Branimir Karadžić 8 лет назад
Родитель
Сommit
a304c982ba

+ 4 - 0
3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -186,7 +186,9 @@ protected:
     bool isTrivialLeaf(const glslang::TIntermTyped* node);
     bool isTrivialLeaf(const glslang::TIntermTyped* node);
     bool isTrivial(const glslang::TIntermTyped* node);
     bool isTrivial(const glslang::TIntermTyped* node);
     spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right);
     spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right);
+#ifdef AMD_EXTENSIONS
     spv::Id getExtBuiltins(const char* name);
     spv::Id getExtBuiltins(const char* name);
+#endif
 
 
     glslang::SpvOptions& options;
     glslang::SpvOptions& options;
     spv::Function* shaderEntry;
     spv::Function* shaderEntry;
@@ -5954,6 +5956,7 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan
     return builder.createOp(spv::OpPhi, boolTypeId, phiOperands);
     return builder.createOp(spv::OpPhi, boolTypeId, phiOperands);
 }
 }
 
 
+#ifdef AMD_EXTENSIONS
 // Return type Id of the imported set of extended instructions corresponds to the name.
 // Return type Id of the imported set of extended instructions corresponds to the name.
 // Import this set if it has not been imported yet.
 // Import this set if it has not been imported yet.
 spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name)
 spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name)
@@ -5967,6 +5970,7 @@ spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name)
         return extBuiltins;
         return extBuiltins;
     }
     }
 }
 }
+#endif
 
 
 };  // end anonymous namespace
 };  // end anonymous namespace
 
 

+ 0 - 5
3rdparty/glslang/Test/baseLegalResults/hlsl.aliasOpaque.frag.out

@@ -11,10 +11,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               ExecutionMode 4 OriginUpperLeft
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 9  "OS"
-                              MemberName 9(OS) 0  "ss"
-                              MemberName 9(OS) 1  "a"
-                              MemberName 9(OS) 2  "tex"
                               Name 47  "gss"
                               Name 47  "gss"
                               Name 51  "gtex"
                               Name 51  "gtex"
                               Name 62  "@entryPointOutput"
                               Name 62  "@entryPointOutput"
@@ -26,7 +22,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                6:             TypeSampler
                6:             TypeSampler
                7:             TypeFloat 32
                7:             TypeFloat 32
                8:             TypeImage 7(float) 2D sampled format:Unknown
                8:             TypeImage 7(float) 2D sampled format:Unknown
-           9(OS):             TypeStruct 6 7(float) 8
               11:             TypeVector 7(float) 4
               11:             TypeVector 7(float) 4
               32:             TypeSampledImage 8
               32:             TypeSampledImage 8
               34:             TypeVector 7(float) 2
               34:             TypeVector 7(float) 2

+ 0 - 7
3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaque.frag.out

@@ -11,11 +11,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               ExecutionMode 4 OriginUpperLeft
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 7  "os"
-                              MemberName 7(os) 0  "s2D"
-                              Name 23  "os2"
-                              MemberName 23(os2) 0  "s2D"
-                              MemberName 23(os2) 1  "tex"
                               Name 38  "tex"
                               Name 38  "tex"
                               Name 82  "s.s2D"
                               Name 82  "s.s2D"
                               Name 97  "s2.s2D"
                               Name 97  "s2.s2D"
@@ -29,12 +24,10 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                2:             TypeVoid
                2:             TypeVoid
                3:             TypeFunction 2
                3:             TypeFunction 2
                6:             TypeSampler
                6:             TypeSampler
-           7(os):             TypeStruct 6
                9:             TypeFloat 32
                9:             TypeFloat 32
               10:             TypeVector 9(float) 4
               10:             TypeVector 9(float) 4
               15:             TypeVector 9(float) 2
               15:             TypeVector 9(float) 2
               22:             TypeImage 9(float) 2D sampled format:Unknown
               22:             TypeImage 9(float) 2D sampled format:Unknown
-         23(os2):             TypeStruct 6 22
               37:             TypePointer UniformConstant 22
               37:             TypePointer UniformConstant 22
          38(tex):     37(ptr) Variable UniformConstant
          38(tex):     37(ptr) Variable UniformConstant
               45:             TypeSampledImage 22
               45:             TypeSampledImage 22

+ 0 - 4
3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out

