iris: scissor count fixes
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 20 Jun 2018 23:07:05 +0000 (16:07 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_state.c

index 7059036a18a83e2e285e218e3764da1be1eccf95..14620b3be2a5a487d0067722f69edede1fea026e 100644 (file)
@@ -246,8 +246,7 @@ struct iris_context {
 
    struct {
       uint64_t dirty;
-      unsigned num_viewports; // XXX: can viewports + scissors be different?
-      unsigned num_scissors;
+      unsigned num_viewports;
       unsigned sample_mask;
       struct iris_blend_state *cso_blend;
       struct iris_rasterizer_state *cso_rast;
index e3f8cf4508b4a8b5c241f09c2f02f5b2dfa52ca9..8fd0ad83b94002df7eadda80dc755fd1ce44e1bc 100644 (file)
@@ -1113,8 +1113,6 @@ iris_set_scissor_states(struct pipe_context *ctx,
 {
    struct iris_context *ice = (struct iris_context *) ctx;
 
-   ice->state.num_scissors = num_scissors;
-
    for (unsigned i = 0; i < num_scissors; i++) {
       ice->state.scissors[start_slot + i] = states[i];
    }
@@ -2722,13 +2720,12 @@ iris_upload_render_state(struct iris_context *ice,
    }
 
    if (dirty & IRIS_DIRTY_SCISSOR_RECT) {
-      // XXX: allocate at set_scissor time?
-      uint32_t scissor_offset = ice->state.num_scissors == 0 ? 0 :
+      uint32_t scissor_offset =
          emit_state(batch, ice->state.dynamic_uploader,
                     &ice->state.last_res.scissor,
                     ice->state.scissors,
                     sizeof(struct pipe_scissor_state) *
-                    ice->state.num_scissors, 32);
+                    ice->state.num_viewports, 32);
 
       iris_emit_cmd(batch, GENX(3DSTATE_SCISSOR_STATE_POINTERS), ptr) {
          ptr.ScissorRectPointer = scissor_offset;