summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-06-20 15:57:46 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:07 -0800
commit4a94628513e490c3f74cb475c8b5612b04807f95 (patch)
tree0bec30cd89aa10e9c721e2a8db175afd809499a8 /src/gallium
parentb17215800cdcc707a59e8889dee919f92498d242 (diff)
iris: fix num viewports to be based on programs
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_program.c13
-rw-r--r--src/gallium/drivers/iris/iris_state.c7
2 files changed, 13 insertions, 7 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 669754e8aaf..136b1c388df 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -443,6 +443,19 @@ update_last_vue_map(struct iris_context *ice)
prog_data = ice->shaders.prog[MESA_SHADER_VERTEX]->prog_data;
struct brw_vue_prog_data *vue_prog_data = (void *) prog_data;
+ struct brw_vue_map *vue_map = &vue_prog_data->vue_map;
+ struct brw_vue_map *old_map = ice->shaders.last_vue_map;
+ const uint64_t changed_slots =
+ (old_map ? old_map->slots_valid : 0ull) ^ vue_map->slots_valid;
+
+ if (changed_slots & VARYING_BIT_VIEWPORT) {
+ // XXX: could use ctx->Const.MaxViewports for old API efficiency
+ ice->state.num_viewports =
+ (vue_map->slots_valid & VARYING_BIT_VIEWPORT) ? IRIS_MAX_VIEWPORTS : 1;
+ ice->state.dirty |= IRIS_DIRTY_CLIP | IRIS_DIRTY_SF_CL_VIEWPORT;
+ // XXX: CC_VIEWPORT?
+ }
+
ice->shaders.last_vue_map = &vue_prog_data->vue_map;
}
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 794e46fc805..7e791c68120 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1259,13 +1259,6 @@ iris_set_viewport_states(struct pipe_context *ctx,
vp_map += GENX(SF_CLIP_VIEWPORT_length);
}
- unsigned num_viewports = start_slot + count;
-
- if (num_viewports != ice->state.num_viewports) {
- ice->state.num_viewports = num_viewports;
- ice->state.dirty |= IRIS_DIRTY_CLIP;
- }
-
ice->state.dirty |= IRIS_DIRTY_SF_CL_VIEWPORT;
}