@@ -10,9 +10,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               EntryPoint Vertex 4  "main" 80
                               EntryPoint Vertex 4  "main" 80
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 9  "FxaaTex"
-                              MemberName 9(FxaaTex) 0  "smpl"
-                              MemberName 9(FxaaTex) 1  "tex"
                               Name 43  "g_tInputTexture_sampler"
                               Name 43  "g_tInputTexture_sampler"
                               Name 47  "g_tInputTexture"
                               Name 47  "g_tInputTexture"
                               Name 80  "@entryPointOutput"
                               Name 80  "@entryPointOutput"
@@ -24,7 +21,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                6:             TypeSampler
                6:             TypeSampler
                7:             TypeFloat 32
                7:             TypeFloat 32
                8:             TypeImage 7(float) 2D sampled format:Unknown
                8:             TypeImage 7(float) 2D sampled format:Unknown
-      9(FxaaTex):             TypeStruct 6 8
               11:             TypeVector 7(float) 4
               11:             TypeVector 7(float) 4
               31:             TypeSampledImage 8
               31:             TypeSampledImage 8
               33:             TypeVector 7(float) 2
               33:             TypeVector 7(float) 2

+ 0 - 5
3rdparty/glslang/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out

@@ -10,10 +10,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               EntryPoint Vertex 4  "main" 57
                               EntryPoint Vertex 4  "main" 57
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 9  "FxaaTex"
-                              MemberName 9(FxaaTex) 0  "smpl"
-                              MemberName 9(FxaaTex) 1  "tex"
-                              MemberName 9(FxaaTex) 2  "f"
                               Name 44  "g_tInputTexture_sampler"
                               Name 44  "g_tInputTexture_sampler"
                               Name 47  "g_tInputTexture"
                               Name 47  "g_tInputTexture"
                               Name 57  "@entryPointOutput"
                               Name 57  "@entryPointOutput"
@@ -25,7 +21,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                6:             TypeSampler
                6:             TypeSampler
                7:             TypeFloat 32
                7:             TypeFloat 32
                8:             TypeImage 7(float) 2D sampled format:Unknown
                8:             TypeImage 7(float) 2D sampled format:Unknown
-      9(FxaaTex):             TypeStruct 6 8 7(float)
               11:             TypeVector 7(float) 4
               11:             TypeVector 7(float) 4
               28:             TypeSampledImage 8
               28:             TypeSampledImage 8
               36:             TypeVector 7(float) 2
               36:             TypeVector 7(float) 2

+ 1 - 21
3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset.frag.out

@@ -2,7 +2,7 @@ hlsl.flattenSubset.frag
 WARNING: AST will form illegal SPIR-V; need to transform to legalize
 WARNING: AST will form illegal SPIR-V; need to transform to legalize
 // Module Version 10000
 // Module Version 10000
 // Generated by (magic number): 80003
 // Generated by (magic number): 80003
-// Id's are bound by 72
+// Id's are bound by 66
 
 
                               Capability Shader
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                1:             ExtInstImport  "GLSL.std.450"
@@ -11,23 +11,7 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               ExecutionMode 4 OriginUpperLeft
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 15  "S0"
-                              MemberName 15(S0) 0  "x"
-                              MemberName 15(S0) 1  "y"
-                              MemberName 15(S0) 2  "ss"
-                              Name 16  "S1"
-                              MemberName 16(S1) 0  "b"
-                              MemberName 16(S1) 1  "samplerState"
-                              MemberName 16(S1) 2  "s0"
-                              MemberName 16(S1) 3  "a"
                               Name 21  "samp"
                               Name 21  "samp"
-                              Name 25  "S2"
-                              MemberName 25(S2) 0  "a1"
-                              MemberName 25(S2) 1  "a2"
-                              MemberName 25(S2) 2  "a3"
-                              MemberName 25(S2) 3  "a4"
-                              MemberName 25(S2) 4  "a5"
-                              MemberName 25(S2) 5  "resources"
                               Name 33  "tex"
                               Name 33  "tex"
                               Name 47  "vpos"
                               Name 47  "vpos"
                               Name 50  "@entryPointOutput"
                               Name 50  "@entryPointOutput"
@@ -40,12 +24,8 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                6:             TypeFloat 32
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
                7:             TypeVector 6(float) 4
               13:             TypeSampler
               13:             TypeSampler
