diff options
author | Jason Ekstrand <[email protected]> | 2015-08-18 11:18:55 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-08-25 10:18:27 -0700 |
commit | 0db8e87b4a16b123f7c0b44d54f23b535a136ee6 (patch) | |
tree | 549ef9e86b96aa7e2b66888d25d10f599487e9cd /src/mesa/drivers | |
parent | 6c33d6bbf9b54784e4498a81c73b712dca5dd737 (diff) |
nir/intrinsics: Add a second const index to load_uniform
In the i965 backend, we want to be able to "pull apart" the uniforms and
push some of them into the shader through a different path. In order to do
this effectively, we need to know which variable is actually being referred
to by a given uniform load. Previously, it was completely flattened by
nir_lower_io which made things difficult. This adds more information to
the intrinsic to make this easier for us.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index b32f8a75e73..ad51d80fd09 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -1504,7 +1504,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr has_indirect = true; /* fallthrough */ case nir_intrinsic_load_uniform: { - unsigned index = instr->const_index[0]; + unsigned index = instr->const_index[0] + instr->const_index[1]; fs_reg uniform_reg; if (index < num_direct_uniforms) { diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp index 4f689dff1ba..9e52229190e 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp @@ -570,7 +570,7 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr) has_indirect = true; /* fallthrough */ case nir_intrinsic_load_uniform: { - int uniform = instr->const_index[0]; + int uniform = instr->const_index[0] + instr->const_index[1]; dest = get_nir_dest(instr->dest); |