diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2019-01-23 01:55:45 -0800 |
---|---|---|
committer | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2019-02-26 16:50:07 +0100 |
commit | bb3fdedadfe71f5f865e2e5b9b81bb77790a498f (patch) | |
tree | f5b56782fa5702ffb0a98b27e58d37eaf8e34055 /src/compiler/glsl | |
parent | c0509143abeb8b1a46c9ad8c899bd3028319a60c (diff) | |
download | mesa-bb3fdedadfe71f5f865e2e5b9b81bb77790a498f.tar.gz mesa-bb3fdedadfe71f5f865e2e5b9b81bb77790a498f.tar.bz2 mesa-bb3fdedadfe71f5f865e2e5b9b81bb77790a498f.zip |
compiler: Mark clip/cull distance arrays as compact before lowering.
nir_lower_clip_cull_distance_arrays() marks the combined clip/cull
distance array as compact. However, when translating in from GLSL
or SPIR-V, we were not marking the original float[] arrays as compact.
We should do so. That way, we can detect these corner cases properly.
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit ef99f4c8d176f4e854e12afa1545fa53f651d758)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index d2db0f95aca..47fc2fea160 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -353,6 +353,12 @@ nir_visitor::visit(ir_variable *ir) ir->data.location == VARYING_SLOT_TESS_LEVEL_OUTER)) { var->data.compact = ir->type->without_array()->is_scalar(); } + + if (shader->info.stage > MESA_SHADER_VERTEX && + ir->data.location >= VARYING_SLOT_CLIP_DIST0 && + ir->data.location <= VARYING_SLOT_CULL_DIST1) { + var->data.compact = ir->type->without_array()->is_scalar(); + } } break; @@ -363,6 +369,12 @@ nir_visitor::visit(ir_variable *ir) ir->data.location == VARYING_SLOT_TESS_LEVEL_OUTER)) { var->data.compact = ir->type->without_array()->is_scalar(); } + + if (shader->info.stage <= MESA_SHADER_GEOMETRY && + ir->data.location >= VARYING_SLOT_CLIP_DIST0 && + ir->data.location <= VARYING_SLOT_CULL_DIST1) { + var->data.compact = ir->type->without_array()->is_scalar(); + } break; case ir_var_uniform: |