zink: use correct value for color buffer sample count when creating renderpass
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sun, 14 Jun 2020 04:31:37 +0000 (00:31 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 24 Sep 2020 20:31:37 +0000 (20:31 +0000)
nr_samples is valid on the texture pipe_resource, not the surface

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6263>

src/gallium/drivers/zink/zink_context.c

index 7d397a1..3f7d4ab 100644 (file)
@@ -444,7 +444,7 @@ get_render_pass(struct zink_context *ctx)
       struct pipe_surface *surf = fb->cbufs[i];
       if (surf) {
          state.rts[i].format = zink_get_format(screen, surf->format);
-         state.rts[i].samples = surf->nr_samples > 0 ? surf->nr_samples :
+         state.rts[i].samples = surf->texture->nr_samples > 0 ? surf->texture->nr_samples :
                                                        VK_SAMPLE_COUNT_1_BIT;
       } else {
          state.rts[i].format = VK_FORMAT_R8_UINT;