diff options
author | Jason Ekstrand <[email protected]> | 2018-10-20 09:10:02 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-10-22 14:24:15 -0500 |
commit | 16870de8a0aab97bd3534b660e7ea73e90ac11cd (patch) | |
tree | 6a2b213cc8f477bdb923b9aceb430715724cb7a1 /src/compiler/glsl | |
parent | ce36f412c99340814c429f99694423af61825c64 (diff) |
nir: Use nir_src_is_const and nir_src_as_* in core code
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/gl_nir_lower_samplers.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/compiler/glsl/gl_nir_lower_samplers.c b/src/compiler/glsl/gl_nir_lower_samplers.c index 593967b7108..1ee075cfd14 100644 --- a/src/compiler/glsl/gl_nir_lower_samplers.c +++ b/src/compiler/glsl/gl_nir_lower_samplers.c @@ -57,12 +57,9 @@ lower_tex_src_to_offset(nir_builder *b, break; case nir_deref_type_array: { - nir_const_value *const_deref_index = - nir_src_as_const_value(deref->arr.index); - - if (const_deref_index && index == NULL) { + if (nir_src_is_const(deref->arr.index) && index == NULL) { /* We're still building a direct index */ - base_index += const_deref_index->u32[0] * array_elements; + base_index += nir_src_as_uint(deref->arr.index) * array_elements; } else { if (index == NULL) { /* We used to be direct but not anymore */ |