aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-05-28 21:56:04 -0500
committerJason Ekstrand <[email protected]>2019-05-29 21:09:16 +0000
commit9dc57eebd578b976b94c54d083377ba0920d43a8 (patch)
tree46a13f227b9b06aaef9ec0ff7afdadadfae5d9df /src/gallium/drivers
parent744f93f5c1e0d1e000e44f61e721c2d5fb545025 (diff)
iris: Don't assume UBO indices are constant
It will be true for the constant/system value buffer because they use a constant zero but it's not true in general. If we ever got here when the source wasn't constant, nir_src_as_uint would assert. Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/iris/iris_program.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c
index 37cf123ae6b..e0a6a5c1edd 100644
--- a/src/gallium/drivers/iris/iris_program.c
+++ b/src/gallium/drivers/iris/iris_program.c
@@ -491,7 +491,8 @@ iris_setup_uniforms(const struct brw_compiler *compiler,
if (load->src[0].ssa == temp_ubo_name) {
nir_instr_rewrite_src(instr, &load->src[0],
nir_src_for_ssa(nir_imm_int(&b, 0)));
- } else if (nir_src_as_uint(load->src[0]) == 0) {
+ } else if (nir_src_is_const(load->src[0]) &&
+ nir_src_as_uint(load->src[0]) == 0) {
nir_ssa_def *offset =
nir_iadd(&b, load->src[1].ssa,
nir_imm_int(&b, 4 * num_system_values));