summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/lower_shared_reference.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-08-31 18:09:27 -0700
committerIan Romanick <[email protected]>2016-10-04 16:53:31 -0700
commitb7df52b106416c410d0e14dc6bba091831f9c786 (patch)
tree21f6c1e646af6b4ef690dc883259909f1f0dbde4 /src/compiler/glsl/lower_shared_reference.cpp
parent5854de99b2735988f1fd7c08f367b4a8e58b270e (diff)
glsl: Use the ir_intrinsic_* enums instead of the __intrinsic_* name strings
text data bss dec hex filename 6038043 283160 28608 6349811 60e3f3 lib64/i965_dri.so before 6036507 283160 28608 6348275 60ddf3 lib64/i965_dri.so after v2: s/ir_intrinsic_atomic_sub/ir_intrinsic_atomic_counter_sub/. Noticed by Ilia. v3: Silence unhandled enum in switch warnings in st_glsl_to_tgsi. Signed-off-by: Ian Romanick <[email protected]> Acked-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/compiler/glsl/lower_shared_reference.cpp')
-rw-r--r--src/compiler/glsl/lower_shared_reference.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/glsl/lower_shared_reference.cpp b/src/compiler/glsl/lower_shared_reference.cpp
index 49ee3774c68..a7e738e8fc4 100644
--- a/src/compiler/glsl/lower_shared_reference.cpp
+++ b/src/compiler/glsl/lower_shared_reference.cpp
@@ -450,15 +450,15 @@ lower_shared_reference_visitor::check_for_shared_atomic_intrinsic(ir_call *ir)
if (!var || var->data.mode != ir_var_shader_shared)
return ir;
- const char *callee = ir->callee_name();
- if (!strcmp("__intrinsic_atomic_add", callee) ||
- !strcmp("__intrinsic_atomic_min", callee) ||
- !strcmp("__intrinsic_atomic_max", callee) ||
- !strcmp("__intrinsic_atomic_and", callee) ||
- !strcmp("__intrinsic_atomic_or", callee) ||
- !strcmp("__intrinsic_atomic_xor", callee) ||
- !strcmp("__intrinsic_atomic_exchange", callee) ||
- !strcmp("__intrinsic_atomic_comp_swap", callee)) {
+ const enum ir_intrinsic_id id = ir->callee->intrinsic_id;
+ if (id == ir_intrinsic_generic_atomic_add ||
+ id == ir_intrinsic_generic_atomic_min ||
+ id == ir_intrinsic_generic_atomic_max ||
+ id == ir_intrinsic_generic_atomic_and ||
+ id == ir_intrinsic_generic_atomic_or ||
+ id == ir_intrinsic_generic_atomic_xor ||
+ id == ir_intrinsic_generic_atomic_exchange ||
+ id == ir_intrinsic_generic_atomic_comp_swap) {
return lower_shared_atomic_intrinsic(ir);
}