summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_lower_io.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-12-04 12:16:06 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:03 -0800
commit45bdcc257eaf538fe9ac1588c15f8bea13c8e717 (patch)
treee2325727cb3e6a09ae1449120a7eb83ae356cf95 /src/glsl/nir/nir_lower_io.c
parente3fa49c9e6a38510fea4b65328d58e8a53859440 (diff)
nir: Add gpu_shader5 interpolation intrinsics
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_lower_io.c')
-rw-r--r--src/glsl/nir/nir_lower_io.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 6a043fdedd1..9fc11b3ca8c 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -208,25 +208,21 @@ nir_lower_io_block(nir_block *block, void *void_state)
bool has_indirect = deref_has_indirect(intrin->variables[0]);
+ /* Figure out the opcode */
nir_intrinsic_op load_op;
switch (mode) {
case nir_var_shader_in:
- if (has_indirect) {
- load_op = nir_intrinsic_load_input_indirect;
- } else {
- load_op = nir_intrinsic_load_input;
- }
+ load_op = has_indirect ? nir_intrinsic_load_input_indirect :
+ nir_intrinsic_load_input;
break;
case nir_var_uniform:
- if (has_indirect) {
- load_op = nir_intrinsic_load_uniform_indirect;
- } else {
- load_op = nir_intrinsic_load_uniform;
- }
+ load_op = has_indirect ? nir_intrinsic_load_uniform_indirect :
+ nir_intrinsic_load_uniform;
break;
default:
unreachable("Unknown variable mode");
}
+
nir_intrinsic_instr *load = nir_intrinsic_instr_create(state->mem_ctx,
load_op);
load->num_components = intrin->num_components;