Browse Source

Updated glslang.

Branimir Karadžić 7 years ago
parent
commit
5b704808d6
45 changed files with 644 additions and 212 deletions
  1. 4 1
      3rdparty/glslang/.appveyor.yml
  2. 0 15
      3rdparty/glslang/BUILD.gn
  3. 9 0
      3rdparty/glslang/README.md
  4. 21 6
      3rdparty/glslang/SPIRV/GlslangToSpv.cpp
  5. 1 1
      3rdparty/glslang/SPIRV/SpvPostProcess.cpp
  6. 2 2
      3rdparty/glslang/SPIRV/SpvTools.cpp
  7. 76 31
      3rdparty/glslang/StandAlone/StandAlone.cpp
  8. 0 3
      3rdparty/glslang/Test/baseResults/hlsl.pp.expand.frag.err
  9. 56 0
      3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out
  10. 56 0
      3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out
  11. 0 1
      3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out
  12. 56 0
      3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out
  13. 56 0
      3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out
  14. 0 1
      3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out
  15. 1 0
      3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out
  16. 54 0
      3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out
  17. 4 4
      3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out
  18. 4 4
      3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out
  19. 4 4
      3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out
  20. 4 4
      3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out
  21. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out
  22. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out
  23. 4 4
      3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out
  24. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out
  25. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out
  26. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out
  27. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out
  28. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out
  29. 11 11
      3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out
  30. 10 7
      3rdparty/glslang/Test/runtests
  31. 15 0
      3rdparty/glslang/Test/spv.1.3.8bitstorage-ssbo.vert
  32. 15 0
      3rdparty/glslang/Test/spv.1.3.8bitstorage-ubo.vert
  33. 15 0
      3rdparty/glslang/Test/spv.8bitstorage-ssbo.vert
  34. 15 0
      3rdparty/glslang/Test/spv.8bitstorage-ubo.vert
  35. 21 0
      3rdparty/glslang/Test/spv.perprimitiveNV.frag
  36. 1 1
      3rdparty/glslang/glslang/Include/revision.h
  37. 8 2
      3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
  38. 5 2
      3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
  39. 6 6
      3rdparty/glslang/glslang/MachineIndependent/glslang.y
  40. 11 11
      3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
  41. 1 1
      3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
  42. 13 10
      3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
  43. 3 0
      3rdparty/glslang/glslang/Public/ShaderLang.h
  44. 5 0
      3rdparty/glslang/gtests/Spv.FromFile.cpp
  45. 0 3
      3rdparty/glslang/hlsl/hlslParseHelper.cpp

+ 4 - 1
3rdparty/glslang/.appveyor.yml

@@ -31,8 +31,11 @@ matrix:
 
 # scripts that run after cloning repository
 install:
-  - git clone https://github.com/google/googletest.git External/googletest
   - C:/Python27/python.exe update_glslang_sources.py
+  - git clone https://github.com/google/googletest.git External/googletest
+  - cd External/googletest
+  - git checkout 440527a61e1c91188195f7de212c63c77e8f0a45
+  - cd ../..
 
 build:
   parallel: true  # enable MSBuild parallel builds

+ 0 - 15
3rdparty/glslang/BUILD.gn

@@ -152,18 +152,3 @@ source_set("glslang_sources") {
     "${spirv_tools_dir}:spvtools_opt",
   ]
 }
-
-static_library("glslang_static") {
-  deps = [
-    ":glslang_sources",
-  ]
-
-  # Without this the macOS linker complains that the static library is empty
-  if (is_mac) {
-    complete_static_lib = true
-  }
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [ "//build/config/compiler:no_chromium_code" ]
-}
-

+ 9 - 0
3rdparty/glslang/README.md

