Include array index in reflected uniform names more consistently
* This comes from the resolution of issues 4, 5 & 6 in ARB_program_interface_query, stating that uniform buffers should have their members expanded out as normal and arrays should have elements added. * If a buffer block has a large array e.g. [10000] we don't want to iterate over every array element. Instead we should only expand out the first [0] element, then expand as normal from there. * The array name should still be appended with [0] to indicate that it's an array.
This commit is contained in:
parent
6d47785825
commit
15c37f79a9
8 changed files with 124 additions and 3 deletions
23
Test/reflection.options.vert
Normal file
23
Test/reflection.options.vert
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#version 440 core
|
||||
|
||||
struct VertexInfo {
|
||||
float position[3];
|
||||
float normal[3];
|
||||
};
|
||||
|
||||
struct TriangleInfo {
|
||||
VertexInfo v[3];
|
||||
};
|
||||
|
||||
buffer VertexCollection {
|
||||
TriangleInfo t[5];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
float f;
|
||||
f += t[0].v[0].position[0];
|
||||
f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID];
|
||||
f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID];
|
||||
TriangleInfo tlocal[5] = t;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue