SPV: Certain decorations are missing for structure-typed in/out variables.
authorRex Xu <rex.xu@amd.com>
Wed, 29 Jun 2016 07:03:44 +0000 (15:03 +0800)
committerRex Xu <rex.xu@amd.com>
Thu, 30 Jun 2016 05:11:36 +0000 (13:11 +0800)
SPIRV/GlslangToSpv.cpp
Test/baseResults/spv.430.vert.out
Test/baseResults/spv.layoutNested.vert.out
Test/baseResults/spv.localAggregates.frag.out
Test/baseResults/spv.variableArrayIndex.frag.out

index ceea1e2..7f12090 100755 (executable)
@@ -4024,7 +4024,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
     id = createSpvVariable(symbol);
     symbolValues[symbol->getId()] = id;
 
-    if (! symbol->getType().isStruct()) {
+    if (symbol->getBasicType() != glslang::EbtBlock) {
         addDecoration(id, TranslatePrecisionDecoration(symbol->getType()));
         addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier()));
         addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier()));
index 07dc1a7..5274913 100755 (executable)
@@ -63,6 +63,7 @@ Linked vertex stage:
                               Decorate 55(sampb2) Binding 5
                               Decorate 56(sampb4) DescriptorSet 0
                               Decorate 56(sampb4) Binding 31
+                              Decorate 62(var) Flat
                               Decorate 62(var) Location 0
                               MemberDecorate 63(MS) 0 Location 17
                               Decorate 63(MS) Block
index 2d6f559..d778fbb 100644 (file)
@@ -162,6 +162,7 @@ Linked vertex stage:
                               Decorate 58(bBt3) BufferBlock
                               Decorate 60(bBtn3) DescriptorSet 1
                               Decorate 60(bBtn3) Binding 0
+                              Decorate 62(sout) Flat
                               MemberDecorate 63(S) 0 Invariant
                               MemberDecorate 63(S) 1 Invariant
                               MemberDecorate 63(S) 2 Invariant
index 2d464de..21c389a 100755 (executable)
@@ -44,8 +44,11 @@ Linked fragment stage:
                               Name 128  "samp2D"
                               Name 134  "foo"
                               Name 135  "foo2"
+                              Decorate 15(foo3) Flat
                               Decorate 90(condition) Flat
                               Decorate 128(samp2D) DescriptorSet 0
+                              Decorate 134(foo) Flat
+                              Decorate 135(foo2) Flat
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 1
index b84b5ba..1f8ee96 100755 (executable)
@@ -39,6 +39,9 @@ Linked fragment stage:
                               Name 63  "coord"
                               Name 69  "constructed"
                               Decorate 10(Count) Flat
+                              Decorate 20(foo3) Flat
+                              Decorate 34(foo2) Flat
+                              Decorate 36(foo) Flat
                               Decorate 59(samp2D) DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2