@@ -84,6 +84,15 @@ cd <the directory glslang was cloned to, "External" will be a subdirectory>
 git clone https://github.com/google/googletest.git External/googletest
 ```
 
+If you want to use googletest with Visual Studio 2013, you also need to check out an older version:
+
+```bash
+# to use googletest with Visual Studio 2013
+cd External/googletest
+git checkout 440527a61e1c91188195f7de212c63c77e8f0a45
+cd ../..
+```
+
 If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan,
 or wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, install
 spirv-tools with this:

+ 21 - 6
3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -1265,14 +1265,14 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
         std::string text;
         const std::vector<std::string>& processes = glslangIntermediate->getProcesses();
         for (int p = 0; p < (int)processes.size(); ++p) {
-            if (glslangIntermediate->getSpv().spv < 0x00010100) {
+            if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1) {
                 text.append("// OpModuleProcessed ");
                 text.append(processes[p]);
                 text.append("\n");
             } else
                 builder.addModuleProcessed(processes[p]);
         }
-        if (glslangIntermediate->getSpv().spv < 0x00010100 && (int)processes.size() > 0)
+        if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1 && (int)processes.size() > 0)
             text.append("#line 1\n");
         text.append(glslangIntermediate->getSourceText());
         builder.setSourceText(text);
@@ -2812,8 +2812,9 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
         } else if (storageClass == spv::StorageClassUniform) {
             builder.addExtension(spv::E_SPV_KHR_8bit_storage);
             builder.addCapability(spv::CapabilityUniformAndStorageBuffer8BitAccess);
-            if (node->getType().getQualifier().storage == glslang::EvqBuffer)
-                builder.addCapability(spv::CapabilityStorageBuffer8BitAccess);
+        } else if (storageClass == spv::StorageClassStorageBuffer) {
+            builder.addExtension(spv::E_SPV_KHR_8bit_storage);
+            builder.addCapability(spv::CapabilityStorageBuffer8BitAccess);
         }
     }
 
@@ -7202,15 +7203,29 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
 void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier& qualifier)
 {
     if (member >= 0) {
-        if (qualifier.perPrimitiveNV)
+        if (qualifier.perPrimitiveNV) {
+            // Need to add capability/extension for fragment shader.
+            // Mesh shader already adds this by default.
+            if (glslangIntermediate->getStage() == EShLangFragment) {
+                builder.addCapability(spv::CapabilityMeshShadingNV);
+                builder.addExtension(spv::E_SPV_NV_mesh_shader);
+            }
             builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerPrimitiveNV);
+        }
         if (qualifier.perViewNV)
             builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerViewNV);
         if (qualifier.perTaskNV)
             builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerTaskNV);
     } else {
-        if (qualifier.perPrimitiveNV)
+        if (qualifier.perPrimitiveNV) {
+            // Need to add capability/extension for fragment shader.
+            // Mesh shader already adds this by default.
+            if (glslangIntermediate->getStage() == EShLangFragment) {
+                builder.addCapability(spv::CapabilityMeshShadingNV);
+                builder.addExtension(spv::E_SPV_NV_mesh_shader);
+            }
             builder.addDecoration(id, spv::DecorationPerPrimitiveNV);
+        }
         if (qualifier.perViewNV)
             builder.addDecoration(id, spv::DecorationPerViewNV);
         if (qualifier.perTaskNV)

+ 1 - 1
3rdparty/glslang/SPIRV/SpvPostProcess.cpp

@@ -208,7 +208,7 @@ void Builder::postProcess(const Instruction& inst)
 }
 
 // Called for each instruction in a reachable block.
-void Builder::postProcessReachable(const Instruction& inst)
+void Builder::postProcessReachable(const Instruction&)
 {
     // did have code here, but questionable to do so without deleting the instructions
 }

+ 2 - 2
3rdparty/glslang/SPIRV/SpvTools.cpp

@@ -114,8 +114,8 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
 
 // Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of
 // legalizing HLSL SPIR-V.
-void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
-                        spv::SpvBuildLogger* logger, const SpvOptions* options)
+void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>& spirv,
+                        spv::SpvBuildLogger*, const SpvOptions* options)
 {
     spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2;
 

+ 76 - 31
3rdparty/glslang/StandAlone/StandAlone.cpp

@@ -161,13 +161,17 @@ const char* shaderStageName = nullptr;
 const char* variableName = nullptr;
 bool HlslEnable16BitTypes = false;
 std::vector<std::string> IncludeDirectoryList;
-int ClientInputSemanticsVersion = 100;                  // maps to, say, #define VULKAN 100
-glslang::EShTargetClientVersion VulkanClientVersion =
-                          glslang::EShTargetVulkan_1_0; // would map to, say, Vulkan 1.0
-glslang::EShTargetClientVersion OpenGLClientVersion =
-                          glslang::EShTargetOpenGL_450; // doesn't influence anything yet, but maps to OpenGL 4.50
-glslang::EShTargetLanguageVersion TargetVersion =
-                          glslang::EShTargetSpv_1_0;    // maps to, say, SPIR-V 1.0
+
+// Source environment
+// (source 'Client' is currently the same as target 'Client')
+int ClientInputSemanticsVersion = 100;
+
+// Target environment
+glslang::EShClient Client = glslang::EShClientNone;  // will stay EShClientNone if only validating
+glslang::EShTargetClientVersion ClientVersion;       // not valid until Client is set
+glslang::EShTargetLanguage TargetLanguage = glslang::EShTargetNone;
+glslang::EShTargetLanguageVersion TargetVersion;     // not valid until TargetLanguage is set
+
 std::vector<std::string> Processes;                     // what should be recorded by OpModuleProcessed, or equivalent
 
 // Per descriptor-set binding base data
@@ -421,6 +425,9 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
 
     // minimum needed (without overriding something else) to target Vulkan SPIR-V
     const auto setVulkanSpv = []() {
+        if (Client == glslang::EShClientNone)
+            ClientVersion = glslang::EShTargetVulkan_1_0;
+        Client = glslang::EShClientVulkan;
         Options |= EOptionSpv;
         Options |= EOptionVulkanRules;
         Options |= EOptionLinkProgram;
@@ -428,6 +435,9 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
 
     // minimum needed (without overriding something else) to target OpenGL SPIR-V
     const auto setOpenGlSpv = []() {
+        if (Client == glslang::EShClientNone)
+            ClientVersion = glslang::EShTargetOpenGL_450;
+        Client = glslang::EShClientOpenGL;
         Options |= EOptionSpv;
         Options |= EOptionLinkProgram;
         // undo a -H default to Vulkan
@@ -561,16 +571,30 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
                         if (argc > 1) {
                             if (strcmp(argv[1], "vulkan1.0") == 0) {
                                 setVulkanSpv();
-                                VulkanClientVersion = glslang::EShTargetVulkan_1_0;
+                                ClientVersion = glslang::EShTargetVulkan_1_0;
                             } else if (strcmp(argv[1], "vulkan1.1") == 0) {
                                 setVulkanSpv();
-                                TargetVersion = glslang::EShTargetSpv_1_3;
-                                VulkanClientVersion = glslang::EShTargetVulkan_1_1;
+                                ClientVersion = glslang::EShTargetVulkan_1_1;
                             } else if (strcmp(argv[1], "opengl") == 0) {
                                 setOpenGlSpv();
-                                OpenGLClientVersion = glslang::EShTargetOpenGL_450;
+                                ClientVersion = glslang::EShTargetOpenGL_450;
+                            } else if (strcmp(argv[1], "spirv1.0") == 0) {
+                                TargetLanguage = glslang::EShTargetSpv;
+                                TargetVersion = glslang::EShTargetSpv_1_0;
+                            } else if (strcmp(argv[1], "spirv1.1") == 0) {
+                                TargetLanguage = glslang::EShTargetSpv;
+                                TargetVersion = glslang::EShTargetSpv_1_1;
+                            } else if (strcmp(argv[1], "spirv1.2") == 0) {
+                                TargetLanguage = glslang::EShTargetSpv;
+                                TargetVersion = glslang::EShTargetSpv_1_2;
+                            } else if (strcmp(argv[1], "spirv1.3") == 0) {
+                                TargetLanguage = glslang::EShTargetSpv;
+                                TargetVersion = glslang::EShTargetSpv_1_3;
+                            } else if (strcmp(argv[1], "spirv1.4") == 0) {
+                                TargetLanguage = glslang::EShTargetSpv;
+                                TargetVersion = glslang::EShTargetSpv_1_4;
                             } else
-                                Error("--target-env expected vulkan1.0, vulkan1.1, or opengl");
+                                Error("--target-env expected one of: vulkan1.0, vulkan1.1, opengl, spirv1.0, spirv1.1, spirv1.2, or spirv1.3");
                         }
                         bumpArg();
                     } else if (lowerword == "variable-name" || // synonyms
@@ -604,7 +628,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
                 Options |= EOptionOutputPreprocessed;
                 break;
             case 'G':
-                // OpenGL Client
+                // OpenGL client
                 setOpenGlSpv();
                 if (argv[0][2] != 0)
                     ClientInputSemanticsVersion = getAttachedNumber("-G<num> client input semantics");
@@ -736,6 +760,28 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
     if ((Options & EOptionFlattenUniformArrays) != 0 &&
         (Options & EOptionReadHlsl) == 0)
         Error("uniform array flattening only valid when compiling HLSL source.");
+
+    // rationalize client and target language
+    if (TargetLanguage == glslang::EShTargetNone) {
+        switch (ClientVersion) {
+        case glslang::EShTargetVulkan_1_0:
+            TargetLanguage = glslang::EShTargetSpv;
+            TargetVersion = glslang::EShTargetSpv_1_0;
+            break;
+        case glslang::EShTargetVulkan_1_1:
+            TargetLanguage = glslang::EShTargetSpv;
+            TargetVersion = glslang::EShTargetSpv_1_3;
+            break;
+        case glslang::EShTargetOpenGL_450:
+            TargetLanguage = glslang::EShTargetSpv;
+            TargetVersion = glslang::EShTargetSpv_1_0;
+            break;
+        default:
+            break;
+        }
+    }
+    if (TargetLanguage != glslang::EShTargetNone && Client == glslang::EShClientNone)
+        Error("To generate SPIR-V, also specify client semantics. See -G and -V.");
 }
 
 //
@@ -936,18 +982,11 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
         // Set up the environment, some subsettings take precedence over earlier
         // ways of setting things.
         if (Options & EOptionSpv) {
-            if (Options & EOptionVulkanRules) {
-                shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
-                                                                : glslang::EShSourceGlsl,
-                                        compUnit.stage, glslang::EShClientVulkan, ClientInputSemanticsVersion);
-                shader->setEnvClient(glslang::EShClientVulkan, VulkanClientVersion);
-            } else {
-                shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
-                                                                : glslang::EShSourceGlsl,
-                                        compUnit.stage, glslang::EShClientOpenGL, ClientInputSemanticsVersion);
-                shader->setEnvClient(glslang::EShClientOpenGL, OpenGLClientVersion);
-            }
-            shader->setEnvTarget(glslang::EShTargetSpv, TargetVersion);
+            shader->setEnvInput((Options & EOptionReadHlsl) ? glslang::EShSourceHlsl
+                                                            : glslang::EShSourceGlsl,
+                                compUnit.stage, Client, ClientInputSemanticsVersion);
+            shader->setEnvClient(Client, ClientVersion);
+            shader->setEnvTarget(TargetLanguage, TargetVersion);
             if (targetHlslFunctionality1)
                 shader->setEnvTargetHlslFunctionality1();
         }
@@ -961,8 +1000,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
             includer.pushExternalLocalDirectory(dir); });
         if (Options & EOptionOutputPreprocessed) {
             std::string str;
-            if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false,
-                                   messages, &str, includer)) {
+            if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
                 PutsIfNonEmpty(str.c_str());
             } else {
                 CompileFailed = true;
@@ -971,6 +1009,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
             StderrIfNonEmpty(shader->getInfoDebugLog());
             continue;
         }
+
         if (! shader->parse(&Resources, defaultVersion, false, messages, includer))
             CompileFailed = true;
 
@@ -1167,13 +1206,15 @@ int singleMain()
 
     ProcessConfigFile();
 
+    if ((Options & EOptionReadHlsl) && !((Options & EOptionOutputPreprocessed) || (Options & EOptionSpv)))
+        Error("ERROR: HLSL requires SPIR-V code generation (or preprocessing only)");
+
     //
     // Two modes:
     // 1) linking all arguments together, single-threaded, new C++ interface
     // 2) independent arguments, can be tackled by multiple asynchronous threads, for testing thread safety, using the old handle interface
     //
-    if (Options & EOptionLinkProgram ||
-        Options & EOptionOutputPreprocessed) {
+    if (Options & (EOptionLinkProgram | EOptionOutputPreprocessed)) {
         glslang::InitializeProcess();
         glslang::InitializeProcess();  // also test reference counting of users
         glslang::InitializeProcess();  // also test reference counting of users
@@ -1513,12 +1554,16 @@ void usage()
            "  --sep                             synonym for --source-entrypoint\n"
            "  --stdin                           read from stdin instead of from a file;\n"
            "                                    requires providing the shader stage using -S\n"
-           "  --target-env {vulkan1.0 | vulkan1.1 | opengl} \n"
+           "  --target-env {vulkan1.0 | vulkan1.1 | opengl | \n"
+           "                spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3}\n"
            "                                    set execution environment that emitted code\n"
-           "                                    will execute in (as opposed to the language\n"
+           "                                    will execute in (versus source language\n"
            "                                    semantics selected by --client) defaults:\n"
            "                                     * 'vulkan1.0' under '--client vulkan<ver>'\n"
            "                                     * 'opengl' under '--client opengl<ver>'\n"
+           "                                     * 'spirv1.0' under --target-env vulkan1.0\n"
+           "                                     * 'spirv1.3' under --target-env vulkan1.1\n"
+           "                                    multiple --targen-env can be specified.\n"
            "  --variable-name <name>\n"
            "  --vn <name>                       creates a C header file that contains a\n"
            "                                    uint32_t array named <name>\n"

+ 0 - 3
3rdparty/glslang/Test/baseResults/hlsl.pp.expand.frag.err

@@ -1,3 +0,0 @@
-ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.
-ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.
-

+ 56 - 0
3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out

@@ -0,0 +1,56 @@
+spv.1.3.8bitstorage-ssbo.vert
+// Module Version 10300
+// Generated by (magic number): 80007
+// Id's are bound by 28
+
+                              Capability Shader
+                              Capability CapabilityStorageBuffer8BitAccess
+                              Extension  "SPV_KHR_8bit_storage"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 9 18
+                              Source GLSL 450
+                              SourceExtension  "GL_EXT_shader_8bit_storage"
+                              Name 4  "main"
+                              Name 9  "color"
+                              Name 12  "Vertices"
+                              MemberName 12(Vertices) 0  "vertices"
+                              Name 14  ""
+                              Name 18  "gl_VertexIndex"
+                              Decorate 9(color) Location 0
+                              Decorate 11 ArrayStride 1
+                              MemberDecorate 12(Vertices) 0 NonWritable
+                              MemberDecorate 12(Vertices) 0 Offset 0
+                              Decorate 12(Vertices) Block
+                              Decorate 14 DescriptorSet 0
+                              Decorate 14 Binding 0
+                              Decorate 18(gl_VertexIndex) BuiltIn VertexIndex
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Output 7(fvec4)
+        9(color):      8(ptr) Variable Output
+              10:             TypeInt 8 0
+              11:             TypeRuntimeArray 10(int8_t)
+    12(Vertices):             TypeStruct 11
+              13:             TypePointer StorageBuffer 12(Vertices)
+              14:     13(ptr) Variable StorageBuffer
+              15:             TypeInt 32 1
+              16:     15(int) Constant 0
+              17:             TypePointer Input 15(int)
+18(gl_VertexIndex):     17(ptr) Variable Input
+              20:             TypePointer StorageBuffer 10(int8_t)
+              23:             TypeInt 32 0
+         4(main):           2 Function None 3
+               5:             Label
+              19:     15(int) Load 18(gl_VertexIndex)
+              21:     20(ptr) AccessChain 14 16 19
+              22:  10(int8_t) Load 21
+              24:     23(int) UConvert 22
+              25:     15(int) Bitcast 24
+              26:    6(float) ConvertSToF 25
+              27:    7(fvec4) CompositeConstruct 26 26 26 26
+                              Store 9(color) 27
+                              Return
+                              FunctionEnd

+ 56 - 0
3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out

@@ -0,0 +1,56 @@
+spv.1.3.8bitstorage-ubo.vert
+// Module Version 10300
+// Generated by (magic number): 80007
+// Id's are bound by 29
+
+                              Capability Shader
+                              Capability CapabilityUniformAndStorageBuffer8BitAccess
+                              Extension  "SPV_KHR_8bit_storage"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 9 20
+                              Source GLSL 450
+                              SourceExtension  "GL_EXT_shader_8bit_storage"
+                              Name 4  "main"
+                              Name 9  "color"
+                              Name 14  "Vertices"
+                              MemberName 14(Vertices) 0  "vertices"
+                              Name 16  ""
+                              Name 20  "gl_VertexIndex"
+                              Decorate 9(color) Location 0
+                              Decorate 13 ArrayStride 16
+                              MemberDecorate 14(Vertices) 0 Offset 0
+                              Decorate 14(Vertices) Block
+                              Decorate 16 DescriptorSet 0
+                              Decorate 16 Binding 0
+                              Decorate 20(gl_VertexIndex) BuiltIn VertexIndex
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Output 7(fvec4)
+        9(color):      8(ptr) Variable Output
+              10:             TypeInt 8 0
+              11:             TypeInt 32 0
+              12:     11(int) Constant 512
+              13:             TypeArray 10(int8_t) 12
+    14(Vertices):             TypeStruct 13
+              15:             TypePointer Uniform 14(Vertices)
+              16:     15(ptr) Variable Uniform
+              17:             TypeInt 32 1
+              18:     17(int) Constant 0
+              19:             TypePointer Input 17(int)
+20(gl_VertexIndex):     19(ptr) Variable Input
+              22:             TypePointer Uniform 10(int8_t)
+         4(main):           2 Function None 3
+               5:             Label
+              21:     17(int) Load 20(gl_VertexIndex)
+              23:     22(ptr) AccessChain 16 18 21
+              24:  10(int8_t) Load 23
+              25:     11(int) UConvert 24
+              26:     17(int) Bitcast 25
+              27:    6(float) ConvertSToF 26
+              28:    7(fvec4) CompositeConstruct 27 27 27 27
+                              Store 9(color) 28
+                              Return
+                              FunctionEnd

+ 0 - 1
3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out

@@ -4,7 +4,6 @@ spv.8bitstorage-int.frag
 // Id's are bound by 171
 
                               Capability Shader
-                              Capability CapabilityStorageBuffer8BitAccess
                               Capability CapabilityUniformAndStorageBuffer8BitAccess
                               Extension  "SPV_KHR_8bit_storage"
                1:             ExtInstImport  "GLSL.std.450"

+ 56 - 0
3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out

@@ -0,0 +1,56 @@
+spv.8bitstorage-ssbo.vert
+// Module Version 10000
+// Generated by (magic number): 80007
+// Id's are bound by 28
+
+                              Capability Shader
+                              Capability CapabilityUniformAndStorageBuffer8BitAccess
+                              Extension  "SPV_KHR_8bit_storage"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 9 18
+                              Source GLSL 450
+                              SourceExtension  "GL_EXT_shader_8bit_storage"
+                              Name 4  "main"
+                              Name 9  "color"
+                              Name 12  "Vertices"
+                              MemberName 12(Vertices) 0  "vertices"
+                              Name 14  ""
+                              Name 18  "gl_VertexIndex"
+                              Decorate 9(color) Location 0
+                              Decorate 11 ArrayStride 1
+                              MemberDecorate 12(Vertices) 0 NonWritable
+                              MemberDecorate 12(Vertices) 0 Offset 0
+                              Decorate 12(Vertices) BufferBlock
+                              Decorate 14 DescriptorSet 0
+                              Decorate 14 Binding 0
+                              Decorate 18(gl_VertexIndex) BuiltIn VertexIndex
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Output 7(fvec4)
+        9(color):      8(ptr) Variable Output
+              10:             TypeInt 8 0
+              11:             TypeRuntimeArray 10(int8_t)
+    12(Vertices):             TypeStruct 11
+              13:             TypePointer Uniform 12(Vertices)
+              14:     13(ptr) Variable Uniform
+              15:             TypeInt 32 1
+              16:     15(int) Constant 0
+              17:             TypePointer Input 15(int)
+18(gl_VertexIndex):     17(ptr) Variable Input
+              20:             TypePointer Uniform 10(int8_t)
+              23:             TypeInt 32 0
+         4(main):           2 Function None 3
+               5:             Label
+              19:     15(int) Load 18(gl_VertexIndex)
+              21:     20(ptr) AccessChain 14 16 19
+              22:  10(int8_t) Load 21
+              24:     23(int) UConvert 22
+              25:     15(int) Bitcast 24
+              26:    6(float) ConvertSToF 25
+              27:    7(fvec4) CompositeConstruct 26 26 26 26
+                              Store 9(color) 27
+                              Return
+                              FunctionEnd

+ 56 - 0
3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out

@@ -0,0 +1,56 @@
+spv.8bitstorage-ubo.vert
+// Module Version 10000
+// Generated by (magic number): 80007
+// Id's are bound by 29
+
+                              Capability Shader
+                              Capability CapabilityUniformAndStorageBuffer8BitAccess
+                              Extension  "SPV_KHR_8bit_storage"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 9 20
+                              Source GLSL 450
+                              SourceExtension  "GL_EXT_shader_8bit_storage"
+                              Name 4  "main"
+                              Name 9  "color"
+                              Name 14  "Vertices"
+                              MemberName 14(Vertices) 0  "vertices"
+                              Name 16  ""
+                              Name 20  "gl_VertexIndex"
+                              Decorate 9(color) Location 0
+                              Decorate 13 ArrayStride 16
+                              MemberDecorate 14(Vertices) 0 Offset 0
+                              Decorate 14(Vertices) Block
+                              Decorate 16 DescriptorSet 0
+                              Decorate 16 Binding 0
+                              Decorate 20(gl_VertexIndex) BuiltIn VertexIndex
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Output 7(fvec4)
+        9(color):      8(ptr) Variable Output
+              10:             TypeInt 8 0
+              11:             TypeInt 32 0
+              12:     11(int) Constant 512
+              13:             TypeArray 10(int8_t) 12
+    14(Vertices):             TypeStruct 13
+              15:             TypePointer Uniform 14(Vertices)
+              16:     15(ptr) Variable Uniform
+              17:             TypeInt 32 1
+              18:     17(int) Constant 0
+              19:             TypePointer Input 17(int)
+20(gl_VertexIndex):     19(ptr) Variable Input
+              22:             TypePointer Uniform 10(int8_t)
+         4(main):           2 Function None 3
+               5:             Label
+              21:     17(int) Load 20(gl_VertexIndex)
+              23:     22(ptr) AccessChain 16 18 21
+              24:  10(int8_t) Load 23
+              25:     11(int) UConvert 24
+              26:     17(int) Bitcast 25
+              27:    6(float) ConvertSToF 26
+              28:    7(fvec4) CompositeConstruct 27 27 27 27
+                              Store 9(color) 28
+                              Return
+                              FunctionEnd

+ 0 - 1
3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out

@@ -4,7 +4,6 @@ spv.8bitstorage-uint.frag
 // Id's are bound by 173
 
                               Capability Shader
-                              Capability CapabilityStorageBuffer8BitAccess
                               Capability CapabilityUniformAndStorageBuffer8BitAccess
                               Extension  "SPV_KHR_8bit_storage"
                1:             ExtInstImport  "GLSL.std.450"

+ 1 - 0
3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out

@@ -88,6 +88,7 @@ void main()
                               ModuleProcessed  "suppress-warnings"
                               ModuleProcessed  "hlsl-offsets"
                               ModuleProcessed  "entry-point main"
+                              ModuleProcessed  "use-storage-buffer"
                               Decorate 24(inv) Location 0
                               Decorate 52(outv) Location 0
                               MemberDecorate 53(S) 0 Offset 0

+ 54 - 0
3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out

@@ -0,0 +1,54 @@
+spv.perprimitiveNV.frag
+// Module Version 10000
+// Generated by (magic number): 80007
+// Id's are bound by 23
+
+                              Capability Shader
+                              Capability MeshShadingNV
+                              Extension  "SPV_NV_mesh_shader"
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 8 11 19
+                              ExecutionMode 4 OriginUpperLeft
+                              Source GLSL 460
+                              SourceExtension  "GL_NV_mesh_shader"
+                              Name 4  "main"
+                              Name 8  "g"
+                              Name 9  "B"
+                              MemberName 9(B) 0  "f"
+                              Name 11  ""
+                              Name 17  "C"
+                              MemberName 17(C) 0  "h"
+                              Name 19  ""
+                              Decorate 8(g) Location 8
+                              MemberDecorate 9(B) 0 PerPrimitiveNV
+                              Decorate 9(B) Block
+                              Decorate 11 Location 0
+                              MemberDecorate 17(C) 0 Flat
+                              MemberDecorate 17(C) 0 Centroid
+                              Decorate 17(C) Block
+                              Decorate 19 Location 4
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypePointer Output 6(float)
+            8(g):      7(ptr) Variable Output
+            9(B):             TypeStruct 6(float)
+              10:             TypePointer Input 9(B)
+              11:     10(ptr) Variable Input
+              12:             TypeInt 32 1
+              13:     12(int) Constant 0
+              14:             TypePointer Input 6(float)
+           17(C):             TypeStruct 6(float)
+              18:             TypePointer Input 17(C)
+              19:     18(ptr) Variable Input
+         4(main):           2 Function None 3
+               5:             Label
+              15:     14(ptr) AccessChain 11 13
+              16:    6(float) Load 15
+              20:     14(ptr) AccessChain 19 13
+              21:    6(float) Load 20
+              22:    6(float) FAdd 16 21
+                              Store 8(g) 22
+                              Return
+                              FunctionEnd

+ 4 - 4
3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out

@@ -23,7 +23,7 @@ spv.subgroup.geom
                               Name 20  "gl_SubgroupInvocationID"
                               Decorate 8 ArrayStride 16
                               MemberDecorate 9(Output) 0 Offset 0
-                              Decorate 9(Output) BufferBlock
+                              Decorate 9(Output) Block
                               Decorate 11 DescriptorSet 0
                               Decorate 11 Binding 0
                               Decorate 15(gl_PrimitiveIDIn) BuiltIn PrimitiveId
@@ -39,8 +39,8 @@ spv.subgroup.geom
                7:             TypeVector 6(int) 4
                8:             TypeRuntimeArray 7(ivec4)
        9(Output):             TypeStruct 8
-              10:             TypePointer Uniform 9(Output)
-              11:     10(ptr) Variable Uniform
+              10:             TypePointer StorageBuffer 9(Output)
+              11:     10(ptr) Variable StorageBuffer
               12:             TypeInt 32 1
               13:     12(int) Constant 0
               14:             TypePointer Input 12(int)
@@ -49,7 +49,7 @@ spv.subgroup.geom
 18(gl_SubgroupSize):     17(ptr) Variable Input
 20(gl_SubgroupInvocationID):     17(ptr) Variable Input
               22:      6(int) Constant 0
-              24:             TypePointer Uniform 7(ivec4)
+              24:             TypePointer StorageBuffer 7(ivec4)
          4(main):           2 Function None 3
                5:             Label
               16:     12(int) Load 15(gl_PrimitiveIDIn)

+ 4 - 4
3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out

@@ -20,7 +20,7 @@ spv.subgroup.tesc
                               Name 20  "gl_SubgroupInvocationID"
                               Decorate 8 ArrayStride 16
                               MemberDecorate 9(Output) 0 Offset 0
-                              Decorate 9(Output) BufferBlock
+                              Decorate 9(Output) Block
                               Decorate 11 DescriptorSet 0
                               Decorate 11 Binding 0
                               Decorate 15(gl_PrimitiveID) BuiltIn PrimitiveId
@@ -36,8 +36,8 @@ spv.subgroup.tesc
                7:             TypeVector 6(int) 4
                8:             TypeRuntimeArray 7(ivec4)
        9(Output):             TypeStruct 8
-              10:             TypePointer Uniform 9(Output)
-              11:     10(ptr) Variable Uniform
+              10:             TypePointer StorageBuffer 9(Output)
+              11:     10(ptr) Variable StorageBuffer
               12:             TypeInt 32 1
               13:     12(int) Constant 0
               14:             TypePointer Input 12(int)
@@ -46,7 +46,7 @@ spv.subgroup.tesc
 18(gl_SubgroupSize):     17(ptr) Variable Input
 20(gl_SubgroupInvocationID):     17(ptr) Variable Input
               22:      6(int) Constant 0
-              24:             TypePointer Uniform 7(ivec4)
+              24:             TypePointer StorageBuffer 7(ivec4)
          4(main):           2 Function None 3
                5:             Label
               16:     12(int) Load 15(gl_PrimitiveID)

+ 4 - 4
3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out

@@ -22,7 +22,7 @@ spv.subgroup.tese
                               Name 20  "gl_SubgroupInvocationID"
                               Decorate 8 ArrayStride 16
                               MemberDecorate 9(Output) 0 Offset 0
-                              Decorate 9(Output) BufferBlock
+                              Decorate 9(Output) Block
                               Decorate 11 DescriptorSet 0
                               Decorate 11 Binding 0
                               Decorate 15(gl_PrimitiveID) BuiltIn PrimitiveId
@@ -38,8 +38,8 @@ spv.subgroup.tese
                7:             TypeVector 6(int) 4
                8:             TypeRuntimeArray 7(ivec4)
        9(Output):             TypeStruct 8
-              10:             TypePointer Uniform 9(Output)
-              11:     10(ptr) Variable Uniform
+              10:             TypePointer StorageBuffer 9(Output)
+              11:     10(ptr) Variable StorageBuffer
               12:             TypeInt 32 1
               13:     12(int) Constant 0
               14:             TypePointer Input 12(int)
@@ -48,7 +48,7 @@ spv.subgroup.tese
 18(gl_SubgroupSize):     17(ptr) Variable Input
 20(gl_SubgroupInvocationID):     17(ptr) Variable Input
               22:      6(int) Constant 0
-              24:             TypePointer Uniform 7(ivec4)
+              24:             TypePointer StorageBuffer 7(ivec4)
          4(main):           2 Function None 3
                5:             Label
               16:     12(int) Load 15(gl_PrimitiveID)

+ 4 - 4
3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out

@@ -19,7 +19,7 @@ spv.subgroup.vert
                               Name 20  "gl_SubgroupInvocationID"
                               Decorate 8 ArrayStride 16
                               MemberDecorate 9(Output) 0 Offset 0
-                              Decorate 9(Output) BufferBlock
+                              Decorate 9(Output) Block
                               Decorate 11 DescriptorSet 0
                               Decorate 11 Binding 0
                               Decorate 15(gl_VertexIndex) BuiltIn VertexIndex
@@ -35,8 +35,8 @@ spv.subgroup.vert
                7:             TypeVector 6(int) 4
                8:             TypeRuntimeArray 7(ivec4)
        9(Output):             TypeStruct 8
-              10:             TypePointer Uniform 9(Output)
-              11:     10(ptr) Variable Uniform
+              10:             TypePointer StorageBuffer 9(Output)
+              11:     10(ptr) Variable StorageBuffer
               12:             TypeInt 32 1
               13:     12(int) Constant 0
               14:             TypePointer Input 12(int)
@@ -45,7 +45,7 @@ spv.subgroup.vert
 18(gl_SubgroupSize):     17(ptr) Variable Input
 20(gl_SubgroupInvocationID):     17(ptr) Variable Input
               22:      6(int) Constant 0
-              24:             TypePointer Uniform 7(ivec4)
+              24:             TypePointer StorageBuffer 7(ivec4)
          4(main):           2 Function None 3
                5:             Label
               16:     12(int) Load 15(gl_VertexIndex)

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out

@@ -36,7 +36,7 @@ spv.subgroupArithmetic.comp
                               MemberDecorate 24(Buffers) 1 Offset 16
                               MemberDecorate 24(Buffers) 2 Offset 32
                               MemberDecorate 24(Buffers) 3 Offset 64
-                              Decorate 24(Buffers) BufferBlock
+                              Decorate 24(Buffers) Block
                               Decorate 27(data) DescriptorSet 0
                               Decorate 27(data) Binding 0
                               Decorate 2084 BuiltIn WorkgroupSize
@@ -57,29 +57,29 @@ spv.subgroupArithmetic.comp
               23:             TypeVector 22(float64_t) 4
      24(Buffers):             TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4)
               25:             TypeArray 24(Buffers) 15
-              26:             TypePointer Uniform 25
-        27(data):     26(ptr) Variable Uniform
+              26:             TypePointer StorageBuffer 25
+        27(data):     26(ptr) Variable StorageBuffer
               29:     19(int) Constant 0
               30:      6(int) Constant 0
-              31:             TypePointer Uniform 17(float)
+              31:             TypePointer StorageBuffer 17(float)
               34:      6(int) Constant 3
               38:     19(int) Constant 1
               39:             TypeVector 17(float) 2
-              40:             TypePointer Uniform 18(fvec4)
+              40:             TypePointer StorageBuffer 18(fvec4)
               49:     19(int) Constant 2
               50:             TypeVector 17(float) 3
               59:     19(int) Constant 3
-              65:             TypePointer Uniform 19(int)
+              65:             TypePointer StorageBuffer 19(int)
               71:             TypeVector 19(int) 2
-              72:             TypePointer Uniform 20(ivec4)
+              72:             TypePointer StorageBuffer 20(ivec4)
               81:             TypeVector 19(int) 3
-              95:             TypePointer Uniform 6(int)
+              95:             TypePointer StorageBuffer 6(int)
              101:             TypeVector 6(int) 2
-             102:             TypePointer Uniform 21(ivec4)
+             102:             TypePointer StorageBuffer 21(ivec4)
              111:             TypeVector 6(int) 3
-             125:             TypePointer Uniform 22(float64_t)
+             125:             TypePointer StorageBuffer 22(float64_t)
              131:             TypeVector 22(float64_t) 2
-             132:             TypePointer Uniform 23(f64vec4)
+             132:             TypePointer StorageBuffer 23(f64vec4)
              141:             TypeVector 22(float64_t) 3
              521:             TypeBool
              530:   71(ivec2) ConstantComposite 29 29

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out

@@ -48,7 +48,7 @@ spv.subgroupBallot.comp
                               MemberDecorate 46(Buffers) 1 Offset 16
                               MemberDecorate 46(Buffers) 2 Offset 32
                               MemberDecorate 46(Buffers) 3 Offset 64
-                              Decorate 46(Buffers) BufferBlock
+                              Decorate 46(Buffers) Block
                               Decorate 49(data) DescriptorSet 0
                               Decorate 49(data) Binding 0
                               Decorate 416 BuiltIn WorkgroupSize
@@ -79,31 +79,31 @@ spv.subgroupBallot.comp
               45:             TypeVector 44(float64_t) 4
      46(Buffers):             TypeStruct 41(fvec4) 43(ivec4) 17(ivec4) 45(f64vec4)
               47:             TypeArray 46(Buffers) 15
-              48:             TypePointer Uniform 47
-        49(data):     48(ptr) Variable Uniform
+              48:             TypePointer StorageBuffer 47
+        49(data):     48(ptr) Variable StorageBuffer
               51:     42(int) Constant 2
               54:      6(int) Constant 0
-              55:             TypePointer Uniform 6(int)
+              55:             TypePointer StorageBuffer 6(int)
               60:     42(int) Constant 1
               61:     42(int) Constant 0
               64:      6(int) Constant 1
               72:      6(int) Constant 2
               83:             TypeVector 36(bool) 4
-              88:             TypePointer Uniform 17(ivec4)
-              96:             TypePointer Uniform 40(float)
+              88:             TypePointer StorageBuffer 17(ivec4)
+              96:             TypePointer StorageBuffer 40(float)
              103:             TypeVector 40(float) 2
-             104:             TypePointer Uniform 41(fvec4)
+             104:             TypePointer StorageBuffer 41(fvec4)
              114:             TypeVector 40(float) 3
              124:     42(int) Constant 3
-             131:             TypePointer Uniform 42(int)
+             131:             TypePointer StorageBuffer 42(int)
              138:             TypeVector 42(int) 2
-             139:             TypePointer Uniform 43(ivec4)
+             139:             TypePointer StorageBuffer 43(ivec4)
              149:             TypeVector 42(int) 3
              171:             TypeVector 6(int) 2
              181:             TypeVector 6(int) 3
-             197:             TypePointer Uniform 44(float64_t)
+             197:             TypePointer StorageBuffer 44(float64_t)
              204:             TypeVector 44(float64_t) 2
-             205:             TypePointer Uniform 45(f64vec4)
+             205:             TypePointer StorageBuffer 45(f64vec4)
              215:             TypeVector 44(float64_t) 3
              242:  138(ivec2) ConstantComposite 61 61
              243:             TypeVector 36(bool) 2

+ 4 - 4
3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out

@@ -21,7 +21,7 @@ spv.subgroupBasic.comp
                               Name 25  "gl_SubgroupID"
                               Decorate 7 ArrayStride 4
                               MemberDecorate 8(Buffer) 0 Offset 0
-                              Decorate 8(Buffer) BufferBlock
+                              Decorate 8(Buffer) Block
                               Decorate 10(data) DescriptorSet 0
                               Decorate 10(data) Binding 0
                               Decorate 14(gl_SubgroupSize) RelaxedPrecision
@@ -38,14 +38,14 @@ spv.subgroupBasic.comp
                6:             TypeInt 32 1
                7:             TypeRuntimeArray 6(int)
        8(Buffer):             TypeStruct 7
-               9:             TypePointer Uniform 8(Buffer)
-        10(data):      9(ptr) Variable Uniform
+               9:             TypePointer StorageBuffer 8(Buffer)
+        10(data):      9(ptr) Variable StorageBuffer
               11:      6(int) Constant 0
               12:             TypeInt 32 0
               13:             TypePointer Input 12(int)
 14(gl_SubgroupSize):     13(ptr) Variable Input
               16:      6(int) Constant 1
-              17:             TypePointer Uniform 6(int)
+              17:             TypePointer StorageBuffer 6(int)
 19(gl_SubgroupInvocationID):     13(ptr) Variable Input
 22(gl_NumSubgroups):     13(ptr) Variable Input
 25(gl_SubgroupID):     13(ptr) Variable Input

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out

@@ -36,7 +36,7 @@ spv.subgroupClustered.comp
                               MemberDecorate 24(Buffers) 1 Offset 16
                               MemberDecorate 24(Buffers) 2 Offset 32
                               MemberDecorate 24(Buffers) 3 Offset 64
-                              Decorate 24(Buffers) BufferBlock
+                              Decorate 24(Buffers) Block
                               Decorate 27(data) DescriptorSet 0
                               Decorate 27(data) Binding 0
                               Decorate 736 BuiltIn WorkgroupSize
@@ -57,30 +57,30 @@ spv.subgroupClustered.comp
               23:             TypeVector 22(float64_t) 4
      24(Buffers):             TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4)
               25:             TypeArray 24(Buffers) 15
-              26:             TypePointer Uniform 25
-        27(data):     26(ptr) Variable Uniform
+              26:             TypePointer StorageBuffer 25
+        27(data):     26(ptr) Variable StorageBuffer
               29:     19(int) Constant 0
               30:      6(int) Constant 0
-              31:             TypePointer Uniform 17(float)
+              31:             TypePointer StorageBuffer 17(float)
               34:      6(int) Constant 1
               35:      6(int) Constant 3
               39:     19(int) Constant 1
               40:             TypeVector 17(float) 2
-              41:             TypePointer Uniform 18(fvec4)
+              41:             TypePointer StorageBuffer 18(fvec4)
               50:     19(int) Constant 2
               51:             TypeVector 17(float) 3
               60:     19(int) Constant 3
-              66:             TypePointer Uniform 19(int)
+              66:             TypePointer StorageBuffer 19(int)
               72:             TypeVector 19(int) 2
-              73:             TypePointer Uniform 20(ivec4)
+              73:             TypePointer StorageBuffer 20(ivec4)
               82:             TypeVector 19(int) 3
-              96:             TypePointer Uniform 6(int)
+              96:             TypePointer StorageBuffer 6(int)
              102:             TypeVector 6(int) 2
-             103:             TypePointer Uniform 21(ivec4)
+             103:             TypePointer StorageBuffer 21(ivec4)
              112:             TypeVector 6(int) 3
-             126:             TypePointer Uniform 22(float64_t)
+             126:             TypePointer StorageBuffer 22(float64_t)
              132:             TypeVector 22(float64_t) 2
-             133:             TypePointer Uniform 23(f64vec4)
+             133:             TypePointer StorageBuffer 23(f64vec4)
              142:             TypeVector 22(float64_t) 3
              522:             TypeBool
              531:   72(ivec2) ConstantComposite 29 29

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out

@@ -42,7 +42,7 @@ error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUn
                               MemberDecorate 28(Buffers) 1 Offset 16
                               MemberDecorate 28(Buffers) 2 Offset 32
                               MemberDecorate 28(Buffers) 3 Offset 64
-                              Decorate 28(Buffers) BufferBlock
+                              Decorate 28(Buffers) Block
                               Decorate 31(data) DescriptorSet 0
                               Decorate 31(data) Binding 0
                               Decorate 2505 BuiltIn WorkgroupSize
@@ -64,28 +64,28 @@ error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUn
               27:             TypeVector 26(float64_t) 4
      28(Buffers):             TypeStruct 23(fvec4) 25(ivec4) 17(ivec4) 27(f64vec4)
               29:             TypeArray 28(Buffers) 15
-              30:             TypePointer Uniform 29
-        31(data):     30(ptr) Variable Uniform
+              30:             TypePointer StorageBuffer 29
+        31(data):     30(ptr) Variable StorageBuffer
               33:     24(int) Constant 2
               34:     24(int) Constant 0
               35:      6(int) Constant 0
-              36:             TypePointer Uniform 22(float)
-              40:             TypePointer Uniform 17(ivec4)
+              36:             TypePointer StorageBuffer 22(float)
+              40:             TypePointer StorageBuffer 17(ivec4)
               43:             TypeVector 22(float) 2
-              44:             TypePointer Uniform 23(fvec4)
+              44:             TypePointer StorageBuffer 23(fvec4)
               51:             TypeVector 22(float) 3
               63:     24(int) Constant 1
-              64:             TypePointer Uniform 24(int)
+              64:             TypePointer StorageBuffer 24(int)
               70:             TypeVector 24(int) 2
-              71:             TypePointer Uniform 25(ivec4)
+              71:             TypePointer StorageBuffer 25(ivec4)
               78:             TypeVector 24(int) 3
-              90:             TypePointer Uniform 6(int)
+              90:             TypePointer StorageBuffer 6(int)
               96:             TypeVector 6(int) 2
              103:             TypeVector 6(int) 3
              115:     24(int) Constant 3
-             116:             TypePointer Uniform 26(float64_t)
+             116:             TypePointer StorageBuffer 26(float64_t)
              122:             TypeVector 26(float64_t) 2
-             123:             TypePointer Uniform 27(f64vec4)
+             123:             TypePointer StorageBuffer 27(f64vec4)
              130:             TypeVector 26(float64_t) 3
              144:             TypeBool
              152:             TypeVector 144(bool) 2

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out

@@ -36,7 +36,7 @@ spv.subgroupQuad.comp
                               MemberDecorate 24(Buffers) 1 Offset 16
                               MemberDecorate 24(Buffers) 2 Offset 32
                               MemberDecorate 24(Buffers) 3 Offset 64
-                              Decorate 24(Buffers) BufferBlock
+                              Decorate 24(Buffers) Block
                               Decorate 27(data) DescriptorSet 0
                               Decorate 27(data) Binding 0
                               Decorate 615 BuiltIn WorkgroupSize
@@ -57,30 +57,30 @@ spv.subgroupQuad.comp
               23:             TypeVector 22(float64_t) 4
      24(Buffers):             TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4)
               25:             TypeArray 24(Buffers) 15
-              26:             TypePointer Uniform 25
-        27(data):     26(ptr) Variable Uniform
+              26:             TypePointer StorageBuffer 25
+        27(data):     26(ptr) Variable StorageBuffer
               29:     19(int) Constant 0
               30:      6(int) Constant 0
-              31:             TypePointer Uniform 17(float)
+              31:             TypePointer StorageBuffer 17(float)
               34:      6(int) Constant 1
               35:      6(int) Constant 3
               39:     19(int) Constant 1
               40:             TypeVector 17(float) 2
-              41:             TypePointer Uniform 18(fvec4)
+              41:             TypePointer StorageBuffer 18(fvec4)
               50:     19(int) Constant 2
               51:             TypeVector 17(float) 3
               60:     19(int) Constant 3
-              66:             TypePointer Uniform 19(int)
+              66:             TypePointer StorageBuffer 19(int)
               72:             TypeVector 19(int) 2
-              73:             TypePointer Uniform 20(ivec4)
+              73:             TypePointer StorageBuffer 20(ivec4)
               82:             TypeVector 19(int) 3
-              96:             TypePointer Uniform 6(int)
+              96:             TypePointer StorageBuffer 6(int)
              102:             TypeVector 6(int) 2
-             103:             TypePointer Uniform 21(ivec4)
+             103:             TypePointer StorageBuffer 21(ivec4)
              112:             TypeVector 6(int) 3
-             126:             TypePointer Uniform 22(float64_t)
+             126:             TypePointer StorageBuffer 22(float64_t)
              132:             TypeVector 22(float64_t) 2
-             133:             TypePointer Uniform 23(f64vec4)
+             133:             TypePointer StorageBuffer 23(f64vec4)
              142:             TypeVector 22(float64_t) 3
              158:             TypeBool
              167:   72(ivec2) ConstantComposite 29 29

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out

@@ -36,7 +36,7 @@ spv.subgroupShuffle.comp
                               MemberDecorate 24(Buffers) 1 Offset 16
                               MemberDecorate 24(Buffers) 2 Offset 32
                               MemberDecorate 24(Buffers) 3 Offset 64
-                              Decorate 24(Buffers) BufferBlock
+                              Decorate 24(Buffers) Block
                               Decorate 27(data) DescriptorSet 0
                               Decorate 27(data) Binding 0
                               Decorate 378 BuiltIn WorkgroupSize
@@ -57,29 +57,29 @@ spv.subgroupShuffle.comp
               23:             TypeVector 22(float64_t) 4
      24(Buffers):             TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4)
               25:             TypeArray 24(Buffers) 15
-              26:             TypePointer Uniform 25
-        27(data):     26(ptr) Variable Uniform
+              26:             TypePointer StorageBuffer 25
+        27(data):     26(ptr) Variable StorageBuffer
               29:     19(int) Constant 0
               30:      6(int) Constant 0
-              31:             TypePointer Uniform 17(float)
+              31:             TypePointer StorageBuffer 17(float)
               35:      6(int) Constant 3
               39:     19(int) Constant 1
               40:             TypeVector 17(float) 2
-              41:             TypePointer Uniform 18(fvec4)
+              41:             TypePointer StorageBuffer 18(fvec4)
               51:     19(int) Constant 2
               52:             TypeVector 17(float) 3
               62:     19(int) Constant 3
-              69:             TypePointer Uniform 19(int)
+              69:             TypePointer StorageBuffer 19(int)
               76:             TypeVector 19(int) 2
-              77:             TypePointer Uniform 20(ivec4)
+              77:             TypePointer StorageBuffer 20(ivec4)
               87:             TypeVector 19(int) 3
-             103:             TypePointer Uniform 6(int)
+             103:             TypePointer StorageBuffer 6(int)
              110:             TypeVector 6(int) 2
-             111:             TypePointer Uniform 21(ivec4)
+             111:             TypePointer StorageBuffer 21(ivec4)
              121:             TypeVector 6(int) 3
-             137:             TypePointer Uniform 22(float64_t)
+             137:             TypePointer StorageBuffer 22(float64_t)
              144:             TypeVector 22(float64_t) 2
-             145:             TypePointer Uniform 23(f64vec4)
+             145:             TypePointer StorageBuffer 23(f64vec4)
              155:             TypeVector 22(float64_t) 3
              173:             TypeBool
              183:   76(ivec2) ConstantComposite 29 29

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out

@@ -36,7 +36,7 @@ spv.subgroupShuffleRelative.comp
                               MemberDecorate 24(Buffers) 1 Offset 16
                               MemberDecorate 24(Buffers) 2 Offset 32
                               MemberDecorate 24(Buffers) 3 Offset 64
-                              Decorate 24(Buffers) BufferBlock
+                              Decorate 24(Buffers) Block
                               Decorate 27(data) DescriptorSet 0
                               Decorate 27(data) Binding 0
                               Decorate 378 BuiltIn WorkgroupSize
@@ -57,29 +57,29 @@ spv.subgroupShuffleRelative.comp
               23:             TypeVector 22(float64_t) 4
      24(Buffers):             TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4)
               25:             TypeArray 24(Buffers) 15
-              26:             TypePointer Uniform 25
-        27(data):     26(ptr) Variable Uniform
+              26:             TypePointer StorageBuffer 25
+        27(data):     26(ptr) Variable StorageBuffer
               29:     19(int) Constant 0
               30:      6(int) Constant 0
-              31:             TypePointer Uniform 17(float)
+              31:             TypePointer StorageBuffer 17(float)
               35:      6(int) Constant 3
               39:     19(int) Constant 1
               40:             TypeVector 17(float) 2
-              41:             TypePointer Uniform 18(fvec4)
+              41:             TypePointer StorageBuffer 18(fvec4)
               51:     19(int) Constant 2
               52:             TypeVector 17(float) 3
               62:     19(int) Constant 3
-              69:             TypePointer Uniform 19(int)
+              69:             TypePointer StorageBuffer 19(int)
               76:             TypeVector 19(int) 2
-              77:             TypePointer Uniform 20(ivec4)
+              77:             TypePointer StorageBuffer 20(ivec4)
               87:             TypeVector 19(int) 3
-             103:             TypePointer Uniform 6(int)
+             103:             TypePointer StorageBuffer 6(int)
              110:             TypeVector 6(int) 2
-             111:             TypePointer Uniform 21(ivec4)
+             111:             TypePointer StorageBuffer 21(ivec4)
              121:             TypeVector 6(int) 3
-             137:             TypePointer Uniform 22(float64_t)
+             137:             TypePointer StorageBuffer 22(float64_t)
              144:             TypeVector 22(float64_t) 2
-             145:             TypePointer Uniform 23(f64vec4)
+             145:             TypePointer StorageBuffer 23(f64vec4)
              155:             TypeVector 22(float64_t) 3
              173:             TypeBool
              183:   76(ivec2) ConstantComposite 29 29

+ 11 - 11
3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out

@@ -38,7 +38,7 @@ spv.subgroupVote.comp
                               MemberDecorate 24(Buffers) 2 Offset 32
                               MemberDecorate 24(Buffers) 3 Offset 64
                               MemberDecorate 24(Buffers) 4 Offset 96
-                              Decorate 24(Buffers) BufferBlock
+                              Decorate 24(Buffers) Block
                               Decorate 27(data) DescriptorSet 0
                               Decorate 27(data) Binding 0
                               Decorate 215 BuiltIn WorkgroupSize
@@ -59,31 +59,31 @@ spv.subgroupVote.comp
               23:             TypeVector 22(float64_t) 4
      24(Buffers):             TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4) 19(int)
               25:             TypeArray 24(Buffers) 15
-              26:             TypePointer Uniform 25
-        27(data):     26(ptr) Variable Uniform
+              26:             TypePointer StorageBuffer 25
+        27(data):     26(ptr) Variable StorageBuffer
               29:     19(int) Constant 4
-              30:             TypePointer Uniform 19(int)
+              30:             TypePointer StorageBuffer 19(int)
               33:     19(int) Constant 0
               34:             TypeBool
               36:      6(int) Constant 3
               41:      6(int) Constant 0
-              42:             TypePointer Uniform 17(float)
+              42:             TypePointer StorageBuffer 17(float)
               46:     19(int) Constant 1
               50:             TypeVector 17(float) 2
-              51:             TypePointer Uniform 18(fvec4)
+              51:             TypePointer StorageBuffer 18(fvec4)
               59:     19(int) Constant 2
               60:             TypeVector 17(float) 3
               68:     19(int) Constant 3
               81:             TypeVector 19(int) 2
-              82:             TypePointer Uniform 20(ivec4)
+              82:             TypePointer StorageBuffer 20(ivec4)
               90:             TypeVector 19(int) 3
-             104:             TypePointer Uniform 6(int)
+             104:             TypePointer StorageBuffer 6(int)
              111:             TypeVector 6(int) 2
-             112:             TypePointer Uniform 21(ivec4)
+             112:             TypePointer StorageBuffer 21(ivec4)
              120:             TypeVector 6(int) 3
-             142:             TypePointer Uniform 22(float64_t)
+             142:             TypePointer StorageBuffer 22(float64_t)
              149:             TypeVector 22(float64_t) 2
-             150:             TypePointer Uniform 23(f64vec4)
+             150:             TypePointer StorageBuffer 23(f64vec4)
              158:             TypeVector 22(float64_t) 3
              182:   81(ivec2) ConstantComposite 33 33
              183:             TypeVector 34(bool) 2

+ 10 - 7
3rdparty/glslang/Test/runtests

@@ -166,13 +166,14 @@ diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1
 # Test --client and --target-env
 #
 echo "Testing --client and --target-env"
-$EXE --client vulkan100      spv.targetVulkan.vert || HASERROR=1
-$EXE --client opengl100      spv.targetOpenGL.vert || HASERROR=1
-$EXE --target-env vulkan1.0  spv.targetVulkan.vert || HASERROR=1
-$EXE --target-env vulkan1.1  spv.targetVulkan.vert || HASERROR=1
-$EXE --target-env opengl     spv.targetOpenGL.vert || HASERROR=1
-$EXE -V100                   spv.targetVulkan.vert || HASERROR=1
-$EXE -G100                   spv.targetOpenGL.vert || HASERROR=1
+$EXE --client vulkan100       spv.targetVulkan.vert || HASERROR=1
+$EXE --client opengl100       spv.targetOpenGL.vert || HASERROR=1
+$EXE --target-env vulkan1.0   spv.targetVulkan.vert || HASERROR=1
+$EXE --target-env vulkan1.1   spv.targetVulkan.vert || HASERROR=1
+$EXE --target-env opengl      spv.targetOpenGL.vert || HASERROR=1
+$EXE -V100                    spv.targetVulkan.vert || HASERROR=1
+$EXE -G100                    spv.targetOpenGL.vert || HASERROR=1
+$EXE --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1
 
 #
 # Testing GLSL entry point rename
@@ -208,6 +209,7 @@ diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out ||
 #
 # Testing hlsl_functionality1
 #
+echo "Testing hlsl_functionality1"
 $EXE -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \
     $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out
 diff -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out $TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out || HASERROR=1
@@ -218,6 +220,7 @@ diff -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out $TARGETDIR/hlsl.noSeman
 #
 # Testing HLSL-specific PP feature expansion
 #
+echo "Testing HLSL-specific PP feature expansion"
 $EXE -D -E hlsl.pp.expand.frag > $TARGETDIR/hlsl.pp.expand.frag.out 2> $TARGETDIR/hlsl.pp.expand.frag.err
 diff -b $BASEDIR/hlsl.pp.expand.frag.out $TARGETDIR/hlsl.pp.expand.frag.out || HASERROR=1
 diff -b $BASEDIR/hlsl.pp.expand.frag.err $TARGETDIR/hlsl.pp.expand.frag.err || HASERROR=1

+ 15 - 0
3rdparty/glslang/Test/spv.1.3.8bitstorage-ssbo.vert

@@ -0,0 +1,15 @@
+#version 450
+
+#extension GL_EXT_shader_8bit_storage: require
+
+layout(binding = 0) readonly buffer Vertices
+{
+    uint8_t vertices[];
+};
+
+layout(location = 0) out vec4 color;
+
+void main()
+{
+    color = vec4(int(vertices[gl_VertexIndex]));
+}

+ 15 - 0
3rdparty/glslang/Test/spv.1.3.8bitstorage-ubo.vert

@@ -0,0 +1,15 @@
+#version 450
+
+#extension GL_EXT_shader_8bit_storage: require
+
+layout(binding = 0) readonly uniform Vertices
+{
+    uint8_t vertices[512];
+};
+
+layout(location = 0) out vec4 color;
+
+void main()
+{
+    color = vec4(int(vertices[gl_VertexIndex]));
+}

+ 15 - 0
3rdparty/glslang/Test/spv.8bitstorage-ssbo.vert

@@ -0,0 +1,15 @@
+#version 450
+
+#extension GL_EXT_shader_8bit_storage: require
+
+layout(binding = 0) readonly buffer Vertices
+{
+    uint8_t vertices[];
+};
+
+layout(location = 0) out vec4 color;
+
+void main()
+{
+    color = vec4(int(vertices[gl_VertexIndex]));
+}

+ 15 - 0
3rdparty/glslang/Test/spv.8bitstorage-ubo.vert

@@ -0,0 +1,15 @@
+#version 450
+
+#extension GL_EXT_shader_8bit_storage: require
+
+layout(binding = 0) readonly uniform Vertices
+{
+    uint8_t vertices[512];
+};
+
+layout(location = 0) out vec4 color;
+
+void main()
+{
+    color = vec4(int(vertices[gl_VertexIndex]));
+}

+ 21 - 0
3rdparty/glslang/Test/spv.perprimitiveNV.frag

@@ -0,0 +1,21 @@
+#version 460
+
+#extension GL_NV_mesh_shader: require
+
+layout(location=0) 
+in B {
+    perprimitiveNV float f;
+};
+
+layout(location=4) 
+in C {
+    flat centroid float h;
+};
+
+layout(location=8) 
+out float g;
+
+void main()
+{
+    g = f + h;
+}

+ 1 - 1
3rdparty/glslang/glslang/Include/revision.h

@@ -1,3 +1,3 @@
 // This header is generated by the make-revision script.
 
-#define GLSLANG_PATCH_LEVEL 2904
+#define GLSLANG_PATCH_LEVEL 2933

+ 8 - 2
3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp

@@ -76,6 +76,10 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b
     globalBufferDefaults.layoutMatrix = ElmColumnMajor;
     globalBufferDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd430 : ElpShared;
 
+    // use storage buffer on SPIR-V 1.3 and up
+    if (spvVersion.spv >= EShTargetSpv_1_3)
+        intermediate.setUseStorageBuffer();
+
     globalInputDefaults.clear();
     globalOutputDefaults.clear();
 
@@ -1503,14 +1507,14 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
 {
     const TIntermSequence* argp = &callNode.getAsAggregate()->getSequence();
 
-    const int gl_SemanticsRelaxed         = 0x0;
+    //const int gl_SemanticsRelaxed         = 0x0;
     const int gl_SemanticsAcquire         = 0x2;
     const int gl_SemanticsRelease         = 0x4;
     const int gl_SemanticsAcquireRelease  = 0x8;
     const int gl_SemanticsMakeAvailable   = 0x2000;
     const int gl_SemanticsMakeVisible     = 0x4000;
 
-    const int gl_StorageSemanticsNone     = 0x0;
+    //const int gl_StorageSemanticsNone     = 0x0;
     const int gl_StorageSemanticsBuffer   = 0x40;
     const int gl_StorageSemanticsShared   = 0x100;
     const int gl_StorageSemanticsImage    = 0x800;
@@ -4514,6 +4518,8 @@ void TParseContext::finish()
         break;
 #ifdef NV_EXTENSIONS
     case EShLangTaskNV:
+        requireExtensions(getCurrentLoc(), 1, &E_GL_NV_mesh_shader, "task shaders");
+        break;
     case EShLangMeshNV:
         requireExtensions(getCurrentLoc(), 1, &E_GL_NV_mesh_shader, "mesh shaders");
         break;

+ 5 - 2
3rdparty/glslang/glslang/MachineIndependent/Versions.cpp

@@ -842,9 +842,12 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
 {
 #ifdef NV_EXTENSIONS
     // GL_NV_mesh_shader extension is only allowed in task/mesh shaders
-    if (strcmp(extension, "GL_NV_mesh_shader") == 0)
-        requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask),
+    if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
+        requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask | EShLangFragmentMask),
                      "#extension GL_NV_mesh_shader");
+        profileRequires(loc, ECoreProfile, 450, 0, "#extension GL_NV_mesh_shader");
+        profileRequires(loc, EEsProfile, 320, 0, "#extension GL_NV_mesh_shader");
+    }
 #endif
 }
 

+ 6 - 6
3rdparty/glslang/glslang/MachineIndependent/glslang.y

@@ -1157,30 +1157,30 @@ interpolation_qualifier
     }
     | PERPRIMITIVENV {
 #ifdef NV_EXTENSIONS
+        // No need for profile version or extension check. Shader stage already checks both.
         parseContext.globalCheck($1.loc, "perprimitiveNV");
         parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_NV_mesh_shader, "perprimitiveNV");
-        parseContext.profileRequires($1.loc, EEsProfile, 320, E_GL_NV_mesh_shader, "perprimitiveNV");
+        // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
+        if (parseContext.language == EShLangFragment)
+            parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
         $$.init($1.loc);
         $$.qualifier.perPrimitiveNV = true;
 #endif
     }
     | PERVIEWNV {
 #ifdef NV_EXTENSIONS
+        // No need for profile version or extension check. Shader stage already checks both.
         parseContext.globalCheck($1.loc, "perviewNV");
         parseContext.requireStage($1.loc, EShLangMeshNV, "perviewNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_NV_mesh_shader, "perviewNV");
-        parseContext.profileRequires($1.loc, EEsProfile, 320, E_GL_NV_mesh_shader, "perviewNV");
         $$.init($1.loc);
         $$.qualifier.perViewNV = true;
 #endif
     }
     | PERTASKNV {
 #ifdef NV_EXTENSIONS
+        // No need for profile version or extension check. Shader stage already checks both.
         parseContext.globalCheck($1.loc, "taskNV");
         parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_NV_mesh_shader, "taskNV");
-        parseContext.profileRequires($1.loc, EEsProfile, 320, E_GL_NV_mesh_shader, "taskNV");
         $$.init($1.loc);
         $$.qualifier.perTaskNV = true;
 #endif

+ 11 - 11
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp

@@ -948,7 +948,7 @@ static const yytype_uint16 yyrline[] =
      820,   825,   834,   834,   845,   849,   856,   863,   866,   873,
      881,   901,   924,   939,   964,   975,   985,   995,  1005,  1014,
     1017,  1021,  1025,  1030,  1038,  1043,  1048,  1053,  1058,  1067,
-    1078,  1105,  1114,  1121,  1128,  1139,  1148,  1158,  1168,  1178,
+    1078,  1105,  1114,  1121,  1128,  1139,  1148,  1158,  1170,  1179,
     1191,  1197,  1200,  1207,  1211,  1215,  1223,  1232,  1235,  1246,
     1249,  1252,  1256,  1260,  1264,  1268,  1274,  1278,  1290,  1304,
     1309,  1315,  1321,  1328,  1334,  1339,  1344,  1349,  1359,  1369,
@@ -5515,40 +5515,40 @@ yyreduce:
 #line 1158 "MachineIndependent/glslang.y" /* yacc.c:1646  */
     {
 #ifdef NV_EXTENSIONS
+        // No need for profile version or extension check. Shader stage already checks both.
         parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV");
         parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV");
-        parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_NV_mesh_shader, "perprimitiveNV");
-        parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, E_GL_NV_mesh_shader, "perprimitiveNV");
+        // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
+        if (parseContext.language == EShLangFragment)
+            parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
         (yyval.interm.type).init((yyvsp[0].lex).loc);
         (yyval.interm.type).qualifier.perPrimitiveNV = true;
 #endif
     }
-#line 5527 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646  */
+#line 5529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646  */
     break;
 
   case 138:
-#line 1168 "MachineIndependent/glslang.y" /* yacc.c:1646  */
+#line 1170 "MachineIndependent/glslang.y" /* yacc.c:1646  */
     {
 #ifdef NV_EXTENSIONS
+        // No need for profile version or extension check. Shader stage already checks both.
         parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV");
         parseContext.requireStage((yyvsp[0].lex).loc, EShLangMeshNV, "perviewNV");
-        parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_NV_mesh_shader, "perviewNV");
-        parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, E_GL_NV_mesh_shader, "perviewNV");
         (yyval.interm.type).init((yyvsp[0].lex).loc);
         (yyval.interm.type).qualifier.perViewNV = true;
 #endif
     }
-#line 5542 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646  */
+#line 5543 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646  */
     break;
 
   case 139:
-#line 1178 "MachineIndependent/glslang.y" /* yacc.c:1646  */
+#line 1179 "MachineIndependent/glslang.y" /* yacc.c:1646  */
     {
 #ifdef NV_EXTENSIONS
+        // No need for profile version or extension check. Shader stage already checks both.
         parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV");
         parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV");
-        parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_NV_mesh_shader, "taskNV");
-        parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, E_GL_NV_mesh_shader, "taskNV");
         (yyval.interm.type).init((yyvsp[0].lex).loc);
         (yyval.interm.type).qualifier.perTaskNV = true;
 #endif

+ 1 - 1
3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp

@@ -457,7 +457,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
 
         int location = intermediate.getUniformLocationOverride(name);
         if (location != -1)
-                return location;
+            return location;
 
         location = nextUniformLocation;
 

+ 13 - 10
3rdparty/glslang/glslang/MachineIndependent/localintermediate.h

@@ -664,7 +664,8 @@ public:
     const std::string& getSourceFile() const { return sourceFile; }
     void addSourceText(const char* text) { sourceText = sourceText + text; }
     const std::string& getSourceText() const { return sourceText; }
-    void addProcesses(const std::vector<std::string>& p) {
+    void addProcesses(const std::vector<std::string>& p)
+    {
         for (int i = 0; i < (int)p.size(); ++i)
             processes.addProcess(p[i]);
     }
@@ -672,18 +673,20 @@ public:
     void addProcessArgument(const std::string& arg) { processes.addArgument(arg); }
     const std::vector<std::string>& getProcesses() const { return processes.getProcesses(); }
 
-    void addUniformLocationOverride(const TString& name, int location)
+    void addUniformLocationOverride(const char* nameStr, int location)
     {
-            uniformLocationOverrides[name] = location;
+        std::string name = nameStr;
+        uniformLocationOverrides[name] = location;
     }
 
-    int getUniformLocationOverride(const TString& name) const
+    int getUniformLocationOverride(const char* nameStr) const
     {
-            auto pos = uniformLocationOverrides.find(name);
-            if (pos == uniformLocationOverrides.end())
-                    return -1;
-            else
-                    return pos->second;
+        std::string name = nameStr;
+        auto pos = uniformLocationOverrides.find(name);
+        if (pos == uniformLocationOverrides.end())
+            return -1;
+        else
+            return pos->second;
     }
 
     void setUniformLocationBase(int base) { uniformLocationBase = base; }
@@ -814,7 +817,7 @@ protected:
     bool needToLegalize;
     bool binaryDoubleOutput;
 
-    std::unordered_map<TString, int> uniformLocationOverrides;
+    std::unordered_map<std::string, int> uniformLocationOverrides;
     int uniformLocationBase;
 
 private:

+ 3 - 0
3rdparty/glslang/glslang/Public/ShaderLang.h

@@ -154,7 +154,10 @@ typedef EShTargetClientVersion EshTargetClientVersion;
 
 typedef enum {
     EShTargetSpv_1_0 = (1 << 16),
+    EShTargetSpv_1_1 = (1 << 16) | (1 << 8),
+    EShTargetSpv_1_2 = (1 << 16) | (2 << 8),
     EShTargetSpv_1_3 = (1 << 16) | (3 << 8),
+    EShTargetSpv_1_4 = (1 << 16) | (4 << 8),
 } EShTargetLanguageVersion;
 
 struct TInputLanguage {

+ 5 - 0
3rdparty/glslang/gtests/Spv.FromFile.cpp

@@ -241,6 +241,8 @@ INSTANTIATE_TEST_CASE_P(
         "spv.8bitstorage_Error-int.frag",
         "spv.8bitstorage-uint.frag",
         "spv.8bitstorage_Error-uint.frag",
+        "spv.8bitstorage-ubo.vert",
+        "spv.8bitstorage-ssbo.vert",
         "spv.accessChain.frag",
         "spv.aggOps.frag",
         "spv.always-discard.frag",
@@ -365,6 +367,8 @@ INSTANTIATE_TEST_CASE_P(
 INSTANTIATE_TEST_CASE_P(
     Glsl, CompileVulkan1_1ToSpirvTest,
     ::testing::ValuesIn(std::vector<std::string>({
+        "spv.1.3.8bitstorage-ubo.vert",
+        "spv.1.3.8bitstorage-ssbo.vert",
         "spv.deviceGroup.frag",
         "spv.drawParams.vert",
         "spv.int8.frag",
@@ -528,6 +532,7 @@ INSTANTIATE_TEST_CASE_P(
     "spv.meshShaderRedeclBuiltins.mesh",
     "spv.meshShaderRedeclPerViewBuiltins.mesh",
     "spv.meshTaskShader.task",
+    "spv.perprimitiveNV.frag",
 })),
 FileNameAsCustomTestSuffix
 );

+ 0 - 3
3rdparty/glslang/hlsl/hlslParseHelper.cpp

@@ -97,9 +97,6 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
 
     if (language == EShLangGeometry)
         globalOutputDefaults.layoutStream = 0;
-
-    if (spvVersion.spv == 0 || spvVersion.vulkan == 0)
-        infoSink.info << "ERROR: HLSL currently only supported when requesting SPIR-V for Vulkan.\n";
 }
 
 HlslParseContext::~HlslParseContext()