From 0eb67a9c85ffb68ebbe86fdbe4db8f9fbe90427a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 19 Nov 2017 13:01:01 -0800 Subject: [PATCH] Updated glslang. --- 3rdparty/glslang/.appveyor.yml | 7 + .../glslang/OGLCompilersDLL/InitializeDll.cpp | 34 +- .../glslang/OGLCompilersDLL/InitializeDll.h | 4 +- 3rdparty/glslang/README.md | 7 + 3rdparty/glslang/StandAlone/StandAlone.cpp | 61 +- .../hlsl.flattenSubset2.frag.out | 37 + .../hlsl.partialFlattenLocal.vert.out | 91 ++ .../hlsl.partialFlattenMixed.vert.out | 38 + .../Test/baseResults/hlsl.gs-hs-mix.tesc.out | 1158 +++++++++++++++++ .../Test/baseResults/hlsl.snorm.uav.comp.out | 212 +++ .../baseResults/hlsl.texturebuffer.frag.out | 153 +++ 3rdparty/glslang/Test/hlsl.gs-hs-mix.tesc | 119 ++ 3rdparty/glslang/Test/hlsl.snorm.uav.comp | 15 + 3rdparty/glslang/Test/hlsl.texturebuffer.frag | 17 + .../glslang/Include/InitializeGlobals.h | 3 - 3rdparty/glslang/glslang/Include/PoolAlloc.h | 9 +- 3rdparty/glslang/glslang/Include/ShHandle.h | 7 +- .../glslang/MachineIndependent/PoolAlloc.cpp | 49 +- .../glslang/MachineIndependent/ShaderLang.cpp | 75 +- .../glslang/OSDependent/Unix/ossource.cpp | 13 + 3rdparty/glslang/glslang/Public/ShaderLang.h | 7 +- 3rdparty/glslang/gtests/Hlsl.FromFile.cpp | 8 +- 3rdparty/glslang/hlsl/hlslGrammar.cpp | 63 + 3rdparty/glslang/hlsl/hlslGrammar.h | 1 + 3rdparty/glslang/hlsl/hlslParseHelper.cpp | 5 + 3rdparty/glslang/hlsl/hlslScanContext.cpp | 2 + 3rdparty/glslang/hlsl/hlslTokens.h | 1 + 27 files changed, 2064 insertions(+), 132 deletions(-) create mode 100755 3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out create mode 100755 3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out create mode 100755 3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out create mode 100644 3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out create mode 100644 3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out create mode 100644 3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out create mode 100644 3rdparty/glslang/Test/hlsl.gs-hs-mix.tesc create mode 100644 3rdparty/glslang/Test/hlsl.snorm.uav.comp create mode 100644 3rdparty/glslang/Test/hlsl.texturebuffer.frag diff --git a/3rdparty/glslang/.appveyor.yml b/3rdparty/glslang/.appveyor.yml index 33a683747..07e269bed 100644 --- a/3rdparty/glslang/.appveyor.yml +++ b/3rdparty/glslang/.appveyor.yml @@ -17,6 +17,13 @@ branches: only: - master +# Travis advances the master-tot tag to current top of the tree after +# each push into the master branch, because it relies on that tag to +# upload build artifacts to the master-tot release. This will cause +# double testing for each push on Appveyor: one for the push, one for +# the tag advance. Disable testing tags. +skip_tags: true + clone_depth: 5 matrix: diff --git a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp index 2eb912c42..abea9108b 100644 --- a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp +++ b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp @@ -38,13 +38,17 @@ #include "InitializeDll.h" #include "../glslang/Include/InitializeGlobals.h" - #include "../glslang/Public/ShaderLang.h" +#include "../glslang/Include/PoolAlloc.h" namespace glslang { OS_TLSIndex ThreadInitializeIndex = OS_INVALID_TLS_INDEX; +// Per-process initialization. +// Needs to be called at least once before parsing, etc. is done. +// Will also do thread initialization for the calling thread; other +// threads will need to do that explicitly. bool InitProcess() { glslang::GetGlobalLock(); @@ -85,7 +89,9 @@ bool InitProcess() return true; } - +// Per-thread scoped initialization. +// Must be called at least once by each new thread sharing the +// symbol tables, etc., needed to parse. bool InitThread() { // @@ -99,17 +105,21 @@ bool InitThread() if (OS_GetTLSValue(ThreadInitializeIndex) != 0) return true; - InitializeMemoryPools(); - if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) { assert(0 && "InitThread(): Unable to set init flag."); return false; } + glslang::SetThreadPoolAllocator(nullptr); + return true; } - +// Not necessary to call this: InitThread() is reentrant, and the need +// to do per thread tear down has been removed. +// +// This is kept, with memory management removed, to satisfy any exiting +// calls to it that rely on it. bool DetachThread() { bool success = true; @@ -125,14 +135,18 @@ bool DetachThread() assert(0 && "DetachThread(): Unable to clear init flag."); success = false; } - - FreeGlobalPools(); - } return success; } +// Not necessary to call this: InitProcess() is reentrant. +// +// This is kept, with memory management removed, to satisfy any exiting +// calls to it that rely on it. +// +// Users of glslang should call shFinalize() or glslang::FinalizeProcess() for +// process-scoped memory tear down. bool DetachProcess() { bool success = true; @@ -140,12 +154,8 @@ bool DetachProcess() if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) return true; - ShFinalize(); - success = DetachThread(); - FreePoolIndex(); - OS_FreeTLSIndex(ThreadInitializeIndex); ThreadInitializeIndex = OS_INVALID_TLS_INDEX; diff --git a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h index 60b2b1593..661cee4d2 100644 --- a/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h +++ b/3rdparty/glslang/OGLCompilersDLL/InitializeDll.h @@ -40,8 +40,8 @@ namespace glslang { bool InitProcess(); bool InitThread(); -bool DetachThread(); -bool DetachProcess(); +bool DetachThread(); // not called from standalone, perhaps other tools rely on parts of it +bool DetachProcess(); // not called from standalone, perhaps other tools rely on parts of it } // end namespace glslang diff --git a/3rdparty/glslang/README.md b/3rdparty/glslang/README.md index 9d5efb5a3..7ade2dcd9 100644 --- a/3rdparty/glslang/README.md +++ b/3rdparty/glslang/README.md @@ -49,6 +49,12 @@ There is also a non-shader extension Building -------- +Instead of building manually, you can also download the binaries for your +platform directly from the [master-tot release][master-tot-release] on GitHub. +Those binaries are automatically uploaded by the buildbots after successful +testing and they always reflect the current top of the tree of the master +branch. + ### Dependencies * [CMake][cmake]: for generating compilation targets. @@ -318,3 +324,4 @@ Basic Internal Operation [bison]: https://www.gnu.org/software/bison/ [googletest]: https://github.com/google/googletest [bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm +[master-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/master-tot diff --git a/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/glslang/StandAlone/StandAlone.cpp index 87d1f5b7a..e7844eb21 100644 --- a/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -127,6 +127,9 @@ void InfoLogMsg(const char* msg, const char* name, const int num); bool CompileFailed = false; bool LinkFailed = false; +// array of unique places to leave the shader names and infologs for the asynchronous compiles +std::vector> WorkItems; + TBuiltInResource Resources; std::string ConfigFile; @@ -1022,14 +1025,10 @@ void CompileAndLinkShaderFiles(glslang::TWorklist& Worklist) FreeFileData(const_cast(it->text[0])); } -int C_DECL main(int argc, char* argv[]) +int singleMain() { - // array of unique places to leave the shader names and infologs for the asynchronous compiles - std::vector> workItems; - ProcessArguments(workItems, argc, argv); - glslang::TWorklist workList; - std::for_each(workItems.begin(), workItems.end(), [&workList](std::unique_ptr& item) { + std::for_each(WorkItems.begin(), WorkItems.end(), [&workList](std::unique_ptr& item) { assert(item); workList.add(item.get()); }); @@ -1061,8 +1060,8 @@ int C_DECL main(int argc, char* argv[]) } if (Options & EOptionStdin) { - workItems.push_back(std::unique_ptr{new glslang::TWorkItem("stdin")}); - workList.add(workItems.back().get()); + WorkItems.push_back(std::unique_ptr{new glslang::TWorkItem("stdin")}); + workList.add(WorkItems.back().get()); } ProcessConfigFile(); @@ -1075,21 +1074,24 @@ int C_DECL main(int argc, char* argv[]) if (Options & EOptionLinkProgram || Options & EOptionOutputPreprocessed) { glslang::InitializeProcess(); + glslang::InitializeProcess(); // also test reference counting of users + glslang::InitializeProcess(); // also test reference counting of users + glslang::FinalizeProcess(); // also test reference counting of users + glslang::FinalizeProcess(); // also test reference counting of users CompileAndLinkShaderFiles(workList); glslang::FinalizeProcess(); } else { ShInitialize(); + ShInitialize(); // also test reference counting of users + ShFinalize(); // also test reference counting of users bool printShaderNames = workList.size() > 1; - if (Options & EOptionMultiThreaded) - { + if (Options & EOptionMultiThreaded) { std::array threads; - for (unsigned int t = 0; t < threads.size(); ++t) - { + for (unsigned int t = 0; t < threads.size(); ++t) { threads[t] = std::thread(CompileShaders, std::ref(workList)); - if (threads[t].get_id() == std::thread::id()) - { + if (threads[t].get_id() == std::thread::id()) { fprintf(stderr, "Failed to create thread\n"); return EFailThreadCreate; } @@ -1100,11 +1102,11 @@ int C_DECL main(int argc, char* argv[]) CompileShaders(workList); // Print out all the resulting infologs - for (size_t w = 0; w < workItems.size(); ++w) { - if (workItems[w]) { - if (printShaderNames || workItems[w]->results.size() > 0) - PutsIfNonEmpty(workItems[w]->name.c_str()); - PutsIfNonEmpty(workItems[w]->results.c_str()); + for (size_t w = 0; w < WorkItems.size(); ++w) { + if (WorkItems[w]) { + if (printShaderNames || WorkItems[w]->results.size() > 0) + PutsIfNonEmpty(WorkItems[w]->name.c_str()); + PutsIfNonEmpty(WorkItems[w]->results.c_str()); } } @@ -1119,6 +1121,25 @@ int C_DECL main(int argc, char* argv[]) return 0; } +int C_DECL main(int argc, char* argv[]) +{ + ProcessArguments(WorkItems, argc, argv); + + int ret = 0; + + // Loop over the entire init/finalize cycle to watch memory changes + const int iterations = 1; + if (iterations > 1) + glslang::OS_DumpMemoryCounters(); + for (int i = 0; i < iterations; ++i) { + ret = singleMain(); + if (iterations > 1) + glslang::OS_DumpMemoryCounters(); + } + + return ret; +} + // // Deduce the language from the filename. Files must end in one of the // following extensions: @@ -1273,7 +1294,7 @@ void usage() " -o save binary to , requires a binary option (e.g., -V)\n" " -q dump reflection query database\n" " -r synonym for --relaxed-errors\n" - " -s silent mode\n" + " -s silence syntax and semantic error reporting\n" " -t multi-threaded mode\n" " -v print version strings\n" " -w synonym for --suppress-warnings\n" diff --git a/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out b/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out new file mode 100755 index 000000000..724ae7bf9 --- /dev/null +++ b/3rdparty/glslang/Test/baseLegalResults/hlsl.flattenSubset2.frag.out @@ -0,0 +1,37 @@ +hlsl.flattenSubset2.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize +// Module Version 10000 +// Generated by (magic number): 80002 +// Id's are bound by 44 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 40 43 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 31 "someTex" + Name 40 "vpos" + Name 43 "@entryPointOutput" + Decorate 31(someTex) DescriptorSet 0 + Decorate 40(vpos) Location 0 + Decorate 43(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 17: TypeImage 6(float) 2D sampled format:Unknown + 30: TypePointer UniformConstant 17 + 31(someTex): 30(ptr) Variable UniformConstant + 34: 6(float) Constant 0 + 35: 7(fvec4) ConstantComposite 34 34 34 34 + 39: TypePointer Input 7(fvec4) + 40(vpos): 39(ptr) Variable Input + 42: TypePointer Output 7(fvec4) +43(@entryPointOutput): 42(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + Store 43(@entryPointOutput) 35 + Return + FunctionEnd diff --git a/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out b/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out new file mode 100755 index 000000000..ed3102e18 --- /dev/null +++ b/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out @@ -0,0 +1,91 @@ +hlsl.partialFlattenLocal.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize +// Module Version 10000 +// Generated by (magic number): 80002 +// Id's are bound by 148 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 90 93 + Source HLSL 500 + Name 4 "main" + Name 17 "tex" + Name 90 "pos" + Name 93 "@entryPointOutput" + Decorate 17(tex) DescriptorSet 0 + Decorate 90(pos) Location 0 + Decorate 93(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 13: TypeImage 6(float) 2D sampled format:Unknown + 16: TypePointer UniformConstant 13 + 17(tex): 16(ptr) Variable UniformConstant + 19: TypeVector 6(float) 3 + 20: TypeInt 32 0 + 21: 20(int) Constant 3 + 22: TypeArray 19(fvec3) 21 + 23: TypePointer Function 22 + 25: TypeInt 32 1 + 26: 25(int) Constant 0 + 27: 6(float) Constant 0 + 28: 19(fvec3) ConstantComposite 27 27 27 + 29: TypePointer Function 19(fvec3) + 31: TypeVector 6(float) 2 + 32: 20(int) Constant 2 + 33: TypeArray 31(fvec2) 32 + 34: TypePointer Function 33 + 36: 6(float) Constant 1065353216 + 37: 31(fvec2) ConstantComposite 27 36 + 38: TypePointer Function 31(fvec2) + 52: 25(int) Constant 1 + 53: TypeBool + 89: TypePointer Input 7(fvec4) + 90(pos): 89(ptr) Variable Input + 92: TypePointer Output 7(fvec4) +93(@entryPointOutput): 92(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 98: 23(ptr) Variable Function + 99: 34(ptr) Variable Function + 91: 7(fvec4) Load 90(pos) + 110: 29(ptr) AccessChain 98 26 + Store 110 28 + 111: 38(ptr) AccessChain 99 26 + Store 111 37 + Branch 112 + 112: Label + 147: 25(int) Phi 26 5 131 114 + LoopMerge 113 114 None + Branch 115 + 115: Label + 117: 53(bool) SLessThan 147 52 + BranchConditional 117 118 113 + 118: Label + 121: 38(ptr) AccessChain 99 147 + 122: 31(fvec2) Load 121 + 123: 29(ptr) AccessChain 98 147 + 124: 19(fvec3) Load 123 + 125: 31(fvec2) VectorShuffle 124 124 0 1 + 126: 31(fvec2) FAdd 125 122 + 127: 29(ptr) AccessChain 98 147 + 128: 19(fvec3) Load 127 + 129: 19(fvec3) VectorShuffle 128 126 3 4 2 + Store 127 129 + Branch 114 + 114: Label + 131: 25(int) IAdd 147 52 + Branch 112 + 113: Label + 133: 22 Load 98 + 146: 19(fvec3) CompositeExtract 133 0 + 140: 6(float) CompositeExtract 146 0 + 141: 6(float) CompositeExtract 146 1 + 142: 6(float) CompositeExtract 146 2 + 143: 7(fvec4) CompositeConstruct 140 141 142 27 + 144: 7(fvec4) FAdd 91 143 + Store 93(@entryPointOutput) 144 + Return + FunctionEnd diff --git a/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out b/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out new file mode 100755 index 000000000..d57566b34 --- /dev/null +++ b/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out @@ -0,0 +1,38 @@ +hlsl.partialFlattenMixed.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize +// Module Version 10000 +// Generated by (magic number): 80002 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 27 30 + Source HLSL 500 + Name 4 "main" + Name 20 "tex" + Name 27 "pos" + Name 30 "@entryPointOutput" + Decorate 20(tex) DescriptorSet 0 + Decorate 27(pos) Location 0 + Decorate 30(@entryPointOutput) BuiltIn Position + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 13: TypeImage 6(float) 2D sampled format:Unknown + 14: TypeInt 32 0 + 15: 14(int) Constant 2 + 16: TypeArray 13 15 + 19: TypePointer UniformConstant 16 + 20(tex): 19(ptr) Variable UniformConstant + 26: TypePointer Input 7(fvec4) + 27(pos): 26(ptr) Variable Input + 29: TypePointer Output 7(fvec4) +30(@entryPointOutput): 29(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 28: 7(fvec4) Load 27(pos) + Store 30(@entryPointOutput) 28 + Return + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out b/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out new file mode 100644 index 000000000..92153c53a --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out @@ -0,0 +1,1158 @@ +hlsl.gs-hs-mix.tesc +Shader version: 500 +vertices = 3 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = ccw +0:? Sequence +0:31 Function Definition: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:31 Function Parameters: +0:31 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 3-component vector of float) +0:32 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:32 tess_factor: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:32 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'roundedInsideTessFactor' ( temp float) +0:33 Constant: +0:33 3.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'insideTessFactor' ( temp float) +0:34 Constant: +0:34 1.000000 +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:39 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:40 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 direct index ( temp float) +0:40 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:41 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 2 (const int) +0:41 direct index ( temp float) +0:41 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:41 Constant: +0:41 2 (const int) +0:42 move second child to first child ( temp float) +0:42 InsideTessFactor: direct index for structure ( temp float) +0:42 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:42 Constant: +0:42 1 (const int) +0:42 'roundedInsideTessFactor' ( temp float) +0:45 move second child to first child ( temp 3-component vector of float) +0:45 direct index ( temp 3-component vector of float) +0:45 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:45 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 NormalWS: direct index for structure ( temp 3-component vector of float) +0:45 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const int) +0:46 move second child to first child ( temp 3-component vector of float) +0:46 direct index ( temp 3-component vector of float) +0:46 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:46 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 NormalWS: direct index for structure ( temp 3-component vector of float) +0:46 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 direct index ( temp 3-component vector of float) +0:47 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:47 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 NormalWS: direct index for structure ( temp 3-component vector of float) +0:47 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const int) +0:49 Branch: Return with expression +0:49 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:61 Function Definition: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Parameters: +0:61 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 'id' ( in uint) +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of float) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:63 Constant: +0:63 0 (const int) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 indirect index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'id' ( in uint) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Return with expression +0:64 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Definition: HSMain( ( temp void) +0:61 Function Parameters: +0:? Sequence +0:61 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 move second child to first child ( temp uint) +0:? 'id' ( temp uint) +0:? 'id' ( in uint InvocationID) +0:61 move second child to first child ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 indirect index (layout( location=0) out structure{ temp 3-component vector of float PositionWS}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'id' ( in uint InvocationID) +0:61 Function Call: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'id' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Function Call: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? InsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp 3-element array of 3-component vector of float) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 2 (const int) +0:84 Function Definition: GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41; ( temp void) +0:84 Function Parameters: +0:84 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:84 'output' ( out structure{ temp 4-component vector of float PositionCS}) +0:? Sequence +0:86 Sequence +0:86 move second child to first child ( temp 3-component vector of float) +0:86 'P0' ( temp 3-component vector of float) +0:86 vector swizzle ( temp 3-component vector of float) +0:86 PositionWS: direct index for structure ( temp 3-component vector of float) +0:86 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 0 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 2 (const int) +0:87 Sequence +0:87 move second child to first child ( temp 3-component vector of float) +0:87 'P1' ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 PositionWS: direct index for structure ( temp 3-component vector of float) +0:87 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 0 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of float) +0:88 'P2' ( temp 3-component vector of float) +0:88 vector swizzle ( temp 3-component vector of float) +0:88 PositionWS: direct index for structure ( temp 3-component vector of float) +0:88 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 Constant: +0:88 2 (const int) +0:88 Constant: +0:88 0 (const int) +0:88 Sequence +0:88 Constant: +0:88 0 (const int) +0:88 Constant: +0:88 1 (const int) +0:88 Constant: +0:88 2 (const int) +0:92 add second child into first child ( temp float) +0:92 direct index ( temp float) +0:92 'P0' ( temp 3-component vector of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 0.001000 +0:93 add second child into first child ( temp float) +0:93 direct index ( temp float) +0:93 'P1' ( temp 3-component vector of float) +0:93 Constant: +0:93 2 (const int) +0:93 Constant: +0:93 0.001000 +0:94 add second child into first child ( temp float) +0:94 direct index ( temp float) +0:94 'P2' ( temp 3-component vector of float) +0:94 Constant: +0:94 2 (const int) +0:94 Constant: +0:94 0.001000 +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'Q0' ( temp 4-component vector of float) +0:95 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:95 'P0' ( temp 3-component vector of float) +0:95 Constant: +0:95 1.000000 +0:95 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:95 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:95 Constant: +0:95 1 (const uint) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of float) +0:96 'Q1' ( temp 4-component vector of float) +0:96 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:96 'P1' ( temp 3-component vector of float) +0:96 Constant: +0:96 1.000000 +0:96 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:96 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:96 Constant: +0:96 1 (const uint) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of float) +0:97 'Q2' ( temp 4-component vector of float) +0:97 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:97 'P2' ( temp 3-component vector of float) +0:97 Constant: +0:97 1.000000 +0:97 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:97 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:97 Constant: +0:97 1 (const uint) +0:100 move second child to first child ( temp 4-component vector of float) +0:100 PositionCS: direct index for structure ( temp 4-component vector of float) +0:100 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:100 Constant: +0:100 0 (const int) +0:100 'Q0' ( temp 4-component vector of float) +0:101 Constant: +0:101 0.000000 +0:102 move second child to first child ( temp 4-component vector of float) +0:102 PositionCS: direct index for structure ( temp 4-component vector of float) +0:102 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:102 Constant: +0:102 0 (const int) +0:102 'Q1' ( temp 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:107 move second child to first child ( temp 4-component vector of float) +0:107 PositionCS: direct index for structure ( temp 4-component vector of float) +0:107 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:107 Constant: +0:107 0 (const int) +0:107 'Q1' ( temp 4-component vector of float) +0:108 Constant: +0:108 0.000000 +0:109 move second child to first child ( temp 4-component vector of float) +0:109 PositionCS: direct index for structure ( temp 4-component vector of float) +0:109 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:109 Constant: +0:109 0 (const int) +0:109 'Q2' ( temp 4-component vector of float) +0:110 Constant: +0:110 0.000000 +0:111 Constant: +0:111 0.000000 +0:114 move second child to first child ( temp 4-component vector of float) +0:114 PositionCS: direct index for structure ( temp 4-component vector of float) +0:114 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:114 Constant: +0:114 0 (const int) +0:114 'Q2' ( temp 4-component vector of float) +0:115 Constant: +0:115 0.000000 +0:116 move second child to first child ( temp 4-component vector of float) +0:116 PositionCS: direct index for structure ( temp 4-component vector of float) +0:116 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:116 Constant: +0:116 0 (const int) +0:116 'Q0' ( temp 4-component vector of float) +0:117 Constant: +0:117 0.000000 +0:118 Constant: +0:118 0.000000 +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( in uint InvocationID) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) + + +Linked tessellation control stage: + + +Shader version: 500 +vertices = 3 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = ccw +0:? Sequence +0:31 Function Definition: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:31 Function Parameters: +0:31 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:32 Sequence +0:32 move second child to first child ( temp 3-component vector of float) +0:32 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:32 tess_factor: direct index for structure (layout( row_major std140) uniform 3-component vector of float) +0:32 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:32 Constant: +0:32 6 (const uint) +0:33 Sequence +0:33 move second child to first child ( temp float) +0:33 'roundedInsideTessFactor' ( temp float) +0:33 Constant: +0:33 3.000000 +0:34 Sequence +0:34 move second child to first child ( temp float) +0:34 'insideTessFactor' ( temp float) +0:34 Constant: +0:34 1.000000 +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:39 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:39 Constant: +0:39 0 (const int) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:39 Constant: +0:39 0 (const int) +0:40 move second child to first child ( temp float) +0:40 direct index ( temp float) +0:40 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:40 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:40 Constant: +0:40 0 (const int) +0:40 Constant: +0:40 1 (const int) +0:40 direct index ( temp float) +0:40 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child ( temp float) +0:41 direct index ( temp float) +0:41 EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:41 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:41 Constant: +0:41 0 (const int) +0:41 Constant: +0:41 2 (const int) +0:41 direct index ( temp float) +0:41 'roundedEdgeTessFactor' ( temp 3-component vector of float) +0:41 Constant: +0:41 2 (const int) +0:42 move second child to first child ( temp float) +0:42 InsideTessFactor: direct index for structure ( temp float) +0:42 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:42 Constant: +0:42 1 (const int) +0:42 'roundedInsideTessFactor' ( temp float) +0:45 move second child to first child ( temp 3-component vector of float) +0:45 direct index ( temp 3-component vector of float) +0:45 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:45 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:45 Constant: +0:45 2 (const int) +0:45 Constant: +0:45 0 (const int) +0:45 NormalWS: direct index for structure ( temp 3-component vector of float) +0:45 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:45 Constant: +0:45 0 (const int) +0:45 Constant: +0:45 1 (const int) +0:46 move second child to first child ( temp 3-component vector of float) +0:46 direct index ( temp 3-component vector of float) +0:46 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:46 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:46 NormalWS: direct index for structure ( temp 3-component vector of float) +0:46 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 1 (const int) +0:47 move second child to first child ( temp 3-component vector of float) +0:47 direct index ( temp 3-component vector of float) +0:47 NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:47 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 2 (const int) +0:47 NormalWS: direct index for structure ( temp 3-component vector of float) +0:47 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:47 Constant: +0:47 2 (const int) +0:47 Constant: +0:47 1 (const int) +0:49 Branch: Return with expression +0:49 'result' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:61 Function Definition: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Parameters: +0:61 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 'id' ( in uint) +0:? Sequence +0:63 move second child to first child ( temp 3-component vector of float) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:63 Constant: +0:63 0 (const int) +0:63 PositionWS: direct index for structure ( temp 3-component vector of float) +0:63 indirect index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'patch' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:63 'id' ( in uint) +0:63 Constant: +0:63 0 (const int) +0:64 Branch: Return with expression +0:64 'output' ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 Function Definition: HSMain( ( temp void) +0:61 Function Parameters: +0:? Sequence +0:61 move second child to first child ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:61 move second child to first child ( temp uint) +0:? 'id' ( temp uint) +0:? 'id' ( in uint InvocationID) +0:61 move second child to first child ( temp structure{ temp 3-component vector of float PositionWS}) +0:61 indirect index (layout( location=0) out structure{ temp 3-component vector of float PositionWS}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'id' ( in uint InvocationID) +0:61 Function Call: @HSMain(struct-HSInput-vf3-vf31[3];u1; ( temp structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( temp uint) +0:? Barrier ( temp void) +0:? Test condition and select ( temp void) +0:? Condition +0:? Compare Equal ( temp bool) +0:? 'id' ( in uint InvocationID) +0:? Constant: +0:? 0 (const int) +0:? true case +0:? Sequence +0:? move second child to first child ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Function Call: HSPatchConstant(struct-HSInput-vf3-vf31[3]; ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? 'patch' ( temp 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? Sequence +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 0 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 0 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 1 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelOuter) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? Constant: +0:? 2 (const int) +0:? direct index ( temp float) +0:? EdgeTessFactor: direct index for structure ( temp 3-element array of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? Constant: +0:? 2 (const int) +0:? move second child to first child ( temp float) +0:? direct index ( patch out float TessLevelInner) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? Constant: +0:? 0 (const int) +0:? InsideTessFactor: direct index for structure ( temp float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 1 (const int) +0:? move second child to first child ( temp 3-element array of 3-component vector of float) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 0 (const int) +0:? NormalWS: direct index for structure ( temp 3-element array of 3-component vector of float) +0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float EdgeTessFactor, temp float InsideTessFactor, temp 3-element array of 3-component vector of float NormalWS}) +0:? Constant: +0:? 2 (const int) +0:84 Function Definition: GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41; ( temp void) +0:84 Function Parameters: +0:84 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:84 'output' ( out structure{ temp 4-component vector of float PositionCS}) +0:? Sequence +0:86 Sequence +0:86 move second child to first child ( temp 3-component vector of float) +0:86 'P0' ( temp 3-component vector of float) +0:86 vector swizzle ( temp 3-component vector of float) +0:86 PositionWS: direct index for structure ( temp 3-component vector of float) +0:86 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 0 (const int) +0:86 Sequence +0:86 Constant: +0:86 0 (const int) +0:86 Constant: +0:86 1 (const int) +0:86 Constant: +0:86 2 (const int) +0:87 Sequence +0:87 move second child to first child ( temp 3-component vector of float) +0:87 'P1' ( temp 3-component vector of float) +0:87 vector swizzle ( temp 3-component vector of float) +0:87 PositionWS: direct index for structure ( temp 3-component vector of float) +0:87 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 0 (const int) +0:87 Sequence +0:87 Constant: +0:87 0 (const int) +0:87 Constant: +0:87 1 (const int) +0:87 Constant: +0:87 2 (const int) +0:88 Sequence +0:88 move second child to first child ( temp 3-component vector of float) +0:88 'P2' ( temp 3-component vector of float) +0:88 vector swizzle ( temp 3-component vector of float) +0:88 PositionWS: direct index for structure ( temp 3-component vector of float) +0:88 direct index ( temp structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 'input' ( in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:88 Constant: +0:88 2 (const int) +0:88 Constant: +0:88 0 (const int) +0:88 Sequence +0:88 Constant: +0:88 0 (const int) +0:88 Constant: +0:88 1 (const int) +0:88 Constant: +0:88 2 (const int) +0:92 add second child into first child ( temp float) +0:92 direct index ( temp float) +0:92 'P0' ( temp 3-component vector of float) +0:92 Constant: +0:92 2 (const int) +0:92 Constant: +0:92 0.001000 +0:93 add second child into first child ( temp float) +0:93 direct index ( temp float) +0:93 'P1' ( temp 3-component vector of float) +0:93 Constant: +0:93 2 (const int) +0:93 Constant: +0:93 0.001000 +0:94 add second child into first child ( temp float) +0:94 direct index ( temp float) +0:94 'P2' ( temp 3-component vector of float) +0:94 Constant: +0:94 2 (const int) +0:94 Constant: +0:94 0.001000 +0:95 Sequence +0:95 move second child to first child ( temp 4-component vector of float) +0:95 'Q0' ( temp 4-component vector of float) +0:95 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:95 'P0' ( temp 3-component vector of float) +0:95 Constant: +0:95 1.000000 +0:95 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:95 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:95 Constant: +0:95 1 (const uint) +0:96 Sequence +0:96 move second child to first child ( temp 4-component vector of float) +0:96 'Q1' ( temp 4-component vector of float) +0:96 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:96 'P1' ( temp 3-component vector of float) +0:96 Constant: +0:96 1.000000 +0:96 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:96 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:96 Constant: +0:96 1 (const uint) +0:97 Sequence +0:97 move second child to first child ( temp 4-component vector of float) +0:97 'Q2' ( temp 4-component vector of float) +0:97 vector-times-matrix ( temp 4-component vector of float) +0:? Construct vec4 ( temp 4-component vector of float) +0:97 'P2' ( temp 3-component vector of float) +0:97 Constant: +0:97 1.000000 +0:97 proj_matrix: direct index for structure (layout( row_major std140) uniform 4X4 matrix of float) +0:97 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:97 Constant: +0:97 1 (const uint) +0:100 move second child to first child ( temp 4-component vector of float) +0:100 PositionCS: direct index for structure ( temp 4-component vector of float) +0:100 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:100 Constant: +0:100 0 (const int) +0:100 'Q0' ( temp 4-component vector of float) +0:101 Constant: +0:101 0.000000 +0:102 move second child to first child ( temp 4-component vector of float) +0:102 PositionCS: direct index for structure ( temp 4-component vector of float) +0:102 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:102 Constant: +0:102 0 (const int) +0:102 'Q1' ( temp 4-component vector of float) +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:107 move second child to first child ( temp 4-component vector of float) +0:107 PositionCS: direct index for structure ( temp 4-component vector of float) +0:107 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:107 Constant: +0:107 0 (const int) +0:107 'Q1' ( temp 4-component vector of float) +0:108 Constant: +0:108 0.000000 +0:109 move second child to first child ( temp 4-component vector of float) +0:109 PositionCS: direct index for structure ( temp 4-component vector of float) +0:109 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:109 Constant: +0:109 0 (const int) +0:109 'Q2' ( temp 4-component vector of float) +0:110 Constant: +0:110 0.000000 +0:111 Constant: +0:111 0.000000 +0:114 move second child to first child ( temp 4-component vector of float) +0:114 PositionCS: direct index for structure ( temp 4-component vector of float) +0:114 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:114 Constant: +0:114 0 (const int) +0:114 'Q2' ( temp 4-component vector of float) +0:115 Constant: +0:115 0.000000 +0:116 move second child to first child ( temp 4-component vector of float) +0:116 PositionCS: direct index for structure ( temp 4-component vector of float) +0:116 'vertex' ( temp structure{ temp 4-component vector of float PositionCS}) +0:116 Constant: +0:116 0 (const int) +0:116 'Q0' ( temp 4-component vector of float) +0:117 Constant: +0:117 0.000000 +0:118 Constant: +0:118 0.000000 +0:? Linker Objects +0:? 'anon@0' (layout( binding=0 row_major std140) uniform block{layout( row_major std140) uniform 4X4 matrix of float model_view_matrix, layout( row_major std140) uniform 4X4 matrix of float proj_matrix, layout( row_major std140) uniform 4X4 matrix of float model_view_proj_matrix, layout( row_major std140) uniform 3X3 matrix of float normal_matrix, layout( row_major std140) uniform 3-component vector of float color, layout( row_major std140) uniform 3-component vector of float view_dir, layout( row_major std140) uniform 3-component vector of float tess_factor}) +0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float PositionWS}) +0:? 'patch' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float PositionWS, temp 3-component vector of float NormalWS}) +0:? 'id' ( in uint InvocationID) +0:? '@patchConstantOutput.EdgeTessFactor' ( patch out 4-element array of float TessLevelOuter) +0:? '@patchConstantOutput.InsideTessFactor' ( patch out 2-element array of float TessLevelInner) +0:? '@patchConstantOutput' (layout( location=1) patch out structure{ temp 3-element array of 3-component vector of float NormalWS}) + +// Module Version 10000 +// Generated by (magic number): 80002 +// Id's are bound by 216 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "HSMain" 97 101 105 126 139 145 + ExecutionMode 4 OutputVertices 3 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingFractionalOdd + ExecutionMode 4 VertexOrderCcw + Source HLSL 500 + Name 4 "HSMain" + Name 8 "HSInput" + MemberName 8(HSInput) 0 "PositionWS" + MemberName 8(HSInput) 1 "NormalWS" + Name 15 "HSTrianglePatchConstant" + MemberName 15(HSTrianglePatchConstant) 0 "EdgeTessFactor" + MemberName 15(HSTrianglePatchConstant) 1 "InsideTessFactor" + MemberName 15(HSTrianglePatchConstant) 2 "NormalWS" + Name 18 "HSPatchConstant(struct-HSInput-vf3-vf31[3];" + Name 17 "patch" + Name 21 "HSOutput" + MemberName 21(HSOutput) 0 "PositionWS" + Name 25 "@HSMain(struct-HSInput-vf3-vf31[3];u1;" + Name 23 "patch" + Name 24 "id" + Name 27 "GSVertexInput" + MemberName 27(GSVertexInput) 0 "PositionWS" + MemberName 27(GSVertexInput) 1 "NormalWS" + Name 31 "GSVertexOutput" + MemberName 31(GSVertexOutput) 0 "PositionCS" + Name 36 "GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41;" + Name 34 "input" + Name 35 "output" + Name 39 "roundedEdgeTessFactor" + Name 42 "UniformBlock0" + MemberName 42(UniformBlock0) 0 "model_view_matrix" + MemberName 42(UniformBlock0) 1 "proj_matrix" + MemberName 42(UniformBlock0) 2 "model_view_proj_matrix" + MemberName 42(UniformBlock0) 3 "normal_matrix" + MemberName 42(UniformBlock0) 4 "color" + MemberName 42(UniformBlock0) 5 "view_dir" + MemberName 42(UniformBlock0) 6 "tess_factor" + Name 44 "" + Name 51 "roundedInsideTessFactor" + Name 53 "insideTessFactor" + Name 56 "result" + Name 87 "output" + Name 95 "patch" + Name 97 "patch" + Name 99 "id" + Name 101 "id" + Name 105 "@entryPointOutput" + Name 107 "param" + Name 109 "param" + Name 119 "@patchConstantResult" + Name 120 "param" + Name 126 "@patchConstantOutput.EdgeTessFactor" + Name 139 "@patchConstantOutput.InsideTessFactor" + Name 143 "HSTrianglePatchConstant" + MemberName 143(HSTrianglePatchConstant) 0 "NormalWS" + Name 145 "@patchConstantOutput" + Name 151 "P0" + Name 154 "P1" + Name 157 "P2" + Name 174 "Q0" + Name 184 "Q1" + Name 193 "Q2" + Name 202 "vertex" + MemberDecorate 42(UniformBlock0) 0 RowMajor + MemberDecorate 42(UniformBlock0) 0 Offset 0 + MemberDecorate 42(UniformBlock0) 0 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 1 RowMajor + MemberDecorate 42(UniformBlock0) 1 Offset 64 + MemberDecorate 42(UniformBlock0) 1 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 2 RowMajor + MemberDecorate 42(UniformBlock0) 2 Offset 128 + MemberDecorate 42(UniformBlock0) 2 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 3 RowMajor + MemberDecorate 42(UniformBlock0) 3 Offset 192 + MemberDecorate 42(UniformBlock0) 3 MatrixStride 16 + MemberDecorate 42(UniformBlock0) 4 Offset 240 + MemberDecorate 42(UniformBlock0) 5 Offset 256 + MemberDecorate 42(UniformBlock0) 6 Offset 272 + Decorate 42(UniformBlock0) Block + Decorate 44 DescriptorSet 0 + Decorate 44 Binding 0 + Decorate 97(patch) Location 0 + Decorate 101(id) BuiltIn InvocationId + Decorate 105(@entryPointOutput) Location 0 + Decorate 126(@patchConstantOutput.EdgeTessFactor) Patch + Decorate 126(@patchConstantOutput.EdgeTessFactor) BuiltIn TessLevelOuter + Decorate 139(@patchConstantOutput.InsideTessFactor) Patch + Decorate 139(@patchConstantOutput.InsideTessFactor) BuiltIn TessLevelInner + MemberDecorate 143(HSTrianglePatchConstant) 0 Patch + Decorate 145(@patchConstantOutput) Patch + Decorate 145(@patchConstantOutput) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 3 + 8(HSInput): TypeStruct 7(fvec3) 7(fvec3) + 9: TypeInt 32 0 + 10: 9(int) Constant 3 + 11: TypeArray 8(HSInput) 10 + 12: TypePointer Function 11 + 13: TypeArray 6(float) 10 + 14: TypeArray 7(fvec3) 10 +15(HSTrianglePatchConstant): TypeStruct 13 6(float) 14 + 16: TypeFunction 15(HSTrianglePatchConstant) 12(ptr) + 20: TypePointer Function 9(int) + 21(HSOutput): TypeStruct 7(fvec3) + 22: TypeFunction 21(HSOutput) 12(ptr) 20(ptr) +27(GSVertexInput): TypeStruct 7(fvec3) 7(fvec3) + 28: TypeArray 27(GSVertexInput) 10 + 29: TypePointer Function 28 + 30: TypeVector 6(float) 4 +31(GSVertexOutput): TypeStruct 30(fvec4) + 32: TypePointer Function 31(GSVertexOutput) + 33: TypeFunction 2 29(ptr) 32(ptr) + 38: TypePointer Function 7(fvec3) + 40: TypeMatrix 30(fvec4) 4 + 41: TypeMatrix 7(fvec3) 3 +42(UniformBlock0): TypeStruct 40 40 40 41 7(fvec3) 7(fvec3) 7(fvec3) + 43: TypePointer Uniform 42(UniformBlock0) + 44: 43(ptr) Variable Uniform + 45: TypeInt 32 1 + 46: 45(int) Constant 6 + 47: TypePointer Uniform 7(fvec3) + 50: TypePointer Function 6(float) + 52: 6(float) Constant 1077936128 + 54: 6(float) Constant 1065353216 + 55: TypePointer Function 15(HSTrianglePatchConstant) + 57: 45(int) Constant 0 + 58: 9(int) Constant 0 + 62: 45(int) Constant 1 + 63: 9(int) Constant 1 + 67: 45(int) Constant 2 + 68: 9(int) Constant 2 + 86: TypePointer Function 21(HSOutput) + 96: TypePointer Input 11 + 97(patch): 96(ptr) Variable Input + 100: TypePointer Input 9(int) + 101(id): 100(ptr) Variable Input + 103: TypeArray 21(HSOutput) 10 + 104: TypePointer Output 103 +105(@entryPointOutput): 104(ptr) Variable Output + 112: TypePointer Output 21(HSOutput) + 115: TypeBool + 123: 9(int) Constant 4 + 124: TypeArray 6(float) 123 + 125: TypePointer Output 124 +126(@patchConstantOutput.EdgeTessFactor): 125(ptr) Variable Output + 129: TypePointer Output 6(float) + 137: TypeArray 6(float) 68 + 138: TypePointer Output 137 +139(@patchConstantOutput.InsideTessFactor): 138(ptr) Variable Output +143(HSTrianglePatchConstant): TypeStruct 14 + 144: TypePointer Output 143(HSTrianglePatchConstant) +145(@patchConstantOutput): 144(ptr) Variable Output + 146: TypePointer Function 14 + 149: TypePointer Output 14 + 160: 6(float) Constant 981668463 + 173: TypePointer Function 30(fvec4) + 180: TypePointer Uniform 40 + 205: 6(float) Constant 0 + 4(HSMain): 2 Function None 3 + 5: Label + 95(patch): 12(ptr) Variable Function + 99(id): 20(ptr) Variable Function + 107(param): 12(ptr) Variable Function + 109(param): 20(ptr) Variable Function +119(@patchConstantResult): 55(ptr) Variable Function + 120(param): 12(ptr) Variable Function + 98: 11 Load 97(patch) + Store 95(patch) 98 + 102: 9(int) Load 101(id) + Store 99(id) 102 + 106: 9(int) Load 101(id) + 108: 11 Load 95(patch) + Store 107(param) 108 + 110: 9(int) Load 99(id) + Store 109(param) 110 + 111:21(HSOutput) FunctionCall 25(@HSMain(struct-HSInput-vf3-vf31[3];u1;) 107(param) 109(param) + 113: 112(ptr) AccessChain 105(@entryPointOutput) 106 + Store 113 111 + ControlBarrier 68 63 58 + 114: 9(int) Load 101(id) + 116: 115(bool) IEqual 114 57 + SelectionMerge 118 None + BranchConditional 116 117 118 + 117: Label + 121: 11 Load 95(patch) + Store 120(param) 121 + 122:15(HSTrianglePatchConstant) FunctionCall 18(HSPatchConstant(struct-HSInput-vf3-vf31[3];) 120(param) + Store 119(@patchConstantResult) 122 + 127: 50(ptr) AccessChain 119(@patchConstantResult) 57 57 + 128: 6(float) Load 127 + 130: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 57 + Store 130 128 + 131: 50(ptr) AccessChain 119(@patchConstantResult) 57 62 + 132: 6(float) Load 131 + 133: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 62 + Store 133 132 + 134: 50(ptr) AccessChain 119(@patchConstantResult) 57 67 + 135: 6(float) Load 134 + 136: 129(ptr) AccessChain 126(@patchConstantOutput.EdgeTessFactor) 67 + Store 136 135 + 140: 50(ptr) AccessChain 119(@patchConstantResult) 62 + 141: 6(float) Load 140 + 142: 129(ptr) AccessChain 139(@patchConstantOutput.InsideTessFactor) 57 + Store 142 141 + 147: 146(ptr) AccessChain 119(@patchConstantResult) 67 + 148: 14 Load 147 + 150: 149(ptr) AccessChain 145(@patchConstantOutput) 57 + Store 150 148 + Branch 118 + 118: Label + Return + FunctionEnd +18(HSPatchConstant(struct-HSInput-vf3-vf31[3];):15(HSTrianglePatchConstant) Function None 16 + 17(patch): 12(ptr) FunctionParameter + 19: Label +39(roundedEdgeTessFactor): 38(ptr) Variable Function +51(roundedInsideTessFactor): 50(ptr) Variable Function +53(insideTessFactor): 50(ptr) Variable Function + 56(result): 55(ptr) Variable Function + 48: 47(ptr) AccessChain 44 46 + 49: 7(fvec3) Load 48 + Store 39(roundedEdgeTessFactor) 49 + Store 51(roundedInsideTessFactor) 52 + Store 53(insideTessFactor) 54 + 59: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 58 + 60: 6(float) Load 59 + 61: 50(ptr) AccessChain 56(result) 57 57 + Store 61 60 + 64: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 63 + 65: 6(float) Load 64 + 66: 50(ptr) AccessChain 56(result) 57 62 + Store 66 65 + 69: 50(ptr) AccessChain 39(roundedEdgeTessFactor) 68 + 70: 6(float) Load 69 + 71: 50(ptr) AccessChain 56(result) 57 67 + Store 71 70 + 72: 6(float) Load 51(roundedInsideTessFactor) + 73: 50(ptr) AccessChain 56(result) 62 + Store 73 72 + 74: 38(ptr) AccessChain 17(patch) 57 62 + 75: 7(fvec3) Load 74 + 76: 38(ptr) AccessChain 56(result) 67 57 + Store 76 75 + 77: 38(ptr) AccessChain 17(patch) 62 62 + 78: 7(fvec3) Load 77 + 79: 38(ptr) AccessChain 56(result) 67 62 + Store 79 78 + 80: 38(ptr) AccessChain 17(patch) 67 62 + 81: 7(fvec3) Load 80 + 82: 38(ptr) AccessChain 56(result) 67 67 + Store 82 81 + 83:15(HSTrianglePatchConstant) Load 56(result) + ReturnValue 83 + FunctionEnd +25(@HSMain(struct-HSInput-vf3-vf31[3];u1;):21(HSOutput) Function None 22 + 23(patch): 12(ptr) FunctionParameter + 24(id): 20(ptr) FunctionParameter + 26: Label + 87(output): 86(ptr) Variable Function + 88: 9(int) Load 24(id) + 89: 38(ptr) AccessChain 23(patch) 88 57 + 90: 7(fvec3) Load 89 + 91: 38(ptr) AccessChain 87(output) 57 + Store 91 90 + 92:21(HSOutput) Load 87(output) + ReturnValue 92 + FunctionEnd +36(GSMain(struct-GSVertexInput-vf3-vf31[3];struct-GSVertexOutput-vf41;): 2 Function None 33 + 34(input): 29(ptr) FunctionParameter + 35(output): 32(ptr) FunctionParameter + 37: Label + 151(P0): 38(ptr) Variable Function + 154(P1): 38(ptr) Variable Function + 157(P2): 38(ptr) Variable Function + 174(Q0): 173(ptr) Variable Function + 184(Q1): 173(ptr) Variable Function + 193(Q2): 173(ptr) Variable Function + 202(vertex): 32(ptr) Variable Function + 152: 38(ptr) AccessChain 34(input) 57 57 + 153: 7(fvec3) Load 152 + Store 151(P0) 153 + 155: 38(ptr) AccessChain 34(input) 62 57 + 156: 7(fvec3) Load 155 + Store 154(P1) 156 + 158: 38(ptr) AccessChain 34(input) 67 57 + 159: 7(fvec3) Load 158 + Store 157(P2) 159 + 161: 50(ptr) AccessChain 151(P0) 68 + 162: 6(float) Load 161 + 163: 6(float) FAdd 162 160 + 164: 50(ptr) AccessChain 151(P0) 68 + Store 164 163 + 165: 50(ptr) AccessChain 154(P1) 68 + 166: 6(float) Load 165 + 167: 6(float) FAdd 166 160 + 168: 50(ptr) AccessChain 154(P1) 68 + Store 168 167 + 169: 50(ptr) AccessChain 157(P2) 68 + 170: 6(float) Load 169 + 171: 6(float) FAdd 170 160 + 172: 50(ptr) AccessChain 157(P2) 68 + Store 172 171 + 175: 7(fvec3) Load 151(P0) + 176: 6(float) CompositeExtract 175 0 + 177: 6(float) CompositeExtract 175 1 + 178: 6(float) CompositeExtract 175 2 + 179: 30(fvec4) CompositeConstruct 176 177 178 54 + 181: 180(ptr) AccessChain 44 62 + 182: 40 Load 181 + 183: 30(fvec4) VectorTimesMatrix 179 182 + Store 174(Q0) 183 + 185: 7(fvec3) Load 154(P1) + 186: 6(float) CompositeExtract 185 0 + 187: 6(float) CompositeExtract 185 1 + 188: 6(float) CompositeExtract 185 2 + 189: 30(fvec4) CompositeConstruct 186 187 188 54 + 190: 180(ptr) AccessChain 44 62 + 191: 40 Load 190 + 192: 30(fvec4) VectorTimesMatrix 189 191 + Store 184(Q1) 192 + 194: 7(fvec3) Load 157(P2) + 195: 6(float) CompositeExtract 194 0 + 196: 6(float) CompositeExtract 194 1 + 197: 6(float) CompositeExtract 194 2 + 198: 30(fvec4) CompositeConstruct 195 196 197 54 + 199: 180(ptr) AccessChain 44 62 + 200: 40 Load 199 + 201: 30(fvec4) VectorTimesMatrix 198 200 + Store 193(Q2) 201 + 203: 30(fvec4) Load 174(Q0) + 204: 173(ptr) AccessChain 202(vertex) 57 + Store 204 203 + 206: 30(fvec4) Load 184(Q1) + 207: 173(ptr) AccessChain 202(vertex) 57 + Store 207 206 + 208: 30(fvec4) Load 184(Q1) + 209: 173(ptr) AccessChain 202(vertex) 57 + Store 209 208 + 210: 30(fvec4) Load 193(Q2) + 211: 173(ptr) AccessChain 202(vertex) 57 + Store 211 210 + 212: 30(fvec4) Load 193(Q2) + 213: 173(ptr) AccessChain 202(vertex) 57 + Store 213 212 + 214: 30(fvec4) Load 174(Q0) + 215: 173(ptr) AccessChain 202(vertex) 57 + Store 215 214 + Return + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out b/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out new file mode 100644 index 000000000..1db3da5ee --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.snorm.uav.comp.out @@ -0,0 +1,212 @@ +hlsl.snorm.uav.comp +Shader version: 500 +local_size = (16, 16, 1) +0:? Sequence +0:12 Function Definition: @main(vu3; ( temp void) +0:12 Function Parameters: +0:12 'tid' ( in 3-component vector of uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of float) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'ResultInS' (layout( binding=1) uniform texture3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 uf4: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:13 Constant: +0:13 0 (const uint) +0:13 imageStore ( temp void) +0:13 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 textureFetch ( temp 4-component vector of float) +0:14 'ResultInU' (layout( binding=0) uniform texture3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 imageStore ( temp void) +0:14 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? 'ResultInU' (layout( binding=0) uniform texture3D) +0:? 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:? 'ResultInS' (layout( binding=1) uniform texture3D) +0:? 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + + +Linked compute stage: + + +Shader version: 500 +local_size = (16, 16, 1) +0:? Sequence +0:12 Function Definition: @main(vu3; ( temp void) +0:12 Function Parameters: +0:12 'tid' ( in 3-component vector of uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 add ( temp 4-component vector of float) +0:13 textureFetch ( temp 4-component vector of float) +0:13 'ResultInS' (layout( binding=1) uniform texture3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 Constant: +0:13 0 (const int) +0:13 uf4: direct index for structure ( uniform 4-component vector of float) +0:13 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:13 Constant: +0:13 0 (const uint) +0:13 imageStore ( temp void) +0:13 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:13 'tid' ( in 3-component vector of uint) +0:13 'storeTemp' ( temp 4-component vector of float) +0:13 'storeTemp' ( temp 4-component vector of float) +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 textureFetch ( temp 4-component vector of float) +0:14 'ResultInU' (layout( binding=0) uniform texture3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 Constant: +0:14 0 (const int) +0:14 imageStore ( temp void) +0:14 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:14 'tid' ( in 3-component vector of uint) +0:14 'storeTemp' ( temp 4-component vector of float) +0:14 'storeTemp' ( temp 4-component vector of float) +0:12 Function Definition: main( ( temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child ( temp 3-component vector of uint) +0:? 'tid' ( temp 3-component vector of uint) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) +0:12 Function Call: @main(vu3; ( temp void) +0:? 'tid' ( temp 3-component vector of uint) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float uf4}) +0:? 'ResultInU' (layout( binding=0) uniform texture3D) +0:? 'ResultOutU' (layout( binding=0 rgba32f) uniform image3D) +0:? 'ResultInS' (layout( binding=1) uniform texture3D) +0:? 'ResultOutS' (layout( binding=1 rgba32f) uniform image3D) +0:? 'tid' ( in 3-component vector of uint GlobalInvocationID) + +// Module Version 10000 +// Generated by (magic number): 80002 +// Id's are bound by 54 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 49 + ExecutionMode 4 LocalSize 16 16 1 + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vu3;" + Name 10 "tid" + Name 16 "storeTemp" + Name 19 "ResultInS" + Name 25 "$Global" + MemberName 25($Global) 0 "uf4" + Name 27 "" + Name 34 "ResultOutS" + Name 38 "storeTemp" + Name 39 "ResultInU" + Name 43 "ResultOutU" + Name 47 "tid" + Name 49 "tid" + Name 51 "param" + Decorate 19(ResultInS) DescriptorSet 0 + Decorate 19(ResultInS) Binding 1 + MemberDecorate 25($Global) 0 Offset 0 + Decorate 25($Global) Block + Decorate 27 DescriptorSet 0 + Decorate 34(ResultOutS) DescriptorSet 0 + Decorate 34(ResultOutS) Binding 1 + Decorate 39(ResultInU) DescriptorSet 0 + Decorate 39(ResultInU) Binding 0 + Decorate 43(ResultOutU) DescriptorSet 0 + Decorate 43(ResultOutU) Binding 0 + Decorate 49(tid) BuiltIn GlobalInvocationId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 9: TypeFunction 2 8(ptr) + 13: TypeFloat 32 + 14: TypeVector 13(float) 4 + 15: TypePointer Function 14(fvec4) + 17: TypeImage 13(float) 3D sampled format:Unknown + 18: TypePointer UniformConstant 17 + 19(ResultInS): 18(ptr) Variable UniformConstant + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 25($Global): TypeStruct 14(fvec4) + 26: TypePointer Uniform 25($Global) + 27: 26(ptr) Variable Uniform + 28: TypePointer Uniform 14(fvec4) + 32: TypeImage 13(float) 3D nonsampled format:Rgba32f + 33: TypePointer UniformConstant 32 + 34(ResultOutS): 33(ptr) Variable UniformConstant + 39(ResultInU): 18(ptr) Variable UniformConstant + 43(ResultOutU): 33(ptr) Variable UniformConstant + 48: TypePointer Input 7(ivec3) + 49(tid): 48(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 47(tid): 8(ptr) Variable Function + 51(param): 8(ptr) Variable Function + 50: 7(ivec3) Load 49(tid) + Store 47(tid) 50 + 52: 7(ivec3) Load 47(tid) + Store 51(param) 52 + 53: 2 FunctionCall 11(@main(vu3;) 51(param) + Return + FunctionEnd + 11(@main(vu3;): 2 Function None 9 + 10(tid): 8(ptr) FunctionParameter + 12: Label + 16(storeTemp): 15(ptr) Variable Function + 38(storeTemp): 15(ptr) Variable Function + 20: 17 Load 19(ResultInS) + 21: 7(ivec3) Load 10(tid) + 24: 14(fvec4) ImageFetch 20 21 Lod 23 + 29: 28(ptr) AccessChain 27 23 + 30: 14(fvec4) Load 29 + 31: 14(fvec4) FAdd 24 30 + Store 16(storeTemp) 31 + 35: 32 Load 34(ResultOutS) + 36: 7(ivec3) Load 10(tid) + 37: 14(fvec4) Load 16(storeTemp) + ImageWrite 35 36 37 + 40: 17 Load 39(ResultInU) + 41: 7(ivec3) Load 10(tid) + 42: 14(fvec4) ImageFetch 40 41 Lod 23 + Store 38(storeTemp) 42 + 44: 32 Load 43(ResultOutU) + 45: 7(ivec3) Load 10(tid) + 46: 14(fvec4) Load 38(storeTemp) + ImageWrite 44 45 46 + Return + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out new file mode 100644 index 000000000..e1e36b00f --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.texturebuffer.frag.out @@ -0,0 +1,153 @@ +hlsl.texturebuffer.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 'pos' ( in 4-component vector of float) +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 f: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:16 Constant: +0:16 0 (const int) +0:16 f2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:16 Constant: +0:16 0 (const uint) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:? 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:15 Function Parameters: +0:15 'pos' ( in 4-component vector of float) +0:? Sequence +0:16 Branch: Return with expression +0:16 add ( temp 4-component vector of float) +0:16 f: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:16 Constant: +0:16 0 (const int) +0:16 f2: direct index for structure (layout( row_major std430) buffer 4-component vector of float) +0:16 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:16 Constant: +0:16 0 (const uint) +0:15 Function Definition: main( ( temp void) +0:15 Function Parameters: +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:15 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:15 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'TextureBuffer_var' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f, layout( row_major std430) buffer 4-component vector of int i}) +0:? 'anon@0' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float f2, layout( row_major std430) buffer 4-component vector of int i2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) + +// Module Version 10000 +// Generated by (magic number): 80002 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 35 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "pos" + Name 15 "TextureBuffer_var" + MemberName 15(TextureBuffer_var) 0 "f" + MemberName 15(TextureBuffer_var) 1 "i" + Name 17 "TextureBuffer_var" + Name 22 "tbuf2" + MemberName 22(tbuf2) 0 "f2" + MemberName 22(tbuf2) 1 "i2" + Name 24 "" + Name 30 "pos" + Name 32 "pos" + Name 35 "@entryPointOutput" + Name 36 "param" + MemberDecorate 15(TextureBuffer_var) 0 NonWritable + MemberDecorate 15(TextureBuffer_var) 0 Offset 0 + MemberDecorate 15(TextureBuffer_var) 1 NonWritable + MemberDecorate 15(TextureBuffer_var) 1 Offset 16 + Decorate 15(TextureBuffer_var) BufferBlock + Decorate 17(TextureBuffer_var) DescriptorSet 0 + Decorate 17(TextureBuffer_var) Binding 0 + MemberDecorate 22(tbuf2) 0 NonWritable + MemberDecorate 22(tbuf2) 0 Offset 0 + MemberDecorate 22(tbuf2) 1 NonWritable + MemberDecorate 22(tbuf2) 1 Offset 16 + Decorate 22(tbuf2) BufferBlock + Decorate 24 DescriptorSet 0 + Decorate 32(pos) BuiltIn FragCoord + Decorate 35(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 13: TypeInt 32 1 + 14: TypeVector 13(int) 4 +15(TextureBuffer_var): TypeStruct 7(fvec4) 14(ivec4) + 16: TypePointer Uniform 15(TextureBuffer_var) +17(TextureBuffer_var): 16(ptr) Variable Uniform + 18: 13(int) Constant 0 + 19: TypePointer Uniform 7(fvec4) + 22(tbuf2): TypeStruct 7(fvec4) 14(ivec4) + 23: TypePointer Uniform 22(tbuf2) + 24: 23(ptr) Variable Uniform + 31: TypePointer Input 7(fvec4) + 32(pos): 31(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(@entryPointOutput): 34(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(pos): 8(ptr) Variable Function + 36(param): 8(ptr) Variable Function + 33: 7(fvec4) Load 32(pos) + Store 30(pos) 33 + 37: 7(fvec4) Load 30(pos) + Store 36(param) 37 + 38: 7(fvec4) FunctionCall 11(@main(vf4;) 36(param) + Store 35(@entryPointOutput) 38 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(pos): 8(ptr) FunctionParameter + 12: Label + 20: 19(ptr) AccessChain 17(TextureBuffer_var) 18 + 21: 7(fvec4) Load 20 + 25: 19(ptr) AccessChain 24 18 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) FAdd 21 26 + ReturnValue 27 + FunctionEnd diff --git a/3rdparty/glslang/Test/hlsl.gs-hs-mix.tesc b/3rdparty/glslang/Test/hlsl.gs-hs-mix.tesc new file mode 100644 index 000000000..451969611 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.gs-hs-mix.tesc @@ -0,0 +1,119 @@ +cbuffer UniformBlock0 : register(b0) +{ + float4x4 model_view_matrix; + float4x4 proj_matrix; + float4x4 model_view_proj_matrix; + float3x3 normal_matrix; + float3 color; + float3 view_dir; + float3 tess_factor; +}; + +// ============================================================================= +// Hull Shader +// ============================================================================= +struct HSInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct HSOutput { + float3 PositionWS : POSITION; +}; + +struct HSTrianglePatchConstant { + float EdgeTessFactor[3] : SV_TessFactor; + float InsideTessFactor : SV_InsideTessFactor; + float3 NormalWS[3] : NORMAL; +}; + +HSTrianglePatchConstant HSPatchConstant(InputPatch patch) +{ + float3 roundedEdgeTessFactor = tess_factor; + float roundedInsideTessFactor = 3; + float insideTessFactor = 1; + + HSTrianglePatchConstant result; + + // Edge and inside tessellation factors + result.EdgeTessFactor[0] = roundedEdgeTessFactor.x; + result.EdgeTessFactor[1] = roundedEdgeTessFactor.y; + result.EdgeTessFactor[2] = roundedEdgeTessFactor.z; + result.InsideTessFactor = roundedInsideTessFactor; + + // Constant data + result.NormalWS[0] = patch[0].NormalWS; + result.NormalWS[1] = patch[1].NormalWS; + result.NormalWS[2] = patch[2].NormalWS; + + return result; +} + +[domain("tri")] +[partitioning("fractional_odd")] +[outputtopology("triangle_ccw")] +[outputcontrolpoints(3)] +[patchconstantfunc("HSPatchConstant")] +HSOutput HSMain( + InputPatch patch, + uint id : SV_OutputControlPointID +) +{ + HSOutput output; + output.PositionWS = patch[id].PositionWS; + return output; +} + +// ============================================================================= +// Geometry Shader +// ============================================================================= +struct GSVertexInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct GSVertexOutput { + float4 PositionCS : SV_POSITION; +}; + +[maxvertexcount(6)] +void GSMain( + triangle GSVertexInput input[3], + inout LineStream output +) +{ + + float3 P0 = input[0].PositionWS.xyz; + float3 P1 = input[1].PositionWS.xyz; + float3 P2 = input[2].PositionWS.xyz; + + GSVertexOutput vertex; + // Totally hacky... + P0.z += 0.001; + P1.z += 0.001; + P2.z += 0.001; + float4 Q0 = mul(proj_matrix, float4(P0, 1.0)); + float4 Q1 = mul(proj_matrix, float4(P1, 1.0)); + float4 Q2 = mul(proj_matrix, float4(P2, 1.0)); + + // Edge 0 + vertex.PositionCS = Q0; + output.Append(vertex); + vertex.PositionCS = Q1; + output.Append(vertex); + output.RestartStrip(); + + // Edge 1 + vertex.PositionCS = Q1; + output.Append(vertex); + vertex.PositionCS = Q2; + output.Append(vertex); + output.RestartStrip(); + + // Edge 2 + vertex.PositionCS = Q2; + output.Append(vertex); + vertex.PositionCS = Q0; + output.Append(vertex); + output.RestartStrip(); +} diff --git a/3rdparty/glslang/Test/hlsl.snorm.uav.comp b/3rdparty/glslang/Test/hlsl.snorm.uav.comp new file mode 100644 index 000000000..c6cafebeb --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.snorm.uav.comp @@ -0,0 +1,15 @@ + +unorm float4 uf4; + +Texture3D ResultInU: register(t0); +RWTexture3D ResultOutU: register(u0); + +Texture3D ResultInS: register(t1); +RWTexture3D ResultOutS: register(u1); + +[numthreads(16, 16, 1)] +void main(uint3 tid: SV_DispatchThreadID) +{ + ResultOutS[tid] = ResultInS[tid] + uf4; + ResultOutU[tid] = ResultInU[tid]; +} diff --git a/3rdparty/glslang/Test/hlsl.texturebuffer.frag b/3rdparty/glslang/Test/hlsl.texturebuffer.frag new file mode 100644 index 000000000..d06974656 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.texturebuffer.frag @@ -0,0 +1,17 @@ + +struct Data { + float4 f; + int4 i; +}; + +TextureBuffer TextureBuffer_var : register(t0); + +tbuffer tbuf2 { + float4 f2; + int4 i2; +}; + +float4 main(float4 pos : SV_POSITION) : SV_TARGET +{ + return TextureBuffer_var.f + f2; +} diff --git a/3rdparty/glslang/glslang/Include/InitializeGlobals.h b/3rdparty/glslang/glslang/Include/InitializeGlobals.h index 4cf2dca7c..95d0a40e9 100644 --- a/3rdparty/glslang/glslang/Include/InitializeGlobals.h +++ b/3rdparty/glslang/glslang/Include/InitializeGlobals.h @@ -37,10 +37,7 @@ namespace glslang { -void InitializeMemoryPools(); -void FreeGlobalPools(); bool InitializePoolIndex(); -void FreePoolIndex(); } // end namespace glslang diff --git a/3rdparty/glslang/glslang/Include/PoolAlloc.h b/3rdparty/glslang/glslang/Include/PoolAlloc.h index 69bacb156..0e237a6a2 100644 --- a/3rdparty/glslang/glslang/Include/PoolAlloc.h +++ b/3rdparty/glslang/glslang/Include/PoolAlloc.h @@ -250,15 +250,8 @@ private: // different times. But a simple use is to have a global pop // with everyone using the same global allocator. // -typedef TPoolAllocator* PoolAllocatorPointer; extern TPoolAllocator& GetThreadPoolAllocator(); - -struct TThreadMemoryPools -{ - TPoolAllocator* threadPoolAllocator; -}; - -void SetThreadPoolAllocator(TPoolAllocator& poolAllocator); +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator); // // This STL compatible allocator is intended to be used as the allocator diff --git a/3rdparty/glslang/glslang/Include/ShHandle.h b/3rdparty/glslang/glslang/Include/ShHandle.h index 64ba6d636..df07bd8ed 100644 --- a/3rdparty/glslang/glslang/Include/ShHandle.h +++ b/3rdparty/glslang/glslang/Include/ShHandle.h @@ -56,11 +56,14 @@ class TUniformMap; // class TShHandleBase { public: - TShHandleBase() { } - virtual ~TShHandleBase() { } + TShHandleBase() { pool = new glslang::TPoolAllocator; } + virtual ~TShHandleBase() { delete pool; } virtual TCompiler* getAsCompiler() { return 0; } virtual TLinker* getAsLinker() { return 0; } virtual TUniformMap* getAsUniformMap() { return 0; } + virtual glslang::TPoolAllocator* getPool() const { return pool; } +private: + glslang::TPoolAllocator* pool; }; // diff --git a/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 4007c3861..c42057c2c 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -40,35 +40,22 @@ namespace glslang { +// Process-wide TLS index OS_TLSIndex PoolIndex; -void InitializeMemoryPools() +// Return the thread-specific current pool. +TPoolAllocator& GetThreadPoolAllocator() { - TThreadMemoryPools* pools = static_cast(OS_GetTLSValue(PoolIndex)); - if (pools) - return; - - TPoolAllocator *threadPoolAllocator = new TPoolAllocator(); - - TThreadMemoryPools* threadData = new TThreadMemoryPools(); - - threadData->threadPoolAllocator = threadPoolAllocator; - - OS_SetTLSValue(PoolIndex, threadData); + return *static_cast(OS_GetTLSValue(PoolIndex)); } -void FreeGlobalPools() +// Set the thread-specific current pool. +void SetThreadPoolAllocator(TPoolAllocator* poolAllocator) { - // Release the allocated memory for this thread. - TThreadMemoryPools* globalPools = static_cast(OS_GetTLSValue(PoolIndex)); - if (! globalPools) - return; - - GetThreadPoolAllocator().popAll(); - delete &GetThreadPoolAllocator(); - delete globalPools; + OS_SetTLSValue(PoolIndex, poolAllocator); } +// Process-wide set up of the TLS pool storage. bool InitializePoolIndex() { // Allocate a TLS index. @@ -78,26 +65,6 @@ bool InitializePoolIndex() return true; } -void FreePoolIndex() -{ - // Release the TLS index. - OS_FreeTLSIndex(PoolIndex); -} - -TPoolAllocator& GetThreadPoolAllocator() -{ - TThreadMemoryPools* threadData = static_cast(OS_GetTLSValue(PoolIndex)); - - return *threadData->threadPoolAllocator; -} - -void SetThreadPoolAllocator(TPoolAllocator& poolAllocator) -{ - TThreadMemoryPools* threadData = static_cast(OS_GetTLSValue(PoolIndex)); - - threadData->threadPoolAllocator = &poolAllocator; -} - // // Implement the functionality of the TPoolAllocator class, which // is documented in PoolAlloc.h. diff --git a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index c8e954ce0..62e079e55 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -69,6 +69,10 @@ namespace { // anonymous namespace for file-local functions and symbols +// Total number of successful initializers of glslang: a refcount +// Shared global; access should be protected by a global mutex/critical section. +int NumberOfClients = 0; + using namespace glslang; // Create a language specific version of parseables. @@ -217,7 +221,7 @@ enum EPrecisionClass { TSymbolTable* CommonSymbolTable[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EPcCount] = {}; TSymbolTable* SharedSymbolTables[VersionCount][SpvVersionCount][ProfileCount][SourceCount][EShLangCount] = {}; -TPoolAllocator* PerProcessGPA = 0; +TPoolAllocator* PerProcessGPA = nullptr; // // Parse and add to the given symbol table the content of the given shader string. @@ -361,7 +365,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // pool allocator intact, so: // - Switch to a new pool for parsing the built-ins // - Do the parsing, which builds the symbol table, using the new pool -// - Switch to the process-global pool to save a copy the resulting symbol table +// - Switch to the process-global pool to save a copy of the resulting symbol table // - Free up the new pool used to parse the built-ins // - Switch back to the original thread's pool // @@ -388,8 +392,8 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp // Switch to a new pool TPoolAllocator& previousAllocator = GetThreadPoolAllocator(); - TPoolAllocator* builtInPoolAllocator = new TPoolAllocator(); - SetThreadPoolAllocator(*builtInPoolAllocator); + TPoolAllocator* builtInPoolAllocator = new TPoolAllocator; + SetThreadPoolAllocator(builtInPoolAllocator); // Dynamically allocate the local symbol tables so we can control when they are deallocated WRT when the pool is popped. TSymbolTable* commonTable[EPcCount]; @@ -403,7 +407,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spvVersion, source); // Switch to the process-global pool - SetThreadPoolAllocator(*PerProcessGPA); + SetThreadPoolAllocator(PerProcessGPA); // Copy the local symbol tables from the new pool to the global tables using the process-global pool for (int precClass = 0; precClass < EPcCount; ++precClass) { @@ -430,7 +434,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp delete stageTables[stage]; delete builtInPoolAllocator; - SetThreadPoolAllocator(previousAllocator); + SetThreadPoolAllocator(&previousAllocator); glslang::ReleaseGlobalLock(); } @@ -722,9 +726,6 @@ bool ProcessDeferred( const std::string sourceEntryPointName = "", const TEnvironment* environment = nullptr) // optional way of fully setting all versions, overriding the above { - if (! InitThread()) - return false; - // This must be undone (.pop()) by the caller, after it finishes consuming the created tree. GetThreadPoolAllocator().push(); @@ -1196,7 +1197,11 @@ int ShInitialize() if (! InitProcess()) return 0; - if (! PerProcessGPA) + glslang::GetGlobalLock(); + ++NumberOfClients; + glslang::ReleaseGlobalLock(); + + if (PerProcessGPA == nullptr) PerProcessGPA = new TPoolAllocator(); glslang::TScanContext::fillInKeywordMap(); @@ -1262,6 +1267,14 @@ void ShDestruct(ShHandle handle) // int __fastcall ShFinalize() { + glslang::GetGlobalLock(); + --NumberOfClients; + assert(NumberOfClients >= 0); + bool finalize = NumberOfClients == 0; + glslang::ReleaseGlobalLock(); + if (! finalize) + return 1; + for (int version = 0; version < VersionCount; ++version) { for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) { for (int p = 0; p < ProfileCount; ++p) { @@ -1288,10 +1301,9 @@ int __fastcall ShFinalize() } } - if (PerProcessGPA) { - PerProcessGPA->popAll(); + if (PerProcessGPA != nullptr) { delete PerProcessGPA; - PerProcessGPA = 0; + PerProcessGPA = nullptr; } glslang::TScanContext::deleteKeywordMap(); @@ -1332,6 +1344,8 @@ int ShCompile( if (compiler == 0) return 0; + SetThreadPoolAllocator(compiler->getPool()); + compiler->infoSink.info.erase(); compiler->infoSink.debug.erase(); @@ -1389,6 +1403,8 @@ int ShLinkExt( TShHandleBase* base = reinterpret_cast(linkHandle); TLinker* linker = static_cast(base->getAsLinker()); + SetThreadPoolAllocator(linker->getPool()); + if (linker == 0) return 0; @@ -1423,9 +1439,6 @@ void ShSetEncryptionMethod(ShHandle handle) // const char* ShGetInfoLog(const ShHandle handle) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1449,9 +1462,6 @@ const char* ShGetInfoLog(const ShHandle handle) // const void* ShGetExecutable(const ShHandle handle) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1474,9 +1484,6 @@ const void* ShGetExecutable(const ShHandle handle) // int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1496,9 +1503,6 @@ int ShSetVirtualAttributeBindings(const ShHandle handle, const ShBindingTable* t // int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1517,9 +1521,6 @@ int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* tab // int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) { - if (!InitThread()) - return 0; - if (handle == 0) return 0; @@ -1541,9 +1542,6 @@ int ShExcludeAttributes(const ShHandle handle, int *attributes, int count) // int ShGetUniformLocation(const ShHandle handle, const char* name) { - if (!InitThread()) - return 0; - if (handle == 0) return -1; @@ -1602,8 +1600,9 @@ public: }; TShader::TShader(EShLanguage s) - : pool(0), stage(s), lengths(nullptr), stringNames(nullptr), preamble("") + : stage(s), lengths(nullptr), stringNames(nullptr), preamble("") { + pool = new TPoolAllocator; infoSink = new TInfoSink; compiler = new TDeferredCompiler(stage, *infoSink); intermediate = new TIntermediate(s); @@ -1706,9 +1705,8 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion { if (! InitThread()) return false; + SetThreadPoolAllocator(pool); - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); if (! preamble) preamble = ""; @@ -1730,9 +1728,8 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources, { if (! InitThread()) return false; + SetThreadPoolAllocator(pool); - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); if (! preamble) preamble = ""; @@ -1752,8 +1749,9 @@ const char* TShader::getInfoDebugLog() return infoSink->debug.c_str(); } -TProgram::TProgram() : pool(0), reflection(0), ioMapper(nullptr), linked(false) +TProgram::TProgram() : reflection(0), ioMapper(nullptr), linked(false) { + pool = new TPoolAllocator; infoSink = new TInfoSink; for (int s = 0; s < EShLangCount; ++s) { intermediate[s] = 0; @@ -1788,8 +1786,7 @@ bool TProgram::link(EShMessages messages) bool error = false; - pool = new TPoolAllocator(); - SetThreadPoolAllocator(*pool); + SetThreadPoolAllocator(pool); for (int s = 0; s < EShLangCount; ++s) { if (! linkStage((EShLanguage)s, messages)) diff --git a/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp index 24b77e162..f59bbceb4 100644 --- a/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp +++ b/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp @@ -43,6 +43,9 @@ #include #include #include +#include +#include +#include namespace glslang { @@ -184,8 +187,18 @@ void ReleaseGlobalLock() pthread_mutex_unlock(&gMutex); } +// #define DUMP_COUNTERS + void OS_DumpMemoryCounters() { +#ifdef DUMP_COUNTERS + struct rusage usage; + + if (getrusage(RUSAGE_SELF, &usage) == 0) + printf("Working set size: %ld\n", usage.ru_maxrss * 1024); +#else + printf("Recompile with DUMP_COUNTERS defined to see counters.\n"); +#endif } } // end namespace glslang diff --git a/3rdparty/glslang/glslang/Public/ShaderLang.h b/3rdparty/glslang/glslang/Public/ShaderLang.h index 6fadfbf0c..6e22bdd72 100644 --- a/3rdparty/glslang/glslang/Public/ShaderLang.h +++ b/3rdparty/glslang/glslang/Public/ShaderLang.h @@ -68,15 +68,14 @@ #endif // -// Driver must call this first, once, before doing any other -// compiler/linker operations. +// Call before doing any other compiler/linker operations. // // (Call once per process, not once per thread.) // SH_IMPORT_EXPORT int ShInitialize(); // -// Driver should call this at process shutdown. +// Call this at process shutdown to clean up memory. // SH_IMPORT_EXPORT int __fastcall ShFinalize(); @@ -290,7 +289,7 @@ SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* // Deferred-Lowering C++ Interface // ----------------------------------- // -// Below is a new alternate C++ interface that might potentially replace the above +// Below is a new alternate C++ interface, which deprecates the above // opaque handle-based interface. // // The below is further designed to handle multiple compilation units per stage, where diff --git a/3rdparty/glslang/gtests/Hlsl.FromFile.cpp b/3rdparty/glslang/gtests/Hlsl.FromFile.cpp index 9d97fdf09..2e4b146d6 100644 --- a/3rdparty/glslang/gtests/Hlsl.FromFile.cpp +++ b/3rdparty/glslang/gtests/Hlsl.FromFile.cpp @@ -172,6 +172,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.getdimensions.dx10.vert", "main"}, {"hlsl.getsampleposition.dx10.frag", "main"}, {"hlsl.global-const-init.frag", "main"}, + {"hlsl.gs-hs-mix.tesc", "HSMain"}, {"hlsl.domain.1.tese", "main"}, {"hlsl.domain.2.tese", "main"}, {"hlsl.domain.3.tese", "main"}, @@ -297,6 +298,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.semicolons.frag", "main"}, {"hlsl.shapeConv.frag", "main"}, {"hlsl.shapeConvRet.frag", "main"}, + {"hlsl.snorm.uav.comp", "main"}, {"hlsl.staticMemberFunction.frag", "main"}, {"hlsl.stringtoken.frag", "main"}, {"hlsl.string.frag", "main"}, @@ -326,6 +328,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.structStructName.frag", "main"}, {"hlsl.subpass.frag", "main"}, {"hlsl.synthesizeInput.frag", "main"}, + {"hlsl.texturebuffer.frag", "main"}, {"hlsl.texture.struct.frag", "main"}, {"hlsl.texture.subvec4.frag", "main"}, {"hlsl.this.frag", "main"}, @@ -384,7 +387,10 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.flattenOpaque.frag", "main"}, {"hlsl.flattenOpaqueInit.vert", "main"}, {"hlsl.flattenOpaqueInitMix.vert", "main"}, - {"hlsl.flattenSubset.frag", "main"} + {"hlsl.flattenSubset.frag", "main"}, + {"hlsl.flattenSubset2.frag", "main"}, + {"hlsl.partialFlattenLocal.vert", "main"}, + {"hlsl.partialFlattenMixed.vert", "main"} }), FileNameAsCustomTestSuffix ); diff --git a/3rdparty/glslang/hlsl/hlslGrammar.cpp b/3rdparty/glslang/hlsl/hlslGrammar.cpp index 515922e03..cf0bf0512 100755 --- a/3rdparty/glslang/hlsl/hlslGrammar.cpp +++ b/3rdparty/glslang/hlsl/hlslGrammar.cpp @@ -1378,6 +1378,23 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) } } + bool isUnorm = false; + bool isSnorm = false; + + // Accept snorm and unorm. Presently, this is ignored, save for an error check below. + switch (peek()) { + case EHTokUnorm: + isUnorm = true; + advanceToken(); // eat the token + break; + case EHTokSNorm: + isSnorm = true; + advanceToken(); // eat the token + break; + default: + break; + } + switch (peek()) { case EHTokVector: return acceptVectorTemplateType(type); @@ -1453,6 +1470,10 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) return acceptStructBufferType(type); break; + case EHTokTextureBuffer: + return acceptTextureBufferType(type); + break; + case EHTokConstantBuffer: return acceptConstantBufferType(type); @@ -1968,6 +1989,11 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList) advanceToken(); + if ((isUnorm || isSnorm) && !type.isFloatingDomain()) { + parseContext.error(token.loc, "unorm and snorm only valid in floating point domain", "", ""); + return false; + } + return true; } @@ -2127,6 +2153,43 @@ bool HlslGrammar::acceptConstantBufferType(TType& type) } } +// texture_buffer +// : TEXTUREBUFFER LEFT_ANGLE type RIGHT_ANGLE +bool HlslGrammar::acceptTextureBufferType(TType& type) +{ + if (! acceptTokenClass(EHTokTextureBuffer)) + return false; + + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + TType templateType; + if (! acceptType(templateType)) { + expected("type"); + return false; + } + + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + + templateType.getQualifier().storage = EvqBuffer; + templateType.getQualifier().readonly = true; + + TType blockType(templateType.getWritableStruct(), "", templateType.getQualifier()); + + blockType.getQualifier().storage = EvqBuffer; + blockType.getQualifier().readonly = true; + + type.shallowCopy(blockType); + + return true; +} + + // struct_buffer // : APPENDSTRUCTUREDBUFFER // | BYTEADDRESSBUFFER diff --git a/3rdparty/glslang/hlsl/hlslGrammar.h b/3rdparty/glslang/hlsl/hlslGrammar.h index f0adfa0b7..9d5380c10 100755 --- a/3rdparty/glslang/hlsl/hlslGrammar.h +++ b/3rdparty/glslang/hlsl/hlslGrammar.h @@ -89,6 +89,7 @@ namespace glslang { bool acceptTextureType(TType&); bool acceptSubpassInputType(TType&); bool acceptStructBufferType(TType&); + bool acceptTextureBufferType(TType&); bool acceptConstantBufferType(TType&); bool acceptStruct(TType&, TIntermNode*& nodeList); bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, TVector&); diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/3rdparty/glslang/hlsl/hlslParseHelper.cpp index 3058f8b44..adb955f7c 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.cpp +++ b/3rdparty/glslang/hlsl/hlslParseHelper.cpp @@ -8559,6 +8559,11 @@ bool HlslParseContext::handleInputGeometry(const TSourceLoc& loc, const TLayoutG // bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayoutGeometry& geometry) { + // If this is not a geometry shader, ignore. It might be a mixed shader including several stages. + // Since that's an OK situation, return true for success. + if (language != EShLangGeometry) + return true; + switch (geometry) { case ElgPoints: case ElgLineStrip: diff --git a/3rdparty/glslang/hlsl/hlslScanContext.cpp b/3rdparty/glslang/hlsl/hlslScanContext.cpp index c16fdfaff..d1e0be6e1 100755 --- a/3rdparty/glslang/hlsl/hlslScanContext.cpp +++ b/3rdparty/glslang/hlsl/hlslScanContext.cpp @@ -345,6 +345,7 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["RWByteAddressBuffer"] = EHTokRWByteAddressBuffer; (*KeywordMap)["RWStructuredBuffer"] = EHTokRWStructuredBuffer; (*KeywordMap)["StructuredBuffer"] = EHTokStructuredBuffer; + (*KeywordMap)["TextureBuffer"] = EHTokTextureBuffer; (*KeywordMap)["class"] = EHTokClass; (*KeywordMap)["struct"] = EHTokStruct; @@ -829,6 +830,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier() case EHTokRWByteAddressBuffer: case EHTokRWStructuredBuffer: case EHTokStructuredBuffer: + case EHTokTextureBuffer: case EHTokSubpassInput: case EHTokSubpassInputMS: return keyword; diff --git a/3rdparty/glslang/hlsl/hlslTokens.h b/3rdparty/glslang/hlsl/hlslTokens.h index 1c827bf8c..98450c9a0 100755 --- a/3rdparty/glslang/hlsl/hlslTokens.h +++ b/3rdparty/glslang/hlsl/hlslTokens.h @@ -283,6 +283,7 @@ enum EHlslTokenClass { EHTokRWByteAddressBuffer, EHTokRWStructuredBuffer, EHTokStructuredBuffer, + EHTokTextureBuffer, // variable, user type, ... EHTokIdentifier,