summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-03-22 11:18:36 -0400
committerMarge Bot <eric+marge@anholt.net>2021-03-30 15:12:59 +0000
commit95af27f03243ec21480867b80a0343f19d26e20b (patch)
tree9ef717fa2360b12d9bd1393b033e0688a839340d
parent3a344174dc5b532955045ba76a19cdb5c443f402 (diff)
zink: make a local screen pointer in zink_flush
no functional changes Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9885>
-rw-r--r--src/gallium/drivers/zink/zink_context.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 33b7c0ff521..4b2c355c6f0 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1854,6 +1854,7 @@ zink_flush(struct pipe_context *pctx,
bool deferred = flags & PIPE_FLUSH_DEFERRED;
struct zink_batch *batch = &ctx->batch;
struct zink_fence *fence = &batch->state->fence;
+ struct zink_screen *screen = zink_screen(ctx->base.screen);
if (!deferred && ctx->clears_enabled) {
/* start rp to do all the clears */
@@ -1870,7 +1871,7 @@ zink_flush(struct pipe_context *pctx,
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);
- if (zink_screen(pctx->screen)->needs_mesa_flush_wsi && ctx->fb_state.cbufs[0])
+ if (screen->needs_mesa_flush_wsi && ctx->fb_state.cbufs[0])
batch->state->flush_res = zink_resource(ctx->fb_state.cbufs[0]->texture);
}
flush_batch(ctx);
@@ -1881,7 +1882,7 @@ zink_flush(struct pipe_context *pctx,
if (deferred && !batch->has_work) {
fence = ctx->last_fence;
}
- zink_fence_reference(zink_screen(pctx->screen),
+ zink_fence_reference(screen,
(struct zink_fence **)pfence,
fence);
if (flags & PIPE_FLUSH_END_OF_FRAME) {
@@ -1890,7 +1891,7 @@ zink_flush(struct pipe_context *pctx,
* unknown at this time why this is the case
*/
if (!ctx->first_frame_done)
- zink_vkfence_wait(zink_screen(pctx->screen), fence, PIPE_TIMEOUT_INFINITE);
+ zink_vkfence_wait(screen, fence, PIPE_TIMEOUT_INFINITE);
ctx->first_frame_done = true;
}
}