summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-03-21 20:37:12 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-03-22 13:50:39 -0700
commite5830e11322bc20cbae7cad9e0654376d41f2c19 (patch)
treeb988bc597a87cd4aa90ac426fd95f053241a2abb /src/compiler
parentcdd90a7502e501b0f25d35a2e9715fbe5d09a211 (diff)
nir: Handle array-deref-of-vector case in loop analysis
SPIR-V can produce those for SSBO and UBO access. Found when testing the ARB_gl_spirv series. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_loop_analyze.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index cb71a55f2f1..781dac27bb7 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -480,9 +480,12 @@ find_array_access_via_induction(loop_info_state *state,
*array_index_out = array_index;
nir_deref_instr *parent = nir_deref_instr_parent(d);
- assert(glsl_type_is_array_or_matrix(parent->type));
-
- return glsl_get_length(parent->type);
+ if (glsl_type_is_array_or_matrix(parent->type)) {
+ return glsl_get_length(parent->type);
+ } else {
+ assert(glsl_type_is_vector(parent->type));
+ return glsl_get_vector_elements(parent->type);
+ }
}
return 0;