diff options
author | Jason Ekstrand <[email protected]> | 2015-09-10 16:53:08 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-21 09:49:40 -0700 |
commit | d513388c8aa1ef4edb937e97a75b953f1abe16f3 (patch) | |
tree | b1cb699a165a015c5ce150652c9a8f451d387cff /src/glsl/nir/nir_lower_system_values.c | |
parent | de7ffdb38343b7f9292184ca827987de9852c80c (diff) |
nir: Move system value -> intrinsic mapping into nir.c
This way they're right next to the map going the other direction.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_lower_system_values.c')
-rw-r--r-- | src/glsl/nir/nir_lower_system_values.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c index a656b27a72a..06ee3e68c8d 100644 --- a/src/glsl/nir/nir_lower_system_values.c +++ b/src/glsl/nir/nir_lower_system_values.c @@ -40,46 +40,7 @@ convert_instr(nir_intrinsic_instr *instr) void *mem_ctx = ralloc_parent(instr); - nir_intrinsic_op op; - - switch (var->data.location) { - case SYSTEM_VALUE_FRONT_FACE: - op = nir_intrinsic_load_front_face; - break; - case SYSTEM_VALUE_VERTEX_ID: - op = nir_intrinsic_load_vertex_id; - break; - case SYSTEM_VALUE_VERTEX_ID_ZERO_BASE: - op = nir_intrinsic_load_vertex_id_zero_base; - break; - case SYSTEM_VALUE_BASE_VERTEX: - op = nir_intrinsic_load_base_vertex; - break; - case SYSTEM_VALUE_INSTANCE_ID: - op = nir_intrinsic_load_instance_id; - break; - case SYSTEM_VALUE_SAMPLE_ID: - op = nir_intrinsic_load_sample_id; - break; - case SYSTEM_VALUE_SAMPLE_POS: - op = nir_intrinsic_load_sample_pos; - break; - case SYSTEM_VALUE_SAMPLE_MASK_IN: - op = nir_intrinsic_load_sample_mask_in; - break; - case SYSTEM_VALUE_INVOCATION_ID: - op = nir_intrinsic_load_invocation_id; - break; - case SYSTEM_VALUE_LOCAL_INVOCATION_ID: - op = nir_intrinsic_load_local_invocation_id; - break; - case SYSTEM_VALUE_WORK_GROUP_ID: - op = nir_intrinsic_load_work_group_id; - break; - default: - unreachable("not reached"); - } - + nir_intrinsic_op op = nir_intrinsic_from_system_value(var->data.location); nir_intrinsic_instr *new_instr = nir_intrinsic_instr_create(mem_ctx, op); if (instr->dest.is_ssa) { |