zink: do not dig into resource for nr_samples
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 20 May 2020 12:48:02 +0000 (14:48 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 25 May 2020 20:20:49 +0000 (20:20 +0000)
The pipe_surface also know this, so no point in digging so deep.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5141>

src/gallium/drivers/zink/zink_context.c

index c5137b1dec8206b5f532b768a3e5fcc0f92b9cdd..a30f1fa6946f68fe8be66d317b83a7eba46cf594 100644 (file)
@@ -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;