Add locations to opaque types for OpenGL

This commit is contained in:
Neil Roberts 2018-03-19 20:05:40 +01:00
parent 95b1334aa2
commit 1fe4a44759
3 changed files with 4 additions and 1 deletions

View File

@ -94,6 +94,7 @@ void main()
MemberDecorate 54(ubuf) 0 Offset 0
Decorate 54(ubuf) Block
Decorate 56 DescriptorSet 3
Decorate 69(s2d) Location 0
Decorate 69(s2d) DescriptorSet 3
3: TypeVoid
4: TypeFunction 3

View File

@ -97,6 +97,7 @@ void main()
Decorate 54(ubuf) Block
Decorate 56 DescriptorSet 3
Decorate 56 Binding 0
Decorate 69(s2d) Location 0
Decorate 69(s2d) DescriptorSet 3
Decorate 69(s2d) Binding 1
3: TypeVoid

View File

@ -431,7 +431,8 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
// no locations added if already present, a built-in variable, a block, or an opaque
if (type.getQualifier().hasLocation() || type.isBuiltIn() ||
type.getBasicType() == EbtBlock || type.containsOpaque())
type.getBasicType() == EbtBlock ||
(type.containsOpaque() && intermediate.getSpv().openGl == 0))
return -1;
// no locations on blocks of built-in variables