summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir.h
diff options
context:
space:
mode:
authorAndres Gomez <[email protected]>2016-10-18 18:18:21 +0300
committerAndres Gomez <[email protected]>2016-11-25 13:18:30 +0200
commit70456aca8d1934ec53c24cfe1cfb4273d2bc9397 (patch)
treecfc6e17d371f45b571dc4ee2f8ac59d7d01ab82d /src/compiler/glsl/ir.h
parent9f13d0c64bee2935ba41a318196f8851a92ad348 (diff)
glsl: merge layouts into the default one as the last step in interface blocks
Consider this example: " #version 150 core #extension GL_ARB_shading_language_420pack: require #extension GL_ARB_explicit_attrib_location: require layout(location=0) out vec4 o; layout(binding=2) layout(binding=3, std140) uniform U { vec4 a; } u[2];" As there is 2 layout-qualifiers for the uniform U and the binding layout-qualifier-id is duplicated, the rules set by the ARB_shading_language_420pack spec state that the rightmost should prevail. Our ast_type_qualifier merges with others in a way that if the value for a layout-qualifier-id is set in both, the object being merged overwrites the value of the object invoking the merge. Hence, the merge has to happen from the left layout towards the right one and this was not happening for interface blocks because we were merging into the default layout qualifier. Now, the merge is done from left to right and, as a last step, we merge into the default layout qualifier if needed, so the values of the explicit layouts prevail over it. V2: added a default_layout variable instead of a layout_helper and make the merge directly over the layout one. Suggested by Timothy. Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Andres Gomez <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir.h')
0 files changed, 0 insertions, 0 deletions