-              14:             TypeInt 32 1
-          15(S0):             TypeStruct 14(int) 14(int) 13
-          16(S1):             TypeStruct 6(float) 13 15(S0) 14(int)
               20:             TypePointer UniformConstant 13
               20:             TypePointer UniformConstant 13
         21(samp):     20(ptr) Variable UniformConstant
         21(samp):     20(ptr) Variable UniformConstant
-          25(S2):             TypeStruct 14(int) 14(int) 14(int) 14(int) 14(int) 16(S1)
               31:             TypeImage 6(float) 2D sampled format:Unknown
               31:             TypeImage 6(float) 2D sampled format:Unknown
               32:             TypePointer UniformConstant 31
               32:             TypePointer UniformConstant 31
          33(tex):     32(ptr) Variable UniformConstant
          33(tex):     32(ptr) Variable UniformConstant

+ 0 - 13
3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out

@@ -11,15 +11,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               ExecutionMode 4 OriginUpperLeft
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 14  "Nested"
-                              MemberName 14(Nested) 0  "y"
-                              MemberName 14(Nested) 1  "texNested"
-                              Name 15  "A"
-                              MemberName 15(A) 0  "n"
-                              MemberName 15(A) 1  "x"
-                              Name 25  "B"
-                              MemberName 25(B) 0  "n"
-                              MemberName 25(B) 1  "tex"
                               Name 49  "vpos"
                               Name 49  "vpos"
                               Name 52  "@entryPointOutput"
                               Name 52  "@entryPointOutput"
                               Decorate 49(vpos) Location 0
                               Decorate 49(vpos) Location 0
@@ -28,10 +19,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                3:             TypeFunction 2
                3:             TypeFunction 2
                6:             TypeFloat 32
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
                7:             TypeVector 6(float) 4
-              13:             TypeImage 6(float) 2D sampled format:Unknown
-      14(Nested):             TypeStruct 6(float) 13
-           15(A):             TypeStruct 14(Nested) 6(float)
-           25(B):             TypeStruct 14(Nested) 13
               43:    6(float) Constant 0
               43:    6(float) Constant 0
               44:    7(fvec4) ConstantComposite 43 43 43 43
               44:    7(fvec4) ConstantComposite 43 43 43 43
               48:             TypePointer Input 7(fvec4)
               48:             TypePointer Input 7(fvec4)

+ 0 - 8
3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out

@@ -10,12 +10,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               EntryPoint Vertex 4  "main" 83 86
                               EntryPoint Vertex 4  "main" 83 86
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 22  "Packed"
-                              MemberName 22(Packed) 0  "tex"
-                              MemberName 22(Packed) 1  "pos"
-                              MemberName 22(Packed) 2  "uv"
-                              MemberName 22(Packed) 3  "x"
-                              MemberName 22(Packed) 4  "n"
                               Name 83  "pos"
                               Name 83  "pos"
                               Name 86  "@entryPointOutput"
                               Name 86  "@entryPointOutput"
                               Decorate 83(pos) Location 0
                               Decorate 83(pos) Location 0
@@ -24,7 +18,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                3:             TypeFunction 2
                3:             TypeFunction 2
                6:             TypeFloat 32
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
                7:             TypeVector 6(float) 4
-              13:             TypeImage 6(float) 2D sampled format:Unknown
               14:             TypeVector 6(float) 3
               14:             TypeVector 6(float) 3
               15:             TypeInt 32 0
               15:             TypeInt 32 0
               16:     15(int) Constant 3
               16:     15(int) Constant 3
@@ -33,7 +26,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
               19:     15(int) Constant 2
               19:     15(int) Constant 2
               20:             TypeArray 18(fvec2) 19
               20:             TypeArray 18(fvec2) 19
               21:             TypeInt 32 1
               21:             TypeInt 32 1
-      22(Packed):             TypeStruct 13 17 20 6(float) 21(int)
               25:     21(int) Constant 0
               25:     21(int) Constant 0
               31:     21(int) Constant 1
               31:     21(int) Constant 1
               32:    6(float) Constant 0
               32:    6(float) Constant 0

+ 1 - 11
3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out

@@ -2,7 +2,7 @@ hlsl.partialFlattenMixed.vert
 WARNING: AST will form illegal SPIR-V; need to transform to legalize
 WARNING: AST will form illegal SPIR-V; need to transform to legalize
 // Module Version 10000
 // Module Version 10000
 // Generated by (magic number): 80003
 // Generated by (magic number): 80003
