diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2023-01-24 16:56:48 -0500 |
---|---|---|
committer | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2023-01-25 15:04:12 -0500 |
commit | 23d3783f587f39f4b2e5a5535a9105a388ace2cf (patch) | |
tree | 69aa18cfc636166be5f8ba0da6a7fe5a1d48fcc2 /src/gallium | |
parent | 1b52e85ead1f6ed312049e931171796d448b186c (diff) |
zink: force GENERAL layout for all fb attachments with image binds
this is incredibly stupid, but KHR-GL46.texture_view.coherency does all
kinds of rasterization discard draws with fb attachments bound as images,
and there's no other sane way to catch it dynamically
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 9bbb70c0613..ebd409e6d4f 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2693,8 +2693,15 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns layout = zink_render_pass_attachment_get_barrier_info(&rt, i < ctx->fb_state.nr_cbufs, &pipeline, &access); } } - if (!zink_screen(ctx->base.screen)->info.have_EXT_attachment_feedback_loop_layout && - layout == VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT) + /* + The image subresources for a storage image must be in the VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR or + VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a shader. + - 14.1.1. Storage Image + */ + if (res->image_bind_count[0]) + layout = VK_IMAGE_LAYOUT_GENERAL; + else if (!zink_screen(ctx->base.screen)->info.have_EXT_attachment_feedback_loop_layout && + layout == VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT) layout = VK_IMAGE_LAYOUT_GENERAL; zink_screen(ctx->base.screen)->image_barrier(ctx, res, layout, access, pipeline); res->obj->unordered_read = res->obj->unordered_write = false; |