zink: rendering corruption since adding multi-planar modifiers
@tpalli noticed that pretty much all apps on zink on anv are broken on master. I tested glxgears and bisected it to commit b1a32d14 (zink: implement multiplanar modifier handling). Running INTEL_DEBUG=norbc,nohiz,nofc MESA_LOADER_DRIVER_OVERRIDE=zink glxgears
reproduces the issue easily.
I did some investigating, it appears that the zink_get_resource_param
used to be returning I915_FORMAT_MOD_Y_TILED
when querying for PIPE_RESOURCE_PARAM_MODIFIER
. With that commit, it returns 0
. I believe this is the source of the corruption: it's still a Y-tiled buffer, but no longer has the MOD_Y_TILED
modifier to indicate that.
Reverting this hunk fixes the issue:
@@ -884,16 +909,7 @@ zink_resource_get_param(struct pipe_screen *pscreen, struct pipe_context *pctx,
}
case PIPE_RESOURCE_PARAM_MODIFIER: {
- *value = DRM_FORMAT_MOD_INVALID;
- if (!screen->info.have_EXT_image_drm_format_modifier)
- return false;
- if (!res->modifiers)
- return false;
- VkImageDrmFormatModifierPropertiesEXT prop;
- prop.sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT;
- prop.pNext = NULL;
- if (VKSCR(GetImageDrmFormatModifierPropertiesEXT)(screen->dev, obj->image, &prop) == VK_SUCCESS)
- *value = prop.drmFormatModifier;
+ *value = res->obj->modifier;
break;
}
It would appear that res->obj->modifier
is not being initialized properly on some path.