From 43c691b5b0f1cfba9292b316f846ad932646f0e4 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 20 May 2020 14:48:02 +0200 Subject: [PATCH] zink: do not dig into resource for nr_samples The pipe_surface also know this, so no point in digging so deep. Reviewed-by: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index c5137b1dec8..a30f1fa6946 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -487,10 +487,10 @@ get_render_pass(struct zink_context *ctx) struct zink_render_pass_state state = { 0 }; for (int i = 0; i < fb->nr_cbufs; i++) { - struct pipe_resource *res = fb->cbufs[i]->texture; - state.rts[i].format = zink_get_format(screen, fb->cbufs[i]->format); - state.rts[i].samples = res->nr_samples > 0 ? res->nr_samples : - VK_SAMPLE_COUNT_1_BIT; + struct pipe_surface *surf = fb->cbufs[i]; + state.rts[i].format = zink_get_format(screen, surf->format); + state.rts[i].samples = surf->nr_samples > 0 ? surf->nr_samples : + VK_SAMPLE_COUNT_1_BIT; } state.num_cbufs = fb->nr_cbufs; -- 2.30.2