From 1fe4a44759903aeb4a4e4cfc94c3e82961714e76 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 19 Mar 2018 20:05:40 +0100 Subject: [PATCH] Add locations to opaque types for OpenGL --- Test/baseResults/spv.debugInfo.1.1.frag.out | 1 + Test/baseResults/spv.debugInfo.frag.out | 1 + glslang/MachineIndependent/iomapper.cpp | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Test/baseResults/spv.debugInfo.1.1.frag.out b/Test/baseResults/spv.debugInfo.1.1.frag.out index b7303762..9bd14910 100644 --- a/Test/baseResults/spv.debugInfo.1.1.frag.out +++ b/Test/baseResults/spv.debugInfo.1.1.frag.out @@ -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 diff --git a/Test/baseResults/spv.debugInfo.frag.out b/Test/baseResults/spv.debugInfo.frag.out index de544151..0bb266bd 100644 --- a/Test/baseResults/spv.debugInfo.frag.out +++ b/Test/baseResults/spv.debugInfo.frag.out @@ -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 diff --git a/glslang/MachineIndependent/iomapper.cpp b/glslang/MachineIndependent/iomapper.cpp index a7deb9d5..619d9187 100644 --- a/glslang/MachineIndependent/iomapper.cpp +++ b/glslang/MachineIndependent/iomapper.cpp @@ -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