diff options
author | Timothy Arceri <[email protected]> | 2015-07-05 15:18:10 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2015-10-15 20:35:35 +1100 |
commit | db280e951a1bcb2318240cb6db296b31abac37cd (patch) | |
tree | 557ee4ef02c350a488e8060c83f6f8ce6c670583 /src/glsl/opt_dead_functions.cpp | |
parent | ff31c243e38332999b617d479a0dca61b15bc1c6 (diff) |
glsl: Add support for linking uniform arrays of arrays
V3: Fix setting of data.location for struct AoA UBO members
V2: Handle arrays of arrays in the same way structures are handled
The ARB_arrays_of_arrays spec doesn't give very many details on how
AoA uniforms are intended to be implemented. However in the
ARB_program_interface_query spec there are details that show AoA are
intended to be handled in a similar way to structs.
Issues 7 from the ARB_program_interface_query spec:
We define rules consistent with our enumeration rules for
other complex types. For existing one-dimensional arrays, we enumerate
a single entry if the array is an array of basic types, or separate
entries for each array element if the array is an array of structures.
We follow similar rules here. For a uniform array such as:
uniform vec4 a[5][4][3];
we enumerate twenty different entries ("a[0][0][0]" through
"a[4][3][0]"), each of which is treated as an array with three elements.
This is morally equivalent to what you'd get if you worked around the
limitation in current GLSL via:
struct ArrayBottom { vec4 c[3]; };
struct ArrayMid { ArrayBottom b[3]; };
uniform ArrayMid a[5];
which would enumerate "a[0].b[0].c[0]" through "a[4].b[3].c[0]".
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/opt_dead_functions.cpp')
0 files changed, 0 insertions, 0 deletions