diff options
author | Dave Airlie <[email protected]> | 2016-05-20 10:19:14 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-05-24 11:27:29 +1000 |
commit | 8c628ab13e4fa86ee662dcddb0f5a89b2d30e1a4 (patch) | |
tree | c7a3ca763ab93784e855bcdef773ea9c75e6bfeb /src/compiler/glsl/link_interface_blocks.cpp | |
parent | 2ae493d68647af26c64ae59f0127349d75817b91 (diff) |
glsl: make max array trackers ints and use -1 as base. (v2)
This fixes a bug that breaks cull distances. The problem
is the max array accessors can't tell the difference between
an never accessed unsized array and an accessed at location 0
unsized array. This leads to converting an undeclared unused
gl_ClipDistance inside or outside gl_PerVertex to a size 1
array. However we need to the number of active clip distances
to work out the starting point for the cull distances, and
this offset by one when it's not being used isn't possible
to distinguish from the case were only the first element is
accessed. I tried to use ->used for this, but that doesn't
work when gl_ClipDistance is part of an interface block.
So this changes things so that max_array_access is an int
and initialised to -1. This also allows unsized arrays to
proceed further than that could before, but we really shouldn't
mind as they will get eliminated if nothing uses them later.
For initialised uniforms we no longer change their array
size at runtime, if these are unused they will get eliminated
eventually.
v2: use ralloc_array (Ilia)
Reviewed-by: Ilia Mirkin <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_interface_blocks.cpp')
-rw-r--r-- | src/compiler/glsl/link_interface_blocks.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/compiler/glsl/link_interface_blocks.cpp b/src/compiler/glsl/link_interface_blocks.cpp index 26072591b0e..4eda09774ef 100644 --- a/src/compiler/glsl/link_interface_blocks.cpp +++ b/src/compiler/glsl/link_interface_blocks.cpp @@ -154,12 +154,6 @@ static bool interstage_match(struct gl_shader_program *prog, ir_variable *producer, ir_variable *consumer, bool extra_array_level) { - /* Unsized arrays should not occur during interstage linking. They - * should have all been assigned a size by link_intrastage_shaders. - */ - assert(!consumer->type->is_unsized_array()); - assert(!producer->type->is_unsized_array()); - /* Types must match. */ if (consumer->get_interface_type() != producer->get_interface_type()) { /* Exception: if both the interface blocks are implicitly declared, |