-// Id's are bound by 45
+// Id's are bound by 36
 
 
                               Capability Shader
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                1:             ExtInstImport  "GLSL.std.450"
@@ -10,10 +10,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                               EntryPoint Vertex 4  "main" 32 35
                               EntryPoint Vertex 4  "main" 32 35
                               Source HLSL 500
                               Source HLSL 500
                               Name 4  "main"
                               Name 4  "main"
-                              Name 18  "Packed"
-                              MemberName 18(Packed) 0  "a"
-                              MemberName 18(Packed) 1  "membTex"
-                              MemberName 18(Packed) 2  "b"
                               Name 32  "pos"
                               Name 32  "pos"
                               Name 35  "@entryPointOutput"
                               Name 35  "@entryPointOutput"
                               Decorate 32(pos) Location 0
                               Decorate 32(pos) Location 0
@@ -22,12 +18,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
                3:             TypeFunction 2
                3:             TypeFunction 2
                6:             TypeFloat 32
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
                7:             TypeVector 6(float) 4
-              13:             TypeInt 32 1
-              14:             TypeImage 6(float) 2D sampled format:Unknown
-              15:             TypeInt 32 0
-              16:     15(int) Constant 2
-              17:             TypeArray 14 16
-      18(Packed):             TypeStruct 13(int) 17 13(int)
               31:             TypePointer Input 7(fvec4)
               31:             TypePointer Input 7(fvec4)
          32(pos):     31(ptr) Variable Input
          32(pos):     31(ptr) Variable Input
               34:             TypePointer Output 7(fvec4)
               34:             TypePointer Output 7(fvec4)

+ 13 - 6
3rdparty/glslang/glslang/Public/ShaderLang.h

@@ -334,11 +334,15 @@ enum TResourceType {
     EResCount
     EResCount
 };
 };
 
 
-// Make one TShader per shader that you will link into a program.  Then provide
-// the shader through setStrings() or setStringsWithLengths(), then call parse(),
-// then query the info logs.
-// Optionally use setPreamble() to set a special shader string that will be
-// processed before all others but won't affect the validity of #version.
+// Make one TShader per shader that you will link into a program. Then
+//  - provide the shader through setStrings() or setStringsWithLengths()
+//  - optionally call setEnv*(), see below for more detail
+//  - optionally use setPreamble() to set a special shader string that will be
+//    processed before all others but won't affect the validity of #version
+//  - call parse(): source language and target environment must be selected
+//    either by correct setting of EShMessages sent to parse(), or by
+//    explicitly calling setEnv*()
+//  - query the info logs
 //
 //
 // N.B.: Does not yet support having the same TShader instance being linked into
 // N.B.: Does not yet support having the same TShader instance being linked into
 // multiple programs.
 // multiple programs.
@@ -377,7 +381,10 @@ public:
     void setNoStorageFormat(bool useUnknownFormat);
     void setNoStorageFormat(bool useUnknownFormat);
     void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
     void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
 
 
-    // For setting up the environment (initialized in the constructor):
+    // For setting up the environment (cleared to nothingness in the constructor).
+    // These must be called so that parsing is done for the right source language and
+    // target environment, either indirectly through TranslateEnvironment() based on
+    // EShMessages et. al., or directly by the user.
     void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version)
     void setEnvInput(EShSource lang, EShLanguage envStage, EShClient client, int version)
     {
     {
         environment.input.languageFamily = lang;
         environment.input.languageFamily = lang;

+ 1 - 1
3rdparty/glslang/known_good.json

@@ -5,7 +5,7 @@
       "site" : "github",
       "site" : "github",
       "subrepo" : "KhronosGroup/SPIRV-Tools",
       "subrepo" : "KhronosGroup/SPIRV-Tools",
       "subdir" : "External/spirv-tools",
       "subdir" : "External/spirv-tools",
-      "commit" : "716718a5e969f6b4e73cbc864db59a754a83aab3"
+      "commit" : "eb0c73dad6102fc0d4f03c62fe910348bae43a11"
     },
     },
     {
     {
       "name" : "spirv-tools/external/spirv-headers",
       "name" : "spirv-tools/external/spirv-headers",