zink: save original scissor and viewport
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 10 Jul 2019 15:19:39 +0000 (17:19 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:46 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h

index b95a9a139aeaa256fd2d6da911114e365b6d835c..751ceb1322263be51d616d3fa39c5d57041a296f 100644 (file)
@@ -378,6 +378,7 @@ zink_set_viewport_states(struct pipe_context *pctx,
          state[i].translate[2] - state[i].scale[2],
          state[i].translate[2] + state[i].scale[2]
       };
+      ctx->viewport_states[start_slot + i] = state[i];
       ctx->viewports[start_slot + i] = viewport;
    }
    ctx->num_viewports = start_slot + num_viewports;
@@ -397,6 +398,7 @@ zink_set_scissor_states(struct pipe_context *pctx,
       scissor.offset.y = states[i].miny;
       scissor.extent.width = states[i].maxx - states[i].minx;
       scissor.extent.height = states[i].maxy - states[i].miny;
+      ctx->scissor_states[start_slot + i] = states[i];
       ctx->scissors[start_slot + i] = scissor;
    }
    ctx->num_scissors = start_slot + num_scissors;
index d2cc752764ac1a195ada26fc909c70e42c1081ad..445579c59b98c53d5b054c1e104d40674b61ff58 100644 (file)
@@ -87,9 +87,11 @@ struct zink_context {
 
    struct zink_framebuffer *framebuffer;
 
+   struct pipe_viewport_state viewport_states[PIPE_MAX_VIEWPORTS];
    VkViewport viewports[PIPE_MAX_VIEWPORTS];
    unsigned num_viewports;
 
+   struct pipe_scissor_state scissor_states[PIPE_MAX_VIEWPORTS];
    VkRect2D scissors[PIPE_MAX_VIEWPORTS];
    unsigned num_scissors;