diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 3180fbef223..9988b5b3e5b 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3182,6 +3182,10 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns else if (!screen->info.have_EXT_attachment_feedback_loop_layout && layout == VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT) layout = VK_IMAGE_LAYOUT_GENERAL; + /* some drivers don't care about zs layouts for attachments, so this saves some layout transition cycles */ + else if (layout != VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT && + i >= ctx->fb_state.nr_cbufs && screen->driver_workarounds.general_depth_layout) + layout = VK_IMAGE_LAYOUT_GENERAL; if (res->valid || res->layout != layout) screen->image_barrier(ctx, res, layout, access, pipeline); if (!(res->aspect & VK_IMAGE_ASPECT_COLOR_BIT)) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 4780f26cce3..f7498fc34b3 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -3057,6 +3057,16 @@ init_driver_workarounds(struct zink_screen *screen) break; } + switch (zink_driverid(screen)) { + case VK_DRIVER_ID_MESA_RADV: + case VK_DRIVER_ID_MESA_NVK: + case VK_DRIVER_ID_NVIDIA_PROPRIETARY: + screen->driver_workarounds.general_depth_layout = true; + break; + default: + break; + } + if (!screen->resizable_bar) screen->info.have_EXT_host_image_copy = false; } diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 74e93f54c21..0c74d651ee1 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -1549,6 +1549,7 @@ struct zink_screen { bool can_do_invalid_linear_modifier; bool inconsistent_interpolation; bool can_2d_view_sparse; + bool general_depth_layout; unsigned z16_unscaled_bias; unsigned z24_unscaled_bias; } driver_workarounds;