From 5b704808d6cb591e8bcceb6d0dae7acf77ae7bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 26 Oct 2018 18:44:52 -0700 Subject: [PATCH] Updated glslang. --- 3rdparty/glslang/.appveyor.yml | 5 +- 3rdparty/glslang/BUILD.gn | 15 --- 3rdparty/glslang/README.md | 9 ++ 3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 27 ++++- 3rdparty/glslang/SPIRV/SpvPostProcess.cpp | 2 +- 3rdparty/glslang/SPIRV/SpvTools.cpp | 4 +- 3rdparty/glslang/StandAlone/StandAlone.cpp | 107 +++++++++++++----- .../Test/baseResults/hlsl.pp.expand.frag.err | 3 - .../spv.1.3.8bitstorage-ssbo.vert.out | 56 +++++++++ .../spv.1.3.8bitstorage-ubo.vert.out | 56 +++++++++ .../baseResults/spv.8bitstorage-int.frag.out | 1 - .../baseResults/spv.8bitstorage-ssbo.vert.out | 56 +++++++++ .../baseResults/spv.8bitstorage-ubo.vert.out | 56 +++++++++ .../baseResults/spv.8bitstorage-uint.frag.out | 1 - .../baseResults/spv.debugInfo.1.1.frag.out | 1 + .../baseResults/spv.perprimitiveNV.frag.out | 54 +++++++++ .../Test/baseResults/spv.subgroup.geom.out | 8 +- .../Test/baseResults/spv.subgroup.tesc.out | 8 +- .../Test/baseResults/spv.subgroup.tese.out | 8 +- .../Test/baseResults/spv.subgroup.vert.out | 8 +- .../spv.subgroupArithmetic.comp.out | 22 ++-- .../baseResults/spv.subgroupBallot.comp.out | 22 ++-- .../baseResults/spv.subgroupBasic.comp.out | 8 +- .../spv.subgroupClustered.comp.out | 22 ++-- .../spv.subgroupPartitioned.comp.out | 22 ++-- .../baseResults/spv.subgroupQuad.comp.out | 22 ++-- .../baseResults/spv.subgroupShuffle.comp.out | 22 ++-- .../spv.subgroupShuffleRelative.comp.out | 22 ++-- .../baseResults/spv.subgroupVote.comp.out | 22 ++-- 3rdparty/glslang/Test/runtests | 17 +-- .../Test/spv.1.3.8bitstorage-ssbo.vert | 15 +++ .../glslang/Test/spv.1.3.8bitstorage-ubo.vert | 15 +++ .../glslang/Test/spv.8bitstorage-ssbo.vert | 15 +++ .../glslang/Test/spv.8bitstorage-ubo.vert | 15 +++ 3rdparty/glslang/Test/spv.perprimitiveNV.frag | 21 ++++ 3rdparty/glslang/glslang/Include/revision.h | 2 +- .../MachineIndependent/ParseHelper.cpp | 10 +- .../glslang/MachineIndependent/Versions.cpp | 7 +- .../glslang/MachineIndependent/glslang.y | 12 +- .../MachineIndependent/glslang_tab.cpp | 22 ++-- .../glslang/MachineIndependent/iomapper.cpp | 2 +- .../MachineIndependent/localintermediate.h | 23 ++-- 3rdparty/glslang/glslang/Public/ShaderLang.h | 3 + 3rdparty/glslang/gtests/Spv.FromFile.cpp | 5 + 3rdparty/glslang/hlsl/hlslParseHelper.cpp | 3 - 45 files changed, 644 insertions(+), 212 deletions(-) mode change 100644 => 100755 3rdparty/glslang/.appveyor.yml mode change 100644 => 100755 3rdparty/glslang/SPIRV/GlslangToSpv.cpp mode change 100644 => 100755 3rdparty/glslang/StandAlone/StandAlone.cpp create mode 100644 3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out create mode 100644 3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out create mode 100644 3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out create mode 100644 3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out create mode 100644 3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out create mode 100644 3rdparty/glslang/Test/spv.1.3.8bitstorage-ssbo.vert create mode 100644 3rdparty/glslang/Test/spv.1.3.8bitstorage-ubo.vert create mode 100644 3rdparty/glslang/Test/spv.8bitstorage-ssbo.vert create mode 100644 3rdparty/glslang/Test/spv.8bitstorage-ubo.vert create mode 100644 3rdparty/glslang/Test/spv.perprimitiveNV.frag mode change 100644 => 100755 3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp mode change 100644 => 100755 3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp mode change 100644 => 100755 3rdparty/glslang/glslang/MachineIndependent/localintermediate.h mode change 100644 => 100755 3rdparty/glslang/glslang/Public/ShaderLang.h mode change 100644 => 100755 3rdparty/glslang/hlsl/hlslParseHelper.cpp diff --git a/3rdparty/glslang/.appveyor.yml b/3rdparty/glslang/.appveyor.yml old mode 100644 new mode 100755 index 55ce61869..5765d9e66 --- a/3rdparty/glslang/.appveyor.yml +++ b/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 diff --git a/3rdparty/glslang/BUILD.gn b/3rdparty/glslang/BUILD.gn index 6239fd02f..a84dbe22e 100644 --- a/3rdparty/glslang/BUILD.gn +++ b/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" ] -} - diff --git a/3rdparty/glslang/README.md b/3rdparty/glslang/README.md index 544081dcd..ba7160da5 100755 --- a/3rdparty/glslang/README.md +++ b/3rdparty/glslang/README.md @@ -84,6 +84,15 @@ cd 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: diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp old mode 100644 new mode 100755 index c222ccb74..21a8c0ca8 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -1265,14 +1265,14 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl std::string text; const std::vector& 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) diff --git a/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/3rdparty/glslang/SPIRV/SpvPostProcess.cpp index 27f145d03..3193ac957 100755 --- a/3rdparty/glslang/SPIRV/SpvPostProcess.cpp +++ b/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 } diff --git a/3rdparty/glslang/SPIRV/SpvTools.cpp b/3rdparty/glslang/SPIRV/SpvTools.cpp index 4807b4255..bc9bf9e08 100755 --- a/3rdparty/glslang/SPIRV/SpvTools.cpp +++ b/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& spirv, - spv::SpvBuildLogger* logger, const SpvOptions* options) +void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector& spirv, + spv::SpvBuildLogger*, const SpvOptions* options) { spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; diff --git a/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/glslang/StandAlone/StandAlone.cpp old mode 100644 new mode 100755 index f60ffaa74..060428bf1 --- a/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -161,13 +161,17 @@ const char* shaderStageName = nullptr; const char* variableName = nullptr; bool HlslEnable16BitTypes = false; std::vector 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 Processes; // what should be recorded by OpModuleProcessed, or equivalent // Per descriptor-set binding base data @@ -421,6 +425,9 @@ void ProcessArguments(std::vector>& 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>& 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>& 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>& workItem Options |= EOptionOutputPreprocessed; break; case 'G': - // OpenGL Client + // OpenGL client setOpenGlSpv(); if (argv[0][2] != 0) ClientInputSemanticsVersion = getAttachedNumber("-G client input semantics"); @@ -736,6 +760,28 @@ void ProcessArguments(std::vector>& 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 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 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 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'\n" " * 'opengl' under '--client opengl'\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 \n" " --vn creates a C header file that contains a\n" " uint32_t array named \n" diff --git a/3rdparty/glslang/Test/baseResults/hlsl.pp.expand.frag.err b/3rdparty/glslang/Test/baseResults/hlsl.pp.expand.frag.err index 1b5681fec..e69de29bb 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.pp.expand.frag.err +++ b/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. - diff --git a/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out b/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ssbo.vert.out new file mode 100644 index 000000000..878aa1a2e --- /dev/null +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out b/3rdparty/glslang/Test/baseResults/spv.1.3.8bitstorage-ubo.vert.out new file mode 100644 index 000000000..54b497ff3 --- /dev/null +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out b/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out index 55a8b3bd7..96cb2ae5d 100644 --- a/3rdparty/glslang/Test/baseResults/spv.8bitstorage-int.frag.out +++ b/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" diff --git a/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out b/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ssbo.vert.out new file mode 100644 index 000000000..1e2337836 --- /dev/null +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out b/3rdparty/glslang/Test/baseResults/spv.8bitstorage-ubo.vert.out new file mode 100644 index 000000000..a6a05cfb5 --- /dev/null +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out b/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out index 461cec4f3..415bada43 100644 --- a/3rdparty/glslang/Test/baseResults/spv.8bitstorage-uint.frag.out +++ b/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" diff --git a/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out b/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out index 7ba005225..f9c8578ca 100644 --- a/3rdparty/glslang/Test/baseResults/spv.debugInfo.1.1.frag.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out b/3rdparty/glslang/Test/baseResults/spv.perprimitiveNV.frag.out new file mode 100644 index 000000000..eaff400c0 --- /dev/null +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out b/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out index 8f134c712..a68343af6 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroup.geom.out +++ b/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) diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out b/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out index 2a7a96325..4e362e2dd 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroup.tesc.out +++ b/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) diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out b/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out index 68c8076b1..e09f558d5 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroup.tese.out +++ b/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) diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out b/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out index e4e778491..2fbc92ba2 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroup.vert.out +++ b/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) diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out index c38d4d0ae..f4e251a0c 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupArithmetic.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out index 7b24337be..23a59132a 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupBallot.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out index 647712fd3..641534d5b 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupBasic.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out index 0c5c0c4d6..150eb8aa4 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupClustered.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out index f65d9962c..e967df4a2 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupPartitioned.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out index 0299fc9ab..435c490f4 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupQuad.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out index 2f5e4aa58..991c6fa77 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupShuffle.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out index 757d4cab3..3aad7605b 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupShuffleRelative.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out b/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out index 89213da1a..4fdbb0be0 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subgroupVote.comp.out +++ b/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 diff --git a/3rdparty/glslang/Test/runtests b/3rdparty/glslang/Test/runtests index d36f3a8cf..8cc8b7a80 100755 --- a/3rdparty/glslang/Test/runtests +++ b/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 diff --git a/3rdparty/glslang/Test/spv.1.3.8bitstorage-ssbo.vert b/3rdparty/glslang/Test/spv.1.3.8bitstorage-ssbo.vert new file mode 100644 index 000000000..61ba7bf15 --- /dev/null +++ b/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])); +} diff --git a/3rdparty/glslang/Test/spv.1.3.8bitstorage-ubo.vert b/3rdparty/glslang/Test/spv.1.3.8bitstorage-ubo.vert new file mode 100644 index 000000000..5c49a2434 --- /dev/null +++ b/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])); +} diff --git a/3rdparty/glslang/Test/spv.8bitstorage-ssbo.vert b/3rdparty/glslang/Test/spv.8bitstorage-ssbo.vert new file mode 100644 index 000000000..61ba7bf15 --- /dev/null +++ b/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])); +} diff --git a/3rdparty/glslang/Test/spv.8bitstorage-ubo.vert b/3rdparty/glslang/Test/spv.8bitstorage-ubo.vert new file mode 100644 index 000000000..5c49a2434 --- /dev/null +++ b/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])); +} diff --git a/3rdparty/glslang/Test/spv.perprimitiveNV.frag b/3rdparty/glslang/Test/spv.perprimitiveNV.frag new file mode 100644 index 000000000..56e00f546 --- /dev/null +++ b/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; +} diff --git a/3rdparty/glslang/glslang/Include/revision.h b/3rdparty/glslang/glslang/Include/revision.h index b5951928f..900a0b437 100644 --- a/3rdparty/glslang/glslang/Include/revision.h +++ b/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 diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp old mode 100644 new mode 100755 index 82ccc9e47..3063d372e --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/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; diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index 9ca20a595..b26bc3e83 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/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 } diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/glslang/glslang/MachineIndependent/glslang.y index cd4256d76..f6e33c6dd 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang.y +++ b/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 diff --git a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp index 9b9df5120..4b70ee3ce 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/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 diff --git a/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp old mode 100644 new mode 100755 index e68e32fb3..46c755837 --- a/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/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; diff --git a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h old mode 100644 new mode 100755 index 59fbaa989..99f777f11 --- a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +++ b/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& p) { + void addProcesses(const std::vector& 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& 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 uniformLocationOverrides; + std::unordered_map uniformLocationOverrides; int uniformLocationBase; private: diff --git a/3rdparty/glslang/glslang/Public/ShaderLang.h b/3rdparty/glslang/glslang/Public/ShaderLang.h old mode 100644 new mode 100755 index 74ab3529b..070882938 --- a/3rdparty/glslang/glslang/Public/ShaderLang.h +++ b/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 { diff --git a/3rdparty/glslang/gtests/Spv.FromFile.cpp b/3rdparty/glslang/gtests/Spv.FromFile.cpp index 815839143..5f03ac1f1 100644 --- a/3rdparty/glslang/gtests/Spv.FromFile.cpp +++ b/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({ + "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 ); diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/3rdparty/glslang/hlsl/hlslParseHelper.cpp old mode 100644 new mode 100755 index 1672365c0..135e1d288 --- a/3rdparty/glslang/hlsl/hlslParseHelper.cpp +++ b/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()