only certain drivers can successfully run an xserver with implicit modifier
handling, and the rest will have broken rendering
until such time that a vk extension emerges to handle this more widely,
break this interop for drivers where it's already broken
fixes #9819
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25299>
int modifier_count = 1;
if (whandle->modifier != DRM_FORMAT_MOD_INVALID)
modifier = whandle->modifier;
- else
+ else {
+ if (!zink_screen(pscreen)->driver_workarounds.can_do_invalid_linear_modifier) {
+ mesa_loge("zink: display server doesn't support DRI3 modifiers and driver can't handle INVALID<->LINEAR!");
+ return NULL;
+ }
whandle->modifier = modifier;
+ }
templ2.bind |= ZINK_BIND_DMABUF;
struct pipe_resource *pres = resource_create(pscreen, &templ2, whandle, usage, &modifier, modifier_count, NULL, NULL);
if (pres) {
break;
}
+ /* these drivers can successfully do INVALID <-> LINEAR dri3 modifier swap */
+ switch (screen->info.driver_props.driverID) {
+ case VK_DRIVER_ID_MESA_TURNIP:
+ screen->driver_workarounds.can_do_invalid_linear_modifier = true;
+ break;
+ default:
+ break;
+ }
+
/* these drivers have no difference between unoptimized and optimized shader compilation */
switch (screen->info.driver_props.driverID) {
case VK_DRIVER_ID_MESA_LLVMPIPE:
bool no_hw_gl_point;
bool lower_robustImageAccess2;
bool needs_zs_shader_swizzle;
+ bool can_do_invalid_linear_modifier;
unsigned z16_unscaled_bias;
unsigned z24_unscaled_bias;
} driver_workarounds;