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/nir/nir_gather_info.c | |
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/nir/nir_gather_info.c')
-rw-r--r-- | src/compiler/nir/nir_gather_info.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 30f0bc721d4..15d38f036b5 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -108,13 +108,11 @@ get_io_offset(nir_deref_instr *deref, bool is_vertex_input) for (nir_deref_instr *d = deref; d; d = nir_deref_instr_parent(d)) { if (d->deref_type == nir_deref_type_array) { - nir_const_value *const_index = nir_src_as_const_value(d->arr.index); - - if (!const_index) + if (!nir_src_is_const(d->arr.index)) return -1; offset += glsl_count_attribute_slots(d->type, is_vertex_input) * - const_index->u32[0]; + nir_src_as_uint(d->arr.index); } /* TODO: we can get the offset for structs here see nir_lower_io() */ } |