zink: set VK_IMAGE_LAYOUT_PRESENT_SRC_KHR on fb resources at eof flush

this should maybe fix garbled images on amd?

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9243>
This commit is contained in:
Mike Blumenkrantz
2020-10-08 15:19:02 -04:00
parent 55f05638f5
commit 22fc869187
+8
View File
@@ -1361,6 +1361,14 @@ zink_flush(struct pipe_context *pctx,
if (deferred)
batch->fence->deferred_ctx = pctx;
else if (batch->has_work) {
if (flags & PIPE_FLUSH_END_OF_FRAME) {
if (ctx->fb_state.nr_cbufs)
zink_end_render_pass(ctx, batch);
for (int i = 0; i < ctx->fb_state.nr_cbufs; i++)
zink_resource_image_barrier(ctx, batch,
ctx->fb_state.cbufs[i] ? zink_resource(ctx->fb_state.cbufs[i]->texture) : NULL,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, 0);
}
flush_batch(ctx);
if (zink_screen(pctx->screen)->info.have_EXT_transform_feedback && ctx->num_so_targets)