diff --git a/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h b/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h index b5b8dd600..5121ed991 100644 --- a/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h +++ b/3rdparty/glslang/SPIRV/GLSL.ext.AMD.h @@ -33,7 +33,7 @@ enum Decoration; enum Op; static const int GLSLextAMDVersion = 100; -static const int GLSLextAMDRevision = 4; +static const int GLSLextAMDRevision = 5; // SPV_AMD_shader_ballot static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot"; @@ -101,4 +101,9 @@ static const char* const E_SPV_AMD_texture_gather_bias_lod = "SPV_AMD_texture_ga // SPV_AMD_gpu_shader_int16 static const char* const E_SPV_AMD_gpu_shader_int16 = "SPV_AMD_gpu_shader_int16"; +// SPV_AMD_shader_image_load_store_lod +static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader_image_load_store_lod"; + +static const Capability CapabilityImageReadWriteLodAMD = static_cast(5015); + #endif // #ifndef GLSLextAMD_H diff --git a/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h b/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h index 6e025298a..2eb10ae62 100644 --- a/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h +++ b/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h @@ -42,5 +42,7 @@ static const char* const E_SPV_KHR_shader_draw_parameters = "SPV_KHR_shade static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage"; static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; +static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; +static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; #endif // #ifndef GLSLextKHR_H diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 1661d5b1e..b6c9705df 100755 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -455,15 +455,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI case glslang::EbvViewportIndex: if (!memberDeclaration) { builder.addCapability(spv::CapabilityMultiViewport); -#ifdef NV_EXTENSIONS if (glslangIntermediate->getStage() == EShLangVertex || glslangIntermediate->getStage() == EShLangTessControl || glslangIntermediate->getStage() == EShLangTessEvaluation) { - builder.addExtension(spv::E_SPV_NV_viewport_array2); - builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV); + builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer); + builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT); } -#endif } return spv::BuiltInViewportIndex; @@ -482,15 +480,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI case glslang::EbvLayer: if (!memberDeclaration) { builder.addCapability(spv::CapabilityGeometry); -#ifdef NV_EXTENSIONS if (glslangIntermediate->getStage() == EShLangVertex || glslangIntermediate->getStage() == EShLangTessControl || glslangIntermediate->getStage() == EShLangTessEvaluation) { - builder.addExtension(spv::E_SPV_NV_viewport_array2); - builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV); + builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer); + builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT); } -#endif } return spv::BuiltInLayer; @@ -522,8 +518,9 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInPrimitiveId; case glslang::EbvFragStencilRef: - logger->missingFunctionality("shader stencil export"); - return spv::BuiltInMax; + builder.addExtension(spv::E_SPV_EXT_shader_stencil_export); + builder.addCapability(spv::CapabilityStencilExportEXT); + return spv::BuiltInFragStencilRefEXT; case glslang::EbvInvocationId: return spv::BuiltInInvocationId; case glslang::EbvTessLevelInner: return spv::BuiltInTessLevelInner; @@ -880,11 +877,30 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage()); builder.clearAccessChain(); - builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()), glslangIntermediate->getVersion()); + builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()), + glslangIntermediate->getVersion()); + if (options.generateDebugInfo) { - builder.setSourceFile(glslangIntermediate->getSourceFile()); - builder.setSourceText(glslangIntermediate->getSourceText()); builder.setEmitOpLines(); + builder.setSourceFile(glslangIntermediate->getSourceFile()); + + // Set the source shader's text. If for SPV version 1.0, include + // a preamble in comments stating the OpModuleProcessed instructions. + // Otherwise, emit those as actual instructions. + std::string text; + const std::vector& processes = glslangIntermediate->getProcesses(); + for (int p = 0; p < (int)processes.size(); ++p) { + if (glslangIntermediate->getSpv().spv < 0x00010100) { + text.append("// OpModuleProcessed "); + text.append(processes[p]); + text.append("\n"); + } else + builder.addModuleProcessed(processes[p]); + } + if (glslangIntermediate->getSpv().spv < 0x00010100 && (int)processes.size() > 0) + text.append("#line 1\n"); + text.append(glslangIntermediate->getSourceText()); + builder.setSourceText(text); } stdBuiltins = builder.import("GLSL.std.450"); builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); @@ -1452,7 +1468,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.setAccessChainRValue(result); return false; +#ifdef AMD_EXTENSIONS + } else if (node->getOp() == glslang::EOpImageStore || node->getOp() == glslang::EOpImageStoreLod) { +#else } else if (node->getOp() == glslang::EOpImageStore) { +#endif // "imageStore" is a special case, which has no result return false; } @@ -2465,6 +2485,10 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member) if (member.getFieldName() == "gl_ViewportMaskPerViewNV" && extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end()) return true; + if ((member.getFieldName() == "gl_ViewportIndex" || member.getFieldName() == "gl_Layer") && + extensions.find(glslang::E_GL_ARB_shader_viewport_layer_array) == extensions.end() && + extensions.find("GL_NV_viewport_array2") == extensions.end()) + return true; return false; }; @@ -3132,6 +3156,10 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& if (i == 4) lvalue = true; break; + case glslang::EOpSparseImageLoadLod: + if (i == 3) + lvalue = true; + break; #endif default: break; @@ -3234,26 +3262,55 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } operands.push_back(*(opIt++)); +#ifdef AMD_EXTENSIONS + if (node->getOp() == glslang::EOpImageLoad || node->getOp() == glslang::EOpImageLoadLod) { +#else if (node->getOp() == glslang::EOpImageLoad) { +#endif if (sampler.ms) { operands.push_back(spv::ImageOperandsSampleMask); operands.push_back(*opIt); +#ifdef AMD_EXTENSIONS + } else if (cracked.lod) { + builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); + builder.addCapability(spv::CapabilityImageReadWriteLodAMD); + + operands.push_back(spv::ImageOperandsLodMask); + operands.push_back(*opIt); +#endif } if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); return builder.createOp(spv::OpImageRead, resultType(), operands); +#ifdef AMD_EXTENSIONS + } else if (node->getOp() == glslang::EOpImageStore || node->getOp() == glslang::EOpImageStoreLod) { +#else } else if (node->getOp() == glslang::EOpImageStore) { +#endif if (sampler.ms) { operands.push_back(*(opIt + 1)); operands.push_back(spv::ImageOperandsSampleMask); operands.push_back(*opIt); +#ifdef AMD_EXTENSIONS + } else if (cracked.lod) { + builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); + builder.addCapability(spv::CapabilityImageReadWriteLodAMD); + + operands.push_back(*(opIt + 1)); + operands.push_back(spv::ImageOperandsLodMask); + operands.push_back(*opIt); +#endif } else operands.push_back(*opIt); builder.createNoResultOp(spv::OpImageWrite, operands); if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageWriteWithoutFormat); return spv::NoResult; +#ifdef AMD_EXTENSIONS + } else if (node->getOp() == glslang::EOpSparseImageLoad || node->getOp() == glslang::EOpSparseImageLoadLod) { +#else } else if (node->getOp() == glslang::EOpSparseImageLoad) { +#endif builder.addCapability(spv::CapabilitySparseResidency); if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown) builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat); @@ -3261,6 +3318,14 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO if (sampler.ms) { operands.push_back(spv::ImageOperandsSampleMask); operands.push_back(*opIt++); +#ifdef AMD_EXTENSIONS + } else if (cracked.lod) { + builder.addExtension(spv::E_SPV_AMD_shader_image_load_store_lod); + builder.addCapability(spv::CapabilityImageReadWriteLodAMD); + + operands.push_back(spv::ImageOperandsLodMask); + operands.push_back(*opIt++); +#endif } // Create the return type that was a special structure @@ -5425,14 +5490,12 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } else if (builtIn == spv::BuiltInLayer) { // SPV_NV_viewport_array2 extension - if (symbol->getQualifier().layoutViewportRelative) - { + if (symbol->getQualifier().layoutViewportRelative) { addDecoration(id, (spv::Decoration)spv::DecorationViewportRelativeNV); builder.addCapability(spv::CapabilityShaderViewportMaskNV); builder.addExtension(spv::E_SPV_NV_viewport_array2); } - if(symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) - { + if (symbol->getQualifier().layoutSecondaryViewportRelativeOffset != -2048) { addDecoration(id, (spv::Decoration)spv::DecorationSecondaryViewportRelativeNV, symbol->getQualifier().layoutSecondaryViewportRelativeOffset); builder.addCapability(spv::CapabilityShaderStereoViewNV); builder.addExtension(spv::E_SPV_NV_stereo_view_rendering); diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/3rdparty/glslang/SPIRV/SpvBuilder.cpp index d472eb533..289d59af7 100644 --- a/3rdparty/glslang/SPIRV/SpvBuilder.cpp +++ b/3rdparty/glslang/SPIRV/SpvBuilder.cpp @@ -402,6 +402,8 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format) { + assert(sampled == 1 || sampled == 2); + // try to find it Instruction* type; for (int t = 0; t < (int)groupedTypes[OpTypeImage].size(); ++t) { @@ -433,27 +435,27 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo // deal with capabilities switch (dim) { case DimBuffer: - if (sampled) + if (sampled == 1) addCapability(CapabilitySampledBuffer); else addCapability(CapabilityImageBuffer); break; case Dim1D: - if (sampled) + if (sampled == 1) addCapability(CapabilitySampled1D); else addCapability(CapabilityImage1D); break; case DimCube: if (arrayed) { - if (sampled) + if (sampled == 1) addCapability(CapabilitySampledCubeArray); else addCapability(CapabilityImageCubeArray); } break; case DimRect: - if (sampled) + if (sampled == 1) addCapability(CapabilitySampledRect); else addCapability(CapabilityImageRect); @@ -466,10 +468,11 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo } if (ms) { - if (arrayed) - addCapability(CapabilityImageMSArray); - if (! sampled) + if (sampled == 2) { addCapability(CapabilityStorageImageMultisample); + if (arrayed) + addCapability(CapabilityImageMSArray); + } } return type->getResultId(); @@ -2427,6 +2430,7 @@ void Builder::dump(std::vector& out) const // Debug instructions dumpInstructions(out, strings); + dumpModuleProcesses(out); dumpSourceInstructions(out); for (int e = 0; e < (int)sourceExtensions.size(); ++e) { Instruction sourceExtInst(0, 0, OpSourceExtension); @@ -2634,4 +2638,15 @@ void Builder::dumpInstructions(std::vector& out, const std::vector } } +void Builder::dumpModuleProcesses(std::vector& out) const +{ + for (int i = 0; i < (int)moduleProcesses.size(); ++i) { + // TODO: switch this out for the 1.1 headers + const spv::Op OpModuleProcessed = (spv::Op)330; + Instruction moduleProcessed(OpModuleProcessed); + moduleProcessed.addStringOperand(moduleProcesses[i]); + moduleProcessed.dump(out); + } +} + }; // end spv namespace diff --git a/3rdparty/glslang/SPIRV/SpvBuilder.h b/3rdparty/glslang/SPIRV/SpvBuilder.h index 3a949190a..59b1da2ee 100755 --- a/3rdparty/glslang/SPIRV/SpvBuilder.h +++ b/3rdparty/glslang/SPIRV/SpvBuilder.h @@ -79,6 +79,7 @@ public: } void setSourceText(const std::string& text) { sourceText = text; } void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); } + void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); } void setEmitOpLines() { emitOpLines = true; } void addExtension(const char* ext) { extensions.insert(ext); } Id import(const char*); @@ -582,6 +583,7 @@ public: void createSelectionMerge(Block* mergeBlock, unsigned int control); void dumpSourceInstructions(std::vector&) const; void dumpInstructions(std::vector&, const std::vector >&) const; + void dumpModuleProcesses(std::vector&) const; SourceLanguage source; int sourceVersion; @@ -591,6 +593,7 @@ public: bool emitOpLines; std::set extensions; std::vector sourceExtensions; + std::vector moduleProcesses; AddressingModel addressModel; MemoryModel memoryModel; std::set capabilities; diff --git a/3rdparty/glslang/SPIRV/doc.cpp b/3rdparty/glslang/SPIRV/doc.cpp index b47fa4889..2fe5d9ce2 100755 --- a/3rdparty/glslang/SPIRV/doc.cpp +++ b/3rdparty/glslang/SPIRV/doc.cpp @@ -331,6 +331,7 @@ const char* BuiltInString(int builtIn) case 4424: return "BaseVertex"; case 4425: return "BaseInstance"; case 4426: return "DrawIndex"; + case 5014: return "FragStencilRefEXT"; #ifdef AMD_EXTENSIONS case 4992: return "BaryCoordNoPerspAMD"; @@ -842,8 +843,11 @@ const char* CapabilityString(int info) case 4437: return "DeviceGroup"; case 4439: return "MultiView"; + case 5013: return "StencilExportEXT"; + #ifdef AMD_EXTENSIONS case 5009: return "ImageGatherBiasLodAMD"; + case 5015: return "ImageReadWriteLodAMD"; #endif case 4445: return "AtomicStorageOps"; diff --git a/3rdparty/glslang/SPIRV/spirv.hpp b/3rdparty/glslang/SPIRV/spirv.hpp index 338f6a16d..8bddf7e50 100755 --- a/3rdparty/glslang/SPIRV/spirv.hpp +++ b/3rdparty/glslang/SPIRV/spirv.hpp @@ -47,11 +47,11 @@ namespace spv { typedef unsigned int Id; #define SPV_VERSION 0x10000 -#define SPV_REVISION 11 +#define SPV_REVISION 12 static const unsigned int MagicNumber = 0x07230203; static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 11; +static const unsigned int Revision = 12; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -444,6 +444,7 @@ enum BuiltIn { BuiltInBaryCoordSmoothCentroidAMD = 4996, BuiltInBaryCoordSmoothSampleAMD = 4997, BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, BuiltInViewportMaskNV = 5253, BuiltInSecondaryPositionNV = 5257, BuiltInSecondaryViewportMaskNV = 5258, @@ -640,8 +641,10 @@ enum Capability { CapabilityAtomicStorageOps = 4445, CapabilitySampleMaskPostDepthCoverage = 4447, CapabilityImageGatherBiasLodAMD = 5009, + CapabilityStencilExportEXT = 5013, CapabilitySampleMaskOverrideCoverageNV = 5249, CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, CapabilityShaderViewportIndexLayerNV = 5254, CapabilityShaderViewportMaskNV = 5255, CapabilityShaderStereoViewNV = 5259, diff --git a/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/glslang/StandAlone/StandAlone.cpp index 3301df453..53a33b8a7 100644 --- a/3rdparty/glslang/StandAlone/StandAlone.cpp +++ b/3rdparty/glslang/StandAlone/StandAlone.cpp @@ -152,6 +152,7 @@ int ClientInputSemanticsVersion = 100; // maps to, say, #define VULKAN 100 int VulkanClientVersion = 100; // would map to, say, Vulkan 1.0 int OpenGLClientVersion = 450; // doesn't influence anything yet, but maps to OpenGL 4.50 unsigned int TargetVersion = 0x00001000; // maps to, say, SPIR-V 1.0 +std::vector Processes; // what should be recorded by OpModuleProcessed, or equivalent std::array baseSamplerBinding; std::array baseTextureBinding; @@ -175,6 +176,9 @@ public: text.append("#define "); fixLine(def); + Processes.push_back("D"); + Processes.back().append(def); + // The first "=" needs to turn into a space const size_t equal = def.find_first_of("="); if (equal != def.npos) @@ -189,6 +193,10 @@ public: { text.append("#undef "); fixLine(undef); + + Processes.push_back("U"); + Processes.back().append(undef); + text.append(undef); text.append("\n"); } @@ -421,6 +429,8 @@ void ProcessArguments(std::vector>& workItem } else if (lowerword == "no-storage-format" || // synonyms lowerword == "nsf") { Options |= EOptionNoStorageFormat; + } else if (lowerword == "relaxed-errors") { + Options |= EOptionRelaxedErrors; } else if (lowerword == "resource-set-bindings" || // synonyms lowerword == "resource-set-binding" || lowerword == "rsb") { @@ -459,6 +469,8 @@ void ProcessArguments(std::vector>& workItem sourceEntryPointName = argv[1]; bumpArg(); break; + } else if (lowerword == "suppress-warnings") { + Options |= EOptionSuppressWarnings; } else if (lowerword == "target-env") { if (argc > 1) { if (strcmp(argv[1], "vulkan1.0") == 0) { @@ -737,6 +749,7 @@ void CompileAndLinkShaderUnits(std::vector compUnits) shader->setSourceEntryPoint(sourceEntryPointName); if (UserPreamble.isSet()) shader->setPreamble(UserPreamble.get()); + shader->addProcesses(Processes); shader->setShiftSamplerBinding(baseSamplerBinding[compUnit.stage]); shader->setShiftTextureBinding(baseTextureBinding[compUnit.stage]); @@ -1162,11 +1175,11 @@ void usage() " -m memory leak mode\n" " -o save binary to , requires a binary option (e.g., -V)\n" " -q dump reflection query database\n" - " -r relaxed semantic error-checking mode\n" + " -r synonym for --relaxed-errors\n" " -s silent mode\n" " -t multi-threaded mode\n" " -v print version strings\n" - " -w suppress warnings (except as required by #extension : warn)\n" + " -w synonym for --suppress-warnings\n" " -x save binary output as text-based 32-bit hexadecimal numbers\n" " --auto-map-bindings automatically bind uniform variables\n" " without explicit bindings.\n" @@ -1185,6 +1198,7 @@ void usage() " --ku synonym for --keep-uncalled\n" " --no-storage-format use Unknown image format\n" " --nsf synonym for --no-storage-format\n" + " --relaxed-errors relaxed GLSL semantic error-checking mode\n" " --resource-set-binding [stage] name set binding\n" " Set descriptor set and binding for individual resources\n" " --resource-set-binding [stage] set\n" @@ -1206,11 +1220,13 @@ void usage() " --source-entrypoint name the given shader source function is\n" " renamed to be the entry point given in -e\n" " --sep synonym for --source-entrypoint\n" - " --target-env {vulkan1.0|opengl} set the execution environment the generated\n" - " code will execute in (as opposed to language\n" - " semantics selected by --client)\n" - " default is 'vulkan1.0' under '--client vulkan'\n" - " default is 'opengl' under '--client opengl'\n" + " --suppress-warnings suppress GLSL warnings\n" + " (except as required by #extension : warn)\n" + " --target-env {vulkan1.0|opengl} set the execution environment code will\n" + " execute in (as opposed to language\n" + " semantics selected by --client) defaults:\n" + " 'vulkan1.0' under '--client vulkan'\n" + " 'opengl' under '--client opengl'\n" " --variable-name Creates a C header file that contains a\n" " uint32_t array named \n" " initialized with the shader binary code.\n" diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out new file mode 100644 index 000000000..70465c8e9 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.frag.out @@ -0,0 +1,190 @@ +hlsl.clipdistance-1.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in float) +0:4 'cull' ( in float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 'clip' ( in float) +0:5 'cull' ( in float) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 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:? Sequence +0:4 move second child to first child ( temp float) +0:? 'clip' ( temp float) +0:4 direct index ( temp float) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'cull' ( temp float) +0:4 direct index ( temp float) +0:? 'cull' ( in 1-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp float) +0:? 'cull' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:? 'cull' ( in 1-element array of float CullDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in float) +0:4 'cull' ( in float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 'clip' ( in float) +0:5 'cull' ( in float) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 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:? Sequence +0:4 move second child to first child ( temp float) +0:? 'clip' ( temp float) +0:4 direct index ( temp float) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:? 'cull' ( temp float) +0:4 direct index ( temp float) +0:? 'cull' ( in 1-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1;f1; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp float) +0:? 'cull' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 1-element array of float ClipDistance) +0:? 'cull' ( in 1-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 53 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 27 34 41 45 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 14 "@main(vf4;f1;f1;" + Name 11 "pos" + Name 12 "clip" + Name 13 "cull" + Name 25 "pos" + Name 27 "pos" + Name 29 "clip" + Name 34 "clip" + Name 40 "cull" + Name 41 "cull" + Name 45 "@entryPointOutput" + Name 46 "param" + Name 48 "param" + Name 50 "param" + Decorate 27(pos) BuiltIn FragCoord + Decorate 34(clip) BuiltIn ClipDistance + Decorate 41(cull) BuiltIn CullDistance + Decorate 45(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypePointer Function 6(float) + 10: TypeFunction 7(fvec4) 8(ptr) 9(ptr) 9(ptr) + 26: TypePointer Input 7(fvec4) + 27(pos): 26(ptr) Variable Input + 30: TypeInt 32 0 + 31: 30(int) Constant 1 + 32: TypeArray 6(float) 31 + 33: TypePointer Input 32 + 34(clip): 33(ptr) Variable Input + 35: TypeInt 32 1 + 36: 35(int) Constant 0 + 37: TypePointer Input 6(float) + 41(cull): 33(ptr) Variable Input + 44: TypePointer Output 7(fvec4) +45(@entryPointOutput): 44(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 25(pos): 8(ptr) Variable Function + 29(clip): 9(ptr) Variable Function + 40(cull): 9(ptr) Variable Function + 46(param): 8(ptr) Variable Function + 48(param): 9(ptr) Variable Function + 50(param): 9(ptr) Variable Function + 28: 7(fvec4) Load 27(pos) + Store 25(pos) 28 + 38: 37(ptr) AccessChain 34(clip) 36 + 39: 6(float) Load 38 + Store 29(clip) 39 + 42: 37(ptr) AccessChain 41(cull) 36 + 43: 6(float) Load 42 + Store 40(cull) 43 + 47: 7(fvec4) Load 25(pos) + Store 46(param) 47 + 49: 6(float) Load 29(clip) + Store 48(param) 49 + 51: 6(float) Load 40(cull) + Store 50(param) 51 + 52: 7(fvec4) FunctionCall 14(@main(vf4;f1;f1;) 46(param) 48(param) 50(param) + Store 45(@entryPointOutput) 52 + Return + FunctionEnd +14(@main(vf4;f1;f1;): 7(fvec4) Function None 10 + 11(pos): 8(ptr) FunctionParameter + 12(clip): 9(ptr) FunctionParameter + 13(cull): 9(ptr) FunctionParameter + 15: Label + 16: 7(fvec4) Load 11(pos) + 17: 6(float) Load 12(clip) + 18: 7(fvec4) CompositeConstruct 17 17 17 17 + 19: 7(fvec4) FAdd 16 18 + 20: 6(float) Load 13(cull) + 21: 7(fvec4) CompositeConstruct 20 20 20 20 + 22: 7(fvec4) FAdd 19 21 + ReturnValue 22 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out new file mode 100644 index 000000000..c9263bc09 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-1.geom.out @@ -0,0 +1,153 @@ +hlsl.clipdistance-1.geom +ERROR: 0:13: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 0:13: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 0:20: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 0:20: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 4 compilation errors. No code generated. + + +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +ERROR: node is still EOpNull! +0:13 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-f1-f11;f1[3];f1[3]; ( temp void) +0:13 Function Parameters: +0:13 'pos' ( in 3-element array of 4-component vector of float) +0:13 'VertexID' ( in 3-element array of uint) +0:13 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:13 'clip' ( in 3-element array of float) +0:13 'cull' ( in 3-element array of float) +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 pos: direct index for structure ( temp 4-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:16 Constant: +0:16 0 (const int) +0:16 direct index ( temp 4-component vector of float) +0:16 'pos' ( in 3-element array of 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:17 move second child to first child ( temp float) +0:17 clip: direct index for structure ( temp float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:17 Constant: +0:17 1 (const int) +0:17 direct index ( temp float) +0:17 'clip' ( in 3-element array of float) +0:17 Constant: +0:17 0 (const int) +0:18 move second child to first child ( temp float) +0:18 cull: direct index for structure ( temp float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp float) +0:18 'cull' ( in 3-element array of float) +0:18 Constant: +0:18 0 (const int) +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:20 pos: direct index for structure ( temp 4-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:20 Constant: +0:20 0 (const int) +0:20 EmitVertex ( temp void) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:13 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:13 Function Call: @main(vf4[3];u1[3];struct-S-vf4-f1-f11;f1[3];f1[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:? 'clip' ( temp 3-element array of float) +0:? 'cull' ( temp 3-element array of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +ERROR: node is still EOpNull! +0:13 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-f1-f11;f1[3];f1[3]; ( temp void) +0:13 Function Parameters: +0:13 'pos' ( in 3-element array of 4-component vector of float) +0:13 'VertexID' ( in 3-element array of uint) +0:13 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:13 'clip' ( in 3-element array of float) +0:13 'cull' ( in 3-element array of float) +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 pos: direct index for structure ( temp 4-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:16 Constant: +0:16 0 (const int) +0:16 direct index ( temp 4-component vector of float) +0:16 'pos' ( in 3-element array of 4-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:17 move second child to first child ( temp float) +0:17 clip: direct index for structure ( temp float) +0:17 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:17 Constant: +0:17 1 (const int) +0:17 direct index ( temp float) +0:17 'clip' ( in 3-element array of float) +0:17 Constant: +0:17 0 (const int) +0:18 move second child to first child ( temp float) +0:18 cull: direct index for structure ( temp float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:18 Constant: +0:18 2 (const int) +0:18 direct index ( temp float) +0:18 'cull' ( in 3-element array of float) +0:18 Constant: +0:18 0 (const int) +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:20 pos: direct index for structure ( temp 4-component vector of float) +0:20 's' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:20 Constant: +0:20 0 (const int) +0:20 EmitVertex ( temp void) +0:13 Function Definition: main( ( temp void) +0:13 Function Parameters: +0:? Sequence +0:13 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:13 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:13 Function Call: @main(vf4[3];u1[3];struct-S-vf4-f1-f11;f1[3];f1[3]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp float clip, temp float cull}) +0:? 'clip' ( temp 3-element array of float) +0:? 'cull' ( temp 3-element array of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) + +SPIR-V is not generated for failed compile or link diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out new file mode 100644 index 000000000..f7b8256b5 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.frag.out @@ -0,0 +1,419 @@ +hlsl.clipdistance-2.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of 2-component vector of float) +0:4 'cull' ( in 2-element array of 2-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add ( temp 4-component vector of float) +0:6 add ( temp 4-component vector of float) +0:6 'pos' ( in 4-component vector of float) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'clip' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'cull' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 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:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 3 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 3 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:? 'cull' ( in 4-element array of float CullDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of 2-component vector of float) +0:4 'cull' ( in 2-element array of 2-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add ( temp 4-component vector of float) +0:6 add ( temp 4-component vector of float) +0:6 'pos' ( in 4-component vector of float) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'clip' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp float) +0:6 direct index ( temp 2-component vector of float) +0:6 'cull' ( in 2-element array of 2-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 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:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:4 Constant: +0:4 3 (const int) +0:? Sequence +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 0 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 0 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 1 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 0 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 2 (const int) +0:4 move second child to first child ( temp float) +0:4 direct index ( temp float) +0:4 direct index ( temp 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:4 Constant: +0:4 1 (const int) +0:4 Constant: +0:4 1 (const int) +0:4 direct index ( temp float) +0:? 'cull' ( in 4-element array of float CullDistance) +0:4 Constant: +0:4 3 (const int) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;vf2[2];vf2[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of 2-component vector of float) +0:? 'cull' ( temp 2-element array of 2-component vector of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 4-element array of float ClipDistance) +0:? 'cull' ( in 4-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 84 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 43 62 76 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 18 "@main(vf4;vf2[2];vf2[2];" + Name 15 "pos" + Name 16 "clip" + Name 17 "cull" + Name 35 "pos" + Name 37 "pos" + Name 39 "clip" + Name 43 "clip" + Name 61 "cull" + Name 62 "cull" + Name 76 "@entryPointOutput" + Name 77 "param" + Name 79 "param" + Name 81 "param" + Decorate 37(pos) BuiltIn FragCoord + Decorate 43(clip) BuiltIn ClipDistance + Decorate 62(cull) BuiltIn CullDistance + Decorate 76(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeVector 6(float) 2 + 10: TypeInt 32 0 + 11: 10(int) Constant 2 + 12: TypeArray 9(fvec2) 11 + 13: TypePointer Function 12 + 14: TypeFunction 7(fvec4) 8(ptr) 13(ptr) 13(ptr) + 21: TypeInt 32 1 + 22: 21(int) Constant 0 + 23: 10(int) Constant 0 + 24: TypePointer Function 6(float) + 36: TypePointer Input 7(fvec4) + 37(pos): 36(ptr) Variable Input + 40: 10(int) Constant 4 + 41: TypeArray 6(float) 40 + 42: TypePointer Input 41 + 43(clip): 42(ptr) Variable Input + 44: TypePointer Input 6(float) + 48: 21(int) Constant 1 + 51: 10(int) Constant 1 + 53: 21(int) Constant 2 + 57: 21(int) Constant 3 + 62(cull): 42(ptr) Variable Input + 75: TypePointer Output 7(fvec4) +76(@entryPointOutput): 75(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(pos): 8(ptr) Variable Function + 39(clip): 13(ptr) Variable Function + 61(cull): 13(ptr) Variable Function + 77(param): 8(ptr) Variable Function + 79(param): 13(ptr) Variable Function + 81(param): 13(ptr) Variable Function + 38: 7(fvec4) Load 37(pos) + Store 35(pos) 38 + 45: 44(ptr) AccessChain 43(clip) 22 + 46: 6(float) Load 45 + 47: 24(ptr) AccessChain 39(clip) 22 23 + Store 47 46 + 49: 44(ptr) AccessChain 43(clip) 48 + 50: 6(float) Load 49 + 52: 24(ptr) AccessChain 39(clip) 22 51 + Store 52 50 + 54: 44(ptr) AccessChain 43(clip) 53 + 55: 6(float) Load 54 + 56: 24(ptr) AccessChain 39(clip) 48 23 + Store 56 55 + 58: 44(ptr) AccessChain 43(clip) 57 + 59: 6(float) Load 58 + 60: 24(ptr) AccessChain 39(clip) 48 51 + Store 60 59 + 63: 44(ptr) AccessChain 62(cull) 22 + 64: 6(float) Load 63 + 65: 24(ptr) AccessChain 61(cull) 22 23 + Store 65 64 + 66: 44(ptr) AccessChain 62(cull) 48 + 67: 6(float) Load 66 + 68: 24(ptr) AccessChain 61(cull) 22 51 + Store 68 67 + 69: 44(ptr) AccessChain 62(cull) 53 + 70: 6(float) Load 69 + 71: 24(ptr) AccessChain 61(cull) 48 23 + Store 71 70 + 72: 44(ptr) AccessChain 62(cull) 57 + 73: 6(float) Load 72 + 74: 24(ptr) AccessChain 61(cull) 48 51 + Store 74 73 + 78: 7(fvec4) Load 35(pos) + Store 77(param) 78 + 80: 12 Load 39(clip) + Store 79(param) 80 + 82: 12 Load 61(cull) + Store 81(param) 82 + 83: 7(fvec4) FunctionCall 18(@main(vf4;vf2[2];vf2[2];) 77(param) 79(param) 81(param) + Store 76(@entryPointOutput) 83 + Return + FunctionEnd +18(@main(vf4;vf2[2];vf2[2];): 7(fvec4) Function None 14 + 15(pos): 8(ptr) FunctionParameter + 16(clip): 13(ptr) FunctionParameter + 17(cull): 13(ptr) FunctionParameter + 19: Label + 20: 7(fvec4) Load 15(pos) + 25: 24(ptr) AccessChain 16(clip) 22 23 + 26: 6(float) Load 25 + 27: 7(fvec4) CompositeConstruct 26 26 26 26 + 28: 7(fvec4) FAdd 20 27 + 29: 24(ptr) AccessChain 17(cull) 22 23 + 30: 6(float) Load 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 28 31 + ReturnValue 32 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out new file mode 100644 index 000000000..a2b568af4 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-2.geom.out @@ -0,0 +1,171 @@ +hlsl.clipdistance-2.geom +ERROR: 0:11: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 0:18: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 2 compilation errors. No code generated. + + +Shader version: 500 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +ERROR: node is still EOpNull! +0:11 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:11 Function Parameters: +0:11 'pos' ( in 3-element array of 4-component vector of float) +0:11 'VertexID' ( in 3-element array of uint) +0:11 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:11 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( temp 4-component vector of float) +0:14 'pos' ( in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 direct index ( temp 2-component vector of float) +0:15 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp 2-component vector of float) +0:15 direct index ( temp 2-element array of 2-component vector of float) +0:15 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:16 direct index ( temp 2-component vector of float) +0:16 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 direct index ( temp 2-component vector of float) +0:16 direct index ( temp 2-element array of 2-component vector of float) +0:16 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 0 (const int) +0:18 EmitVertex ( temp void) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:11 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:11 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) + + +Linked geometry stage: + + +Shader version: 500 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = line_strip +ERROR: node is still EOpNull! +0:11 Function Definition: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:11 Function Parameters: +0:11 'pos' ( in 3-element array of 4-component vector of float) +0:11 'VertexID' ( in 3-element array of uint) +0:11 'OutputStream' ( out structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:11 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:? Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 pos: direct index for structure ( temp 4-component vector of float) +0:14 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:14 Constant: +0:14 0 (const int) +0:14 direct index ( temp 4-component vector of float) +0:14 'pos' ( in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 direct index ( temp 2-component vector of float) +0:15 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:15 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:15 Constant: +0:15 1 (const int) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp 2-component vector of float) +0:15 direct index ( temp 2-element array of 2-component vector of float) +0:15 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 2-component vector of float) +0:16 direct index ( temp 2-component vector of float) +0:16 clip: direct index for structure ( temp 2-element array of 2-component vector of float) +0:16 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 1 (const int) +0:16 direct index ( temp 2-component vector of float) +0:16 direct index ( temp 2-element array of 2-component vector of float) +0:16 'clip' ( in 3-element array of 2-element array of 2-component vector of float) +0:16 Constant: +0:16 0 (const int) +0:16 Constant: +0:16 1 (const int) +0:18 Sequence +0:18 Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) +0:18 pos: direct index for structure ( temp 4-component vector of float) +0:18 's' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:18 Constant: +0:18 0 (const int) +0:18 EmitVertex ( temp void) +0:11 Function Definition: main( ( temp void) +0:11 Function Parameters: +0:? Sequence +0:11 move second child to first child ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:11 move second child to first child ( temp 3-element array of uint) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:11 Function Call: @main(vf4[3];u1[3];struct-S-vf4-vf2[2]1;vf2[3][2]; ( temp void) +0:? 'pos' ( temp 3-element array of 4-component vector of float) +0:? 'VertexID' ( temp 3-element array of uint) +0:? 'OutputStream' ( temp structure{ temp 4-component vector of float pos, temp 2-element array of 2-component vector of float clip}) +0:? 'clip' ( temp 3-element array of 2-element array of 2-component vector of float) +0:? Linker Objects +0:? 'pos' ( in 3-element array of 4-component vector of float Position) +0:? 'VertexID' (layout( location=0) in 3-element array of uint) +0:? 'OutputStream.pos' ( out 4-component vector of float Position) + +SPIR-V is not generated for failed compile or link diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out new file mode 100644 index 000000000..8515cd7b6 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-3.frag.out @@ -0,0 +1,190 @@ +hlsl.clipdistance-3.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of float) +0:4 'cull' ( in 2-element array of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 direct index ( temp float) +0:5 'clip' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp float) +0:5 'cull' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 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:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? 'cull' ( in 2-element array of float CullDistance) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? 'cull' ( in 2-element array of float CullDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:4 Function Definition: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:4 Function Parameters: +0:4 'pos' ( in 4-component vector of float) +0:4 'clip' ( in 2-element array of float) +0:4 'cull' ( in 2-element array of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 add ( temp 4-component vector of float) +0:5 add ( temp 4-component vector of float) +0:5 'pos' ( in 4-component vector of float) +0:5 direct index ( temp float) +0:5 'clip' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:5 direct index ( temp float) +0:5 'cull' ( in 2-element array of float) +0:5 Constant: +0:5 0 (const int) +0:4 Function Definition: main( ( temp void) +0:4 Function Parameters: +0:? Sequence +0:4 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:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? Sequence +0:4 move second child to first child ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? 'cull' ( in 2-element array of float CullDistance) +0:4 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:4 Function Call: @main(vf4;f1[2];f1[2]; ( temp 4-component vector of float) +0:? 'pos' ( temp 4-component vector of float) +0:? 'clip' ( temp 2-element array of float) +0:? 'cull' ( temp 2-element array of float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'pos' ( in 4-component vector of float FragCoord) +0:? 'clip' ( in 2-element array of float ClipDistance) +0:? 'cull' ( in 2-element array of float CullDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 53 + + Capability Shader + Capability ClipDistance + Capability CullDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 35 39 42 45 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 17 "@main(vf4;f1[2];f1[2];" + Name 14 "pos" + Name 15 "clip" + Name 16 "cull" + Name 33 "pos" + Name 35 "pos" + Name 37 "clip" + Name 39 "clip" + Name 41 "cull" + Name 42 "cull" + Name 45 "@entryPointOutput" + Name 46 "param" + Name 48 "param" + Name 50 "param" + Decorate 35(pos) BuiltIn FragCoord + Decorate 39(clip) BuiltIn ClipDistance + Decorate 42(cull) BuiltIn CullDistance + Decorate 45(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 6(float) 10 + 12: TypePointer Function 11 + 13: TypeFunction 7(fvec4) 8(ptr) 12(ptr) 12(ptr) + 20: TypeInt 32 1 + 21: 20(int) Constant 0 + 22: TypePointer Function 6(float) + 34: TypePointer Input 7(fvec4) + 35(pos): 34(ptr) Variable Input + 38: TypePointer Input 11 + 39(clip): 38(ptr) Variable Input + 42(cull): 38(ptr) Variable Input + 44: TypePointer Output 7(fvec4) +45(@entryPointOutput): 44(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 33(pos): 8(ptr) Variable Function + 37(clip): 12(ptr) Variable Function + 41(cull): 12(ptr) Variable Function + 46(param): 8(ptr) Variable Function + 48(param): 12(ptr) Variable Function + 50(param): 12(ptr) Variable Function + 36: 7(fvec4) Load 35(pos) + Store 33(pos) 36 + 40: 11 Load 39(clip) + Store 37(clip) 40 + 43: 11 Load 42(cull) + Store 41(cull) 43 + 47: 7(fvec4) Load 33(pos) + Store 46(param) 47 + 49: 11 Load 37(clip) + Store 48(param) 49 + 51: 11 Load 41(cull) + Store 50(param) 51 + 52: 7(fvec4) FunctionCall 17(@main(vf4;f1[2];f1[2];) 46(param) 48(param) 50(param) + Store 45(@entryPointOutput) 52 + Return + FunctionEnd +17(@main(vf4;f1[2];f1[2];): 7(fvec4) Function None 13 + 14(pos): 8(ptr) FunctionParameter + 15(clip): 12(ptr) FunctionParameter + 16(cull): 12(ptr) FunctionParameter + 18: Label + 19: 7(fvec4) Load 14(pos) + 23: 22(ptr) AccessChain 15(clip) 21 + 24: 6(float) Load 23 + 25: 7(fvec4) CompositeConstruct 24 24 24 24 + 26: 7(fvec4) FAdd 19 25 + 27: 22(ptr) AccessChain 16(cull) 21 + 28: 6(float) Load 27 + 29: 7(fvec4) CompositeConstruct 28 28 28 28 + 30: 7(fvec4) FAdd 26 29 + ReturnValue 30 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out new file mode 100644 index 000000000..54a540545 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-4.frag.out @@ -0,0 +1,262 @@ +hlsl.clipdistance-4.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 ClipRect: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 3 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 ClipRect: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 2 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 ClipRect: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 3 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 57 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 24 32 54 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Position" + MemberName 8(VS_OUTPUT) 1 "ClipRect" + Name 11 "@main(struct-VS_OUTPUT-vf4-vf41;" + Name 10 "v" + Name 22 "v" + Name 24 "v.Position" + Name 32 "v.ClipRect" + Name 54 "@entryPointOutput" + Decorate 24(v.Position) BuiltIn FragCoord + Decorate 32(v.ClipRect) BuiltIn ClipDistance + Decorate 54(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4) + 9: TypeFunction 7(fvec4) 8(VS_OUTPUT) + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 16: 13(int) Constant 1 + 21: TypePointer Function 8(VS_OUTPUT) + 23: TypePointer Input 7(fvec4) + 24(v.Position): 23(ptr) Variable Input + 26: TypePointer Function 7(fvec4) + 28: TypeInt 32 0 + 29: 28(int) Constant 4 + 30: TypeArray 6(float) 29 + 31: TypePointer Input 30 + 32(v.ClipRect): 31(ptr) Variable Input + 33: TypePointer Input 6(float) + 36: 28(int) Constant 0 + 37: TypePointer Function 6(float) + 41: 28(int) Constant 1 + 43: 13(int) Constant 2 + 46: 28(int) Constant 2 + 48: 13(int) Constant 3 + 51: 28(int) Constant 3 + 53: TypePointer Output 7(fvec4) +54(@entryPointOutput): 53(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 22(v): 21(ptr) Variable Function + 25: 7(fvec4) Load 24(v.Position) + 27: 26(ptr) AccessChain 22(v) 14 + Store 27 25 + 34: 33(ptr) AccessChain 32(v.ClipRect) 14 + 35: 6(float) Load 34 + 38: 37(ptr) AccessChain 22(v) 16 36 + Store 38 35 + 39: 33(ptr) AccessChain 32(v.ClipRect) 16 + 40: 6(float) Load 39 + 42: 37(ptr) AccessChain 22(v) 16 41 + Store 42 40 + 44: 33(ptr) AccessChain 32(v.ClipRect) 43 + 45: 6(float) Load 44 + 47: 37(ptr) AccessChain 22(v) 16 46 + Store 47 45 + 49: 33(ptr) AccessChain 32(v.ClipRect) 48 + 50: 6(float) Load 49 + 52: 37(ptr) AccessChain 22(v) 16 51 + Store 52 50 + 55:8(VS_OUTPUT) Load 22(v) + 56: 7(fvec4) FunctionCall 11(@main(struct-VS_OUTPUT-vf4-vf41;) 55 + Store 54(@entryPointOutput) 56 + Return + FunctionEnd +11(@main(struct-VS_OUTPUT-vf4-vf41;): 7(fvec4) Function None 9 + 10(v):8(VS_OUTPUT) FunctionParameter + 12: Label + 15: 7(fvec4) CompositeExtract 10(v) 0 + 17: 7(fvec4) CompositeExtract 10(v) 1 + 18: 7(fvec4) FAdd 15 17 + ReturnValue 18 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out new file mode 100644 index 000000000..4b0ce7f78 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-5.frag.out @@ -0,0 +1,325 @@ +hlsl.clipdistance-5.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:7 Function Parameters: +0:7 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Sequence +0:8 Branch: Return with expression +0:8 add ( temp 4-component vector of float) +0:8 add ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:8 direct index ( temp 2-component vector of float) +0:8 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:8 'v' ( const (read only) structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:7 Function Definition: main( ( temp void) +0:7 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp 4-component vector of float) +0:7 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 0 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 1 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 0 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 2 (const int) +0:7 move second child to first child ( temp float) +0:7 direct index ( temp float) +0:7 direct index ( temp 2-component vector of float) +0:7 ClipRect: direct index for structure ( temp 2-element array of 2-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 Constant: +0:7 1 (const int) +0:7 direct index ( temp float) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) +0:7 Constant: +0:7 3 (const int) +0:7 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:7 Function Call: @main(struct-VS_OUTPUT-vf4-vf2[2]1; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 2-element array of 2-component vector of float ClipRect}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.ClipRect' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 62 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 33 40 59 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 12 "VS_OUTPUT" + MemberName 12(VS_OUTPUT) 0 "Position" + MemberName 12(VS_OUTPUT) 1 "ClipRect" + Name 15 "@main(struct-VS_OUTPUT-vf4-vf2[2]1;" + Name 14 "v" + Name 31 "v" + Name 33 "v.Position" + Name 40 "v.ClipRect" + Name 59 "@entryPointOutput" + Decorate 33(v.Position) BuiltIn FragCoord + Decorate 40(v.ClipRect) BuiltIn ClipDistance + Decorate 59(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9: TypeInt 32 0 + 10: 9(int) Constant 2 + 11: TypeArray 8(fvec2) 10 + 12(VS_OUTPUT): TypeStruct 7(fvec4) 11 + 13: TypeFunction 7(fvec4) 12(VS_OUTPUT) + 17: TypeInt 32 1 + 18: 17(int) Constant 0 + 20: 17(int) Constant 1 + 21: 9(int) Constant 0 + 30: TypePointer Function 12(VS_OUTPUT) + 32: TypePointer Input 7(fvec4) + 33(v.Position): 32(ptr) Variable Input + 35: TypePointer Function 7(fvec4) + 37: 9(int) Constant 4 + 38: TypeArray 6(float) 37 + 39: TypePointer Input 38 + 40(v.ClipRect): 39(ptr) Variable Input + 41: TypePointer Input 6(float) + 44: TypePointer Function 6(float) + 48: 9(int) Constant 1 + 50: 17(int) Constant 2 + 54: 17(int) Constant 3 + 58: TypePointer Output 7(fvec4) +59(@entryPointOutput): 58(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 31(v): 30(ptr) Variable Function + 34: 7(fvec4) Load 33(v.Position) + 36: 35(ptr) AccessChain 31(v) 18 + Store 36 34 + 42: 41(ptr) AccessChain 40(v.ClipRect) 18 + 43: 6(float) Load 42 + 45: 44(ptr) AccessChain 31(v) 20 18 21 + Store 45 43 + 46: 41(ptr) AccessChain 40(v.ClipRect) 20 + 47: 6(float) Load 46 + 49: 44(ptr) AccessChain 31(v) 20 18 48 + Store 49 47 + 51: 41(ptr) AccessChain 40(v.ClipRect) 50 + 52: 6(float) Load 51 + 53: 44(ptr) AccessChain 31(v) 20 20 21 + Store 53 52 + 55: 41(ptr) AccessChain 40(v.ClipRect) 54 + 56: 6(float) Load 55 + 57: 44(ptr) AccessChain 31(v) 20 20 48 + Store 57 56 + 60:12(VS_OUTPUT) Load 31(v) + 61: 7(fvec4) FunctionCall 15(@main(struct-VS_OUTPUT-vf4-vf2[2]1;) 60 + Store 59(@entryPointOutput) 61 + Return + FunctionEnd +15(@main(struct-VS_OUTPUT-vf4-vf2[2]1;): 7(fvec4) Function None 13 + 14(v):12(VS_OUTPUT) FunctionParameter + 16: Label + 19: 7(fvec4) CompositeExtract 14(v) 0 + 22: 6(float) CompositeExtract 14(v) 1 0 0 + 23: 7(fvec4) CompositeConstruct 22 22 22 22 + 24: 7(fvec4) FAdd 19 23 + 25: 6(float) CompositeExtract 14(v) 1 1 0 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 24 26 + ReturnValue 27 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out new file mode 100644 index 000000000..57166ae80 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-6.frag.out @@ -0,0 +1,399 @@ +hlsl.clipdistance-6.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 clip0: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 clip0: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf4-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 4-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 79 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 31 38 75 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 8 "VS_OUTPUT" + MemberName 8(VS_OUTPUT) 0 "Position" + MemberName 8(VS_OUTPUT) 1 "clip0" + MemberName 8(VS_OUTPUT) 2 "clip1" + Name 12 "@main(struct-VS_OUTPUT-vf4-vf4-vf41;" + Name 11 "v" + Name 29 "v" + Name 31 "v.Position" + Name 38 "v.clip1" + Name 75 "@entryPointOutput" + Name 76 "param" + Decorate 31(v.Position) BuiltIn FragCoord + Decorate 38(v.clip1) BuiltIn ClipDistance + Decorate 75(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(VS_OUTPUT): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) + 9: TypePointer Function 8(VS_OUTPUT) + 10: TypeFunction 7(fvec4) 9(ptr) + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Function 7(fvec4) + 19: 14(int) Constant 1 + 23: 14(int) Constant 2 + 30: TypePointer Input 7(fvec4) + 31(v.Position): 30(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 8 + 36: TypeArray 6(float) 35 + 37: TypePointer Input 36 + 38(v.clip1): 37(ptr) Variable Input + 39: TypePointer Input 6(float) + 42: 34(int) Constant 0 + 43: TypePointer Function 6(float) + 47: 34(int) Constant 1 + 51: 34(int) Constant 2 + 53: 14(int) Constant 3 + 56: 34(int) Constant 3 + 58: 14(int) Constant 4 + 62: 14(int) Constant 5 + 66: 14(int) Constant 6 + 70: 14(int) Constant 7 + 74: TypePointer Output 7(fvec4) +75(@entryPointOutput): 74(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 29(v): 9(ptr) Variable Function + 76(param): 9(ptr) Variable Function + 32: 7(fvec4) Load 31(v.Position) + 33: 16(ptr) AccessChain 29(v) 15 + Store 33 32 + 40: 39(ptr) AccessChain 38(v.clip1) 15 + 41: 6(float) Load 40 + 44: 43(ptr) AccessChain 29(v) 19 42 + Store 44 41 + 45: 39(ptr) AccessChain 38(v.clip1) 19 + 46: 6(float) Load 45 + 48: 43(ptr) AccessChain 29(v) 19 47 + Store 48 46 + 49: 39(ptr) AccessChain 38(v.clip1) 23 + 50: 6(float) Load 49 + 52: 43(ptr) AccessChain 29(v) 19 51 + Store 52 50 + 54: 39(ptr) AccessChain 38(v.clip1) 53 + 55: 6(float) Load 54 + 57: 43(ptr) AccessChain 29(v) 19 56 + Store 57 55 + 59: 39(ptr) AccessChain 38(v.clip1) 58 + 60: 6(float) Load 59 + 61: 43(ptr) AccessChain 29(v) 23 42 + Store 61 60 + 63: 39(ptr) AccessChain 38(v.clip1) 62 + 64: 6(float) Load 63 + 65: 43(ptr) AccessChain 29(v) 23 47 + Store 65 64 + 67: 39(ptr) AccessChain 38(v.clip1) 66 + 68: 6(float) Load 67 + 69: 43(ptr) AccessChain 29(v) 23 51 + Store 69 68 + 71: 39(ptr) AccessChain 38(v.clip1) 70 + 72: 6(float) Load 71 + 73: 43(ptr) AccessChain 29(v) 23 56 + Store 73 72 + 77:8(VS_OUTPUT) Load 29(v) + Store 76(param) 77 + 78: 7(fvec4) FunctionCall 12(@main(struct-VS_OUTPUT-vf4-vf4-vf41;) 76(param) + Store 75(@entryPointOutput) 78 + Return + FunctionEnd +12(@main(struct-VS_OUTPUT-vf4-vf4-vf41;): 7(fvec4) Function None 10 + 11(v): 9(ptr) FunctionParameter + 13: Label + 17: 16(ptr) AccessChain 11(v) 15 + 18: 7(fvec4) Load 17 + 20: 16(ptr) AccessChain 11(v) 19 + 21: 7(fvec4) Load 20 + 22: 7(fvec4) FAdd 18 21 + 24: 16(ptr) AccessChain 11(v) 23 + 25: 7(fvec4) Load 24 + 26: 7(fvec4) FAdd 22 25 + ReturnValue 26 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out new file mode 100644 index 000000000..22cb0e5ac --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-7.frag.out @@ -0,0 +1,385 @@ +hlsl.clipdistance-7.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 0 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip1: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 0 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 4 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 5 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 6 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip1: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 3 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) +0:8 Constant: +0:8 7 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-vf41; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp 4-component vector of float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 8-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 78 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 43 74 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "clip0" + MemberName 9(VS_OUTPUT) 2 "clip1" + Name 13 "@main(struct-VS_OUTPUT-vf4-vf3-vf41;" + Name 12 "v" + Name 35 "v" + Name 37 "v.Position" + Name 43 "v.clip1" + Name 74 "@entryPointOutput" + Name 75 "param" + Decorate 37(v.Position) BuiltIn FragCoord + Decorate 43(v.clip1) BuiltIn ClipDistance + Decorate 74(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_OUTPUT): TypeStruct 7(fvec4) 8(fvec3) 7(fvec4) + 10: TypePointer Function 9(VS_OUTPUT) + 11: TypeFunction 7(fvec4) 10(ptr) + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Function 7(fvec4) + 20: 15(int) Constant 1 + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 28: 15(int) Constant 2 + 36: TypePointer Input 7(fvec4) + 37(v.Position): 36(ptr) Variable Input + 40: 21(int) Constant 8 + 41: TypeArray 6(float) 40 + 42: TypePointer Input 41 + 43(v.clip1): 42(ptr) Variable Input + 44: TypePointer Input 6(float) + 50: 21(int) Constant 1 + 54: 21(int) Constant 2 + 56: 15(int) Constant 4 + 60: 15(int) Constant 5 + 64: 15(int) Constant 6 + 68: 15(int) Constant 7 + 71: 21(int) Constant 3 + 73: TypePointer Output 7(fvec4) +74(@entryPointOutput): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(v): 10(ptr) Variable Function + 75(param): 10(ptr) Variable Function + 38: 7(fvec4) Load 37(v.Position) + 39: 17(ptr) AccessChain 35(v) 16 + Store 39 38 + 45: 44(ptr) AccessChain 43(v.clip1) 16 + 46: 6(float) Load 45 + 47: 23(ptr) AccessChain 35(v) 20 22 + Store 47 46 + 48: 44(ptr) AccessChain 43(v.clip1) 20 + 49: 6(float) Load 48 + 51: 23(ptr) AccessChain 35(v) 20 50 + Store 51 49 + 52: 44(ptr) AccessChain 43(v.clip1) 28 + 53: 6(float) Load 52 + 55: 23(ptr) AccessChain 35(v) 20 54 + Store 55 53 + 57: 44(ptr) AccessChain 43(v.clip1) 56 + 58: 6(float) Load 57 + 59: 23(ptr) AccessChain 35(v) 28 22 + Store 59 58 + 61: 44(ptr) AccessChain 43(v.clip1) 60 + 62: 6(float) Load 61 + 63: 23(ptr) AccessChain 35(v) 28 50 + Store 63 62 + 65: 44(ptr) AccessChain 43(v.clip1) 64 + 66: 6(float) Load 65 + 67: 23(ptr) AccessChain 35(v) 28 54 + Store 67 66 + 69: 44(ptr) AccessChain 43(v.clip1) 68 + 70: 6(float) Load 69 + 72: 23(ptr) AccessChain 35(v) 28 71 + Store 72 70 + 76:9(VS_OUTPUT) Load 35(v) + Store 75(param) 76 + 77: 7(fvec4) FunctionCall 13(@main(struct-VS_OUTPUT-vf4-vf3-vf41;) 75(param) + Store 74(@entryPointOutput) 77 + Return + FunctionEnd +13(@main(struct-VS_OUTPUT-vf4-vf3-vf41;): 7(fvec4) Function None 11 + 12(v): 10(ptr) FunctionParameter + 14: Label + 18: 17(ptr) AccessChain 12(v) 16 + 19: 7(fvec4) Load 18 + 24: 23(ptr) AccessChain 12(v) 20 22 + 25: 6(float) Load 24 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 19 26 + 29: 23(ptr) AccessChain 12(v) 28 22 + 30: 6(float) Load 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 27 31 + ReturnValue 32 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out new file mode 100644 index 000000000..a1f66483d --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-8.frag.out @@ -0,0 +1,285 @@ +hlsl.clipdistance-8.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 clip1: direct index for structure ( temp float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 clip1: direct index for structure ( temp float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:8 Function Parameters: +0:8 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Sequence +0:9 Branch: Return with expression +0:9 add ( temp 4-component vector of float) +0:9 add ( temp 4-component vector of float) +0:9 Position: direct index for structure ( temp 4-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 0 (const int) +0:9 direct index ( temp float) +0:9 clip0: direct index for structure ( temp 3-component vector of float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 1 (const int) +0:9 Constant: +0:9 0 (const int) +0:9 clip1: direct index for structure ( temp float) +0:9 'v' ( in structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:9 Constant: +0:9 2 (const int) +0:8 Function Definition: main( ( temp void) +0:8 Function Parameters: +0:? Sequence +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 Position: direct index for structure ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 0 (const int) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 0 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 0 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 1 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 1 (const int) +0:8 move second child to first child ( temp float) +0:8 direct index ( temp float) +0:8 clip0: direct index for structure ( temp 3-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 1 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 2 (const int) +0:? Sequence +0:8 move second child to first child ( temp float) +0:8 clip1: direct index for structure ( temp float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:8 Constant: +0:8 2 (const int) +0:8 direct index ( temp float) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) +0:8 Constant: +0:8 3 (const int) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:8 Function Call: @main(struct-VS_OUTPUT-vf4-vf3-f11; ( temp 4-component vector of float) +0:? 'v' ( temp structure{ temp 4-component vector of float Position, temp 3-component vector of float clip0, temp float clip1}) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'v.Position' ( in 4-component vector of float FragCoord) +0:? 'v.clip1' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 65 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 37 43 61 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 9 "VS_OUTPUT" + MemberName 9(VS_OUTPUT) 0 "Position" + MemberName 9(VS_OUTPUT) 1 "clip0" + MemberName 9(VS_OUTPUT) 2 "clip1" + Name 13 "@main(struct-VS_OUTPUT-vf4-vf3-f11;" + Name 12 "v" + Name 35 "v" + Name 37 "v.Position" + Name 43 "v.clip1" + Name 61 "@entryPointOutput" + Name 62 "param" + Decorate 37(v.Position) BuiltIn FragCoord + Decorate 43(v.clip1) BuiltIn ClipDistance + Decorate 61(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 3 + 9(VS_OUTPUT): TypeStruct 7(fvec4) 8(fvec3) 6(float) + 10: TypePointer Function 9(VS_OUTPUT) + 11: TypeFunction 7(fvec4) 10(ptr) + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Function 7(fvec4) + 20: 15(int) Constant 1 + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 28: 15(int) Constant 2 + 36: TypePointer Input 7(fvec4) + 37(v.Position): 36(ptr) Variable Input + 40: 21(int) Constant 4 + 41: TypeArray 6(float) 40 + 42: TypePointer Input 41 + 43(v.clip1): 42(ptr) Variable Input + 44: TypePointer Input 6(float) + 50: 21(int) Constant 1 + 54: 21(int) Constant 2 + 56: 15(int) Constant 3 + 60: TypePointer Output 7(fvec4) +61(@entryPointOutput): 60(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 35(v): 10(ptr) Variable Function + 62(param): 10(ptr) Variable Function + 38: 7(fvec4) Load 37(v.Position) + 39: 17(ptr) AccessChain 35(v) 16 + Store 39 38 + 45: 44(ptr) AccessChain 43(v.clip1) 16 + 46: 6(float) Load 45 + 47: 23(ptr) AccessChain 35(v) 20 22 + Store 47 46 + 48: 44(ptr) AccessChain 43(v.clip1) 20 + 49: 6(float) Load 48 + 51: 23(ptr) AccessChain 35(v) 20 50 + Store 51 49 + 52: 44(ptr) AccessChain 43(v.clip1) 28 + 53: 6(float) Load 52 + 55: 23(ptr) AccessChain 35(v) 20 54 + Store 55 53 + 57: 44(ptr) AccessChain 43(v.clip1) 56 + 58: 6(float) Load 57 + 59: 23(ptr) AccessChain 35(v) 28 + Store 59 58 + 63:9(VS_OUTPUT) Load 35(v) + Store 62(param) 63 + 64: 7(fvec4) FunctionCall 13(@main(struct-VS_OUTPUT-vf4-vf3-f11;) 62(param) + Store 61(@entryPointOutput) 64 + Return + FunctionEnd +13(@main(struct-VS_OUTPUT-vf4-vf3-f11;): 7(fvec4) Function None 11 + 12(v): 10(ptr) FunctionParameter + 14: Label + 18: 17(ptr) AccessChain 12(v) 16 + 19: 7(fvec4) Load 18 + 24: 23(ptr) AccessChain 12(v) 20 22 + 25: 6(float) Load 24 + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 19 26 + 29: 23(ptr) AccessChain 12(v) 28 + 30: 6(float) Load 29 + 31: 7(fvec4) CompositeConstruct 30 30 30 30 + 32: 7(fvec4) FAdd 27 31 + ReturnValue 32 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out new file mode 100644 index 000000000..ef52b230f --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.clipdistance-9.frag.out @@ -0,0 +1,250 @@ +hlsl.clipdistance-9.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:6 Function Parameters: +0:6 'Position' ( in 4-component vector of float) +0:6 'clip0' ( in 3-component vector of float) +0:6 'clip1' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp 4-component vector of float) +0:7 add ( temp 4-component vector of float) +0:7 'Position' ( in 4-component vector of float) +0:7 direct index ( temp float) +0:7 'clip0' ( in 3-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 'clip1' ( in float) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 0 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 2 (const int) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 2 (const int) +0:? Sequence +0:6 move second child to first child ( temp float) +0:? 'clip1' ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 3 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'clip0' ( temp 3-component vector of float) +0:? 'clip1' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? 'clip0' ( in 4-element array of float ClipDistance) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:6 Function Definition: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:6 Function Parameters: +0:6 'Position' ( in 4-component vector of float) +0:6 'clip0' ( in 3-component vector of float) +0:6 'clip1' ( in float) +0:? Sequence +0:7 Branch: Return with expression +0:7 add ( temp 4-component vector of float) +0:7 add ( temp 4-component vector of float) +0:7 'Position' ( in 4-component vector of float) +0:7 direct index ( temp float) +0:7 'clip0' ( in 3-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 'clip1' ( in float) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? Sequence +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 0 (const int) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 0 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 1 (const int) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 1 (const int) +0:6 move second child to first child ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( temp 3-component vector of float) +0:6 Constant: +0:6 2 (const int) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 2 (const int) +0:? Sequence +0:6 move second child to first child ( temp float) +0:? 'clip1' ( temp float) +0:6 direct index ( temp float) +0:? 'clip0' ( in 4-element array of float ClipDistance) +0:6 Constant: +0:6 3 (const int) +0:6 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:6 Function Call: @main(vf4;vf3;f1; ( temp 4-component vector of float) +0:? 'Position' ( temp 4-component vector of float) +0:? 'clip0' ( temp 3-component vector of float) +0:? 'clip1' ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'Position' ( in 4-component vector of float FragCoord) +0:? 'clip0' ( in 4-element array of float ClipDistance) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 68 + + Capability Shader + Capability ClipDistance + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 32 38 60 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 16 "@main(vf4;vf3;f1;" + Name 13 "Position" + Name 14 "clip0" + Name 15 "clip1" + Name 30 "Position" + Name 32 "Position" + Name 34 "clip0" + Name 38 "clip0" + Name 55 "clip1" + Name 60 "@entryPointOutput" + Name 61 "param" + Name 63 "param" + Name 65 "param" + Decorate 32(Position) BuiltIn FragCoord + Decorate 38(clip0) BuiltIn ClipDistance + Decorate 60(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeVector 6(float) 3 + 10: TypePointer Function 9(fvec3) + 11: TypePointer Function 6(float) + 12: TypeFunction 7(fvec4) 8(ptr) 10(ptr) 11(ptr) + 19: TypeInt 32 0 + 20: 19(int) Constant 0 + 31: TypePointer Input 7(fvec4) + 32(Position): 31(ptr) Variable Input + 35: 19(int) Constant 4 + 36: TypeArray 6(float) 35 + 37: TypePointer Input 36 + 38(clip0): 37(ptr) Variable Input + 39: TypeInt 32 1 + 40: 39(int) Constant 0 + 41: TypePointer Input 6(float) + 45: 39(int) Constant 1 + 48: 19(int) Constant 1 + 50: 39(int) Constant 2 + 53: 19(int) Constant 2 + 56: 39(int) Constant 3 + 59: TypePointer Output 7(fvec4) +60(@entryPointOutput): 59(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 30(Position): 8(ptr) Variable Function + 34(clip0): 10(ptr) Variable Function + 55(clip1): 11(ptr) Variable Function + 61(param): 8(ptr) Variable Function + 63(param): 10(ptr) Variable Function + 65(param): 11(ptr) Variable Function + 33: 7(fvec4) Load 32(Position) + Store 30(Position) 33 + 42: 41(ptr) AccessChain 38(clip0) 40 + 43: 6(float) Load 42 + 44: 11(ptr) AccessChain 34(clip0) 20 + Store 44 43 + 46: 41(ptr) AccessChain 38(clip0) 45 + 47: 6(float) Load 46 + 49: 11(ptr) AccessChain 34(clip0) 48 + Store 49 47 + 51: 41(ptr) AccessChain 38(clip0) 50 + 52: 6(float) Load 51 + 54: 11(ptr) AccessChain 34(clip0) 53 + Store 54 52 + 57: 41(ptr) AccessChain 38(clip0) 56 + 58: 6(float) Load 57 + Store 55(clip1) 58 + 62: 7(fvec4) Load 30(Position) + Store 61(param) 62 + 64: 9(fvec3) Load 34(clip0) + Store 63(param) 64 + 66: 6(float) Load 55(clip1) + Store 65(param) 66 + 67: 7(fvec4) FunctionCall 16(@main(vf4;vf3;f1;) 61(param) 63(param) 65(param) + Store 60(@entryPointOutput) 67 + Return + FunctionEnd +16(@main(vf4;vf3;f1;): 7(fvec4) Function None 12 + 13(Position): 8(ptr) FunctionParameter + 14(clip0): 10(ptr) FunctionParameter + 15(clip1): 11(ptr) FunctionParameter + 17: Label + 18: 7(fvec4) Load 13(Position) + 21: 11(ptr) AccessChain 14(clip0) 20 + 22: 6(float) Load 21 + 23: 7(fvec4) CompositeConstruct 22 22 22 22 + 24: 7(fvec4) FAdd 18 23 + 25: 6(float) Load 15(clip1) + 26: 7(fvec4) CompositeConstruct 25 25 25 25 + 27: 7(fvec4) FAdd 24 26 + ReturnValue 27 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out b/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out index 9cdf297e4..e8a195531 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.domain.1.tese.out @@ -4,9 +4,10 @@ input primitive = triangles vertex spacing = none triangle order = none 0:? Sequence -0:22 Function Definition: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Definition: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:22 Function Parameters: 0:22 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 'f' ( in float) 0:22 'tesscoord' ( in 3-component vector of float) 0:22 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) 0:? Sequence @@ -23,10 +24,12 @@ triangle order = none 0:25 0 (const int) 0:25 Constant: 0:25 0 (const int) -0:25 direct index ( temp float) -0:25 'tesscoord' ( in 3-component vector of float) -0:25 Constant: -0:25 0 (const int) +0:25 component-wise multiply ( temp float) +0:25 direct index ( temp float) +0:25 'tesscoord' ( in 3-component vector of float) +0:25 Constant: +0:25 0 (const int) +0:25 'f' ( in float) 0:26 move second child to first child ( temp 3-component vector of float) 0:26 norm: direct index for structure ( temp 3-component vector of float) 0:26 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) @@ -56,6 +59,9 @@ triangle order = none 0:22 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=2) patch in float) 0:22 move second child to first child ( temp 3-component vector of float) 0:? 'tesscoord' ( temp 3-component vector of float) 0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) @@ -108,8 +114,9 @@ triangle order = none 0:22 Sequence 0:22 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) -0:22 Function Call: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Call: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' ( temp float) 0:? 'tesscoord' ( temp 3-component vector of float) 0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) 0:22 move second child to first child ( temp 4-component vector of float) @@ -128,6 +135,7 @@ triangle order = none 0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) 0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' (layout( location=2) patch in float) 0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) 0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) 0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) @@ -141,9 +149,10 @@ input primitive = triangles vertex spacing = none triangle order = none 0:? Sequence -0:22 Function Definition: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Definition: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:22 Function Parameters: 0:22 'i' ( const (read only) 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 'f' ( in float) 0:22 'tesscoord' ( in 3-component vector of float) 0:22 'pcf_data' ( in structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) 0:? Sequence @@ -160,10 +169,12 @@ triangle order = none 0:25 0 (const int) 0:25 Constant: 0:25 0 (const int) -0:25 direct index ( temp float) -0:25 'tesscoord' ( in 3-component vector of float) -0:25 Constant: -0:25 0 (const int) +0:25 component-wise multiply ( temp float) +0:25 direct index ( temp float) +0:25 'tesscoord' ( in 3-component vector of float) +0:25 Constant: +0:25 0 (const int) +0:25 'f' ( in float) 0:26 move second child to first child ( temp 3-component vector of float) 0:26 norm: direct index for structure ( temp 3-component vector of float) 0:26 'o' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) @@ -193,6 +204,9 @@ triangle order = none 0:22 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 move second child to first child ( temp float) +0:? 'f' ( temp float) +0:? 'f' (layout( location=2) patch in float) 0:22 move second child to first child ( temp 3-component vector of float) 0:? 'tesscoord' ( temp 3-component vector of float) 0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) @@ -245,8 +259,9 @@ triangle order = none 0:22 Sequence 0:22 move second child to first child ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:22 'flattenTemp' ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) -0:22 Function Call: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:22 Function Call: @main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' ( temp float) 0:? 'tesscoord' ( temp 3-component vector of float) 0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor}) 0:22 move second child to first child ( temp 4-component vector of float) @@ -265,56 +280,63 @@ triangle order = none 0:? '@entryPointOutput.pos' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput.norm' (layout( location=1) out 3-component vector of float) 0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) +0:? 'f' (layout( location=2) patch in float) 0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) 0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) 0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 95 +// Id's are bound by 103 Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationEvaluation 4 "main" 51 55 61 76 88 92 + EntryPoint TessellationEvaluation 4 "main" 54 58 62 68 82 96 100 ExecutionMode 4 Triangles Source HLSL 500 Name 4 "main" Name 9 "ds_in_t" MemberName 9(ds_in_t) 0 "pos" MemberName 9(ds_in_t) 1 "norm" - Name 15 "pcf_in_t" - MemberName 15(pcf_in_t) 0 "flTessFactor" - MemberName 15(pcf_in_t) 1 "flInsideTessFactor" - Name 17 "gs_in_t" - MemberName 17(gs_in_t) 0 "pos" - MemberName 17(gs_in_t) 1 "norm" - Name 22 "@main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11;" - Name 19 "i" - Name 20 "tesscoord" - Name 21 "pcf_data" - Name 25 "o" - Name 49 "i" - Name 51 "i" - Name 53 "tesscoord" - Name 55 "tesscoord" - Name 57 "pcf_data" - Name 61 "pcf_data.flTessFactor" - Name 76 "pcf_data.flInsideTessFactor" - Name 80 "flattenTemp" - Name 82 "param" - Name 84 "param" - Name 88 "@entryPointOutput.pos" - Name 92 "@entryPointOutput.norm" - Decorate 51(i) Location 0 - Decorate 55(tesscoord) Patch - Decorate 55(tesscoord) BuiltIn TessCoord - Decorate 61(pcf_data.flTessFactor) Patch - Decorate 61(pcf_data.flTessFactor) BuiltIn TessLevelOuter - Decorate 76(pcf_data.flInsideTessFactor) Patch - Decorate 76(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner - Decorate 88(@entryPointOutput.pos) Location 0 - Decorate 92(@entryPointOutput.norm) Location 1 + Name 16 "pcf_in_t" + MemberName 16(pcf_in_t) 0 "flTessFactor" + MemberName 16(pcf_in_t) 1 "flInsideTessFactor" + Name 18 "gs_in_t" + MemberName 18(gs_in_t) 0 "pos" + MemberName 18(gs_in_t) 1 "norm" + Name 24 "@main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11;" + Name 20 "i" + Name 21 "f" + Name 22 "tesscoord" + Name 23 "pcf_data" + Name 27 "o" + Name 52 "i" + Name 54 "i" + Name 56 "f" + Name 58 "f" + Name 60 "tesscoord" + Name 62 "tesscoord" + Name 64 "pcf_data" + Name 68 "pcf_data.flTessFactor" + Name 82 "pcf_data.flInsideTessFactor" + Name 86 "flattenTemp" + Name 88 "param" + Name 90 "param" + Name 92 "param" + Name 96 "@entryPointOutput.pos" + Name 100 "@entryPointOutput.norm" + Decorate 54(i) Location 0 + Decorate 58(f) Patch + Decorate 58(f) Location 2 + Decorate 62(tesscoord) Patch + Decorate 62(tesscoord) BuiltIn TessCoord + Decorate 68(pcf_data.flTessFactor) Patch + Decorate 68(pcf_data.flTessFactor) BuiltIn TessLevelOuter + Decorate 82(pcf_data.flInsideTessFactor) Patch + Decorate 82(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner + Decorate 96(@entryPointOutput.pos) Location 0 + Decorate 100(@entryPointOutput.norm) Location 1 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -324,102 +346,112 @@ triangle order = none 10: TypeInt 32 0 11: 10(int) Constant 3 12: TypeArray 9(ds_in_t) 11 - 13: TypePointer Function 8(fvec3) - 14: TypeArray 6(float) 11 - 15(pcf_in_t): TypeStruct 14 6(float) - 16: TypePointer Function 15(pcf_in_t) - 17(gs_in_t): TypeStruct 7(fvec4) 8(fvec3) - 18: TypeFunction 17(gs_in_t) 12 13(ptr) 16(ptr) - 24: TypePointer Function 17(gs_in_t) - 26: TypeInt 32 1 - 27: 26(int) Constant 0 - 29: 10(int) Constant 0 - 30: TypePointer Function 6(float) - 35: TypePointer Function 7(fvec4) - 37: 26(int) Constant 1 - 39: 10(int) Constant 1 - 48: TypePointer Function 12 - 50: TypePointer Input 12 - 51(i): 50(ptr) Variable Input - 54: TypePointer Input 8(fvec3) - 55(tesscoord): 54(ptr) Variable Input - 58: 10(int) Constant 4 - 59: TypeArray 6(float) 58 - 60: TypePointer Input 59 -61(pcf_data.flTessFactor): 60(ptr) Variable Input - 62: TypePointer Input 6(float) - 69: 26(int) Constant 2 - 73: 10(int) Constant 2 - 74: TypeArray 6(float) 73 - 75: TypePointer Input 74 -76(pcf_data.flInsideTessFactor): 75(ptr) Variable Input - 87: TypePointer Output 7(fvec4) -88(@entryPointOutput.pos): 87(ptr) Variable Output - 91: TypePointer Output 8(fvec3) -92(@entryPointOutput.norm): 91(ptr) Variable Output + 13: TypePointer Function 6(float) + 14: TypePointer Function 8(fvec3) + 15: TypeArray 6(float) 11 + 16(pcf_in_t): TypeStruct 15 6(float) + 17: TypePointer Function 16(pcf_in_t) + 18(gs_in_t): TypeStruct 7(fvec4) 8(fvec3) + 19: TypeFunction 18(gs_in_t) 12 13(ptr) 14(ptr) 17(ptr) + 26: TypePointer Function 18(gs_in_t) + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 31: 10(int) Constant 0 + 38: TypePointer Function 7(fvec4) + 40: 28(int) Constant 1 + 42: 10(int) Constant 1 + 51: TypePointer Function 12 + 53: TypePointer Input 12 + 54(i): 53(ptr) Variable Input + 57: TypePointer Input 6(float) + 58(f): 57(ptr) Variable Input + 61: TypePointer Input 8(fvec3) + 62(tesscoord): 61(ptr) Variable Input + 65: 10(int) Constant 4 + 66: TypeArray 6(float) 65 + 67: TypePointer Input 66 +68(pcf_data.flTessFactor): 67(ptr) Variable Input + 75: 28(int) Constant 2 + 79: 10(int) Constant 2 + 80: TypeArray 6(float) 79 + 81: TypePointer Input 80 +82(pcf_data.flInsideTessFactor): 81(ptr) Variable Input + 95: TypePointer Output 7(fvec4) +96(@entryPointOutput.pos): 95(ptr) Variable Output + 99: TypePointer Output 8(fvec3) +100(@entryPointOutput.norm): 99(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 49(i): 48(ptr) Variable Function - 53(tesscoord): 13(ptr) Variable Function - 57(pcf_data): 16(ptr) Variable Function - 80(flattenTemp): 24(ptr) Variable Function - 82(param): 13(ptr) Variable Function - 84(param): 16(ptr) Variable Function - 52: 12 Load 51(i) - Store 49(i) 52 - 56: 8(fvec3) Load 55(tesscoord) - Store 53(tesscoord) 56 - 63: 62(ptr) AccessChain 61(pcf_data.flTessFactor) 27 - 64: 6(float) Load 63 - 65: 30(ptr) AccessChain 57(pcf_data) 27 27 - Store 65 64 - 66: 62(ptr) AccessChain 61(pcf_data.flTessFactor) 37 - 67: 6(float) Load 66 - 68: 30(ptr) AccessChain 57(pcf_data) 27 37 - Store 68 67 - 70: 62(ptr) AccessChain 61(pcf_data.flTessFactor) 69 - 71: 6(float) Load 70 - 72: 30(ptr) AccessChain 57(pcf_data) 27 69 - Store 72 71 - 77: 62(ptr) AccessChain 76(pcf_data.flInsideTessFactor) 27 - 78: 6(float) Load 77 - 79: 30(ptr) AccessChain 57(pcf_data) 37 - Store 79 78 - 81: 12 Load 49(i) - 83: 8(fvec3) Load 53(tesscoord) - Store 82(param) 83 - 85:15(pcf_in_t) Load 57(pcf_data) - Store 84(param) 85 - 86: 17(gs_in_t) FunctionCall 22(@main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11;) 81 82(param) 84(param) - Store 80(flattenTemp) 86 - 89: 35(ptr) AccessChain 80(flattenTemp) 27 - 90: 7(fvec4) Load 89 - Store 88(@entryPointOutput.pos) 90 - 93: 13(ptr) AccessChain 80(flattenTemp) 37 - 94: 8(fvec3) Load 93 - Store 92(@entryPointOutput.norm) 94 + 52(i): 51(ptr) Variable Function + 56(f): 13(ptr) Variable Function + 60(tesscoord): 14(ptr) Variable Function + 64(pcf_data): 17(ptr) Variable Function + 86(flattenTemp): 26(ptr) Variable Function + 88(param): 13(ptr) Variable Function + 90(param): 14(ptr) Variable Function + 92(param): 17(ptr) Variable Function + 55: 12 Load 54(i) + Store 52(i) 55 + 59: 6(float) Load 58(f) + Store 56(f) 59 + 63: 8(fvec3) Load 62(tesscoord) + Store 60(tesscoord) 63 + 69: 57(ptr) AccessChain 68(pcf_data.flTessFactor) 29 + 70: 6(float) Load 69 + 71: 13(ptr) AccessChain 64(pcf_data) 29 29 + Store 71 70 + 72: 57(ptr) AccessChain 68(pcf_data.flTessFactor) 40 + 73: 6(float) Load 72 + 74: 13(ptr) AccessChain 64(pcf_data) 29 40 + Store 74 73 + 76: 57(ptr) AccessChain 68(pcf_data.flTessFactor) 75 + 77: 6(float) Load 76 + 78: 13(ptr) AccessChain 64(pcf_data) 29 75 + Store 78 77 + 83: 57(ptr) AccessChain 82(pcf_data.flInsideTessFactor) 29 + 84: 6(float) Load 83 + 85: 13(ptr) AccessChain 64(pcf_data) 40 + Store 85 84 + 87: 12 Load 52(i) + 89: 6(float) Load 56(f) + Store 88(param) 89 + 91: 8(fvec3) Load 60(tesscoord) + Store 90(param) 91 + 93:16(pcf_in_t) Load 64(pcf_data) + Store 92(param) 93 + 94: 18(gs_in_t) FunctionCall 24(@main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11;) 87 88(param) 90(param) 92(param) + Store 86(flattenTemp) 94 + 97: 38(ptr) AccessChain 86(flattenTemp) 29 + 98: 7(fvec4) Load 97 + Store 96(@entryPointOutput.pos) 98 + 101: 14(ptr) AccessChain 86(flattenTemp) 40 + 102: 8(fvec3) Load 101 + Store 100(@entryPointOutput.norm) 102 Return FunctionEnd -22(@main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11;): 17(gs_in_t) Function None 18 - 19(i): 12 FunctionParameter - 20(tesscoord): 13(ptr) FunctionParameter - 21(pcf_data): 16(ptr) FunctionParameter - 23: Label - 25(o): 24(ptr) Variable Function - 28: 7(fvec4) CompositeExtract 19(i) 0 0 - 31: 30(ptr) AccessChain 20(tesscoord) 29 - 32: 6(float) Load 31 - 33: 7(fvec4) CompositeConstruct 32 32 32 32 - 34: 7(fvec4) FAdd 28 33 - 36: 35(ptr) AccessChain 25(o) 27 - Store 36 34 - 38: 8(fvec3) CompositeExtract 19(i) 0 1 - 40: 30(ptr) AccessChain 20(tesscoord) 39 - 41: 6(float) Load 40 - 42: 8(fvec3) CompositeConstruct 41 41 41 - 43: 8(fvec3) FAdd 38 42 - 44: 13(ptr) AccessChain 25(o) 37 - Store 44 43 - 45: 17(gs_in_t) Load 25(o) - ReturnValue 45 +24(@main(struct-ds_in_t-vf4-vf31[3];f1;vf3;struct-pcf_in_t-f1[3]-f11;): 18(gs_in_t) Function None 19 + 20(i): 12 FunctionParameter + 21(f): 13(ptr) FunctionParameter + 22(tesscoord): 14(ptr) FunctionParameter + 23(pcf_data): 17(ptr) FunctionParameter + 25: Label + 27(o): 26(ptr) Variable Function + 30: 7(fvec4) CompositeExtract 20(i) 0 0 + 32: 13(ptr) AccessChain 22(tesscoord) 31 + 33: 6(float) Load 32 + 34: 6(float) Load 21(f) + 35: 6(float) FMul 33 34 + 36: 7(fvec4) CompositeConstruct 35 35 35 35 + 37: 7(fvec4) FAdd 30 36 + 39: 38(ptr) AccessChain 27(o) 29 + Store 39 37 + 41: 8(fvec3) CompositeExtract 20(i) 0 1 + 43: 13(ptr) AccessChain 22(tesscoord) 42 + 44: 6(float) Load 43 + 45: 8(fvec3) CompositeConstruct 44 44 44 + 46: 8(fvec3) FAdd 41 45 + 47: 14(ptr) AccessChain 27(o) 40 + Store 47 46 + 48: 18(gs_in_t) Load 27(o) + ReturnValue 48 FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out b/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out index 75e226569..0f421312c 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.domain.2.tese.out @@ -104,10 +104,7 @@ triangle order = none 0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) 0:25 Constant: 0:25 2 (const int) -0:25 foo: direct index for structure ( temp float) -0:25 'pcf_data' (layout( location=2) patch in structure{ temp float foo}) -0:25 Constant: -0:25 0 (const int) +0:? 'pcf_data.foo' (layout( location=2) patch in float) 0:25 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) @@ -140,7 +137,7 @@ triangle order = none 0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) 0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) 0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) -0:? 'pcf_data' (layout( location=2) patch in structure{ temp float foo}) +0:? 'pcf_data.foo' (layout( location=2) patch in float) Linked tessellation evaluation stage: @@ -251,10 +248,7 @@ triangle order = none 0:? 'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor, temp float flInsideTessFactor, temp float foo}) 0:25 Constant: 0:25 2 (const int) -0:25 foo: direct index for structure ( temp float) -0:25 'pcf_data' (layout( location=2) patch in structure{ temp float foo}) -0:25 Constant: -0:25 0 (const int) +0:? 'pcf_data.foo' (layout( location=2) patch in float) 0:25 move second child to first child ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' ( temp 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) 0:? 'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos, temp 3-component vector of float norm}) @@ -287,16 +281,16 @@ triangle order = none 0:? 'tesscoord' ( patch in 3-component vector of float TessCoord) 0:? 'pcf_data.flTessFactor' ( patch in 4-element array of float TessLevelOuter) 0:? 'pcf_data.flInsideTessFactor' ( patch in 2-element array of float TessLevelInner) -0:? 'pcf_data' (layout( location=2) patch in structure{ temp float foo}) +0:? 'pcf_data.foo' (layout( location=2) patch in float) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 101 +// Id's are bound by 98 Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationEvaluation 4 "main" 52 67 73 80 84 94 98 + EntryPoint TessellationEvaluation 4 "main" 52 67 71 77 81 91 95 ExecutionMode 4 Triangles Source HLSL 500 Name 4 "main" @@ -318,30 +312,27 @@ triangle order = none Name 48 "pcf_data" Name 52 "pcf_data.flTessFactor" Name 67 "pcf_data.flInsideTessFactor" - Name 71 "pcf_in_t" - MemberName 71(pcf_in_t) 0 "foo" - Name 73 "pcf_data" - Name 78 "i" - Name 80 "i" - Name 82 "tesscoord" - Name 84 "tesscoord" - Name 86 "flattenTemp" - Name 88 "param" - Name 90 "param" - Name 94 "@entryPointOutput.pos" - Name 98 "@entryPointOutput.norm" + Name 71 "pcf_data.foo" + Name 75 "i" + Name 77 "i" + Name 79 "tesscoord" + Name 81 "tesscoord" + Name 83 "flattenTemp" + Name 85 "param" + Name 87 "param" + Name 91 "@entryPointOutput.pos" + Name 95 "@entryPointOutput.norm" Decorate 52(pcf_data.flTessFactor) Patch Decorate 52(pcf_data.flTessFactor) BuiltIn TessLevelOuter Decorate 67(pcf_data.flInsideTessFactor) Patch Decorate 67(pcf_data.flInsideTessFactor) BuiltIn TessLevelInner - MemberDecorate 71(pcf_in_t) 0 Patch - Decorate 73(pcf_data) Patch - Decorate 73(pcf_data) Location 2 - Decorate 80(i) Location 0 - Decorate 84(tesscoord) Patch - Decorate 84(tesscoord) BuiltIn TessCoord - Decorate 94(@entryPointOutput.pos) Location 0 - Decorate 98(@entryPointOutput.norm) Location 1 + Decorate 71(pcf_data.foo) Patch + Decorate 71(pcf_data.foo) Location 2 + Decorate 77(i) Location 0 + Decorate 81(tesscoord) Patch + Decorate 81(tesscoord) BuiltIn TessCoord + Decorate 91(@entryPointOutput.pos) Location 0 + Decorate 95(@entryPointOutput.norm) Location 1 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -375,26 +366,24 @@ triangle order = none 65: TypeArray 6(float) 64 66: TypePointer Input 65 67(pcf_data.flInsideTessFactor): 66(ptr) Variable Input - 71(pcf_in_t): TypeStruct 6(float) - 72: TypePointer Input 71(pcf_in_t) - 73(pcf_data): 72(ptr) Variable Input - 77: TypePointer Function 15 - 79: TypePointer Input 15 - 80(i): 79(ptr) Variable Input - 83: TypePointer Input 13(fvec3) - 84(tesscoord): 83(ptr) Variable Input - 93: TypePointer Output 12(fvec4) -94(@entryPointOutput.pos): 93(ptr) Variable Output - 97: TypePointer Output 13(fvec3) -98(@entryPointOutput.norm): 97(ptr) Variable Output +71(pcf_data.foo): 53(ptr) Variable Input + 74: TypePointer Function 15 + 76: TypePointer Input 15 + 77(i): 76(ptr) Variable Input + 80: TypePointer Input 13(fvec3) + 81(tesscoord): 80(ptr) Variable Input + 90: TypePointer Output 12(fvec4) +91(@entryPointOutput.pos): 90(ptr) Variable Output + 94: TypePointer Output 13(fvec3) +95(@entryPointOutput.norm): 94(ptr) Variable Output 4(main): 2 Function None 3 5: Label 48(pcf_data): 11(ptr) Variable Function - 78(i): 77(ptr) Variable Function - 82(tesscoord): 16(ptr) Variable Function - 86(flattenTemp): 24(ptr) Variable Function - 88(param): 11(ptr) Variable Function - 90(param): 16(ptr) Variable Function + 75(i): 74(ptr) Variable Function + 79(tesscoord): 16(ptr) Variable Function + 83(flattenTemp): 24(ptr) Variable Function + 85(param): 11(ptr) Variable Function + 87(param): 16(ptr) Variable Function 54: 53(ptr) AccessChain 52(pcf_data.flTessFactor) 27 55: 6(float) Load 54 56: 30(ptr) AccessChain 48(pcf_data) 27 27 @@ -411,27 +400,26 @@ triangle order = none 69: 6(float) Load 68 70: 30(ptr) AccessChain 48(pcf_data) 37 Store 70 69 - 74: 53(ptr) AccessChain 73(pcf_data) 27 - 75: 6(float) Load 74 - 76: 30(ptr) AccessChain 48(pcf_data) 60 - Store 76 75 - 81: 15 Load 80(i) - Store 78(i) 81 - 85: 13(fvec3) Load 84(tesscoord) - Store 82(tesscoord) 85 - 87: 15 Load 78(i) - 89:10(pcf_in_t) Load 48(pcf_data) - Store 88(param) 89 - 91: 13(fvec3) Load 82(tesscoord) - Store 90(param) 91 - 92: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 88(param) 87 90(param) - Store 86(flattenTemp) 92 - 95: 35(ptr) AccessChain 86(flattenTemp) 27 - 96: 12(fvec4) Load 95 - Store 94(@entryPointOutput.pos) 96 - 99: 16(ptr) AccessChain 86(flattenTemp) 37 - 100: 13(fvec3) Load 99 - Store 98(@entryPointOutput.norm) 100 + 72: 6(float) Load 71(pcf_data.foo) + 73: 30(ptr) AccessChain 48(pcf_data) 60 + Store 73 72 + 78: 15 Load 77(i) + Store 75(i) 78 + 82: 13(fvec3) Load 81(tesscoord) + Store 79(tesscoord) 82 + 84: 15 Load 75(i) + 86:10(pcf_in_t) Load 48(pcf_data) + Store 85(param) 86 + 88: 13(fvec3) Load 79(tesscoord) + Store 87(param) 88 + 89: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 85(param) 84 87(param) + Store 83(flattenTemp) 89 + 92: 35(ptr) AccessChain 83(flattenTemp) 27 + 93: 12(fvec4) Load 92 + Store 91(@entryPointOutput.pos) 93 + 96: 16(ptr) AccessChain 83(flattenTemp) 37 + 97: 13(fvec3) Load 96 + Store 95(@entryPointOutput.norm) 97 Return FunctionEnd 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;): 17(gs_in_t) Function None 18 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out index 454b2f951..f27479352 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.entry-in.frag.out @@ -57,10 +57,7 @@ gl_FragCoord origin is upper left 0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) 0:13 Constant: 0:13 0 (const int) -0:13 v: direct index for structure ( temp 2-component vector of float) -0:13 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2}) -0:13 Constant: -0:13 0 (const int) +0:? 'i.v' (layout( location=0) in 2-component vector of float) 0:13 move second child to first child ( temp 4-component vector of float) 0:13 fragCoord: direct index for structure ( temp 4-component vector of float) 0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) @@ -72,10 +69,7 @@ gl_FragCoord origin is upper left 0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) 0:13 Constant: 0:13 2 (const int) -0:13 i2: direct index for structure ( flat temp 2-component vector of int) -0:13 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2}) -0:13 Constant: -0:13 1 (const int) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) 0:13 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:13 Function Call: @PixelShaderFunction(struct-InParam-vf2-vf4-vi21; ( temp 4-component vector of float) @@ -83,7 +77,8 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'i.fragCoord' ( in 4-component vector of float FragCoord) -0:? 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2}) +0:? 'i.v' (layout( location=0) in 2-component vector of float) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) Linked fragment stage: @@ -147,10 +142,7 @@ gl_FragCoord origin is upper left 0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) 0:13 Constant: 0:13 0 (const int) -0:13 v: direct index for structure ( temp 2-component vector of float) -0:13 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2}) -0:13 Constant: -0:13 0 (const int) +0:? 'i.v' (layout( location=0) in 2-component vector of float) 0:13 move second child to first child ( temp 4-component vector of float) 0:13 fragCoord: direct index for structure ( temp 4-component vector of float) 0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) @@ -162,10 +154,7 @@ gl_FragCoord origin is upper left 0:? 'i' ( temp structure{ temp 2-component vector of float v, temp 4-component vector of float fragCoord, temp 2-component vector of int i2}) 0:13 Constant: 0:13 2 (const int) -0:13 i2: direct index for structure ( flat temp 2-component vector of int) -0:13 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2}) -0:13 Constant: -0:13 1 (const int) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) 0:13 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:13 Function Call: @PixelShaderFunction(struct-InParam-vf2-vf4-vi21; ( temp 4-component vector of float) @@ -173,16 +162,17 @@ gl_FragCoord origin is upper left 0:? Linker Objects 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'i.fragCoord' ( in 4-component vector of float FragCoord) -0:? 'i' (layout( location=0) in structure{ temp 2-component vector of float v, flat temp 2-component vector of int i2}) +0:? 'i.v' (layout( location=0) in 2-component vector of float) +0:? 'i.i2' (layout( location=1) flat in 2-component vector of int) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 77 +// Id's are bound by 74 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "PixelShaderFunction" 56 63 73 + EntryPoint Fragment 4 "PixelShaderFunction" 55 60 65 70 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "PixelShaderFunction" @@ -200,17 +190,16 @@ gl_FragCoord origin is upper left Name 40 "ret2" Name 41 "param" Name 53 "i" - Name 54 "InParam" - MemberName 54(InParam) 0 "v" - MemberName 54(InParam) 1 "i2" - Name 56 "i" - Name 63 "i.fragCoord" - Name 73 "@entryPointOutput" - Name 74 "param" - MemberDecorate 54(InParam) 1 Flat - Decorate 56(i) Location 0 - Decorate 63(i.fragCoord) BuiltIn FragCoord - Decorate 73(@entryPointOutput) Location 0 + Name 55 "i.v" + Name 60 "i.fragCoord" + Name 65 "i.i2" + Name 70 "@entryPointOutput" + Name 71 "param" + Decorate 55(i.v) Location 0 + Decorate 60(i.fragCoord) BuiltIn FragCoord + Decorate 65(i.i2) Flat + Decorate 65(i.i2) Location 1 + Decorate 70(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -229,37 +218,34 @@ gl_FragCoord origin is upper left 27: 9(int) Constant 1 28: 22(int) Constant 0 44: TypePointer Function 8(fvec4) - 54(InParam): TypeStruct 7(fvec2) 10(ivec2) - 55: TypePointer Input 54(InParam) - 56(i): 55(ptr) Variable Input - 57: TypePointer Input 7(fvec2) - 60: TypePointer Function 7(fvec2) - 62: TypePointer Input 8(fvec4) - 63(i.fragCoord): 62(ptr) Variable Input - 66: 9(int) Constant 2 - 67: TypePointer Input 10(ivec2) - 70: TypePointer Function 10(ivec2) - 72: TypePointer Output 8(fvec4) -73(@entryPointOutput): 72(ptr) Variable Output + 54: TypePointer Input 7(fvec2) + 55(i.v): 54(ptr) Variable Input + 57: TypePointer Function 7(fvec2) + 59: TypePointer Input 8(fvec4) + 60(i.fragCoord): 59(ptr) Variable Input + 63: 9(int) Constant 2 + 64: TypePointer Input 10(ivec2) + 65(i.i2): 64(ptr) Variable Input + 67: TypePointer Function 10(ivec2) + 69: TypePointer Output 8(fvec4) +70(@entryPointOutput): 69(ptr) Variable Output 4(PixelShaderFunction): 2 Function None 3 5: Label 53(i): 12(ptr) Variable Function - 74(param): 12(ptr) Variable Function - 58: 57(ptr) AccessChain 56(i) 21 - 59: 7(fvec2) Load 58 - 61: 60(ptr) AccessChain 53(i) 21 - Store 61 59 - 64: 8(fvec4) Load 63(i.fragCoord) - 65: 44(ptr) AccessChain 53(i) 27 - Store 65 64 - 68: 67(ptr) AccessChain 56(i) 27 - 69: 10(ivec2) Load 68 - 71: 70(ptr) AccessChain 53(i) 66 - Store 71 69 - 75: 11(InParam) Load 53(i) - Store 74(param) 75 - 76: 8(fvec4) FunctionCall 19(@PixelShaderFunction(struct-InParam-vf2-vf4-vi21;) 74(param) - Store 73(@entryPointOutput) 76 + 71(param): 12(ptr) Variable Function + 56: 7(fvec2) Load 55(i.v) + 58: 57(ptr) AccessChain 53(i) 21 + Store 58 56 + 61: 8(fvec4) Load 60(i.fragCoord) + 62: 44(ptr) AccessChain 53(i) 27 + Store 62 61 + 66: 10(ivec2) Load 65(i.i2) + 68: 67(ptr) AccessChain 53(i) 63 + Store 68 66 + 72: 11(InParam) Load 53(i) + Store 71(param) 72 + 73: 8(fvec4) FunctionCall 19(@PixelShaderFunction(struct-InParam-vf2-vf4-vi21;) 71(param) + Store 70(@entryPointOutput) 73 Return FunctionEnd 15(fun(struct-InParam-vf2-vf4-vi21;): 6(float) Function None 13 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out b/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out index 99f6512cd..4bd316186 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.flattenOpaqueInit.vert.out @@ -1,4 +1,6 @@ hlsl.flattenOpaqueInit.vert +WARNING: 0:20: '=' : cannot do member-wise aliasing for opaque members with this initializer + Shader version: 500 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) @@ -14,19 +16,43 @@ Shader version: 500 0:? Constant: 0:? 0.300000 0:? 0.400000 -0:10 Function Definition: @main( ( temp 4-component vector of float) +0:10 Function Definition: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) 0:10 Function Parameters: 0:? Sequence -0:12 Branch: Return with expression -0:12 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:12 'g_tInputTexture_sampler' ( uniform sampler) +0:13 'g_tInputTexture' ( uniform texture2D) +0:14 Branch: Return with expression +0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 move second child to first child ( temp sampler) +0:? 'tex2.smpl' ( temp sampler) +0:20 smpl: direct index for structure ( temp sampler) +0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp texture2D) +0:? 'tex2.tex' ( temp texture2D) +0:20 tex: direct index for structure ( temp texture2D) +0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 Constant: +0:20 1 (const int) +0:21 Branch: Return with expression +0:21 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) 0:? 'g_tInputTexture_sampler' ( uniform sampler) 0:? 'g_tInputTexture' ( uniform texture2D) -0:10 Function Definition: main( ( temp void) -0:10 Function Parameters: +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: 0:? Sequence -0:10 move second child to first child ( temp 4-component vector of float) +0:18 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -0:10 Function Call: @main( ( temp 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) 0:? Linker Objects 0:? 'g_tInputTexture_sampler' ( uniform sampler) 0:? 'g_tInputTexture' ( uniform texture2D) @@ -51,19 +77,43 @@ Shader version: 500 0:? Constant: 0:? 0.300000 0:? 0.400000 -0:10 Function Definition: @main( ( temp 4-component vector of float) +0:10 Function Definition: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) 0:10 Function Parameters: 0:? Sequence -0:12 Branch: Return with expression -0:12 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) +0:12 'g_tInputTexture_sampler' ( uniform sampler) +0:13 'g_tInputTexture' ( uniform texture2D) +0:14 Branch: Return with expression +0:14 't' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:18 Function Definition: @main( ( temp 4-component vector of float) +0:18 Function Parameters: +0:? Sequence +0:20 Sequence +0:20 Sequence +0:20 move second child to first child ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 Function Call: fillOpaque( ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 move second child to first child ( temp sampler) +0:? 'tex2.smpl' ( temp sampler) +0:20 smpl: direct index for structure ( temp sampler) +0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 Constant: +0:20 0 (const int) +0:20 move second child to first child ( temp texture2D) +0:? 'tex2.tex' ( temp texture2D) +0:20 tex: direct index for structure ( temp texture2D) +0:20 'flattenTemp' ( temp structure{ temp sampler smpl, temp texture2D tex}) +0:20 Constant: +0:20 1 (const int) +0:21 Branch: Return with expression +0:21 Function Call: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) 0:? 'g_tInputTexture_sampler' ( uniform sampler) 0:? 'g_tInputTexture' ( uniform texture2D) -0:10 Function Definition: main( ( temp void) -0:10 Function Parameters: +0:18 Function Definition: main( ( temp void) +0:18 Function Parameters: 0:? Sequence -0:10 move second child to first child ( temp 4-component vector of float) +0:18 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) -0:10 Function Call: @main( ( temp 4-component vector of float) +0:18 Function Call: @main( ( temp 4-component vector of float) 0:? Linker Objects 0:? 'g_tInputTexture_sampler' ( uniform sampler) 0:? 'g_tInputTexture' ( uniform texture2D) @@ -71,24 +121,32 @@ Shader version: 500 // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 40 +// Id's are bound by 60 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 38 + EntryPoint Vertex 4 "main" 58 Source HLSL 500 Name 4 "main" Name 15 "lookUp(struct-FxaaTex-p1-t211;" Name 13 "tex.smpl" Name 14 "tex.tex" - Name 18 "@main(" - Name 32 "g_tInputTexture_sampler" - Name 33 "g_tInputTexture" - Name 38 "@entryPointOutput" - Decorate 32(g_tInputTexture_sampler) DescriptorSet 0 - Decorate 33(g_tInputTexture) DescriptorSet 0 - Decorate 38(@entryPointOutput) Location 0 + Name 17 "FxaaTex" + MemberName 17(FxaaTex) 0 "smpl" + MemberName 17(FxaaTex) 1 "tex" + Name 19 "fillOpaque(" + Name 22 "@main(" + Name 36 "g_tInputTexture_sampler" + Name 37 "g_tInputTexture" + Name 39 "t" + Name 43 "flattenTemp" + Name 45 "tex2.smpl" + Name 50 "tex2.tex" + Name 58 "@entryPointOutput" + Decorate 36(g_tInputTexture_sampler) DescriptorSet 0 + Decorate 37(g_tInputTexture) DescriptorSet 0 + Decorate 58(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeSampler @@ -98,35 +156,58 @@ Shader version: 500 10: TypePointer UniformConstant 9 11: TypeVector 8(float) 4 12: TypeFunction 11(fvec4) 7(ptr) 10(ptr) - 17: TypeFunction 11(fvec4) - 22: TypeSampledImage 9 - 24: TypeVector 8(float) 2 - 25: 8(float) Constant 1050253722 - 26: 8(float) Constant 1053609165 - 27: 24(fvec2) ConstantComposite 25 26 - 28: 8(float) Constant 0 -32(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant -33(g_tInputTexture): 10(ptr) Variable UniformConstant - 37: TypePointer Output 11(fvec4) -38(@entryPointOutput): 37(ptr) Variable Output + 17(FxaaTex): TypeStruct 6 9 + 18: TypeFunction 17(FxaaTex) + 21: TypeFunction 11(fvec4) + 26: TypeSampledImage 9 + 28: TypeVector 8(float) 2 + 29: 8(float) Constant 1050253722 + 30: 8(float) Constant 1053609165 + 31: 28(fvec2) ConstantComposite 29 30 + 32: 8(float) Constant 0 +36(g_tInputTexture_sampler): 7(ptr) Variable UniformConstant +37(g_tInputTexture): 10(ptr) Variable UniformConstant + 38: TypePointer UniformConstant 17(FxaaTex) + 39(t): 38(ptr) Variable UniformConstant + 43(flattenTemp): 38(ptr) Variable UniformConstant + 45(tex2.smpl): 7(ptr) Variable UniformConstant + 46: TypeInt 32 1 + 47: 46(int) Constant 0 + 50(tex2.tex): 10(ptr) Variable UniformConstant + 51: 46(int) Constant 1 + 57: TypePointer Output 11(fvec4) +58(@entryPointOutput): 57(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 39: 11(fvec4) FunctionCall 18(@main() - Store 38(@entryPointOutput) 39 + 59: 11(fvec4) FunctionCall 22(@main() + Store 58(@entryPointOutput) 59 Return FunctionEnd 15(lookUp(struct-FxaaTex-p1-t211;): 11(fvec4) Function None 12 13(tex.smpl): 7(ptr) FunctionParameter 14(tex.tex): 10(ptr) FunctionParameter 16: Label - 20: 9 Load 14(tex.tex) - 21: 6 Load 13(tex.smpl) - 23: 22 SampledImage 20 21 - 29: 11(fvec4) ImageSampleExplicitLod 23 27 Lod 28 - ReturnValue 29 + 24: 9 Load 14(tex.tex) + 25: 6 Load 13(tex.smpl) + 27: 26 SampledImage 24 25 + 33: 11(fvec4) ImageSampleExplicitLod 27 31 Lod 32 + ReturnValue 33 FunctionEnd - 18(@main(): 11(fvec4) Function None 17 - 19: Label - 34: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 32(g_tInputTexture_sampler) 33(g_tInputTexture) - ReturnValue 34 + 19(fillOpaque(): 17(FxaaTex) Function None 18 + 20: Label + 40: 17(FxaaTex) Load 39(t) + ReturnValue 40 + FunctionEnd + 22(@main(): 11(fvec4) Function None 21 + 23: Label + 44: 17(FxaaTex) FunctionCall 19(fillOpaque() + Store 43(flattenTemp) 44 + 48: 7(ptr) AccessChain 43(flattenTemp) 47 + 49: 6 Load 48 + Store 45(tex2.smpl) 49 + 52: 10(ptr) AccessChain 43(flattenTemp) 51 + 53: 9 Load 52 + Store 50(tex2.tex) 53 + 54: 11(fvec4) FunctionCall 15(lookUp(struct-FxaaTex-p1-t211;) 36(g_tInputTexture_sampler) 37(g_tInputTexture) + ReturnValue 54 FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out index ea6c200da..3780bd34d 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out @@ -2322,7 +2322,6 @@ gl_FragCoord origin is upper left Capability Shader Capability Sampled1D Capability SampledCubeArray - Capability ImageMSArray Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out index beb19092a..b301a61ad 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out @@ -720,8 +720,8 @@ gl_FragCoord origin is upper left // Id's are bound by 232 Capability Shader - Capability Sampled1D - Capability SampledBuffer + Capability Image1D + Capability ImageBuffer Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out index d45d7316b..12fe30c89 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out @@ -582,7 +582,6 @@ gl_FragCoord origin is upper left // Id's are bound by 221 Capability Shader - Capability ImageMSArray Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out index 462bb81ef..b5d046604 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out @@ -361,7 +361,6 @@ gl_FragCoord origin is upper left Capability Shader Capability ImageGatherExtended - Capability ImageMSArray 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 120 124 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out index fa66acca9..851f82462 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out @@ -114,7 +114,7 @@ gl_FragCoord origin is upper left // Id's are bound by 57 Capability Shader - Capability SampledBuffer + Capability ImageBuffer 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 54 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out index 99070b705..10931001a 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out @@ -210,7 +210,7 @@ gl_FragCoord origin is upper left // Id's are bound by 119 Capability Shader - Capability Sampled1D + Capability Image1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 82 86 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out index 6c9e2c010..1347a5191 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out @@ -246,7 +246,7 @@ gl_FragCoord origin is upper left // Id's are bound by 132 Capability Shader - Capability Sampled1D + Capability Image1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 104 108 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out index 17e88237b..1c0e50300 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.multiDescriptorSet.frag.out @@ -1,12 +1,12 @@ hlsl.multiDescriptorSet.frag // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 95 +// Id's are bound by 92 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 78 83 89 + EntryPoint Fragment 4 "main" 78 82 86 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -30,13 +30,11 @@ hlsl.multiDescriptorSet.frag Name 63 "samLinearA" Name 76 "input" Name 78 "input.Pos" - Name 81 "PS_INPUT" - MemberName 81(PS_INPUT) 0 "Tex" - Name 83 "input" - Name 89 "@entryPointOutput" - Name 90 "param" - Name 93 "txDiffuseB" - Name 94 "samLinearB" + Name 82 "input.Tex" + Name 86 "@entryPointOutput" + Name 87 "param" + Name 90 "txDiffuseB" + Name 91 "samLinearB" MemberDecorate 23(cbChangesEveryFrame) 0 RowMajor MemberDecorate 23(cbChangesEveryFrame) 0 Offset 0 MemberDecorate 23(cbChangesEveryFrame) 0 MatrixStride 16 @@ -61,12 +59,12 @@ hlsl.multiDescriptorSet.frag Decorate 63(samLinearA) DescriptorSet 0 Decorate 63(samLinearA) Binding 1 Decorate 78(input.Pos) BuiltIn FragCoord - Decorate 83(input) Location 0 - Decorate 89(@entryPointOutput) Location 0 - Decorate 93(txDiffuseB) DescriptorSet 1 - Decorate 93(txDiffuseB) Binding 0 - Decorate 94(samLinearB) DescriptorSet 1 - Decorate 94(samLinearB) Binding 1 + Decorate 82(input.Tex) Location 0 + Decorate 86(@entryPointOutput) Location 0 + Decorate 90(txDiffuseB) DescriptorSet 1 + Decorate 90(txDiffuseB) Binding 0 + Decorate 91(samLinearB) DescriptorSet 1 + Decorate 91(samLinearB) Binding 1 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -105,29 +103,26 @@ hlsl.multiDescriptorSet.frag 70: TypePointer Uniform 7(fvec4) 77: TypePointer Input 7(fvec4) 78(input.Pos): 77(ptr) Variable Input - 81(PS_INPUT): TypeStruct 8(fvec2) - 82: TypePointer Input 81(PS_INPUT) - 83(input): 82(ptr) Variable Input - 84: TypePointer Input 8(fvec2) - 88: TypePointer Output 7(fvec4) -89(@entryPointOutput): 88(ptr) Variable Output - 93(txDiffuseB): 58(ptr) Variable UniformConstant - 94(samLinearB): 62(ptr) Variable UniformConstant + 81: TypePointer Input 8(fvec2) + 82(input.Tex): 81(ptr) Variable Input + 85: TypePointer Output 7(fvec4) +86(@entryPointOutput): 85(ptr) Variable Output + 90(txDiffuseB): 58(ptr) Variable UniformConstant + 91(samLinearB): 62(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 76(input): 10(ptr) Variable Function - 90(param): 10(ptr) Variable Function + 87(param): 10(ptr) Variable Function 79: 7(fvec4) Load 78(input.Pos) 80: 29(ptr) AccessChain 76(input) 21 Store 80 79 - 85: 84(ptr) AccessChain 83(input) 21 - 86: 8(fvec2) Load 85 - 87: 53(ptr) AccessChain 76(input) 52 - Store 87 86 - 91: 9(PS_INPUT) Load 76(input) - Store 90(param) 91 - 92: 7(fvec4) FunctionCall 13(@main(struct-PS_INPUT-vf4-vf21;) 90(param) - Store 89(@entryPointOutput) 92 + 83: 8(fvec2) Load 82(input.Tex) + 84: 53(ptr) AccessChain 76(input) 52 + Store 84 83 + 88: 9(PS_INPUT) Load 76(input) + Store 87(param) 88 + 89: 7(fvec4) FunctionCall 13(@main(struct-PS_INPUT-vf4-vf21;) 87(param) + Store 86(@entryPointOutput) 89 Return FunctionEnd 13(@main(struct-PS_INPUT-vf4-vf21;): 7(fvec4) Function None 11 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out index b31ac6126..ead4fe311 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.promote.atomic.frag.out @@ -68,7 +68,7 @@ gl_FragCoord origin is upper left // Id's are bound by 36 Capability Shader - Capability SampledBuffer + Capability ImageBuffer 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 34 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out index 5e7fdb1db..99c417404 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out @@ -3950,8 +3950,8 @@ gl_FragCoord origin is upper left // Id's are bound by 1147 Capability Shader - Capability Sampled1D - Capability SampledBuffer + Capability Image1D + Capability ImageBuffer 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 1117 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out index 911726530..7804e33a8 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out @@ -1748,7 +1748,7 @@ gl_FragCoord origin is upper left // Id's are bound by 607 Capability Shader - Capability Sampled1D + Capability Image1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 583 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out index 237303c45..5464ac2eb 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.register.frag.out @@ -102,8 +102,8 @@ gl_FragCoord origin is upper left // Id's are bound by 42 Capability Shader - Capability Sampled1D - Capability SampledBuffer + Capability Image1D + Capability ImageBuffer 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 39 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out index da7a5a11a..7ff34fa01 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out @@ -1694,7 +1694,7 @@ gl_FragCoord origin is upper left // Id's are bound by 571 Capability Shader - Capability Sampled1D + Capability Image1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 547 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out index 60a6b997e..4d804e98b 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.swizzle.frag.out @@ -206,7 +206,7 @@ gl_FragCoord origin is upper left // Id's are bound by 63 Capability Shader - Capability SampledBuffer + Capability ImageBuffer 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 58 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out index d920bf3eb..980c82b63 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out @@ -1712,7 +1712,7 @@ gl_FragCoord origin is upper left // Id's are bound by 605 Capability Shader - Capability Sampled1D + Capability Image1D Capability StorageImageExtendedFormats 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out b/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out index 2ed9f2b52..70a851215 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.scalarCast.vert.out @@ -149,17 +149,14 @@ Shader version: 500 0:29 Constant: 0:29 0 (const int) 0:29 move second child to first child ( temp 2-component vector of float) -0:29 texCoord: direct index for structure ( temp 2-component vector of float) -0:29 '@entryPointOutput' (layout( location=0) out structure{ temp 2-component vector of float texCoord}) -0:29 Constant: -0:29 0 (const int) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) 0:29 texCoord: direct index for structure ( temp 2-component vector of float) 0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) 0:29 Constant: 0:29 1 (const int) 0:? Linker Objects 0:? '@entryPointOutput.position' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-component vector of float texCoord}) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) Linked vertex stage: @@ -315,26 +312,23 @@ Shader version: 500 0:29 Constant: 0:29 0 (const int) 0:29 move second child to first child ( temp 2-component vector of float) -0:29 texCoord: direct index for structure ( temp 2-component vector of float) -0:29 '@entryPointOutput' (layout( location=0) out structure{ temp 2-component vector of float texCoord}) -0:29 Constant: -0:29 0 (const int) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) 0:29 texCoord: direct index for structure ( temp 2-component vector of float) 0:29 'flattenTemp' ( temp structure{ temp 4-component vector of float position, temp 2-component vector of float texCoord}) 0:29 Constant: 0:29 1 (const int) 0:? Linker Objects 0:? '@entryPointOutput.position' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-component vector of float texCoord}) +0:? '@entryPointOutput.texCoord' (layout( location=0) out 2-component vector of float) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 123 +// Id's are bound by 120 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 108 116 + EntryPoint Vertex 4 "main" 108 115 Source HLSL 500 Name 4 "main" Name 9 "VertexOut" @@ -360,11 +354,9 @@ Shader version: 500 Name 98 "v5" Name 105 "flattenTemp" Name 108 "@entryPointOutput.position" - Name 114 "VertexOut" - MemberName 114(VertexOut) 0 "texCoord" - Name 116 "@entryPointOutput" + Name 115 "@entryPointOutput.texCoord" Decorate 108(@entryPointOutput.position) BuiltIn Position - Decorate 116(@entryPointOutput) Location 0 + Decorate 115(@entryPointOutput.texCoord) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -395,12 +387,10 @@ Shader version: 500 109: TypeInt 32 1 110: 109(int) Constant 0 111: TypePointer Function 7(fvec4) - 114(VertexOut): TypeStruct 8(fvec2) - 115: TypePointer Output 114(VertexOut) -116(@entryPointOutput): 115(ptr) Variable Output - 117: 109(int) Constant 1 - 118: TypePointer Function 8(fvec2) - 121: TypePointer Output 8(fvec2) + 114: TypePointer Output 8(fvec2) +115(@entryPointOutput.texCoord): 114(ptr) Variable Output + 116: 109(int) Constant 1 + 117: TypePointer Function 8(fvec2) 4(main): 2 Function None 3 5: Label 105(flattenTemp): 87(ptr) Variable Function @@ -409,10 +399,9 @@ Shader version: 500 112: 111(ptr) AccessChain 105(flattenTemp) 110 113: 7(fvec4) Load 112 Store 108(@entryPointOutput.position) 113 - 119: 118(ptr) AccessChain 105(flattenTemp) 117 - 120: 8(fvec2) Load 119 - 122: 121(ptr) AccessChain 116(@entryPointOutput) 110 - Store 122 120 + 118: 117(ptr) AccessChain 105(flattenTemp) 116 + 119: 8(fvec2) Load 118 + Store 115(@entryPointOutput.texCoord) 119 Return FunctionEnd 11(r0():9(VertexOut) Function None 10 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out b/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out index 888651845..38acc2732 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out @@ -1,10 +1,15 @@ hlsl.semantic.geom +ERROR: 0:15: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 0:15: '' : unimplemented: clip/cull not currently implemented for this stage +ERROR: 2 compilation errors. No code generated. + + Shader version: 500 invocations = -1 max_vertices = 4 input primitive = triangles output primitive = line_strip -0:? Sequence +ERROR: node is still EOpNull! 0:13 Function Definition: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) 0:13 Function Parameters: 0:13 'VertexID' ( in 3-element array of uint) @@ -18,26 +23,6 @@ output primitive = line_strip 0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:15 Constant: 0:15 0 (const int) -0:? Sequence -0:15 move second child to first child ( temp float) -0:15 direct index ( temp float) -0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) -0:15 Constant: -0:15 0 (const int) -0:15 clip0: direct index for structure ( temp float) -0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) -0:15 Constant: -0:15 1 (const int) -0:? Sequence -0:15 move second child to first child ( temp float) -0:15 direct index ( temp float) -0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) -0:15 Constant: -0:15 0 (const int) -0:15 cull0: direct index for structure ( temp float) -0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) -0:15 Constant: -0:15 2 (const int) 0:15 move second child to first child ( temp uint) 0:? 'OutputStream.vpai' ( out uint ViewportIndex) 0:15 vpai: direct index for structure ( temp uint) @@ -51,10 +36,7 @@ output primitive = line_strip 0:15 Constant: 0:15 4 (const int) 0:15 move second child to first child ( temp int) -0:15 ii: direct index for structure ( temp int) -0:15 'OutputStream' (layout( location=0) out structure{ temp int ii}) -0:15 Constant: -0:15 0 (const int) +0:? 'OutputStream.ii' (layout( location=0) out int) 0:15 ii: direct index for structure ( temp int) 0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:15 Constant: @@ -74,9 +56,7 @@ output primitive = line_strip 0:? 'OutputStream.clip0' ( out float Position) 0:? 'OutputStream.vpai' ( out uint ViewportIndex) 0:? 'OutputStream.rtai' ( out uint Layer) -0:? 'OutputStream' (layout( location=0) out structure{ temp int ii}) -0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) -0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) +0:? 'OutputStream.ii' (layout( location=0) out int) Linked geometry stage: @@ -87,7 +67,7 @@ invocations = 1 max_vertices = 4 input primitive = triangles output primitive = line_strip -0:? Sequence +ERROR: node is still EOpNull! 0:13 Function Definition: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) 0:13 Function Parameters: 0:13 'VertexID' ( in 3-element array of uint) @@ -101,26 +81,6 @@ output primitive = line_strip 0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:15 Constant: 0:15 0 (const int) -0:? Sequence -0:15 move second child to first child ( temp float) -0:15 direct index ( temp float) -0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) -0:15 Constant: -0:15 0 (const int) -0:15 clip0: direct index for structure ( temp float) -0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) -0:15 Constant: -0:15 1 (const int) -0:? Sequence -0:15 move second child to first child ( temp float) -0:15 direct index ( temp float) -0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) -0:15 Constant: -0:15 0 (const int) -0:15 cull0: direct index for structure ( temp float) -0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) -0:15 Constant: -0:15 2 (const int) 0:15 move second child to first child ( temp uint) 0:? 'OutputStream.vpai' ( out uint ViewportIndex) 0:15 vpai: direct index for structure ( temp uint) @@ -134,10 +94,7 @@ output primitive = line_strip 0:15 Constant: 0:15 4 (const int) 0:15 move second child to first child ( temp int) -0:15 ii: direct index for structure ( temp int) -0:15 'OutputStream' (layout( location=0) out structure{ temp int ii}) -0:15 Constant: -0:15 0 (const int) +0:? 'OutputStream.ii' (layout( location=0) out int) 0:15 ii: direct index for structure ( temp int) 0:15 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) 0:15 Constant: @@ -157,135 +114,6 @@ output primitive = line_strip 0:? 'OutputStream.clip0' ( out float Position) 0:? 'OutputStream.vpai' ( out uint ViewportIndex) 0:? 'OutputStream.rtai' ( out uint Layer) -0:? 'OutputStream' (layout( location=0) out structure{ temp int ii}) -0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) -0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) +0:? 'OutputStream.ii' (layout( location=0) out int) -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 68 - - Capability Geometry - Capability ClipDistance - Capability CullDistance - Capability MultiViewport - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 20 29 34 40 45 51 60 - ExecutionMode 4 Triangles - ExecutionMode 4 Invocations 1 - ExecutionMode 4 OutputLineStrip - ExecutionMode 4 OutputVertices 4 - Source HLSL 500 - Name 4 "main" - Name 12 "S" - MemberName 12(S) 0 "clip0" - MemberName 12(S) 1 "clip0" - MemberName 12(S) 2 "cull0" - MemberName 12(S) 3 "vpai" - MemberName 12(S) 4 "rtai" - MemberName 12(S) 5 "ii" - Name 17 "@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;" - Name 15 "VertexID" - Name 16 "OutputStream" - Name 20 "OutputStream.clip0" - Name 21 "s" - Name 29 "OutputStream.clip0" - Name 34 "OutputStream.cull0" - Name 40 "OutputStream.vpai" - Name 45 "OutputStream.rtai" - Name 49 "S" - MemberName 49(S) 0 "ii" - Name 51 "OutputStream" - Name 58 "VertexID" - Name 60 "VertexID" - Name 62 "OutputStream" - Name 63 "param" - Name 65 "param" - Decorate 20(OutputStream.clip0) BuiltIn Position - Decorate 29(OutputStream.clip0) BuiltIn ClipDistance - Decorate 34(OutputStream.cull0) BuiltIn CullDistance - Decorate 40(OutputStream.vpai) BuiltIn ViewportIndex - Decorate 45(OutputStream.rtai) BuiltIn Layer - Decorate 51(OutputStream) Location 0 - Decorate 60(VertexID) Location 0 - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 0 - 7: 6(int) Constant 3 - 8: TypeArray 6(int) 7 - 9: TypePointer Function 8 - 10: TypeFloat 32 - 11: TypeInt 32 1 - 12(S): TypeStruct 10(float) 10(float) 10(float) 6(int) 6(int) 11(int) - 13: TypePointer Function 12(S) - 14: TypeFunction 2 9(ptr) 13(ptr) - 19: TypePointer Output 10(float) -20(OutputStream.clip0): 19(ptr) Variable Output - 22: 11(int) Constant 0 - 23: TypePointer Function 10(float) - 26: 6(int) Constant 1 - 27: TypeArray 10(float) 26 - 28: TypePointer Output 27 -29(OutputStream.clip0): 28(ptr) Variable Output - 30: 11(int) Constant 1 -34(OutputStream.cull0): 28(ptr) Variable Output - 35: 11(int) Constant 2 - 39: TypePointer Output 6(int) -40(OutputStream.vpai): 39(ptr) Variable Output - 41: 11(int) Constant 3 - 42: TypePointer Function 6(int) -45(OutputStream.rtai): 39(ptr) Variable Output - 46: 11(int) Constant 4 - 49(S): TypeStruct 11(int) - 50: TypePointer Output 49(S) -51(OutputStream): 50(ptr) Variable Output - 52: 11(int) Constant 5 - 53: TypePointer Function 11(int) - 56: TypePointer Output 11(int) - 59: TypePointer Input 8 - 60(VertexID): 59(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 58(VertexID): 9(ptr) Variable Function -62(OutputStream): 13(ptr) Variable Function - 63(param): 9(ptr) Variable Function - 65(param): 13(ptr) Variable Function - 61: 8 Load 60(VertexID) - Store 58(VertexID) 61 - 64: 8 Load 58(VertexID) - Store 63(param) 64 - 66: 2 FunctionCall 17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;) 63(param) 65(param) - 67: 12(S) Load 65(param) - Store 62(OutputStream) 67 - Return - FunctionEnd -17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;): 2 Function None 14 - 15(VertexID): 9(ptr) FunctionParameter -16(OutputStream): 13(ptr) FunctionParameter - 18: Label - 21(s): 13(ptr) Variable Function - 24: 23(ptr) AccessChain 21(s) 22 - 25: 10(float) Load 24 - Store 20(OutputStream.clip0) 25 - 31: 23(ptr) AccessChain 21(s) 30 - 32: 10(float) Load 31 - 33: 19(ptr) AccessChain 29(OutputStream.clip0) 22 - Store 33 32 - 36: 23(ptr) AccessChain 21(s) 35 - 37: 10(float) Load 36 - 38: 19(ptr) AccessChain 34(OutputStream.cull0) 22 - Store 38 37 - 43: 42(ptr) AccessChain 21(s) 41 - 44: 6(int) Load 43 - Store 40(OutputStream.vpai) 44 - 47: 42(ptr) AccessChain 21(s) 46 - 48: 6(int) Load 47 - Store 45(OutputStream.rtai) 48 - 54: 53(ptr) AccessChain 21(s) 52 - 55: 11(int) Load 54 - 57: 56(ptr) AccessChain 51(OutputStream) 22 - Store 57 55 - EmitVertex - Return - FunctionEnd +SPIR-V is not generated for failed compile or link diff --git a/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out b/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out index de7214f04..086a4aace 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out @@ -28,13 +28,13 @@ Shader version: 500 0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) 0:10 Constant: 0:10 2 (const int) -0:? 'ins.cull0' (layout( location=2) in float) +0:? 'ins.cull0' (layout( location=0) in float) 0:10 move second child to first child ( temp float) 0:10 cull1: direct index for structure ( temp float) 0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) 0:10 Constant: 0:10 3 (const int) -0:? 'ins.cull1' (layout( location=3) in float) +0:? 'ins.cull1' (layout( location=1) in float) 0:10 move second child to first child ( temp int) 0:10 ii: direct index for structure ( temp int) 0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) @@ -87,21 +87,18 @@ Shader version: 500 0:10 Constant: 0:10 3 (const int) 0:10 move second child to first child ( temp int) -0:10 ii: direct index for structure ( temp int) -0:10 '@entryPointOutput' (layout( location=0) out structure{ temp int ii}) -0:10 Constant: -0:10 0 (const int) +0:? '@entryPointOutput.ii' (layout( location=0) out int) 0:10 ii: direct index for structure ( temp int) 0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) 0:10 Constant: 0:10 4 (const int) 0:? Linker Objects -0:? '@entryPointOutput' (layout( location=0) out structure{ temp int ii}) +0:? '@entryPointOutput.ii' (layout( location=0) out int) 0:? 'ins.ii' ( in int InstanceIndex) 0:? 'ins.clip0' (layout( location=0) in float) 0:? 'ins.clip1' (layout( location=1) in float) -0:? 'ins.cull0' (layout( location=2) in float) -0:? 'ins.cull1' (layout( location=3) in float) +0:? 'ins.cull0' (layout( location=0) in float) +0:? 'ins.cull1' (layout( location=1) in float) 0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) 0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) @@ -138,13 +135,13 @@ Shader version: 500 0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) 0:10 Constant: 0:10 2 (const int) -0:? 'ins.cull0' (layout( location=2) in float) +0:? 'ins.cull0' (layout( location=0) in float) 0:10 move second child to first child ( temp float) 0:10 cull1: direct index for structure ( temp float) 0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) 0:10 Constant: 0:10 3 (const int) -0:? 'ins.cull1' (layout( location=3) in float) +0:? 'ins.cull1' (layout( location=1) in float) 0:10 move second child to first child ( temp int) 0:10 ii: direct index for structure ( temp int) 0:? 'ins' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) @@ -197,34 +194,31 @@ Shader version: 500 0:10 Constant: 0:10 3 (const int) 0:10 move second child to first child ( temp int) -0:10 ii: direct index for structure ( temp int) -0:10 '@entryPointOutput' (layout( location=0) out structure{ temp int ii}) -0:10 Constant: -0:10 0 (const int) +0:? '@entryPointOutput.ii' (layout( location=0) out int) 0:10 ii: direct index for structure ( temp int) 0:10 'flattenTemp' ( temp structure{ temp float clip0, temp float clip1, temp float cull0, temp float cull1, temp int ii}) 0:10 Constant: 0:10 4 (const int) 0:? Linker Objects -0:? '@entryPointOutput' (layout( location=0) out structure{ temp int ii}) +0:? '@entryPointOutput.ii' (layout( location=0) out int) 0:? 'ins.ii' ( in int InstanceIndex) 0:? 'ins.clip0' (layout( location=0) in float) 0:? 'ins.clip1' (layout( location=1) in float) -0:? 'ins.cull0' (layout( location=2) in float) -0:? 'ins.cull1' (layout( location=3) in float) +0:? 'ins.cull0' (layout( location=0) in float) +0:? 'ins.cull1' (layout( location=1) in float) 0:? '@entryPointOutput.clip1' ( out 2-element array of float ClipDistance) 0:? '@entryPointOutput.cull1' ( out 2-element array of float CullDistance) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 73 +// Id's are bound by 70 Capability Shader Capability ClipDistance Capability CullDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 21 26 30 34 39 51 59 68 + EntryPoint Vertex 4 "main" 21 26 30 34 39 51 59 67 Source HLSL 500 Name 4 "main" Name 8 "S" @@ -246,17 +240,15 @@ Shader version: 500 Name 44 "param" Name 51 "@entryPointOutput.clip1" Name 59 "@entryPointOutput.cull1" - Name 66 "S" - MemberName 66(S) 0 "ii" - Name 68 "@entryPointOutput" + Name 67 "@entryPointOutput.ii" Decorate 21(ins.clip0) Location 0 Decorate 26(ins.clip1) Location 1 - Decorate 30(ins.cull0) Location 2 - Decorate 34(ins.cull1) Location 3 + Decorate 30(ins.cull0) Location 0 + Decorate 34(ins.cull1) Location 1 Decorate 39(ins.ii) BuiltIn InstanceIndex Decorate 51(@entryPointOutput.clip1) BuiltIn ClipDistance Decorate 59(@entryPointOutput.cull1) BuiltIn CullDistance - Decorate 68(@entryPointOutput) Location 0 + Decorate 67(@entryPointOutput.ii) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -285,10 +277,8 @@ Shader version: 500 51(@entryPointOutput.clip1): 50(ptr) Variable Output 54: TypePointer Output 6(float) 59(@entryPointOutput.cull1): 50(ptr) Variable Output - 66(S): TypeStruct 7(int) - 67: TypePointer Output 66(S) -68(@entryPointOutput): 67(ptr) Variable Output - 71: TypePointer Output 7(int) + 66: TypePointer Output 7(int) +67(@entryPointOutput.ii): 66(ptr) Variable Output 4(main): 2 Function None 3 5: Label 18(ins): 9(ptr) Variable Function @@ -329,10 +319,9 @@ Shader version: 500 64: 6(float) Load 63 65: 54(ptr) AccessChain 59(@entryPointOutput.cull1) 25 Store 65 64 - 69: 41(ptr) AccessChain 43(flattenTemp) 37 - 70: 7(int) Load 69 - 72: 71(ptr) AccessChain 68(@entryPointOutput) 19 - Store 72 70 + 68: 41(ptr) AccessChain 43(flattenTemp) 37 + 69: 7(int) Load 68 + Store 67(@entryPointOutput.ii) 69 Return FunctionEnd 12(@main(struct-S-f1-f1-f1-f1-i11;): 8(S) Function None 10 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out index 8cf6e37ce..d0881645d 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.struct.frag.out @@ -43,37 +43,25 @@ gl_FragCoord origin is upper left 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 0 (const int) -0:40 a: direct index for structure ( smooth temp 4-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 0 (const int) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) 0:40 move second child to first child ( temp bool) 0:40 b: direct index for structure ( temp bool) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 1 (const int) -0:40 b: direct index for structure ( flat temp bool) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 1 (const int) +0:? 's.b' (layout( location=2) flat in bool) 0:40 move second child to first child ( temp 1-component vector of float) 0:40 c: direct index for structure ( temp 1-component vector of float) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 2 (const int) -0:40 c: direct index for structure ( centroid noperspective temp 1-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 2 (const int) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) 0:40 move second child to first child ( temp 2-component vector of float) 0:40 d: direct index for structure ( temp 2-component vector of float) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 3 (const int) -0:40 d: direct index for structure ( centroid sample temp 2-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 3 (const int) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) 0:40 move second child to first child ( temp bool) 0:40 ff1: direct index for structure ( temp bool) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) @@ -85,28 +73,19 @@ gl_FragCoord origin is upper left 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 5 (const int) -0:40 ff2: direct index for structure ( flat temp bool) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 4 (const int) +0:? 's.ff2' (layout( location=5) flat in bool) 0:40 move second child to first child ( temp bool) 0:40 ff3: direct index for structure ( temp bool) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 6 (const int) -0:40 ff3: direct index for structure ( flat temp bool) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 5 (const int) +0:? 's.ff3' (layout( location=6) flat in bool) 0:40 move second child to first child ( temp 4-component vector of float) 0:40 ff4: direct index for structure ( temp 4-component vector of float) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 7 (const int) -0:40 ff4: direct index for structure ( temp 4-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 6 (const int) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) 0:40 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:40 Function Call: @PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; ( temp 4-component vector of float) @@ -118,7 +97,13 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'input' (layout( location=0) in 4-component vector of float) 0:? 's.ff1' ( flat in bool Face) -0:? 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) +0:? 's.b' (layout( location=2) flat in bool) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) +0:? 's.ff2' (layout( location=5) flat in bool) +0:? 's.ff3' (layout( location=6) flat in bool) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) Linked fragment stage: @@ -164,37 +149,25 @@ gl_FragCoord origin is upper left 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 0 (const int) -0:40 a: direct index for structure ( smooth temp 4-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 0 (const int) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) 0:40 move second child to first child ( temp bool) 0:40 b: direct index for structure ( temp bool) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 1 (const int) -0:40 b: direct index for structure ( flat temp bool) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 1 (const int) +0:? 's.b' (layout( location=2) flat in bool) 0:40 move second child to first child ( temp 1-component vector of float) 0:40 c: direct index for structure ( temp 1-component vector of float) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 2 (const int) -0:40 c: direct index for structure ( centroid noperspective temp 1-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 2 (const int) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) 0:40 move second child to first child ( temp 2-component vector of float) 0:40 d: direct index for structure ( temp 2-component vector of float) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 3 (const int) -0:40 d: direct index for structure ( centroid sample temp 2-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 3 (const int) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) 0:40 move second child to first child ( temp bool) 0:40 ff1: direct index for structure ( temp bool) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) @@ -206,28 +179,19 @@ gl_FragCoord origin is upper left 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 5 (const int) -0:40 ff2: direct index for structure ( flat temp bool) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 4 (const int) +0:? 's.ff2' (layout( location=5) flat in bool) 0:40 move second child to first child ( temp bool) 0:40 ff3: direct index for structure ( temp bool) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 6 (const int) -0:40 ff3: direct index for structure ( flat temp bool) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 5 (const int) +0:? 's.ff3' (layout( location=6) flat in bool) 0:40 move second child to first child ( temp 4-component vector of float) 0:40 ff4: direct index for structure ( temp 4-component vector of float) 0:? 's' ( temp structure{ temp 4-component vector of float a, temp bool b, temp 1-component vector of float c, temp 2-component vector of float d, temp bool ff1, temp bool ff2, temp bool ff3, temp 4-component vector of float ff4}) 0:40 Constant: 0:40 7 (const int) -0:40 ff4: direct index for structure ( temp 4-component vector of float) -0:40 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) -0:40 Constant: -0:40 6 (const int) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) 0:40 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:40 Function Call: @PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41; ( temp 4-component vector of float) @@ -239,16 +203,22 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'input' (layout( location=0) in 4-component vector of float) 0:? 's.ff1' ( flat in bool Face) -0:? 's' (layout( location=1) in structure{ smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, flat temp bool ff2, flat temp bool ff3, temp 4-component vector of float ff4}) +0:? 's.a' (layout( location=1) smooth in 4-component vector of float) +0:? 's.b' (layout( location=2) flat in bool) +0:? 's.c' (layout( location=3) centroid noperspective in 1-component vector of float) +0:? 's.d' (layout( location=4) centroid sample in 2-component vector of float) +0:? 's.ff2' (layout( location=5) flat in bool) +0:? 's.ff3' (layout( location=6) flat in bool) +0:? 's.ff4' (layout( location=7) in 4-component vector of float) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 105 +// Id's are bound by 102 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "PixelShaderFunction" 51 56 79 94 + EntryPoint Fragment 4 "PixelShaderFunction" 51 54 59 65 71 76 80 84 87 91 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "PixelShaderFunction" @@ -278,49 +248,53 @@ gl_FragCoord origin is upper left Name 49 "input" Name 51 "input" Name 53 "s" - Name 54 "IN_S" - MemberName 54(IN_S) 0 "a" - MemberName 54(IN_S) 1 "b" - MemberName 54(IN_S) 2 "c" - MemberName 54(IN_S) 3 "d" - MemberName 54(IN_S) 4 "ff2" - MemberName 54(IN_S) 5 "ff3" - MemberName 54(IN_S) 6 "ff4" - Name 56 "s" - Name 79 "s.ff1" - Name 94 "@entryPointOutput" - Name 95 "param" - Name 97 "param" - Name 101 "myS" - MemberName 101(myS) 0 "b" - MemberName 101(myS) 1 "c" - MemberName 101(myS) 2 "a" - MemberName 101(myS) 3 "d" - Name 102 "$Global" - MemberName 102($Global) 0 "s1" - MemberName 102($Global) 1 "ff5" - MemberName 102($Global) 2 "ff6" - Name 104 "" + Name 54 "s.a" + Name 59 "s.b" + Name 65 "s.c" + Name 71 "s.d" + Name 76 "s.ff1" + Name 80 "s.ff2" + Name 84 "s.ff3" + Name 87 "s.ff4" + Name 91 "@entryPointOutput" + Name 92 "param" + Name 94 "param" + Name 98 "myS" + MemberName 98(myS) 0 "b" + MemberName 98(myS) 1 "c" + MemberName 98(myS) 2 "a" + MemberName 98(myS) 3 "d" + Name 99 "$Global" + MemberName 99($Global) 0 "s1" + MemberName 99($Global) 1 "ff5" + MemberName 99($Global) 2 "ff6" + Name 101 "" Decorate 51(input) Location 0 - MemberDecorate 54(IN_S) 1 Flat - MemberDecorate 54(IN_S) 2 NoPerspective - MemberDecorate 54(IN_S) 2 Centroid - MemberDecorate 54(IN_S) 3 Centroid - MemberDecorate 54(IN_S) 4 Flat - MemberDecorate 54(IN_S) 5 Flat - Decorate 56(s) Location 1 - Decorate 79(s.ff1) Flat - Decorate 79(s.ff1) BuiltIn FrontFacing - Decorate 94(@entryPointOutput) Location 0 - MemberDecorate 101(myS) 0 Offset 0 - MemberDecorate 101(myS) 1 Offset 4 - MemberDecorate 101(myS) 2 Offset 16 - MemberDecorate 101(myS) 3 Offset 32 - MemberDecorate 102($Global) 0 Offset 0 - MemberDecorate 102($Global) 1 Offset 1620 - MemberDecorate 102($Global) 2 Offset 1636 - Decorate 102($Global) Block - Decorate 104 DescriptorSet 0 + Decorate 54(s.a) Location 1 + Decorate 59(s.b) Flat + Decorate 59(s.b) Location 2 + Decorate 65(s.c) NoPerspective + Decorate 65(s.c) Centroid + Decorate 65(s.c) Location 3 + Decorate 71(s.d) Centroid + Decorate 71(s.d) Location 4 + Decorate 76(s.ff1) Flat + Decorate 76(s.ff1) BuiltIn FrontFacing + Decorate 80(s.ff2) Flat + Decorate 80(s.ff2) Location 5 + Decorate 84(s.ff3) Flat + Decorate 84(s.ff3) Location 6 + Decorate 87(s.ff4) Location 7 + Decorate 91(@entryPointOutput) Location 0 + MemberDecorate 98(myS) 0 Offset 0 + MemberDecorate 98(myS) 1 Offset 4 + MemberDecorate 98(myS) 2 Offset 16 + MemberDecorate 98(myS) 3 Offset 32 + MemberDecorate 99($Global) 0 Offset 0 + MemberDecorate 99($Global) 1 Offset 1620 + MemberDecorate 99($Global) 2 Offset 1636 + Decorate 99($Global) Block + Decorate 101 DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -347,74 +321,71 @@ gl_FragCoord origin is upper left 42: TypePointer Function 41(containEmpty) 50: TypePointer Input 7(fvec4) 51(input): 50(ptr) Variable Input - 54(IN_S): TypeStruct 7(fvec4) 9(bool) 6(float) 10(fvec2) 9(bool) 9(bool) 7(fvec4) - 55: TypePointer Input 54(IN_S) - 56(s): 55(ptr) Variable Input - 60: 31(int) Constant 1 - 61: TypePointer Input 9(bool) - 64: TypePointer Function 9(bool) - 66: 31(int) Constant 2 - 67: TypePointer Input 6(float) - 70: TypePointer Function 6(float) - 72: 31(int) Constant 3 - 73: TypePointer Input 10(fvec2) - 76: TypePointer Function 10(fvec2) - 78: 31(int) Constant 4 - 79(s.ff1): 61(ptr) Variable Input - 82: 31(int) Constant 5 - 86: 31(int) Constant 6 - 93: TypePointer Output 7(fvec4) -94(@entryPointOutput): 93(ptr) Variable Output - 100: TypeInt 32 0 - 101(myS): TypeStruct 100(int) 100(int) 7(fvec4) 7(fvec4) - 102($Global): TypeStruct 101(myS) 6(float) 6(float) - 103: TypePointer Uniform 102($Global) - 104: 103(ptr) Variable Uniform + 54(s.a): 50(ptr) Variable Input + 57: 31(int) Constant 1 + 58: TypePointer Input 9(bool) + 59(s.b): 58(ptr) Variable Input + 61: TypePointer Function 9(bool) + 63: 31(int) Constant 2 + 64: TypePointer Input 6(float) + 65(s.c): 64(ptr) Variable Input + 67: TypePointer Function 6(float) + 69: 31(int) Constant 3 + 70: TypePointer Input 10(fvec2) + 71(s.d): 70(ptr) Variable Input + 73: TypePointer Function 10(fvec2) + 75: 31(int) Constant 4 + 76(s.ff1): 58(ptr) Variable Input + 79: 31(int) Constant 5 + 80(s.ff2): 58(ptr) Variable Input + 83: 31(int) Constant 6 + 84(s.ff3): 58(ptr) Variable Input + 87(s.ff4): 50(ptr) Variable Input + 90: TypePointer Output 7(fvec4) +91(@entryPointOutput): 90(ptr) Variable Output + 97: TypeInt 32 0 + 98(myS): TypeStruct 97(int) 97(int) 7(fvec4) 7(fvec4) + 99($Global): TypeStruct 98(myS) 6(float) 6(float) + 100: TypePointer Uniform 99($Global) + 101: 100(ptr) Variable Uniform 4(PixelShaderFunction): 2 Function None 3 5: Label 49(input): 8(ptr) Variable Function 53(s): 12(ptr) Variable Function - 95(param): 8(ptr) Variable Function - 97(param): 12(ptr) Variable Function + 92(param): 8(ptr) Variable Function + 94(param): 12(ptr) Variable Function 52: 7(fvec4) Load 51(input) Store 49(input) 52 - 57: 50(ptr) AccessChain 56(s) 32 - 58: 7(fvec4) Load 57 - 59: 8(ptr) AccessChain 53(s) 32 - Store 59 58 - 62: 61(ptr) AccessChain 56(s) 60 - 63: 9(bool) Load 62 - 65: 64(ptr) AccessChain 53(s) 60 - Store 65 63 - 68: 67(ptr) AccessChain 56(s) 66 - 69: 6(float) Load 68 - 71: 70(ptr) AccessChain 53(s) 66 - Store 71 69 - 74: 73(ptr) AccessChain 56(s) 72 - 75: 10(fvec2) Load 74 - 77: 76(ptr) AccessChain 53(s) 72 - Store 77 75 - 80: 9(bool) Load 79(s.ff1) - 81: 64(ptr) AccessChain 53(s) 78 - Store 81 80 - 83: 61(ptr) AccessChain 56(s) 78 - 84: 9(bool) Load 83 - 85: 64(ptr) AccessChain 53(s) 82 - Store 85 84 - 87: 61(ptr) AccessChain 56(s) 82 - 88: 9(bool) Load 87 - 89: 64(ptr) AccessChain 53(s) 86 + 55: 7(fvec4) Load 54(s.a) + 56: 8(ptr) AccessChain 53(s) 32 + Store 56 55 + 60: 9(bool) Load 59(s.b) + 62: 61(ptr) AccessChain 53(s) 57 + Store 62 60 + 66: 6(float) Load 65(s.c) + 68: 67(ptr) AccessChain 53(s) 63 + Store 68 66 + 72: 10(fvec2) Load 71(s.d) + 74: 73(ptr) AccessChain 53(s) 69 + Store 74 72 + 77: 9(bool) Load 76(s.ff1) + 78: 61(ptr) AccessChain 53(s) 75 + Store 78 77 + 81: 9(bool) Load 80(s.ff2) + 82: 61(ptr) AccessChain 53(s) 79 + Store 82 81 + 85: 9(bool) Load 84(s.ff3) + 86: 61(ptr) AccessChain 53(s) 83 + Store 86 85 + 88: 7(fvec4) Load 87(s.ff4) + 89: 8(ptr) AccessChain 53(s) 33 Store 89 88 - 90: 50(ptr) AccessChain 56(s) 86 - 91: 7(fvec4) Load 90 - 92: 8(ptr) AccessChain 53(s) 33 - Store 92 91 - 96: 7(fvec4) Load 49(input) - Store 95(param) 96 - 98: 11(IN_S) Load 53(s) - Store 97(param) 98 - 99: 7(fvec4) FunctionCall 16(@PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41;) 95(param) 97(param) - Store 94(@entryPointOutput) 99 + 93: 7(fvec4) Load 49(input) + Store 92(param) 93 + 95: 11(IN_S) Load 53(s) + Store 94(param) 95 + 96: 7(fvec4) FunctionCall 16(@PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41;) 92(param) 94(param) + Store 91(@entryPointOutput) 96 Return FunctionEnd 16(@PixelShaderFunction(vf4;struct-IN_S-vf4-b1-vf1-vf2-b1-b1-b1-vf41;): 7(fvec4) Function None 13 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out b/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out index 893895e72..896e1245c 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.struct.split-1.vert.out @@ -69,10 +69,7 @@ Shader version: 500 0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) 0:? 'Pos_loose' ( temp 4-component vector of float) 0:17 move second child to first child ( temp int) -0:17 x0_out: direct index for structure ( temp int) -0:17 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:17 Constant: -0:17 0 (const int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) 0:17 x0_out: direct index for structure ( temp int) 0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:17 Constant: @@ -84,17 +81,15 @@ Shader version: 500 0:17 Constant: 0:17 1 (const int) 0:17 move second child to first child ( temp int) -0:17 x1_out: direct index for structure ( temp int) -0:17 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:17 Constant: -0:17 1 (const int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:17 x1_out: direct index for structure ( temp int) 0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:17 Constant: 0:17 2 (const int) 0:? Linker Objects 0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:? 'vsin.x0_in' (layout( location=0) in int) 0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) 0:? 'vsin.x1_in' (layout( location=2) in int) @@ -174,10 +169,7 @@ Shader version: 500 0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) 0:? 'Pos_loose' ( temp 4-component vector of float) 0:17 move second child to first child ( temp int) -0:17 x0_out: direct index for structure ( temp int) -0:17 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:17 Constant: -0:17 0 (const int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) 0:17 x0_out: direct index for structure ( temp int) 0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:17 Constant: @@ -189,17 +181,15 @@ Shader version: 500 0:17 Constant: 0:17 1 (const int) 0:17 move second child to first child ( temp int) -0:17 x1_out: direct index for structure ( temp int) -0:17 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:17 Constant: -0:17 1 (const int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:17 x1_out: direct index for structure ( temp int) 0:17 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:17 Constant: 0:17 2 (const int) 0:? Linker Objects 0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:? 'vsin.x0_in' (layout( location=0) in int) 0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) 0:? 'vsin.x1_in' (layout( location=2) in int) @@ -207,12 +197,12 @@ Shader version: 500 // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 73 +// Id's are bound by 70 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 40 44 47 51 61 67 + EntryPoint Vertex 4 "main" 40 44 47 51 60 64 67 Source HLSL 500 Name 4 "main" Name 9 "VS_INPUT" @@ -236,17 +226,16 @@ Shader version: 500 Name 53 "flattenTemp" Name 54 "param" Name 56 "param" - Name 59 "VS_OUTPUT" - MemberName 59(VS_OUTPUT) 0 "x0_out" - MemberName 59(VS_OUTPUT) 1 "x1_out" - Name 61 "@entryPointOutput" - Name 67 "@entryPointOutput.Pos_out" + Name 60 "@entryPointOutput.x0_out" + Name 64 "@entryPointOutput.Pos_out" + Name 67 "@entryPointOutput.x1_out" Decorate 40(vsin.x0_in) Location 0 Decorate 44(vsin.Pos_in) Location 1 Decorate 47(vsin.x1_in) Location 2 Decorate 51(Pos_loose) Location 3 - Decorate 61(@entryPointOutput) Location 0 - Decorate 67(@entryPointOutput.Pos_out) BuiltIn Position + Decorate 60(@entryPointOutput.x0_out) Location 0 + Decorate 64(@entryPointOutput.Pos_out) BuiltIn Position + Decorate 67(@entryPointOutput.x1_out) Location 1 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -268,12 +257,11 @@ Shader version: 500 44(vsin.Pos_in): 43(ptr) Variable Input 47(vsin.x1_in): 39(ptr) Variable Input 51(Pos_loose): 43(ptr) Variable Input - 59(VS_OUTPUT): TypeStruct 6(int) 6(int) - 60: TypePointer Output 59(VS_OUTPUT) -61(@entryPointOutput): 60(ptr) Variable Output - 64: TypePointer Output 6(int) - 66: TypePointer Output 8(fvec4) -67(@entryPointOutput.Pos_out): 66(ptr) Variable Output + 59: TypePointer Output 6(int) +60(@entryPointOutput.x0_out): 59(ptr) Variable Output + 63: TypePointer Output 8(fvec4) +64(@entryPointOutput.Pos_out): 63(ptr) Variable Output +67(@entryPointOutput.x1_out): 59(ptr) Variable Output 4(main): 2 Function None 3 5: Label 38(vsin): 10(ptr) Variable Function @@ -298,17 +286,15 @@ Shader version: 500 Store 56(param) 57 58:12(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;) 54(param) 56(param) Store 53(flattenTemp) 58 - 62: 21(ptr) AccessChain 53(flattenTemp) 20 - 63: 6(int) Load 62 - 65: 64(ptr) AccessChain 61(@entryPointOutput) 20 - Store 65 63 - 68: 11(ptr) AccessChain 53(flattenTemp) 25 - 69: 8(fvec4) Load 68 - Store 67(@entryPointOutput.Pos_out) 69 - 70: 21(ptr) AccessChain 53(flattenTemp) 31 - 71: 6(int) Load 70 - 72: 64(ptr) AccessChain 61(@entryPointOutput) 25 - Store 72 71 + 61: 21(ptr) AccessChain 53(flattenTemp) 20 + 62: 6(int) Load 61 + Store 60(@entryPointOutput.x0_out) 62 + 65: 11(ptr) AccessChain 53(flattenTemp) 25 + 66: 8(fvec4) Load 65 + Store 64(@entryPointOutput.Pos_out) 66 + 68: 21(ptr) AccessChain 53(flattenTemp) 31 + 69: 6(int) Load 68 + Store 67(@entryPointOutput.x1_out) 69 Return FunctionEnd 16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;):12(VS_OUTPUT) Function None 13 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out index 1f181caf6..8aae6f372 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.array.geom.out @@ -73,7 +73,9 @@ output primitive = triangle_strip 0:? Linker Objects 0:? 'v' (layout( location=0) in 1-element array of uint) 0:? 'OutputStream.Pos' ( out 4-component vector of float Position) -0:? 'OutputStream' (layout( location=0) out structure{ temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:? 'OutputStream.TexCoord' (layout( location=0) out 2-component vector of float) +0:? 'OutputStream.TerrainPos' (layout( location=1) out 3-component vector of float) +0:? 'OutputStream.VertexID' (layout( location=2) out uint) Linked geometry stage: @@ -153,16 +155,18 @@ output primitive = triangle_strip 0:? Linker Objects 0:? 'v' (layout( location=0) in 1-element array of uint) 0:? 'OutputStream.Pos' ( out 4-component vector of float Position) -0:? 'OutputStream' (layout( location=0) out structure{ temp 2-component vector of float TexCoord, temp 3-component vector of float TerrainPos, temp uint VertexID}) +0:? 'OutputStream.TexCoord' (layout( location=0) out 2-component vector of float) +0:? 'OutputStream.TerrainPos' (layout( location=1) out 3-component vector of float) +0:? 'OutputStream.VertexID' (layout( location=2) out uint) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 79 +// Id's are bound by 82 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 66 75 78 + EntryPoint Geometry 4 "main" 66 75 77 79 81 ExecutionMode 4 InputPoints ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -187,14 +191,14 @@ output primitive = triangle_strip Name 69 "param" Name 71 "param" Name 75 "OutputStream.Pos" - Name 76 "PSInput" - MemberName 76(PSInput) 0 "TexCoord" - MemberName 76(PSInput) 1 "TerrainPos" - MemberName 76(PSInput) 2 "VertexID" - Name 78 "OutputStream" + Name 77 "OutputStream.TexCoord" + Name 79 "OutputStream.TerrainPos" + Name 81 "OutputStream.VertexID" Decorate 66(v) Location 0 Decorate 75(OutputStream.Pos) BuiltIn Position - Decorate 78(OutputStream) Location 0 + Decorate 77(OutputStream.TexCoord) Location 0 + Decorate 79(OutputStream.TerrainPos) Location 1 + Decorate 81(OutputStream.VertexID) Location 2 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -229,9 +233,12 @@ output primitive = triangle_strip 66(v): 65(ptr) Variable Input 74: TypePointer Output 11(fvec4) 75(OutputStream.Pos): 74(ptr) Variable Output - 76(PSInput): TypeStruct 12(fvec2) 13(fvec3) 6(int) - 77: TypePointer Output 76(PSInput) -78(OutputStream): 77(ptr) Variable Output + 76: TypePointer Output 12(fvec2) +77(OutputStream.TexCoord): 76(ptr) Variable Output + 78: TypePointer Output 13(fvec3) +79(OutputStream.TerrainPos): 78(ptr) Variable Output + 80: TypePointer Output 6(int) +81(OutputStream.VertexID): 80(ptr) Variable Output 4(main): 2 Function None 3 5: Label 64(v): 9(ptr) Variable Function diff --git a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out index ce2f50de3..fca9751be 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.assign.frag.out @@ -11,10 +11,13 @@ gl_FragCoord origin is upper left 0:9 'input' ( in 3-element array of structure{ temp float f, temp 4-component vector of float pos}) 0:9 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) 0:11 Branch: Return with expression -0:11 Constant: -0:11 1.000000 -0:11 1.000000 -0:11 1.000000 +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:11 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) 0:7 Function Definition: main( ( temp void) 0:7 Function Parameters: 0:? Sequence @@ -30,13 +33,7 @@ gl_FragCoord origin is upper left 0:7 0 (const int) 0:7 Constant: 0:7 0 (const int) -0:7 f: direct index for structure ( temp float) -0:7 direct index (layout( location=1) in structure{ temp float f}) -0:7 'input' (layout( location=1) in 3-element array of structure{ temp float f}) -0:7 Constant: -0:7 0 (const int) -0:7 Constant: -0:7 0 (const int) +0:? 'input[0].f' (layout( location=1) in float) 0:7 move second child to first child ( temp 4-component vector of float) 0:7 pos: direct index for structure ( temp 4-component vector of float) 0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) @@ -57,13 +54,7 @@ gl_FragCoord origin is upper left 0:7 1 (const int) 0:7 Constant: 0:7 0 (const int) -0:7 f: direct index for structure ( temp float) -0:7 direct index (layout( location=1) in structure{ temp float f}) -0:7 'input' (layout( location=1) in 3-element array of structure{ temp float f}) -0:7 Constant: -0:7 1 (const int) -0:7 Constant: -0:7 0 (const int) +0:? 'input[1].f' (layout( location=2) in float) 0:7 move second child to first child ( temp 4-component vector of float) 0:7 pos: direct index for structure ( temp 4-component vector of float) 0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) @@ -84,13 +75,7 @@ gl_FragCoord origin is upper left 0:7 2 (const int) 0:7 Constant: 0:7 0 (const int) -0:7 f: direct index for structure ( temp float) -0:7 direct index (layout( location=1) in structure{ temp float f}) -0:7 'input' (layout( location=1) in 3-element array of structure{ temp float f}) -0:7 Constant: -0:7 2 (const int) -0:7 Constant: -0:7 0 (const int) +0:? 'input[2].f' (layout( location=3) in float) 0:7 move second child to first child ( temp 4-component vector of float) 0:7 pos: direct index for structure ( temp 4-component vector of float) 0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) @@ -112,7 +97,9 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'i' (layout( location=0) flat in int) 0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) -0:? 'input' (layout( location=1) in 3-element array of structure{ temp float f}) +0:? 'input[0].f' (layout( location=1) in float) +0:? 'input[1].f' (layout( location=2) in float) +0:? 'input[2].f' (layout( location=3) in float) Linked fragment stage: @@ -130,10 +117,13 @@ gl_FragCoord origin is upper left 0:9 'input' ( in 3-element array of structure{ temp float f, temp 4-component vector of float pos}) 0:9 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) 0:11 Branch: Return with expression -0:11 Constant: -0:11 1.000000 -0:11 1.000000 -0:11 1.000000 +0:11 pos: direct index for structure ( temp 4-component vector of float) +0:11 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) +0:11 'a' ( temp 3-element array of structure{ temp float f, temp 4-component vector of float pos}) +0:11 Constant: +0:11 1 (const int) +0:11 Constant: +0:11 1 (const int) 0:7 Function Definition: main( ( temp void) 0:7 Function Parameters: 0:? Sequence @@ -149,13 +139,7 @@ gl_FragCoord origin is upper left 0:7 0 (const int) 0:7 Constant: 0:7 0 (const int) -0:7 f: direct index for structure ( temp float) -0:7 direct index (layout( location=1) in structure{ temp float f}) -0:7 'input' (layout( location=1) in 3-element array of structure{ temp float f}) -0:7 Constant: -0:7 0 (const int) -0:7 Constant: -0:7 0 (const int) +0:? 'input[0].f' (layout( location=1) in float) 0:7 move second child to first child ( temp 4-component vector of float) 0:7 pos: direct index for structure ( temp 4-component vector of float) 0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) @@ -176,13 +160,7 @@ gl_FragCoord origin is upper left 0:7 1 (const int) 0:7 Constant: 0:7 0 (const int) -0:7 f: direct index for structure ( temp float) -0:7 direct index (layout( location=1) in structure{ temp float f}) -0:7 'input' (layout( location=1) in 3-element array of structure{ temp float f}) -0:7 Constant: -0:7 1 (const int) -0:7 Constant: -0:7 0 (const int) +0:? 'input[1].f' (layout( location=2) in float) 0:7 move second child to first child ( temp 4-component vector of float) 0:7 pos: direct index for structure ( temp 4-component vector of float) 0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) @@ -203,13 +181,7 @@ gl_FragCoord origin is upper left 0:7 2 (const int) 0:7 Constant: 0:7 0 (const int) -0:7 f: direct index for structure ( temp float) -0:7 direct index (layout( location=1) in structure{ temp float f}) -0:7 'input' (layout( location=1) in 3-element array of structure{ temp float f}) -0:7 Constant: -0:7 2 (const int) -0:7 Constant: -0:7 0 (const int) +0:? 'input[2].f' (layout( location=3) in float) 0:7 move second child to first child ( temp 4-component vector of float) 0:7 pos: direct index for structure ( temp 4-component vector of float) 0:7 direct index ( temp structure{ temp float f, temp 4-component vector of float pos}) @@ -231,16 +203,18 @@ gl_FragCoord origin is upper left 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? 'i' (layout( location=0) flat in int) 0:? 'input.pos' ( in 3-element array of 4-component vector of float FragCoord) -0:? 'input' (layout( location=1) in 3-element array of structure{ temp float f}) +0:? 'input[0].f' (layout( location=1) in float) +0:? 'input[1].f' (layout( location=2) in float) +0:? 'input[2].f' (layout( location=3) in float) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 73 +// Id's are bound by 66 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 32 39 48 67 + EntryPoint Fragment 4 "main" 30 35 41 46 53 60 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -251,21 +225,23 @@ gl_FragCoord origin is upper left Name 16 "i" Name 17 "input" Name 20 "a" + Name 28 "i" Name 30 "i" - Name 32 "i" - Name 34 "input" - Name 36 "S" - MemberName 36(S) 0 "f" - Name 39 "input" - Name 48 "input.pos" - Name 67 "@entryPointOutput" - Name 68 "param" - Name 70 "param" - Decorate 32(i) Flat - Decorate 32(i) Location 0 - Decorate 39(input) Location 1 - Decorate 48(input.pos) BuiltIn FragCoord - Decorate 67(@entryPointOutput) Location 0 + Name 32 "input" + Name 35 "input[0].f" + Name 41 "input.pos" + Name 46 "input[1].f" + Name 53 "input[2].f" + Name 60 "@entryPointOutput" + Name 61 "param" + Name 63 "param" + Decorate 30(i) Flat + Decorate 30(i) Location 0 + Decorate 35(input[0].f) Location 1 + Decorate 41(input.pos) BuiltIn FragCoord + Decorate 46(input[1].f) Location 2 + Decorate 53(input[2].f) Location 3 + Decorate 60(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -278,65 +254,58 @@ gl_FragCoord origin is upper left 13: TypeArray 10(S) 12 14: TypePointer Function 13 15: TypeFunction 9(fvec4) 7(ptr) 14(ptr) - 22: TypeVector 8(float) 3 - 23: 8(float) Constant 1065353216 - 24: 22(fvec3) ConstantComposite 23 23 23 - 25: TypePointer Function 9(fvec4) - 31: TypePointer Input 6(int) - 32(i): 31(ptr) Variable Input - 35: 6(int) Constant 0 - 36(S): TypeStruct 8(float) - 37: TypeArray 36(S) 12 - 38: TypePointer Input 37 - 39(input): 38(ptr) Variable Input - 40: TypePointer Input 8(float) - 43: TypePointer Function 8(float) - 45: 6(int) Constant 1 - 46: TypeArray 9(fvec4) 12 - 47: TypePointer Input 46 - 48(input.pos): 47(ptr) Variable Input - 49: TypePointer Input 9(fvec4) - 59: 6(int) Constant 2 - 66: TypePointer Output 9(fvec4) -67(@entryPointOutput): 66(ptr) Variable Output + 22: 6(int) Constant 1 + 23: TypePointer Function 9(fvec4) + 29: TypePointer Input 6(int) + 30(i): 29(ptr) Variable Input + 33: 6(int) Constant 0 + 34: TypePointer Input 8(float) + 35(input[0].f): 34(ptr) Variable Input + 37: TypePointer Function 8(float) + 39: TypeArray 9(fvec4) 12 + 40: TypePointer Input 39 + 41(input.pos): 40(ptr) Variable Input + 42: TypePointer Input 9(fvec4) + 46(input[1].f): 34(ptr) Variable Input + 52: 6(int) Constant 2 + 53(input[2].f): 34(ptr) Variable Input + 59: TypePointer Output 9(fvec4) +60(@entryPointOutput): 59(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 30(i): 7(ptr) Variable Function - 34(input): 14(ptr) Variable Function - 68(param): 7(ptr) Variable Function - 70(param): 14(ptr) Variable Function - 33: 6(int) Load 32(i) - Store 30(i) 33 - 41: 40(ptr) AccessChain 39(input) 35 35 - 42: 8(float) Load 41 - 44: 43(ptr) AccessChain 34(input) 35 35 - Store 44 42 - 50: 49(ptr) AccessChain 48(input.pos) 35 - 51: 9(fvec4) Load 50 - 52: 25(ptr) AccessChain 34(input) 35 45 - Store 52 51 - 53: 40(ptr) AccessChain 39(input) 45 35 - 54: 8(float) Load 53 - 55: 43(ptr) AccessChain 34(input) 45 35 + 28(i): 7(ptr) Variable Function + 32(input): 14(ptr) Variable Function + 61(param): 7(ptr) Variable Function + 63(param): 14(ptr) Variable Function + 31: 6(int) Load 30(i) + Store 28(i) 31 + 36: 8(float) Load 35(input[0].f) + 38: 37(ptr) AccessChain 32(input) 33 33 + Store 38 36 + 43: 42(ptr) AccessChain 41(input.pos) 33 + 44: 9(fvec4) Load 43 + 45: 23(ptr) AccessChain 32(input) 33 22 + Store 45 44 + 47: 8(float) Load 46(input[1].f) + 48: 37(ptr) AccessChain 32(input) 22 33 + Store 48 47 + 49: 42(ptr) AccessChain 41(input.pos) 22 + 50: 9(fvec4) Load 49 + 51: 23(ptr) AccessChain 32(input) 22 22 + Store 51 50 + 54: 8(float) Load 53(input[2].f) + 55: 37(ptr) AccessChain 32(input) 52 33 Store 55 54 - 56: 49(ptr) AccessChain 48(input.pos) 45 + 56: 42(ptr) AccessChain 41(input.pos) 52 57: 9(fvec4) Load 56 - 58: 25(ptr) AccessChain 34(input) 45 45 + 58: 23(ptr) AccessChain 32(input) 52 22 Store 58 57 - 60: 40(ptr) AccessChain 39(input) 59 35 - 61: 8(float) Load 60 - 62: 43(ptr) AccessChain 34(input) 59 35 - Store 62 61 - 63: 49(ptr) AccessChain 48(input.pos) 59 - 64: 9(fvec4) Load 63 - 65: 25(ptr) AccessChain 34(input) 59 45 - Store 65 64 - 69: 6(int) Load 30(i) - Store 68(param) 69 - 71: 13 Load 34(input) - Store 70(param) 71 - 72: 9(fvec4) FunctionCall 18(@main(i1;struct-S-f1-vf41[3];) 68(param) 70(param) - Store 67(@entryPointOutput) 72 + 62: 6(int) Load 28(i) + Store 61(param) 62 + 64: 13 Load 32(input) + Store 63(param) 64 + 65: 9(fvec4) FunctionCall 18(@main(i1;struct-S-f1-vf41[3];) 61(param) 63(param) + Store 60(@entryPointOutput) 65 Return FunctionEnd 18(@main(i1;struct-S-f1-vf41[3];): 9(fvec4) Function None 15 @@ -344,10 +313,9 @@ gl_FragCoord origin is upper left 17(input): 14(ptr) FunctionParameter 19: Label 20(a): 14(ptr) Variable Function - 26: 25(ptr) Variable Function 21: 13 Load 20(a) Store 17(input) 21 - Store 26 24 - 27: 9(fvec4) Load 26 - ReturnValue 27 + 24: 23(ptr) AccessChain 20(a) 22 22 + 25: 9(fvec4) Load 24 + ReturnValue 25 FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out index 1921ef2c1..bbbbe9a89 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.call.vert.out @@ -79,10 +79,7 @@ Shader version: 500 0:22 Function Call: @main(struct-VS_INPUT-i1-vf4-i11; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) 0:22 move second child to first child ( temp int) -0:22 x0_out: direct index for structure ( temp int) -0:22 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:22 Constant: -0:22 0 (const int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) 0:22 x0_out: direct index for structure ( temp int) 0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:22 Constant: @@ -94,17 +91,15 @@ Shader version: 500 0:22 Constant: 0:22 1 (const int) 0:22 move second child to first child ( temp int) -0:22 x1_out: direct index for structure ( temp int) -0:22 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:22 Constant: -0:22 1 (const int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:22 x1_out: direct index for structure ( temp int) 0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:22 Constant: 0:22 2 (const int) 0:? Linker Objects 0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:? 'vsin.x0_in' (layout( location=0) in int) 0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) 0:? 'vsin.x1_in' (layout( location=2) in int) @@ -193,10 +188,7 @@ Shader version: 500 0:22 Function Call: @main(struct-VS_INPUT-i1-vf4-i11; ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:? 'vsin' ( temp structure{ temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in}) 0:22 move second child to first child ( temp int) -0:22 x0_out: direct index for structure ( temp int) -0:22 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:22 Constant: -0:22 0 (const int) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) 0:22 x0_out: direct index for structure ( temp int) 0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:22 Constant: @@ -208,29 +200,27 @@ Shader version: 500 0:22 Constant: 0:22 1 (const int) 0:22 move second child to first child ( temp int) -0:22 x1_out: direct index for structure ( temp int) -0:22 '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) -0:22 Constant: -0:22 1 (const int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:22 x1_out: direct index for structure ( temp int) 0:22 'flattenTemp' ( temp structure{ temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out}) 0:22 Constant: 0:22 2 (const int) 0:? Linker Objects 0:? '@entryPointOutput.Pos_out' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp int x0_out, temp int x1_out}) +0:? '@entryPointOutput.x0_out' (layout( location=0) out int) +0:? '@entryPointOutput.x1_out' (layout( location=1) out int) 0:? 'vsin.x0_in' (layout( location=0) in int) 0:? 'vsin.Pos_in' (layout( location=1) in 4-component vector of float) 0:? 'vsin.x1_in' (layout( location=2) in int) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 80 +// Id's are bound by 77 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 52 56 59 68 74 + EntryPoint Vertex 4 "main" 52 56 59 67 71 74 Source HLSL 500 Name 4 "main" Name 9 "VS_INPUT" @@ -255,16 +245,15 @@ Shader version: 500 Name 59 "vsin.x1_in" Name 62 "flattenTemp" Name 63 "param" - Name 66 "VS_OUTPUT" - MemberName 66(VS_OUTPUT) 0 "x0_out" - MemberName 66(VS_OUTPUT) 1 "x1_out" - Name 68 "@entryPointOutput" - Name 74 "@entryPointOutput.Pos_out" + Name 67 "@entryPointOutput.x0_out" + Name 71 "@entryPointOutput.Pos_out" + Name 74 "@entryPointOutput.x1_out" Decorate 52(vsin.x0_in) Location 0 Decorate 56(vsin.Pos_in) Location 1 Decorate 59(vsin.x1_in) Location 2 - Decorate 68(@entryPointOutput) Location 0 - Decorate 74(@entryPointOutput.Pos_out) BuiltIn Position + Decorate 67(@entryPointOutput.x0_out) Location 0 + Decorate 71(@entryPointOutput.Pos_out) BuiltIn Position + Decorate 74(@entryPointOutput.x1_out) Location 1 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -286,12 +275,11 @@ Shader version: 500 55: TypePointer Input 8(fvec4) 56(vsin.Pos_in): 55(ptr) Variable Input 59(vsin.x1_in): 51(ptr) Variable Input - 66(VS_OUTPUT): TypeStruct 6(int) 6(int) - 67: TypePointer Output 66(VS_OUTPUT) -68(@entryPointOutput): 67(ptr) Variable Output - 71: TypePointer Output 6(int) - 73: TypePointer Output 8(fvec4) -74(@entryPointOutput.Pos_out): 73(ptr) Variable Output + 66: TypePointer Output 6(int) +67(@entryPointOutput.x0_out): 66(ptr) Variable Output + 70: TypePointer Output 8(fvec4) +71(@entryPointOutput.Pos_out): 70(ptr) Variable Output +74(@entryPointOutput.x1_out): 66(ptr) Variable Output 4(main): 2 Function None 3 5: Label 50(vsin): 10(ptr) Variable Function @@ -310,17 +298,15 @@ Shader version: 500 Store 63(param) 64 65:11(VS_OUTPUT) FunctionCall 20(@main(struct-VS_INPUT-i1-vf4-i11;) 63(param) Store 62(flattenTemp) 65 - 69: 31(ptr) AccessChain 62(flattenTemp) 30 - 70: 6(int) Load 69 - 72: 71(ptr) AccessChain 68(@entryPointOutput) 30 - Store 72 70 - 75: 23(ptr) AccessChain 62(flattenTemp) 22 - 76: 8(fvec4) Load 75 - Store 74(@entryPointOutput.Pos_out) 76 - 77: 31(ptr) AccessChain 62(flattenTemp) 38 - 78: 6(int) Load 77 - 79: 71(ptr) AccessChain 68(@entryPointOutput) 22 - Store 79 78 + 68: 31(ptr) AccessChain 62(flattenTemp) 30 + 69: 6(int) Load 68 + Store 67(@entryPointOutput.x0_out) 69 + 72: 23(ptr) AccessChain 62(flattenTemp) 22 + 73: 8(fvec4) Load 72 + Store 71(@entryPointOutput.Pos_out) 73 + 75: 31(ptr) AccessChain 62(flattenTemp) 38 + 76: 6(int) Load 75 + Store 74(@entryPointOutput.x1_out) 76 Return FunctionEnd 16(Fn1(struct-VS_INPUT-i1-vf4-i11;struct-VS_OUTPUT-i1-vf4-i11;): 2 Function None 13 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out index 3a103ae64..d01d9bd3c 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.struct.split.nested.geom.out @@ -73,7 +73,7 @@ output primitive = triangle_strip 0:33 Sequence 0:33 Sequence 0:33 move second child to first child ( temp 4-component vector of float) -0:? 'ts.psIn.pos' ( out 4-component vector of float Position) +0:? 'ts.pos' ( out 4-component vector of float Position) 0:33 pos: direct index for structure ( temp 4-component vector of float) 0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) 0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) @@ -82,13 +82,7 @@ output primitive = triangle_strip 0:33 Constant: 0:33 0 (const int) 0:33 move second child to first child ( temp 2-component vector of float) -0:33 tc: direct index for structure ( temp 2-component vector of float) -0:33 psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc}) -0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) -0:33 Constant: -0:33 0 (const int) -0:33 Constant: -0:33 0 (const int) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) 0:33 tc: direct index for structure ( temp 2-component vector of float) 0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) 0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) @@ -96,13 +90,37 @@ output primitive = triangle_strip 0:33 0 (const int) 0:33 Constant: 0:33 1 (const int) -0:33 move second child to first child ( temp structure{ temp 2-element array of float m0_array, temp int m1}) -0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) -0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) 0:33 Constant: 0:33 1 (const int) -0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) -0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 move second child to first child ( temp int) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) +0:33 m1: direct index for structure ( temp int) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) 0:33 Constant: 0:33 1 (const int) 0:33 EmitVertex ( temp void) @@ -197,8 +215,11 @@ output primitive = triangle_strip 0:? Linker Objects 0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) 0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) -0:? 'ts.psIn.pos' ( out 4-component vector of float Position) -0:? 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) Linked geometry stage: @@ -278,7 +299,7 @@ output primitive = triangle_strip 0:33 Sequence 0:33 Sequence 0:33 move second child to first child ( temp 4-component vector of float) -0:? 'ts.psIn.pos' ( out 4-component vector of float Position) +0:? 'ts.pos' ( out 4-component vector of float Position) 0:33 pos: direct index for structure ( temp 4-component vector of float) 0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) 0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) @@ -287,13 +308,7 @@ output primitive = triangle_strip 0:33 Constant: 0:33 0 (const int) 0:33 move second child to first child ( temp 2-component vector of float) -0:33 tc: direct index for structure ( temp 2-component vector of float) -0:33 psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc}) -0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) -0:33 Constant: -0:33 0 (const int) -0:33 Constant: -0:33 0 (const int) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) 0:33 tc: direct index for structure ( temp 2-component vector of float) 0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc}) 0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) @@ -301,13 +316,37 @@ output primitive = triangle_strip 0:33 0 (const int) 0:33 Constant: 0:33 1 (const int) -0:33 move second child to first child ( temp structure{ temp 2-element array of float m0_array, temp int m1}) -0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) -0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 Constant: +0:33 0 (const int) +0:33 move second child to first child ( temp float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:33 direct index ( temp float) +0:33 m0_array: direct index for structure ( temp 2-element array of float) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) +0:33 Constant: +0:33 0 (const int) 0:33 Constant: 0:33 1 (const int) -0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) -0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 move second child to first child ( temp int) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) +0:33 m1: direct index for structure ( temp int) +0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1}) +0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:33 Constant: +0:33 1 (const int) 0:33 Constant: 0:33 1 (const int) 0:33 EmitVertex ( temp void) @@ -402,17 +441,20 @@ output primitive = triangle_strip 0:? Linker Objects 0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position) 0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc}) -0:? 'ts.psIn.pos' ( out 4-component vector of float Position) -0:? 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io}) +0:? 'ts.pos' ( out 4-component vector of float Position) +0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float) +0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float) +0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float) +0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 105 +// Id's are bound by 100 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 48 55 74 82 + EntryPoint Geometry 4 "main" 48 52 56 59 63 69 77 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -432,28 +474,26 @@ output primitive = triangle_strip Name 21 "tin" Name 22 "ts" Name 25 "o" - Name 48 "ts.psIn.pos" - Name 51 "PS_IN" - MemberName 51(PS_IN) 0 "tc" - Name 52 "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO" - MemberName 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0 "m0_array" - MemberName 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1 "m1" - Name 53 "GS_OUT" - MemberName 53(GS_OUT) 0 "psIn" - MemberName 53(GS_OUT) 1 "contains_no_builtin_io" - Name 55 "ts" - Name 71 "tin" - Name 74 "tin.pos" - Name 79 "PS_IN" - MemberName 79(PS_IN) 0 "tc" - Name 82 "tin" - Name 99 "ts" - Name 100 "param" - Name 102 "param" - Decorate 48(ts.psIn.pos) BuiltIn Position - Decorate 55(ts) Location 0 - Decorate 74(tin.pos) BuiltIn Position - Decorate 82(tin) Location 0 + Name 48 "ts.pos" + Name 52 "ts.psIn.tc" + Name 56 "ts.contains_no_builtin_io.m0_array[0]" + Name 59 "ts.contains_no_builtin_io.m0_array[1]" + Name 63 "ts.contains_no_builtin_io.m1" + Name 66 "tin" + Name 69 "tin.pos" + Name 74 "PS_IN" + MemberName 74(PS_IN) 0 "tc" + Name 77 "tin" + Name 94 "ts" + Name 95 "param" + Name 97 "param" + Decorate 48(ts.pos) BuiltIn Position + Decorate 52(ts.psIn.tc) Location 0 + Decorate 56(ts.contains_no_builtin_io.m0_array[0]) Location 1 + Decorate 59(ts.contains_no_builtin_io.m0_array[1]) Location 2 + Decorate 63(ts.contains_no_builtin_io.m1) Location 3 + Decorate 69(tin.pos) BuiltIn Position + Decorate 77(tin) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -488,61 +528,58 @@ output primitive = triangle_strip 44: 16(int) Constant 2 45: TypePointer Function 16(int) 47: TypePointer Output 7(fvec4) - 48(ts.psIn.pos): 47(ptr) Variable Output - 51(PS_IN): TypeStruct 8(fvec2) -52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO): TypeStruct 15 16(int) - 53(GS_OUT): TypeStruct 51(PS_IN) 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) - 54: TypePointer Output 53(GS_OUT) - 55(ts): 54(ptr) Variable Output - 58: TypePointer Output 8(fvec2) - 60: TypePointer Function 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) - 63: TypePointer Output 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) - 66: TypePointer Output 15 - 69: TypePointer Output 16(int) - 72: TypeArray 7(fvec4) 11 - 73: TypePointer Input 72 - 74(tin.pos): 73(ptr) Variable Input - 75: TypePointer Input 7(fvec4) - 79(PS_IN): TypeStruct 8(fvec2) - 80: TypeArray 79(PS_IN) 11 - 81: TypePointer Input 80 - 82(tin): 81(ptr) Variable Input - 83: TypePointer Input 8(fvec2) + 48(ts.pos): 47(ptr) Variable Output + 51: TypePointer Output 8(fvec2) + 52(ts.psIn.tc): 51(ptr) Variable Output + 55: TypePointer Output 6(float) +56(ts.contains_no_builtin_io.m0_array[0]): 55(ptr) Variable Output +59(ts.contains_no_builtin_io.m0_array[1]): 55(ptr) Variable Output + 62: TypePointer Output 16(int) +63(ts.contains_no_builtin_io.m1): 62(ptr) Variable Output + 67: TypeArray 7(fvec4) 11 + 68: TypePointer Input 67 + 69(tin.pos): 68(ptr) Variable Input + 70: TypePointer Input 7(fvec4) + 74(PS_IN): TypeStruct 8(fvec2) + 75: TypeArray 74(PS_IN) 11 + 76: TypePointer Input 75 + 77(tin): 76(ptr) Variable Input + 78: TypePointer Input 8(fvec2) 4(main): 2 Function None 3 5: Label - 71(tin): 13(ptr) Variable Function - 99(ts): 19(ptr) Variable Function - 100(param): 13(ptr) Variable Function - 102(param): 19(ptr) Variable Function - 76: 75(ptr) AccessChain 74(tin.pos) 26 - 77: 7(fvec4) Load 76 - 78: 32(ptr) AccessChain 71(tin) 26 26 - Store 78 77 - 84: 83(ptr) AccessChain 82(tin) 26 26 - 85: 8(fvec2) Load 84 - 86: 38(ptr) AccessChain 71(tin) 26 34 - Store 86 85 - 87: 75(ptr) AccessChain 74(tin.pos) 34 - 88: 7(fvec4) Load 87 - 89: 32(ptr) AccessChain 71(tin) 34 26 - Store 89 88 - 90: 83(ptr) AccessChain 82(tin) 34 26 - 91: 8(fvec2) Load 90 - 92: 38(ptr) AccessChain 71(tin) 34 34 - Store 92 91 - 93: 75(ptr) AccessChain 74(tin.pos) 44 - 94: 7(fvec4) Load 93 - 95: 32(ptr) AccessChain 71(tin) 44 26 - Store 95 94 - 96: 83(ptr) AccessChain 82(tin) 44 26 - 97: 8(fvec2) Load 96 - 98: 38(ptr) AccessChain 71(tin) 44 34 - Store 98 97 - 101: 12 Load 71(tin) - Store 100(param) 101 - 103: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 100(param) 102(param) - 104: 18(GS_OUT) Load 102(param) - Store 99(ts) 104 + 66(tin): 13(ptr) Variable Function + 94(ts): 19(ptr) Variable Function + 95(param): 13(ptr) Variable Function + 97(param): 19(ptr) Variable Function + 71: 70(ptr) AccessChain 69(tin.pos) 26 + 72: 7(fvec4) Load 71 + 73: 32(ptr) AccessChain 66(tin) 26 26 + Store 73 72 + 79: 78(ptr) AccessChain 77(tin) 26 26 + 80: 8(fvec2) Load 79 + 81: 38(ptr) AccessChain 66(tin) 26 34 + Store 81 80 + 82: 70(ptr) AccessChain 69(tin.pos) 34 + 83: 7(fvec4) Load 82 + 84: 32(ptr) AccessChain 66(tin) 34 26 + Store 84 83 + 85: 78(ptr) AccessChain 77(tin) 34 26 + 86: 8(fvec2) Load 85 + 87: 38(ptr) AccessChain 66(tin) 34 34 + Store 87 86 + 88: 70(ptr) AccessChain 69(tin.pos) 44 + 89: 7(fvec4) Load 88 + 90: 32(ptr) AccessChain 66(tin) 44 26 + Store 90 89 + 91: 78(ptr) AccessChain 77(tin) 44 26 + 92: 8(fvec2) Load 91 + 93: 38(ptr) AccessChain 66(tin) 44 34 + Store 93 92 + 96: 12 Load 66(tin) + Store 95(param) 96 + 98: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 95(param) 97(param) + 99: 18(GS_OUT) Load 97(param) + Store 94(ts) 99 Return FunctionEnd 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;): 2 Function None 20 @@ -562,20 +599,19 @@ output primitive = triangle_strip Store 46 44 49: 32(ptr) AccessChain 25(o) 26 26 50: 7(fvec4) Load 49 - Store 48(ts.psIn.pos) 50 - 56: 38(ptr) AccessChain 25(o) 26 34 - 57: 8(fvec2) Load 56 - 59: 58(ptr) AccessChain 55(ts) 26 26 - Store 59 57 - 61: 60(ptr) AccessChain 25(o) 34 - 62:17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) Load 61 - 64: 63(ptr) AccessChain 55(ts) 34 - 65: 15 CompositeExtract 62 0 - 67: 66(ptr) AccessChain 64 26 - Store 67 65 - 68: 16(int) CompositeExtract 62 1 - 70: 69(ptr) AccessChain 64 34 - Store 70 68 + Store 48(ts.pos) 50 + 53: 38(ptr) AccessChain 25(o) 26 34 + 54: 8(fvec2) Load 53 + Store 52(ts.psIn.tc) 54 + 57: 41(ptr) AccessChain 25(o) 34 26 26 + 58: 6(float) Load 57 + Store 56(ts.contains_no_builtin_io.m0_array[0]) 58 + 60: 41(ptr) AccessChain 25(o) 34 26 34 + 61: 6(float) Load 60 + Store 59(ts.contains_no_builtin_io.m0_array[1]) 61 + 64: 45(ptr) AccessChain 25(o) 34 34 + 65: 16(int) Load 64 + Store 63(ts.contains_no_builtin_io.m1) 65 EmitVertex Return FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out b/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out index 5675fb476..c11857d26 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.structarray.flatten.geom.out @@ -55,19 +55,13 @@ output primitive = triangle_strip 0:22 Constant: 0:22 0 (const int) 0:22 move second child to first child ( temp 4-component vector of float) -0:22 color: direct index for structure ( temp 4-component vector of float) -0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 Constant: -0:22 0 (const int) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) 0:22 color: direct index for structure ( temp 4-component vector of float) 0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:22 Constant: 0:22 1 (const int) 0:22 move second child to first child ( temp 2-component vector of float) -0:22 uv: direct index for structure ( temp 2-component vector of float) -0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 Constant: -0:22 1 (const int) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) 0:22 uv: direct index for structure ( temp 2-component vector of float) 0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:22 Constant: @@ -85,7 +79,8 @@ output primitive = triangle_strip 0:? Linker Objects 0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:? 'outStream.position' ( out 4-component vector of float Position) -0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) Linked geometry stage: @@ -147,19 +142,13 @@ output primitive = triangle_strip 0:22 Constant: 0:22 0 (const int) 0:22 move second child to first child ( temp 4-component vector of float) -0:22 color: direct index for structure ( temp 4-component vector of float) -0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 Constant: -0:22 0 (const int) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) 0:22 color: direct index for structure ( temp 4-component vector of float) 0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:22 Constant: 0:22 1 (const int) 0:22 move second child to first child ( temp 2-component vector of float) -0:22 uv: direct index for structure ( temp 2-component vector of float) -0:22 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) -0:22 Constant: -0:22 1 (const int) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) 0:22 uv: direct index for structure ( temp 2-component vector of float) 0:22 'vout' ( temp structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:22 Constant: @@ -177,16 +166,17 @@ output primitive = triangle_strip 0:? Linker Objects 0:? 'vin' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float position, temp 4-component vector of float color, temp 2-component vector of float uv}) 0:? 'outStream.position' ( out 4-component vector of float Position) -0:? 'outStream' (layout( location=0) out structure{ temp 4-component vector of float color, temp 2-component vector of float uv}) +0:? 'outStream.color' (layout( location=0) out 4-component vector of float) +0:? 'outStream.uv' (layout( location=1) out 2-component vector of float) // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 61 +// Id's are bound by 58 Capability Geometry 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 38 43 53 + EntryPoint Geometry 4 "main" 38 41 45 50 ExecutionMode 4 InputLines ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputTriangleStrip @@ -206,18 +196,17 @@ output primitive = triangle_strip Name 18 "outStream" Name 21 "vout" Name 38 "outStream.position" - Name 41 "PS_IN" - MemberName 41(PS_IN) 0 "color" - MemberName 41(PS_IN) 1 "uv" - Name 43 "outStream" - Name 51 "vin" - Name 53 "vin" - Name 55 "outStream" - Name 56 "param" - Name 58 "param" + Name 41 "outStream.color" + Name 45 "outStream.uv" + Name 48 "vin" + Name 50 "vin" + Name 52 "outStream" + Name 53 "param" + Name 55 "param" Decorate 38(outStream.position) BuiltIn Position - Decorate 43(outStream) Location 0 - Decorate 53(vin) Location 0 + Decorate 41(outStream.color) Location 0 + Decorate 45(outStream.uv) Location 1 + Decorate 50(vin) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -239,25 +228,24 @@ output primitive = triangle_strip 33: 22(int) Constant 0 37: TypePointer Output 7(fvec4) 38(outStream.position): 37(ptr) Variable Output - 41(PS_IN): TypeStruct 7(fvec4) 8(fvec2) - 42: TypePointer Output 41(PS_IN) - 43(outStream): 42(ptr) Variable Output - 49: TypePointer Output 8(fvec2) - 52: TypePointer Input 12 - 53(vin): 52(ptr) Variable Input +41(outStream.color): 37(ptr) Variable Output + 44: TypePointer Output 8(fvec2) +45(outStream.uv): 44(ptr) Variable Output + 49: TypePointer Input 12 + 50(vin): 49(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 51(vin): 13(ptr) Variable Function - 55(outStream): 15(ptr) Variable Function - 56(param): 13(ptr) Variable Function - 58(param): 15(ptr) Variable Function - 54: 12 Load 53(vin) - Store 51(vin) 54 - 57: 12 Load 51(vin) - Store 56(param) 57 - 59: 2 FunctionCall 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;) 56(param) 58(param) - 60: 14(PS_IN) Load 58(param) - Store 55(outStream) 60 + 48(vin): 13(ptr) Variable Function + 52(outStream): 15(ptr) Variable Function + 53(param): 13(ptr) Variable Function + 55(param): 15(ptr) Variable Function + 51: 12 Load 50(vin) + Store 48(vin) 51 + 54: 12 Load 48(vin) + Store 53(param) 54 + 56: 2 FunctionCall 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;) 53(param) 55(param) + 57: 14(PS_IN) Load 55(param) + Store 52(outStream) 57 Return FunctionEnd 19(@main(struct-VertexData-vf4-vf4-vf21[2];struct-PS_IN-vf4-vf4-vf21;): 2 Function None 16 @@ -280,14 +268,12 @@ output primitive = triangle_strip 39: 24(ptr) AccessChain 21(vout) 33 40: 7(fvec4) Load 39 Store 38(outStream.position) 40 - 44: 24(ptr) AccessChain 21(vout) 23 - 45: 7(fvec4) Load 44 - 46: 37(ptr) AccessChain 43(outStream) 33 - Store 46 45 - 47: 29(ptr) AccessChain 21(vout) 28 - 48: 8(fvec2) Load 47 - 50: 49(ptr) AccessChain 43(outStream) 23 - Store 50 48 + 42: 24(ptr) AccessChain 21(vout) 23 + 43: 7(fvec4) Load 42 + Store 41(outStream.color) 43 + 46: 29(ptr) AccessChain 21(vout) 28 + 47: 8(fvec2) Load 46 + Store 45(outStream.uv) 47 EmitVertex Return FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out b/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out index cb12ba5d3..efe5fe3c1 100644 --- a/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out @@ -138,7 +138,7 @@ local_size = (256, 1, 1) // Id's are bound by 61 Capability Shader - Capability SampledBuffer + Capability ImageBuffer Capability StorageImageExtendedFormats 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out b/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out index 11a3e429a..accd7933f 100755 --- a/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out +++ b/3rdparty/glslang/Test/baseResults/hlsl.structin.vert.out @@ -125,15 +125,24 @@ Shader version: 500 0:? 'd' ( temp 4-component vector of float) 0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) 0:? 'e' ( temp 4-component vector of float) -0:8 move second child to first child ( temp 2-element array of 4-component vector of float) -0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) -0:8 '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) 0:8 Constant: 0:8 0 (const int) -0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) -0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) 0:8 Constant: -0:8 0 (const int) +0:8 1 (const int) 0:8 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) 0:8 coord: direct index for structure ( temp 4-component vector of float) @@ -141,17 +150,16 @@ Shader version: 500 0:8 Constant: 0:8 1 (const int) 0:8 move second child to first child ( temp 4-component vector of float) -0:8 b: direct index for structure ( smooth temp 4-component vector of float) -0:8 '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b}) -0:8 Constant: -0:8 1 (const int) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) 0:8 b: direct index for structure ( temp 4-component vector of float) 0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) 0:8 Constant: 0:8 2 (const int) 0:? Linker Objects 0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b}) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) 0:? 'd' (layout( location=0) in 4-component vector of float) 0:? 'vi.m[0]' (layout( location=1) in 4-component vector of float) 0:? 'vi.m[1]' (layout( location=2) in 4-component vector of float) @@ -289,15 +297,24 @@ Shader version: 500 0:? 'd' ( temp 4-component vector of float) 0:? 'vi' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) 0:? 'e' ( temp 4-component vector of float) -0:8 move second child to first child ( temp 2-element array of 4-component vector of float) -0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) -0:8 '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) 0:8 Constant: 0:8 0 (const int) -0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) -0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:8 direct index ( temp 4-component vector of float) +0:8 m: direct index for structure ( temp 2-element array of 4-component vector of float) +0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) +0:8 Constant: +0:8 0 (const int) 0:8 Constant: -0:8 0 (const int) +0:8 1 (const int) 0:8 move second child to first child ( temp 4-component vector of float) 0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) 0:8 coord: direct index for structure ( temp 4-component vector of float) @@ -305,17 +322,16 @@ Shader version: 500 0:8 Constant: 0:8 1 (const int) 0:8 move second child to first child ( temp 4-component vector of float) -0:8 b: direct index for structure ( smooth temp 4-component vector of float) -0:8 '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b}) -0:8 Constant: -0:8 1 (const int) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) 0:8 b: direct index for structure ( temp 4-component vector of float) 0:8 'flattenTemp' ( temp structure{ temp 2-element array of 4-component vector of float m, temp 4-component vector of float coord, temp 4-component vector of float b}) 0:8 Constant: 0:8 2 (const int) 0:? Linker Objects 0:? '@entryPointOutput.coord' ( out 4-component vector of float Position) -0:? '@entryPointOutput' (layout( location=0) out structure{ temp 2-element array of 4-component vector of float m, smooth temp 4-component vector of float b}) +0:? '@entryPointOutput.m[0]' (layout( location=0) out 4-component vector of float) +0:? '@entryPointOutput.m[1]' (layout( location=1) out 4-component vector of float) +0:? '@entryPointOutput.b' (layout( location=2) smooth out 4-component vector of float) 0:? 'd' (layout( location=0) in 4-component vector of float) 0:? 'vi.m[0]' (layout( location=1) in 4-component vector of float) 0:? 'vi.m[1]' (layout( location=2) in 4-component vector of float) @@ -325,12 +341,12 @@ Shader version: 500 // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 96 +// Id's are bound by 94 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 55 58 61 64 67 71 83 90 + EntryPoint Vertex 4 "main" 55 58 61 64 67 71 82 85 88 91 Source HLSL 500 Name 4 "main" Name 12 "VI" @@ -355,19 +371,20 @@ Shader version: 500 Name 74 "param" Name 76 "param" Name 78 "param" - Name 81 "VI" - MemberName 81(VI) 0 "m" - MemberName 81(VI) 1 "b" - Name 83 "@entryPointOutput" - Name 90 "@entryPointOutput.coord" + Name 82 "@entryPointOutput.m[0]" + Name 85 "@entryPointOutput.m[1]" + Name 88 "@entryPointOutput.coord" + Name 91 "@entryPointOutput.b" Decorate 55(d) Location 0 Decorate 58(vi.m[0]) Location 1 Decorate 61(vi.m[1]) Location 2 Decorate 64(vi.coord) Location 3 Decorate 67(vi.b) Location 4 Decorate 71(e) Location 5 - Decorate 83(@entryPointOutput) Location 0 - Decorate 90(@entryPointOutput.coord) BuiltIn Position + Decorate 82(@entryPointOutput.m[0]) Location 0 + Decorate 85(@entryPointOutput.m[1]) Location 1 + Decorate 88(@entryPointOutput.coord) BuiltIn Position + Decorate 91(@entryPointOutput.b) Location 2 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -398,13 +415,11 @@ Shader version: 500 64(vi.coord): 54(ptr) Variable Input 67(vi.b): 54(ptr) Variable Input 71(e): 54(ptr) Variable Input - 81(VI): TypeStruct 11 7(fvec4) - 82: TypePointer Output 81(VI) -83(@entryPointOutput): 82(ptr) Variable Output - 84: TypePointer Function 11 - 87: TypePointer Output 11 - 89: TypePointer Output 7(fvec4) -90(@entryPointOutput.coord): 89(ptr) Variable Output + 81: TypePointer Output 7(fvec4) +82(@entryPointOutput.m[0]): 81(ptr) Variable Output +85(@entryPointOutput.m[1]): 81(ptr) Variable Output +88(@entryPointOutput.coord): 81(ptr) Variable Output +91(@entryPointOutput.b): 81(ptr) Variable Output 4(main): 2 Function None 3 5: Label 53(d): 8(ptr) Variable Function @@ -438,17 +453,18 @@ Shader version: 500 Store 78(param) 79 80: 12(VI) FunctionCall 18(@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;) 74(param) 76(param) 78(param) Store 73(flattenTemp) 80 - 85: 84(ptr) AccessChain 73(flattenTemp) 23 - 86: 11 Load 85 - 88: 87(ptr) AccessChain 83(@entryPointOutput) 23 - Store 88 86 - 91: 8(ptr) AccessChain 73(flattenTemp) 24 - 92: 7(fvec4) Load 91 - Store 90(@entryPointOutput.coord) 92 - 93: 8(ptr) AccessChain 73(flattenTemp) 22 - 94: 7(fvec4) Load 93 - 95: 89(ptr) AccessChain 83(@entryPointOutput) 24 - Store 95 94 + 83: 8(ptr) AccessChain 73(flattenTemp) 23 23 + 84: 7(fvec4) Load 83 + Store 82(@entryPointOutput.m[0]) 84 + 86: 8(ptr) AccessChain 73(flattenTemp) 23 24 + 87: 7(fvec4) Load 86 + Store 85(@entryPointOutput.m[1]) 87 + 89: 8(ptr) AccessChain 73(flattenTemp) 24 + 90: 7(fvec4) Load 89 + Store 88(@entryPointOutput.coord) 90 + 92: 8(ptr) AccessChain 73(flattenTemp) 22 + 93: 7(fvec4) Load 92 + Store 91(@entryPointOutput.b) 93 Return FunctionEnd 18(@main(vf4;struct-VI-vf4[2]-vf4-vf41;vf4;): 12(VI) Function None 14 diff --git a/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out b/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out new file mode 100644 index 000000000..09af45153 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/hlsl.texture.struct.frag.out @@ -0,0 +1,1184 @@ +hlsl.texture.struct.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:38 Function Definition: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Function Parameters: +0:38 't1' ( in texture2D) +0:? Sequence +0:38 Branch: Return with expression +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler2D) +0:38 't1' ( in texture2D) +0:38 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:38 move second child to first child ( temp float) +0:38 c0: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 0 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 0 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 1 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 2 (const uint) +0:38 move second child to first child ( temp float) +0:38 c2: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 2 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 3 (const uint) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:39 Function Definition: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Function Parameters: +0:39 't2' ( in texture2D) +0:? Sequence +0:39 Branch: Return with expression +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler2D) +0:39 't2' ( in texture2D) +0:39 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:39 move second child to first child ( temp float) +0:39 c0: direct index for structure ( temp float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 0 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 1 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 1 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 2 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 2 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 3 (const uint) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:42 Function Definition: @main( ( temp 4-component vector of float) +0:42 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 's1' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp sampler2D) +0:43 'g_tTex2s1' ( uniform texture2D) +0:43 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.110000 +0:43 move second child to first child ( temp float) +0:43 c0: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 0 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 0 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 1 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 2 (const uint) +0:43 move second child to first child ( temp float) +0:43 c2: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 2 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 3 (const uint) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:44 Sequence +0:44 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 's2' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp sampler2D) +0:44 'g_tTex2s2' ( uniform texture2D) +0:44 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.210000 +0:44 move second child to first child ( temp float) +0:44 c0: direct index for structure ( temp float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 0 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 1 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 1 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 2 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 3 (const uint) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 's3' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2D) +0:45 'g_tTex2s3' ( uniform texture2D) +0:45 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.310000 +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 0 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 1 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c1: direct index for structure ( temp 1-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 2 (const uint) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:46 Sequence +0:46 move second child to first child ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 's4' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:? texture ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2D) +0:46 'g_tTex2s4' ( uniform itexture2D) +0:46 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.410000 +0:46 move second child to first child ( temp int) +0:46 c0: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 0 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 0 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 1 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 2 (const uint) +0:46 move second child to first child ( temp int) +0:46 c2: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 2 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 3 (const uint) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:47 Sequence +0:47 move second child to first child ( temp structure{ temp uint c0, temp uint c1}) +0:47 's5' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:? texture ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2D) +0:47 'g_tTex2s5' ( uniform utexture2D) +0:47 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.510000 +0:47 move second child to first child ( temp uint) +0:47 c0: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 0 (const uint) +0:47 move second child to first child ( temp uint) +0:47 c1: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 1 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 1 (const uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:49 Sequence +0:49 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'r0' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'g_tTex2s1' ( uniform texture2D) +0:50 Sequence +0:50 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'r1' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 Function Call: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'g_tTex2s2' ( uniform texture2D) +0:51 Sequence +0:51 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'r2' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'g_tTex2s1a' ( uniform texture2D) +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:42 Function Definition: main( ( temp void) +0:42 Function Parameters: +0:? Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:42 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_sSamp' ( uniform sampler) +0:? 'g_tTex2s1' ( uniform texture2D) +0:? 'g_tTex2s2' ( uniform texture2D) +0:? 'g_tTex2s3' ( uniform texture2D) +0:? 'g_tTex2s4' ( uniform itexture2D) +0:? 'g_tTex2s5' ( uniform utexture2D) +0:? 'g_tTex2s1a' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:38 Function Definition: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Function Parameters: +0:38 't1' ( in texture2D) +0:? Sequence +0:38 Branch: Return with expression +0:38 Sequence +0:38 move second child to first child ( temp 4-component vector of float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:38 Construct combined texture-sampler ( temp sampler2D) +0:38 't1' ( in texture2D) +0:38 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:38 move second child to first child ( temp float) +0:38 c0: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 0 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 0 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 0 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 1 (const uint) +0:38 move second child to first child ( temp float) +0:38 direct index ( temp float) +0:38 c1: direct index for structure ( temp 2-component vector of float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 1 (const uint) +0:38 Constant: +0:38 1 (const int) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 2 (const uint) +0:38 move second child to first child ( temp float) +0:38 c2: direct index for structure ( temp float) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:38 Constant: +0:38 2 (const uint) +0:38 direct index ( temp float) +0:38 '@sampleResultShadow' ( temp 4-component vector of float) +0:38 Constant: +0:38 3 (const uint) +0:38 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:39 Function Definition: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Function Parameters: +0:39 't2' ( in texture2D) +0:? Sequence +0:39 Branch: Return with expression +0:39 Sequence +0:39 move second child to first child ( temp 4-component vector of float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:39 Construct combined texture-sampler ( temp sampler2D) +0:39 't2' ( in texture2D) +0:39 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.600000 +0:? 0.610000 +0:39 move second child to first child ( temp float) +0:39 c0: direct index for structure ( temp float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 0 (const uint) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 0 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 0 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 1 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 1 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 2 (const uint) +0:39 move second child to first child ( temp float) +0:39 direct index ( temp float) +0:39 c1: direct index for structure ( temp 3-component vector of float) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:39 Constant: +0:39 1 (const uint) +0:39 Constant: +0:39 2 (const int) +0:39 direct index ( temp float) +0:39 '@sampleResultShadow' ( temp 4-component vector of float) +0:39 Constant: +0:39 3 (const uint) +0:39 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:42 Function Definition: @main( ( temp 4-component vector of float) +0:42 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 's1' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Sequence +0:43 move second child to first child ( temp 4-component vector of float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:43 Construct combined texture-sampler ( temp sampler2D) +0:43 'g_tTex2s1' ( uniform texture2D) +0:43 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.100000 +0:? 0.110000 +0:43 move second child to first child ( temp float) +0:43 c0: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 0 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 0 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 0 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 1 (const uint) +0:43 move second child to first child ( temp float) +0:43 direct index ( temp float) +0:43 c1: direct index for structure ( temp 2-component vector of float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 1 (const uint) +0:43 Constant: +0:43 1 (const int) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 2 (const uint) +0:43 move second child to first child ( temp float) +0:43 c2: direct index for structure ( temp float) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:43 Constant: +0:43 2 (const uint) +0:43 direct index ( temp float) +0:43 '@sampleResultShadow' ( temp 4-component vector of float) +0:43 Constant: +0:43 3 (const uint) +0:43 '@sampleStructTemp' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:44 Sequence +0:44 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 's2' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Sequence +0:44 move second child to first child ( temp 4-component vector of float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:44 Construct combined texture-sampler ( temp sampler2D) +0:44 'g_tTex2s2' ( uniform texture2D) +0:44 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.200000 +0:? 0.210000 +0:44 move second child to first child ( temp float) +0:44 c0: direct index for structure ( temp float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 0 (const uint) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 0 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 0 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 1 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 1 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 2 (const uint) +0:44 move second child to first child ( temp float) +0:44 direct index ( temp float) +0:44 c1: direct index for structure ( temp 3-component vector of float) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:44 Constant: +0:44 1 (const uint) +0:44 Constant: +0:44 2 (const int) +0:44 direct index ( temp float) +0:44 '@sampleResultShadow' ( temp 4-component vector of float) +0:44 Constant: +0:44 3 (const uint) +0:44 '@sampleStructTemp' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 's3' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Sequence +0:45 move second child to first child ( temp 4-component vector of float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:? texture ( temp 4-component vector of float) +0:45 Construct combined texture-sampler ( temp sampler2D) +0:45 'g_tTex2s3' ( uniform texture2D) +0:45 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.300000 +0:? 0.310000 +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 0 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c0: direct index for structure ( temp 2-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 0 (const uint) +0:45 Constant: +0:45 1 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 1 (const uint) +0:45 move second child to first child ( temp float) +0:45 direct index ( temp float) +0:45 c1: direct index for structure ( temp 1-component vector of float) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:45 Constant: +0:45 1 (const uint) +0:45 Constant: +0:45 0 (const int) +0:45 direct index ( temp float) +0:45 '@sampleResultShadow' ( temp 4-component vector of float) +0:45 Constant: +0:45 2 (const uint) +0:45 '@sampleStructTemp' ( temp structure{ temp 2-component vector of float c0, temp 1-component vector of float c1}) +0:46 Sequence +0:46 move second child to first child ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 's4' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Sequence +0:46 move second child to first child ( temp 4-component vector of int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:? texture ( temp 4-component vector of int) +0:46 Construct combined texture-sampler ( temp isampler2D) +0:46 'g_tTex2s4' ( uniform itexture2D) +0:46 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.400000 +0:? 0.410000 +0:46 move second child to first child ( temp int) +0:46 c0: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 0 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 0 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 0 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 1 (const uint) +0:46 move second child to first child ( temp float) +0:46 direct index ( temp float) +0:46 c1: direct index for structure ( temp 2-component vector of int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1 (const int) +0:46 Convert int to float ( temp float) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 2 (const uint) +0:46 move second child to first child ( temp int) +0:46 c2: direct index for structure ( temp int) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:46 Constant: +0:46 2 (const uint) +0:46 direct index ( temp int) +0:46 '@sampleResultShadow' ( temp 4-component vector of int) +0:46 Constant: +0:46 3 (const uint) +0:46 '@sampleStructTemp' ( temp structure{ temp int c0, temp 2-component vector of int c1, temp int c2}) +0:47 Sequence +0:47 move second child to first child ( temp structure{ temp uint c0, temp uint c1}) +0:47 's5' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Sequence +0:47 move second child to first child ( temp 4-component vector of uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:? texture ( temp 4-component vector of uint) +0:47 Construct combined texture-sampler ( temp usampler2D) +0:47 'g_tTex2s5' ( uniform utexture2D) +0:47 'g_sSamp' ( uniform sampler) +0:? Constant: +0:? 0.500000 +0:? 0.510000 +0:47 move second child to first child ( temp uint) +0:47 c0: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 0 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 0 (const uint) +0:47 move second child to first child ( temp uint) +0:47 c1: direct index for structure ( temp uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:47 Constant: +0:47 1 (const uint) +0:47 direct index ( temp uint) +0:47 '@sampleResultShadow' ( temp 4-component vector of uint) +0:47 Constant: +0:47 1 (const uint) +0:47 '@sampleStructTemp' ( temp structure{ temp uint c0, temp uint c1}) +0:49 Sequence +0:49 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'r0' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:49 'g_tTex2s1' ( uniform texture2D) +0:50 Sequence +0:50 move second child to first child ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'r1' ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 Function Call: fn1(t2-tx-struct1-1; ( temp structure{ temp float c0, temp 3-component vector of float c1}) +0:50 'g_tTex2s2' ( uniform texture2D) +0:51 Sequence +0:51 move second child to first child ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'r2' ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 Function Call: fn1(t2-tx-struct0-1; ( temp structure{ temp float c0, temp 2-component vector of float c1, temp float c2}) +0:51 'g_tTex2s1a' ( uniform texture2D) +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:53 0.000000 +0:42 Function Definition: main( ( temp void) +0:42 Function Parameters: +0:? Sequence +0:42 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:42 Function Call: @main( ( temp 4-component vector of float) +0:? Linker Objects +0:? 'g_sSamp' ( uniform sampler) +0:? 'g_tTex2s1' ( uniform texture2D) +0:? 'g_tTex2s2' ( uniform texture2D) +0:? 'g_tTex2s3' ( uniform texture2D) +0:? 'g_tTex2s4' ( uniform itexture2D) +0:? 'g_tTex2s5' ( uniform utexture2D) +0:? 'g_tTex2s1a' ( uniform texture2D) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 233 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 231 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 10 "s1_t" + MemberName 10(s1_t) 0 "c0" + MemberName 10(s1_t) 1 "c1" + MemberName 10(s1_t) 2 "c2" + Name 13 "fn1(t2-tx-struct0-1;" + Name 12 "t1" + Name 16 "s2_t" + MemberName 16(s2_t) 0 "c0" + MemberName 16(s2_t) 1 "c1" + Name 19 "fn1(t2-tx-struct1-1;" + Name 18 "t2" + Name 23 "@main(" + Name 26 "@sampleResultShadow" + Name 30 "g_sSamp" + Name 39 "@sampleStructTemp" + Name 65 "@sampleResultShadow" + Name 71 "@sampleStructTemp" + Name 87 "s1" + Name 88 "@sampleResultShadow" + Name 89 "g_tTex2s1" + Name 97 "@sampleStructTemp" + Name 111 "s2" + Name 112 "@sampleResultShadow" + Name 113 "g_tTex2s2" + Name 121 "@sampleStructTemp" + Name 135 "s3_t" + MemberName 135(s3_t) 0 "c0" + MemberName 135(s3_t) 1 "c1" + Name 137 "s3" + Name 138 "@sampleResultShadow" + Name 139 "g_tTex2s3" + Name 147 "@sampleStructTemp" + Name 159 "s4_t" + MemberName 159(s4_t) 0 "c0" + MemberName 159(s4_t) 1 "c1" + MemberName 159(s4_t) 2 "c2" + Name 161 "s4" + Name 164 "@sampleResultShadow" + Name 167 "g_tTex2s4" + Name 176 "@sampleStructTemp" + Name 193 "s5_t" + MemberName 193(s5_t) 0 "c0" + MemberName 193(s5_t) 1 "c1" + Name 195 "s5" + Name 198 "@sampleResultShadow" + Name 201 "g_tTex2s5" + Name 210 "@sampleStructTemp" + Name 219 "r0" + Name 221 "r1" + Name 223 "r2" + Name 224 "g_tTex2s1a" + Name 231 "@entryPointOutput" + Decorate 30(g_sSamp) DescriptorSet 0 + Decorate 89(g_tTex2s1) DescriptorSet 0 + Decorate 113(g_tTex2s2) DescriptorSet 0 + Decorate 139(g_tTex2s3) DescriptorSet 0 + Decorate 167(g_tTex2s4) DescriptorSet 0 + Decorate 201(g_tTex2s5) DescriptorSet 0 + Decorate 224(g_tTex2s1a) DescriptorSet 0 + Decorate 231(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeImage 6(float) 2D sampled format:Unknown + 8: TypePointer UniformConstant 7 + 9: TypeVector 6(float) 2 + 10(s1_t): TypeStruct 6(float) 9(fvec2) 6(float) + 11: TypeFunction 10(s1_t) 8(ptr) + 15: TypeVector 6(float) 3 + 16(s2_t): TypeStruct 6(float) 15(fvec3) + 17: TypeFunction 16(s2_t) 8(ptr) + 21: TypeVector 6(float) 4 + 22: TypeFunction 21(fvec4) + 25: TypePointer Function 21(fvec4) + 28: TypeSampler + 29: TypePointer UniformConstant 28 + 30(g_sSamp): 29(ptr) Variable UniformConstant + 32: TypeSampledImage 7 + 34: 6(float) Constant 1058642330 + 35: 6(float) Constant 1058810102 + 36: 9(fvec2) ConstantComposite 34 35 + 38: TypePointer Function 10(s1_t) + 40: TypeInt 32 1 + 41: 40(int) Constant 0 + 42: TypeInt 32 0 + 43: 42(int) Constant 0 + 44: TypePointer Function 6(float) + 48: 40(int) Constant 1 + 49: 42(int) Constant 1 + 53: 42(int) Constant 2 + 57: 40(int) Constant 2 + 58: 42(int) Constant 3 + 70: TypePointer Function 16(s2_t) + 89(g_tTex2s1): 8(ptr) Variable UniformConstant + 93: 6(float) Constant 1036831949 + 94: 6(float) Constant 1038174126 + 95: 9(fvec2) ConstantComposite 93 94 + 113(g_tTex2s2): 8(ptr) Variable UniformConstant + 117: 6(float) Constant 1045220557 + 118: 6(float) Constant 1045891645 + 119: 9(fvec2) ConstantComposite 117 118 + 135(s3_t): TypeStruct 9(fvec2) 6(float) + 136: TypePointer Function 135(s3_t) + 139(g_tTex2s3): 8(ptr) Variable UniformConstant + 143: 6(float) Constant 1050253722 + 144: 6(float) Constant 1050589266 + 145: 9(fvec2) ConstantComposite 143 144 + 158: TypeVector 40(int) 2 + 159(s4_t): TypeStruct 40(int) 158(ivec2) 40(int) + 160: TypePointer Function 159(s4_t) + 162: TypeVector 40(int) 4 + 163: TypePointer Function 162(ivec4) + 165: TypeImage 40(int) 2D sampled format:Unknown + 166: TypePointer UniformConstant 165 + 167(g_tTex2s4): 166(ptr) Variable UniformConstant + 170: TypeSampledImage 165 + 172: 6(float) Constant 1053609165 + 173: 6(float) Constant 1053944709 + 174: 9(fvec2) ConstantComposite 172 173 + 177: TypePointer Function 40(int) + 193(s5_t): TypeStruct 42(int) 42(int) + 194: TypePointer Function 193(s5_t) + 196: TypeVector 42(int) 4 + 197: TypePointer Function 196(ivec4) + 199: TypeImage 42(int) 2D sampled format:Unknown + 200: TypePointer UniformConstant 199 + 201(g_tTex2s5): 200(ptr) Variable UniformConstant + 204: TypeSampledImage 199 + 206: 6(float) Constant 1056964608 + 207: 6(float) Constant 1057132380 + 208: 9(fvec2) ConstantComposite 206 207 + 211: TypePointer Function 42(int) + 224(g_tTex2s1a): 8(ptr) Variable UniformConstant + 226: 6(float) Constant 0 + 227: 21(fvec4) ConstantComposite 226 226 226 226 + 230: TypePointer Output 21(fvec4) +231(@entryPointOutput): 230(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 232: 21(fvec4) FunctionCall 23(@main() + Store 231(@entryPointOutput) 232 + Return + FunctionEnd +13(fn1(t2-tx-struct0-1;): 10(s1_t) Function None 11 + 12(t1): 8(ptr) FunctionParameter + 14: Label +26(@sampleResultShadow): 25(ptr) Variable Function +39(@sampleStructTemp): 38(ptr) Variable Function + 27: 7 Load 12(t1) + 31: 28 Load 30(g_sSamp) + 33: 32 SampledImage 27 31 + 37: 21(fvec4) ImageSampleImplicitLod 33 36 + Store 26(@sampleResultShadow) 37 + 45: 44(ptr) AccessChain 26(@sampleResultShadow) 43 + 46: 6(float) Load 45 + 47: 44(ptr) AccessChain 39(@sampleStructTemp) 41 + Store 47 46 + 50: 44(ptr) AccessChain 26(@sampleResultShadow) 49 + 51: 6(float) Load 50 + 52: 44(ptr) AccessChain 39(@sampleStructTemp) 48 43 + Store 52 51 + 54: 44(ptr) AccessChain 26(@sampleResultShadow) 53 + 55: 6(float) Load 54 + 56: 44(ptr) AccessChain 39(@sampleStructTemp) 48 49 + Store 56 55 + 59: 44(ptr) AccessChain 26(@sampleResultShadow) 58 + 60: 6(float) Load 59 + 61: 44(ptr) AccessChain 39(@sampleStructTemp) 57 + Store 61 60 + 62: 10(s1_t) Load 39(@sampleStructTemp) + ReturnValue 62 + FunctionEnd +19(fn1(t2-tx-struct1-1;): 16(s2_t) Function None 17 + 18(t2): 8(ptr) FunctionParameter + 20: Label +65(@sampleResultShadow): 25(ptr) Variable Function +71(@sampleStructTemp): 70(ptr) Variable Function + 66: 7 Load 18(t2) + 67: 28 Load 30(g_sSamp) + 68: 32 SampledImage 66 67 + 69: 21(fvec4) ImageSampleImplicitLod 68 36 + Store 65(@sampleResultShadow) 69 + 72: 44(ptr) AccessChain 65(@sampleResultShadow) 43 + 73: 6(float) Load 72 + 74: 44(ptr) AccessChain 71(@sampleStructTemp) 41 + Store 74 73 + 75: 44(ptr) AccessChain 65(@sampleResultShadow) 49 + 76: 6(float) Load 75 + 77: 44(ptr) AccessChain 71(@sampleStructTemp) 48 43 + Store 77 76 + 78: 44(ptr) AccessChain 65(@sampleResultShadow) 53 + 79: 6(float) Load 78 + 80: 44(ptr) AccessChain 71(@sampleStructTemp) 48 49 + Store 80 79 + 81: 44(ptr) AccessChain 65(@sampleResultShadow) 58 + 82: 6(float) Load 81 + 83: 44(ptr) AccessChain 71(@sampleStructTemp) 48 53 + Store 83 82 + 84: 16(s2_t) Load 71(@sampleStructTemp) + ReturnValue 84 + FunctionEnd + 23(@main(): 21(fvec4) Function None 22 + 24: Label + 87(s1): 38(ptr) Variable Function +88(@sampleResultShadow): 25(ptr) Variable Function +97(@sampleStructTemp): 38(ptr) Variable Function + 111(s2): 70(ptr) Variable Function +112(@sampleResultShadow): 25(ptr) Variable Function +121(@sampleStructTemp): 70(ptr) Variable Function + 137(s3): 136(ptr) Variable Function +138(@sampleResultShadow): 25(ptr) Variable Function +147(@sampleStructTemp): 136(ptr) Variable Function + 161(s4): 160(ptr) Variable Function +164(@sampleResultShadow): 163(ptr) Variable Function +176(@sampleStructTemp): 160(ptr) Variable Function + 195(s5): 194(ptr) Variable Function +198(@sampleResultShadow): 197(ptr) Variable Function +210(@sampleStructTemp): 194(ptr) Variable Function + 219(r0): 38(ptr) Variable Function + 221(r1): 70(ptr) Variable Function + 223(r2): 38(ptr) Variable Function + 90: 7 Load 89(g_tTex2s1) + 91: 28 Load 30(g_sSamp) + 92: 32 SampledImage 90 91 + 96: 21(fvec4) ImageSampleImplicitLod 92 95 + Store 88(@sampleResultShadow) 96 + 98: 44(ptr) AccessChain 88(@sampleResultShadow) 43 + 99: 6(float) Load 98 + 100: 44(ptr) AccessChain 97(@sampleStructTemp) 41 + Store 100 99 + 101: 44(ptr) AccessChain 88(@sampleResultShadow) 49 + 102: 6(float) Load 101 + 103: 44(ptr) AccessChain 97(@sampleStructTemp) 48 43 + Store 103 102 + 104: 44(ptr) AccessChain 88(@sampleResultShadow) 53 + 105: 6(float) Load 104 + 106: 44(ptr) AccessChain 97(@sampleStructTemp) 48 49 + Store 106 105 + 107: 44(ptr) AccessChain 88(@sampleResultShadow) 58 + 108: 6(float) Load 107 + 109: 44(ptr) AccessChain 97(@sampleStructTemp) 57 + Store 109 108 + 110: 10(s1_t) Load 97(@sampleStructTemp) + Store 87(s1) 110 + 114: 7 Load 113(g_tTex2s2) + 115: 28 Load 30(g_sSamp) + 116: 32 SampledImage 114 115 + 120: 21(fvec4) ImageSampleImplicitLod 116 119 + Store 112(@sampleResultShadow) 120 + 122: 44(ptr) AccessChain 112(@sampleResultShadow) 43 + 123: 6(float) Load 122 + 124: 44(ptr) AccessChain 121(@sampleStructTemp) 41 + Store 124 123 + 125: 44(ptr) AccessChain 112(@sampleResultShadow) 49 + 126: 6(float) Load 125 + 127: 44(ptr) AccessChain 121(@sampleStructTemp) 48 43 + Store 127 126 + 128: 44(ptr) AccessChain 112(@sampleResultShadow) 53 + 129: 6(float) Load 128 + 130: 44(ptr) AccessChain 121(@sampleStructTemp) 48 49 + Store 130 129 + 131: 44(ptr) AccessChain 112(@sampleResultShadow) 58 + 132: 6(float) Load 131 + 133: 44(ptr) AccessChain 121(@sampleStructTemp) 48 53 + Store 133 132 + 134: 16(s2_t) Load 121(@sampleStructTemp) + Store 111(s2) 134 + 140: 7 Load 139(g_tTex2s3) + 141: 28 Load 30(g_sSamp) + 142: 32 SampledImage 140 141 + 146: 21(fvec4) ImageSampleImplicitLod 142 145 + Store 138(@sampleResultShadow) 146 + 148: 44(ptr) AccessChain 138(@sampleResultShadow) 43 + 149: 6(float) Load 148 + 150: 44(ptr) AccessChain 147(@sampleStructTemp) 41 43 + Store 150 149 + 151: 44(ptr) AccessChain 138(@sampleResultShadow) 49 + 152: 6(float) Load 151 + 153: 44(ptr) AccessChain 147(@sampleStructTemp) 41 49 + Store 153 152 + 154: 44(ptr) AccessChain 138(@sampleResultShadow) 53 + 155: 6(float) Load 154 + 156: 44(ptr) AccessChain 147(@sampleStructTemp) 48 + Store 156 155 + 157: 135(s3_t) Load 147(@sampleStructTemp) + Store 137(s3) 157 + 168: 165 Load 167(g_tTex2s4) + 169: 28 Load 30(g_sSamp) + 171: 170 SampledImage 168 169 + 175: 162(ivec4) ImageSampleImplicitLod 171 174 + Store 164(@sampleResultShadow) 175 + 178: 177(ptr) AccessChain 164(@sampleResultShadow) 43 + 179: 40(int) Load 178 + 180: 177(ptr) AccessChain 176(@sampleStructTemp) 41 + Store 180 179 + 181: 177(ptr) AccessChain 164(@sampleResultShadow) 49 + 182: 40(int) Load 181 + 183: 6(float) ConvertSToF 182 + 184: 177(ptr) AccessChain 176(@sampleStructTemp) 48 43 + Store 184 183 + 185: 177(ptr) AccessChain 164(@sampleResultShadow) 53 + 186: 40(int) Load 185 + 187: 6(float) ConvertSToF 186 + 188: 177(ptr) AccessChain 176(@sampleStructTemp) 48 49 + Store 188 187 + 189: 177(ptr) AccessChain 164(@sampleResultShadow) 58 + 190: 40(int) Load 189 + 191: 177(ptr) AccessChain 176(@sampleStructTemp) 57 + Store 191 190 + 192: 159(s4_t) Load 176(@sampleStructTemp) + Store 161(s4) 192 + 202: 199 Load 201(g_tTex2s5) + 203: 28 Load 30(g_sSamp) + 205: 204 SampledImage 202 203 + 209: 196(ivec4) ImageSampleImplicitLod 205 208 + Store 198(@sampleResultShadow) 209 + 212: 211(ptr) AccessChain 198(@sampleResultShadow) 43 + 213: 42(int) Load 212 + 214: 211(ptr) AccessChain 210(@sampleStructTemp) 41 + Store 214 213 + 215: 211(ptr) AccessChain 198(@sampleResultShadow) 49 + 216: 42(int) Load 215 + 217: 211(ptr) AccessChain 210(@sampleStructTemp) 48 + Store 217 216 + 218: 193(s5_t) Load 210(@sampleStructTemp) + Store 195(s5) 218 + 220: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 89(g_tTex2s1) + Store 219(r0) 220 + 222: 16(s2_t) FunctionCall 19(fn1(t2-tx-struct1-1;) 113(g_tTex2s2) + Store 221(r1) 222 + 225: 10(s1_t) FunctionCall 13(fn1(t2-tx-struct0-1;) 224(g_tTex2s1a) + Store 223(r2) 225 + ReturnValue 227 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/spv.450.geom.out b/3rdparty/glslang/Test/baseResults/spv.450.geom.out index 4d012c415..9c851c343 100755 --- a/3rdparty/glslang/Test/baseResults/spv.450.geom.out +++ b/3rdparty/glslang/Test/baseResults/spv.450.geom.out @@ -1,13 +1,14 @@ spv.450.geom // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 26 +// Id's are bound by 31 Capability Geometry Capability GeometryPointSize + Capability MultiViewport 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 13 20 + EntryPoint Geometry 4 "main" 13 20 27 29 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 4 ExecutionMode 4 OutputLineStrip @@ -26,6 +27,8 @@ spv.450.geom MemberName 16(gl_PerVertex) 2 "gl_ClipDistance" MemberName 16(gl_PerVertex) 3 "gl_CullDistance" Name 20 "gl_in" + Name 27 "gl_Layer" + Name 29 "gl_ViewportIndex" MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance @@ -36,6 +39,8 @@ spv.450.geom MemberDecorate 16(gl_PerVertex) 2 BuiltIn ClipDistance MemberDecorate 16(gl_PerVertex) 3 BuiltIn CullDistance Decorate 16(gl_PerVertex) Block + Decorate 27(gl_Layer) BuiltIn Layer + Decorate 29(gl_ViewportIndex) BuiltIn ViewportIndex 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -55,11 +60,18 @@ spv.450.geom 20(gl_in): 19(ptr) Variable Input 21: TypePointer Input 6(float) 24: TypePointer Output 6(float) + 26: TypePointer Output 14(int) + 27(gl_Layer): 26(ptr) Variable Output + 28: 14(int) Constant 2 +29(gl_ViewportIndex): 26(ptr) Variable Output + 30: 14(int) Constant 3 4(main): 2 Function None 3 5: Label 22: 21(ptr) AccessChain 20(gl_in) 15 15 23: 6(float) Load 22 25: 24(ptr) AccessChain 13 15 Store 25 23 + Store 27(gl_Layer) 28 + Store 29(gl_ViewportIndex) 30 Return FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/spv.450.tesc.out b/3rdparty/glslang/Test/baseResults/spv.450.tesc.out index 6b4325b95..5ccea066f 100755 --- a/3rdparty/glslang/Test/baseResults/spv.450.tesc.out +++ b/3rdparty/glslang/Test/baseResults/spv.450.tesc.out @@ -1,72 +1,120 @@ spv.450.tesc // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 23 +// Id's are bound by 45 Capability Tessellation 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 9 16 19 22 + EntryPoint TessellationControl 4 "main" 15 18 25 32 38 41 44 ExecutionMode 4 OutputVertices 4 Source GLSL 450 Name 4 "main" - Name 9 "patchOut" - Name 10 "S" - MemberName 10(S) 0 "sMem1" - MemberName 10(S) 1 "sMem2" - Name 11 "TheBlock" - MemberName 11(TheBlock) 0 "bMem1" - MemberName 11(TheBlock) 1 "bMem2" - MemberName 11(TheBlock) 2 "s" - Name 16 "tcBlock" - Name 17 "SingleBlock" - MemberName 17(SingleBlock) 0 "bMem1" - MemberName 17(SingleBlock) 1 "bMem2" - MemberName 17(SingleBlock) 2 "s" - Name 19 "singleBlock" - Name 20 "bn" - MemberName 20(bn) 0 "v1" - MemberName 20(bn) 1 "v2" - MemberName 20(bn) 2 "v3" - Name 22 "" - Decorate 9(patchOut) Patch - MemberDecorate 11(TheBlock) 0 Patch - MemberDecorate 11(TheBlock) 1 Patch - MemberDecorate 11(TheBlock) 2 Patch - Decorate 11(TheBlock) Block - Decorate 16(tcBlock) Location 12 - MemberDecorate 17(SingleBlock) 0 Patch - MemberDecorate 17(SingleBlock) 1 Patch - MemberDecorate 17(SingleBlock) 2 Patch - Decorate 17(SingleBlock) Block - Decorate 19(singleBlock) Location 2 - MemberDecorate 20(bn) 0 Patch - MemberDecorate 20(bn) 0 Location 20 - MemberDecorate 20(bn) 1 Patch - MemberDecorate 20(bn) 1 Location 24 - MemberDecorate 20(bn) 2 Patch - MemberDecorate 20(bn) 2 Location 25 - Decorate 20(bn) Block + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 15 "gl_out" + Name 18 "gl_InvocationID" + Name 21 "gl_PerVertex" + MemberName 21(gl_PerVertex) 0 "gl_Position" + MemberName 21(gl_PerVertex) 1 "gl_PointSize" + MemberName 21(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 21(gl_PerVertex) 3 "gl_CullDistance" + Name 25 "gl_in" + Name 32 "patchOut" + Name 33 "S" + MemberName 33(S) 0 "sMem1" + MemberName 33(S) 1 "sMem2" + Name 34 "TheBlock" + MemberName 34(TheBlock) 0 "bMem1" + MemberName 34(TheBlock) 1 "bMem2" + MemberName 34(TheBlock) 2 "s" + Name 38 "tcBlock" + Name 39 "SingleBlock" + MemberName 39(SingleBlock) 0 "bMem1" + MemberName 39(SingleBlock) 1 "bMem2" + MemberName 39(SingleBlock) 2 "s" + Name 41 "singleBlock" + Name 42 "bn" + MemberName 42(bn) 0 "v1" + MemberName 42(bn) 1 "v2" + MemberName 42(bn) 2 "v3" + Name 44 "" + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + Decorate 18(gl_InvocationID) BuiltIn InvocationId + MemberDecorate 21(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 21(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 21(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 21(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 21(gl_PerVertex) Block + Decorate 32(patchOut) Patch + Decorate 32(patchOut) Location 1 + MemberDecorate 34(TheBlock) 0 Patch + MemberDecorate 34(TheBlock) 1 Patch + MemberDecorate 34(TheBlock) 2 Patch + Decorate 34(TheBlock) Block + Decorate 38(tcBlock) Location 12 + MemberDecorate 39(SingleBlock) 0 Patch + MemberDecorate 39(SingleBlock) 1 Patch + MemberDecorate 39(SingleBlock) 2 Patch + Decorate 39(SingleBlock) Block + Decorate 41(singleBlock) Location 2 + MemberDecorate 42(bn) 0 Patch + MemberDecorate 42(bn) 0 Location 20 + MemberDecorate 42(bn) 1 Patch + MemberDecorate 42(bn) 1 Location 24 + MemberDecorate 42(bn) 2 Patch + MemberDecorate 42(bn) 2 Location 25 + Decorate 42(bn) Block 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 - 8: TypePointer Output 7(fvec4) - 9(patchOut): 8(ptr) Variable Output - 10(S): TypeStruct 6(float) 6(float) - 11(TheBlock): TypeStruct 6(float) 6(float) 10(S) - 12: TypeInt 32 0 - 13: 12(int) Constant 2 - 14: TypeArray 11(TheBlock) 13 - 15: TypePointer Output 14 - 16(tcBlock): 15(ptr) Variable Output - 17(SingleBlock): TypeStruct 6(float) 6(float) 10(S) - 18: TypePointer Output 17(SingleBlock) - 19(singleBlock): 18(ptr) Variable Output - 20(bn): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) - 21: TypePointer Output 20(bn) - 22: 21(ptr) Variable Output + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: 8(int) Constant 4 + 13: TypeArray 11(gl_PerVertex) 12 + 14: TypePointer Output 13 + 15(gl_out): 14(ptr) Variable Output + 16: TypeInt 32 1 + 17: TypePointer Input 16(int) +18(gl_InvocationID): 17(ptr) Variable Input + 20: 16(int) Constant 0 +21(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 22: 8(int) Constant 32 + 23: TypeArray 21(gl_PerVertex) 22 + 24: TypePointer Input 23 + 25(gl_in): 24(ptr) Variable Input + 27: TypePointer Input 7(fvec4) + 30: TypePointer Output 7(fvec4) + 32(patchOut): 30(ptr) Variable Output + 33(S): TypeStruct 6(float) 6(float) + 34(TheBlock): TypeStruct 6(float) 6(float) 33(S) + 35: 8(int) Constant 2 + 36: TypeArray 34(TheBlock) 35 + 37: TypePointer Output 36 + 38(tcBlock): 37(ptr) Variable Output + 39(SingleBlock): TypeStruct 6(float) 6(float) 33(S) + 40: TypePointer Output 39(SingleBlock) + 41(singleBlock): 40(ptr) Variable Output + 42(bn): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) + 43: TypePointer Output 42(bn) + 44: 43(ptr) Variable Output 4(main): 2 Function None 3 5: Label + 19: 16(int) Load 18(gl_InvocationID) + 26: 16(int) Load 18(gl_InvocationID) + 28: 27(ptr) AccessChain 25(gl_in) 26 20 + 29: 7(fvec4) Load 28 + 31: 30(ptr) AccessChain 15(gl_out) 19 20 + Store 31 29 Return FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out b/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out index f501528a5..2e0d1b383 100644 --- a/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.debugInfo.frag.out @@ -7,9 +7,19 @@ spv.debugInfo.frag 2: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 5 "main" 24 52 - ExecutionMode 5 OriginUpperLeft + ExecutionMode 5 OriginLowerLeft 1: String "spv.debugInfo.frag" - Source GLSL 450 1 "#version 450 + Source GLSL 450 1 "// OpModuleProcessed no-storage-format +// OpModuleProcessed resource-set-binding 3 +// OpModuleProcessed auto-map-locations +// OpModuleProcessed client opengl100 +// OpModuleProcessed target-env opengl +// OpModuleProcessed relaxed-errors +// OpModuleProcessed suppress-warnings +// OpModuleProcessed hlsl-offsets +// OpModuleProcessed entry-point main +#line 1 +#version 450 struct S { int a; @@ -84,8 +94,8 @@ void main() MemberDecorate 53(S) 0 Offset 0 MemberDecorate 54(ubuf) 0 Offset 0 Decorate 54(ubuf) Block - Decorate 56 DescriptorSet 0 - Decorate 69(s2d) DescriptorSet 0 + Decorate 56 DescriptorSet 3 + Decorate 69(s2d) DescriptorSet 3 3: TypeVoid 4: TypeFunction 3 7: TypeInt 32 1 diff --git a/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out b/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out new file mode 100644 index 000000000..571e59410 --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/spv.hlslDebugInfo.frag.out @@ -0,0 +1,58 @@ +spv.hlslDebugInfo.vert +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 19 + + Capability Shader + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 5 "newMain" 17 + 1: String "spv.hlslDebugInfo.vert" + Source HLSL 500 1 "// OpModuleProcessed entry-point newMain +// OpModuleProcessed shift-sampler-binding 2 +// OpModuleProcessed shift-texture-binding 4 +// OpModuleProcessed shift-image-binding 1 +// OpModuleProcessed shift-UBO-binding 6 +// OpModuleProcessed shift-ssbo-binding 3 +// OpModuleProcessed shift-uav-binding 5 +// OpModuleProcessed flatten-uniform-arrays +// OpModuleProcessed no-storage-format +// OpModuleProcessed resource-set-binding t0 0 0 +// OpModuleProcessed hlsl-iomap +// OpModuleProcessed auto-map-bindings +// OpModuleProcessed auto-map-locations +// OpModuleProcessed client vulkan100 +// OpModuleProcessed target-env vulkan1.0 +// OpModuleProcessed source-entrypoint origMain +// OpModuleProcessed hlsl-offsets +#line 1 +float4 origMain() : SV_Position +{ + return (float4)0; +} +" + Name 5 "newMain" + Name 10 "@newMain(" + Name 17 "@entryPointOutput" + Decorate 17(@entryPointOutput) BuiltIn Position + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 8: TypeVector 7(float) 4 + 9: TypeFunction 8(fvec4) + 12: 7(float) Constant 0 + 13: 8(fvec4) ConstantComposite 12 12 12 12 + 16: TypePointer Output 8(fvec4) +17(@entryPointOutput): 16(ptr) Variable Output + 5(newMain): 3 Function None 4 + 6: Label + Line 1 2 0 + 18: 8(fvec4) FunctionCall 10(@newMain() + Store 17(@entryPointOutput) 18 + Return + FunctionEnd + 10(@newMain(): 8(fvec4) Function None 9 + 11: Label + Line 1 3 0 + ReturnValue 13 + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/spv.image.frag.out b/3rdparty/glslang/Test/baseResults/spv.image.frag.out index c21f9bf15..d645f2a32 100644 --- a/3rdparty/glslang/Test/baseResults/spv.image.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.image.frag.out @@ -4,10 +4,11 @@ spv.image.frag // Id's are bound by 376 Capability Shader - Capability SampledRect - Capability Sampled1D - Capability SampledCubeArray - Capability SampledBuffer + Capability StorageImageMultisample + Capability ImageCubeArray + Capability ImageRect + Capability Image1D + Capability ImageBuffer Capability ImageMSArray Capability StorageImageExtendedFormats Capability ImageQuery diff --git a/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out b/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out new file mode 100644 index 000000000..0f164304b --- /dev/null +++ b/3rdparty/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out @@ -0,0 +1,135 @@ +spv.imageLoadStoreLod.frag +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 82 + + Capability Shader + Capability ImageCubeArray + Capability SparseResidency + Capability Image1D + Capability ImageReadWriteLodAMD + Extension "SPV_AMD_shader_image_load_store_lod" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 77 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_AMD_shader_image_load_store_lod" + Name 4 "main" + Name 9 "f4" + Name 14 "i1D" + Name 24 "i2D" + Name 34 "i3D" + Name 46 "iiCube" + Name 53 "ii1DArray" + Name 60 "ui2DArray" + Name 64 "u4" + Name 65 "ResType" + Name 71 "uiCubeArray" + Name 77 "fragColor" + Decorate 14(i1D) DescriptorSet 0 + Decorate 14(i1D) Binding 0 + Decorate 24(i2D) DescriptorSet 0 + Decorate 24(i2D) Binding 1 + Decorate 34(i3D) DescriptorSet 0 + Decorate 34(i3D) Binding 2 + Decorate 46(iiCube) DescriptorSet 0 + Decorate 46(iiCube) Binding 3 + Decorate 53(ii1DArray) DescriptorSet 0 + Decorate 53(ii1DArray) Binding 4 + Decorate 60(ui2DArray) DescriptorSet 0 + Decorate 60(ui2DArray) Binding 5 + Decorate 71(uiCubeArray) DescriptorSet 0 + Decorate 71(uiCubeArray) Binding 6 + Decorate 77(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: 6(float) Constant 0 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeImage 6(float) 1D nonsampled format:Rgba32f + 13: TypePointer UniformConstant 12 + 14(i1D): 13(ptr) Variable UniformConstant + 16: TypeInt 32 1 + 17: 16(int) Constant 1 + 18: 16(int) Constant 3 + 22: TypeImage 6(float) 2D nonsampled format:Rgba32f + 23: TypePointer UniformConstant 22 + 24(i2D): 23(ptr) Variable UniformConstant + 26: TypeVector 16(int) 2 + 27: 16(int) Constant 2 + 28: 26(ivec2) ConstantComposite 27 18 + 32: TypeImage 6(float) 3D nonsampled format:Rgba32f + 33: TypePointer UniformConstant 32 + 34(i3D): 33(ptr) Variable UniformConstant + 36: TypeVector 16(int) 3 + 37: 16(int) Constant 4 + 38: 16(int) Constant 5 + 39: 16(int) Constant 6 + 40: 36(ivec3) ConstantComposite 37 38 39 + 44: TypeImage 16(int) Cube nonsampled format:Rgba32i + 45: TypePointer UniformConstant 44 + 46(iiCube): 45(ptr) Variable UniformConstant + 49: TypeVector 16(int) 4 + 51: TypeImage 16(int) 1D array nonsampled format:Rgba32i + 52: TypePointer UniformConstant 51 + 53(ii1DArray): 52(ptr) Variable UniformConstant + 57: TypeInt 32 0 + 58: TypeImage 57(int) 2D array nonsampled format:Rgba32ui + 59: TypePointer UniformConstant 58 + 60(ui2DArray): 59(ptr) Variable UniformConstant + 62: TypeVector 57(int) 4 + 63: TypePointer Function 62(ivec4) + 65(ResType): TypeStruct 16(int) 62(ivec4) + 69: TypeImage 57(int) Cube array nonsampled format:Rgba32ui + 70: TypePointer UniformConstant 69 + 71(uiCubeArray): 70(ptr) Variable UniformConstant + 76: TypePointer Output 7(fvec4) + 77(fragColor): 76(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(f4): 8(ptr) Variable Function + 64(u4): 63(ptr) Variable Function + Store 9(f4) 11 + 15: 12 Load 14(i1D) + 19: 7(fvec4) ImageRead 15 17 Lod 18 + 20: 7(fvec4) Load 9(f4) + 21: 7(fvec4) FAdd 20 19 + Store 9(f4) 21 + 25: 22 Load 24(i2D) + 29: 7(fvec4) ImageRead 25 28 Lod 18 + 30: 7(fvec4) Load 9(f4) + 31: 7(fvec4) FAdd 30 29 + Store 9(f4) 31 + 35: 32 Load 34(i3D) + 41: 7(fvec4) ImageRead 35 40 Lod 18 + 42: 7(fvec4) Load 9(f4) + 43: 7(fvec4) FAdd 42 41 + Store 9(f4) 43 + 47: 44 Load 46(iiCube) + 48: 7(fvec4) Load 9(f4) + 50: 49(ivec4) ConvertFToS 48 + ImageWrite 47 40 50 Lod 18 + 54: 51 Load 53(ii1DArray) + 55: 7(fvec4) Load 9(f4) + 56: 49(ivec4) ConvertFToS 55 + ImageWrite 54 28 56 Lod 18 + 61: 58 Load 60(ui2DArray) + 66: 65(ResType) ImageSparseRead 61 40 Lod 18 + 67: 62(ivec4) CompositeExtract 66 1 + Store 64(u4) 67 + 68: 16(int) CompositeExtract 66 0 + 72: 69 Load 71(uiCubeArray) + 73: 65(ResType) ImageSparseRead 72 40 Lod 18 + 74: 62(ivec4) CompositeExtract 73 1 + Store 64(u4) 74 + 75: 16(int) CompositeExtract 73 0 + 78: 7(fvec4) Load 9(f4) + 79: 62(ivec4) Load 64(u4) + 80: 7(fvec4) ConvertUToF 79 + 81: 7(fvec4) FAdd 78 80 + Store 77(fragColor) 81 + Return + FunctionEnd diff --git a/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out b/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out index 00608680d..c041a5229 100644 --- a/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.memoryQualifier.frag.out @@ -4,8 +4,8 @@ spv.memoryQualifier.frag // Id's are bound by 97 Capability Shader - Capability SampledRect - Capability Sampled1D + Capability ImageRect + Capability Image1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" diff --git a/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out b/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out index 0f2a51d21..6121b9b9a 100644 --- a/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.rw.autoassign.frag.out @@ -4,8 +4,8 @@ spv.rw.autoassign.frag // Id's are bound by 42 Capability Shader - Capability Sampled1D - Capability SampledBuffer + Capability Image1D + Capability ImageBuffer 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 39 diff --git a/3rdparty/glslang/Test/baseResults/spv.separate.frag.out b/3rdparty/glslang/Test/baseResults/spv.separate.frag.out index 5b078afc7..38072426d 100644 --- a/3rdparty/glslang/Test/baseResults/spv.separate.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.separate.frag.out @@ -8,7 +8,6 @@ spv.separate.frag Capability Sampled1D Capability SampledCubeArray Capability SampledBuffer - Capability ImageMSArray 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 11 34 diff --git a/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out b/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out index c0c720952..b0774de92 100644 --- a/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.shaderStencilExport.frag.out @@ -1,10 +1,11 @@ spv.shaderStencilExport.frag -Missing functionality: shader stencil export // Module Version 10000 // Generated by (magic number): 80001 // Id's are bound by 10 Capability Shader + Capability StencilExportEXT + Extension "SPV_EXT_shader_stencil_export" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 8 @@ -13,6 +14,7 @@ Missing functionality: shader stencil export SourceExtension "GL_ARB_shader_stencil_export" Name 4 "main" Name 8 "gl_FragStencilRefARB" + Decorate 8(gl_FragStencilRefARB) BuiltIn FragStencilRefEXT 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 diff --git a/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out b/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out index af3b63ecc..b57b87ca7 100644 --- a/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.sparseTexture.frag.out @@ -4,6 +4,7 @@ spv.sparseTexture.frag // Id's are bound by 438 Capability Shader + Capability StorageImageMultisample Capability SampledRect Capability SparseResidency Capability SampledCubeArray diff --git a/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out b/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out index 2452c31c0..fbbdf173b 100644 --- a/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out +++ b/3rdparty/glslang/Test/baseResults/spv.stereoViewRendering.vert.out @@ -8,6 +8,7 @@ spv.stereoViewRendering.vert Capability ShaderViewportIndexLayerNV Capability ShaderViewportMaskNV Capability ShaderStereoViewNV + Extension "SPV_EXT_shader_viewport_index_layer" Extension "SPV_NV_stereo_view_rendering" Extension "SPV_NV_viewport_array2" 1: ExtInstImport "GLSL.std.450" diff --git a/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out b/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out index 661ebbafb..7db9e39d4 100644 --- a/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out +++ b/3rdparty/glslang/Test/baseResults/spv.subpass.frag.out @@ -4,6 +4,7 @@ spv.subpass.frag // Id's are bound by 67 Capability Shader + Capability StorageImageMultisample Capability InputAttachment 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out b/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out index 814f0139c..a8c7dc6d5 100644 --- a/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out +++ b/3rdparty/glslang/Test/baseResults/spv.viewportArray2.tesc.out @@ -7,6 +7,7 @@ spv.viewportArray2.tesc Capability MultiViewport Capability ShaderViewportIndexLayerNV Capability ShaderViewportMaskNV + Extension "SPV_EXT_shader_viewport_index_layer" Extension "SPV_NV_viewport_array2" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out b/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out index 3b3e84767..cc52905b2 100644 --- a/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out +++ b/3rdparty/glslang/Test/baseResults/spv.viewportArray2.vert.out @@ -8,6 +8,7 @@ spv.viewportArray2.vert Capability MultiViewport Capability ShaderViewportIndexLayerNV Capability ShaderViewportMaskNV + Extension "SPV_EXT_shader_viewport_index_layer" Extension "SPV_NV_viewport_array2" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-1.frag b/3rdparty/glslang/Test/hlsl.clipdistance-1.frag new file mode 100644 index 000000000..10813b30b --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-1.frag @@ -0,0 +1,6 @@ +float4 main(in float4 pos : SV_Position, + in float clip : SV_ClipDistance, + in float cull : SV_CullDistance) : SV_Target0 +{ + return pos + clip + cull; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-1.geom b/3rdparty/glslang/Test/hlsl.clipdistance-1.geom new file mode 100644 index 000000000..d056ebd04 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-1.geom @@ -0,0 +1,22 @@ +struct S { + float4 pos : SV_Position; + float clip : SV_ClipDistance0; + float cull : SV_CullDistance0; +}; + +[maxvertexcount(3)] +void main(triangle in float4 pos[3] : SV_Position, + triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream, + triangle in float clip[3] : SV_ClipDistance, // scalar float + triangle in float cull[3] : SV_CullDistance) // scalar float +{ + S s; + + s.pos = pos[0]; + s.clip = clip[0]; + s.cull = cull[0]; + + OutputStream.Append(s); +} + diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-2.frag b/3rdparty/glslang/Test/hlsl.clipdistance-2.frag new file mode 100644 index 000000000..b6f88d567 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-2.frag @@ -0,0 +1,7 @@ +float4 main(in float4 pos : SV_Position, + in float2 clip[2] : SV_ClipDistance, // array of vector float + in float2 cull[2] : SV_CullDistance) : SV_Target0 // array of vector float +{ + + return pos + clip[0][0] + cull[0][0]; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-2.geom b/3rdparty/glslang/Test/hlsl.clipdistance-2.geom new file mode 100644 index 000000000..49d27349b --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-2.geom @@ -0,0 +1,19 @@ +struct S { + float4 pos : SV_Position; + float2 clip[2] : SV_ClipDistance0; +}; + +[maxvertexcount(3)] +void main(triangle in float4 pos[3] : SV_Position, + triangle in uint VertexID[3] : VertexID, + inout LineStream OutputStream, + triangle in float2 clip[3][2] : SV_ClipDistance) // scalar float +{ + S s; + + s.pos = pos[0]; + s.clip[0] = clip[0][0]; + s.clip[1] = clip[0][1]; + + OutputStream.Append(s); +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-3.frag b/3rdparty/glslang/Test/hlsl.clipdistance-3.frag new file mode 100644 index 000000000..c590fa4f5 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-3.frag @@ -0,0 +1,8 @@ +float4 main(in float4 pos : SV_Position, + in float clip[2] : SV_ClipDistance, // array of scalar float + in float cull[2] : SV_CullDistance) : SV_Target0 // array of scalar float +{ + return pos + clip[0] + cull[0]; +} + + diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-4.frag b/3rdparty/glslang/Test/hlsl.clipdistance-4.frag new file mode 100644 index 000000000..61441604a --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-4.frag @@ -0,0 +1,9 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float4 ClipRect : SV_ClipDistance0; // vector in split struct +}; + +float4 main(const VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.ClipRect; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-5.frag b/3rdparty/glslang/Test/hlsl.clipdistance-5.frag new file mode 100644 index 000000000..472299948 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-5.frag @@ -0,0 +1,9 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float2 ClipRect[2] : SV_ClipDistance0; // array of float2 in split struct +}; + +float4 main(const VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.ClipRect[0].x + v.ClipRect[1].x; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-6.frag b/3rdparty/glslang/Test/hlsl.clipdistance-6.frag new file mode 100644 index 000000000..646197be7 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-6.frag @@ -0,0 +1,10 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float4 clip0 : SV_ClipDistance0; // multiple semantic IDs, two vec4s (no extra packing) + float4 clip1 : SV_ClipDistance1; // ... +}; + +float4 main(VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.clip0 + v.clip1; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-7.frag b/3rdparty/glslang/Test/hlsl.clipdistance-7.frag new file mode 100644 index 000000000..1a26df8a4 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-7.frag @@ -0,0 +1,10 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float3 clip0 : SV_ClipDistance0; // multiple semantic IDs, vec3+vec4 (skip) + float4 clip1 : SV_ClipDistance1; // ... +}; + +float4 main(VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.clip0.x + v.clip1.x; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-8.frag b/3rdparty/glslang/Test/hlsl.clipdistance-8.frag new file mode 100644 index 000000000..2edf1948f --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-8.frag @@ -0,0 +1,10 @@ +struct VS_OUTPUT { + float4 Position : SV_Position; + float3 clip0 : SV_ClipDistance0; // multiple semantic IDs, vec3+float (pack) + float clip1 : SV_ClipDistance1; // ... +}; + +float4 main(VS_OUTPUT v) : SV_Target0 +{ + return v.Position + v.clip0.x + v.clip1; +} diff --git a/3rdparty/glslang/Test/hlsl.clipdistance-9.frag b/3rdparty/glslang/Test/hlsl.clipdistance-9.frag new file mode 100644 index 000000000..cbe940af3 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.clipdistance-9.frag @@ -0,0 +1,8 @@ + +// Test packing 0 and 1 semantics into single array[4], from in fn params. +float4 main(in float4 Position : SV_Position, + in float3 clip0 : SV_ClipDistance0, + in float clip1 : SV_ClipDistance1) : SV_Target0 +{ + return Position + clip0.x + clip1; +} diff --git a/3rdparty/glslang/Test/hlsl.domain.1.tese b/3rdparty/glslang/Test/hlsl.domain.1.tese index 503941046..7366e9bc6 100644 --- a/3rdparty/glslang/Test/hlsl.domain.1.tese +++ b/3rdparty/glslang/Test/hlsl.domain.1.tese @@ -18,11 +18,11 @@ struct gs_in_t }; [domain ( "tri" )] -gs_in_t main (const OutputPatch i, float3 tesscoord : SV_DomainLocation, pcf_in_t pcf_data ) +gs_in_t main (const OutputPatch i, float f : msem, float3 tesscoord : SV_DomainLocation, pcf_in_t pcf_data ) { gs_in_t o; - o.pos = i[0].pos + tesscoord.x; + o.pos = i[0].pos + tesscoord.x * f; o.norm = i[0].norm + tesscoord.y; tesscoord.z; diff --git a/3rdparty/glslang/Test/hlsl.flattenOpaqueInit.vert b/3rdparty/glslang/Test/hlsl.flattenOpaqueInit.vert index 5efb02edc..75d28a9a7 100644 --- a/3rdparty/glslang/Test/hlsl.flattenOpaqueInit.vert +++ b/3rdparty/glslang/Test/hlsl.flattenOpaqueInit.vert @@ -6,8 +6,17 @@ float4 lookUp(FxaaTex tex) return tex.tex.Sample(tex.smpl, float2(0.3, 0.4)); } +FxaaTex fillOpaque() +{ + FxaaTex t; + t.smpl = g_tInputTexture_sampler; + t.tex = g_tInputTexture; + return t; +} + float4 main() : SV_TARGET0 { - FxaaTex tex = { g_tInputTexture_sampler, g_tInputTexture }; - return lookUp(tex); + FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture }; + FxaaTex tex2 = fillOpaque(); + return lookUp(tex1); } \ No newline at end of file diff --git a/3rdparty/glslang/Test/hlsl.function.frag b/3rdparty/glslang/Test/hlsl.function.frag index 4d1167855..5834b3196 100644 --- a/3rdparty/glslang/Test/hlsl.function.frag +++ b/3rdparty/glslang/Test/hlsl.function.frag @@ -8,7 +8,7 @@ uint fun2(float4 col) return 7; } -float4 fun4(uint id1, uint id2) +float4 fun4(uint id1, uniform uint id2) { return id1 * id2; } diff --git a/3rdparty/glslang/Test/hlsl.struct.split.assign.frag b/3rdparty/glslang/Test/hlsl.struct.split.assign.frag index e7fe02887..d9921f30e 100644 --- a/3rdparty/glslang/Test/hlsl.struct.split.assign.frag +++ b/3rdparty/glslang/Test/hlsl.struct.split.assign.frag @@ -8,5 +8,5 @@ float4 main(int i, S input[3]) : COLOR0 S a[3]; input = a; - return float3(1.0); + return a[1].pos; } diff --git a/3rdparty/glslang/Test/hlsl.texture.struct.frag b/3rdparty/glslang/Test/hlsl.texture.struct.frag new file mode 100644 index 000000000..461469cd4 --- /dev/null +++ b/3rdparty/glslang/Test/hlsl.texture.struct.frag @@ -0,0 +1,55 @@ +struct s1_t { + float c0; + float2 c1; + float c2; +}; + +struct s2_t { + float c0; + float3 c1; +}; + +struct s3_t { + float2 c0; + float1 c1; +}; + +struct s4_t { + int c0; + int2 c1; + int c2; +}; + +struct s5_t { + uint c0; + uint c1; +}; + +SamplerState g_sSamp; +Texture2D g_tTex2s1; +Texture2D g_tTex2s2; +Texture2D g_tTex2s3; +Texture2D g_tTex2s4; +Texture2D g_tTex2s5; + +Texture2D g_tTex2s1a; // same type as g_tTex2s1, to test fn signature matching. + +// function overloading to test name mangling with textures templatized on structs +s1_t fn1(Texture2D t1) { return t1 . Sample(g_sSamp, float2(0.6, 0.61)); } +s2_t fn1(Texture2D t2) { return t2 . Sample(g_sSamp, float2(0.6, 0.61)); } + +float4 main() : SV_Target0 +{ + s1_t s1 = g_tTex2s1 . Sample(g_sSamp, float2(0.1, 0.11)); + s2_t s2 = g_tTex2s2 . Sample(g_sSamp, float2(0.2, 0.21)); + s3_t s3 = g_tTex2s3 . Sample(g_sSamp, float2(0.3, 0.31)); + s4_t s4 = g_tTex2s4 . Sample(g_sSamp, float2(0.4, 0.41)); + s5_t s5 = g_tTex2s5 . Sample(g_sSamp, float2(0.5, 0.51)); + + s1_t r0 = fn1(g_tTex2s1); + s2_t r1 = fn1(g_tTex2s2); + s1_t r2 = fn1(g_tTex2s1a); + + return 0; +} + diff --git a/3rdparty/glslang/Test/hlsl.texture.subvec4.frag b/3rdparty/glslang/Test/hlsl.texture.subvec4.frag index 9e057d575..56fd4106c 100644 --- a/3rdparty/glslang/Test/hlsl.texture.subvec4.frag +++ b/3rdparty/glslang/Test/hlsl.texture.subvec4.frag @@ -11,7 +11,7 @@ Texture2D g_tTex2df4; SamplerState g_sSamp; -float4 main() +float4 main() : SV_Target0 { uint MipLevel; uint WidthU; diff --git a/3rdparty/glslang/Test/runtests b/3rdparty/glslang/Test/runtests index c5a93378f..98cd944db 100755 --- a/3rdparty/glslang/Test/runtests +++ b/3rdparty/glslang/Test/runtests @@ -116,8 +116,12 @@ diff -b $BASEDIR/spv.noBuiltInLoc.vert.out $TARGETDIR/spv.noBuiltInLoc.vert.out # Testing debug information # echo Testing SPV Debug Information -$EXE -g -H spv.debugInfo.frag > $TARGETDIR/spv.debugInfo.frag.out +$EXE -g --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \ + -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1 +$EXE -g -D -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \ + --sep origMain -H spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out +diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1 # # Testing Includer diff --git a/3rdparty/glslang/Test/spv.450.geom b/3rdparty/glslang/Test/spv.450.geom index 8aefe5076..3489a8881 100644 --- a/3rdparty/glslang/Test/spv.450.geom +++ b/3rdparty/glslang/Test/spv.450.geom @@ -9,4 +9,6 @@ layout(invocations = 4) in; void main() { gl_PointSize = gl_in[1].gl_PointSize; + gl_Layer = 2; + gl_ViewportIndex = 3; } diff --git a/3rdparty/glslang/Test/spv.450.tesc b/3rdparty/glslang/Test/spv.450.tesc index c3719f96d..47b9a4087 100644 --- a/3rdparty/glslang/Test/spv.450.tesc +++ b/3rdparty/glslang/Test/spv.450.tesc @@ -2,7 +2,7 @@ layout(vertices = 4) out; -patch out vec4 patchOut; +layout(location=1) patch out vec4 patchOut; struct S { float sMem1; // should not see a patch decoration @@ -17,6 +17,7 @@ layout(location = 12) patch out TheBlock { void main() { + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; } layout(location = 2) patch out SingleBlock { diff --git a/3rdparty/glslang/Test/spv.hlslDebugInfo.vert b/3rdparty/glslang/Test/spv.hlslDebugInfo.vert new file mode 100644 index 000000000..b2bc18778 --- /dev/null +++ b/3rdparty/glslang/Test/spv.hlslDebugInfo.vert @@ -0,0 +1,4 @@ +float4 origMain() : SV_Position +{ + return (float4)0; +} diff --git a/3rdparty/glslang/Test/spv.imageLoadStoreLod.frag b/3rdparty/glslang/Test/spv.imageLoadStoreLod.frag new file mode 100644 index 000000000..0da1da125 --- /dev/null +++ b/3rdparty/glslang/Test/spv.imageLoadStoreLod.frag @@ -0,0 +1,36 @@ +#version 450 core + +#extension GL_AMD_shader_image_load_store_lod: enable + +layout(rgba32f, binding = 0) uniform image1D i1D; +layout(rgba32f, binding = 1) uniform image2D i2D; +layout(rgba32f, binding = 2) uniform image3D i3D; +layout(rgba32i, binding = 3) uniform iimageCube iiCube; +layout(rgba32i, binding = 4) uniform iimage1DArray ii1DArray; +layout(rgba32ui, binding = 5) uniform uimage2DArray ui2DArray; +layout(rgba32ui, binding = 6) uniform uimageCubeArray uiCubeArray; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + const int c1 = 1; + const ivec2 c2 = ivec2(2, 3); + const ivec3 c3 = ivec3(4, 5, 6); + + const int lod = 3; + + vec4 f4 = vec4(0.0); + f4 += imageLoadLodAMD(i1D, c1, lod); + f4 += imageLoadLodAMD(i2D, c2, lod); + f4 += imageLoadLodAMD(i3D, c3, lod); + + imageStoreLodAMD(iiCube, c3, lod, ivec4(f4)); + imageStoreLodAMD(ii1DArray, c2, lod, ivec4(f4)); + + uvec4 u4; + sparseImageLoadLodAMD(ui2DArray, c3, lod, u4); + sparseImageLoadLodAMD(uiCubeArray, c3, lod, u4); + + fragColor = f4 + vec4(u4); +} \ No newline at end of file diff --git a/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/glslang/glslang/Include/Types.h index b94f91526..b5b91f527 100644 --- a/3rdparty/glslang/glslang/Include/Types.h +++ b/3rdparty/glslang/glslang/Include/Types.h @@ -80,7 +80,19 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler bool sampler : 1; // true means a pure sampler, other fields should be clear() bool external : 1; // GL_OES_EGL_image_external - unsigned int vectorSize : 3; // return vector size. TODO: support arbitrary types. + unsigned int vectorSize : 3; // vector return type size. + + // Some languages support structures as sample results. Storing the whole structure in the + // TSampler is too large, so there is an index to a separate table. + static const unsigned structReturnIndexBits = 4; // number of index bits to use. + static const unsigned structReturnSlots = (1<getQualifier().precision); } // compute the result precision +#ifdef AMD_EXTENSIONS + if (agg->isSampling() || + agg->getOp() == EOpImageLoad || agg->getOp() == EOpImageStore || + agg->getOp() == EOpImageLoadLod || agg->getOp() == EOpImageStoreLod) +#else if (agg->isSampling() || agg->getOp() == EOpImageLoad || agg->getOp() == EOpImageStore) +#endif resultPrecision = sequence[0]->getAsTyped()->getQualifier().precision; else if (function.getType().getBasicType() != EbtBool) resultPrecision = function.getType().getQualifier().precision == EpqNone ? diff --git a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp index d2964e4d2..2a904f45e 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -675,6 +675,22 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages } } +// Most processes are recorded when set in the intermediate representation, +// These are the few that are not. +void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const std::string& sourceEntryPointName) +{ + if ((messages & EShMsgRelaxedErrors) != 0) + intermediate.addProcess("relaxed-errors"); + if ((messages & EShMsgSuppressWarnings) != 0) + intermediate.addProcess("suppress-warnings"); + if ((messages & EShMsgKeepUncalled) != 0) + intermediate.addProcess("keep-uncalled"); + if (sourceEntryPointName.size() > 0) { + intermediate.addProcess("source-entrypoint"); + intermediate.addProcessArgument(sourceEntryPointName); + } +} + // This is the common setup and cleanup code for PreprocessDeferred and // CompileDeferred. // It takes any callable with a signature of @@ -798,6 +814,7 @@ bool ProcessDeferred( intermediate.setVersion(version); intermediate.setProfile(profile); intermediate.setSpv(spvVersion); + RecordProcesses(intermediate, messages, sourceEntryPointName); if (spvVersion.vulkan >= 100) intermediate.setOriginUpperLeft(); if ((messages & EShMsgHlslOffsets) || source == EShSourceHlsl) @@ -1641,6 +1658,11 @@ void TShader::setSourceEntryPoint(const char* name) sourceEntryPointName = name; } +void TShader::addProcesses(const std::vector& p) +{ + intermediate->addProcesses(p); +} + // Set binding base for sampler types void TShader::setShiftSamplerBinding(unsigned int base) { intermediate->setShiftSamplerBinding(base); } // Set binding base for texture types (SRV) @@ -1658,7 +1680,7 @@ void TShader::setShiftSsboBinding(unsigned int base) { intermediate->setShift // Enables binding automapping using TIoMapper void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); } // Fragile: currently within one stage: simple auto-assignment of location -void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } +void TShader::setAutoMapLocations(bool map) { intermediate->setAutoMapLocations(map); } // See comment above TDefaultHlslIoMapper in iomapper.cpp: void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); } void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); } diff --git a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp index d7f9e1d99..233033e78 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -104,11 +104,20 @@ void TType::buildMangledName(TString& mangledName) const default: break; // some compilers want this } - switch (sampler.vectorSize) { - case 1: mangledName += "1"; break; - case 2: mangledName += "2"; break; - case 3: mangledName += "3"; break; - case 4: break; // default to prior name mangle behavior + if (sampler.hasReturnStruct()) { + // Name mangle for sampler return struct uses struct table index. + mangledName += "-tx-struct"; + + char text[16]; // plenty enough space for the small integers. + snprintf(text, sizeof(text), "%d-", sampler.structReturnIndex); + mangledName += text; + } else { + switch (sampler.getVectorSize()) { + case 1: mangledName += "1"; break; + case 2: mangledName += "2"; break; + case 3: mangledName += "3"; break; + case 4: break; // default to prior name mangle behavior + } } if (sampler.ms) diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp index 413a1b973..531aa159f 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp @@ -182,6 +182,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_shader_stencil_export] = EBhDisable; // extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members extensionBehavior[E_GL_ARB_post_depth_coverage] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable; extensionBehavior[E_GL_EXT_shader_non_constant_global_initializers] = EBhDisable; extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable; @@ -199,12 +200,12 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_AMD_gpu_shader_half_float] = EBhDisable; extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable; extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable; + extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable; #endif #ifdef NV_EXTENSIONS extensionBehavior[E_GL_NV_sample_mask_override_coverage] = EBhDisable; extensionBehavior[E_SPV_NV_geometry_shader_passthrough] = EBhDisable; - extensionBehavior[E_GL_ARB_shader_viewport_layer_array] = EBhDisable; extensionBehavior[E_GL_NV_viewport_array2] = EBhDisable; extensionBehavior[E_GL_NV_stereo_view_rendering] = EBhDisable; extensionBehavior[E_GL_NVX_multiview_per_view_attributes] = EBhDisable; @@ -331,6 +332,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_AMD_gpu_shader_half_float 1\n" "#define GL_AMD_texture_gather_bias_lod 1\n" "#define GL_AMD_gpu_shader_int16 1\n" + "#define GL_AMD_shader_image_load_store_lod 1\n" #endif #ifdef NV_EXTENSIONS diff --git a/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/3rdparty/glslang/glslang/MachineIndependent/Versions.h index a7c6009a6..78a9b2865 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Versions.h +++ b/3rdparty/glslang/glslang/MachineIndependent/Versions.h @@ -136,6 +136,7 @@ const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture const char* const E_GL_ARB_shader_stencil_export = "GL_ARB_shader_stencil_export"; // const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_coverage"; +const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; const char* const E_GL_EXT_shader_non_constant_global_initializers = "GL_EXT_shader_non_constant_global_initializers"; const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_load_formatted"; @@ -169,13 +170,13 @@ const char* const E_GL_AMD_gcn_shader = "GL_AMD_gcn_sh const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_shader_half_float"; const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod"; const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16"; +const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod"; #endif #ifdef NV_EXTENSIONS const char* const E_GL_NV_sample_mask_override_coverage = "GL_NV_sample_mask_override_coverage"; const char* const E_SPV_NV_geometry_shader_passthrough = "GL_NV_geometry_shader_passthrough"; -const char* const E_GL_ARB_shader_viewport_layer_array = "GL_ARB_shader_viewport_layer_array"; const char* const E_GL_NV_viewport_array2 = "GL_NV_viewport_array2"; const char* const E_GL_NV_stereo_view_rendering = "GL_NV_stereo_view_rendering"; const char* const E_GL_NVX_multiview_per_view_attributes = "GL_NVX_multiview_per_view_attributes"; diff --git a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index 479f15d8d..30240fcc3 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -704,6 +704,10 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpImageAtomicXor: out.debug << "imageAtomicXor"; break; case EOpImageAtomicExchange: out.debug << "imageAtomicExchange"; break; case EOpImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break; +#ifdef AMD_EXTENSIONS + case EOpImageLoadLod: out.debug << "imageLoadLod"; break; + case EOpImageStoreLod: out.debug << "imageStoreLod"; break; +#endif case EOpTextureQuerySize: out.debug << "textureSize"; break; case EOpTextureQueryLod: out.debug << "textureQueryLod"; break; @@ -756,6 +760,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSparseTextureGatherLod: out.debug << "sparseTextureGatherLod"; break; case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break; case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break; + case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break; #endif case EOpAddCarry: out.debug << "addCarry"; break; diff --git a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h index c1daf1b50..d3219cc54 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h +++ b/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h @@ -150,6 +150,54 @@ struct TXfbBuffer { bool containsDouble; }; +// Track a set of strings describing how the module was processed. +// Using the form: +// process arg0 arg1 arg2 ... +// process arg0 arg1 arg2 ... +// where everything is textual, and there can be zero or more arguments +class TProcesses { +public: + TProcesses() {} + ~TProcesses() {} + + void addProcess(const char* process) + { + processes.push_back(process); + } + void addProcess(const std::string& process) + { + processes.push_back(process); + } + void addArgument(int arg) + { + processes.back().append(" "); + std::string argString = std::to_string(arg); + processes.back().append(argString); + } + void addArgument(const char* arg) + { + processes.back().append(" "); + processes.back().append(arg); + } + void addArgument(const std::string& arg) + { + processes.back().append(" "); + processes.back().append(arg); + } + void addIfNonZero(const char* process, int value) + { + if (value != 0) { + addProcess(process); + addArgument(value); + } + } + + const std::vector& getProcesses() const { return processes; } + +private: + std::vector processes; +}; + class TSymbolTable; class TSymbol; class TVariable; @@ -201,46 +249,135 @@ public: void setSource(EShSource s) { source = s; } EShSource getSource() const { return source; } - void setEntryPointName(const char* ep) { entryPointName = ep; } + void setEntryPointName(const char* ep) + { + entryPointName = ep; + processes.addProcess("entry-point"); + processes.addArgument(entryPointName); + } void setEntryPointMangledName(const char* ep) { entryPointMangledName = ep; } const std::string& getEntryPointName() const { return entryPointName; } const std::string& getEntryPointMangledName() const { return entryPointMangledName; } - void setShiftSamplerBinding(unsigned int shift) { shiftSamplerBinding = shift; } + void setShiftSamplerBinding(unsigned int shift) + { + shiftSamplerBinding = shift; + processes.addIfNonZero("shift-sampler-binding", shift); + } unsigned int getShiftSamplerBinding() const { return shiftSamplerBinding; } - void setShiftTextureBinding(unsigned int shift) { shiftTextureBinding = shift; } + void setShiftTextureBinding(unsigned int shift) + { + shiftTextureBinding = shift; + processes.addIfNonZero("shift-texture-binding", shift); + } unsigned int getShiftTextureBinding() const { return shiftTextureBinding; } - void setShiftImageBinding(unsigned int shift) { shiftImageBinding = shift; } + void setShiftImageBinding(unsigned int shift) + { + shiftImageBinding = shift; + processes.addIfNonZero("shift-image-binding", shift); + } unsigned int getShiftImageBinding() const { return shiftImageBinding; } - void setShiftUboBinding(unsigned int shift) { shiftUboBinding = shift; } - unsigned int getShiftUboBinding() const { return shiftUboBinding; } - void setShiftSsboBinding(unsigned int shift) { shiftSsboBinding = shift; } - unsigned int getShiftSsboBinding() const { return shiftSsboBinding; } - void setShiftUavBinding(unsigned int shift) { shiftUavBinding = shift; } - unsigned int getShiftUavBinding() const { return shiftUavBinding; } - void setResourceSetBinding(const std::vector& shift) { resourceSetBinding = shift; } + void setShiftUboBinding(unsigned int shift) + { + shiftUboBinding = shift; + processes.addIfNonZero("shift-UBO-binding", shift); + } + unsigned int getShiftUboBinding() const { return shiftUboBinding; } + void setShiftSsboBinding(unsigned int shift) + { + shiftSsboBinding = shift; + processes.addIfNonZero("shift-ssbo-binding", shift); + } + unsigned int getShiftSsboBinding() const { return shiftSsboBinding; } + void setShiftUavBinding(unsigned int shift) + { + shiftUavBinding = shift; + processes.addIfNonZero("shift-uav-binding", shift); + } + unsigned int getShiftUavBinding() const { return shiftUavBinding; } + void setResourceSetBinding(const std::vector& shift) + { + resourceSetBinding = shift; + if (shift.size() > 0) { + processes.addProcess("resource-set-binding"); + for (int s = 0; s < (int)shift.size(); ++s) + processes.addArgument(shift[s]); + } + } const std::vector& getResourceSetBinding() const { return resourceSetBinding; } - void setAutoMapBindings(bool map) { autoMapBindings = map; } - bool getAutoMapBindings() const { return autoMapBindings; } - void setAutoMapLocations(bool map) { autoMapLocations = map; } - bool getAutoMapLocations() const { return autoMapLocations; } - void setFlattenUniformArrays(bool flatten) { flattenUniformArrays = flatten; } - bool getFlattenUniformArrays() const { return flattenUniformArrays; } - void setNoStorageFormat(bool b) { useUnknownFormat = b; } - bool getNoStorageFormat() const { return useUnknownFormat; } - void setHlslOffsets() { hlslOffsets = true; } + void setAutoMapBindings(bool map) + { + autoMapBindings = map; + if (autoMapBindings) + processes.addProcess("auto-map-bindings"); + } + bool getAutoMapBindings() const { return autoMapBindings; } + void setAutoMapLocations(bool map) + { + autoMapLocations = map; + if (autoMapLocations) + processes.addProcess("auto-map-locations"); + } + bool getAutoMapLocations() const { return autoMapLocations; } + void setFlattenUniformArrays(bool flatten) + { + flattenUniformArrays = flatten; + if (flattenUniformArrays) + processes.addProcess("flatten-uniform-arrays"); + } + bool getFlattenUniformArrays() const { return flattenUniformArrays; } + void setNoStorageFormat(bool b) + { + useUnknownFormat = b; + if (useUnknownFormat) + processes.addProcess("no-storage-format"); + } + bool getNoStorageFormat() const { return useUnknownFormat; } + void setHlslOffsets() + { + hlslOffsets = true; + if (hlslOffsets) + processes.addProcess("hlsl-offsets"); + } bool usingHlslOFfsets() const { return hlslOffsets; } - void setUseStorageBuffer() { useStorageBuffer = true; } + void setUseStorageBuffer() + { + useStorageBuffer = true; + processes.addProcess("use-storage-buffer"); + } bool usingStorageBuffer() const { return useStorageBuffer; } - void setHlslIoMapping(bool b) { hlslIoMapping = b; } - bool usingHlslIoMapping() { return hlslIoMapping; } + void setHlslIoMapping(bool b) + { + hlslIoMapping = b; + if (hlslIoMapping) + processes.addProcess("hlsl-iomap"); + } + bool usingHlslIoMapping() { return hlslIoMapping; } + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } void setVersion(int v) { version = v; } int getVersion() const { return version; } void setProfile(EProfile p) { profile = p; } EProfile getProfile() const { return profile; } - void setSpv(const SpvVersion& s) { spvVersion = s; } + void setSpv(const SpvVersion& s) + { + spvVersion = s; + + // client processes + if (spvVersion.vulkan > 0) + processes.addProcess("client vulkan100"); + if (spvVersion.openGl > 0) + processes.addProcess("client opengl100"); + + // target-environment processes + if (spvVersion.vulkan == 100) + processes.addProcess("target-env vulkan1.0"); + else if (spvVersion.vulkan > 0) + processes.addProcess("target-env vulkanUnknown"); + if (spvVersion.openGl > 0) + processes.addProcess("target-env opengl"); + } const SpvVersion& getSpv() const { return spvVersion; } EShLanguage getStage() const { return language; } void addRequestedExtension(const char* extension) { requestedExtensions.insert(extension); } @@ -462,6 +599,13 @@ public: const std::string& getSourceFile() const { return sourceFile; } void addSourceText(const char* text) { sourceText = sourceText + text; } const std::string& getSourceText() const { return sourceText; } + void addProcesses(const std::vector& p) { + for (int i = 0; i < (int)p.size(); ++i) + processes.addProcess(p[i]); + } + void addProcess(const std::string& process) { processes.addProcess(process); } + void addProcessArgument(const std::string& arg) { processes.addArgument(arg); } + const std::vector& getProcesses() const { return processes.getProcesses(); } const char* const implicitThisName = "@this"; @@ -558,6 +702,9 @@ protected: std::string sourceFile; std::string sourceText; + // for OpModuleProcessed, or equivalent + TProcesses processes; + private: void operator=(TIntermediate&); // prevent assignments }; diff --git a/3rdparty/glslang/glslang/Public/ShaderLang.h b/3rdparty/glslang/glslang/Public/ShaderLang.h index 12672eeea..b968967d2 100644 --- a/3rdparty/glslang/glslang/Public/ShaderLang.h +++ b/3rdparty/glslang/glslang/Public/ShaderLang.h @@ -346,6 +346,7 @@ public: void setPreamble(const char* s) { preamble = s; } void setEntryPoint(const char* entryPoint); void setSourceEntryPoint(const char* sourceEntryPointName); + void addProcesses(const std::vector&); void setShiftSamplerBinding(unsigned int base); void setShiftTextureBinding(unsigned int base); void setShiftImageBinding(unsigned int base); diff --git a/3rdparty/glslang/gtests/Hlsl.FromFile.cpp b/3rdparty/glslang/gtests/Hlsl.FromFile.cpp index d28b97c28..0488eb792 100644 --- a/3rdparty/glslang/gtests/Hlsl.FromFile.cpp +++ b/3rdparty/glslang/gtests/Hlsl.FromFile.cpp @@ -97,14 +97,25 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.cast.frag", "PixelShaderFunction"}, {"hlsl.charLit.vert", "main"}, {"hlsl.clip.frag", "main"}, + {"hlsl.clipdistance-1.frag", "main"}, + {"hlsl.clipdistance-1.geom", "main"}, {"hlsl.clipdistance-1.vert", "main"}, + {"hlsl.clipdistance-2.frag", "main"}, + {"hlsl.clipdistance-2.geom", "main"}, {"hlsl.clipdistance-2.vert", "main"}, + {"hlsl.clipdistance-3.frag", "main"}, {"hlsl.clipdistance-3.vert", "main"}, + {"hlsl.clipdistance-4.frag", "main"}, {"hlsl.clipdistance-4.vert", "main"}, + {"hlsl.clipdistance-5.frag", "main"}, {"hlsl.clipdistance-5.vert", "main"}, + {"hlsl.clipdistance-6.frag", "main"}, {"hlsl.clipdistance-6.vert", "main"}, + {"hlsl.clipdistance-7.frag", "main"}, {"hlsl.clipdistance-7.vert", "main"}, + {"hlsl.clipdistance-8.frag", "main"}, {"hlsl.clipdistance-8.vert", "main"}, + {"hlsl.clipdistance-9.frag", "main"}, {"hlsl.clipdistance-9.vert", "main"}, {"hlsl.comparison.vec.frag", "main"}, {"hlsl.conditional.frag", "PixelShaderFunction"}, @@ -291,6 +302,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.structIoFourWay.frag", "main"}, {"hlsl.structStructName.frag", "main"}, {"hlsl.synthesizeInput.frag", "main"}, + {"hlsl.texture.struct.frag", "main"}, {"hlsl.texture.subvec4.frag", "main"}, {"hlsl.this.frag", "main"}, {"hlsl.intrinsics.vert", "VertexShaderFunction"}, diff --git a/3rdparty/glslang/gtests/Spv.FromFile.cpp b/3rdparty/glslang/gtests/Spv.FromFile.cpp index 86d5bbab1..ef2ef342f 100644 --- a/3rdparty/glslang/gtests/Spv.FromFile.cpp +++ b/3rdparty/glslang/gtests/Spv.FromFile.cpp @@ -406,6 +406,7 @@ INSTANTIATE_TEST_CASE_P( Glsl, CompileVulkanToSpirvTestAMD, ::testing::ValuesIn(std::vector({ "spv.float16.frag", + "spv.imageLoadStoreLod.frag", "spv.int16.frag", "spv.shaderBallotAMD.comp", "spv.textureGatherBiasLod.frag" diff --git a/3rdparty/glslang/hlsl/hlslGrammar.cpp b/3rdparty/glslang/hlsl/hlslGrammar.cpp index 0e8614cf3..2f687c5a9 100755 --- a/3rdparty/glslang/hlsl/hlslGrammar.cpp +++ b/3rdparty/glslang/hlsl/hlslGrammar.cpp @@ -1189,7 +1189,13 @@ bool HlslGrammar::acceptTextureType(TType& type) const TBasicType basicRetType = txType.getBasicType() ; - if (basicRetType != EbtFloat && basicRetType != EbtUint && basicRetType != EbtInt) { + switch (basicRetType) { + case EbtFloat: + case EbtUint: + case EbtInt: + case EbtStruct: + break; + default: unimplemented("basic type in texture"); return false; } @@ -1206,8 +1212,8 @@ bool HlslGrammar::acceptTextureType(TType& type) return false; } - if (!txType.isScalar() && !txType.isVector()) { - expected("scalar or vector type"); + if (!txType.isScalar() && !txType.isVector() && !txType.isStruct()) { + expected("scalar, vector, or struct type"); return false; } @@ -1244,20 +1250,24 @@ bool HlslGrammar::acceptTextureType(TType& type) if (image || dim == EsdBuffer) format = parseContext.getLayoutFromTxType(token.loc, txType); + const TBasicType txBasicType = txType.isStruct() ? (*txType.getStruct())[0].type->getBasicType() + : txType.getBasicType(); + // Non-image Buffers are combined if (dim == EsdBuffer && !image) { sampler.set(txType.getBasicType(), dim, array); } else { // DX10 textures are separated. TODO: DX9. if (image) { - sampler.setImage(txType.getBasicType(), dim, array, shadow, ms); + sampler.setImage(txBasicType, dim, array, shadow, ms); } else { - sampler.setTexture(txType.getBasicType(), dim, array, shadow, ms); + sampler.setTexture(txBasicType, dim, array, shadow, ms); } } - // Remember the declared vector size. - sampler.vectorSize = txType.getVectorSize(); + // Remember the declared return type. Function returns false on error. + if (!parseContext.setTextureReturnType(sampler, txType, token.loc)) + return false; // Force uncombined, if necessary if (!combined) diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/3rdparty/glslang/hlsl/hlslParseHelper.cpp index 4c5cf050a..2d7e59340 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.cpp +++ b/3rdparty/glslang/hlsl/hlslParseHelper.cpp @@ -66,8 +66,8 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int entryPointFunction(nullptr), entryPointFunctionBody(nullptr), gsStreamOutput(nullptr), - clipDistanceOutput(nullptr), - cullDistanceOutput(nullptr) + clipDistanceVariable(nullptr), + cullDistanceVariable(nullptr) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor; @@ -189,7 +189,14 @@ void HlslParseContext::growGlobalUniformBlock(const TSourceLoc& loc, TType& memb // TLayoutFormat HlslParseContext::getLayoutFromTxType(const TSourceLoc& loc, const TType& txType) { + if (txType.isStruct()) { + // TODO: implement. + error(loc, "unimplemented: structure type in image or buffer", "", ""); + return ElfNone; + } + const int components = txType.getVectorSize(); + const TBasicType txBasicType = txType.getBasicType(); const auto selectFormat = [this,&components](TLayoutFormat v1, TLayoutFormat v2, TLayoutFormat v4) -> TLayoutFormat { if (intermediate.getNoStorageFormat()) @@ -199,7 +206,7 @@ TLayoutFormat HlslParseContext::getLayoutFromTxType(const TSourceLoc& loc, const components == 2 ? v2 : v4; }; - switch (txType.getBasicType()) { + switch (txBasicType) { case EbtFloat: return selectFormat(ElfR32f, ElfRg32f, ElfRgba32f); case EbtInt: return selectFormat(ElfR32i, ElfRg32i, ElfRgba32i); case EbtUint: return selectFormat(ElfR32ui, ElfRg32ui, ElfRgba32ui); @@ -370,7 +377,8 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char* const TSampler& texSampler = object->getType().getSampler(); - const TType objDerefType(texSampler.type, EvqTemporary, texSampler.vectorSize); + TType objDerefType; + getTextureReturnType(texSampler, objDerefType); if (nodeAsBinary) { TIntermTyped* rhs = nodeAsBinary->getRight(); @@ -771,7 +779,10 @@ TIntermTyped* HlslParseContext::handleBracketOperator(const TSourceLoc& loc, TIn } else { TIntermAggregate* load = new TIntermAggregate(sampler.isImage() ? EOpImageLoad : EOpTextureFetch); - load->setType(TType(sampler.type, EvqTemporary, sampler.vectorSize)); + TType sampReturnType; + getTextureReturnType(sampler, sampReturnType); + + load->setType(sampReturnType); load->setLoc(loc); load->getSequence().push_back(base); load->getSequence().push_back(index); @@ -1270,16 +1281,16 @@ int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType& if (flattenData.nextBinding != TQualifier::layoutBindingEnd) memberVariable->getWritableType().getQualifier().layoutBinding = flattenData.nextBinding++; - if (!memberVariable->getType().isBuiltIn()) { + if (memberVariable->getType().isBuiltIn()) { + // inherited locations are nonsensical for built-ins (TODO: what if semantic had a number) + memberVariable->getWritableType().getQualifier().layoutLocation = TQualifier::layoutLocationEnd; + } else { // inherited locations must be auto bumped, not replicated if (flattenData.nextLocation != TQualifier::layoutLocationEnd) { memberVariable->getWritableType().getQualifier().layoutLocation = flattenData.nextLocation; flattenData.nextLocation += intermediate.computeTypeLocationSize(memberVariable->getType()); nextOutLocation = std::max(nextOutLocation, flattenData.nextLocation); } - } else { - // inherited locations are nonsensical for built-ins - memberVariable->getWritableType().getQualifier().layoutLocation = TQualifier::layoutLocationEnd; } flattenData.offsets.push_back(static_cast(flattenData.members.size())); @@ -1484,11 +1495,7 @@ void HlslParseContext::fixBuiltInIoType(TType& type) // Alter or set array size as needed. if (requiredArraySize > 0) { - if (type.isArray()) { - // Already an array. Fix the size. - type.changeOuterArraySize(requiredArraySize); - } else { - // it wasn't an array, but needs to be. + if (!type.isArray() || type.getOuterArraySize() != requiredArraySize) { TArraySizes arraySizes; arraySizes.addInnerSize(requiredArraySize); type.newArraySizes(arraySizes); @@ -1916,19 +1923,15 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct // Further this return/in/out transform by flattening, splitting, and assigning locations const auto makeVariableInOut = [&](TVariable& variable) { if (variable.getType().isStruct()) { - const TStorageQualifier qualifier = variable.getType().getQualifier().storage; - // struct inputs to the vertex stage and outputs from the fragment stage must be flattened - if ((language == EShLangVertex && qualifier == EvqVaryingIn) || - (language == EShLangFragment && qualifier == EvqVaryingOut)) + if (variable.getType().getQualifier().isArrayedIo(language)) { + if (variable.getType().containsBuiltIn()) + split(variable); + } else flatten(variable, false /* don't track linkage here, it will be tracked in assignToInterface() */); - // Structs containing built-ins must be split - else if (variable.getType().containsBuiltIn()) - split(variable); - else if (!variable.getType().getQualifier().isArrayedIo(language)) - flatten(variable, false); - //else - // TODO: unify split and flatten, so all paths can create flattened I/O } + // TODO: flatten arrays too + // TODO: flatten everything in I/O + // TODO: replace all split with flatten, make all paths can create flattened I/O, then split code can be removed // For clip and cull distance, multiple output variables potentially get merged // into one in assignClipCullDistance. That code in assignClipCullDistance @@ -2236,7 +2239,7 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT value = intermediate.addConversion(EOpReturn, *currentFunctionType, value); if (value && *currentFunctionType != value->getType()) value = intermediate.addUniShapeConversion(EOpReturn, *currentFunctionType, value); - if (value == nullptr) { + if (value == nullptr || *currentFunctionType != value->getType()) { error(loc, "type does not match, or is not convertible to, the function's return type", "return", ""); return value; } @@ -2268,25 +2271,37 @@ void HlslParseContext::handleFunctionArgument(TFunction* function, TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc, TOperator op, int semanticId, TIntermTyped* left, TIntermTyped* right) { + switch (language) { + case EShLangFragment: + case EShLangVertex: + break; + default: + error(loc, "unimplemented: clip/cull not currently implemented for this stage", "", ""); + return nullptr; + } + TVariable** clipCullVar = nullptr; - const TBuiltInVariable builtInType = left->getQualifier().builtIn; + // Figure out if we are assigning to, or from, clip or cull distance. + const bool isOutput = isClipOrCullDistance(left->getType()); - // array sizes, or 1 if it's not an array: - const int rhsArraySize = (right->getType().isArray() ? right->getType().getOuterArraySize() : 1); - // vector sizes: - const int rhsVectorSize = right->getType().getVectorSize(); + // This is the rvalue or lvalue holding the clip or cull distance. + TIntermTyped* clipCullNode = isOutput ? left : right; + // This is the value going into or out of the clip or cull distance. + TIntermTyped* internalNode = isOutput ? right : left; + + const TBuiltInVariable builtInType = clipCullNode->getQualifier().builtIn; decltype(clipSemanticNSize)* semanticNSize = nullptr; // Refer to either the clip or the cull distance, depending on semantic. switch (builtInType) { case EbvClipDistance: - clipCullVar = &clipDistanceOutput; + clipCullVar = &clipDistanceVariable; semanticNSize = &clipSemanticNSize; break; case EbvCullDistance: - clipCullVar = &cullDistanceOutput; + clipCullVar = &cullDistanceVariable; semanticNSize = &cullSemanticNSize; break; @@ -2314,22 +2329,23 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc arrayLoc += (*semanticNSize)[x]; } + // array sizes, or 1 if it's not an array: + const int internalNodeArraySize = (internalNode->getType().isArray() ? internalNode->getType().getOuterArraySize() : 1); + // vector sizes: + const int internalNodeVectorSize = internalNode->getType().getVectorSize(); // If we haven't created the output already, create it now. if (*clipCullVar == nullptr) { - // ClipDistance and CullDistance are handled specially in the entry point output - // copy algorithm, because they may need to be unpacked from components of vectors - // (or a scalar) into a float array. Here, we make the array the right size and type, - // which depends on the incoming data, which has several potential dimensions: - // Semantic ID - // vector size - // array size - // Of those, semantic ID and array size cannot appear simultaneously. + // ClipDistance and CullDistance are handled specially in the entry point input/output copy + // algorithm, because they may need to be unpacked from components of vectors (or a scalar) + // into a float array, or vice versa. Here, we make the array the right size and type, + // which depends on the incoming data, which has several potential dimensions: Semantic ID + // vector size array size Of those, semantic ID and array size cannot appear + // simultaneously. + const int requiredArraySize = arrayLoc * internalNodeArraySize; - const int requiredArraySize = arrayLoc * rhsArraySize; - - TType clipCullType(EbtFloat, left->getType().getQualifier().storage, 1); - clipCullType.getQualifier() = left->getType().getQualifier(); + TType clipCullType(EbtFloat, clipCullNode->getType().getQualifier().storage, 1); + clipCullType.getQualifier() = clipCullNode->getType().getQualifier(); // Create required array dimension TArraySizes arraySizes; @@ -2337,7 +2353,7 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc clipCullType.newArraySizes(arraySizes); // Obtain symbol name: we'll use that for the symbol we introduce. - TIntermSymbol* sym = left->getAsSymbolNode(); + TIntermSymbol* sym = clipCullNode->getAsSymbolNode(); assert(sym != nullptr); // We are moving the semantic ID from the layout location, so it is no longer needed or @@ -2351,66 +2367,81 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc } // Create symbol for the clip or cull variable. - left = intermediate.addSymbol(**clipCullVar); + TIntermSymbol* clipCullSym = intermediate.addSymbol(**clipCullVar); // array sizes, or 1 if it's not an array: - const int lhsArraySize = (left->getType().isArray() ? left->getType().getOuterArraySize() : 1); + const int clipCullSymArraySize = (clipCullSym->getType().isArray() ? clipCullSym->getType().getOuterArraySize() : 1); // vector sizes: - const int lhsVectorSize = left->getType().getVectorSize(); + const int clipCullSymVectorSize = clipCullSym->getType().getVectorSize(); - // left has got to be an array of scalar floats, per SPIR-V semantics. + // clipCullSym has got to be an array of scalar floats, per SPIR-V semantics. // fixBuiltInIoType() should have handled that upstream. - assert(left->getType().isArray()); - assert(left->getType().getVectorSize() == 1); - assert(left->getType().getBasicType() == EbtFloat); + assert(clipCullSym->getType().isArray()); + assert(clipCullSym->getType().getVectorSize() == 1); + assert(clipCullSym->getType().getBasicType() == EbtFloat); // We may be creating multiple sub-assignments. This is an aggregate to hold them. // TODO: it would be possible to be clever sometimes and avoid the sequence node if not needed. TIntermAggregate* assignList = nullptr; + // Holds individual component assignments as we make them. + TIntermTyped* clipCullAssign = nullptr; + // If the types are homomorphic, use a simple assign. No need to mess about with // individual components. - if (left->getType().isArray() == right->getType().isArray() && - lhsArraySize == rhsArraySize && - lhsVectorSize == rhsVectorSize) { - assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, right, loc)); + if (clipCullSym->getType().isArray() == internalNode->getType().isArray() && + clipCullSymArraySize == internalNodeArraySize && + clipCullSymVectorSize == internalNodeVectorSize) { + + if (isOutput) + clipCullAssign = intermediate.addAssign(op, clipCullSym, internalNode, loc); + else + clipCullAssign = intermediate.addAssign(op, internalNode, clipCullSym, loc); + + assignList = intermediate.growAggregate(assignList, clipCullAssign); assignList->setOperator(EOpSequence); + return assignList; } - // We are going to copy each component of the right (per array element if indicated) to sequential - // array elements of the left. This tracks the lhs element we're writing to as we go along. + // We are going to copy each component of the internal (per array element if indicated) to sequential + // array elements of the clipCullSym. This tracks the lhs element we're writing to as we go along. // We may be starting in the middle - e.g, for a non-zero semantic ID calculated above. - int lhsArrayPos = semanticOffset[semanticId]; + int clipCullArrayPos = semanticOffset[semanticId]; - // Loop through every component of every element of the RHS, and copy to LHS elements in turn. - for (int rhsArrayPos = 0; rhsArrayPos < rhsArraySize; ++rhsArrayPos) { - for (int rhsComponent = 0; rhsComponent < rhsVectorSize; ++rhsComponent) { - // LHS array member to write to: - TIntermTyped* lhsMember = intermediate.addIndex(EOpIndexDirect, left, - intermediate.addConstantUnion(lhsArrayPos++, loc), loc); + // Loop through every component of every element of the internal, and copy to or from the matching external. + for (int internalArrayPos = 0; internalArrayPos < internalNodeArraySize; ++internalArrayPos) { + for (int internalComponent = 0; internalComponent < internalNodeVectorSize; ++internalComponent) { + // array member to read from / write to: + TIntermTyped* clipCullMember = intermediate.addIndex(EOpIndexDirect, clipCullSym, + intermediate.addConstantUnion(clipCullArrayPos++, loc), loc); - TIntermTyped* rhsMember = right; + TIntermTyped* internalMember = internalNode; - // If right is an array, extract the element of interest - if (right->getType().isArray()) { - const TType derefType(rhsMember->getType(), 0); - rhsMember = intermediate.addIndex(EOpIndexDirect, rhsMember, - intermediate.addConstantUnion(rhsArrayPos, loc), loc); - rhsMember->setType(derefType); + // If internal node is an array, extract the element of interest + if (internalNode->getType().isArray()) { + const TType derefType(internalMember->getType(), 0); + internalMember = intermediate.addIndex(EOpIndexDirect, internalMember, + intermediate.addConstantUnion(internalArrayPos, loc), loc); + internalMember->setType(derefType); } - // If right is a vector, extract the component of interest. - if (right->getType().isVector()) { - const TType derefType(rhsMember->getType(), 0); - rhsMember = intermediate.addIndex(EOpIndexDirect, rhsMember, - intermediate.addConstantUnion(rhsComponent, loc), loc); - rhsMember->setType(derefType); + // If internal node is a vector, extract the component of interest. + if (internalNode->getType().isVector()) { + const TType derefType(internalMember->getType(), 0); + internalMember = intermediate.addIndex(EOpIndexDirect, internalMember, + intermediate.addConstantUnion(internalComponent, loc), loc); + internalMember->setType(derefType); } - // Assign: to the proper lhs member. - assignList = intermediate.growAggregate(assignList, - intermediate.addAssign(op, lhsMember, rhsMember, loc)); + // Create an assignment: output from internal to clip cull, or input from clip cull to internal. + if (isOutput) + clipCullAssign = intermediate.addAssign(op, clipCullMember, internalMember, loc); + else + clipCullAssign = intermediate.addAssign(op, internalMember, clipCullMember, loc); + + // Track assignment in the sequence. + assignList = intermediate.growAggregate(assignList, clipCullAssign); } } @@ -2424,17 +2455,23 @@ TIntermAggregate* HlslParseContext::assignClipCullDistance(const TSourceLoc& loc // and possibly contains opaque values, such that the initializer should never exist // as emitted code, because even creating the initializer would write opaques. // -// Decompose this into individual member-wise assignments, which themselves are -// expected to then not exist for opaque types, because they will turn into aliases. +// If possible, decompose this into individual member-wise assignments, which themselves +// are expected to then not exist for opaque types, because they will turn into aliases. // // Return a node that contains the non-aliased assignments that must continue to exist. -TIntermAggregate* HlslParseContext::executeFlattenedInitializer(const TSourceLoc& loc, TIntermSymbol* symbol, - const TIntermAggregate& initializer) +TIntermTyped* HlslParseContext::executeFlattenedInitializer(const TSourceLoc& loc, TIntermSymbol* symbol, + TIntermAggregate& initializer) { + // We need individual RHS initializers per member to do this + const TTypeList* typeList = symbol->getType().getStruct(); + if (typeList == nullptr || initializer.getSequence().size() != typeList->size()) { + warn(loc, "cannot do member-wise aliasing for opaque members with this initializer", "=", ""); + return handleAssign(loc, EOpAssign, symbol, &initializer); + } + TIntermAggregate* initList = nullptr; // synthesize an access to each member, and then an assignment to it - const TTypeList& typeList = *symbol->getType().getStruct(); - for (int member = 0; member < (int)typeList.size(); ++member) { + for (int member = 0; member < (int)typeList->size(); ++member) { TIntermTyped* memberInitializer = initializer.getSequence()[member]->getAsTyped(); TIntermTyped* flattenedMember = flattenAccess(symbol, member); if (flattenedMember->getType().containsOpaque()) @@ -2474,8 +2511,10 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op // isn't, we fall back to a member-wise copy. if (!isFlattenLeft && !isFlattenRight && !isSplitLeft && !isSplitRight) { // Clip and cull distance requires more processing. See comment above assignClipCullDistance. - if (isClipOrCullDistance(left->getType())) { - const int semanticId = left->getType().getQualifier().layoutLocation; + if (isClipOrCullDistance(left->getType()) || isClipOrCullDistance(right->getType())) { + const bool isOutput = isClipOrCullDistance(left->getType()); + + const int semanticId = (isOutput ? left : right)->getType().getQualifier().layoutLocation; return assignClipCullDistance(loc, op, semanticId, left, right); } @@ -2655,13 +2694,15 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op TIntermTyped* subSplitRight = isSplitRight ? getMember(false, right, member, splitRight, memberR) : subRight; - if (isClipOrCullDistance(subSplitLeft->getType())) { + if (isClipOrCullDistance(subSplitLeft->getType()) || isClipOrCullDistance(subSplitRight->getType())) { // Clip and cull distance built-in assignment is complex in its own right, and is handled in // a separate function dedicated to that task. See comment above assignClipCullDistance; + const bool isOutput = isClipOrCullDistance(subSplitLeft->getType()); + // Since all clip/cull semantics boil down to the same built-in type, we need to get the // semantic ID from the dereferenced type's layout location, to avoid an N-1 mapping. - const TType derefType(left->getType(), member); + const TType derefType((isOutput ? left : right)->getType(), member); const int semanticId = derefType.getQualifier().layoutLocation; TIntermAggregate* clipCullAssign = assignClipCullDistance(loc, op, semanticId, @@ -3294,21 +3335,99 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType if (node == nullptr || !node->getAsOperator()) return; - const auto clampReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) -> TIntermTyped* { - // Sampler return must always be a vec4, but we can construct a shorter vector + // Sampler return must always be a vec4, but we can construct a shorter vector or a structure from it. + const auto convertReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) -> TIntermTyped* { result->setType(TType(node->getType().getBasicType(), EvqTemporary, node->getVectorSize())); - if (sampler.vectorSize < (unsigned)node->getVectorSize()) { - // Too many components. Construct shorter vector from it. - const TType clampedType(result->getType().getBasicType(), EvqTemporary, sampler.vectorSize); + TIntermTyped* convertedResult = nullptr; + + TType retType; + getTextureReturnType(sampler, retType); - const TOperator op = intermediate.mapTypeToConstructorOp(clampedType); + if (retType.isStruct()) { + // For type convenience, conversionAggregate points to the convertedResult (we know it's an aggregate here) + TIntermAggregate* conversionAggregate = new TIntermAggregate; + convertedResult = conversionAggregate; - result = constructBuiltIn(clampedType, op, result, loc, false); + // Convert vector output to return structure. We will need a temp symbol to copy the results to. + TVariable* structVar = makeInternalVariable("@sampleStructTemp", retType); + + // We also need a temp symbol to hold the result of the texture. We don't want to re-fetch the + // sample each time we'll index into the result, so we'll copy to this, and index into the copy. + TVariable* sampleShadow = makeInternalVariable("@sampleResultShadow", result->getType()); + + // Initial copy from texture to our sample result shadow. + TIntermTyped* shadowCopy = intermediate.addAssign(EOpAssign, intermediate.addSymbol(*sampleShadow, loc), + result, loc); + + conversionAggregate->getSequence().push_back(shadowCopy); + + unsigned vec4Pos = 0; + + for (unsigned m = 0; m < unsigned(retType.getStruct()->size()); ++m) { + const TType memberType(retType, m); // dereferenced type of the member we're about to assign. + + // Check for bad struct members. This should have been caught upstream. Complain, because + // wwe don't know what to do with it. This algorithm could be generalized to handle + // other things, e.g, sub-structures, but HLSL doesn't allow them. + if (!memberType.isVector() && !memberType.isScalar()) { + error(loc, "expected: scalar or vector type in texture structure", "", ""); + return nullptr; + } + + // Index into the struct variable to find the member to assign. + TIntermTyped* structMember = intermediate.addIndex(EOpIndexDirectStruct, + intermediate.addSymbol(*structVar, loc), + intermediate.addConstantUnion(m, loc), loc); + + structMember->setType(memberType); + + // Assign each component of (possible) vector in struct member. + for (int component = 0; component < memberType.getVectorSize(); ++component) { + TIntermTyped* vec4Member = intermediate.addIndex(EOpIndexDirect, + intermediate.addSymbol(*sampleShadow, loc), + intermediate.addConstantUnion(vec4Pos++, loc), loc); + vec4Member->setType(TType(memberType.getBasicType(), EvqTemporary, 1)); + + TIntermTyped* memberAssign = nullptr; + + if (memberType.isVector()) { + // Vector member: we need to create an access chain to the vector component. + + TIntermTyped* structVecComponent = intermediate.addIndex(EOpIndexDirect, structMember, + intermediate.addConstantUnion(component, loc), loc); + + memberAssign = intermediate.addAssign(EOpAssign, structVecComponent, vec4Member, loc); + } else { + // Scalar member: we can assign to it directly. + memberAssign = intermediate.addAssign(EOpAssign, structMember, vec4Member, loc); + } + + + conversionAggregate->getSequence().push_back(memberAssign); + } + } + + // Add completed variable so the expression results in the whole struct value we just built. + conversionAggregate->getSequence().push_back(intermediate.addSymbol(*structVar, loc)); + + // Make it a sequence. + intermediate.setAggregateOperator(conversionAggregate, EOpSequence, retType, loc); + } else { + // vector clamp the output if template vector type is smaller than sample result. + if (retType.getVectorSize() < node->getVectorSize()) { + // Too many components. Construct shorter vector from it. + const TOperator op = intermediate.mapTypeToConstructorOp(retType); + + convertedResult = constructBuiltIn(retType, op, result, loc, false); + } else { + // Enough components. Use directly. + convertedResult = result; + } } - result->setLoc(loc); - return result; + convertedResult->setLoc(loc); + return convertedResult; }; const TOperator op = node->getAsOperator()->getOp(); @@ -3374,7 +3493,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType tex->getSequence().push_back(constructCoord); // coordinate tex->getSequence().push_back(bias); // bias - node = clampReturn(tex, sampler); + node = convertReturn(tex, sampler); break; } @@ -3414,7 +3533,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType if (argOffset != nullptr) txsample->getSequence().push_back(argOffset); - node = clampReturn(txsample, sampler); + node = convertReturn(txsample, sampler); break; } @@ -3447,7 +3566,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType if (argOffset != nullptr) txsample->getSequence().push_back(argOffset); - node = clampReturn(txsample, sampler); + node = convertReturn(txsample, sampler); break; } @@ -3723,7 +3842,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType txfetch->getSequence().push_back(argOffset); } - node = clampReturn(txfetch, sampler); + node = convertReturn(txfetch, sampler); break; } @@ -3754,7 +3873,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType if (argOffset != nullptr) txsample->getSequence().push_back(argOffset); - node = clampReturn(txsample, sampler); + node = convertReturn(txsample, sampler); break; } @@ -6267,6 +6386,7 @@ void HlslParseContext::paramFix(TType& type) type.getQualifier().storage = EvqConstReadOnly; break; case EvqGlobal: + case EvqUniform: case EvqTemporary: type.getQualifier().storage = EvqIn; break; @@ -8698,9 +8818,6 @@ void HlslParseContext::correctInput(TQualifier& qualifier) qualifier.sample = false; } - if (isClipOrCullDistance(qualifier)) - qualifier.layoutLocation = TQualifier::layoutLocationEnd; - qualifier.clearStreamLayout(); qualifier.clearXfbLayout(); @@ -8757,6 +8874,106 @@ void HlslParseContext::clearUniformInputOutput(TQualifier& qualifier) } +// Set texture return type. Returns success (not all types are valid). +bool HlslParseContext::setTextureReturnType(TSampler& sampler, const TType& retType, const TSourceLoc& loc) +{ + // Seed the output with an invalid index. We will set it to a valid one if we can. + sampler.structReturnIndex = TSampler::noReturnStruct; + + // Arrays aren't supported. + if (retType.isArray()) { + error(loc, "Arrays not supported in texture template types", "", ""); + return false; + } + + // If return type is a vector, remember the vector size in the sampler, and return. + if (retType.isVector() || retType.isScalar()) { + sampler.vectorSize = retType.getVectorSize(); + return true; + } + + // If it wasn't a vector, it must be a struct meeting certain requirements. The requirements + // are checked below: just check for struct-ness here. + if (!retType.isStruct()) { + error(loc, "Invalid texture template type", "", ""); + return false; + } + + TTypeList* members = retType.getWritableStruct(); + + // Check for too many or not enough structure members. + if (members->size() > 4 || members->size() == 0) { + error(loc, "Invalid member count in texture template structure", "", ""); + return false; + } + + // Error checking: We must have <= 4 total components, all of the same basic type. + unsigned totalComponents = 0; + for (unsigned m = 0; m < members->size(); ++m) { + // Check for bad member types + if (!(*members)[m].type->isScalar() && !(*members)[m].type->isVector()) { + error(loc, "Invalid texture template struct member type", "", ""); + return false; + } + + const unsigned memberVectorSize = (*members)[m].type->getVectorSize(); + totalComponents += memberVectorSize; + + // too many total member components + if (totalComponents > 4) { + error(loc, "Too many components in texture template structure type", "", ""); + return false; + } + + // All members must be of a common basic type + if ((*members)[m].type->getBasicType() != (*members)[0].type->getBasicType()) { + error(loc, "Texture template structure members must same basic type", "", ""); + return false; + } + } + + // If the structure in the return type already exists in the table, we'll use it. Otherwise, we'll make + // a new entry. This is a linear search, but it hardly ever happens, and the list cannot be very large. + for (unsigned int idx = 0; idx < textureReturnStruct.size(); ++idx) { + if (textureReturnStruct[idx] == members) { + sampler.structReturnIndex = idx; + return true; + } + } + + // It wasn't found as an existing entry. See if we have room for a new one. + if (textureReturnStruct.size() >= TSampler::structReturnSlots) { + error(loc, "Texture template struct return slots exceeded", "", ""); + return false; + } + + // Insert it in the vector that tracks struct return types. + sampler.structReturnIndex = unsigned(textureReturnStruct.size()); + textureReturnStruct.push_back(members); + + // Success! + return true; +} + +// Return the sampler return type in retType. +void HlslParseContext::getTextureReturnType(const TSampler& sampler, TType& retType) const +{ + if (sampler.hasReturnStruct()) { + assert(textureReturnStruct.size() >= sampler.structReturnIndex); + + // We land here if the texture return is a structure. + TTypeList* blockStruct = textureReturnStruct[sampler.structReturnIndex]; + + const TType resultType(blockStruct, ""); + retType.shallowCopy(resultType); + } else { + // We land here if the texture return is a vector or scalar. + const TType resultType(sampler.type, EvqTemporary, sampler.getVectorSize()); + retType.shallowCopy(resultType); + } +} + + // Return a symbol for the tessellation linkage variable of the given TBuiltInVariable type TIntermSymbol* HlslParseContext::findTessLinkageSymbol(TBuiltInVariable biType) const { diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.h b/3rdparty/glslang/hlsl/hlslParseHelper.h index b743136ea..e545109cd 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.h +++ b/3rdparty/glslang/hlsl/hlslParseHelper.h @@ -89,7 +89,7 @@ public: void remapNonEntryPointIO(TFunction& function); TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg); - TIntermAggregate* executeFlattenedInitializer(const TSourceLoc&, TIntermSymbol*, const TIntermAggregate&); + TIntermTyped* executeFlattenedInitializer(const TSourceLoc&, TIntermSymbol*, TIntermAggregate&); TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleAssignToMatrixSwizzle(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*); @@ -213,6 +213,12 @@ public: // Share struct buffer deep types void shareStructBufferType(TType&); + // Set texture return type of the given sampler. Returns success (not all types are valid). + bool setTextureReturnType(TSampler& sampler, const TType& retType, const TSourceLoc& loc); + + // Obtain the sampler return type of the given sampler in retType. + void getTextureReturnType(const TSampler& sampler, TType& retType) const; + protected: struct TFlattenData { TFlattenData() : nextBinding(TQualifier::layoutBindingEnd), @@ -388,6 +394,10 @@ protected: // Structuredbuffer shared types. Typically there are only a few. TVector structBufferTypes; + + // This tracks texture sample user structure return types. Only a limited number are supported, as + // may fit in TSampler::structReturnIndex. + TVector textureReturnStruct; TMap structBufferCounter; @@ -425,8 +435,8 @@ protected: TVariable* gsStreamOutput; // geometry shader stream outputs, for emit (Append method) - TVariable* clipDistanceOutput; // synthesized clip distance output variable (shader might have >1) - TVariable* cullDistanceOutput; // synthesized cull distance output variable (shader might have >1) + TVariable* clipDistanceVariable; // synthesized clip distance variable (shader might have >1) + TVariable* cullDistanceVariable; // synthesized cull distance variable (shader might have >1) static const int maxClipCullRegs = 2; std::array clipSemanticNSize; // vector, indexed by clip semantic ID