diff --git a/BUILD.bazel b/BUILD.bazel index 1115b7de8..12168fae1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -146,6 +146,7 @@ genrule( "SPIRV/GLSL.ext.NV.h", "SPIRV/GLSL.std.450.h", "SPIRV/NonSemanticDebugPrintf.h", + "SPIRV/NonSemanticShaderDebugInfo100.h", "SPIRV/spirv.hpp", ], outs = [ @@ -155,6 +156,7 @@ genrule( "include/SPIRV/GLSL.ext.NV.h", "include/SPIRV/GLSL.std.450.h", "include/SPIRV/NonSemanticDebugPrintf.h", + "include/SPIRV/NonSemanticShaderDebugInfo100.h", "include/SPIRV/spirv.hpp", ], cmd_bash = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/", diff --git a/BUILD.gn b/BUILD.gn index 4dd0a5539..29328d407 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -133,6 +133,7 @@ template("glslang_sources_common") { "SPIRV/Logger.cpp", "SPIRV/Logger.h", "SPIRV/NonSemanticDebugPrintf.h", + "SPIRV/NonSemanticShaderDebugInfo100.h", "SPIRV/SPVRemapper.cpp", "SPIRV/SPVRemapper.h", "SPIRV/SpvBuilder.cpp", diff --git a/SPIRV/CInterface/spirv_c_interface.cpp b/SPIRV/CInterface/spirv_c_interface.cpp index d9312bbbd..5f577e119 100644 --- a/SPIRV/CInterface/spirv_c_interface.cpp +++ b/SPIRV/CInterface/spirv_c_interface.cpp @@ -86,6 +86,8 @@ GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, g glslang_spv_options_t spv_options; spv_options.generate_debug_info = false; spv_options.strip_debug_info = false; + spv_options.emit_nonsemantic_shader_debug_info = false; + spv_options.emit_nonsemantic_shader_debug_source = false; spv_options.disable_optimizer = true; spv_options.optimize_size = false; spv_options.disassemble = false; diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index 6724417f4..2408e4cce 100644 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -62,7 +62,8 @@ set(HEADERS disassemble.h GLSL.ext.AMD.h GLSL.ext.NV.h - NonSemanticDebugPrintf.h) + NonSemanticDebugPrintf.h + NonSemanticShaderDebugInfo100.h) set(SPVREMAP_HEADERS SPVRemapper.h diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 75fff3565..ded2663fe 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1557,6 +1557,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, for (auto iItr = include_txt.begin(); iItr != include_txt.end(); ++iItr) builder.addInclude(iItr->first, iItr->second); } + + builder.setEmitNonSemanticShaderDebugInfo(options.emitNonSemanticShaderDebugInfo); + builder.setEmitNonSemanticShaderDebugSource(options.emitNonSemanticShaderDebugSource); + stdBuiltins = builder.import("GLSL.std.450"); spv::AddressingModel addressingModel = spv::AddressingModelLogical; @@ -2498,6 +2502,14 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI return false; } + // Force variable declaration - Debug Mode Only + if (node->getOp() == glslang::EOpDeclare) { + builder.clearAccessChain(); + node->getOperand()->traverse(this); + builder.clearAccessChain(); + return false; + } + // Start by evaluating the operand // Does it need a swizzle inversion? If so, evaluation is inverted; @@ -2758,32 +2770,38 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision()); switch (node->getOp()) { + case glslang::EOpScope: case glslang::EOpSequence: { - if (preVisit) + if (visit == glslang::EvPreVisit) { ++sequenceDepth; - else + if (sequenceDepth == 1) { + // If this is the parent node of all the functions, we want to see them + // early, so all call points have actual SPIR-V functions to reference. + // In all cases, still let the traverser visit the children for us. + makeFunctions(node->getAsAggregate()->getSequence()); + + // Also, we want all globals initializers to go into the beginning of the entry point, before + // anything else gets there, so visit out of order, doing them all now. + makeGlobalInitializers(node->getAsAggregate()->getSequence()); + + //Pre process linker objects for ray tracing stages + if (glslangIntermediate->isRayTracingStage()) + collectRayTracingLinkerObjects(); + + // Initializers are done, don't want to visit again, but functions and link objects need to be processed, + // so do them manually. + visitFunctions(node->getAsAggregate()->getSequence()); + + return false; + } else { + if (node->getOp() == glslang::EOpScope) + builder.enterScope(0); + } + } else { + if (sequenceDepth > 1 && node->getOp() == glslang::EOpScope) + builder.leaveScope(); --sequenceDepth; - - if (sequenceDepth == 1) { - // If this is the parent node of all the functions, we want to see them - // early, so all call points have actual SPIR-V functions to reference. - // In all cases, still let the traverser visit the children for us. - makeFunctions(node->getAsAggregate()->getSequence()); - - // Also, we want all globals initializers to go into the beginning of the entry point, before - // anything else gets there, so visit out of order, doing them all now. - makeGlobalInitializers(node->getAsAggregate()->getSequence()); - - //Pre process linker objects for ray tracing stages - if (glslangIntermediate->isRayTracingStage()) - collectRayTracingLinkerObjects(); - - // Initializers are done, don't want to visit again, but functions and link objects need to be processed, - // so do them manually. - visitFunctions(node->getAsAggregate()->getSequence()); - - return false; } return true; @@ -2812,6 +2830,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (isShaderEntryPoint(node)) { inEntryPoint = true; builder.setBuildPoint(shaderEntry->getLastBlock()); + builder.enterFunction(shaderEntry); currentFunction = shaderEntry; } else { handleFunctionEntry(node); @@ -3796,8 +3815,8 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn // by a block-ending branch. But we don't want to put any other body/test // instructions in it, since the body/test may have arbitrary instructions, // including merges of its own. - builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.setBuildPoint(&blocks.head); + builder.setLine(node->getLoc().line, node->getLoc().getFilename()); builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, operands); if (node->testFirst() && node->getTest()) { spv::Block& test = builder.makeNewBlock(); @@ -4016,7 +4035,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* initializer = builder.makeNullConstant(spvType); } - return builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer); + return builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer, false); } // Return type Id of the sampled type. @@ -4104,7 +4123,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty if (explicitLayout != glslang::ElpNone) spvType = builder.makeUintType(32); else - spvType = builder.makeBoolType(); + spvType = builder.makeBoolType(false); break; case glslang::EbtInt: spvType = builder.makeIntType(32); @@ -4422,14 +4441,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy // except sometimes for blocks std::vector > deferredForwardPointers; for (int i = 0; i < (int)glslangMembers->size(); i++) { - glslang::TType& glslangMember = *(*glslangMembers)[i].type; - if (glslangMember.hiddenMember()) { + auto& glslangMember = (*glslangMembers)[i]; + if (glslangMember.type->hiddenMember()) { ++memberDelta; if (type.getBasicType() == glslang::EbtBlock) memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1; } else { if (type.getBasicType() == glslang::EbtBlock) { - if (filterMember(glslangMember)) { + if (filterMember(*glslangMember.type)) { memberDelta++; memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1; continue; @@ -4437,7 +4456,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = i - memberDelta; } // modify just this child's view of the qualifier - glslang::TQualifier memberQualifier = glslangMember.getQualifier(); + glslang::TQualifier memberQualifier = glslangMember.type->getQualifier(); InheritQualifiers(memberQualifier, qualifier); // manually inherit location @@ -4448,25 +4467,38 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy bool lastBufferBlockMember = qualifier.storage == glslang::EvqBuffer && i == (int)glslangMembers->size() - 1; - // Make forward pointers for any pointer members, and create a list of members to - // convert to spirv types after creating the struct. - if (glslangMember.isReference()) { - if (forwardPointers.find(glslangMember.getReferentType()) == forwardPointers.end()) { - deferredForwardPointers.push_back(std::make_pair(&glslangMember, memberQualifier)); - } - spvMembers.push_back( - convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, - true)); - } else { - spvMembers.push_back( - convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, - false)); + // Make forward pointers for any pointer members. + if (glslangMember.type->isReference() && + forwardPointers.find(glslangMember.type->getReferentType()) == forwardPointers.end()) { + deferredForwardPointers.push_back(std::make_pair(glslangMember.type, memberQualifier)); + } + + // Create the member type. + auto const spvMember = convertGlslangToSpvType(*glslangMember.type, explicitLayout, memberQualifier, lastBufferBlockMember, + glslangMember.type->isReference()); + spvMembers.push_back(spvMember); + + // Update the builder with the type's location so that we can create debug types for the structure members. + // There doesn't exist a "clean" entry point for this information to be passed along to the builder so, for now, + // it is stored in the builder and consumed during the construction of composite debug types. + // TODO: This probably warrants further investigation. This approach was decided to be the least ugly of the + // quick and dirty approaches that were tried. + // Advantages of this approach: + // + Relatively clean. No direct calls into debug type system. + // + Handles nested recursive structures. + // Disadvantages of this approach: + // + Not as clean as desired. Traverser queries/sets persistent state. This is fragile. + // + Table lookup during creation of composite debug types. This really shouldn't be necessary. + if(options.emitNonSemanticShaderDebugInfo) { + builder.debugTypeLocs[spvMember].name = glslangMember.type->getFieldName().c_str(); + builder.debugTypeLocs[spvMember].line = glslangMember.loc.line; + builder.debugTypeLocs[spvMember].column = glslangMember.loc.column; } } } // Make the SPIR-V type - spv::Id spvType = builder.makeStructType(spvMembers, type.getTypeName().c_str()); + spv::Id spvType = builder.makeStructType(spvMembers, type.getTypeName().c_str(), false); if (! HasNonLayoutQualifiers(type, qualifier)) structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType; @@ -5060,6 +5092,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF // GLSL has copy-in/copy-out semantics. They can be handled though with a pointer to a copy. std::vector paramTypes; + std::vector paramNames; std::vector> paramDecorations; // list of decorations per parameter glslang::TIntermSequence& parameters = glslFunction->getSequence()[0]->getAsAggregate()->getSequence(); @@ -5084,10 +5117,14 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF paramTypes.push_back(typeId); } + for (auto const parameter:parameters) { + paramNames.push_back(parameter->getAsSymbolNode()->getName().c_str()); + } + spv::Block* functionBlock; spv::Function *function = builder.makeFunctionEntry(TranslatePrecisionDecoration(glslFunction->getType()), convertGlslangToSpvType(glslFunction->getType()), - glslFunction->getName().c_str(), paramTypes, + glslFunction->getName().c_str(), paramTypes, paramNames, paramDecorations, &functionBlock); if (implicitThis) function->setImplicitThis(); @@ -5177,6 +5214,7 @@ void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate currentFunction = functionMap[node->getName().c_str()]; spv::Block* functionBlock = currentFunction->getEntryBlock(); builder.setBuildPoint(functionBlock); + builder.enterFunction(currentFunction); } void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, diff --git a/SPIRV/NonSemanticShaderDebugInfo100.h b/SPIRV/NonSemanticShaderDebugInfo100.h new file mode 100644 index 000000000..c52f32f80 --- /dev/null +++ b/SPIRV/NonSemanticShaderDebugInfo100.h @@ -0,0 +1,171 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ +#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticShaderDebugInfo100Version = 100, + NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff +}; +enum { + NonSemanticShaderDebugInfo100Revision = 6, + NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100Instructions { + NonSemanticShaderDebugInfo100DebugInfoNone = 0, + NonSemanticShaderDebugInfo100DebugCompilationUnit = 1, + NonSemanticShaderDebugInfo100DebugTypeBasic = 2, + NonSemanticShaderDebugInfo100DebugTypePointer = 3, + NonSemanticShaderDebugInfo100DebugTypeQualifier = 4, + NonSemanticShaderDebugInfo100DebugTypeArray = 5, + NonSemanticShaderDebugInfo100DebugTypeVector = 6, + NonSemanticShaderDebugInfo100DebugTypedef = 7, + NonSemanticShaderDebugInfo100DebugTypeFunction = 8, + NonSemanticShaderDebugInfo100DebugTypeEnum = 9, + NonSemanticShaderDebugInfo100DebugTypeComposite = 10, + NonSemanticShaderDebugInfo100DebugTypeMember = 11, + NonSemanticShaderDebugInfo100DebugTypeInheritance = 12, + NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13, + NonSemanticShaderDebugInfo100DebugTypeTemplate = 14, + NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15, + NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16, + NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17, + NonSemanticShaderDebugInfo100DebugGlobalVariable = 18, + NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19, + NonSemanticShaderDebugInfo100DebugFunction = 20, + NonSemanticShaderDebugInfo100DebugLexicalBlock = 21, + NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22, + NonSemanticShaderDebugInfo100DebugScope = 23, + NonSemanticShaderDebugInfo100DebugNoScope = 24, + NonSemanticShaderDebugInfo100DebugInlinedAt = 25, + NonSemanticShaderDebugInfo100DebugLocalVariable = 26, + NonSemanticShaderDebugInfo100DebugInlinedVariable = 27, + NonSemanticShaderDebugInfo100DebugDeclare = 28, + NonSemanticShaderDebugInfo100DebugValue = 29, + NonSemanticShaderDebugInfo100DebugOperation = 30, + NonSemanticShaderDebugInfo100DebugExpression = 31, + NonSemanticShaderDebugInfo100DebugMacroDef = 32, + NonSemanticShaderDebugInfo100DebugMacroUndef = 33, + NonSemanticShaderDebugInfo100DebugImportedEntity = 34, + NonSemanticShaderDebugInfo100DebugSource = 35, + NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101, + NonSemanticShaderDebugInfo100DebugSourceContinued = 102, + NonSemanticShaderDebugInfo100DebugLine = 103, + NonSemanticShaderDebugInfo100DebugNoLine = 104, + NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105, + NonSemanticShaderDebugInfo100DebugStoragePath = 106, + NonSemanticShaderDebugInfo100DebugEntryPoint = 107, + NonSemanticShaderDebugInfo100DebugTypeMatrix = 108, + NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff +}; + + +enum NonSemanticShaderDebugInfo100DebugInfoFlags { + NonSemanticShaderDebugInfo100None = 0x0000, + NonSemanticShaderDebugInfo100FlagIsProtected = 0x01, + NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02, + NonSemanticShaderDebugInfo100FlagIsPublic = 0x03, + NonSemanticShaderDebugInfo100FlagIsLocal = 0x04, + NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08, + NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10, + NonSemanticShaderDebugInfo100FlagArtificial = 0x20, + NonSemanticShaderDebugInfo100FlagExplicit = 0x40, + NonSemanticShaderDebugInfo100FlagPrototyped = 0x80, + NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100, + NonSemanticShaderDebugInfo100FlagStaticMember = 0x200, + NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400, + NonSemanticShaderDebugInfo100FlagLValueReference = 0x800, + NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000, + NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000, + NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000, + NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000, + NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000, + NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000, + NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100BuildIdentifierFlags { + NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01, + NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding { + NonSemanticShaderDebugInfo100Unspecified = 0, + NonSemanticShaderDebugInfo100Address = 1, + NonSemanticShaderDebugInfo100Boolean = 2, + NonSemanticShaderDebugInfo100Float = 3, + NonSemanticShaderDebugInfo100Signed = 4, + NonSemanticShaderDebugInfo100SignedChar = 5, + NonSemanticShaderDebugInfo100Unsigned = 6, + NonSemanticShaderDebugInfo100UnsignedChar = 7, + NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugCompositeType { + NonSemanticShaderDebugInfo100Class = 0, + NonSemanticShaderDebugInfo100Structure = 1, + NonSemanticShaderDebugInfo100Union = 2, + NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugTypeQualifier { + NonSemanticShaderDebugInfo100ConstType = 0, + NonSemanticShaderDebugInfo100VolatileType = 1, + NonSemanticShaderDebugInfo100RestrictType = 2, + NonSemanticShaderDebugInfo100AtomicType = 3, + NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugOperation { + NonSemanticShaderDebugInfo100Deref = 0, + NonSemanticShaderDebugInfo100Plus = 1, + NonSemanticShaderDebugInfo100Minus = 2, + NonSemanticShaderDebugInfo100PlusUconst = 3, + NonSemanticShaderDebugInfo100BitPiece = 4, + NonSemanticShaderDebugInfo100Swap = 5, + NonSemanticShaderDebugInfo100Xderef = 6, + NonSemanticShaderDebugInfo100StackValue = 7, + NonSemanticShaderDebugInfo100Constu = 8, + NonSemanticShaderDebugInfo100Fragment = 9, + NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfo100DebugImportedEntity { + NonSemanticShaderDebugInfo100ImportedModule = 0, + NonSemanticShaderDebugInfo100ImportedDeclaration = 1, + NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 36a3f0974..54df992fb 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -59,12 +59,15 @@ namespace spv { Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogger* buildLogger) : spvVersion(spvVersion), - source(SourceLanguageUnknown), + sourceLang(SourceLanguageUnknown), sourceVersion(0), sourceFileStringId(NoResult), currentLine(0), currentFile(nullptr), + currentFileId(NoResult), + lastDebugScopeId(NoResult), emitOpLines(false), + emitNonSemanticShaderDebugInfo(false), addressModel(AddressingModelLogical), memoryModel(MemoryModelGLSL450), builderNumber(magicNumber), @@ -98,8 +101,12 @@ void Builder::setLine(int lineNum) { if (lineNum != 0 && lineNum != currentLine) { currentLine = lineNum; - if (emitOpLines) - addLine(sourceFileStringId, currentLine, 0); + if (emitOpLines) { + if (emitNonSemanticShaderDebugInfo) + addDebugScopeAndLine(currentFileId, currentLine, 0); + else + addLine(sourceFileStringId, currentLine, 0); + } } } @@ -118,7 +125,10 @@ void Builder::setLine(int lineNum, const char* filename) currentFile = filename; if (emitOpLines) { spv::Id strId = getStringId(filename); - addLine(strId, currentLine, 0); + if (emitNonSemanticShaderDebugInfo) + addDebugScopeAndLine(strId, currentLine, 0); + else + addLine(strId, currentLine, 0); } } } @@ -132,22 +142,49 @@ void Builder::addLine(Id fileName, int lineNum, int column) buildPoint->addInstruction(std::unique_ptr(line)); } +void Builder::addDebugScopeAndLine(Id fileName, int lineNum, int column) +{ + if (currentDebugScopeId.top() != lastDebugScopeId) { + spv::Id resultId = getUniqueId(); + Instruction* scopeInst = new Instruction(resultId, makeVoidType(), OpExtInst); + scopeInst->addIdOperand(nonSemanticShaderDebugInfo); + scopeInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugScope); + scopeInst->addIdOperand(currentDebugScopeId.top()); + buildPoint->addInstruction(std::unique_ptr(scopeInst)); + lastDebugScopeId = currentDebugScopeId.top(); + } + spv::Id resultId = getUniqueId(); + Instruction* lineInst = new Instruction(resultId, makeVoidType(), OpExtInst); + lineInst->addIdOperand(nonSemanticShaderDebugInfo); + lineInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLine); + lineInst->addIdOperand(makeDebugSource(fileName)); + lineInst->addIdOperand(makeUintConstant(lineNum)); + lineInst->addIdOperand(makeUintConstant(lineNum)); + lineInst->addIdOperand(makeUintConstant(column)); + lineInst->addIdOperand(makeUintConstant(column)); + buildPoint->addInstruction(std::unique_ptr(lineInst)); +} + // For creating new groupedTypes (will return old type if the requested one was already made). Id Builder::makeVoidType() { Instruction* type; if (groupedTypes[OpTypeVoid].size() == 0) { - type = new Instruction(getUniqueId(), NoType, OpTypeVoid); + Id typeId = getUniqueId(); + type = new Instruction(typeId, NoType, OpTypeVoid); groupedTypes[OpTypeVoid].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // Core OpTypeVoid used for debug void type + if (emitNonSemanticShaderDebugInfo) + debugId[typeId] = typeId; } else type = groupedTypes[OpTypeVoid].back(); return type->getResultId(); } -Id Builder::makeBoolType() +Id Builder::makeBoolType(bool const compilerGenerated) { Instruction* type; if (groupedTypes[OpTypeBool].size() == 0) { @@ -158,6 +195,12 @@ Id Builder::makeBoolType() } else type = groupedTypes[OpTypeBool].back(); + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) + { + auto const debugResultId = makeBoolDebugType(32); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -172,6 +215,12 @@ Id Builder::makeSamplerType() } else type = groupedTypes[OpTypeSampler].back(); + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeCompositeDebugType({}, "type.sampler", NonSemanticShaderDebugInfo100Structure, true); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -268,6 +317,12 @@ Id Builder::makeIntegerType(int width, bool hasSign) break; } + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeIntegerDebugType(width, hasSign); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -305,6 +360,12 @@ Id Builder::makeFloatType(int width) break; } + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeFloatDebugType(width); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -312,7 +373,7 @@ Id Builder::makeFloatType(int width) // See makeStructResultType() for non-decorated structs // needed as the result of some instructions, which does // check for duplicates. -Id Builder::makeStructType(const std::vector& members, const char* name) +Id Builder::makeStructType(const std::vector& members, const char* name, bool const compilerGenerated) { // Don't look for previous one, because in the general case, // structs can be duplicated except for decorations. @@ -326,6 +387,12 @@ Id Builder::makeStructType(const std::vector& members, const char* name) module.mapInstruction(type); addName(type->getResultId(), name); + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) + { + auto const debugResultId = makeCompositeDebugType(members, name, NonSemanticShaderDebugInfo100Structure); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -372,6 +439,12 @@ Id Builder::makeVectorType(Id component, int size) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeVectorDebugType(component, size); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -398,6 +471,12 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeMatrixDebugType(column, cols); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -484,6 +563,12 @@ Id Builder::makeArrayType(Id element, Id sizeId, int stride) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeArrayDebugType(element, sizeId); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -494,6 +579,12 @@ Id Builder::makeRuntimeArray(Id element) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeArrayDebugType(element, makeUintConstant(0)); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -513,11 +604,25 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) } } if (! mismatch) + { + // If compiling HLSL, glslang will create a wrapper function around the entrypoint. Accordingly, a void(void) + // function type is created for the wrapper function. However, nonsemantic shader debug information is disabled + // while creating the HLSL wrapper. Consequently, if we encounter another void(void) function, we need to create + // the associated debug function type if it hasn't been created yet. + if(emitNonSemanticShaderDebugInfo && debugId[type->getResultId()] == 0) { + assert(sourceLang == spv::SourceLanguageHLSL); + assert(getTypeClass(returnType) == OpTypeVoid && paramTypes.size() == 0); + + Id debugTypeId = makeDebugFunctionType(returnType, {}); + debugId[type->getResultId()] = debugTypeId; + } return type->getResultId(); + } } // not found, make it - type = new Instruction(getUniqueId(), NoType, OpTypeFunction); + Id typeId = getUniqueId(); + type = new Instruction(typeId, NoType, OpTypeFunction); type->addIdOperand(returnType); for (int p = 0; p < (int)paramTypes.size(); ++p) type->addIdOperand(paramTypes[p]); @@ -525,9 +630,34 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + // make debug type and map it + if (emitNonSemanticShaderDebugInfo) { + Id debugTypeId = makeDebugFunctionType(returnType, paramTypes); + debugId[typeId] = debugTypeId; + } + return type->getResultId(); } +Id Builder::makeDebugFunctionType(Id returnType, const std::vector& paramTypes) +{ + assert(debugId[returnType] != 0); + + Id typeId = getUniqueId(); + auto type = new Instruction(typeId, makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeFunction); + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); + type->addIdOperand(debugId[returnType]); + for (auto const paramType : paramTypes) { + assert(isPointerType(paramType) || isArrayType(paramType)); + type->addIdOperand(debugId[getContainedTypeId(paramType)]); + } + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + return typeId; +} + Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format) { @@ -609,6 +739,22 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo } #endif + if (emitNonSemanticShaderDebugInfo) + { + auto TypeName = [&dim]() -> char const* { + switch (dim) { + case Dim1D: return "type.1d.image"; + case Dim2D: return "type.2d.image"; + case Dim3D: return "type.3d.image"; + case DimCube: return "type.cube.image"; + default: return "type.image"; + } + }; + + auto const debugResultId = makeCompositeDebugType({}, TypeName(), NonSemanticShaderDebugInfo100Class, true); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } @@ -630,9 +776,389 @@ Id Builder::makeSampledImageType(Id imageType) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) + { + auto const debugResultId = makeCompositeDebugType({}, "type.sampled.image", NonSemanticShaderDebugInfo100Class, true); + debugId[type->getResultId()] = debugResultId; + } + return type->getResultId(); } +Id Builder::makeDebugInfoNone() +{ + if (debugInfoNone != 0) + return debugInfoNone; + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugInfoNone); + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + debugInfoNone = inst->getResultId(); + + return debugInfoNone; +} + +Id Builder::makeBoolDebugType(int const size) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + if (type->getIdOperand(0) == getStringId("bool") && + type->getIdOperand(1) == static_cast(size) && + type->getIdOperand(2) == NonSemanticShaderDebugInfo100Boolean) + return type->getResultId(); + } + + type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + + type->addIdOperand(getStringId("bool")); // name id + type->addIdOperand(makeUintConstant(size)); // size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Boolean)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeIntegerDebugType(int const width, bool const hasSign) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + if (type->getIdOperand(0) == (hasSign ? getStringId("int") : getStringId("uint")) && + type->getIdOperand(1) == static_cast(width) && + type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfo100Signed : NonSemanticShaderDebugInfo100Unsigned)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + if(hasSign == true) { + type->addIdOperand(getStringId("int")); // name id + } else { + type->addIdOperand(getStringId("uint")); // name id + } + type->addIdOperand(makeUintConstant(width)); // size id + if(hasSign == true) { + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Signed)); // encoding id + } else { + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Unsigned)); // encoding id + } + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeFloatDebugType(int const width) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + if (type->getIdOperand(0) == getStringId("float") && + type->getIdOperand(1) == static_cast(width) && + type->getIdOperand(2) == NonSemanticShaderDebugInfo100Float) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + type->addIdOperand(getStringId("float")); // name id + type->addIdOperand(makeUintConstant(width)); // size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Float)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType) +{ + assert(sequenceType == NonSemanticShaderDebugInfo100DebugTypeArray || + sequenceType == NonSemanticShaderDebugInfo100DebugTypeVector); + + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[sequenceType].size(); ++t) { + type = groupedDebugTypes[sequenceType][t]; + if (type->getIdOperand(0) == baseType && + type->getIdOperand(1) == makeUintConstant(componentCount)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(sequenceType); + type->addIdOperand(debugId[baseType]); // base type + type->addIdOperand(componentCount); // component count + + groupedDebugTypes[sequenceType].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeArrayDebugType(Id const baseType, Id const componentCount) +{ + return makeSequentialDebugType(baseType, componentCount, NonSemanticShaderDebugInfo100DebugTypeArray); +} + +Id Builder::makeVectorDebugType(Id const baseType, int const componentCount) +{ + return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector);; +} + +Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix][t]; + if (type->getIdOperand(0) == vectorType && + type->getIdOperand(1) == makeUintConstant(vectorCount)) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMatrix); + type->addIdOperand(debugId[vectorType]); // vector type id + type->addIdOperand(makeUintConstant(vectorCount)); // component count id + type->addIdOperand(makeBoolConstant(columnMajor)); // column-major id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc) +{ + assert(debugId[memberType] != 0); + + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMember); + type->addIdOperand(getStringId(debugTypeLoc.name)); // name id + type->addIdOperand(debugId[memberType]); // type id + type->addIdOperand(makeDebugSource(sourceFileStringId)); // source id TODO: verify this works across include directives + type->addIdOperand(makeUintConstant(debugTypeLoc.line)); // line id TODO: currentLine is always zero + type->addIdOperand(makeUintConstant(debugTypeLoc.column)); // TODO: column id + type->addIdOperand(makeUintConstant(0)); // TODO: offset id + type->addIdOperand(makeUintConstant(0)); // TODO: size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMember].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// Note: To represent a source language opaque type, this instruction must have no Members operands, Size operand must be +// DebugInfoNone, and Name must start with @ to avoid clashes with user defined names. +Id Builder::makeCompositeDebugType(std::vector const& memberTypes, char const*const name, + NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType) +{ + // Create the debug member types. + std::vector memberDebugTypes; + for(auto const memberType : memberTypes) { + assert(debugTypeLocs.find(memberType) != debugTypeLocs.end()); + + memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType])); + + // TODO: Need to rethink this method of passing location information. + // debugTypeLocs.erase(memberType); + } + + // Create The structure debug type. + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeComposite); + type->addIdOperand(getStringId(name)); // name id + type->addIdOperand(makeUintConstant(tag)); // tag id + type->addIdOperand(makeDebugSource(sourceFileStringId)); // source id TODO: verify this works across include directives + type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? + type->addIdOperand(makeUintConstant(0)); // TODO: column id + type->addIdOperand(makeDebugCompilationUnit()); // scope id + if(isOpaqueType == true) { + // Prepend '@' to opaque types. + type->addIdOperand(getStringId('@' + std::string(name))); // linkage name id + type->addIdOperand(makeDebugInfoNone()); // size id + } else { + type->addIdOperand(getStringId(name)); // linkage name id + type->addIdOperand(makeUintConstant(0)); // TODO: size id + } + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id + assert(isOpaqueType == false || (isOpaqueType == true && memberDebugTypes.empty())); + for(auto const memberDebugType : memberDebugTypes) { + type->addIdOperand(memberDebugType); + } + + groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeComposite].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeDebugSource(const Id fileName) { + if (debugSourceId.find(fileName) != debugSourceId.end()) + return debugSourceId[fileName]; + spv::Id resultId = getUniqueId(); + Instruction* sourceInst = new Instruction(resultId, makeVoidType(), OpExtInst); + sourceInst->addIdOperand(nonSemanticShaderDebugInfo); + sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSource); + sourceInst->addIdOperand(fileName); + if (emitNonSemanticShaderDebugSource) { + spv::Id sourceId = 0; + if (fileName == sourceFileStringId) { + sourceId = getStringId(sourceText); + } else { + auto incItr = includeFiles.find(fileName); + assert(incItr != includeFiles.end()); + sourceId = getStringId(*incItr->second); + } + sourceInst->addIdOperand(sourceId); + } + constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); + module.mapInstruction(sourceInst); + debugSourceId[fileName] = resultId; + return resultId; +} + +Id Builder::makeDebugCompilationUnit() { + if (nonSemanticShaderCompilationUnitId != 0) + return nonSemanticShaderCompilationUnitId; + spv::Id resultId = getUniqueId(); + Instruction* sourceInst = new Instruction(resultId, makeVoidType(), OpExtInst); + sourceInst->addIdOperand(nonSemanticShaderDebugInfo); + sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugCompilationUnit); + sourceInst->addIdOperand(makeUintConstant(1)); // TODO(greg-lunarg): Get rid of magic number + sourceInst->addIdOperand(makeUintConstant(4)); // TODO(greg-lunarg): Get rid of magic number + sourceInst->addIdOperand(makeDebugSource(sourceFileStringId)); + sourceInst->addIdOperand(makeUintConstant(sourceLang)); + constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); + module.mapInstruction(sourceInst); + nonSemanticShaderCompilationUnitId = resultId; + return resultId; +} + +Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id const variable) +{ + assert(type != 0); + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugGlobalVariable); + inst->addIdOperand(getStringId(name)); // name id + inst->addIdOperand(type); // type id + inst->addIdOperand(makeDebugSource(sourceFileStringId)); // source id + inst->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? + inst->addIdOperand(makeUintConstant(0)); // TODO: column id + inst->addIdOperand(makeDebugCompilationUnit()); // scope id + inst->addIdOperand(getStringId(name)); // linkage name id + inst->addIdOperand(variable); // variable id + inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsDefinition)); // flags id + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + return inst->getResultId(); +} + +Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t const argNumber) +{ + assert(name != nullptr); + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable); + inst->addIdOperand(getStringId(name)); // name id + inst->addIdOperand(type); // type id + inst->addIdOperand(makeDebugSource(sourceFileStringId)); // source id + inst->addIdOperand(makeUintConstant(currentLine)); // line id + inst->addIdOperand(makeUintConstant(0)); // TODO: column id + inst->addIdOperand(currentDebugScopeId.top()); // scope id + inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsLocal)); // flags id + if(argNumber != 0) { + inst->addIdOperand(makeUintConstant(argNumber)); + } + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + return inst->getResultId(); +} + +Id Builder::makeDebugExpression() +{ + if (debugExpression != 0) + return debugExpression; + + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugExpression); + + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + + debugExpression = inst->getResultId(); + + return debugExpression; +} + +Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const localVariable) +{ + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugDeclare); + inst->addIdOperand(debugLocalVariable); // debug local variable id + inst->addIdOperand(localVariable); // local variable id + inst->addIdOperand(makeDebugExpression()); // expression id + buildPoint->addInstruction(std::unique_ptr(inst)); + + return inst->getResultId(); +} + +Id Builder::makeDebugValue(Id const debugLocalVariable, Id const value) +{ + Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst); + inst->addIdOperand(nonSemanticShaderDebugInfo); + inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugValue); + inst->addIdOperand(debugLocalVariable); // debug local variable id + inst->addIdOperand(value); // value id + inst->addIdOperand(makeDebugExpression()); // expression id + buildPoint->addInstruction(std::unique_ptr(inst)); + + return inst->getResultId(); +} + #ifndef GLSLANG_WEB Id Builder::makeAccelerationStructureType() { @@ -920,6 +1446,17 @@ bool Builder::isSpecConstantOpCode(Op opcode) const } } +bool Builder::isRayTracingOpCode(Op opcode) const +{ + switch (opcode) { + case OpTypeAccelerationStructureKHR: + case OpTypeRayQueryKHR: + return true; + default: + return false; + } +} + Id Builder::makeNullConstant(Id typeId) { Instruction* constant; @@ -1136,6 +1673,19 @@ Id Builder::makeFpConstant(Id type, double d, bool specConstant) return NoResult; } +Id Builder::importNonSemanticShaderDebugInfoInstructions() +{ + assert(emitNonSemanticShaderDebugInfo == true); + + if(nonSemanticShaderDebugInfo == 0) + { + this->addExtension(spv::E_SPV_KHR_non_semantic_info); + nonSemanticShaderDebugInfo = this->import("NonSemantic.Shader.DebugInfo.100"); + } + + return nonSemanticShaderDebugInfo; +} + Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector& comps) { Instruction* constant = 0; @@ -1447,23 +1997,34 @@ Function* Builder::makeEntryPoint(const char* entryPoint) assert(! entryPointFunction); Block* entry; - std::vector params; + std::vector paramsTypes; + std::vector paramNames; std::vector> decorations; - entryPointFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, decorations, &entry); + auto const returnType = makeVoidType(); + + restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; + if(sourceLang == spv::SourceLanguageHLSL) { + emitNonSemanticShaderDebugInfo = false; + } + + entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, paramsTypes, paramNames, decorations, &entry); + + emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; return entryPointFunction; } // Comments in header Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, - const std::vector& paramTypes, + const std::vector& paramTypes, const std::vector& paramNames, const std::vector>& decorations, Block **entry) { // Make the function and initial instructions in it Id typeId = makeFunctionType(returnType, paramTypes); Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size()); - Function* function = new Function(getUniqueId(), returnType, typeId, firstParamId, module); + Id funcId = getUniqueId(); + Function* function = new Function(funcId, returnType, typeId, firstParamId, module); // Set up the precisions setPrecision(function->getId(), precision); @@ -1475,11 +2036,39 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const } } + // Make the debug function instruction + if (emitNonSemanticShaderDebugInfo) { + Id nameId = getStringId(unmangleFunctionName(name)); + Id debugFuncId = makeDebugFunction(function, nameId, typeId); + debugId[funcId] = debugFuncId; + currentDebugScopeId.push(debugFuncId); + lastDebugScopeId = NoResult; + } + // CFG - if (entry) { - *entry = new Block(getUniqueId(), *function); - function->addBlock(*entry); - setBuildPoint(*entry); + assert(entry != nullptr); + *entry = new Block(getUniqueId(), *function); + function->addBlock(*entry); + setBuildPoint(*entry); + + // DebugScope and DebugLine for parameter DebugDeclares + if (emitNonSemanticShaderDebugInfo && (int)paramTypes.size() > 0) { + addDebugScopeAndLine(currentFileId, currentLine, 0); + } + + if (emitNonSemanticShaderDebugInfo) { + assert(paramTypes.size() == paramNames.size()); + for(size_t p = 0; p < paramTypes.size(); ++p) + { + auto const& paramType = paramTypes[p]; + assert(isPointerType(paramType) || isArrayType(paramType)); + assert(debugId[getContainedTypeId(paramType)] != 0); + auto const& paramName = paramNames[p]; + auto const debugLocalVariableId = createDebugLocalVariable(debugId[getContainedTypeId(paramType)], paramName, p+1); + debugId[firstParamId + p] = debugLocalVariableId; + + makeDebugDeclare(debugLocalVariableId, firstParamId + p); + } } if (name) @@ -1487,9 +2076,62 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const functions.push_back(std::unique_ptr(function)); + // Clear debug scope stack + if (emitNonSemanticShaderDebugInfo) + currentDebugScopeId.pop(); + return function; } +Id Builder::makeDebugFunction(Function* function, Id nameId, Id funcTypeId) { + assert(function != nullptr); + assert(nameId != 0); + assert(funcTypeId != 0); + assert(debugId[funcTypeId] != 0); + + Id funcId = getUniqueId(); + auto type = new Instruction(funcId, makeVoidType(), OpExtInst); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunction); + type->addIdOperand(nameId); + type->addIdOperand(debugId[funcTypeId]); + type->addIdOperand(makeDebugSource(currentFileId)); // Will be fixed later when true filename available + type->addIdOperand(makeUintConstant(currentLine)); // Will be fixed later when true line available + type->addIdOperand(makeUintConstant(0)); // column + type->addIdOperand(makeDebugCompilationUnit()); // scope + type->addIdOperand(nameId); // linkage name + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); + type->addIdOperand(makeUintConstant(currentLine)); // TODO(greg-lunarg): correct scope line + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + return funcId; +} + +Id Builder::makeDebugLexicalBlock(uint32_t line) { + Id lexId = getUniqueId(); + auto lex = new Instruction(lexId, makeVoidType(), OpExtInst); + lex->addIdOperand(nonSemanticShaderDebugInfo); + lex->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLexicalBlock); + lex->addIdOperand(makeDebugSource(currentFileId)); + lex->addIdOperand(makeUintConstant(line)); + lex->addIdOperand(makeUintConstant(0)); // column + lex->addIdOperand(currentDebugScopeId.top()); // scope + constantsTypesGlobals.push_back(std::unique_ptr(lex)); + module.mapInstruction(lex); + return lexId; +} + +std::string Builder::unmangleFunctionName(std::string const& name) const +{ + assert(name.length() > 0); + + if(name.rfind('(') != std::string::npos) { + return name.substr(0, name.rfind('(')); + } else { + return name; + } +} + // Comments in header void Builder::makeReturn(bool implicit, Id retVal) { @@ -1504,6 +2146,48 @@ void Builder::makeReturn(bool implicit, Id retVal) createAndSetNoPredecessorBlock("post-return"); } +// Comments in header +void Builder::enterScope(uint32_t line) +{ + // Generate new lexical scope debug instruction + Id lexId = makeDebugLexicalBlock(line); + currentDebugScopeId.push(lexId); + lastDebugScopeId = NoResult; +} + +// Comments in header +void Builder::leaveScope() +{ + // Pop current scope from stack and clear current scope + currentDebugScopeId.pop(); + lastDebugScopeId = NoResult; +} + +// Comments in header +void Builder::enterFunction(Function const* function) +{ + // Save and disable debugInfo for HLSL entry point function. It is a wrapper + // function with no user code in it. + restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; + if (sourceLang == spv::SourceLanguageHLSL && function == entryPointFunction) { + emitNonSemanticShaderDebugInfo = false; + } + + if (emitNonSemanticShaderDebugInfo) { + // Initialize scope state + Id funcId = function->getFuncId(); + currentDebugScopeId.push(debugId[funcId]); + // Create DebugFunctionDefinition + spv::Id resultId = getUniqueId(); + Instruction* defInst = new Instruction(resultId, makeVoidType(), OpExtInst); + defInst->addIdOperand(nonSemanticShaderDebugInfo); + defInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunctionDefinition); + defInst->addIdOperand(debugId[funcId]); + defInst->addIdOperand(funcId); + buildPoint->addInstruction(std::unique_ptr(defInst)); + } +} + // Comments in header void Builder::leaveFunction() { @@ -1519,6 +2203,12 @@ void Builder::leaveFunction() makeReturn(true, createUndefined(function.getReturnType())); } } + + // Clear function scope from debug scope stack + if (emitNonSemanticShaderDebugInfo) + currentDebugScopeId.pop(); + + emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; } // Comments in header @@ -1529,7 +2219,8 @@ void Builder::makeStatementTerminator(spv::Op opcode, const char *name) } // Comments in header -Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer) +Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer, + bool const compilerGenerated) { Id pointerType = makePointer(storageClass, type); Instruction* inst = new Instruction(getUniqueId(), pointerType, OpVariable); @@ -1541,11 +2232,27 @@ Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id t case StorageClassFunction: // Validation rules require the declaration in the entry block buildPoint->getParent().addLocalVariable(std::unique_ptr(inst)); + + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) + { + auto const debugLocalVariableId = createDebugLocalVariable(debugId[type], name); + debugId[inst->getResultId()] = debugLocalVariableId; + + // TODO: Remove? + // makeDebugDeclare(debugLocalVariableId, inst->getResultId()); + } + break; default: constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); + + if (emitNonSemanticShaderDebugInfo && !isRayTracingOpCode(getOpCode(type))) + { + auto const debugResultId = createDebugGlobalVariable(debugId[type], name, inst->getResultId()); + debugId[inst->getResultId()] = debugResultId; + } break; } @@ -1605,6 +2312,15 @@ void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAcce } buildPoint->addInstruction(std::unique_ptr(store)); + + if (emitNonSemanticShaderDebugInfo && !isGlobalVariable(lValue)) + { + if(debugId.find(lValue) != debugId.end()) + { + auto const debugLocalVariableId = debugId[lValue]; + makeDebugValue(debugLocalVariableId, rValue); + } + } } // Comments in header @@ -3271,10 +3987,10 @@ void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& te const int opSourceWordCount = 4; const int nonNullBytesPerInstruction = 4 * (maxWordCount - opSourceWordCount) - 1; - if (source != SourceLanguageUnknown) { + if (sourceLang != SourceLanguageUnknown) { // OpSource Language Version File Source Instruction sourceInst(NoResult, NoType, OpSource); - sourceInst.addImmediateOperand(source); + sourceInst.addImmediateOperand(sourceLang); sourceInst.addImmediateOperand(sourceVersion); // File operand if (fileId != NoResult) { @@ -3307,6 +4023,7 @@ void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& te // Dump an OpSource[Continued] sequence for the source and every include file void Builder::dumpSourceInstructions(std::vector& out) const { + if (emitNonSemanticShaderDebugInfo) return; dumpSourceInstructions(sourceFileStringId, sourceText, out); for (auto iItr = includeFiles.begin(); iItr != includeFiles.end(); ++iItr) dumpSourceInstructions(iItr->first, *iItr->second, out); diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 0d6bce631..8bbd5185e 100644 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -50,6 +50,10 @@ #include "Logger.h" #include "spirv.hpp" #include "spvIR.h" +namespace spv { + #include "GLSL.ext.KHR.h" + #include "NonSemanticShaderDebugInfo100.h" +} #include #include @@ -82,7 +86,7 @@ public: void setSource(spv::SourceLanguage lang, int version) { - source = lang; + sourceLang = lang; sourceVersion = version; } spv::Id getStringId(const std::string& str) @@ -106,11 +110,25 @@ public: void setSourceFile(const std::string& file) { sourceFileStringId = getStringId(file); + currentFileId = sourceFileStringId; } 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 setEmitNonSemanticShaderDebugInfo(bool const emit) + { + emitNonSemanticShaderDebugInfo = emit; + + if(emit) + { + importNonSemanticShaderDebugInfoInstructions(); + } + } + void setEmitNonSemanticShaderDebugSource(bool const src) + { + emitNonSemanticShaderDebugSource = src; + } void addExtension(const char* ext) { extensions.insert(ext); } void removeExtension(const char* ext) { @@ -163,10 +181,11 @@ public: void setLine(int line, const char* filename); // Low-level OpLine. See setLine() for a layered helper. void addLine(Id fileName, int line, int column); + void addDebugScopeAndLine(Id fileName, int line, int column); // For creating new types (will return old type if the requested one was already made). Id makeVoidType(); - Id makeBoolType(); + Id makeBoolType(bool const compilerGenerated = true); Id makePointer(StorageClass, Id pointee); Id makeForwardPointer(StorageClass); Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee); @@ -174,7 +193,7 @@ public: Id makeIntType(int width) { return makeIntegerType(width, true); } Id makeUintType(int width) { return makeIntegerType(width, false); } Id makeFloatType(int width); - Id makeStructType(const std::vector& members, const char*); + Id makeStructType(const std::vector& members, const char* name, bool const compilerGenerated = true); Id makeStructResultType(Id type0, Id type1); Id makeVectorType(Id component, int size); Id makeMatrixType(Id component, int cols, int rows); @@ -187,6 +206,36 @@ public: Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols); Id makeGenericType(spv::Op opcode, std::vector& operands); + // SPIR-V NonSemantic Shader DebugInfo Instructions + struct DebugTypeLoc { + std::string name {}; + int line {0}; + int column {0}; + }; + std::unordered_map debugTypeLocs; + Id makeDebugInfoNone(); + Id makeBoolDebugType(int const size); + Id makeIntegerDebugType(int const width, bool const hasSign); + Id makeFloatDebugType(int const width); + Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType); + Id makeArrayDebugType(Id const baseType, Id const componentCount); + Id makeVectorDebugType(Id const baseType, int const componentCount); + Id makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor = true); + Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc); + Id makeCompositeDebugType(std::vector const& memberTypes, char const*const name, + NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false); + Id makeDebugSource(const Id fileName); + Id makeDebugCompilationUnit(); + Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable); + Id createDebugLocalVariable(Id type, char const*const name, size_t const argNumber = 0); + Id makeDebugExpression(); + Id makeDebugDeclare(Id const debugLocalVariable, Id const localVariable); + Id makeDebugValue(Id const debugLocalVariable, Id const value); + Id makeDebugFunctionType(Id returnType, const std::vector& paramTypes); + Id makeDebugFunction(Function* function, Id nameId, Id funcTypeId); + Id makeDebugLexicalBlock(uint32_t line); + std::string unmangleFunctionName(std::string const& name) const; + // accelerationStructureNV type Id makeAccelerationStructureType(); // rayQueryEXT type @@ -261,6 +310,8 @@ public: // See if a resultId is valid for use as an initializer. bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); } + bool isRayTracingOpCode(Op opcode) const; + int getScalarTypeWidth(Id typeId) const { Id scalarTypeId = getScalarTypeId(typeId); @@ -322,6 +373,8 @@ public: Id makeFloat16Constant(float f16, bool specConstant = false); Id makeFpConstant(Id type, double d, bool specConstant = false); + Id importNonSemanticShaderDebugInfoInstructions(); + // Turn the array of constants into a proper spv constant of the requested type. Id makeCompositeConstant(Id type, const std::vector& comps, bool specConst = false); @@ -344,7 +397,12 @@ public: void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector& strings); // At the end of what block do the next create*() instructions go? - void setBuildPoint(Block* bp) { buildPoint = bp; } + // Also reset current last DebugScope and current source line to unknown + void setBuildPoint(Block* bp) { + buildPoint = bp; + lastDebugScopeId = NoResult; + currentLine = 0; + } Block* getBuildPoint() const { return buildPoint; } // Make the entry-point function. The returned pointer is only valid @@ -355,12 +413,22 @@ public: // Return the function, pass back the entry. // The returned pointer is only valid for the lifetime of this builder. Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, - const std::vector& paramTypes, const std::vector>& precisions, Block **entry = 0); + const std::vector& paramTypes, const std::vector& paramNames, + const std::vector>& precisions, Block **entry = 0); // Create a return. An 'implicit' return is one not appearing in the source // code. In the case of an implicit return, no post-return block is inserted. void makeReturn(bool implicit, Id retVal = 0); + // Initialize state and generate instructions for new lexical scope + void enterScope(uint32_t line); + + // Set state and generate instructions to exit current lexical scope + void leaveScope(); + + // Prepare builder for generation of instructions for a function. + void enterFunction(Function const* function); + // Generate all the code needed to finish up a function. void leaveFunction(); @@ -369,8 +437,8 @@ public: void makeStatementTerminator(spv::Op opcode, const char *name); // Create a global or function local or IO variable. - Id createVariable(Decoration precision, StorageClass, Id type, const char* name = nullptr, - Id initializer = NoResult); + Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr, + Id initializer = NoResult, bool const compilerGenerated = true); // Create an intermediate with an undefined value. Id createUndefined(Id type); @@ -805,13 +873,23 @@ public: const; unsigned int spvVersion; // the version of SPIR-V to emit in the header - SourceLanguage source; + SourceLanguage sourceLang; int sourceVersion; spv::Id sourceFileStringId; + spv::Id nonSemanticShaderCompilationUnitId {0}; + spv::Id nonSemanticShaderDebugInfo {0}; + spv::Id debugInfoNone {0}; + spv::Id debugExpression {0}; // Debug expression with zero operations. std::string sourceText; int currentLine; const char* currentFile; + spv::Id currentFileId; + std::stack currentDebugScopeId; + spv::Id lastDebugScopeId; bool emitOpLines; + bool emitNonSemanticShaderDebugInfo; + bool restoreNonSemanticShaderDebugInfo; + bool emitNonSemanticShaderDebugSource; std::set extensions; std::vector sourceExtensions; std::vector moduleProcesses; @@ -845,6 +923,8 @@ public: std::unordered_map> groupedStructConstants; // map type opcodes to type instructions std::unordered_map> groupedTypes; + // map type opcodes to debug type instructions + std::unordered_map> groupedDebugTypes; // list of OpConstantNull instructions std::vector nullConstants; @@ -860,6 +940,12 @@ public: // map from include file name ids to their contents std::map includeFiles; + // map from core id to debug id + std::map debugId; + + // map from file name string id to DebugSource id + std::unordered_map debugSourceId; + // The stream for outputting warnings and errors. SpvBuildLogger* logger; }; // end Builder class diff --git a/SPIRV/SpvTools.h b/SPIRV/SpvTools.h index 3fb3cbacd..5386048ab 100644 --- a/SPIRV/SpvTools.h +++ b/SPIRV/SpvTools.h @@ -53,14 +53,14 @@ namespace glslang { struct SpvOptions { - SpvOptions() : generateDebugInfo(false), stripDebugInfo(false), disableOptimizer(true), - optimizeSize(false), disassemble(false), validate(false) { } - bool generateDebugInfo; - bool stripDebugInfo; - bool disableOptimizer; - bool optimizeSize; - bool disassemble; - bool validate; + bool generateDebugInfo {false}; + bool stripDebugInfo {false}; + bool disableOptimizer {true}; + bool optimizeSize {false}; + bool disassemble {false}; + bool validate {false}; + bool emitNonSemanticShaderDebugInfo {false}; + bool emitNonSemanticShaderDebugSource{ false }; }; #if ENABLE_OPT diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 57e7d378b..09691273a 100644 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -349,6 +349,7 @@ public: const std::vector& getBlocks() const { return blocks; } void addLocalVariable(std::unique_ptr inst); Id getReturnType() const { return functionInstruction.getTypeId(); } + Id getFuncId() const { return functionInstruction.getResultId(); } void setReturnPrecision(Decoration precision) { if (precision == DecorationRelaxedPrecision) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 37282f2d0..f8894d161 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -113,6 +113,8 @@ bool SpvToolsDisassembler = false; bool SpvToolsValidate = false; bool NaNClamp = false; bool stripDebugInfo = false; +bool emitNonSemanticShaderDebugInfo = false; +bool emitNonSemanticShaderDebugSource = false; bool beQuiet = false; bool VulkanRulesRelaxed = false; bool autoSampledTextures = false; @@ -969,11 +971,21 @@ void ProcessArguments(std::vector>& workItem case 'g': // Override previous -g or -g0 argument stripDebugInfo = false; + emitNonSemanticShaderDebugInfo = false; Options &= ~EOptionDebug; if (argv[0][2] == '0') stripDebugInfo = true; - else + else { Options |= EOptionDebug; + if (argv[0][2] == 'V') { + emitNonSemanticShaderDebugInfo = true; + if (argv[0][3] == 'S') { + emitNonSemanticShaderDebugSource = true; + } else { + emitNonSemanticShaderDebugSource = false; + } + } + } break; case 'h': usage(); @@ -1379,6 +1391,9 @@ void CompileAndLinkShaderUnits(std::vector compUnits) if (EnhancedMsgs) shader->setEnhancedMsgs(); + if (emitNonSemanticShaderDebugInfo) + shader->setDebugInfo(true); + // Set up the environment, some subsettings take precedence over earlier // ways of setting things. if (Options & EOptionSpv) { @@ -1470,9 +1485,15 @@ void CompileAndLinkShaderUnits(std::vector compUnits) std::vector spirv; spv::SpvBuildLogger logger; glslang::SpvOptions spvOptions; - if (Options & EOptionDebug) + if (Options & EOptionDebug) { spvOptions.generateDebugInfo = true; - else if (stripDebugInfo) + if (emitNonSemanticShaderDebugInfo) { + spvOptions.emitNonSemanticShaderDebugInfo = true; + if (emitNonSemanticShaderDebugSource) { + spvOptions.emitNonSemanticShaderDebugSource = true; + } + } + } else if (stripDebugInfo) spvOptions.stripDebugInfo = true; spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0; spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0; @@ -1906,6 +1927,8 @@ void usage() " SPV_GOOGLE_hlsl_functionality1 extension\n" " -g generate debug information\n" " -g0 strip debug information\n" + " -gV generate nonsemantic shader debug information\n" + " -gVS generate nonsemantic shader debug information with source\n" " -h print this usage message\n" " -i intermediate tree (glslang AST) is printed out\n" " -l link all input files together to form a single module\n" diff --git a/Test/baseResults/spv.debugInfo.1.1.frag.out b/Test/baseResults/spv.debugInfo.1.1.frag.out index 109dc4bd5..fbf373b88 100644 --- a/Test/baseResults/spv.debugInfo.1.1.frag.out +++ b/Test/baseResults/spv.debugInfo.1.1.frag.out @@ -196,9 +196,11 @@ void main() Store 97(i) 18 Branch 98 98: Label + Line 1 46 0 LoopMerge 100 101 None Branch 102 102: Label + Line 1 46 0 103: 7(int) Load 97(i) 105: 37(bool) SLessThan 103 104 BranchConditional 105 99 100 diff --git a/Test/baseResults/spv.debugInfo.frag.out b/Test/baseResults/spv.debugInfo.frag.out index 909132715..9a9e0d941 100644 --- a/Test/baseResults/spv.debugInfo.frag.out +++ b/Test/baseResults/spv.debugInfo.frag.out @@ -197,9 +197,11 @@ void main() Store 97(i) 18 Branch 98 98: Label + Line 1 46 0 LoopMerge 100 101 None Branch 102 102: Label + Line 1 46 0 103: 7(int) Load 97(i) 105: 37(bool) SLessThan 103 104 BranchConditional 105 99 100 diff --git a/Test/baseResults/spv.debuginfo.glsl.comp.out b/Test/baseResults/spv.debuginfo.glsl.comp.out new file mode 100644 index 000000000..0b5e9ba2d --- /dev/null +++ b/Test/baseResults/spv.debuginfo.glsl.comp.out @@ -0,0 +1,1085 @@ +spv.debuginfo.glsl.comp +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 839 + + Capability Shader + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 13 "main" 117 + ExecutionMode 13 LocalSize 10 10 1 + 8: String "uint" + 14: String "main" + 17: String "" + 24: String "float" + 36: String "springForce" + 42: String "p0" + 46: String "p1" + 49: String "restDist" + 54: String "dist" + 65: String "int" + 71: String "sphereRadius" + 82: String "gravity" + 87: String "particleCount" + 90: String "UBO" + 95: String "params" + 114: String "id" + 119: String "gl_GlobalInvocationID" + 125: String "index" + 147: String "bool" + 155: String "normal" + 161: String "pinned" + 163: String "Particle" + 169: String "particleIn" + 173: String "ParticleIn" + 191: String "particleOut" + 194: String "ParticleOut" + 213: String "force" + 225: String "pos" + 234: String "vel" + 496: String "f" + 540: String "sphereDist" + 584: String "calculateNormals" + 587: String "PushConsts" + 592: String "pushConsts" + 619: String "a" + 631: String "b" + 647: String "c" + Name 13 "main" + Name 35 "springForce(vf3;vf3;f1;" + Name 32 "p0" + Name 33 "p1" + Name 34 "restDist" + Name 52 "dist" + Name 69 "UBO" + MemberName 69(UBO) 0 "deltaT" + MemberName 69(UBO) 1 "particleMass" + MemberName 69(UBO) 2 "springStiffness" + MemberName 69(UBO) 3 "damping" + MemberName 69(UBO) 4 "restDistH" + MemberName 69(UBO) 5 "restDistV" + MemberName 69(UBO) 6 "restDistD" + MemberName 69(UBO) 7 "sphereRadius" + MemberName 69(UBO) 8 "spherePos" + MemberName 69(UBO) 9 "gravity" + MemberName 69(UBO) 10 "particleCount" + Name 93 "params" + Name 112 "id" + Name 117 "gl_GlobalInvocationID" + Name 123 "index" + Name 153 "Particle" + MemberName 153(Particle) 0 "pos" + MemberName 153(Particle) 1 "vel" + MemberName 153(Particle) 2 "uv" + MemberName 153(Particle) 3 "normal" + MemberName 153(Particle) 4 "pinned" + Name 167 "ParticleIn" + MemberName 167(ParticleIn) 0 "particleIn" + Name 175 "" + Name 189 "ParticleOut" + MemberName 189(ParticleOut) 0 "particleOut" + Name 197 "" + Name 211 "force" + Name 223 "pos" + Name 232 "vel" + Name 249 "param" + Name 253 "param" + Name 255 "param" + Name 274 "param" + Name 278 "param" + Name 280 "param" + Name 303 "param" + Name 307 "param" + Name 309 "param" + Name 327 "param" + Name 331 "param" + Name 333 "param" + Name 364 "param" + Name 368 "param" + Name 370 "param" + Name 396 "param" + Name 400 "param" + Name 402 "param" + Name 436 "param" + Name 440 "param" + Name 442 "param" + Name 472 "param" + Name 476 "param" + Name 478 "param" + Name 494 "f" + Name 538 "sphereDist" + Name 582 "PushConsts" + MemberName 582(PushConsts) 0 "calculateNormals" + Name 590 "pushConsts" + Name 600 "normal" + Name 617 "a" + Name 629 "b" + Name 645 "c" + MemberDecorate 69(UBO) 0 Offset 0 + MemberDecorate 69(UBO) 1 Offset 4 + MemberDecorate 69(UBO) 2 Offset 8 + MemberDecorate 69(UBO) 3 Offset 12 + MemberDecorate 69(UBO) 4 Offset 16 + MemberDecorate 69(UBO) 5 Offset 20 + MemberDecorate 69(UBO) 6 Offset 24 + MemberDecorate 69(UBO) 7 Offset 28 + MemberDecorate 69(UBO) 8 Offset 32 + MemberDecorate 69(UBO) 9 Offset 48 + MemberDecorate 69(UBO) 10 Offset 64 + Decorate 69(UBO) Block + Decorate 93(params) DescriptorSet 0 + Decorate 93(params) Binding 2 + Decorate 117(gl_GlobalInvocationID) BuiltIn GlobalInvocationId + MemberDecorate 153(Particle) 0 Offset 0 + MemberDecorate 153(Particle) 1 Offset 16 + MemberDecorate 153(Particle) 2 Offset 32 + MemberDecorate 153(Particle) 3 Offset 48 + MemberDecorate 153(Particle) 4 Offset 64 + Decorate 165 ArrayStride 80 + MemberDecorate 167(ParticleIn) 0 Offset 0 + Decorate 167(ParticleIn) BufferBlock + Decorate 175 DescriptorSet 0 + Decorate 175 Binding 0 + Decorate 187 ArrayStride 80 + MemberDecorate 189(ParticleOut) 0 Offset 0 + Decorate 189(ParticleOut) BufferBlock + Decorate 197 DescriptorSet 0 + Decorate 197 Binding 1 + MemberDecorate 582(PushConsts) 0 Offset 0 + Decorate 582(PushConsts) Block + Decorate 838 BuiltIn WorkgroupSize + 3: TypeVoid + 4: TypeFunction 3 + 6: TypeInt 32 0 + 9: 6(int) Constant 32 + 10: 6(int) Constant 6 + 11: 6(int) Constant 0 + 7: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 8 9 10 11 + 12: 6(int) Constant 3 + 5: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 3 + 16: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 17 + 19: 6(int) Constant 1 + 20: 6(int) Constant 4 + 21: 6(int) Constant 2 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 19 20 16 21 + 15: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 14 5 16 11 11 18 14 12 11 + 23: TypeFloat 32 + 25: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 24 9 12 11 + 26: TypeVector 23(float) 3 + 27: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 12 + 28: TypePointer Function 26(fvec3) + 29: TypePointer Function 23(float) + 30: TypeFunction 26(fvec3) 28(ptr) 28(ptr) 29(ptr) + 31: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 27 27 27 25 + 37: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 36 31 16 11 11 18 36 12 11 + 41: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 42 27 16 11 11 37 20 19 + 44: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 46 27 16 11 11 37 20 21 + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 49 25 16 11 11 37 20 12 + 55: 6(int) Constant 68 + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 54 27 16 55 11 37 20 + 62: TypeVector 23(float) 4 + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 20 + 64: TypeInt 32 1 + 66: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 65 9 20 11 + 67: TypeVector 64(int) 2 + 68: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 66 21 + 69(UBO): TypeStruct 23(float) 23(float) 23(float) 23(float) 23(float) 23(float) 23(float) 23(float) 62(fvec4) 62(fvec4) 67(ivec2) + 72: 6(int) Constant 56 + 73: 6(int) Constant 8 + 70: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 74: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 75: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 77: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 78: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 79: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 80: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 71 25 16 72 73 11 11 12 + 83: 6(int) Constant 58 + 84: 6(int) Constant 7 + 81: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 82 63 16 83 84 11 11 12 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 82 63 16 83 84 11 11 12 + 88: 6(int) Constant 59 + 86: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 87 68 16 88 73 11 11 12 + 91: 6(int) Constant 69 + 89: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 90 19 16 91 11 18 90 11 12 70 74 75 76 77 78 79 80 81 85 86 + 92: TypePointer Uniform 69(UBO) + 93(params): 92(ptr) Variable Uniform + 94: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 95 89 16 91 11 18 95 93(params) 73 + 96: 64(int) Constant 2 + 97: TypePointer Uniform 23(float) + 109: TypeVector 6(int) 3 + 110: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 7 12 + 111: TypePointer Function 109(ivec3) + 115: 6(int) Constant 74 + 113: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 114 110 16 115 11 15 20 + 116: TypePointer Input 109(ivec3) +117(gl_GlobalInvocationID): 116(ptr) Variable Input + 118: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 119 110 16 115 11 18 119 117(gl_GlobalInvocationID) 73 + 122: TypePointer Function 6(int) + 126: 6(int) Constant 76 + 124: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 125 7 16 126 11 15 20 + 129: 64(int) Constant 10 + 130: TypePointer Uniform 64(int) + 146: TypeBool + 148: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 153(Particle): TypeStruct 62(fvec4) 62(fvec4) 62(fvec4) 62(fvec4) 23(float) + 156: 6(int) Constant 31 + 154: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 155 63 16 156 84 11 11 12 + 157: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 155 63 16 156 84 11 11 12 + 158: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 155 63 16 156 84 11 11 12 + 159: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 155 63 16 156 84 11 11 12 + 160: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 161 25 16 9 73 11 11 12 + 164: 6(int) Constant 81 + 162: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 163 19 16 164 11 18 163 11 12 154 157 158 159 160 + 165: TypeRuntimeArray 153(Particle) + 166: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 162 11 + 167(ParticleIn): TypeStruct 165 + 170: 6(int) Constant 36 + 171: 6(int) Constant 11 + 168: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 169 166 16 170 171 11 11 12 + 172: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 173 19 16 164 11 18 173 11 12 168 + 174: TypePointer Uniform 167(ParticleIn) + 175: 174(ptr) Variable Uniform + 176: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 17 172 16 164 11 18 17 175 73 + 177: 64(int) Constant 0 + 179: 64(int) Constant 4 + 182: 23(float) Constant 1065353216 + 183: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 187: TypeRuntimeArray 153(Particle) + 188: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 162 11 +189(ParticleOut): TypeStruct 187 + 192: 6(int) Constant 40 + 190: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 191 188 16 192 171 11 11 12 + 195: 6(int) Constant 82 + 193: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 194 19 16 195 11 18 194 11 12 190 + 196: TypePointer Uniform 189(ParticleOut) + 197: 196(ptr) Variable Uniform + 198: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 17 193 16 195 11 18 17 197 73 + 201: TypePointer Uniform 62(fvec4) + 206: 64(int) Constant 1 + 207: 23(float) Constant 0 + 208: 62(fvec4) ConstantComposite 207 207 207 207 + 214: 6(int) Constant 88 + 212: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 213 27 16 214 11 15 20 + 215: 64(int) Constant 9 + 226: 6(int) Constant 90 + 224: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 225 27 16 226 11 15 20 + 235: 6(int) Constant 91 + 233: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 234 27 16 235 11 15 20 + 243: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 268: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 293: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 302: 64(int) Constant 5 + 318: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 342: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 352: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 363: 64(int) Constant 6 + 379: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 385: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 415: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 425: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 455: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 461: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 485: 64(int) Constant 3 + 497: 6(int) Constant 130 + 495: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 496 27 16 497 11 15 20 + 511: 23(float) Constant 1056964608 + 541: 6(int) Constant 135 + 539: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 540 27 16 541 11 15 20 + 546: 64(int) Constant 8 + 554: 64(int) Constant 7 + 557: 23(float) Constant 1008981770 + 559: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 582(PushConsts): TypeStruct 6(int) + 585: 6(int) Constant 63 + 583: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 584 7 16 585 84 11 11 12 + 588: 6(int) Constant 144 + 586: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 587 19 16 588 11 18 587 11 12 583 + 589: TypePointer PushConstant 582(PushConsts) + 590(pushConsts): 589(ptr) Variable PushConstant + 591: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 592 586 16 588 11 18 592 590(pushConsts) 73 + 593: TypePointer PushConstant 6(int) + 596: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 602: 6(int) Constant 145 + 601: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 155 27 16 602 11 15 20 + 603: 26(fvec3) ConstantComposite 207 207 207 + 607: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 613: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 620: 6(int) Constant 149 + 618: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 619 27 16 620 11 15 20 + 632: 6(int) Constant 150 + 630: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 631 27 16 632 11 15 20 + 648: 6(int) Constant 151 + 646: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 647 27 16 648 11 15 20 + 676: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 727: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 733: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 784: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 147 9 21 11 + 837: 6(int) Constant 10 + 838: 109(ivec3) ConstantComposite 837 837 19 + 13(main): 3 Function None 4 + 22: Label + 112(id): 111(ptr) Variable Function + 123(index): 122(ptr) Variable Function + 211(force): 28(ptr) Variable Function + 223(pos): 28(ptr) Variable Function + 232(vel): 28(ptr) Variable Function + 249(param): 28(ptr) Variable Function + 253(param): 28(ptr) Variable Function + 255(param): 29(ptr) Variable Function + 274(param): 28(ptr) Variable Function + 278(param): 28(ptr) Variable Function + 280(param): 29(ptr) Variable Function + 303(param): 28(ptr) Variable Function + 307(param): 28(ptr) Variable Function + 309(param): 29(ptr) Variable Function + 327(param): 28(ptr) Variable Function + 331(param): 28(ptr) Variable Function + 333(param): 29(ptr) Variable Function + 364(param): 28(ptr) Variable Function + 368(param): 28(ptr) Variable Function + 370(param): 29(ptr) Variable Function + 396(param): 28(ptr) Variable Function + 400(param): 28(ptr) Variable Function + 402(param): 29(ptr) Variable Function + 436(param): 28(ptr) Variable Function + 440(param): 28(ptr) Variable Function + 442(param): 29(ptr) Variable Function + 472(param): 28(ptr) Variable Function + 476(param): 28(ptr) Variable Function + 478(param): 29(ptr) Variable Function + 494(f): 28(ptr) Variable Function + 538(sphereDist): 28(ptr) Variable Function + 600(normal): 28(ptr) Variable Function + 617(a): 28(ptr) Variable Function + 629(b): 28(ptr) Variable Function + 645(c): 28(ptr) Variable Function + 108: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main) + 120: 109(ivec3) Load 117(gl_GlobalInvocationID) + Store 112(id) 120 + 121: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 113 120 44 + 127: 122(ptr) AccessChain 112(id) 19 + 128: 6(int) Load 127 + 131: 130(ptr) AccessChain 93(params) 129 11 + 132: 64(int) Load 131 + 133: 6(int) Bitcast 132 + 134: 6(int) IMul 128 133 + 135: 122(ptr) AccessChain 112(id) 11 + 136: 6(int) Load 135 + 137: 6(int) IAdd 134 136 + Store 123(index) 137 + 138: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 124 137 44 + 139: 6(int) Load 123(index) + 140: 130(ptr) AccessChain 93(params) 129 11 + 141: 64(int) Load 140 + 142: 130(ptr) AccessChain 93(params) 129 19 + 143: 64(int) Load 142 + 144: 64(int) IMul 141 143 + 145: 6(int) Bitcast 144 + 149: 146(bool) UGreaterThan 139 145 + SelectionMerge 151 None + BranchConditional 149 150 151 + 150: Label + Return + 151: Label + 178: 6(int) Load 123(index) + 180: 97(ptr) AccessChain 175 177 178 179 + 181: 23(float) Load 180 + 184: 146(bool) FOrdEqual 181 182 + SelectionMerge 186 None + BranchConditional 184 185 186 + 185: Label + 199: 6(int) Load 123(index) + 200: 6(int) Load 123(index) + 202: 201(ptr) AccessChain 197 177 200 177 + 203: 62(fvec4) Load 202 + 204: 201(ptr) AccessChain 197 177 199 177 + Store 204 203 + 205: 6(int) Load 123(index) + 209: 201(ptr) AccessChain 197 177 205 206 + Store 209 208 + Return + 186: Label + 216: 201(ptr) AccessChain 93(params) 215 + 217: 62(fvec4) Load 216 + 218: 26(fvec3) VectorShuffle 217 217 0 1 2 + 219: 97(ptr) AccessChain 93(params) 206 + 220: 23(float) Load 219 + 221: 26(fvec3) VectorTimesScalar 218 220 + Store 211(force) 221 + 222: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 221 44 + 227: 6(int) Load 123(index) + 228: 201(ptr) AccessChain 175 177 227 177 + 229: 62(fvec4) Load 228 + 230: 26(fvec3) VectorShuffle 229 229 0 1 2 + Store 223(pos) 230 + 231: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 224 230 44 + 236: 6(int) Load 123(index) + 237: 201(ptr) AccessChain 175 177 236 206 + 238: 62(fvec4) Load 237 + 239: 26(fvec3) VectorShuffle 238 238 0 1 2 + Store 232(vel) 239 + 240: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 233 239 44 + 241: 122(ptr) AccessChain 112(id) 11 + 242: 6(int) Load 241 + 244: 146(bool) UGreaterThan 242 11 + SelectionMerge 246 None + BranchConditional 244 245 246 + 245: Label + 247: 6(int) Load 123(index) + 248: 6(int) ISub 247 19 + 250: 201(ptr) AccessChain 175 177 248 177 + 251: 62(fvec4) Load 250 + 252: 26(fvec3) VectorShuffle 251 251 0 1 2 + Store 249(param) 252 + 254: 26(fvec3) Load 223(pos) + Store 253(param) 254 + 256: 97(ptr) AccessChain 93(params) 179 + 257: 23(float) Load 256 + Store 255(param) 257 + 258: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 249(param) 253(param) 255(param) + 259: 26(fvec3) Load 211(force) + 260: 26(fvec3) FAdd 259 258 + Store 211(force) 260 + 261: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 260 44 + Branch 246 + 246: Label + 262: 122(ptr) AccessChain 112(id) 11 + 263: 6(int) Load 262 + 264: 130(ptr) AccessChain 93(params) 129 11 + 265: 64(int) Load 264 + 266: 64(int) ISub 265 206 + 267: 6(int) Bitcast 266 + 269: 146(bool) ULessThan 263 267 + SelectionMerge 271 None + BranchConditional 269 270 271 + 270: Label + 272: 6(int) Load 123(index) + 273: 6(int) IAdd 272 19 + 275: 201(ptr) AccessChain 175 177 273 177 + 276: 62(fvec4) Load 275 + 277: 26(fvec3) VectorShuffle 276 276 0 1 2 + Store 274(param) 277 + 279: 26(fvec3) Load 223(pos) + Store 278(param) 279 + 281: 97(ptr) AccessChain 93(params) 179 + 282: 23(float) Load 281 + Store 280(param) 282 + 283: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 274(param) 278(param) 280(param) + 284: 26(fvec3) Load 211(force) + 285: 26(fvec3) FAdd 284 283 + Store 211(force) 285 + 286: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 285 44 + Branch 271 + 271: Label + 287: 122(ptr) AccessChain 112(id) 19 + 288: 6(int) Load 287 + 289: 130(ptr) AccessChain 93(params) 129 19 + 290: 64(int) Load 289 + 291: 64(int) ISub 290 206 + 292: 6(int) Bitcast 291 + 294: 146(bool) ULessThan 288 292 + SelectionMerge 296 None + BranchConditional 294 295 296 + 295: Label + 297: 6(int) Load 123(index) + 298: 130(ptr) AccessChain 93(params) 129 11 + 299: 64(int) Load 298 + 300: 6(int) Bitcast 299 + 301: 6(int) IAdd 297 300 + 304: 201(ptr) AccessChain 175 177 301 177 + 305: 62(fvec4) Load 304 + 306: 26(fvec3) VectorShuffle 305 305 0 1 2 + Store 303(param) 306 + 308: 26(fvec3) Load 223(pos) + Store 307(param) 308 + 310: 97(ptr) AccessChain 93(params) 302 + 311: 23(float) Load 310 + Store 309(param) 311 + 312: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 303(param) 307(param) 309(param) + 313: 26(fvec3) Load 211(force) + 314: 26(fvec3) FAdd 313 312 + Store 211(force) 314 + 315: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 314 44 + Branch 296 + 296: Label + 316: 122(ptr) AccessChain 112(id) 19 + 317: 6(int) Load 316 + 319: 146(bool) UGreaterThan 317 11 + SelectionMerge 321 None + BranchConditional 319 320 321 + 320: Label + 322: 6(int) Load 123(index) + 323: 130(ptr) AccessChain 93(params) 129 11 + 324: 64(int) Load 323 + 325: 6(int) Bitcast 324 + 326: 6(int) ISub 322 325 + 328: 201(ptr) AccessChain 175 177 326 177 + 329: 62(fvec4) Load 328 + 330: 26(fvec3) VectorShuffle 329 329 0 1 2 + Store 327(param) 330 + 332: 26(fvec3) Load 223(pos) + Store 331(param) 332 + 334: 97(ptr) AccessChain 93(params) 302 + 335: 23(float) Load 334 + Store 333(param) 335 + 336: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 327(param) 331(param) 333(param) + 337: 26(fvec3) Load 211(force) + 338: 26(fvec3) FAdd 337 336 + Store 211(force) 338 + 339: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 338 44 + Branch 321 + 321: Label + 340: 122(ptr) AccessChain 112(id) 11 + 341: 6(int) Load 340 + 343: 146(bool) UGreaterThan 341 11 + SelectionMerge 345 None + BranchConditional 343 344 345 + 344: Label + 346: 122(ptr) AccessChain 112(id) 19 + 347: 6(int) Load 346 + 348: 130(ptr) AccessChain 93(params) 129 19 + 349: 64(int) Load 348 + 350: 64(int) ISub 349 206 + 351: 6(int) Bitcast 350 + 353: 146(bool) ULessThan 347 351 + Branch 345 + 345: Label + 354: 146(bool) Phi 343 321 353 344 + SelectionMerge 356 None + BranchConditional 354 355 356 + 355: Label + 357: 6(int) Load 123(index) + 358: 130(ptr) AccessChain 93(params) 129 11 + 359: 64(int) Load 358 + 360: 6(int) Bitcast 359 + 361: 6(int) IAdd 357 360 + 362: 6(int) ISub 361 19 + 365: 201(ptr) AccessChain 175 177 362 177 + 366: 62(fvec4) Load 365 + 367: 26(fvec3) VectorShuffle 366 366 0 1 2 + Store 364(param) 367 + 369: 26(fvec3) Load 223(pos) + Store 368(param) 369 + 371: 97(ptr) AccessChain 93(params) 363 + 372: 23(float) Load 371 + Store 370(param) 372 + 373: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 364(param) 368(param) 370(param) + 374: 26(fvec3) Load 211(force) + 375: 26(fvec3) FAdd 374 373 + Store 211(force) 375 + 376: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 375 44 + Branch 356 + 356: Label + 377: 122(ptr) AccessChain 112(id) 11 + 378: 6(int) Load 377 + 380: 146(bool) UGreaterThan 378 11 + SelectionMerge 382 None + BranchConditional 380 381 382 + 381: Label + 383: 122(ptr) AccessChain 112(id) 19 + 384: 6(int) Load 383 + 386: 146(bool) UGreaterThan 384 11 + Branch 382 + 382: Label + 387: 146(bool) Phi 380 356 386 381 + SelectionMerge 389 None + BranchConditional 387 388 389 + 388: Label + 390: 6(int) Load 123(index) + 391: 130(ptr) AccessChain 93(params) 129 11 + 392: 64(int) Load 391 + 393: 6(int) Bitcast 392 + 394: 6(int) ISub 390 393 + 395: 6(int) ISub 394 19 + 397: 201(ptr) AccessChain 175 177 395 177 + 398: 62(fvec4) Load 397 + 399: 26(fvec3) VectorShuffle 398 398 0 1 2 + Store 396(param) 399 + 401: 26(fvec3) Load 223(pos) + Store 400(param) 401 + 403: 97(ptr) AccessChain 93(params) 363 + 404: 23(float) Load 403 + Store 402(param) 404 + 405: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 396(param) 400(param) 402(param) + 406: 26(fvec3) Load 211(force) + 407: 26(fvec3) FAdd 406 405 + Store 211(force) 407 + 408: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 407 44 + Branch 389 + 389: Label + 409: 122(ptr) AccessChain 112(id) 11 + 410: 6(int) Load 409 + 411: 130(ptr) AccessChain 93(params) 129 11 + 412: 64(int) Load 411 + 413: 64(int) ISub 412 206 + 414: 6(int) Bitcast 413 + 416: 146(bool) ULessThan 410 414 + SelectionMerge 418 None + BranchConditional 416 417 418 + 417: Label + 419: 122(ptr) AccessChain 112(id) 19 + 420: 6(int) Load 419 + 421: 130(ptr) AccessChain 93(params) 129 19 + 422: 64(int) Load 421 + 423: 64(int) ISub 422 206 + 424: 6(int) Bitcast 423 + 426: 146(bool) ULessThan 420 424 + Branch 418 + 418: Label + 427: 146(bool) Phi 416 389 426 417 + SelectionMerge 429 None + BranchConditional 427 428 429 + 428: Label + 430: 6(int) Load 123(index) + 431: 130(ptr) AccessChain 93(params) 129 11 + 432: 64(int) Load 431 + 433: 6(int) Bitcast 432 + 434: 6(int) IAdd 430 433 + 435: 6(int) IAdd 434 19 + 437: 201(ptr) AccessChain 175 177 435 177 + 438: 62(fvec4) Load 437 + 439: 26(fvec3) VectorShuffle 438 438 0 1 2 + Store 436(param) 439 + 441: 26(fvec3) Load 223(pos) + Store 440(param) 441 + 443: 97(ptr) AccessChain 93(params) 363 + 444: 23(float) Load 443 + Store 442(param) 444 + 445: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 436(param) 440(param) 442(param) + 446: 26(fvec3) Load 211(force) + 447: 26(fvec3) FAdd 446 445 + Store 211(force) 447 + 448: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 447 44 + Branch 429 + 429: Label + 449: 122(ptr) AccessChain 112(id) 11 + 450: 6(int) Load 449 + 451: 130(ptr) AccessChain 93(params) 129 11 + 452: 64(int) Load 451 + 453: 64(int) ISub 452 206 + 454: 6(int) Bitcast 453 + 456: 146(bool) ULessThan 450 454 + SelectionMerge 458 None + BranchConditional 456 457 458 + 457: Label + 459: 122(ptr) AccessChain 112(id) 19 + 460: 6(int) Load 459 + 462: 146(bool) UGreaterThan 460 11 + Branch 458 + 458: Label + 463: 146(bool) Phi 456 429 462 457 + SelectionMerge 465 None + BranchConditional 463 464 465 + 464: Label + 466: 6(int) Load 123(index) + 467: 130(ptr) AccessChain 93(params) 129 11 + 468: 64(int) Load 467 + 469: 6(int) Bitcast 468 + 470: 6(int) ISub 466 469 + 471: 6(int) IAdd 470 19 + 473: 201(ptr) AccessChain 175 177 471 177 + 474: 62(fvec4) Load 473 + 475: 26(fvec3) VectorShuffle 474 474 0 1 2 + Store 472(param) 475 + 477: 26(fvec3) Load 223(pos) + Store 476(param) 477 + 479: 97(ptr) AccessChain 93(params) 363 + 480: 23(float) Load 479 + Store 478(param) 480 + 481: 26(fvec3) FunctionCall 35(springForce(vf3;vf3;f1;) 472(param) 476(param) 478(param) + 482: 26(fvec3) Load 211(force) + 483: 26(fvec3) FAdd 482 481 + Store 211(force) 483 + 484: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 483 44 + Branch 465 + 465: Label + 486: 97(ptr) AccessChain 93(params) 485 + 487: 23(float) Load 486 + 488: 23(float) FNegate 487 + 489: 26(fvec3) Load 232(vel) + 490: 26(fvec3) VectorTimesScalar 489 488 + 491: 26(fvec3) Load 211(force) + 492: 26(fvec3) FAdd 491 490 + Store 211(force) 492 + 493: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 212 492 44 + 498: 26(fvec3) Load 211(force) + 499: 97(ptr) AccessChain 93(params) 206 + 500: 23(float) Load 499 + 501: 23(float) FDiv 182 500 + 502: 26(fvec3) VectorTimesScalar 498 501 + Store 494(f) 502 + 503: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 495 502 44 + 504: 6(int) Load 123(index) + 505: 26(fvec3) Load 223(pos) + 506: 26(fvec3) Load 232(vel) + 507: 97(ptr) AccessChain 93(params) 177 + 508: 23(float) Load 507 + 509: 26(fvec3) VectorTimesScalar 506 508 + 510: 26(fvec3) FAdd 505 509 + 512: 26(fvec3) Load 494(f) + 513: 26(fvec3) VectorTimesScalar 512 511 + 514: 97(ptr) AccessChain 93(params) 177 + 515: 23(float) Load 514 + 516: 26(fvec3) VectorTimesScalar 513 515 + 517: 97(ptr) AccessChain 93(params) 177 + 518: 23(float) Load 517 + 519: 26(fvec3) VectorTimesScalar 516 518 + 520: 26(fvec3) FAdd 510 519 + 521: 23(float) CompositeExtract 520 0 + 522: 23(float) CompositeExtract 520 1 + 523: 23(float) CompositeExtract 520 2 + 524: 62(fvec4) CompositeConstruct 521 522 523 182 + 525: 201(ptr) AccessChain 197 177 504 177 + Store 525 524 + 526: 6(int) Load 123(index) + 527: 26(fvec3) Load 232(vel) + 528: 26(fvec3) Load 494(f) + 529: 97(ptr) AccessChain 93(params) 177 + 530: 23(float) Load 529 + 531: 26(fvec3) VectorTimesScalar 528 530 + 532: 26(fvec3) FAdd 527 531 + 533: 23(float) CompositeExtract 532 0 + 534: 23(float) CompositeExtract 532 1 + 535: 23(float) CompositeExtract 532 2 + 536: 62(fvec4) CompositeConstruct 533 534 535 207 + 537: 201(ptr) AccessChain 197 177 526 206 + Store 537 536 + 542: 6(int) Load 123(index) + 543: 201(ptr) AccessChain 197 177 542 177 + 544: 62(fvec4) Load 543 + 545: 26(fvec3) VectorShuffle 544 544 0 1 2 + 547: 201(ptr) AccessChain 93(params) 546 + 548: 62(fvec4) Load 547 + 549: 26(fvec3) VectorShuffle 548 548 0 1 2 + 550: 26(fvec3) FSub 545 549 + Store 538(sphereDist) 550 + 551: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 539 550 44 + 552: 26(fvec3) Load 538(sphereDist) + 553: 23(float) ExtInst 2(GLSL.std.450) 66(Length) 552 + 555: 97(ptr) AccessChain 93(params) 554 + 556: 23(float) Load 555 + 558: 23(float) FAdd 556 557 + 560: 146(bool) FOrdLessThan 553 558 + SelectionMerge 562 None + BranchConditional 560 561 562 + 561: Label + 563: 6(int) Load 123(index) + 564: 201(ptr) AccessChain 93(params) 546 + 565: 62(fvec4) Load 564 + 566: 26(fvec3) VectorShuffle 565 565 0 1 2 + 567: 26(fvec3) Load 538(sphereDist) + 568: 26(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 567 + 569: 97(ptr) AccessChain 93(params) 554 + 570: 23(float) Load 569 + 571: 23(float) FAdd 570 557 + 572: 26(fvec3) VectorTimesScalar 568 571 + 573: 26(fvec3) FAdd 566 572 + 574: 97(ptr) AccessChain 197 177 563 177 11 + 575: 23(float) CompositeExtract 573 0 + Store 574 575 + 576: 97(ptr) AccessChain 197 177 563 177 19 + 577: 23(float) CompositeExtract 573 1 + Store 576 577 + 578: 97(ptr) AccessChain 197 177 563 177 21 + 579: 23(float) CompositeExtract 573 2 + Store 578 579 + 580: 6(int) Load 123(index) + 581: 201(ptr) AccessChain 197 177 580 206 + Store 581 208 + Branch 562 + 562: Label + 594: 593(ptr) AccessChain 590(pushConsts) 177 + 595: 6(int) Load 594 + 597: 146(bool) IEqual 595 19 + SelectionMerge 599 None + BranchConditional 597 598 599 + 598: Label + Store 600(normal) 603 + 604: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 601 603 44 + 605: 122(ptr) AccessChain 112(id) 19 + 606: 6(int) Load 605 + 608: 146(bool) UGreaterThan 606 11 + SelectionMerge 610 None + BranchConditional 608 609 610 + 609: Label + 611: 122(ptr) AccessChain 112(id) 11 + 612: 6(int) Load 611 + 614: 146(bool) UGreaterThan 612 11 + SelectionMerge 616 None + BranchConditional 614 615 616 + 615: Label + 621: 6(int) Load 123(index) + 622: 6(int) ISub 621 19 + 623: 201(ptr) AccessChain 175 177 622 177 + 624: 62(fvec4) Load 623 + 625: 26(fvec3) VectorShuffle 624 624 0 1 2 + 626: 26(fvec3) Load 223(pos) + 627: 26(fvec3) FSub 625 626 + Store 617(a) 627 + 628: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 618 627 44 + 633: 6(int) Load 123(index) + 634: 130(ptr) AccessChain 93(params) 129 11 + 635: 64(int) Load 634 + 636: 6(int) Bitcast 635 + 637: 6(int) ISub 633 636 + 638: 6(int) ISub 637 19 + 639: 201(ptr) AccessChain 175 177 638 177 + 640: 62(fvec4) Load 639 + 641: 26(fvec3) VectorShuffle 640 640 0 1 2 + 642: 26(fvec3) Load 223(pos) + 643: 26(fvec3) FSub 641 642 + Store 629(b) 643 + 644: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 630 643 44 + 649: 6(int) Load 123(index) + 650: 130(ptr) AccessChain 93(params) 129 11 + 651: 64(int) Load 650 + 652: 6(int) Bitcast 651 + 653: 6(int) ISub 649 652 + 654: 201(ptr) AccessChain 175 177 653 177 + 655: 62(fvec4) Load 654 + 656: 26(fvec3) VectorShuffle 655 655 0 1 2 + 657: 26(fvec3) Load 223(pos) + 658: 26(fvec3) FSub 656 657 + Store 645(c) 658 + 659: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 646 658 44 + 660: 26(fvec3) Load 617(a) + 661: 26(fvec3) Load 629(b) + 662: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 660 661 + 663: 26(fvec3) Load 629(b) + 664: 26(fvec3) Load 645(c) + 665: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 663 664 + 666: 26(fvec3) FAdd 662 665 + 667: 26(fvec3) Load 600(normal) + 668: 26(fvec3) FAdd 667 666 + Store 600(normal) 668 + 669: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 601 668 44 + Branch 616 + 616: Label + 670: 122(ptr) AccessChain 112(id) 11 + 671: 6(int) Load 670 + 672: 130(ptr) AccessChain 93(params) 129 11 + 673: 64(int) Load 672 + 674: 64(int) ISub 673 206 + 675: 6(int) Bitcast 674 + 677: 146(bool) ULessThan 671 675 + SelectionMerge 679 None + BranchConditional 677 678 679 + 678: Label + 680: 6(int) Load 123(index) + 681: 130(ptr) AccessChain 93(params) 129 11 + 682: 64(int) Load 681 + 683: 6(int) Bitcast 682 + 684: 6(int) ISub 680 683 + 685: 201(ptr) AccessChain 175 177 684 177 + 686: 62(fvec4) Load 685 + 687: 26(fvec3) VectorShuffle 686 686 0 1 2 + 688: 26(fvec3) Load 223(pos) + 689: 26(fvec3) FSub 687 688 + Store 617(a) 689 + 690: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 618 689 44 + 691: 6(int) Load 123(index) + 692: 130(ptr) AccessChain 93(params) 129 11 + 693: 64(int) Load 692 + 694: 6(int) Bitcast 693 + 695: 6(int) ISub 691 694 + 696: 6(int) IAdd 695 19 + 697: 201(ptr) AccessChain 175 177 696 177 + 698: 62(fvec4) Load 697 + 699: 26(fvec3) VectorShuffle 698 698 0 1 2 + 700: 26(fvec3) Load 223(pos) + 701: 26(fvec3) FSub 699 700 + Store 629(b) 701 + 702: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 630 701 44 + 703: 6(int) Load 123(index) + 704: 6(int) IAdd 703 19 + 705: 201(ptr) AccessChain 175 177 704 177 + 706: 62(fvec4) Load 705 + 707: 26(fvec3) VectorShuffle 706 706 0 1 2 + 708: 26(fvec3) Load 223(pos) + 709: 26(fvec3) FSub 707 708 + Store 645(c) 709 + 710: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 646 709 44 + 711: 26(fvec3) Load 617(a) + 712: 26(fvec3) Load 629(b) + 713: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 711 712 + 714: 26(fvec3) Load 629(b) + 715: 26(fvec3) Load 645(c) + 716: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 714 715 + 717: 26(fvec3) FAdd 713 716 + 718: 26(fvec3) Load 600(normal) + 719: 26(fvec3) FAdd 718 717 + Store 600(normal) 719 + 720: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 601 719 44 + Branch 679 + 679: Label + Branch 610 + 610: Label + 721: 122(ptr) AccessChain 112(id) 19 + 722: 6(int) Load 721 + 723: 130(ptr) AccessChain 93(params) 129 19 + 724: 64(int) Load 723 + 725: 64(int) ISub 724 206 + 726: 6(int) Bitcast 725 + 728: 146(bool) ULessThan 722 726 + SelectionMerge 730 None + BranchConditional 728 729 730 + 729: Label + 731: 122(ptr) AccessChain 112(id) 11 + 732: 6(int) Load 731 + 734: 146(bool) UGreaterThan 732 11 + SelectionMerge 736 None + BranchConditional 734 735 736 + 735: Label + 737: 6(int) Load 123(index) + 738: 130(ptr) AccessChain 93(params) 129 11 + 739: 64(int) Load 738 + 740: 6(int) Bitcast 739 + 741: 6(int) IAdd 737 740 + 742: 201(ptr) AccessChain 175 177 741 177 + 743: 62(fvec4) Load 742 + 744: 26(fvec3) VectorShuffle 743 743 0 1 2 + 745: 26(fvec3) Load 223(pos) + 746: 26(fvec3) FSub 744 745 + Store 617(a) 746 + 747: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 618 746 44 + 748: 6(int) Load 123(index) + 749: 130(ptr) AccessChain 93(params) 129 11 + 750: 64(int) Load 749 + 751: 6(int) Bitcast 750 + 752: 6(int) IAdd 748 751 + 753: 6(int) ISub 752 19 + 754: 201(ptr) AccessChain 175 177 753 177 + 755: 62(fvec4) Load 754 + 756: 26(fvec3) VectorShuffle 755 755 0 1 2 + 757: 26(fvec3) Load 223(pos) + 758: 26(fvec3) FSub 756 757 + Store 629(b) 758 + 759: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 630 758 44 + 760: 6(int) Load 123(index) + 761: 6(int) ISub 760 19 + 762: 201(ptr) AccessChain 175 177 761 177 + 763: 62(fvec4) Load 762 + 764: 26(fvec3) VectorShuffle 763 763 0 1 2 + 765: 26(fvec3) Load 223(pos) + 766: 26(fvec3) FSub 764 765 + Store 645(c) 766 + 767: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 646 766 44 + 768: 26(fvec3) Load 617(a) + 769: 26(fvec3) Load 629(b) + 770: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 768 769 + 771: 26(fvec3) Load 629(b) + 772: 26(fvec3) Load 645(c) + 773: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 771 772 + 774: 26(fvec3) FAdd 770 773 + 775: 26(fvec3) Load 600(normal) + 776: 26(fvec3) FAdd 775 774 + Store 600(normal) 776 + 777: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 601 776 44 + Branch 736 + 736: Label + 778: 122(ptr) AccessChain 112(id) 11 + 779: 6(int) Load 778 + 780: 130(ptr) AccessChain 93(params) 129 11 + 781: 64(int) Load 780 + 782: 64(int) ISub 781 206 + 783: 6(int) Bitcast 782 + 785: 146(bool) ULessThan 779 783 + SelectionMerge 787 None + BranchConditional 785 786 787 + 786: Label + 788: 6(int) Load 123(index) + 789: 6(int) IAdd 788 19 + 790: 201(ptr) AccessChain 175 177 789 177 + 791: 62(fvec4) Load 790 + 792: 26(fvec3) VectorShuffle 791 791 0 1 2 + 793: 26(fvec3) Load 223(pos) + 794: 26(fvec3) FSub 792 793 + Store 617(a) 794 + 795: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 618 794 44 + 796: 6(int) Load 123(index) + 797: 130(ptr) AccessChain 93(params) 129 11 + 798: 64(int) Load 797 + 799: 6(int) Bitcast 798 + 800: 6(int) IAdd 796 799 + 801: 6(int) IAdd 800 19 + 802: 201(ptr) AccessChain 175 177 801 177 + 803: 62(fvec4) Load 802 + 804: 26(fvec3) VectorShuffle 803 803 0 1 2 + 805: 26(fvec3) Load 223(pos) + 806: 26(fvec3) FSub 804 805 + Store 629(b) 806 + 807: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 630 806 44 + 808: 6(int) Load 123(index) + 809: 130(ptr) AccessChain 93(params) 129 11 + 810: 64(int) Load 809 + 811: 6(int) Bitcast 810 + 812: 6(int) IAdd 808 811 + 813: 201(ptr) AccessChain 175 177 812 177 + 814: 62(fvec4) Load 813 + 815: 26(fvec3) VectorShuffle 814 814 0 1 2 + 816: 26(fvec3) Load 223(pos) + 817: 26(fvec3) FSub 815 816 + Store 645(c) 817 + 818: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 646 817 44 + 819: 26(fvec3) Load 617(a) + 820: 26(fvec3) Load 629(b) + 821: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 819 820 + 822: 26(fvec3) Load 629(b) + 823: 26(fvec3) Load 645(c) + 824: 26(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 822 823 + 825: 26(fvec3) FAdd 821 824 + 826: 26(fvec3) Load 600(normal) + 827: 26(fvec3) FAdd 826 825 + Store 600(normal) 827 + 828: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 601 827 44 + Branch 787 + 787: Label + Branch 730 + 730: Label + 829: 6(int) Load 123(index) + 830: 26(fvec3) Load 600(normal) + 831: 26(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 830 + 832: 23(float) CompositeExtract 831 0 + 833: 23(float) CompositeExtract 831 1 + 834: 23(float) CompositeExtract 831 2 + 835: 62(fvec4) CompositeConstruct 832 833 834 207 + 836: 201(ptr) AccessChain 197 177 829 485 + Store 836 835 + Branch 599 + 599: Label + Return + FunctionEnd +35(springForce(vf3;vf3;f1;): 26(fvec3) Function None 30 + 32(p0): 28(ptr) FunctionParameter + 33(p1): 28(ptr) FunctionParameter + 34(restDist): 29(ptr) FunctionParameter + 38: Label + 52(dist): 28(ptr) Variable Function + 39: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 37 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 16 11 11 11 11 + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 41 32(p0) 44 + 47: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 45 33(p1) 44 + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 48 34(restDist) 44 + 51: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 37 35(springForce(vf3;vf3;f1;) + 56: 26(fvec3) Load 32(p0) + 57: 26(fvec3) Load 33(p1) + 58: 26(fvec3) FSub 56 57 + Store 52(dist) 58 + 59: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 53 58 44 + 60: 26(fvec3) Load 52(dist) + 61: 26(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 60 + 98: 97(ptr) AccessChain 93(params) 96 + 99: 23(float) Load 98 + 100: 26(fvec3) VectorTimesScalar 61 99 + 101: 26(fvec3) Load 52(dist) + 102: 23(float) ExtInst 2(GLSL.std.450) 66(Length) 101 + 103: 23(float) Load 34(restDist) + 104: 23(float) FSub 102 103 + 105: 26(fvec3) VectorTimesScalar 100 104 + ReturnValue 105 + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.glsl.frag.out b/Test/baseResults/spv.debuginfo.glsl.frag.out new file mode 100644 index 000000000..2180f7ee2 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.glsl.frag.out @@ -0,0 +1,949 @@ +spv.debuginfo.glsl.frag +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 716 + + Capability Shader + Capability ImageQuery + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 13 "main" 406 452 + ExecutionMode 13 OriginUpperLeft + 8: String "uint" + 14: String "main" + 17: String "" + 24: String "float" + 39: String "textureProj" + 45: String "P" + 49: String "layer" + 52: String "offset" + 59: String "filterPCF" + 65: String "sc" + 77: String "shadow" + 83: String "fragcolor" + 86: String "fragpos" + 96: String "shadowCoord" + 118: String "bool" + 132: String "dist" + 136: String "type.2d.image" + 137: String "@type.2d.image" + 141: String "type.sampled.image" + 142: String "@type.sampled.image" + 146: String "samplerShadowMap" + 182: String "int" + 189: String "texDim" + 201: String "scale" + 207: String "dx" + 219: String "dy" + 230: String "shadowFactor" + 235: String "count" + 240: String "range" + 246: String "x" + 262: String "y" + 312: String "i" + 326: String "shadowClip" + 333: String "color" + 339: String "viewMatrix" + 342: String "Light" + 348: String "lights" + 351: String "debugDisplayTarget" + 355: String "UBO" + 359: String "ubo" + 394: String "fragPos" + 403: String "samplerposition" + 408: String "inUV" + 415: String "normal" + 419: String "samplerNormal" + 427: String "albedo" + 431: String "samplerAlbedo" + 454: String "outFragColor" + 516: String "N" + 535: String "L" + 556: String "V" + 569: String "lightCosInnerAngle" + 575: String "lightCosOuterAngle" + 581: String "lightRange" + 587: String "dir" + 602: String "cosDir" + 610: String "spotEffect" + 619: String "heightAttenuation" + 627: String "NdotL" + 636: String "diff" + 643: String "R" + 652: String "NdotR" + 661: String "spec" + Name 13 "main" + Name 38 "textureProj(vf4;f1;vf2;" + Name 35 "P" + Name 36 "layer" + Name 37 "offset" + Name 58 "filterPCF(vf4;f1;" + Name 56 "sc" + Name 57 "layer" + Name 76 "shadow(vf3;vf3;" + Name 74 "fragcolor" + Name 75 "fragpos" + Name 89 "shadow" + Name 94 "shadowCoord" + Name 130 "dist" + Name 144 "samplerShadowMap" + Name 187 "texDim" + Name 199 "scale" + Name 205 "dx" + Name 217 "dy" + Name 228 "shadowFactor" + Name 233 "count" + Name 238 "range" + Name 244 "x" + Name 260 "y" + Name 285 "param" + Name 287 "param" + Name 289 "param" + Name 310 "i" + Name 324 "shadowClip" + Name 331 "Light" + MemberName 331(Light) 0 "position" + MemberName 331(Light) 1 "target" + MemberName 331(Light) 2 "color" + MemberName 331(Light) 3 "viewMatrix" + Name 345 "UBO" + MemberName 345(UBO) 0 "viewPos" + MemberName 345(UBO) 1 "lights" + MemberName 345(UBO) 2 "useShadows" + MemberName 345(UBO) 3 "debugDisplayTarget" + Name 357 "ubo" + Name 371 "shadowFactor" + Name 376 "param" + Name 378 "param" + Name 392 "fragPos" + Name 401 "samplerposition" + Name 406 "inUV" + Name 413 "normal" + Name 417 "samplerNormal" + Name 425 "albedo" + Name 429 "samplerAlbedo" + Name 452 "outFragColor" + Name 457 "param" + Name 458 "param" + Name 506 "fragcolor" + Name 514 "N" + Name 521 "i" + Name 533 "L" + Name 545 "dist" + Name 554 "V" + Name 567 "lightCosInnerAngle" + Name 573 "lightCosOuterAngle" + Name 579 "lightRange" + Name 585 "dir" + Name 600 "cosDir" + Name 608 "spotEffect" + Name 617 "heightAttenuation" + Name 625 "NdotL" + Name 634 "diff" + Name 641 "R" + Name 650 "NdotR" + Name 659 "spec" + Name 705 "param" + Name 707 "param" + Decorate 144(samplerShadowMap) DescriptorSet 0 + Decorate 144(samplerShadowMap) Binding 5 + MemberDecorate 331(Light) 0 Offset 0 + MemberDecorate 331(Light) 1 Offset 16 + MemberDecorate 331(Light) 2 Offset 32 + MemberDecorate 331(Light) 3 ColMajor + MemberDecorate 331(Light) 3 Offset 48 + MemberDecorate 331(Light) 3 MatrixStride 16 + Decorate 343 ArrayStride 112 + MemberDecorate 345(UBO) 0 Offset 0 + MemberDecorate 345(UBO) 1 Offset 16 + MemberDecorate 345(UBO) 2 Offset 352 + MemberDecorate 345(UBO) 3 Offset 356 + Decorate 345(UBO) Block + Decorate 357(ubo) DescriptorSet 0 + Decorate 357(ubo) Binding 4 + Decorate 401(samplerposition) DescriptorSet 0 + Decorate 401(samplerposition) Binding 1 + Decorate 406(inUV) Location 0 + Decorate 417(samplerNormal) DescriptorSet 0 + Decorate 417(samplerNormal) Binding 2 + Decorate 429(samplerAlbedo) DescriptorSet 0 + Decorate 429(samplerAlbedo) Binding 3 + Decorate 452(outFragColor) Location 0 + 3: TypeVoid + 4: TypeFunction 3 + 6: TypeInt 32 0 + 9: 6(int) Constant 32 + 10: 6(int) Constant 6 + 11: 6(int) Constant 0 + 7: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 8 9 10 11 + 12: 6(int) Constant 3 + 5: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 3 + 16: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 17 + 19: 6(int) Constant 1 + 20: 6(int) Constant 4 + 21: 6(int) Constant 2 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 19 20 16 21 + 15: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 14 5 16 11 11 18 14 12 11 + 23: TypeFloat 32 + 25: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 24 9 12 11 + 26: TypeVector 23(float) 4 + 27: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 20 + 28: TypePointer Function 26(fvec4) + 29: TypePointer Function 23(float) + 30: TypeVector 23(float) 2 + 31: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 21 + 32: TypePointer Function 30(fvec2) + 33: TypeFunction 23(float) 28(ptr) 29(ptr) 32(ptr) + 34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 25 27 25 31 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 39 34 16 11 11 18 39 12 11 + 44: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 45 27 16 11 11 40 20 19 + 47: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 49 25 16 11 11 40 20 21 + 51: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 52 31 16 11 11 40 20 12 + 54: TypeFunction 23(float) 28(ptr) 29(ptr) + 55: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 25 27 25 + 60: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 59 55 16 11 11 18 59 12 11 + 64: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 65 27 16 11 11 60 20 19 + 67: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 49 25 16 11 11 60 20 21 + 69: TypeVector 23(float) 3 + 70: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 12 + 71: TypePointer Function 69(fvec3) + 72: TypeFunction 69(fvec3) 71(ptr) 71(ptr) + 73: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 70 70 70 + 78: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 77 73 16 11 11 18 77 12 11 + 82: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 83 70 16 11 11 78 20 19 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 86 70 16 11 11 78 20 21 + 91: 6(int) Constant 59 + 90: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 77 25 16 91 11 40 20 + 92: 23(float) Constant 1065353216 + 97: 6(int) Constant 60 + 95: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 96 27 16 97 11 40 20 + 106: 23(float) Constant 1056964608 + 114: TypeBool + 117: 23(float) Constant 3212836864 + 119: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 125: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 133: 6(int) Constant 65 + 131: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 132 25 16 133 11 40 20 + 134: TypeImage 23(float) 2D array sampled format:Unknown + 138: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 0(Unknown) + 135: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 136 11 16 133 11 18 137 138 12 + 139: TypeSampledImage 134 + 140: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 141 11 16 133 11 18 142 138 12 + 143: TypePointer UniformConstant 139 +144(samplerShadowMap): 143(ptr) Variable UniformConstant + 147: 6(int) Constant 8 + 145: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 146 140 16 133 11 18 146 144(samplerShadowMap) 147 + 162: 23(float) Constant 0 + 163: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 170: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 175: 23(float) Constant 1048576000 + 181: TypeInt 32 1 + 183: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 182 9 20 11 + 184: TypeVector 181(int) 2 + 185: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 183 21 + 186: TypePointer Function 184(ivec2) + 190: 6(int) Constant 76 + 188: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 189 185 16 190 11 60 20 + 192: 181(int) Constant 0 + 194: TypeVector 181(int) 3 + 195: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 183 12 + 202: 6(int) Constant 77 + 200: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 201 25 16 202 11 60 20 + 203: 23(float) Constant 1069547520 + 208: 6(int) Constant 78 + 206: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 207 25 16 208 11 60 20 + 211: TypePointer Function 181(int) + 220: 6(int) Constant 79 + 218: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 219 25 16 220 11 60 20 + 231: 6(int) Constant 81 + 229: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 230 25 16 231 11 60 20 + 236: 6(int) Constant 82 + 234: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 235 183 16 236 11 60 20 + 241: 6(int) Constant 83 + 239: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 240 183 16 241 11 60 20 + 242: 181(int) Constant 1 + 247: 6(int) Constant 85 + 245: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 246 183 16 247 11 60 20 + 258: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 263: 6(int) Constant 87 + 261: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 262 183 16 263 11 60 20 + 274: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 313: 6(int) Constant 98 + 311: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 312 183 16 313 11 78 20 + 321: 181(int) Constant 3 + 322: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 327: 6(int) Constant 100 + 325: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 326 27 16 327 11 78 20 + 328: TypeMatrix 26(fvec4) 4 + 330: 114(bool) ConstantTrue + 329: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 27 20 330 + 331(Light): TypeStruct 26(fvec4) 26(fvec4) 26(fvec4) 328 + 334: 6(int) Constant 45 + 335: 6(int) Constant 7 + 332: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 333 27 16 334 335 11 11 12 + 336: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 333 27 16 334 335 11 11 12 + 337: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 333 27 16 334 335 11 11 12 + 340: 6(int) Constant 46 + 338: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 339 329 16 340 335 11 11 12 + 341: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 342 19 16 327 11 18 342 11 12 332 336 337 338 + 343: TypeArray 331(Light) 12 + 344: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 341 12 + 345(UBO): TypeStruct 26(fvec4) 343 181(int) 181(int) + 346: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 333 27 16 334 335 11 11 12 + 349: 6(int) Constant 52 + 347: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 348 344 16 349 147 11 11 12 + 352: 6(int) Constant 54 + 350: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 351 183 16 352 10 11 11 12 + 353: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 351 183 16 352 10 11 11 12 + 354: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 355 19 16 327 11 18 355 11 12 346 347 350 353 + 356: TypePointer Uniform 345(UBO) + 357(ubo): 356(ptr) Variable Uniform + 358: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 359 354 16 327 11 18 359 357(ubo) 147 + 361: TypePointer Uniform 328 + 373: 6(int) Constant 104 + 372: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 230 25 16 373 11 78 20 + 395: 6(int) Constant 117 + 393: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 394 70 16 395 11 15 20 + 396: TypeImage 23(float) 2D sampled format:Unknown + 397: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 136 11 16 395 11 18 137 138 12 + 398: TypeSampledImage 396 + 399: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 141 11 16 395 11 18 142 138 12 + 400: TypePointer UniformConstant 398 +401(samplerposition): 400(ptr) Variable UniformConstant + 402: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 403 399 16 395 11 18 403 401(samplerposition) 147 + 405: TypePointer Input 30(fvec2) + 406(inUV): 405(ptr) Variable Input + 407: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 408 31 16 395 11 18 408 406(inUV) 147 + 416: 6(int) Constant 118 + 414: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 415 70 16 416 11 15 20 +417(samplerNormal): 400(ptr) Variable UniformConstant + 418: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 419 399 16 416 11 18 419 417(samplerNormal) 147 + 428: 6(int) Constant 119 + 426: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 427 27 16 428 11 15 20 +429(samplerAlbedo): 400(ptr) Variable UniformConstant + 430: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 431 399 16 428 11 18 431 429(samplerAlbedo) 147 + 436: TypePointer Uniform 181(int) + 439: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 451: TypePointer Output 26(fvec4) +452(outFragColor): 451(ptr) Variable Output + 455: 6(int) Constant 125 + 453: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 454 27 16 455 11 18 454 452(outFragColor) 147 + 456: 69(fvec3) ConstantComposite 92 92 92 + 461: TypePointer Output 23(float) + 508: 6(int) Constant 145 + 507: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 83 70 16 508 11 15 20 + 511: 23(float) Constant 1036831949 + 517: 6(int) Constant 147 + 515: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 516 70 16 517 11 15 20 + 523: 6(int) Constant 149 + 522: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 312 183 16 523 11 15 20 + 531: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 536: 6(int) Constant 152 + 534: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 535 70 16 536 11 15 20 + 538: TypePointer Uniform 26(fvec4) + 547: 6(int) Constant 154 + 546: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 132 25 16 547 11 15 20 + 557: 6(int) Constant 158 + 555: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 556 70 16 557 11 15 20 + 570: 6(int) Constant 161 + 568: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 569 25 16 570 11 15 20 + 571: 23(float) Constant 1064781546 + 576: 6(int) Constant 162 + 574: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 575 25 16 576 11 15 20 + 577: 23(float) Constant 1063781322 + 582: 6(int) Constant 163 + 580: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 581 25 16 582 11 15 20 + 583: 23(float) Constant 1120403456 + 588: 6(int) Constant 166 + 586: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 587 70 16 588 11 15 20 + 603: 6(int) Constant 169 + 601: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 602 25 16 603 11 15 20 + 611: 6(int) Constant 170 + 609: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 610 25 16 611 11 15 20 + 620: 6(int) Constant 171 + 618: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 619 25 16 620 11 15 20 + 628: 6(int) Constant 174 + 626: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 627 25 16 628 11 15 20 + 637: 6(int) Constant 175 + 635: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 636 70 16 637 11 15 20 + 644: 6(int) Constant 178 + 642: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 643 70 16 644 11 15 20 + 653: 6(int) Constant 179 + 651: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 652 25 16 653 11 15 20 + 662: 6(int) Constant 180 + 660: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 661 70 16 662 11 15 20 + 664: 23(float) Constant 1098907648 + 669: 23(float) Constant 1075838976 + 685: 181(int) Constant 2 + 701: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 118 9 21 11 + 13(main): 3 Function None 4 + 22: Label + 392(fragPos): 71(ptr) Variable Function + 413(normal): 71(ptr) Variable Function + 425(albedo): 28(ptr) Variable Function + 457(param): 71(ptr) Variable Function + 458(param): 71(ptr) Variable Function + 506(fragcolor): 71(ptr) Variable Function + 514(N): 71(ptr) Variable Function + 521(i): 211(ptr) Variable Function + 533(L): 71(ptr) Variable Function + 545(dist): 29(ptr) Variable Function + 554(V): 71(ptr) Variable Function +567(lightCosInnerAngle): 29(ptr) Variable Function +573(lightCosOuterAngle): 29(ptr) Variable Function + 579(lightRange): 29(ptr) Variable Function + 585(dir): 71(ptr) Variable Function + 600(cosDir): 29(ptr) Variable Function + 608(spotEffect): 29(ptr) Variable Function +617(heightAttenuation): 29(ptr) Variable Function + 625(NdotL): 29(ptr) Variable Function + 634(diff): 71(ptr) Variable Function + 641(R): 71(ptr) Variable Function + 650(NdotR): 29(ptr) Variable Function + 659(spec): 71(ptr) Variable Function + 705(param): 71(ptr) Variable Function + 707(param): 71(ptr) Variable Function + 391: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main) + 404: 398 Load 401(samplerposition) + 409: 30(fvec2) Load 406(inUV) + 410: 26(fvec4) ImageSampleImplicitLod 404 409 + 411: 69(fvec3) VectorShuffle 410 410 0 1 2 + Store 392(fragPos) 411 + 412: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 393 411 47 + 420: 398 Load 417(samplerNormal) + 421: 30(fvec2) Load 406(inUV) + 422: 26(fvec4) ImageSampleImplicitLod 420 421 + 423: 69(fvec3) VectorShuffle 422 422 0 1 2 + Store 413(normal) 423 + 424: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 414 423 47 + 432: 398 Load 429(samplerAlbedo) + 433: 30(fvec2) Load 406(inUV) + 434: 26(fvec4) ImageSampleImplicitLod 432 433 + Store 425(albedo) 434 + 435: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 426 434 47 + 437: 436(ptr) AccessChain 357(ubo) 321 + 438: 181(int) Load 437 + 440: 114(bool) SGreaterThan 438 192 + SelectionMerge 442 None + BranchConditional 440 441 442 + 441: Label + 443: 436(ptr) AccessChain 357(ubo) 321 + 444: 181(int) Load 443 + SelectionMerge 450 None + Switch 444 450 + case 1: 445 + case 2: 446 + case 3: 447 + case 4: 448 + case 5: 449 + 445: Label + Store 457(param) 456 + 459: 69(fvec3) Load 392(fragPos) + Store 458(param) 459 + 460: 69(fvec3) FunctionCall 76(shadow(vf3;vf3;) 457(param) 458(param) + 462: 461(ptr) AccessChain 452(outFragColor) 11 + 463: 23(float) CompositeExtract 460 0 + Store 462 463 + 464: 461(ptr) AccessChain 452(outFragColor) 19 + 465: 23(float) CompositeExtract 460 1 + Store 464 465 + 466: 461(ptr) AccessChain 452(outFragColor) 21 + 467: 23(float) CompositeExtract 460 2 + Store 466 467 + Branch 450 + 446: Label + 469: 69(fvec3) Load 392(fragPos) + 470: 461(ptr) AccessChain 452(outFragColor) 11 + 471: 23(float) CompositeExtract 469 0 + Store 470 471 + 472: 461(ptr) AccessChain 452(outFragColor) 19 + 473: 23(float) CompositeExtract 469 1 + Store 472 473 + 474: 461(ptr) AccessChain 452(outFragColor) 21 + 475: 23(float) CompositeExtract 469 2 + Store 474 475 + Branch 450 + 447: Label + 477: 69(fvec3) Load 413(normal) + 478: 461(ptr) AccessChain 452(outFragColor) 11 + 479: 23(float) CompositeExtract 477 0 + Store 478 479 + 480: 461(ptr) AccessChain 452(outFragColor) 19 + 481: 23(float) CompositeExtract 477 1 + Store 480 481 + 482: 461(ptr) AccessChain 452(outFragColor) 21 + 483: 23(float) CompositeExtract 477 2 + Store 482 483 + Branch 450 + 448: Label + 485: 26(fvec4) Load 425(albedo) + 486: 69(fvec3) VectorShuffle 485 485 0 1 2 + 487: 461(ptr) AccessChain 452(outFragColor) 11 + 488: 23(float) CompositeExtract 486 0 + Store 487 488 + 489: 461(ptr) AccessChain 452(outFragColor) 19 + 490: 23(float) CompositeExtract 486 1 + Store 489 490 + 491: 461(ptr) AccessChain 452(outFragColor) 21 + 492: 23(float) CompositeExtract 486 2 + Store 491 492 + Branch 450 + 449: Label + 494: 26(fvec4) Load 425(albedo) + 495: 69(fvec3) VectorShuffle 494 494 3 3 3 + 496: 461(ptr) AccessChain 452(outFragColor) 11 + 497: 23(float) CompositeExtract 495 0 + Store 496 497 + 498: 461(ptr) AccessChain 452(outFragColor) 19 + 499: 23(float) CompositeExtract 495 1 + Store 498 499 + 500: 461(ptr) AccessChain 452(outFragColor) 21 + 501: 23(float) CompositeExtract 495 2 + Store 500 501 + Branch 450 + 450: Label + 504: 461(ptr) AccessChain 452(outFragColor) 12 + Store 504 92 + Return + 442: Label + 509: 26(fvec4) Load 425(albedo) + 510: 69(fvec3) VectorShuffle 509 509 0 1 2 + 512: 69(fvec3) VectorTimesScalar 510 511 + Store 506(fragcolor) 512 + 513: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 507 512 47 + 518: 69(fvec3) Load 413(normal) + 519: 69(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 518 + Store 514(N) 519 + 520: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 519 47 + Store 521(i) 192 + 524: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 522 192 47 + Branch 525 + 525: Label + LoopMerge 527 528 None + Branch 529 + 529: Label + 530: 181(int) Load 521(i) + 532: 114(bool) SLessThan 530 321 + BranchConditional 532 526 527 + 526: Label + 537: 181(int) Load 521(i) + 539: 538(ptr) AccessChain 357(ubo) 242 537 192 + 540: 26(fvec4) Load 539 + 541: 69(fvec3) VectorShuffle 540 540 0 1 2 + 542: 69(fvec3) Load 392(fragPos) + 543: 69(fvec3) FSub 541 542 + Store 533(L) 543 + 544: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 534 543 47 + 548: 69(fvec3) Load 533(L) + 549: 23(float) ExtInst 2(GLSL.std.450) 66(Length) 548 + Store 545(dist) 549 + 550: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 546 549 47 + 551: 69(fvec3) Load 533(L) + 552: 69(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 551 + Store 533(L) 552 + 553: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 534 552 47 + 558: 538(ptr) AccessChain 357(ubo) 192 + 559: 26(fvec4) Load 558 + 560: 69(fvec3) VectorShuffle 559 559 0 1 2 + 561: 69(fvec3) Load 392(fragPos) + 562: 69(fvec3) FSub 560 561 + Store 554(V) 562 + 563: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 555 562 47 + 564: 69(fvec3) Load 554(V) + 565: 69(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 564 + Store 554(V) 565 + 566: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 555 565 47 + Store 567(lightCosInnerAngle) 571 + 572: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 568 571 47 + Store 573(lightCosOuterAngle) 577 + 578: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 574 577 47 + Store 579(lightRange) 583 + 584: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 580 583 47 + 589: 181(int) Load 521(i) + 590: 538(ptr) AccessChain 357(ubo) 242 589 192 + 591: 26(fvec4) Load 590 + 592: 69(fvec3) VectorShuffle 591 591 0 1 2 + 593: 181(int) Load 521(i) + 594: 538(ptr) AccessChain 357(ubo) 242 593 242 + 595: 26(fvec4) Load 594 + 596: 69(fvec3) VectorShuffle 595 595 0 1 2 + 597: 69(fvec3) FSub 592 596 + 598: 69(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 597 + Store 585(dir) 598 + 599: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 586 598 47 + 604: 69(fvec3) Load 533(L) + 605: 69(fvec3) Load 585(dir) + 606: 23(float) Dot 604 605 + Store 600(cosDir) 606 + 607: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 601 606 47 + 612: 23(float) Load 573(lightCosOuterAngle) + 613: 23(float) Load 567(lightCosInnerAngle) + 614: 23(float) Load 600(cosDir) + 615: 23(float) ExtInst 2(GLSL.std.450) 49(SmoothStep) 612 613 614 + Store 608(spotEffect) 615 + 616: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 609 615 47 + 621: 23(float) Load 579(lightRange) + 622: 23(float) Load 545(dist) + 623: 23(float) ExtInst 2(GLSL.std.450) 49(SmoothStep) 621 162 622 + Store 617(heightAttenuation) 623 + 624: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 618 623 47 + 629: 69(fvec3) Load 514(N) + 630: 69(fvec3) Load 533(L) + 631: 23(float) Dot 629 630 + 632: 23(float) ExtInst 2(GLSL.std.450) 40(FMax) 162 631 + Store 625(NdotL) 632 + 633: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 626 632 47 + 638: 23(float) Load 625(NdotL) + 639: 69(fvec3) CompositeConstruct 638 638 638 + Store 634(diff) 639 + 640: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 635 639 47 + 645: 69(fvec3) Load 533(L) + 646: 69(fvec3) FNegate 645 + 647: 69(fvec3) Load 514(N) + 648: 69(fvec3) ExtInst 2(GLSL.std.450) 71(Reflect) 646 647 + Store 641(R) 648 + 649: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 642 648 47 + 654: 69(fvec3) Load 641(R) + 655: 69(fvec3) Load 554(V) + 656: 23(float) Dot 654 655 + 657: 23(float) ExtInst 2(GLSL.std.450) 40(FMax) 162 656 + Store 650(NdotR) 657 + 658: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 651 657 47 + 663: 23(float) Load 650(NdotR) + 665: 23(float) ExtInst 2(GLSL.std.450) 26(Pow) 663 664 + 666: 29(ptr) AccessChain 425(albedo) 12 + 667: 23(float) Load 666 + 668: 23(float) FMul 665 667 + 670: 23(float) FMul 668 669 + 671: 69(fvec3) CompositeConstruct 670 670 670 + Store 659(spec) 671 + 672: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 660 671 47 + 673: 69(fvec3) Load 634(diff) + 674: 69(fvec3) Load 659(spec) + 675: 69(fvec3) FAdd 673 674 + 676: 23(float) Load 608(spotEffect) + 677: 69(fvec3) VectorTimesScalar 675 676 + 678: 23(float) Load 617(heightAttenuation) + 679: 69(fvec3) VectorTimesScalar 677 678 + 680: 23(float) CompositeExtract 679 0 + 681: 23(float) CompositeExtract 679 1 + 682: 23(float) CompositeExtract 679 2 + 683: 69(fvec3) CompositeConstruct 680 681 682 + 684: 181(int) Load 521(i) + 686: 538(ptr) AccessChain 357(ubo) 242 684 685 + 687: 26(fvec4) Load 686 + 688: 69(fvec3) VectorShuffle 687 687 0 1 2 + 689: 69(fvec3) FMul 683 688 + 690: 26(fvec4) Load 425(albedo) + 691: 69(fvec3) VectorShuffle 690 690 0 1 2 + 692: 69(fvec3) FMul 689 691 + 693: 69(fvec3) Load 506(fragcolor) + 694: 69(fvec3) FAdd 693 692 + Store 506(fragcolor) 694 + 695: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 507 694 47 + Branch 528 + 528: Label + 696: 181(int) Load 521(i) + 697: 181(int) IAdd 696 242 + Store 521(i) 697 + 698: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 522 697 47 + Branch 525 + 527: Label + 699: 436(ptr) AccessChain 357(ubo) 685 + 700: 181(int) Load 699 + 702: 114(bool) SGreaterThan 700 192 + SelectionMerge 704 None + BranchConditional 702 703 704 + 703: Label + 706: 69(fvec3) Load 506(fragcolor) + Store 705(param) 706 + 708: 69(fvec3) Load 392(fragPos) + Store 707(param) 708 + 709: 69(fvec3) FunctionCall 76(shadow(vf3;vf3;) 705(param) 707(param) + Store 506(fragcolor) 709 + 710: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 507 709 47 + Branch 704 + 704: Label + 711: 69(fvec3) Load 506(fragcolor) + 712: 23(float) CompositeExtract 711 0 + 713: 23(float) CompositeExtract 711 1 + 714: 23(float) CompositeExtract 711 2 + 715: 26(fvec4) CompositeConstruct 712 713 714 92 + Store 452(outFragColor) 715 + Return + FunctionEnd +38(textureProj(vf4;f1;vf2;): 23(float) Function None 33 + 35(P): 28(ptr) FunctionParameter + 36(layer): 29(ptr) FunctionParameter + 37(offset): 32(ptr) FunctionParameter + 41: Label + 89(shadow): 29(ptr) Variable Function + 94(shadowCoord): 28(ptr) Variable Function + 130(dist): 29(ptr) Variable Function + 42: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 40 + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 16 11 11 11 11 + 46: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 44 35(P) 47 + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 48 36(layer) 47 + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 51 37(offset) 47 + 88: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 40 38(textureProj(vf4;f1;vf2;) + Store 89(shadow) 92 + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 90 92 47 + 98: 26(fvec4) Load 35(P) + 99: 29(ptr) AccessChain 35(P) 12 + 100: 23(float) Load 99 + 101: 26(fvec4) CompositeConstruct 100 100 100 100 + 102: 26(fvec4) FDiv 98 101 + Store 94(shadowCoord) 102 + 103: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 95 102 47 + 104: 26(fvec4) Load 94(shadowCoord) + 105: 30(fvec2) VectorShuffle 104 104 0 1 + 107: 30(fvec2) VectorTimesScalar 105 106 + 108: 30(fvec2) CompositeConstruct 106 106 + 109: 30(fvec2) FAdd 107 108 + 110: 29(ptr) AccessChain 94(shadowCoord) 11 + 111: 23(float) CompositeExtract 109 0 + Store 110 111 + 112: 29(ptr) AccessChain 94(shadowCoord) 19 + 113: 23(float) CompositeExtract 109 1 + Store 112 113 + 115: 29(ptr) AccessChain 94(shadowCoord) 21 + 116: 23(float) Load 115 + 120: 114(bool) FOrdGreaterThan 116 117 + SelectionMerge 122 None + BranchConditional 120 121 122 + 121: Label + 123: 29(ptr) AccessChain 94(shadowCoord) 21 + 124: 23(float) Load 123 + 126: 114(bool) FOrdLessThan 124 92 + Branch 122 + 122: Label + 127: 114(bool) Phi 120 41 126 121 + SelectionMerge 129 None + BranchConditional 127 128 129 + 128: Label + 148: 139 Load 144(samplerShadowMap) + 149: 26(fvec4) Load 94(shadowCoord) + 150: 30(fvec2) VectorShuffle 149 149 0 1 + 151: 30(fvec2) Load 37(offset) + 152: 30(fvec2) FAdd 150 151 + 153: 23(float) Load 36(layer) + 154: 23(float) CompositeExtract 152 0 + 155: 23(float) CompositeExtract 152 1 + 156: 69(fvec3) CompositeConstruct 154 155 153 + 157: 26(fvec4) ImageSampleImplicitLod 148 156 + 158: 23(float) CompositeExtract 157 0 + Store 130(dist) 158 + 159: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 131 158 47 + 160: 29(ptr) AccessChain 94(shadowCoord) 12 + 161: 23(float) Load 160 + 164: 114(bool) FOrdGreaterThan 161 162 + SelectionMerge 166 None + BranchConditional 164 165 166 + 165: Label + 167: 23(float) Load 130(dist) + 168: 29(ptr) AccessChain 94(shadowCoord) 21 + 169: 23(float) Load 168 + 171: 114(bool) FOrdLessThan 167 169 + Branch 166 + 166: Label + 172: 114(bool) Phi 164 128 171 165 + SelectionMerge 174 None + BranchConditional 172 173 174 + 173: Label + Store 89(shadow) 175 + 176: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 90 175 47 + Branch 174 + 174: Label + Branch 129 + 129: Label + 177: 23(float) Load 89(shadow) + ReturnValue 177 + FunctionEnd +58(filterPCF(vf4;f1;): 23(float) Function None 54 + 56(sc): 28(ptr) FunctionParameter + 57(layer): 29(ptr) FunctionParameter + 61: Label + 187(texDim): 186(ptr) Variable Function + 199(scale): 29(ptr) Variable Function + 205(dx): 29(ptr) Variable Function + 217(dy): 29(ptr) Variable Function +228(shadowFactor): 29(ptr) Variable Function + 233(count): 211(ptr) Variable Function + 238(range): 211(ptr) Variable Function + 244(x): 211(ptr) Variable Function + 260(y): 211(ptr) Variable Function + 285(param): 28(ptr) Variable Function + 287(param): 29(ptr) Variable Function + 289(param): 32(ptr) Variable Function + 62: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 60 + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 16 11 11 11 11 + 66: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 64 56(sc) 47 + 68: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 67 57(layer) 47 + 180: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 60 58(filterPCF(vf4;f1;) + 191: 139 Load 144(samplerShadowMap) + 193: 134 Image 191 + 196: 194(ivec3) ImageQuerySizeLod 193 192 + 197: 184(ivec2) VectorShuffle 196 196 0 1 + Store 187(texDim) 197 + 198: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 188 197 47 + Store 199(scale) 203 + 204: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 200 203 47 + 209: 23(float) Load 199(scale) + 210: 23(float) FMul 209 92 + 212: 211(ptr) AccessChain 187(texDim) 11 + 213: 181(int) Load 212 + 214: 23(float) ConvertSToF 213 + 215: 23(float) FDiv 210 214 + Store 205(dx) 215 + 216: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 206 215 47 + 221: 23(float) Load 199(scale) + 222: 23(float) FMul 221 92 + 223: 211(ptr) AccessChain 187(texDim) 19 + 224: 181(int) Load 223 + 225: 23(float) ConvertSToF 224 + 226: 23(float) FDiv 222 225 + Store 217(dy) 226 + 227: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 218 226 47 + Store 228(shadowFactor) 162 + 232: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 229 162 47 + Store 233(count) 192 + 237: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 234 192 47 + Store 238(range) 242 + 243: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 239 242 47 + 248: 181(int) Load 238(range) + 249: 181(int) SNegate 248 + Store 244(x) 249 + 250: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 245 249 47 + Branch 251 + 251: Label + LoopMerge 253 254 None + Branch 255 + 255: Label + 256: 181(int) Load 244(x) + 257: 181(int) Load 238(range) + 259: 114(bool) SLessThanEqual 256 257 + BranchConditional 259 252 253 + 252: Label + 264: 181(int) Load 238(range) + 265: 181(int) SNegate 264 + Store 260(y) 265 + 266: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 261 265 47 + Branch 267 + 267: Label + LoopMerge 269 270 None + Branch 271 + 271: Label + 272: 181(int) Load 260(y) + 273: 181(int) Load 238(range) + 275: 114(bool) SLessThanEqual 272 273 + BranchConditional 275 268 269 + 268: Label + 276: 23(float) Load 205(dx) + 277: 181(int) Load 244(x) + 278: 23(float) ConvertSToF 277 + 279: 23(float) FMul 276 278 + 280: 23(float) Load 217(dy) + 281: 181(int) Load 260(y) + 282: 23(float) ConvertSToF 281 + 283: 23(float) FMul 280 282 + 284: 30(fvec2) CompositeConstruct 279 283 + 286: 26(fvec4) Load 56(sc) + Store 285(param) 286 + 288: 23(float) Load 57(layer) + Store 287(param) 288 + Store 289(param) 284 + 290: 23(float) FunctionCall 38(textureProj(vf4;f1;vf2;) 285(param) 287(param) 289(param) + 291: 23(float) Load 228(shadowFactor) + 292: 23(float) FAdd 291 290 + Store 228(shadowFactor) 292 + 293: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 229 292 47 + 294: 181(int) Load 233(count) + 295: 181(int) IAdd 294 242 + Store 233(count) 295 + 296: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 234 295 47 + Branch 270 + 270: Label + 297: 181(int) Load 260(y) + 298: 181(int) IAdd 297 242 + Store 260(y) 298 + 299: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 261 298 47 + Branch 267 + 269: Label + Branch 254 + 254: Label + 300: 181(int) Load 244(x) + 301: 181(int) IAdd 300 242 + Store 244(x) 301 + 302: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 245 301 47 + Branch 251 + 253: Label + 303: 23(float) Load 228(shadowFactor) + 304: 181(int) Load 233(count) + 305: 23(float) ConvertSToF 304 + 306: 23(float) FDiv 303 305 + ReturnValue 306 + FunctionEnd +76(shadow(vf3;vf3;): 69(fvec3) Function None 72 + 74(fragcolor): 71(ptr) FunctionParameter + 75(fragpos): 71(ptr) FunctionParameter + 79: Label + 310(i): 211(ptr) Variable Function + 324(shadowClip): 28(ptr) Variable Function +371(shadowFactor): 29(ptr) Variable Function + 376(param): 28(ptr) Variable Function + 378(param): 29(ptr) Variable Function + 80: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 78 + 81: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 16 11 11 11 11 + 84: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 82 74(fragcolor) 47 + 87: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 85 75(fragpos) 47 + 309: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 78 76(shadow(vf3;vf3;) + Store 310(i) 192 + 314: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 311 192 47 + Branch 315 + 315: Label + LoopMerge 317 318 None + Branch 319 + 319: Label + 320: 181(int) Load 310(i) + 323: 114(bool) SLessThan 320 321 + BranchConditional 323 316 317 + 316: Label + 360: 181(int) Load 310(i) + 362: 361(ptr) AccessChain 357(ubo) 242 360 321 + 363: 328 Load 362 + 364: 69(fvec3) Load 75(fragpos) + 365: 23(float) CompositeExtract 364 0 + 366: 23(float) CompositeExtract 364 1 + 367: 23(float) CompositeExtract 364 2 + 368: 26(fvec4) CompositeConstruct 365 366 367 92 + 369: 26(fvec4) MatrixTimesVector 363 368 + Store 324(shadowClip) 369 + 370: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 325 369 47 + 374: 181(int) Load 310(i) + 375: 23(float) ConvertSToF 374 + 377: 26(fvec4) Load 324(shadowClip) + Store 376(param) 377 + Store 378(param) 375 + 379: 23(float) FunctionCall 58(filterPCF(vf4;f1;) 376(param) 378(param) + Store 371(shadowFactor) 379 + 380: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 372 379 47 + 381: 23(float) Load 371(shadowFactor) + 382: 69(fvec3) Load 74(fragcolor) + 383: 69(fvec3) VectorTimesScalar 382 381 + Store 74(fragcolor) 383 + 384: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 82 383 47 + Branch 318 + 318: Label + 385: 181(int) Load 310(i) + 386: 181(int) IAdd 385 242 + Store 310(i) 386 + 387: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 311 386 47 + Branch 315 + 317: Label + 388: 69(fvec3) Load 74(fragcolor) + ReturnValue 388 + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.glsl.geom.out b/Test/baseResults/spv.debuginfo.glsl.geom.out new file mode 100644 index 000000000..8fa99b4e4 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.glsl.geom.out @@ -0,0 +1,333 @@ +spv.debuginfo.glsl.geom +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 232 + + Capability Geometry + Capability MultiViewport + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 13 "main" 52 85 104 112 116 145 181 189 206 216 221 225 + ExecutionMode 13 Triangles + ExecutionMode 13 Invocations 2 + ExecutionMode 13 OutputTriangleStrip + ExecutionMode 13 OutputVertices 3 + 8: String "uint" + 14: String "main" + 17: String "" + 25: String "int" + 30: String "i" + 43: String "bool" + 47: String "float" + 54: String "outNormal" + 68: String "projection" + 72: String "modelview" + 75: String "lightPos" + 78: String "UBO" + 82: String "ubo" + 87: String "gl_InvocationID" + 106: String "inNormal" + 114: String "outColor" + 118: String "inColor" + 125: String "pos" + 131: String "gl_Position" + 134: String "gl_PointSize" + 137: String "gl_CullDistance" + 141: String "gl_PerVertex" + 147: String "gl_in" + 155: String "worldPos" + 166: String "lPos" + 183: String "outLightVec" + 191: String "outViewVec" + 218: String "gl_ViewportIndex" + 223: String "gl_PrimitiveID" + 227: String "gl_PrimitiveIDIn" + SourceExtension "GL_ARB_viewport_array" + Name 13 "main" + Name 28 "i" + Name 52 "outNormal" + Name 66 "UBO" + MemberName 66(UBO) 0 "projection" + MemberName 66(UBO) 1 "modelview" + MemberName 66(UBO) 2 "lightPos" + Name 80 "ubo" + Name 85 "gl_InvocationID" + Name 104 "inNormal" + Name 112 "outColor" + Name 116 "inColor" + Name 123 "pos" + Name 129 "gl_PerVertex" + MemberName 129(gl_PerVertex) 0 "gl_Position" + MemberName 129(gl_PerVertex) 1 "gl_PointSize" + MemberName 129(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 129(gl_PerVertex) 3 "gl_CullDistance" + Name 145 "gl_in" + Name 153 "worldPos" + Name 164 "lPos" + Name 181 "outLightVec" + Name 189 "outViewVec" + Name 196 "gl_PerVertex" + MemberName 196(gl_PerVertex) 0 "gl_Position" + MemberName 196(gl_PerVertex) 1 "gl_PointSize" + MemberName 196(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 196(gl_PerVertex) 3 "gl_CullDistance" + Name 206 "" + Name 216 "gl_ViewportIndex" + Name 221 "gl_PrimitiveID" + Name 225 "gl_PrimitiveIDIn" + Decorate 52(outNormal) Location 0 + Decorate 62 ArrayStride 64 + Decorate 64 ArrayStride 64 + MemberDecorate 66(UBO) 0 ColMajor + MemberDecorate 66(UBO) 0 Offset 0 + MemberDecorate 66(UBO) 0 MatrixStride 16 + MemberDecorate 66(UBO) 1 ColMajor + MemberDecorate 66(UBO) 1 Offset 128 + MemberDecorate 66(UBO) 1 MatrixStride 16 + MemberDecorate 66(UBO) 2 Offset 256 + Decorate 66(UBO) Block + Decorate 80(ubo) DescriptorSet 0 + Decorate 80(ubo) Binding 0 + Decorate 85(gl_InvocationID) BuiltIn InvocationId + Decorate 104(inNormal) Location 0 + Decorate 112(outColor) Location 1 + Decorate 116(inColor) Location 1 + MemberDecorate 129(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 129(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 129(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 129(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 129(gl_PerVertex) Block + Decorate 181(outLightVec) Location 3 + Decorate 189(outViewVec) Location 2 + MemberDecorate 196(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 196(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 196(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 196(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 196(gl_PerVertex) Block + Decorate 216(gl_ViewportIndex) BuiltIn ViewportIndex + Decorate 221(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 225(gl_PrimitiveIDIn) BuiltIn PrimitiveId + 3: TypeVoid + 4: TypeFunction 3 + 6: TypeInt 32 0 + 9: 6(int) Constant 32 + 10: 6(int) Constant 6 + 11: 6(int) Constant 0 + 7: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 8 9 10 11 + 12: 6(int) Constant 3 + 5: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 3 + 16: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 17 + 19: 6(int) Constant 1 + 20: 6(int) Constant 4 + 21: 6(int) Constant 2 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 19 20 16 21 + 15: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 14 5 16 11 11 18 14 12 11 + 24: TypeInt 32 1 + 26: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 25 9 20 11 + 27: TypePointer Function 24(int) + 31: 6(int) Constant 49 + 29: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 30 26 16 31 11 15 20 + 32: 24(int) Constant 0 + 34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 41: 24(int) Constant 3 + 42: TypeBool + 44: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 43 9 21 11 + 46: TypeFloat 32 + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 12 11 + 49: TypeVector 46(float) 3 + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 48 12 + 51: TypePointer Output 49(fvec3) + 52(outNormal): 51(ptr) Variable Output + 55: 6(int) Constant 51 + 56: 6(int) Constant 8 + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 54 50 16 55 11 18 54 52(outNormal) 56 + 57: TypeVector 46(float) 4 + 58: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 48 20 + 59: TypeMatrix 57(fvec4) 4 + 61: 42(bool) ConstantTrue + 60: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 58 20 61 + 62: TypeArray 59 21 + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 60 21 + 64: TypeArray 59 21 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 60 21 + 66(UBO): TypeStruct 62 64 57(fvec4) + 69: 6(int) Constant 34 + 70: 6(int) Constant 7 + 67: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 68 63 16 69 70 11 11 12 + 73: 6(int) Constant 35 + 71: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 72 65 16 73 70 11 11 12 + 76: 6(int) Constant 36 + 74: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 75 58 16 76 70 11 11 12 + 77: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 78 19 16 55 11 18 78 11 12 67 71 74 + 79: TypePointer Uniform 66(UBO) + 80(ubo): 79(ptr) Variable Uniform + 81: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 82 77 16 55 11 18 82 80(ubo) 56 + 83: 24(int) Constant 1 + 84: TypePointer Input 24(int) +85(gl_InvocationID): 84(ptr) Variable Input + 86: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 87 26 16 55 11 18 87 85(gl_InvocationID) 56 + 89: TypePointer Uniform 59 + 92: TypeMatrix 49(fvec3) 3 + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 50 12 61 + 101: TypeArray 49(fvec3) 12 + 102: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 50 12 + 103: TypePointer Input 101 + 104(inNormal): 103(ptr) Variable Input + 105: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 106 102 16 55 11 18 106 104(inNormal) 56 + 108: TypePointer Input 49(fvec3) + 112(outColor): 51(ptr) Variable Output + 115: 6(int) Constant 52 + 113: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 114 50 16 115 11 18 114 112(outColor) 56 + 116(inColor): 103(ptr) Variable Input + 117: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 118 102 16 115 11 18 118 116(inColor) 56 + 122: TypePointer Function 57(fvec4) + 126: 6(int) Constant 54 + 124: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 125 58 16 126 11 15 20 + 127: TypeArray 46(float) 19 + 128: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 48 19 +129(gl_PerVertex): TypeStruct 57(fvec4) 46(float) 127 127 + 132: 6(int) Constant 23 + 130: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 131 58 16 21 132 11 11 12 + 135: 6(int) Constant 41 + 133: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 134 48 16 21 135 11 11 12 + 138: 6(int) Constant 84 + 136: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 21 138 11 11 12 + 139: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 21 138 11 11 12 + 140: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 141 19 16 126 11 18 141 11 12 130 133 136 139 + 142: TypeArray 129(gl_PerVertex) 12 + 143: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 140 12 + 144: TypePointer Input 142 + 145(gl_in): 144(ptr) Variable Input + 146: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 147 143 16 126 11 18 147 145(gl_in) 56 + 149: TypePointer Input 57(fvec4) + 156: 6(int) Constant 55 + 154: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 155 58 16 156 11 15 20 + 163: TypePointer Function 49(fvec3) + 167: 6(int) Constant 57 + 165: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 166 50 16 167 11 15 20 + 171: 24(int) Constant 2 + 172: TypePointer Uniform 57(fvec4) +181(outLightVec): 51(ptr) Variable Output + 184: 6(int) Constant 58 + 182: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 183 50 16 184 11 18 183 181(outLightVec) 56 + 189(outViewVec): 51(ptr) Variable Output + 192: 6(int) Constant 59 + 190: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 191 50 16 192 11 18 191 189(outViewVec) 56 +196(gl_PerVertex): TypeStruct 57(fvec4) 46(float) 127 127 + 198: 6(int) Constant 215 + 197: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 131 58 16 21 198 11 11 12 + 200: 6(int) Constant 233 + 199: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 134 48 16 21 200 11 11 12 + 201: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 12 70 11 11 12 + 202: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 137 128 16 12 70 11 11 12 + 204: 6(int) Constant 61 + 203: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 141 19 16 204 11 18 141 11 12 197 199 201 202 + 205: TypePointer Output 196(gl_PerVertex) + 206: 205(ptr) Variable Output + 207: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 17 203 16 204 11 18 17 206 56 + 213: TypePointer Output 57(fvec4) + 215: TypePointer Output 24(int) +216(gl_ViewportIndex): 215(ptr) Variable Output + 219: 6(int) Constant 64 + 217: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 218 26 16 219 11 18 218 216(gl_ViewportIndex) 56 +221(gl_PrimitiveID): 215(ptr) Variable Output + 224: 6(int) Constant 65 + 222: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 223 26 16 224 11 18 223 221(gl_PrimitiveID) 56 +225(gl_PrimitiveIDIn): 84(ptr) Variable Input + 226: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 227 26 16 224 11 18 227 225(gl_PrimitiveIDIn) 56 + 13(main): 3 Function None 4 + 22: Label + 28(i): 27(ptr) Variable Function + 123(pos): 122(ptr) Variable Function + 153(worldPos): 122(ptr) Variable Function + 164(lPos): 163(ptr) Variable Function + 23: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main) + Store 28(i) 32 + 33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 29 32 34 + Branch 35 + 35: Label + LoopMerge 37 38 None + Branch 39 + 39: Label + 40: 24(int) Load 28(i) + 45: 42(bool) SLessThan 40 41 + BranchConditional 45 36 37 + 36: Label + 88: 24(int) Load 85(gl_InvocationID) + 90: 89(ptr) AccessChain 80(ubo) 83 88 + 91: 59 Load 90 + 94: 57(fvec4) CompositeExtract 91 0 + 95: 49(fvec3) VectorShuffle 94 94 0 1 2 + 96: 57(fvec4) CompositeExtract 91 1 + 97: 49(fvec3) VectorShuffle 96 96 0 1 2 + 98: 57(fvec4) CompositeExtract 91 2 + 99: 49(fvec3) VectorShuffle 98 98 0 1 2 + 100: 92 CompositeConstruct 95 97 99 + 107: 24(int) Load 28(i) + 109: 108(ptr) AccessChain 104(inNormal) 107 + 110: 49(fvec3) Load 109 + 111: 49(fvec3) MatrixTimesVector 100 110 + Store 52(outNormal) 111 + 119: 24(int) Load 28(i) + 120: 108(ptr) AccessChain 116(inColor) 119 + 121: 49(fvec3) Load 120 + Store 112(outColor) 121 + 148: 24(int) Load 28(i) + 150: 149(ptr) AccessChain 145(gl_in) 148 32 + 151: 57(fvec4) Load 150 + Store 123(pos) 151 + 152: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 124 151 34 + 157: 24(int) Load 85(gl_InvocationID) + 158: 89(ptr) AccessChain 80(ubo) 83 157 + 159: 59 Load 158 + 160: 57(fvec4) Load 123(pos) + 161: 57(fvec4) MatrixTimesVector 159 160 + Store 153(worldPos) 161 + 162: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 154 161 34 + 168: 24(int) Load 85(gl_InvocationID) + 169: 89(ptr) AccessChain 80(ubo) 83 168 + 170: 59 Load 169 + 173: 172(ptr) AccessChain 80(ubo) 171 + 174: 57(fvec4) Load 173 + 175: 57(fvec4) MatrixTimesVector 170 174 + 176: 46(float) CompositeExtract 175 0 + 177: 46(float) CompositeExtract 175 1 + 178: 46(float) CompositeExtract 175 2 + 179: 49(fvec3) CompositeConstruct 176 177 178 + Store 164(lPos) 179 + 180: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 165 179 34 + 185: 49(fvec3) Load 164(lPos) + 186: 57(fvec4) Load 153(worldPos) + 187: 49(fvec3) VectorShuffle 186 186 0 1 2 + 188: 49(fvec3) FSub 185 187 + Store 181(outLightVec) 188 + 193: 57(fvec4) Load 153(worldPos) + 194: 49(fvec3) VectorShuffle 193 193 0 1 2 + 195: 49(fvec3) FNegate 194 + Store 189(outViewVec) 195 + 208: 24(int) Load 85(gl_InvocationID) + 209: 89(ptr) AccessChain 80(ubo) 32 208 + 210: 59 Load 209 + 211: 57(fvec4) Load 153(worldPos) + 212: 57(fvec4) MatrixTimesVector 210 211 + 214: 213(ptr) AccessChain 206 32 + Store 214 212 + 220: 24(int) Load 85(gl_InvocationID) + Store 216(gl_ViewportIndex) 220 + 228: 24(int) Load 225(gl_PrimitiveIDIn) + Store 221(gl_PrimitiveID) 228 + EmitVertex + Branch 38 + 38: Label + 229: 24(int) Load 28(i) + 230: 24(int) IAdd 229 83 + Store 28(i) 230 + 231: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 29 230 34 + Branch 35 + 37: Label + EndPrimitive + Return + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.glsl.tesc.out b/Test/baseResults/spv.debuginfo.glsl.tesc.out new file mode 100644 index 000000000..89e6cf308 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.glsl.tesc.out @@ -0,0 +1,622 @@ +spv.debuginfo.glsl.tesc +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 460 + + Capability Tessellation + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 13 "main" 231 235 261 328 338 418 430 438 450 + ExecutionMode 13 OutputVertices 4 + 8: String "uint" + 14: String "main" + 17: String "" + 24: String "float" + 34: String "screenSpaceTessFactor" + 40: String "p0" + 44: String "p1" + 47: String "bool" + 52: String "frustumCheck" + 58: String "midPoint" + 69: String "radius" + 79: String "v0" + 90: String "modelview" + 95: String "lightPos" + 98: String "frustumPlanes" + 100: String "tessellatedEdgeSize" + 105: String "viewportDim" + 109: String "UBO" + 113: String "ubo" + 115: String "int" + 126: String "clip0" + 146: String "clip1" + 211: String "pos" + 217: String "gl_Position" + 220: String "gl_PointSize" + 223: String "gl_CullDistance" + 227: String "gl_PerVertex" + 233: String "gl_in" + 237: String "gl_InvocationID" + 245: String "type.2d.image" + 247: String "@type.2d.image" + 251: String "type.sampled.image" + 252: String "@type.sampled.image" + 256: String "samplerHeight" + 263: String "inUV" + 280: String "i" + 330: String "gl_TessLevelInner" + 340: String "gl_TessLevelOuter" + 420: String "gl_out" + 432: String "outNormal" + 440: String "inNormal" + 452: String "outUV" + Name 13 "main" + Name 33 "screenSpaceTessFactor(vf4;vf4;" + Name 31 "p0" + Name 32 "p1" + Name 51 "frustumCheck(" + Name 56 "midPoint" + Name 67 "radius" + Name 77 "v0" + Name 88 "UBO" + MemberName 88(UBO) 0 "projection" + MemberName 88(UBO) 1 "modelview" + MemberName 88(UBO) 2 "lightPos" + MemberName 88(UBO) 3 "frustumPlanes" + MemberName 88(UBO) 4 "displacementFactor" + MemberName 88(UBO) 5 "tessellationFactor" + MemberName 88(UBO) 6 "viewportDim" + MemberName 88(UBO) 7 "tessellatedEdgeSize" + Name 111 "ubo" + Name 124 "clip0" + Name 144 "clip1" + Name 209 "pos" + Name 215 "gl_PerVertex" + MemberName 215(gl_PerVertex) 0 "gl_Position" + MemberName 215(gl_PerVertex) 1 "gl_PointSize" + MemberName 215(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 215(gl_PerVertex) 3 "gl_CullDistance" + Name 231 "gl_in" + Name 235 "gl_InvocationID" + Name 254 "samplerHeight" + Name 261 "inUV" + Name 278 "i" + Name 328 "gl_TessLevelInner" + Name 338 "gl_TessLevelOuter" + Name 354 "param" + Name 357 "param" + Name 362 "param" + Name 365 "param" + Name 370 "param" + Name 373 "param" + Name 378 "param" + Name 381 "param" + Name 405 "gl_PerVertex" + MemberName 405(gl_PerVertex) 0 "gl_Position" + MemberName 405(gl_PerVertex) 1 "gl_PointSize" + MemberName 405(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 405(gl_PerVertex) 3 "gl_CullDistance" + Name 418 "gl_out" + Name 430 "outNormal" + Name 438 "inNormal" + Name 450 "outUV" + Decorate 84 ArrayStride 16 + MemberDecorate 88(UBO) 0 ColMajor + MemberDecorate 88(UBO) 0 Offset 0 + MemberDecorate 88(UBO) 0 MatrixStride 16 + MemberDecorate 88(UBO) 1 ColMajor + MemberDecorate 88(UBO) 1 Offset 64 + MemberDecorate 88(UBO) 1 MatrixStride 16 + MemberDecorate 88(UBO) 2 Offset 128 + MemberDecorate 88(UBO) 3 Offset 144 + MemberDecorate 88(UBO) 4 Offset 240 + MemberDecorate 88(UBO) 5 Offset 244 + MemberDecorate 88(UBO) 6 Offset 248 + MemberDecorate 88(UBO) 7 Offset 256 + Decorate 88(UBO) Block + Decorate 111(ubo) DescriptorSet 0 + Decorate 111(ubo) Binding 0 + MemberDecorate 215(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 215(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 215(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 215(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 215(gl_PerVertex) Block + Decorate 235(gl_InvocationID) BuiltIn InvocationId + Decorate 254(samplerHeight) DescriptorSet 0 + Decorate 254(samplerHeight) Binding 1 + Decorate 261(inUV) Location 1 + Decorate 328(gl_TessLevelInner) Patch + Decorate 328(gl_TessLevelInner) BuiltIn TessLevelInner + Decorate 338(gl_TessLevelOuter) Patch + Decorate 338(gl_TessLevelOuter) BuiltIn TessLevelOuter + MemberDecorate 405(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 405(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 405(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 405(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 405(gl_PerVertex) Block + Decorate 430(outNormal) Location 0 + Decorate 438(inNormal) Location 0 + Decorate 450(outUV) Location 1 + 3: TypeVoid + 4: TypeFunction 3 + 6: TypeInt 32 0 + 9: 6(int) Constant 32 + 10: 6(int) Constant 6 + 11: 6(int) Constant 0 + 7: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 8 9 10 11 + 12: 6(int) Constant 3 + 5: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 3 + 16: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 17 + 19: 6(int) Constant 1 + 20: 6(int) Constant 4 + 21: 6(int) Constant 2 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 19 20 16 21 + 15: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 14 5 16 11 11 18 14 12 11 + 23: TypeFloat 32 + 25: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 24 9 12 11 + 26: TypeVector 23(float) 4 + 27: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 20 + 28: TypePointer Function 26(fvec4) + 29: TypeFunction 23(float) 28(ptr) 28(ptr) + 30: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 25 27 27 + 35: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 34 30 16 11 11 18 34 12 11 + 39: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 40 27 16 11 11 35 20 19 + 42: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 44 27 16 11 11 35 20 21 + 46: TypeBool + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 49: TypeFunction 46(bool) + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 48 + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 52 50 16 11 11 18 52 12 11 + 59: 6(int) Constant 54 + 57: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 58 27 16 59 11 35 20 + 60: 23(float) Constant 1056964608 + 66: TypePointer Function 23(float) + 70: 6(int) Constant 56 + 68: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 69 25 16 70 11 35 20 + 74: 23(float) Constant 1073741824 + 80: 6(int) Constant 59 + 78: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 79 27 16 80 11 35 20 + 81: TypeMatrix 26(fvec4) 4 + 83: 46(bool) ConstantTrue + 82: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 27 20 83 + 84: TypeArray 26(fvec4) 10 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 27 10 + 86: TypeVector 23(float) 2 + 87: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 21 + 88(UBO): TypeStruct 81 81 26(fvec4) 84 23(float) 23(float) 86(fvec2) 23(float) + 91: 6(int) Constant 30 + 92: 6(int) Constant 7 + 89: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 90 82 16 91 92 11 11 12 + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 90 82 16 91 92 11 11 12 + 96: 6(int) Constant 31 + 94: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 95 27 16 96 92 11 11 12 + 97: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 98 85 16 9 92 11 11 12 + 101: 6(int) Constant 36 + 102: 6(int) Constant 8 + 99: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 100 25 16 101 102 11 11 12 + 103: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 100 25 16 101 102 11 11 12 + 106: 6(int) Constant 35 + 104: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 105 87 16 106 92 11 11 12 + 107: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 100 25 16 101 102 11 11 12 + 108: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 109 19 16 80 11 18 109 11 12 89 93 94 97 99 103 104 107 + 110: TypePointer Uniform 88(UBO) + 111(ubo): 110(ptr) Variable Uniform + 112: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 113 108 16 80 11 18 113 111(ubo) 102 + 114: TypeInt 32 1 + 116: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 115 9 20 11 + 117: 114(int) Constant 1 + 118: TypePointer Uniform 81 + 127: 6(int) Constant 62 + 125: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 126 27 16 127 11 35 20 + 128: 114(int) Constant 0 + 133: TypeVector 23(float) 3 + 134: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 25 12 + 135: 23(float) Constant 0 + 136: 133(fvec3) ConstantComposite 135 135 135 + 147: 6(int) Constant 63 + 145: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 146 27 16 147 11 35 20 + 171: 114(int) Constant 6 + 172: TypePointer Uniform 86(fvec2) + 194: 114(int) Constant 7 + 195: TypePointer Uniform 23(float) + 199: 114(int) Constant 5 + 203: 23(float) Constant 1065353216 + 204: 23(float) Constant 1115684864 + 212: 6(int) Constant 85 + 210: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 211 27 16 212 11 53 20 + 213: TypeArray 23(float) 19 + 214: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 25 19 +215(gl_PerVertex): TypeStruct 26(fvec4) 23(float) 213 213 + 218: 6(int) Constant 1756 + 216: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 217 27 16 19 218 11 11 12 + 221: 6(int) Constant 1774 + 219: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 220 25 16 19 221 11 11 12 + 224: 6(int) Constant 1817 + 222: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 223 214 16 19 224 11 11 12 + 225: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 223 214 16 19 224 11 11 12 + 226: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 227 19 16 212 11 18 227 11 12 216 219 222 225 + 228: TypeArray 215(gl_PerVertex) 9 + 229: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 226 9 + 230: TypePointer Input 228 + 231(gl_in): 230(ptr) Variable Input + 232: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 233 229 16 212 11 18 233 231(gl_in) 102 + 234: TypePointer Input 114(int) +235(gl_InvocationID): 234(ptr) Variable Input + 236: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 237 116 16 212 11 18 237 235(gl_InvocationID) 102 + 239: TypePointer Input 26(fvec4) + 243: TypeImage 23(float) 2D sampled format:Unknown + 246: 6(int) Constant 86 + 248: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 0(Unknown) + 244: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 245 11 16 246 11 18 247 248 12 + 249: TypeSampledImage 243 + 250: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 251 11 16 246 11 18 252 248 12 + 253: TypePointer UniformConstant 249 +254(samplerHeight): 253(ptr) Variable UniformConstant + 255: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 256 250 16 246 11 18 256 254(samplerHeight) 102 + 258: TypeArray 86(fvec2) 9 + 259: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 87 9 + 260: TypePointer Input 258 + 261(inUV): 260(ptr) Variable Input + 262: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 263 259 16 246 11 18 263 261(inUV) 102 + 264: TypePointer Input 86(fvec2) + 269: 114(int) Constant 4 + 277: TypePointer Function 114(int) + 281: 6(int) Constant 89 + 279: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 280 116 16 281 11 53 20 + 289: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 292: 114(int) Constant 3 + 294: TypePointer Uniform 26(fvec4) + 298: 23(float) Constant 1090519040 + 300: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 304: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 305: 46(bool) ConstantFalse + 310: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 315: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 320: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 321: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 + 325: TypeArray 23(float) 21 + 326: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 25 21 + 327: TypePointer Output 325 +328(gl_TessLevelInner): 327(ptr) Variable Output + 331: 6(int) Constant 104 + 329: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 330 326 16 331 11 18 330 328(gl_TessLevelInner) 102 + 332: TypePointer Output 23(float) + 335: TypeArray 23(float) 20 + 336: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 25 20 + 337: TypePointer Output 335 +338(gl_TessLevelOuter): 337(ptr) Variable Output + 341: 6(int) Constant 106 + 339: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 340 336 16 341 11 18 340 338(gl_TessLevelOuter) 102 + 344: 114(int) Constant 2 + 350: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 47 9 21 11 +405(gl_PerVertex): TypeStruct 26(fvec4) 23(float) 213 213 + 407: 6(int) Constant 110 + 406: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 217 27 16 19 407 11 11 12 + 409: 6(int) Constant 128 + 408: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 220 25 16 19 409 11 11 12 + 411: 6(int) Constant 171 + 410: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 223 214 16 19 411 11 11 12 + 412: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 223 214 16 19 411 11 11 12 + 414: 6(int) Constant 137 + 413: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 227 19 16 414 11 18 227 11 12 406 408 410 412 + 415: TypeArray 405(gl_PerVertex) 20 + 416: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 413 20 + 417: TypePointer Output 415 + 418(gl_out): 417(ptr) Variable Output + 419: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 420 416 16 414 11 18 420 418(gl_out) 102 + 425: TypePointer Output 26(fvec4) + 427: TypeArray 133(fvec3) 20 + 428: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 134 20 + 429: TypePointer Output 427 + 430(outNormal): 429(ptr) Variable Output + 433: 6(int) Constant 138 + 431: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 432 428 16 433 11 18 432 430(outNormal) 102 + 435: TypeArray 133(fvec3) 9 + 436: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 134 9 + 437: TypePointer Input 435 + 438(inNormal): 437(ptr) Variable Input + 439: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 440 436 16 433 11 18 440 438(inNormal) 102 + 442: TypePointer Input 133(fvec3) + 445: TypePointer Output 133(fvec3) + 447: TypeArray 86(fvec2) 20 + 448: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 87 20 + 449: TypePointer Output 447 + 450(outUV): 449(ptr) Variable Output + 453: 6(int) Constant 139 + 451: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 452 448 16 453 11 18 452 450(outUV) 102 + 458: TypePointer Output 86(fvec2) + 13(main): 3 Function None 4 + 22: Label + 354(param): 28(ptr) Variable Function + 357(param): 28(ptr) Variable Function + 362(param): 28(ptr) Variable Function + 365(param): 28(ptr) Variable Function + 370(param): 28(ptr) Variable Function + 373(param): 28(ptr) Variable Function + 378(param): 28(ptr) Variable Function + 381(param): 28(ptr) Variable Function + 313: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main) + 314: 114(int) Load 235(gl_InvocationID) + 316: 46(bool) IEqual 314 128 + SelectionMerge 318 None + BranchConditional 316 317 318 + 317: Label + 319: 46(bool) FunctionCall 51(frustumCheck() + 322: 46(bool) LogicalNot 319 + SelectionMerge 324 None + BranchConditional 322 323 347 + 323: Label + 333: 332(ptr) AccessChain 328(gl_TessLevelInner) 128 + Store 333 135 + 334: 332(ptr) AccessChain 328(gl_TessLevelInner) 117 + Store 334 135 + 342: 332(ptr) AccessChain 338(gl_TessLevelOuter) 128 + Store 342 135 + 343: 332(ptr) AccessChain 338(gl_TessLevelOuter) 117 + Store 343 135 + 345: 332(ptr) AccessChain 338(gl_TessLevelOuter) 344 + Store 345 135 + 346: 332(ptr) AccessChain 338(gl_TessLevelOuter) 292 + Store 346 135 + Branch 324 + 347: Label + 348: 195(ptr) AccessChain 111(ubo) 199 + 349: 23(float) Load 348 + 351: 46(bool) FOrdGreaterThan 349 135 + SelectionMerge 353 None + BranchConditional 351 352 398 + 352: Label + 355: 239(ptr) AccessChain 231(gl_in) 292 128 + 356: 26(fvec4) Load 355 + Store 354(param) 356 + 358: 239(ptr) AccessChain 231(gl_in) 128 128 + 359: 26(fvec4) Load 358 + Store 357(param) 359 + 360: 23(float) FunctionCall 33(screenSpaceTessFactor(vf4;vf4;) 354(param) 357(param) + 361: 332(ptr) AccessChain 338(gl_TessLevelOuter) 128 + Store 361 360 + 363: 239(ptr) AccessChain 231(gl_in) 128 128 + 364: 26(fvec4) Load 363 + Store 362(param) 364 + 366: 239(ptr) AccessChain 231(gl_in) 117 128 + 367: 26(fvec4) Load 366 + Store 365(param) 367 + 368: 23(float) FunctionCall 33(screenSpaceTessFactor(vf4;vf4;) 362(param) 365(param) + 369: 332(ptr) AccessChain 338(gl_TessLevelOuter) 117 + Store 369 368 + 371: 239(ptr) AccessChain 231(gl_in) 117 128 + 372: 26(fvec4) Load 371 + Store 370(param) 372 + 374: 239(ptr) AccessChain 231(gl_in) 344 128 + 375: 26(fvec4) Load 374 + Store 373(param) 375 + 376: 23(float) FunctionCall 33(screenSpaceTessFactor(vf4;vf4;) 370(param) 373(param) + 377: 332(ptr) AccessChain 338(gl_TessLevelOuter) 344 + Store 377 376 + 379: 239(ptr) AccessChain 231(gl_in) 344 128 + 380: 26(fvec4) Load 379 + Store 378(param) 380 + 382: 239(ptr) AccessChain 231(gl_in) 292 128 + 383: 26(fvec4) Load 382 + Store 381(param) 383 + 384: 23(float) FunctionCall 33(screenSpaceTessFactor(vf4;vf4;) 378(param) 381(param) + 385: 332(ptr) AccessChain 338(gl_TessLevelOuter) 292 + Store 385 384 + 386: 332(ptr) AccessChain 338(gl_TessLevelOuter) 128 + 387: 23(float) Load 386 + 388: 332(ptr) AccessChain 338(gl_TessLevelOuter) 292 + 389: 23(float) Load 388 + 390: 23(float) ExtInst 2(GLSL.std.450) 46(FMix) 387 389 60 + 391: 332(ptr) AccessChain 328(gl_TessLevelInner) 128 + Store 391 390 + 392: 332(ptr) AccessChain 338(gl_TessLevelOuter) 344 + 393: 23(float) Load 392 + 394: 332(ptr) AccessChain 338(gl_TessLevelOuter) 117 + 395: 23(float) Load 394 + 396: 23(float) ExtInst 2(GLSL.std.450) 46(FMix) 393 395 60 + 397: 332(ptr) AccessChain 328(gl_TessLevelInner) 117 + Store 397 396 + Branch 353 + 398: Label + 399: 332(ptr) AccessChain 328(gl_TessLevelInner) 128 + Store 399 203 + 400: 332(ptr) AccessChain 328(gl_TessLevelInner) 117 + Store 400 203 + 401: 332(ptr) AccessChain 338(gl_TessLevelOuter) 128 + Store 401 203 + 402: 332(ptr) AccessChain 338(gl_TessLevelOuter) 117 + Store 402 203 + 403: 332(ptr) AccessChain 338(gl_TessLevelOuter) 344 + Store 403 203 + 404: 332(ptr) AccessChain 338(gl_TessLevelOuter) 292 + Store 404 203 + Branch 353 + 353: Label + Branch 324 + 324: Label + Branch 318 + 318: Label + 421: 114(int) Load 235(gl_InvocationID) + 422: 114(int) Load 235(gl_InvocationID) + 423: 239(ptr) AccessChain 231(gl_in) 422 128 + 424: 26(fvec4) Load 423 + 426: 425(ptr) AccessChain 418(gl_out) 421 128 + Store 426 424 + 434: 114(int) Load 235(gl_InvocationID) + 441: 114(int) Load 235(gl_InvocationID) + 443: 442(ptr) AccessChain 438(inNormal) 441 + 444: 133(fvec3) Load 443 + 446: 445(ptr) AccessChain 430(outNormal) 434 + Store 446 444 + 454: 114(int) Load 235(gl_InvocationID) + 455: 114(int) Load 235(gl_InvocationID) + 456: 264(ptr) AccessChain 261(inUV) 455 + 457: 86(fvec2) Load 456 + 459: 458(ptr) AccessChain 450(outUV) 454 + Store 459 457 + Return + FunctionEnd +33(screenSpaceTessFactor(vf4;vf4;): 23(float) Function None 29 + 31(p0): 28(ptr) FunctionParameter + 32(p1): 28(ptr) FunctionParameter + 36: Label + 56(midPoint): 28(ptr) Variable Function + 67(radius): 66(ptr) Variable Function + 77(v0): 28(ptr) Variable Function + 124(clip0): 28(ptr) Variable Function + 144(clip1): 28(ptr) Variable Function + 37: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 35 + 38: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 16 11 11 11 11 + 41: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 39 31(p0) 42 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 43 32(p1) 42 + 55: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 35 33(screenSpaceTessFactor(vf4;vf4;) + 61: 26(fvec4) Load 31(p0) + 62: 26(fvec4) Load 32(p1) + 63: 26(fvec4) FAdd 61 62 + 64: 26(fvec4) VectorTimesScalar 63 60 + Store 56(midPoint) 64 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 57 64 42 + 71: 26(fvec4) Load 31(p0) + 72: 26(fvec4) Load 32(p1) + 73: 23(float) ExtInst 2(GLSL.std.450) 67(Distance) 71 72 + 75: 23(float) FDiv 73 74 + Store 67(radius) 75 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 68 75 42 + 119: 118(ptr) AccessChain 111(ubo) 117 + 120: 81 Load 119 + 121: 26(fvec4) Load 56(midPoint) + 122: 26(fvec4) MatrixTimesVector 120 121 + Store 77(v0) 122 + 123: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 78 122 42 + 129: 118(ptr) AccessChain 111(ubo) 128 + 130: 81 Load 129 + 131: 26(fvec4) Load 77(v0) + 132: 23(float) Load 67(radius) + 137: 23(float) CompositeExtract 136 0 + 138: 23(float) CompositeExtract 136 1 + 139: 23(float) CompositeExtract 136 2 + 140: 26(fvec4) CompositeConstruct 132 137 138 139 + 141: 26(fvec4) FSub 131 140 + 142: 26(fvec4) MatrixTimesVector 130 141 + Store 124(clip0) 142 + 143: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 125 142 42 + 148: 118(ptr) AccessChain 111(ubo) 128 + 149: 81 Load 148 + 150: 26(fvec4) Load 77(v0) + 151: 23(float) Load 67(radius) + 152: 23(float) CompositeExtract 136 0 + 153: 23(float) CompositeExtract 136 1 + 154: 23(float) CompositeExtract 136 2 + 155: 26(fvec4) CompositeConstruct 151 152 153 154 + 156: 26(fvec4) FAdd 150 155 + 157: 26(fvec4) MatrixTimesVector 149 156 + Store 144(clip1) 157 + 158: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 145 157 42 + 159: 66(ptr) AccessChain 124(clip0) 12 + 160: 23(float) Load 159 + 161: 26(fvec4) Load 124(clip0) + 162: 26(fvec4) CompositeConstruct 160 160 160 160 + 163: 26(fvec4) FDiv 161 162 + Store 124(clip0) 163 + 164: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 125 163 42 + 165: 66(ptr) AccessChain 144(clip1) 12 + 166: 23(float) Load 165 + 167: 26(fvec4) Load 144(clip1) + 168: 26(fvec4) CompositeConstruct 166 166 166 166 + 169: 26(fvec4) FDiv 167 168 + Store 144(clip1) 169 + 170: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 145 169 42 + 173: 172(ptr) AccessChain 111(ubo) 171 + 174: 86(fvec2) Load 173 + 175: 26(fvec4) Load 124(clip0) + 176: 86(fvec2) VectorShuffle 175 175 0 1 + 177: 86(fvec2) FMul 176 174 + 178: 66(ptr) AccessChain 124(clip0) 11 + 179: 23(float) CompositeExtract 177 0 + Store 178 179 + 180: 66(ptr) AccessChain 124(clip0) 19 + 181: 23(float) CompositeExtract 177 1 + Store 180 181 + 182: 172(ptr) AccessChain 111(ubo) 171 + 183: 86(fvec2) Load 182 + 184: 26(fvec4) Load 144(clip1) + 185: 86(fvec2) VectorShuffle 184 184 0 1 + 186: 86(fvec2) FMul 185 183 + 187: 66(ptr) AccessChain 144(clip1) 11 + 188: 23(float) CompositeExtract 186 0 + Store 187 188 + 189: 66(ptr) AccessChain 144(clip1) 19 + 190: 23(float) CompositeExtract 186 1 + Store 189 190 + 191: 26(fvec4) Load 124(clip0) + 192: 26(fvec4) Load 144(clip1) + 193: 23(float) ExtInst 2(GLSL.std.450) 67(Distance) 191 192 + 196: 195(ptr) AccessChain 111(ubo) 194 + 197: 23(float) Load 196 + 198: 23(float) FDiv 193 197 + 200: 195(ptr) AccessChain 111(ubo) 199 + 201: 23(float) Load 200 + 202: 23(float) FMul 198 201 + 205: 23(float) ExtInst 2(GLSL.std.450) 43(FClamp) 202 203 204 + ReturnValue 205 + FunctionEnd +51(frustumCheck(): 46(bool) Function None 49 + 54: Label + 209(pos): 28(ptr) Variable Function + 278(i): 277(ptr) Variable Function + 208: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 53 51(frustumCheck() + 238: 114(int) Load 235(gl_InvocationID) + 240: 239(ptr) AccessChain 231(gl_in) 238 128 + 241: 26(fvec4) Load 240 + Store 209(pos) 241 + 242: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 210 241 42 + 257: 249 Load 254(samplerHeight) + 265: 264(ptr) AccessChain 261(inUV) 128 + 266: 86(fvec2) Load 265 + 267: 26(fvec4) ImageSampleExplicitLod 257 266 Lod 135 + 268: 23(float) CompositeExtract 267 0 + 270: 195(ptr) AccessChain 111(ubo) 269 + 271: 23(float) Load 270 + 272: 23(float) FMul 268 271 + 273: 66(ptr) AccessChain 209(pos) 19 + 274: 23(float) Load 273 + 275: 23(float) FSub 274 272 + 276: 66(ptr) AccessChain 209(pos) 19 + Store 276 275 + Store 278(i) 128 + 282: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 279 128 42 + Branch 283 + 283: Label + LoopMerge 285 286 None + Branch 287 + 287: Label + 288: 114(int) Load 278(i) + 290: 46(bool) SLessThan 288 171 + BranchConditional 290 284 285 + 284: Label + 291: 26(fvec4) Load 209(pos) + 293: 114(int) Load 278(i) + 295: 294(ptr) AccessChain 111(ubo) 292 293 + 296: 26(fvec4) Load 295 + 297: 23(float) Dot 291 296 + 299: 23(float) FAdd 297 298 + 301: 46(bool) FOrdLessThan 299 135 + SelectionMerge 303 None + BranchConditional 301 302 303 + 302: Label + ReturnValue 305 + 303: Label + Branch 286 + 286: Label + 307: 114(int) Load 278(i) + 308: 114(int) IAdd 307 117 + Store 278(i) 308 + 309: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 279 308 42 + Branch 283 + 285: Label + ReturnValue 83 + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.glsl.tese.out b/Test/baseResults/spv.debuginfo.glsl.tese.out new file mode 100644 index 000000000..e2b0e3ee1 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.glsl.tese.out @@ -0,0 +1,421 @@ +spv.debuginfo.glsl.tese +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 315 + + Capability Tessellation + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 13 "main" 37 54 80 98 124 159 267 279 286 297 303 + ExecutionMode 13 Quads + ExecutionMode 13 SpacingEqual + ExecutionMode 13 VertexOrderCw + 8: String "uint" + 14: String "main" + 17: String "" + 25: String "float" + 32: String "uv1" + 39: String "inUV" + 42: String "int" + 56: String "gl_TessCoord" + 66: String "uv2" + 82: String "outUV" + 93: String "n1" + 100: String "inNormal" + 112: String "n2" + 126: String "outNormal" + 139: String "pos1" + 145: String "gl_Position" + 148: String "gl_PointSize" + 151: String "gl_CullDistance" + 155: String "gl_PerVertex" + 161: String "gl_in" + 174: String "pos2" + 187: String "pos" + 198: String "type.2d.image" + 200: String "@type.2d.image" + 204: String "type.sampled.image" + 205: String "@type.sampled.image" + 209: String "displacementMap" + 223: String "modelview" + 228: String "lightPos" + 231: String "frustumPlanes" + 233: String "tessellatedEdgeSize" + 237: String "viewportDim" + 241: String "UBO" + 245: String "ubo" + 281: String "outViewVec" + 288: String "outLightVec" + 299: String "outWorldPos" + 305: String "outEyePos" + Name 13 "main" + Name 30 "uv1" + Name 37 "inUV" + Name 54 "gl_TessCoord" + Name 64 "uv2" + Name 80 "outUV" + Name 91 "n1" + Name 98 "inNormal" + Name 110 "n2" + Name 124 "outNormal" + Name 137 "pos1" + Name 143 "gl_PerVertex" + MemberName 143(gl_PerVertex) 0 "gl_Position" + MemberName 143(gl_PerVertex) 1 "gl_PointSize" + MemberName 143(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 143(gl_PerVertex) 3 "gl_CullDistance" + Name 159 "gl_in" + Name 172 "pos2" + Name 185 "pos" + Name 207 "displacementMap" + Name 221 "UBO" + MemberName 221(UBO) 0 "projection" + MemberName 221(UBO) 1 "modelview" + MemberName 221(UBO) 2 "lightPos" + MemberName 221(UBO) 3 "frustumPlanes" + MemberName 221(UBO) 4 "displacementFactor" + MemberName 221(UBO) 5 "tessellationFactor" + MemberName 221(UBO) 6 "viewportDim" + MemberName 221(UBO) 7 "tessellatedEdgeSize" + Name 243 "ubo" + Name 256 "gl_PerVertex" + MemberName 256(gl_PerVertex) 0 "gl_Position" + MemberName 256(gl_PerVertex) 1 "gl_PointSize" + MemberName 256(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 256(gl_PerVertex) 3 "gl_CullDistance" + Name 267 "" + Name 279 "outViewVec" + Name 286 "outLightVec" + Name 297 "outWorldPos" + Name 303 "outEyePos" + Decorate 37(inUV) Location 1 + Decorate 54(gl_TessCoord) BuiltIn TessCoord + Decorate 80(outUV) Location 1 + Decorate 98(inNormal) Location 0 + Decorate 124(outNormal) Location 0 + MemberDecorate 143(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 143(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 143(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 143(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 143(gl_PerVertex) Block + Decorate 207(displacementMap) DescriptorSet 0 + Decorate 207(displacementMap) Binding 1 + Decorate 219 ArrayStride 16 + MemberDecorate 221(UBO) 0 ColMajor + MemberDecorate 221(UBO) 0 Offset 0 + MemberDecorate 221(UBO) 0 MatrixStride 16 + MemberDecorate 221(UBO) 1 ColMajor + MemberDecorate 221(UBO) 1 Offset 64 + MemberDecorate 221(UBO) 1 MatrixStride 16 + MemberDecorate 221(UBO) 2 Offset 128 + MemberDecorate 221(UBO) 3 Offset 144 + MemberDecorate 221(UBO) 4 Offset 240 + MemberDecorate 221(UBO) 5 Offset 244 + MemberDecorate 221(UBO) 6 Offset 248 + MemberDecorate 221(UBO) 7 Offset 256 + Decorate 221(UBO) Block + Decorate 243(ubo) DescriptorSet 0 + Decorate 243(ubo) Binding 0 + MemberDecorate 256(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 256(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 256(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 256(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 256(gl_PerVertex) Block + Decorate 279(outViewVec) Location 2 + Decorate 286(outLightVec) Location 3 + Decorate 297(outWorldPos) Location 5 + Decorate 303(outEyePos) Location 4 + 3: TypeVoid + 4: TypeFunction 3 + 6: TypeInt 32 0 + 9: 6(int) Constant 32 + 10: 6(int) Constant 6 + 11: 6(int) Constant 0 + 7: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 8 9 10 11 + 12: 6(int) Constant 3 + 5: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 3 + 16: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 17 + 19: 6(int) Constant 1 + 20: 6(int) Constant 4 + 21: 6(int) Constant 2 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 19 20 16 21 + 15: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 14 5 16 11 11 18 14 12 11 + 24: TypeFloat 32 + 26: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 25 9 12 11 + 27: TypeVector 24(float) 2 + 28: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 26 21 + 29: TypePointer Function 27(fvec2) + 33: 6(int) Constant 56 + 31: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 32 28 16 33 11 15 20 + 34: TypeArray 27(fvec2) 9 + 35: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 28 9 + 36: TypePointer Input 34 + 37(inUV): 36(ptr) Variable Input + 40: 6(int) Constant 8 + 38: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 39 35 16 33 11 18 39 37(inUV) 40 + 41: TypeInt 32 1 + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 42 9 20 11 + 44: 41(int) Constant 0 + 45: TypePointer Input 27(fvec2) + 48: 41(int) Constant 1 + 51: TypeVector 24(float) 3 + 52: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 26 12 + 53: TypePointer Input 51(fvec3) +54(gl_TessCoord): 53(ptr) Variable Input + 55: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 56 52 16 33 11 18 56 54(gl_TessCoord) 40 + 57: TypePointer Input 24(float) + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 67: 6(int) Constant 57 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 66 28 16 67 11 15 20 + 68: 41(int) Constant 3 + 71: 41(int) Constant 2 + 79: TypePointer Output 27(fvec2) + 80(outUV): 79(ptr) Variable Output + 83: 6(int) Constant 58 + 81: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 82 28 16 83 11 18 82 80(outUV) 40 + 90: TypePointer Function 51(fvec3) + 94: 6(int) Constant 60 + 92: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 93 52 16 94 11 15 20 + 95: TypeArray 51(fvec3) 9 + 96: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 52 9 + 97: TypePointer Input 95 + 98(inNormal): 97(ptr) Variable Input + 99: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 100 96 16 94 11 18 100 98(inNormal) 40 + 113: 6(int) Constant 61 + 111: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 112 52 16 113 11 15 20 + 123: TypePointer Output 51(fvec3) + 124(outNormal): 123(ptr) Variable Output + 127: 6(int) Constant 62 + 125: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 126 52 16 127 11 18 126 124(outNormal) 40 + 134: TypeVector 24(float) 4 + 135: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 26 20 + 136: TypePointer Function 134(fvec4) + 140: 6(int) Constant 65 + 138: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 139 135 16 140 11 15 20 + 141: TypeArray 24(float) 19 + 142: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 26 19 +143(gl_PerVertex): TypeStruct 134(fvec4) 24(float) 141 141 + 146: 6(int) Constant 1756 + 144: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 145 135 16 19 146 11 11 12 + 149: 6(int) Constant 1774 + 147: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 148 26 16 19 149 11 11 12 + 152: 6(int) Constant 1817 + 150: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 151 142 16 19 152 11 11 12 + 153: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 151 142 16 19 152 11 11 12 + 154: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 155 19 16 140 11 18 155 11 12 144 147 150 153 + 156: TypeArray 143(gl_PerVertex) 9 + 157: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 154 9 + 158: TypePointer Input 156 + 159(gl_in): 158(ptr) Variable Input + 160: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 161 157 16 140 11 18 161 159(gl_in) 40 + 162: TypePointer Input 134(fvec4) + 175: 6(int) Constant 66 + 173: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 174 135 16 175 11 15 20 + 188: 6(int) Constant 67 + 186: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 187 135 16 188 11 15 20 + 196: TypeImage 24(float) 2D sampled format:Unknown + 199: 6(int) Constant 69 + 201: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 0(Unknown) + 197: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 198 11 16 199 11 18 200 201 12 + 202: TypeSampledImage 196 + 203: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 204 11 16 199 11 18 205 201 12 + 206: TypePointer UniformConstant 202 +207(displacementMap): 206(ptr) Variable UniformConstant + 208: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 209 203 16 199 11 18 209 207(displacementMap) 40 + 212: 24(float) Constant 0 + 215: TypeMatrix 134(fvec4) 4 + 217: TypeBool + 218: 217(bool) ConstantTrue + 216: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 135 20 218 + 219: TypeArray 134(fvec4) 10 + 220: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 135 10 + 221(UBO): TypeStruct 215 215 134(fvec4) 219 24(float) 24(float) 27(fvec2) 24(float) + 224: 6(int) Constant 30 + 225: 6(int) Constant 7 + 222: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 223 216 16 224 225 11 11 12 + 226: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 223 216 16 224 225 11 11 12 + 229: 6(int) Constant 31 + 227: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 228 135 16 229 225 11 11 12 + 230: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 231 220 16 9 225 11 11 12 + 234: 6(int) Constant 36 + 232: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 233 26 16 234 40 11 11 12 + 235: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 233 26 16 234 40 11 11 12 + 238: 6(int) Constant 35 + 236: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 237 28 16 238 225 11 11 12 + 239: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 233 26 16 234 40 11 11 12 + 240: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 241 19 16 199 11 18 241 11 12 222 226 227 230 232 235 236 239 + 242: TypePointer Uniform 221(UBO) + 243(ubo): 242(ptr) Variable Uniform + 244: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 245 240 16 199 11 18 245 243(ubo) 40 + 246: 41(int) Constant 4 + 247: TypePointer Uniform 24(float) + 251: TypePointer Function 24(float) +256(gl_PerVertex): TypeStruct 134(fvec4) 24(float) 141 141 + 258: 6(int) Constant 165 + 257: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 145 135 16 19 258 11 11 12 + 260: 6(int) Constant 183 + 259: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 148 26 16 19 260 11 11 12 + 262: 6(int) Constant 226 + 261: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 151 142 16 19 262 11 11 12 + 263: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 151 142 16 19 262 11 11 12 + 265: 6(int) Constant 71 + 264: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 155 19 16 265 11 18 155 11 12 257 259 261 263 + 266: TypePointer Output 256(gl_PerVertex) + 267: 266(ptr) Variable Output + 268: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 17 264 16 265 11 18 17 267 40 + 269: TypePointer Uniform 215 + 277: TypePointer Output 134(fvec4) + 279(outViewVec): 123(ptr) Variable Output + 282: 6(int) Constant 74 + 280: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 281 52 16 282 11 18 281 279(outViewVec) 40 +286(outLightVec): 123(ptr) Variable Output + 289: 6(int) Constant 75 + 287: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 288 52 16 289 11 18 288 286(outLightVec) 40 + 290: TypePointer Uniform 134(fvec4) +297(outWorldPos): 123(ptr) Variable Output + 300: 6(int) Constant 76 + 298: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 299 52 16 300 11 18 299 297(outWorldPos) 40 + 303(outEyePos): 123(ptr) Variable Output + 306: 6(int) Constant 77 + 304: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 305 52 16 306 11 18 305 303(outEyePos) 40 + 13(main): 3 Function None 4 + 22: Label + 30(uv1): 29(ptr) Variable Function + 64(uv2): 29(ptr) Variable Function + 91(n1): 90(ptr) Variable Function + 110(n2): 90(ptr) Variable Function + 137(pos1): 136(ptr) Variable Function + 172(pos2): 136(ptr) Variable Function + 185(pos): 136(ptr) Variable Function + 23: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main) + 46: 45(ptr) AccessChain 37(inUV) 44 + 47: 27(fvec2) Load 46 + 49: 45(ptr) AccessChain 37(inUV) 48 + 50: 27(fvec2) Load 49 + 58: 57(ptr) AccessChain 54(gl_TessCoord) 11 + 59: 24(float) Load 58 + 60: 27(fvec2) CompositeConstruct 59 59 + 61: 27(fvec2) ExtInst 2(GLSL.std.450) 46(FMix) 47 50 60 + Store 30(uv1) 61 + 62: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 31 61 63 + 69: 45(ptr) AccessChain 37(inUV) 68 + 70: 27(fvec2) Load 69 + 72: 45(ptr) AccessChain 37(inUV) 71 + 73: 27(fvec2) Load 72 + 74: 57(ptr) AccessChain 54(gl_TessCoord) 11 + 75: 24(float) Load 74 + 76: 27(fvec2) CompositeConstruct 75 75 + 77: 27(fvec2) ExtInst 2(GLSL.std.450) 46(FMix) 70 73 76 + Store 64(uv2) 77 + 78: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 65 77 63 + 84: 27(fvec2) Load 30(uv1) + 85: 27(fvec2) Load 64(uv2) + 86: 57(ptr) AccessChain 54(gl_TessCoord) 19 + 87: 24(float) Load 86 + 88: 27(fvec2) CompositeConstruct 87 87 + 89: 27(fvec2) ExtInst 2(GLSL.std.450) 46(FMix) 84 85 88 + Store 80(outUV) 89 + 101: 53(ptr) AccessChain 98(inNormal) 44 + 102: 51(fvec3) Load 101 + 103: 53(ptr) AccessChain 98(inNormal) 48 + 104: 51(fvec3) Load 103 + 105: 57(ptr) AccessChain 54(gl_TessCoord) 11 + 106: 24(float) Load 105 + 107: 51(fvec3) CompositeConstruct 106 106 106 + 108: 51(fvec3) ExtInst 2(GLSL.std.450) 46(FMix) 102 104 107 + Store 91(n1) 108 + 109: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 92 108 63 + 114: 53(ptr) AccessChain 98(inNormal) 68 + 115: 51(fvec3) Load 114 + 116: 53(ptr) AccessChain 98(inNormal) 71 + 117: 51(fvec3) Load 116 + 118: 57(ptr) AccessChain 54(gl_TessCoord) 11 + 119: 24(float) Load 118 + 120: 51(fvec3) CompositeConstruct 119 119 119 + 121: 51(fvec3) ExtInst 2(GLSL.std.450) 46(FMix) 115 117 120 + Store 110(n2) 121 + 122: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 111 121 63 + 128: 51(fvec3) Load 91(n1) + 129: 51(fvec3) Load 110(n2) + 130: 57(ptr) AccessChain 54(gl_TessCoord) 19 + 131: 24(float) Load 130 + 132: 51(fvec3) CompositeConstruct 131 131 131 + 133: 51(fvec3) ExtInst 2(GLSL.std.450) 46(FMix) 128 129 132 + Store 124(outNormal) 133 + 163: 162(ptr) AccessChain 159(gl_in) 44 44 + 164: 134(fvec4) Load 163 + 165: 162(ptr) AccessChain 159(gl_in) 48 44 + 166: 134(fvec4) Load 165 + 167: 57(ptr) AccessChain 54(gl_TessCoord) 11 + 168: 24(float) Load 167 + 169: 134(fvec4) CompositeConstruct 168 168 168 168 + 170: 134(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 164 166 169 + Store 137(pos1) 170 + 171: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 138 170 63 + 176: 162(ptr) AccessChain 159(gl_in) 68 44 + 177: 134(fvec4) Load 176 + 178: 162(ptr) AccessChain 159(gl_in) 71 44 + 179: 134(fvec4) Load 178 + 180: 57(ptr) AccessChain 54(gl_TessCoord) 11 + 181: 24(float) Load 180 + 182: 134(fvec4) CompositeConstruct 181 181 181 181 + 183: 134(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 177 179 182 + Store 172(pos2) 183 + 184: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 173 183 63 + 189: 134(fvec4) Load 137(pos1) + 190: 134(fvec4) Load 172(pos2) + 191: 57(ptr) AccessChain 54(gl_TessCoord) 19 + 192: 24(float) Load 191 + 193: 134(fvec4) CompositeConstruct 192 192 192 192 + 194: 134(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 189 190 193 + Store 185(pos) 194 + 195: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 186 194 63 + 210: 202 Load 207(displacementMap) + 211: 27(fvec2) Load 80(outUV) + 213: 134(fvec4) ImageSampleExplicitLod 210 211 Lod 212 + 214: 24(float) CompositeExtract 213 0 + 248: 247(ptr) AccessChain 243(ubo) 246 + 249: 24(float) Load 248 + 250: 24(float) FMul 214 249 + 252: 251(ptr) AccessChain 185(pos) 19 + 253: 24(float) Load 252 + 254: 24(float) FSub 253 250 + 255: 251(ptr) AccessChain 185(pos) 19 + Store 255 254 + 270: 269(ptr) AccessChain 243(ubo) 44 + 271: 215 Load 270 + 272: 269(ptr) AccessChain 243(ubo) 48 + 273: 215 Load 272 + 274: 215 MatrixTimesMatrix 271 273 + 275: 134(fvec4) Load 185(pos) + 276: 134(fvec4) MatrixTimesVector 274 275 + 278: 277(ptr) AccessChain 267 44 + Store 278 276 + 283: 134(fvec4) Load 185(pos) + 284: 51(fvec3) VectorShuffle 283 283 0 1 2 + 285: 51(fvec3) FNegate 284 + Store 279(outViewVec) 285 + 291: 290(ptr) AccessChain 243(ubo) 71 + 292: 134(fvec4) Load 291 + 293: 51(fvec3) VectorShuffle 292 292 0 1 2 + 294: 51(fvec3) Load 279(outViewVec) + 295: 51(fvec3) FAdd 293 294 + 296: 51(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 295 + Store 286(outLightVec) 296 + 301: 134(fvec4) Load 185(pos) + 302: 51(fvec3) VectorShuffle 301 301 0 1 2 + Store 297(outWorldPos) 302 + 307: 269(ptr) AccessChain 243(ubo) 48 + 308: 215 Load 307 + 309: 134(fvec4) Load 185(pos) + 310: 134(fvec4) MatrixTimesVector 308 309 + 311: 24(float) CompositeExtract 310 0 + 312: 24(float) CompositeExtract 310 1 + 313: 24(float) CompositeExtract 310 2 + 314: 51(fvec3) CompositeConstruct 311 312 313 + Store 303(outEyePos) 314 + Return + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.glsl.vert.out b/Test/baseResults/spv.debuginfo.glsl.vert.out new file mode 100644 index 000000000..303f314ce --- /dev/null +++ b/Test/baseResults/spv.debuginfo.glsl.vert.out @@ -0,0 +1,487 @@ +spv.debuginfo.glsl.vert +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 377 + + Capability Shader + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 13 "main" 30 36 40 47 55 68 248 265 270 295 309 327 362 370 + 8: String "uint" + 14: String "main" + 17: String "" + 25: String "float" + 32: String "outColor" + 38: String "inColor" + 42: String "outUV" + 49: String "inUV" + 52: String "int" + 57: String "instanceTexIndex" + 66: String "s" + 70: String "instanceRot" + 82: String "modelview" + 87: String "lightPos" + 90: String "globSpeed" + 94: String "UBO" + 98: String "ubo" + 109: String "c" + 123: String "mx" + 158: String "my" + 187: String "mz" + 202: String "rotMat" + 228: String "gRotMat" + 246: String "locPos" + 250: String "inPos" + 261: String "pos" + 267: String "instanceScale" + 272: String "instancePos" + 284: String "gl_Position" + 287: String "gl_PointSize" + 289: String "gl_CullDistance" + 292: String "gl_PerVertex" + 311: String "outNormal" + 329: String "inNormal" + 345: String "lPos" + 364: String "outLightVec" + 372: String "outViewVec" + Name 13 "main" + Name 30 "outColor" + Name 36 "inColor" + Name 40 "outUV" + Name 47 "inUV" + Name 55 "instanceTexIndex" + Name 64 "s" + Name 68 "instanceRot" + Name 80 "UBO" + MemberName 80(UBO) 0 "projection" + MemberName 80(UBO) 1 "modelview" + MemberName 80(UBO) 2 "lightPos" + MemberName 80(UBO) 3 "locSpeed" + MemberName 80(UBO) 4 "globSpeed" + Name 96 "ubo" + Name 107 "c" + Name 121 "mx" + Name 156 "my" + Name 185 "mz" + Name 200 "rotMat" + Name 226 "gRotMat" + Name 244 "locPos" + Name 248 "inPos" + Name 259 "pos" + Name 265 "instanceScale" + Name 270 "instancePos" + Name 282 "gl_PerVertex" + MemberName 282(gl_PerVertex) 0 "gl_Position" + MemberName 282(gl_PerVertex) 1 "gl_PointSize" + MemberName 282(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 282(gl_PerVertex) 3 "gl_CullDistance" + Name 295 "" + Name 309 "outNormal" + Name 327 "inNormal" + Name 343 "lPos" + Name 362 "outLightVec" + Name 370 "outViewVec" + Decorate 30(outColor) Location 1 + Decorate 36(inColor) Location 3 + Decorate 40(outUV) Location 2 + Decorate 47(inUV) Location 2 + Decorate 55(instanceTexIndex) Location 7 + Decorate 68(instanceRot) Location 5 + MemberDecorate 80(UBO) 0 ColMajor + MemberDecorate 80(UBO) 0 Offset 0 + MemberDecorate 80(UBO) 0 MatrixStride 16 + MemberDecorate 80(UBO) 1 ColMajor + MemberDecorate 80(UBO) 1 Offset 64 + MemberDecorate 80(UBO) 1 MatrixStride 16 + MemberDecorate 80(UBO) 2 Offset 128 + MemberDecorate 80(UBO) 3 Offset 144 + MemberDecorate 80(UBO) 4 Offset 148 + Decorate 80(UBO) Block + Decorate 96(ubo) DescriptorSet 0 + Decorate 96(ubo) Binding 0 + Decorate 248(inPos) Location 0 + Decorate 265(instanceScale) Location 6 + Decorate 270(instancePos) Location 4 + MemberDecorate 282(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 282(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 282(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 282(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 282(gl_PerVertex) Block + Decorate 309(outNormal) Location 0 + Decorate 327(inNormal) Location 1 + Decorate 362(outLightVec) Location 4 + Decorate 370(outViewVec) Location 3 + 3: TypeVoid + 4: TypeFunction 3 + 6: TypeInt 32 0 + 9: 6(int) Constant 32 + 10: 6(int) Constant 6 + 11: 6(int) Constant 0 + 7: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 8 9 10 11 + 12: 6(int) Constant 3 + 5: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 12 3 + 16: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 17 + 19: 6(int) Constant 1 + 20: 6(int) Constant 4 + 21: 6(int) Constant 2 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 19 20 16 21 + 15: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 14 5 16 11 11 18 14 12 11 + 24: TypeFloat 32 + 26: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 25 9 12 11 + 27: TypeVector 24(float) 3 + 28: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 26 12 + 29: TypePointer Output 27(fvec3) + 30(outColor): 29(ptr) Variable Output + 33: 6(int) Constant 56 + 34: 6(int) Constant 8 + 31: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 32 28 16 33 11 18 32 30(outColor) 34 + 35: TypePointer Input 27(fvec3) + 36(inColor): 35(ptr) Variable Input + 37: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 38 28 16 33 11 18 38 36(inColor) 34 + 40(outUV): 29(ptr) Variable Output + 43: 6(int) Constant 57 + 41: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 42 28 16 43 11 18 42 40(outUV) 34 + 44: TypeVector 24(float) 2 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 26 21 + 46: TypePointer Input 44(fvec2) + 47(inUV): 46(ptr) Variable Input + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 49 45 16 43 11 18 49 47(inUV) 34 + 51: TypeInt 32 1 + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 52 9 20 11 + 54: TypePointer Input 51(int) +55(instanceTexIndex): 54(ptr) Variable Input + 56: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 57 53 16 43 11 18 57 55(instanceTexIndex) 34 + 63: TypePointer Function 24(float) + 67: 6(int) Constant 62 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 66 26 16 67 11 15 20 + 68(instanceRot): 35(ptr) Variable Input + 69: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 70 28 16 67 11 18 70 68(instanceRot) 34 + 71: TypePointer Input 24(float) + 74: TypeVector 24(float) 4 + 75: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 26 20 + 76: TypeMatrix 74(fvec4) 4 + 78: TypeBool + 79: 78(bool) ConstantTrue + 77: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 75 20 79 + 80(UBO): TypeStruct 76 76 74(fvec4) 24(float) 24(float) + 83: 6(int) Constant 42 + 84: 6(int) Constant 7 + 81: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 82 77 16 83 84 11 11 12 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 82 77 16 83 84 11 11 12 + 88: 6(int) Constant 43 + 86: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 87 75 16 88 84 11 11 12 + 91: 6(int) Constant 45 + 89: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 90 26 16 91 34 11 11 12 + 92: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 90 26 16 91 34 11 11 12 + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 94 19 16 67 11 18 94 11 12 81 85 86 89 92 + 95: TypePointer Uniform 80(UBO) + 96(ubo): 95(ptr) Variable Uniform + 97: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 98 93 16 67 11 18 98 96(ubo) 34 + 99: 51(int) Constant 3 + 100: TypePointer Uniform 24(float) + 106: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 110: 6(int) Constant 63 + 108: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 109 26 16 110 11 15 20 + 118: TypeMatrix 27(fvec3) 3 + 119: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 28 12 79 + 120: TypePointer Function 118 + 124: 6(int) Constant 65 + 122: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 123 119 16 124 11 15 20 + 125: 51(int) Constant 0 + 128: 24(float) Constant 0 + 130: TypePointer Function 27(fvec3) + 132: 51(int) Constant 1 + 138: 51(int) Constant 2 + 139: 24(float) Constant 1065353216 + 140: 27(fvec3) ConstantComposite 128 128 139 + 159: 6(int) Constant 73 + 157: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 158 119 16 159 11 15 20 + 164: 27(fvec3) ConstantComposite 128 139 128 + 188: 6(int) Constant 81 + 186: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 187 119 16 188 11 15 20 + 189: 27(fvec3) ConstantComposite 139 128 128 + 203: 6(int) Constant 85 + 201: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 202 119 16 203 11 15 20 + 212: 51(int) Constant 4 + 225: TypePointer Function 76 + 229: 6(int) Constant 90 + 227: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 228 77 16 229 11 15 20 + 233: TypePointer Function 74(fvec4) + 235: 74(fvec4) ConstantComposite 128 139 128 128 + 242: 74(fvec4) ConstantComposite 128 128 128 139 + 247: 6(int) Constant 95 + 245: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 246 75 16 247 11 15 20 + 248(inPos): 35(ptr) Variable Input + 249: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 250 28 16 247 11 18 250 248(inPos) 34 + 262: 6(int) Constant 96 + 260: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 261 75 16 262 11 15 20 +265(instanceScale): 71(ptr) Variable Input + 266: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 267 26 16 262 11 18 267 265(instanceScale) 34 +270(instancePos): 35(ptr) Variable Input + 271: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 272 28 16 262 11 18 272 270(instancePos) 34 + 280: TypeArray 24(float) 19 + 281: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 26 19 +282(gl_PerVertex): TypeStruct 74(fvec4) 24(float) 280 280 + 285: 6(int) Constant 24 + 283: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 284 75 16 19 285 11 11 12 + 286: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 287 26 16 19 83 11 11 12 + 288: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 289 281 16 19 203 11 11 12 + 290: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 289 281 16 19 203 11 11 12 + 293: 6(int) Constant 98 + 291: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 292 19 16 293 11 18 292 11 12 283 286 288 290 + 294: TypePointer Output 282(gl_PerVertex) + 295: 294(ptr) Variable Output + 296: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 17 291 16 293 11 18 17 295 34 + 297: TypePointer Uniform 76 + 307: TypePointer Output 74(fvec4) + 309(outNormal): 29(ptr) Variable Output + 312: 6(int) Constant 99 + 310: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 311 28 16 312 11 18 311 309(outNormal) 34 + 327(inNormal): 35(ptr) Variable Input + 328: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 329 28 16 312 11 18 329 327(inNormal) 34 + 346: 6(int) Constant 102 + 344: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 345 28 16 346 11 15 20 + 356: TypePointer Uniform 74(fvec4) +362(outLightVec): 29(ptr) Variable Output + 365: 6(int) Constant 103 + 363: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 364 28 16 365 11 18 364 362(outLightVec) 34 + 370(outViewVec): 29(ptr) Variable Output + 373: 6(int) Constant 104 + 371: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 372 28 16 373 11 18 372 370(outViewVec) 34 + 13(main): 3 Function None 4 + 22: Label + 64(s): 63(ptr) Variable Function + 107(c): 63(ptr) Variable Function + 121(mx): 120(ptr) Variable Function + 156(my): 120(ptr) Variable Function + 185(mz): 120(ptr) Variable Function + 200(rotMat): 120(ptr) Variable Function + 226(gRotMat): 225(ptr) Variable Function + 244(locPos): 233(ptr) Variable Function + 259(pos): 233(ptr) Variable Function + 343(lPos): 130(ptr) Variable Function + 23: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 15 13(main) + 39: 27(fvec3) Load 36(inColor) + Store 30(outColor) 39 + 50: 44(fvec2) Load 47(inUV) + 58: 51(int) Load 55(instanceTexIndex) + 59: 24(float) ConvertSToF 58 + 60: 24(float) CompositeExtract 50 0 + 61: 24(float) CompositeExtract 50 1 + 62: 27(fvec3) CompositeConstruct 60 61 59 + Store 40(outUV) 62 + 72: 71(ptr) AccessChain 68(instanceRot) 11 + 73: 24(float) Load 72 + 101: 100(ptr) AccessChain 96(ubo) 99 + 102: 24(float) Load 101 + 103: 24(float) FAdd 73 102 + 104: 24(float) ExtInst 2(GLSL.std.450) 13(Sin) 103 + Store 64(s) 104 + 105: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 65 104 106 + 111: 71(ptr) AccessChain 68(instanceRot) 11 + 112: 24(float) Load 111 + 113: 100(ptr) AccessChain 96(ubo) 99 + 114: 24(float) Load 113 + 115: 24(float) FAdd 112 114 + 116: 24(float) ExtInst 2(GLSL.std.450) 14(Cos) 115 + Store 107(c) 116 + 117: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 108 116 106 + 126: 24(float) Load 107(c) + 127: 24(float) Load 64(s) + 129: 27(fvec3) CompositeConstruct 126 127 128 + 131: 130(ptr) AccessChain 121(mx) 125 + Store 131 129 + 133: 24(float) Load 64(s) + 134: 24(float) FNegate 133 + 135: 24(float) Load 107(c) + 136: 27(fvec3) CompositeConstruct 134 135 128 + 137: 130(ptr) AccessChain 121(mx) 132 + Store 137 136 + 141: 130(ptr) AccessChain 121(mx) 138 + Store 141 140 + 142: 71(ptr) AccessChain 68(instanceRot) 19 + 143: 24(float) Load 142 + 144: 100(ptr) AccessChain 96(ubo) 99 + 145: 24(float) Load 144 + 146: 24(float) FAdd 143 145 + 147: 24(float) ExtInst 2(GLSL.std.450) 13(Sin) 146 + Store 64(s) 147 + 148: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 65 147 106 + 149: 71(ptr) AccessChain 68(instanceRot) 19 + 150: 24(float) Load 149 + 151: 100(ptr) AccessChain 96(ubo) 99 + 152: 24(float) Load 151 + 153: 24(float) FAdd 150 152 + 154: 24(float) ExtInst 2(GLSL.std.450) 14(Cos) 153 + Store 107(c) 154 + 155: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 108 154 106 + 160: 24(float) Load 107(c) + 161: 24(float) Load 64(s) + 162: 27(fvec3) CompositeConstruct 160 128 161 + 163: 130(ptr) AccessChain 156(my) 125 + Store 163 162 + 165: 130(ptr) AccessChain 156(my) 132 + Store 165 164 + 166: 24(float) Load 64(s) + 167: 24(float) FNegate 166 + 168: 24(float) Load 107(c) + 169: 27(fvec3) CompositeConstruct 167 128 168 + 170: 130(ptr) AccessChain 156(my) 138 + Store 170 169 + 171: 71(ptr) AccessChain 68(instanceRot) 21 + 172: 24(float) Load 171 + 173: 100(ptr) AccessChain 96(ubo) 99 + 174: 24(float) Load 173 + 175: 24(float) FAdd 172 174 + 176: 24(float) ExtInst 2(GLSL.std.450) 13(Sin) 175 + Store 64(s) 176 + 177: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 65 176 106 + 178: 71(ptr) AccessChain 68(instanceRot) 21 + 179: 24(float) Load 178 + 180: 100(ptr) AccessChain 96(ubo) 99 + 181: 24(float) Load 180 + 182: 24(float) FAdd 179 181 + 183: 24(float) ExtInst 2(GLSL.std.450) 14(Cos) 182 + Store 107(c) 183 + 184: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 108 183 106 + 190: 130(ptr) AccessChain 185(mz) 125 + Store 190 189 + 191: 24(float) Load 107(c) + 192: 24(float) Load 64(s) + 193: 27(fvec3) CompositeConstruct 128 191 192 + 194: 130(ptr) AccessChain 185(mz) 132 + Store 194 193 + 195: 24(float) Load 64(s) + 196: 24(float) FNegate 195 + 197: 24(float) Load 107(c) + 198: 27(fvec3) CompositeConstruct 128 196 197 + 199: 130(ptr) AccessChain 185(mz) 138 + Store 199 198 + 204: 118 Load 185(mz) + 205: 118 Load 156(my) + 206: 118 MatrixTimesMatrix 204 205 + 207: 118 Load 121(mx) + 208: 118 MatrixTimesMatrix 206 207 + Store 200(rotMat) 208 + 209: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 201 208 106 + 210: 71(ptr) AccessChain 68(instanceRot) 19 + 211: 24(float) Load 210 + 213: 100(ptr) AccessChain 96(ubo) 212 + 214: 24(float) Load 213 + 215: 24(float) FAdd 211 214 + 216: 24(float) ExtInst 2(GLSL.std.450) 13(Sin) 215 + Store 64(s) 216 + 217: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 65 216 106 + 218: 71(ptr) AccessChain 68(instanceRot) 19 + 219: 24(float) Load 218 + 220: 100(ptr) AccessChain 96(ubo) 212 + 221: 24(float) Load 220 + 222: 24(float) FAdd 219 221 + 223: 24(float) ExtInst 2(GLSL.std.450) 14(Cos) 222 + Store 107(c) 223 + 224: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 108 223 106 + 230: 24(float) Load 107(c) + 231: 24(float) Load 64(s) + 232: 74(fvec4) CompositeConstruct 230 128 231 128 + 234: 233(ptr) AccessChain 226(gRotMat) 125 + Store 234 232 + 236: 233(ptr) AccessChain 226(gRotMat) 132 + Store 236 235 + 237: 24(float) Load 64(s) + 238: 24(float) FNegate 237 + 239: 24(float) Load 107(c) + 240: 74(fvec4) CompositeConstruct 238 128 239 128 + 241: 233(ptr) AccessChain 226(gRotMat) 138 + Store 241 240 + 243: 233(ptr) AccessChain 226(gRotMat) 99 + Store 243 242 + 251: 27(fvec3) Load 248(inPos) + 252: 118 Load 200(rotMat) + 253: 27(fvec3) VectorTimesMatrix 251 252 + 254: 24(float) CompositeExtract 253 0 + 255: 24(float) CompositeExtract 253 1 + 256: 24(float) CompositeExtract 253 2 + 257: 74(fvec4) CompositeConstruct 254 255 256 139 + Store 244(locPos) 257 + 258: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 245 257 106 + 263: 74(fvec4) Load 244(locPos) + 264: 27(fvec3) VectorShuffle 263 263 0 1 2 + 268: 24(float) Load 265(instanceScale) + 269: 27(fvec3) VectorTimesScalar 264 268 + 273: 27(fvec3) Load 270(instancePos) + 274: 27(fvec3) FAdd 269 273 + 275: 24(float) CompositeExtract 274 0 + 276: 24(float) CompositeExtract 274 1 + 277: 24(float) CompositeExtract 274 2 + 278: 74(fvec4) CompositeConstruct 275 276 277 139 + Store 259(pos) 278 + 279: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 260 278 106 + 298: 297(ptr) AccessChain 96(ubo) 125 + 299: 76 Load 298 + 300: 297(ptr) AccessChain 96(ubo) 132 + 301: 76 Load 300 + 302: 76 MatrixTimesMatrix 299 301 + 303: 76 Load 226(gRotMat) + 304: 76 MatrixTimesMatrix 302 303 + 305: 74(fvec4) Load 259(pos) + 306: 74(fvec4) MatrixTimesVector 304 305 + 308: 307(ptr) AccessChain 295 125 + Store 308 306 + 313: 297(ptr) AccessChain 96(ubo) 132 + 314: 76 Load 313 + 315: 76 Load 226(gRotMat) + 316: 76 MatrixTimesMatrix 314 315 + 317: 74(fvec4) CompositeExtract 316 0 + 318: 27(fvec3) VectorShuffle 317 317 0 1 2 + 319: 74(fvec4) CompositeExtract 316 1 + 320: 27(fvec3) VectorShuffle 319 319 0 1 2 + 321: 74(fvec4) CompositeExtract 316 2 + 322: 27(fvec3) VectorShuffle 321 321 0 1 2 + 323: 118 CompositeConstruct 318 320 322 + 324: 118 Load 200(rotMat) + 325: 118 ExtInst 2(GLSL.std.450) 34(MatrixInverse) 324 + 326: 118 MatrixTimesMatrix 323 325 + 330: 27(fvec3) Load 327(inNormal) + 331: 27(fvec3) MatrixTimesVector 326 330 + Store 309(outNormal) 331 + 332: 297(ptr) AccessChain 96(ubo) 132 + 333: 76 Load 332 + 334: 27(fvec3) Load 248(inPos) + 335: 27(fvec3) Load 270(instancePos) + 336: 27(fvec3) FAdd 334 335 + 337: 24(float) CompositeExtract 336 0 + 338: 24(float) CompositeExtract 336 1 + 339: 24(float) CompositeExtract 336 2 + 340: 74(fvec4) CompositeConstruct 337 338 339 139 + 341: 74(fvec4) MatrixTimesVector 333 340 + Store 259(pos) 341 + 342: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 260 341 106 + 347: 297(ptr) AccessChain 96(ubo) 132 + 348: 76 Load 347 + 349: 74(fvec4) CompositeExtract 348 0 + 350: 27(fvec3) VectorShuffle 349 349 0 1 2 + 351: 74(fvec4) CompositeExtract 348 1 + 352: 27(fvec3) VectorShuffle 351 351 0 1 2 + 353: 74(fvec4) CompositeExtract 348 2 + 354: 27(fvec3) VectorShuffle 353 353 0 1 2 + 355: 118 CompositeConstruct 350 352 354 + 357: 356(ptr) AccessChain 96(ubo) 138 + 358: 74(fvec4) Load 357 + 359: 27(fvec3) VectorShuffle 358 358 0 1 2 + 360: 27(fvec3) MatrixTimesVector 355 359 + Store 343(lPos) 360 + 361: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 344 360 106 + 366: 27(fvec3) Load 343(lPos) + 367: 74(fvec4) Load 259(pos) + 368: 27(fvec3) VectorShuffle 367 367 0 1 2 + 369: 27(fvec3) FSub 366 368 + Store 362(outLightVec) 369 + 374: 74(fvec4) Load 259(pos) + 375: 27(fvec3) VectorShuffle 374 374 0 1 2 + 376: 27(fvec3) FNegate 375 + Store 370(outViewVec) 376 + Return + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.hlsl.comp.out b/Test/baseResults/spv.debuginfo.hlsl.comp.out new file mode 100644 index 000000000..7315b8704 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.hlsl.comp.out @@ -0,0 +1,1103 @@ +spv.debuginfo.hlsl.comp +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 855 + + Capability Shader + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 5 "main" 850 + ExecutionMode 5 LocalSize 10 10 1 + 9: String "float" + 12: String "uint" + 27: String "springForce" + 30: String "" + 39: String "p0" + 43: String "p1" + 47: String "restDist" + 56: String "@main" + 62: String "id" + 67: String "dist" + 78: String "int" + 84: String "sphereRadius" + 95: String "gravity" + 100: String "particleCount" + 103: String "UBO" + 107: String "params" + 111: String "ubo" + 133: String "index" + 155: String "bool" + 163: String "normal" + 170: String "pinned" + 174: String "Particle" + 180: String "@data" + 184: String "particleIn" + 203: String "particleOut" + 222: String "force" + 234: String "pos" + 243: String "vel" + 501: String "f" + 545: String "sphereDist" + 589: String "calculateNormals" + 593: String "PushConstants" + 597: String "pushConstants" + 600: String "$Global" + 630: String "a" + 642: String "b" + 658: String "c" + Name 5 "main" + Name 26 "springForce(vf3;vf3;f1;" + Name 23 "p0" + Name 24 "p1" + Name 25 "restDist" + Name 55 "@main(vu3;" + Name 54 "id" + Name 65 "dist" + Name 82 "UBO" + MemberName 82(UBO) 0 "deltaT" + MemberName 82(UBO) 1 "particleMass" + MemberName 82(UBO) 2 "springStiffness" + MemberName 82(UBO) 3 "damping" + MemberName 82(UBO) 4 "restDistH" + MemberName 82(UBO) 5 "restDistV" + MemberName 82(UBO) 6 "restDistD" + MemberName 82(UBO) 7 "sphereRadius" + MemberName 82(UBO) 8 "spherePos" + MemberName 82(UBO) 9 "gravity" + MemberName 82(UBO) 10 "particleCount" + Name 105 "ubo" + MemberName 105(ubo) 0 "params" + Name 113 "" + Name 131 "index" + Name 161 "Particle" + MemberName 161(Particle) 0 "pos" + MemberName 161(Particle) 1 "vel" + MemberName 161(Particle) 2 "uv" + MemberName 161(Particle) 3 "normal" + MemberName 161(Particle) 4 "pinned" + Name 178 "particleIn" + MemberName 178(particleIn) 0 "@data" + Name 186 "particleIn" + Name 199 "particleOut" + MemberName 199(particleOut) 0 "@data" + Name 206 "particleOut" + Name 220 "force" + Name 232 "pos" + Name 241 "vel" + Name 258 "param" + Name 262 "param" + Name 264 "param" + Name 283 "param" + Name 287 "param" + Name 289 "param" + Name 312 "param" + Name 316 "param" + Name 318 "param" + Name 336 "param" + Name 340 "param" + Name 342 "param" + Name 372 "param" + Name 376 "param" + Name 378 "param" + Name 403 "param" + Name 407 "param" + Name 409 "param" + Name 442 "param" + Name 446 "param" + Name 448 "param" + Name 477 "param" + Name 481 "param" + Name 483 "param" + Name 499 "f" + Name 543 "sphereDist" + Name 587 "PushConstants" + MemberName 587(PushConstants) 0 "calculateNormals" + Name 595 "$Global" + MemberName 595($Global) 0 "pushConstants" + Name 602 "" + Name 611 "normal" + Name 628 "a" + Name 640 "b" + Name 656 "c" + Name 848 "id" + Name 850 "id" + Name 852 "param" + MemberDecorate 82(UBO) 0 Offset 0 + MemberDecorate 82(UBO) 1 Offset 4 + MemberDecorate 82(UBO) 2 Offset 8 + MemberDecorate 82(UBO) 3 Offset 12 + MemberDecorate 82(UBO) 4 Offset 16 + MemberDecorate 82(UBO) 5 Offset 20 + MemberDecorate 82(UBO) 6 Offset 24 + MemberDecorate 82(UBO) 7 Offset 28 + MemberDecorate 82(UBO) 8 Offset 32 + MemberDecorate 82(UBO) 9 Offset 48 + MemberDecorate 82(UBO) 10 Offset 64 + MemberDecorate 105(ubo) 0 Offset 0 + Decorate 105(ubo) Block + Decorate 113 DescriptorSet 0 + Decorate 113 Binding 2 + MemberDecorate 161(Particle) 0 Offset 0 + MemberDecorate 161(Particle) 1 Offset 16 + MemberDecorate 161(Particle) 2 Offset 32 + MemberDecorate 161(Particle) 3 Offset 48 + MemberDecorate 161(Particle) 4 Offset 64 + Decorate 176 ArrayStride 80 + MemberDecorate 178(particleIn) 0 NonWritable + MemberDecorate 178(particleIn) 0 Offset 0 + Decorate 178(particleIn) BufferBlock + Decorate 186(particleIn) DescriptorSet 0 + Decorate 186(particleIn) Binding 0 + Decorate 197 ArrayStride 80 + MemberDecorate 199(particleOut) 0 Offset 0 + Decorate 199(particleOut) BufferBlock + Decorate 206(particleOut) DescriptorSet 0 + Decorate 206(particleOut) Binding 1 + MemberDecorate 587(PushConstants) 0 Offset 0 + MemberDecorate 595($Global) 0 Offset 0 + Decorate 595($Global) Block + Decorate 602 DescriptorSet 0 + Decorate 602 Binding 3 + Decorate 850(id) BuiltIn GlobalInvocationId + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 10: TypeInt 32 0 + 13: 10(int) Constant 32 + 14: 10(int) Constant 6 + 15: 10(int) Constant 0 + 11: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 12 13 14 15 + 16: 10(int) Constant 3 + 8: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 9 13 16 15 + 17: TypeVector 7(float) 3 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 16 + 19: TypePointer Function 17(fvec3) + 20: TypePointer Function 7(float) + 21: TypeFunction 17(fvec3) 19(ptr) 19(ptr) 20(ptr) + 22: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 18 18 18 8 + 29: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 30 + 32: 10(int) Constant 1 + 33: 10(int) Constant 4 + 34: 10(int) Constant 5 + 31: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 32 33 29 34 + 28: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 27 22 29 15 15 31 27 16 15 + 38: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 39 18 29 15 15 28 33 32 + 41: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 44: 10(int) Constant 2 + 42: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 43 18 29 15 15 28 33 44 + 46: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 47 8 29 15 15 28 33 16 + 49: TypeVector 10(int) 3 + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 11 16 + 51: TypePointer Function 49(ivec3) + 52: TypeFunction 3 51(ptr) + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 3 50 + 57: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 56 53 29 15 15 31 56 16 15 + 61: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 62 50 29 15 15 57 33 32 + 68: 10(int) Constant 76 + 66: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 67 18 29 68 15 28 33 + 75: TypeVector 7(float) 4 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 33 + 77: TypeInt 32 1 + 79: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 78 13 33 15 + 80: TypeVector 77(int) 2 + 81: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 79 44 + 82(UBO): TypeStruct 7(float) 7(float) 7(float) 7(float) 7(float) 7(float) 7(float) 7(float) 75(fvec4) 75(fvec4) 80(ivec2) + 85: 10(int) Constant 48 + 86: 10(int) Constant 20 + 83: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 87: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 88: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 89: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 90: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 91: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 92: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 84 8 29 85 86 15 15 16 + 96: 10(int) Constant 50 + 97: 10(int) Constant 16 + 94: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 95 76 29 96 97 15 15 16 + 98: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 95 76 29 96 97 15 15 16 + 101: 10(int) Constant 51 + 99: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 100 81 29 101 86 15 15 16 + 104: 10(int) Constant 77 + 102: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 103 32 29 104 15 31 103 15 16 83 87 88 89 90 91 92 93 94 98 99 + 105(ubo): TypeStruct 82(UBO) + 108: 10(int) Constant 56 + 109: 10(int) Constant 12 + 106: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 107 102 29 108 109 15 15 16 + 110: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 111 32 29 104 15 31 111 15 16 106 + 112: TypePointer Uniform 105(ubo) + 113: 112(ptr) Variable Uniform + 115: 10(int) Constant 8 + 114: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 30 110 29 104 15 31 30 113 115 + 116: 77(int) Constant 0 + 117: 77(int) Constant 2 + 118: TypePointer Uniform 7(float) + 130: TypePointer Function 10(int) + 134: 10(int) Constant 83 + 132: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 133 11 29 134 15 57 33 + 137: 77(int) Constant 10 + 138: TypePointer Uniform 77(int) + 154: TypeBool + 156: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 161(Particle): TypeStruct 75(fvec4) 75(fvec4) 75(fvec4) 75(fvec4) 7(float) + 164: 10(int) Constant 30 + 165: 10(int) Constant 15 + 162: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 163 76 29 164 165 15 15 16 + 166: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 163 76 29 164 165 15 15 16 + 167: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 163 76 29 164 165 15 15 16 + 168: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 163 76 29 164 165 15 15 16 + 171: 10(int) Constant 31 + 172: 10(int) Constant 14 + 169: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 170 8 29 171 172 15 15 16 + 175: 10(int) Constant 88 + 173: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 174 32 29 175 15 31 174 15 16 162 166 167 168 169 + 176: TypeRuntimeArray 161(Particle) + 177: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 173 15 + 178(particleIn): TypeStruct 176 + 181: 10(int) Constant 35 + 182: 10(int) Constant 28 + 179: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 180 177 29 181 182 15 15 16 + 183: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 184 32 29 175 15 31 184 15 16 179 + 185: TypePointer Uniform 178(particleIn) + 186(particleIn): 185(ptr) Variable Uniform + 187: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 184 183 29 175 15 31 184 186(particleIn) 115 + 189: 77(int) Constant 4 + 192: 7(float) Constant 1065353216 + 193: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 197: TypeRuntimeArray 161(Particle) + 198: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 173 15 +199(particleOut): TypeStruct 197 + 201: 10(int) Constant 37 + 200: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 180 198 29 201 164 15 15 16 + 204: 10(int) Constant 89 + 202: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 203 32 29 204 15 31 203 15 16 200 + 205: TypePointer Uniform 199(particleOut) +206(particleOut): 205(ptr) Variable Uniform + 207: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 203 202 29 204 15 31 203 206(particleOut) 115 + 210: TypePointer Uniform 75(fvec4) + 215: 77(int) Constant 1 + 216: 7(float) Constant 0 + 217: 75(fvec4) ConstantComposite 216 216 216 216 + 223: 10(int) Constant 95 + 221: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 222 18 29 223 15 57 33 + 224: 77(int) Constant 9 + 235: 10(int) Constant 97 + 233: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 234 18 29 235 15 57 33 + 244: 10(int) Constant 98 + 242: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 243 18 29 244 15 57 33 + 252: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 277: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 302: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 311: 77(int) Constant 5 + 327: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 351: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 359: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 361: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 371: 77(int) Constant 6 + 387: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 391: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 393: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 422: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 430: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 432: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 461: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 465: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 467: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 490: 77(int) Constant 3 + 502: 10(int) Constant 137 + 500: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 501 18 29 502 15 57 33 + 516: 7(float) Constant 1056964608 + 546: 10(int) Constant 142 + 544: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 545 18 29 546 15 57 33 + 551: 77(int) Constant 8 + 559: 77(int) Constant 7 + 562: 7(float) Constant 1008981770 + 564: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 +587(PushConstants): TypeStruct 10(int) + 590: 10(int) Constant 67 + 591: 10(int) Constant 23 + 588: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 589 11 29 590 591 15 15 16 + 594: 10(int) Constant 151 + 592: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 593 32 29 594 15 31 593 15 16 588 + 595($Global): TypeStruct 587(PushConstants) + 598: 10(int) Constant 71 + 596: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 597 592 29 598 165 15 15 16 + 599: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 600 32 29 594 15 31 600 15 16 596 + 601: TypePointer Uniform 595($Global) + 602: 601(ptr) Variable Uniform + 603: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 30 599 29 594 15 31 30 602 115 + 604: TypePointer Uniform 10(int) + 607: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 613: 10(int) Constant 152 + 612: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 163 18 29 613 15 57 33 + 614: 17(fvec3) ConstantComposite 216 216 216 + 618: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 624: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 631: 10(int) Constant 156 + 629: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 630 18 29 631 15 57 33 + 643: 10(int) Constant 157 + 641: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 642 18 29 643 15 57 33 + 659: 10(int) Constant 158 + 657: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 658 18 29 659 15 57 33 + 687: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 738: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 744: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 795: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 155 13 44 15 + 849: TypePointer Input 49(ivec3) + 850(id): 849(ptr) Variable Input + 5(main): 3 Function None 4 + 6: Label + 848(id): 51(ptr) Variable Function + 852(param): 51(ptr) Variable Function + 851: 49(ivec3) Load 850(id) + Store 848(id) 851 + 853: 49(ivec3) Load 848(id) + Store 852(param) 853 + 854: 3 FunctionCall 55(@main(vu3;) 852(param) + Return + FunctionEnd +26(springForce(vf3;vf3;f1;): 17(fvec3) Function None 21 + 23(p0): 19(ptr) FunctionParameter + 24(p1): 19(ptr) FunctionParameter + 25(restDist): 20(ptr) FunctionParameter + 35: Label + 65(dist): 19(ptr) Variable Function + 36: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 28 + 37: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 29 15 15 15 15 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 38 23(p0) 41 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 42 24(p1) 41 + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 46 25(restDist) 41 + 64: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 28 26(springForce(vf3;vf3;f1;) + 69: 17(fvec3) Load 23(p0) + 70: 17(fvec3) Load 24(p1) + 71: 17(fvec3) FSub 69 70 + Store 65(dist) 71 + 72: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 66 71 41 + 73: 17(fvec3) Load 65(dist) + 74: 17(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 73 + 119: 118(ptr) AccessChain 113 116 117 + 120: 7(float) Load 119 + 121: 17(fvec3) VectorTimesScalar 74 120 + 122: 17(fvec3) Load 65(dist) + 123: 7(float) ExtInst 2(GLSL.std.450) 66(Length) 122 + 124: 7(float) Load 25(restDist) + 125: 7(float) FSub 123 124 + 126: 17(fvec3) VectorTimesScalar 121 125 + ReturnValue 126 + FunctionEnd + 55(@main(vu3;): 3 Function None 52 + 54(id): 51(ptr) FunctionParameter + 58: Label + 131(index): 130(ptr) Variable Function + 220(force): 19(ptr) Variable Function + 232(pos): 19(ptr) Variable Function + 241(vel): 19(ptr) Variable Function + 258(param): 19(ptr) Variable Function + 262(param): 19(ptr) Variable Function + 264(param): 20(ptr) Variable Function + 283(param): 19(ptr) Variable Function + 287(param): 19(ptr) Variable Function + 289(param): 20(ptr) Variable Function + 312(param): 19(ptr) Variable Function + 316(param): 19(ptr) Variable Function + 318(param): 20(ptr) Variable Function + 336(param): 19(ptr) Variable Function + 340(param): 19(ptr) Variable Function + 342(param): 20(ptr) Variable Function + 372(param): 19(ptr) Variable Function + 376(param): 19(ptr) Variable Function + 378(param): 20(ptr) Variable Function + 403(param): 19(ptr) Variable Function + 407(param): 19(ptr) Variable Function + 409(param): 20(ptr) Variable Function + 442(param): 19(ptr) Variable Function + 446(param): 19(ptr) Variable Function + 448(param): 20(ptr) Variable Function + 477(param): 19(ptr) Variable Function + 481(param): 19(ptr) Variable Function + 483(param): 20(ptr) Variable Function + 499(f): 19(ptr) Variable Function + 543(sphereDist): 19(ptr) Variable Function + 611(normal): 19(ptr) Variable Function + 628(a): 19(ptr) Variable Function + 640(b): 19(ptr) Variable Function + 656(c): 19(ptr) Variable Function + 59: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 57 + 60: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 29 15 15 15 15 + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 61 54(id) 41 + 129: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 57 55(@main(vu3;) + 135: 130(ptr) AccessChain 54(id) 32 + 136: 10(int) Load 135 + 139: 138(ptr) AccessChain 113 116 137 15 + 140: 77(int) Load 139 + 141: 10(int) Bitcast 140 + 142: 10(int) IMul 136 141 + 143: 130(ptr) AccessChain 54(id) 15 + 144: 10(int) Load 143 + 145: 10(int) IAdd 142 144 + Store 131(index) 145 + 146: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 132 145 41 + 147: 10(int) Load 131(index) + 148: 138(ptr) AccessChain 113 116 137 15 + 149: 77(int) Load 148 + 150: 138(ptr) AccessChain 113 116 137 32 + 151: 77(int) Load 150 + 152: 77(int) IMul 149 151 + 153: 10(int) Bitcast 152 + 157: 154(bool) UGreaterThan 147 153 + SelectionMerge 159 None + BranchConditional 157 158 159 + 158: Label + Return + 159: Label + 188: 10(int) Load 131(index) + 190: 118(ptr) AccessChain 186(particleIn) 116 188 189 + 191: 7(float) Load 190 + 194: 154(bool) FOrdEqual 191 192 + SelectionMerge 196 None + BranchConditional 194 195 196 + 195: Label + 208: 10(int) Load 131(index) + 209: 10(int) Load 131(index) + 211: 210(ptr) AccessChain 206(particleOut) 116 209 116 + 212: 75(fvec4) Load 211 + 213: 210(ptr) AccessChain 206(particleOut) 116 208 116 + Store 213 212 + 214: 10(int) Load 131(index) + 218: 210(ptr) AccessChain 206(particleOut) 116 214 215 + Store 218 217 + Return + 196: Label + 225: 210(ptr) AccessChain 113 116 224 + 226: 75(fvec4) Load 225 + 227: 17(fvec3) VectorShuffle 226 226 0 1 2 + 228: 118(ptr) AccessChain 113 116 215 + 229: 7(float) Load 228 + 230: 17(fvec3) VectorTimesScalar 227 229 + Store 220(force) 230 + 231: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 230 41 + 236: 10(int) Load 131(index) + 237: 210(ptr) AccessChain 186(particleIn) 116 236 116 + 238: 75(fvec4) Load 237 + 239: 17(fvec3) VectorShuffle 238 238 0 1 2 + Store 232(pos) 239 + 240: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 233 239 41 + 245: 10(int) Load 131(index) + 246: 210(ptr) AccessChain 186(particleIn) 116 245 215 + 247: 75(fvec4) Load 246 + 248: 17(fvec3) VectorShuffle 247 247 0 1 2 + Store 241(vel) 248 + 249: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 242 248 41 + 250: 130(ptr) AccessChain 54(id) 15 + 251: 10(int) Load 250 + 253: 154(bool) UGreaterThan 251 15 + SelectionMerge 255 None + BranchConditional 253 254 255 + 254: Label + 256: 10(int) Load 131(index) + 257: 10(int) ISub 256 32 + 259: 210(ptr) AccessChain 186(particleIn) 116 257 116 + 260: 75(fvec4) Load 259 + 261: 17(fvec3) VectorShuffle 260 260 0 1 2 + Store 258(param) 261 + 263: 17(fvec3) Load 232(pos) + Store 262(param) 263 + 265: 118(ptr) AccessChain 113 116 189 + 266: 7(float) Load 265 + Store 264(param) 266 + 267: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 258(param) 262(param) 264(param) + 268: 17(fvec3) Load 220(force) + 269: 17(fvec3) FAdd 268 267 + Store 220(force) 269 + 270: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 269 41 + Branch 255 + 255: Label + 271: 130(ptr) AccessChain 54(id) 15 + 272: 10(int) Load 271 + 273: 138(ptr) AccessChain 113 116 137 15 + 274: 77(int) Load 273 + 275: 77(int) ISub 274 215 + 276: 10(int) Bitcast 275 + 278: 154(bool) ULessThan 272 276 + SelectionMerge 280 None + BranchConditional 278 279 280 + 279: Label + 281: 10(int) Load 131(index) + 282: 10(int) IAdd 281 32 + 284: 210(ptr) AccessChain 186(particleIn) 116 282 116 + 285: 75(fvec4) Load 284 + 286: 17(fvec3) VectorShuffle 285 285 0 1 2 + Store 283(param) 286 + 288: 17(fvec3) Load 232(pos) + Store 287(param) 288 + 290: 118(ptr) AccessChain 113 116 189 + 291: 7(float) Load 290 + Store 289(param) 291 + 292: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 283(param) 287(param) 289(param) + 293: 17(fvec3) Load 220(force) + 294: 17(fvec3) FAdd 293 292 + Store 220(force) 294 + 295: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 294 41 + Branch 280 + 280: Label + 296: 130(ptr) AccessChain 54(id) 32 + 297: 10(int) Load 296 + 298: 138(ptr) AccessChain 113 116 137 32 + 299: 77(int) Load 298 + 300: 77(int) ISub 299 215 + 301: 10(int) Bitcast 300 + 303: 154(bool) ULessThan 297 301 + SelectionMerge 305 None + BranchConditional 303 304 305 + 304: Label + 306: 10(int) Load 131(index) + 307: 138(ptr) AccessChain 113 116 137 15 + 308: 77(int) Load 307 + 309: 10(int) Bitcast 308 + 310: 10(int) IAdd 306 309 + 313: 210(ptr) AccessChain 186(particleIn) 116 310 116 + 314: 75(fvec4) Load 313 + 315: 17(fvec3) VectorShuffle 314 314 0 1 2 + Store 312(param) 315 + 317: 17(fvec3) Load 232(pos) + Store 316(param) 317 + 319: 118(ptr) AccessChain 113 116 311 + 320: 7(float) Load 319 + Store 318(param) 320 + 321: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 312(param) 316(param) 318(param) + 322: 17(fvec3) Load 220(force) + 323: 17(fvec3) FAdd 322 321 + Store 220(force) 323 + 324: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 323 41 + Branch 305 + 305: Label + 325: 130(ptr) AccessChain 54(id) 32 + 326: 10(int) Load 325 + 328: 154(bool) UGreaterThan 326 15 + SelectionMerge 330 None + BranchConditional 328 329 330 + 329: Label + 331: 10(int) Load 131(index) + 332: 138(ptr) AccessChain 113 116 137 15 + 333: 77(int) Load 332 + 334: 10(int) Bitcast 333 + 335: 10(int) ISub 331 334 + 337: 210(ptr) AccessChain 186(particleIn) 116 335 116 + 338: 75(fvec4) Load 337 + 339: 17(fvec3) VectorShuffle 338 338 0 1 2 + Store 336(param) 339 + 341: 17(fvec3) Load 232(pos) + Store 340(param) 341 + 343: 118(ptr) AccessChain 113 116 311 + 344: 7(float) Load 343 + Store 342(param) 344 + 345: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 336(param) 340(param) 342(param) + 346: 17(fvec3) Load 220(force) + 347: 17(fvec3) FAdd 346 345 + Store 220(force) 347 + 348: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 347 41 + Branch 330 + 330: Label + 349: 130(ptr) AccessChain 54(id) 15 + 350: 10(int) Load 349 + 352: 154(bool) UGreaterThan 350 15 + 353: 130(ptr) AccessChain 54(id) 32 + 354: 10(int) Load 353 + 355: 138(ptr) AccessChain 113 116 137 32 + 356: 77(int) Load 355 + 357: 77(int) ISub 356 215 + 358: 10(int) Bitcast 357 + 360: 154(bool) ULessThan 354 358 + 362: 154(bool) LogicalAnd 352 360 + SelectionMerge 364 None + BranchConditional 362 363 364 + 363: Label + 365: 10(int) Load 131(index) + 366: 138(ptr) AccessChain 113 116 137 15 + 367: 77(int) Load 366 + 368: 10(int) Bitcast 367 + 369: 10(int) IAdd 365 368 + 370: 10(int) ISub 369 32 + 373: 210(ptr) AccessChain 186(particleIn) 116 370 116 + 374: 75(fvec4) Load 373 + 375: 17(fvec3) VectorShuffle 374 374 0 1 2 + Store 372(param) 375 + 377: 17(fvec3) Load 232(pos) + Store 376(param) 377 + 379: 118(ptr) AccessChain 113 116 371 + 380: 7(float) Load 379 + Store 378(param) 380 + 381: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 372(param) 376(param) 378(param) + 382: 17(fvec3) Load 220(force) + 383: 17(fvec3) FAdd 382 381 + Store 220(force) 383 + 384: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 383 41 + Branch 364 + 364: Label + 385: 130(ptr) AccessChain 54(id) 15 + 386: 10(int) Load 385 + 388: 154(bool) UGreaterThan 386 15 + 389: 130(ptr) AccessChain 54(id) 32 + 390: 10(int) Load 389 + 392: 154(bool) UGreaterThan 390 15 + 394: 154(bool) LogicalAnd 388 392 + SelectionMerge 396 None + BranchConditional 394 395 396 + 395: Label + 397: 10(int) Load 131(index) + 398: 138(ptr) AccessChain 113 116 137 15 + 399: 77(int) Load 398 + 400: 10(int) Bitcast 399 + 401: 10(int) ISub 397 400 + 402: 10(int) ISub 401 32 + 404: 210(ptr) AccessChain 186(particleIn) 116 402 116 + 405: 75(fvec4) Load 404 + 406: 17(fvec3) VectorShuffle 405 405 0 1 2 + Store 403(param) 406 + 408: 17(fvec3) Load 232(pos) + Store 407(param) 408 + 410: 118(ptr) AccessChain 113 116 371 + 411: 7(float) Load 410 + Store 409(param) 411 + 412: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 403(param) 407(param) 409(param) + 413: 17(fvec3) Load 220(force) + 414: 17(fvec3) FAdd 413 412 + Store 220(force) 414 + 415: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 414 41 + Branch 396 + 396: Label + 416: 130(ptr) AccessChain 54(id) 15 + 417: 10(int) Load 416 + 418: 138(ptr) AccessChain 113 116 137 15 + 419: 77(int) Load 418 + 420: 77(int) ISub 419 215 + 421: 10(int) Bitcast 420 + 423: 154(bool) ULessThan 417 421 + 424: 130(ptr) AccessChain 54(id) 32 + 425: 10(int) Load 424 + 426: 138(ptr) AccessChain 113 116 137 32 + 427: 77(int) Load 426 + 428: 77(int) ISub 427 215 + 429: 10(int) Bitcast 428 + 431: 154(bool) ULessThan 425 429 + 433: 154(bool) LogicalAnd 423 431 + SelectionMerge 435 None + BranchConditional 433 434 435 + 434: Label + 436: 10(int) Load 131(index) + 437: 138(ptr) AccessChain 113 116 137 15 + 438: 77(int) Load 437 + 439: 10(int) Bitcast 438 + 440: 10(int) IAdd 436 439 + 441: 10(int) IAdd 440 32 + 443: 210(ptr) AccessChain 186(particleIn) 116 441 116 + 444: 75(fvec4) Load 443 + 445: 17(fvec3) VectorShuffle 444 444 0 1 2 + Store 442(param) 445 + 447: 17(fvec3) Load 232(pos) + Store 446(param) 447 + 449: 118(ptr) AccessChain 113 116 371 + 450: 7(float) Load 449 + Store 448(param) 450 + 451: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 442(param) 446(param) 448(param) + 452: 17(fvec3) Load 220(force) + 453: 17(fvec3) FAdd 452 451 + Store 220(force) 453 + 454: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 453 41 + Branch 435 + 435: Label + 455: 130(ptr) AccessChain 54(id) 15 + 456: 10(int) Load 455 + 457: 138(ptr) AccessChain 113 116 137 15 + 458: 77(int) Load 457 + 459: 77(int) ISub 458 215 + 460: 10(int) Bitcast 459 + 462: 154(bool) ULessThan 456 460 + 463: 130(ptr) AccessChain 54(id) 32 + 464: 10(int) Load 463 + 466: 154(bool) UGreaterThan 464 15 + 468: 154(bool) LogicalAnd 462 466 + SelectionMerge 470 None + BranchConditional 468 469 470 + 469: Label + 471: 10(int) Load 131(index) + 472: 138(ptr) AccessChain 113 116 137 15 + 473: 77(int) Load 472 + 474: 10(int) Bitcast 473 + 475: 10(int) ISub 471 474 + 476: 10(int) IAdd 475 32 + 478: 210(ptr) AccessChain 186(particleIn) 116 476 116 + 479: 75(fvec4) Load 478 + 480: 17(fvec3) VectorShuffle 479 479 0 1 2 + Store 477(param) 480 + 482: 17(fvec3) Load 232(pos) + Store 481(param) 482 + 484: 118(ptr) AccessChain 113 116 371 + 485: 7(float) Load 484 + Store 483(param) 485 + 486: 17(fvec3) FunctionCall 26(springForce(vf3;vf3;f1;) 477(param) 481(param) 483(param) + 487: 17(fvec3) Load 220(force) + 488: 17(fvec3) FAdd 487 486 + Store 220(force) 488 + 489: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 488 41 + Branch 470 + 470: Label + 491: 118(ptr) AccessChain 113 116 490 + 492: 7(float) Load 491 + 493: 7(float) FNegate 492 + 494: 17(fvec3) Load 241(vel) + 495: 17(fvec3) VectorTimesScalar 494 493 + 496: 17(fvec3) Load 220(force) + 497: 17(fvec3) FAdd 496 495 + Store 220(force) 497 + 498: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 221 497 41 + 503: 17(fvec3) Load 220(force) + 504: 118(ptr) AccessChain 113 116 215 + 505: 7(float) Load 504 + 506: 7(float) FDiv 192 505 + 507: 17(fvec3) VectorTimesScalar 503 506 + Store 499(f) 507 + 508: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 500 507 41 + 509: 10(int) Load 131(index) + 510: 17(fvec3) Load 232(pos) + 511: 17(fvec3) Load 241(vel) + 512: 118(ptr) AccessChain 113 116 116 + 513: 7(float) Load 512 + 514: 17(fvec3) VectorTimesScalar 511 513 + 515: 17(fvec3) FAdd 510 514 + 517: 17(fvec3) Load 499(f) + 518: 17(fvec3) VectorTimesScalar 517 516 + 519: 118(ptr) AccessChain 113 116 116 + 520: 7(float) Load 519 + 521: 17(fvec3) VectorTimesScalar 518 520 + 522: 118(ptr) AccessChain 113 116 116 + 523: 7(float) Load 522 + 524: 17(fvec3) VectorTimesScalar 521 523 + 525: 17(fvec3) FAdd 515 524 + 526: 7(float) CompositeExtract 525 0 + 527: 7(float) CompositeExtract 525 1 + 528: 7(float) CompositeExtract 525 2 + 529: 75(fvec4) CompositeConstruct 526 527 528 192 + 530: 210(ptr) AccessChain 206(particleOut) 116 509 116 + Store 530 529 + 531: 10(int) Load 131(index) + 532: 17(fvec3) Load 241(vel) + 533: 17(fvec3) Load 499(f) + 534: 118(ptr) AccessChain 113 116 116 + 535: 7(float) Load 534 + 536: 17(fvec3) VectorTimesScalar 533 535 + 537: 17(fvec3) FAdd 532 536 + 538: 7(float) CompositeExtract 537 0 + 539: 7(float) CompositeExtract 537 1 + 540: 7(float) CompositeExtract 537 2 + 541: 75(fvec4) CompositeConstruct 538 539 540 216 + 542: 210(ptr) AccessChain 206(particleOut) 116 531 215 + Store 542 541 + 547: 10(int) Load 131(index) + 548: 210(ptr) AccessChain 206(particleOut) 116 547 116 + 549: 75(fvec4) Load 548 + 550: 17(fvec3) VectorShuffle 549 549 0 1 2 + 552: 210(ptr) AccessChain 113 116 551 + 553: 75(fvec4) Load 552 + 554: 17(fvec3) VectorShuffle 553 553 0 1 2 + 555: 17(fvec3) FSub 550 554 + Store 543(sphereDist) 555 + 556: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 544 555 41 + 557: 17(fvec3) Load 543(sphereDist) + 558: 7(float) ExtInst 2(GLSL.std.450) 66(Length) 557 + 560: 118(ptr) AccessChain 113 116 559 + 561: 7(float) Load 560 + 563: 7(float) FAdd 561 562 + 565: 154(bool) FOrdLessThan 558 563 + SelectionMerge 567 None + BranchConditional 565 566 567 + 566: Label + 568: 10(int) Load 131(index) + 569: 210(ptr) AccessChain 113 116 551 + 570: 75(fvec4) Load 569 + 571: 17(fvec3) VectorShuffle 570 570 0 1 2 + 572: 17(fvec3) Load 543(sphereDist) + 573: 17(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 572 + 574: 118(ptr) AccessChain 113 116 559 + 575: 7(float) Load 574 + 576: 7(float) FAdd 575 562 + 577: 17(fvec3) VectorTimesScalar 573 576 + 578: 17(fvec3) FAdd 571 577 + 579: 118(ptr) AccessChain 206(particleOut) 116 568 116 15 + 580: 7(float) CompositeExtract 578 0 + Store 579 580 + 581: 118(ptr) AccessChain 206(particleOut) 116 568 116 32 + 582: 7(float) CompositeExtract 578 1 + Store 581 582 + 583: 118(ptr) AccessChain 206(particleOut) 116 568 116 44 + 584: 7(float) CompositeExtract 578 2 + Store 583 584 + 585: 10(int) Load 131(index) + 586: 210(ptr) AccessChain 206(particleOut) 116 585 215 + Store 586 217 + Branch 567 + 567: Label + 605: 604(ptr) AccessChain 602 116 116 + 606: 10(int) Load 605 + 608: 154(bool) IEqual 606 32 + SelectionMerge 610 None + BranchConditional 608 609 610 + 609: Label + Store 611(normal) 614 + 615: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 612 614 41 + 616: 130(ptr) AccessChain 54(id) 32 + 617: 10(int) Load 616 + 619: 154(bool) UGreaterThan 617 15 + SelectionMerge 621 None + BranchConditional 619 620 621 + 620: Label + 622: 130(ptr) AccessChain 54(id) 15 + 623: 10(int) Load 622 + 625: 154(bool) UGreaterThan 623 15 + SelectionMerge 627 None + BranchConditional 625 626 627 + 626: Label + 632: 10(int) Load 131(index) + 633: 10(int) ISub 632 32 + 634: 210(ptr) AccessChain 186(particleIn) 116 633 116 + 635: 75(fvec4) Load 634 + 636: 17(fvec3) VectorShuffle 635 635 0 1 2 + 637: 17(fvec3) Load 232(pos) + 638: 17(fvec3) FSub 636 637 + Store 628(a) 638 + 639: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 629 638 41 + 644: 10(int) Load 131(index) + 645: 138(ptr) AccessChain 113 116 137 15 + 646: 77(int) Load 645 + 647: 10(int) Bitcast 646 + 648: 10(int) ISub 644 647 + 649: 10(int) ISub 648 32 + 650: 210(ptr) AccessChain 186(particleIn) 116 649 116 + 651: 75(fvec4) Load 650 + 652: 17(fvec3) VectorShuffle 651 651 0 1 2 + 653: 17(fvec3) Load 232(pos) + 654: 17(fvec3) FSub 652 653 + Store 640(b) 654 + 655: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 641 654 41 + 660: 10(int) Load 131(index) + 661: 138(ptr) AccessChain 113 116 137 15 + 662: 77(int) Load 661 + 663: 10(int) Bitcast 662 + 664: 10(int) ISub 660 663 + 665: 210(ptr) AccessChain 186(particleIn) 116 664 116 + 666: 75(fvec4) Load 665 + 667: 17(fvec3) VectorShuffle 666 666 0 1 2 + 668: 17(fvec3) Load 232(pos) + 669: 17(fvec3) FSub 667 668 + Store 656(c) 669 + 670: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 657 669 41 + 671: 17(fvec3) Load 628(a) + 672: 17(fvec3) Load 640(b) + 673: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 671 672 + 674: 17(fvec3) Load 640(b) + 675: 17(fvec3) Load 656(c) + 676: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 674 675 + 677: 17(fvec3) FAdd 673 676 + 678: 17(fvec3) Load 611(normal) + 679: 17(fvec3) FAdd 678 677 + Store 611(normal) 679 + 680: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 612 679 41 + Branch 627 + 627: Label + 681: 130(ptr) AccessChain 54(id) 15 + 682: 10(int) Load 681 + 683: 138(ptr) AccessChain 113 116 137 15 + 684: 77(int) Load 683 + 685: 77(int) ISub 684 215 + 686: 10(int) Bitcast 685 + 688: 154(bool) ULessThan 682 686 + SelectionMerge 690 None + BranchConditional 688 689 690 + 689: Label + 691: 10(int) Load 131(index) + 692: 138(ptr) AccessChain 113 116 137 15 + 693: 77(int) Load 692 + 694: 10(int) Bitcast 693 + 695: 10(int) ISub 691 694 + 696: 210(ptr) AccessChain 186(particleIn) 116 695 116 + 697: 75(fvec4) Load 696 + 698: 17(fvec3) VectorShuffle 697 697 0 1 2 + 699: 17(fvec3) Load 232(pos) + 700: 17(fvec3) FSub 698 699 + Store 628(a) 700 + 701: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 629 700 41 + 702: 10(int) Load 131(index) + 703: 138(ptr) AccessChain 113 116 137 15 + 704: 77(int) Load 703 + 705: 10(int) Bitcast 704 + 706: 10(int) ISub 702 705 + 707: 10(int) IAdd 706 32 + 708: 210(ptr) AccessChain 186(particleIn) 116 707 116 + 709: 75(fvec4) Load 708 + 710: 17(fvec3) VectorShuffle 709 709 0 1 2 + 711: 17(fvec3) Load 232(pos) + 712: 17(fvec3) FSub 710 711 + Store 640(b) 712 + 713: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 641 712 41 + 714: 10(int) Load 131(index) + 715: 10(int) IAdd 714 32 + 716: 210(ptr) AccessChain 186(particleIn) 116 715 116 + 717: 75(fvec4) Load 716 + 718: 17(fvec3) VectorShuffle 717 717 0 1 2 + 719: 17(fvec3) Load 232(pos) + 720: 17(fvec3) FSub 718 719 + Store 656(c) 720 + 721: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 657 720 41 + 722: 17(fvec3) Load 628(a) + 723: 17(fvec3) Load 640(b) + 724: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 722 723 + 725: 17(fvec3) Load 640(b) + 726: 17(fvec3) Load 656(c) + 727: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 725 726 + 728: 17(fvec3) FAdd 724 727 + 729: 17(fvec3) Load 611(normal) + 730: 17(fvec3) FAdd 729 728 + Store 611(normal) 730 + 731: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 612 730 41 + Branch 690 + 690: Label + Branch 621 + 621: Label + 732: 130(ptr) AccessChain 54(id) 32 + 733: 10(int) Load 732 + 734: 138(ptr) AccessChain 113 116 137 32 + 735: 77(int) Load 734 + 736: 77(int) ISub 735 215 + 737: 10(int) Bitcast 736 + 739: 154(bool) ULessThan 733 737 + SelectionMerge 741 None + BranchConditional 739 740 741 + 740: Label + 742: 130(ptr) AccessChain 54(id) 15 + 743: 10(int) Load 742 + 745: 154(bool) UGreaterThan 743 15 + SelectionMerge 747 None + BranchConditional 745 746 747 + 746: Label + 748: 10(int) Load 131(index) + 749: 138(ptr) AccessChain 113 116 137 15 + 750: 77(int) Load 749 + 751: 10(int) Bitcast 750 + 752: 10(int) IAdd 748 751 + 753: 210(ptr) AccessChain 186(particleIn) 116 752 116 + 754: 75(fvec4) Load 753 + 755: 17(fvec3) VectorShuffle 754 754 0 1 2 + 756: 17(fvec3) Load 232(pos) + 757: 17(fvec3) FSub 755 756 + Store 628(a) 757 + 758: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 629 757 41 + 759: 10(int) Load 131(index) + 760: 138(ptr) AccessChain 113 116 137 15 + 761: 77(int) Load 760 + 762: 10(int) Bitcast 761 + 763: 10(int) IAdd 759 762 + 764: 10(int) ISub 763 32 + 765: 210(ptr) AccessChain 186(particleIn) 116 764 116 + 766: 75(fvec4) Load 765 + 767: 17(fvec3) VectorShuffle 766 766 0 1 2 + 768: 17(fvec3) Load 232(pos) + 769: 17(fvec3) FSub 767 768 + Store 640(b) 769 + 770: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 641 769 41 + 771: 10(int) Load 131(index) + 772: 10(int) ISub 771 32 + 773: 210(ptr) AccessChain 186(particleIn) 116 772 116 + 774: 75(fvec4) Load 773 + 775: 17(fvec3) VectorShuffle 774 774 0 1 2 + 776: 17(fvec3) Load 232(pos) + 777: 17(fvec3) FSub 775 776 + Store 656(c) 777 + 778: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 657 777 41 + 779: 17(fvec3) Load 628(a) + 780: 17(fvec3) Load 640(b) + 781: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 779 780 + 782: 17(fvec3) Load 640(b) + 783: 17(fvec3) Load 656(c) + 784: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 782 783 + 785: 17(fvec3) FAdd 781 784 + 786: 17(fvec3) Load 611(normal) + 787: 17(fvec3) FAdd 786 785 + Store 611(normal) 787 + 788: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 612 787 41 + Branch 747 + 747: Label + 789: 130(ptr) AccessChain 54(id) 15 + 790: 10(int) Load 789 + 791: 138(ptr) AccessChain 113 116 137 15 + 792: 77(int) Load 791 + 793: 77(int) ISub 792 215 + 794: 10(int) Bitcast 793 + 796: 154(bool) ULessThan 790 794 + SelectionMerge 798 None + BranchConditional 796 797 798 + 797: Label + 799: 10(int) Load 131(index) + 800: 10(int) IAdd 799 32 + 801: 210(ptr) AccessChain 186(particleIn) 116 800 116 + 802: 75(fvec4) Load 801 + 803: 17(fvec3) VectorShuffle 802 802 0 1 2 + 804: 17(fvec3) Load 232(pos) + 805: 17(fvec3) FSub 803 804 + Store 628(a) 805 + 806: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 629 805 41 + 807: 10(int) Load 131(index) + 808: 138(ptr) AccessChain 113 116 137 15 + 809: 77(int) Load 808 + 810: 10(int) Bitcast 809 + 811: 10(int) IAdd 807 810 + 812: 10(int) IAdd 811 32 + 813: 210(ptr) AccessChain 186(particleIn) 116 812 116 + 814: 75(fvec4) Load 813 + 815: 17(fvec3) VectorShuffle 814 814 0 1 2 + 816: 17(fvec3) Load 232(pos) + 817: 17(fvec3) FSub 815 816 + Store 640(b) 817 + 818: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 641 817 41 + 819: 10(int) Load 131(index) + 820: 138(ptr) AccessChain 113 116 137 15 + 821: 77(int) Load 820 + 822: 10(int) Bitcast 821 + 823: 10(int) IAdd 819 822 + 824: 210(ptr) AccessChain 186(particleIn) 116 823 116 + 825: 75(fvec4) Load 824 + 826: 17(fvec3) VectorShuffle 825 825 0 1 2 + 827: 17(fvec3) Load 232(pos) + 828: 17(fvec3) FSub 826 827 + Store 656(c) 828 + 829: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 657 828 41 + 830: 17(fvec3) Load 628(a) + 831: 17(fvec3) Load 640(b) + 832: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 830 831 + 833: 17(fvec3) Load 640(b) + 834: 17(fvec3) Load 656(c) + 835: 17(fvec3) ExtInst 2(GLSL.std.450) 68(Cross) 833 834 + 836: 17(fvec3) FAdd 832 835 + 837: 17(fvec3) Load 611(normal) + 838: 17(fvec3) FAdd 837 836 + Store 611(normal) 838 + 839: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 612 838 41 + Branch 798 + 798: Label + Branch 741 + 741: Label + 840: 10(int) Load 131(index) + 841: 17(fvec3) Load 611(normal) + 842: 17(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 841 + 843: 7(float) CompositeExtract 842 0 + 844: 7(float) CompositeExtract 842 1 + 845: 7(float) CompositeExtract 842 2 + 846: 75(fvec4) CompositeConstruct 843 844 845 216 + 847: 210(ptr) AccessChain 206(particleOut) 116 840 490 + Store 847 846 + Branch 610 + 610: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.hlsl.frag.out b/Test/baseResults/spv.debuginfo.hlsl.frag.out new file mode 100644 index 000000000..679fcd5e9 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.hlsl.frag.out @@ -0,0 +1,1003 @@ +spv.debuginfo.hlsl.frag +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 759 + + Capability Shader + Capability ImageQuery + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 5 "main" 752 755 + ExecutionMode 5 OriginUpperLeft + 9: String "float" + 12: String "uint" + 32: String "textureProj" + 35: String "" + 43: String "P" + 47: String "layer" + 50: String "offset" + 57: String "filterPCF" + 63: String "sc" + 75: String "shadow" + 81: String "fragcolor" + 84: String "fragPos" + 90: String "@main" + 96: String "inUV" + 106: String "shadowCoord" + 128: String "bool" + 141: String "dist" + 145: String "type.2d.image" + 146: String "@type.2d.image" + 151: String "textureShadowMap" + 156: String "type.sampler" + 157: String "@type.sampler" + 161: String "samplerShadowMap" + 165: String "type.sampled.image" + 166: String "@type.sampled.image" + 204: String "sizeQueryTemp" + 210: String "int" + 217: String "texDim" + 230: String "elements" + 237: String "levels" + 244: String "scale" + 250: String "dx" + 261: String "dy" + 272: String "shadowFactor" + 277: String "count" + 283: String "range" + 289: String "x" + 305: String "y" + 355: String "i" + 369: String "shadowClip" + 381: String "color" + 387: String "viewMatrix" + 391: String "Light" + 397: String "lights" + 400: String "displayDebugTarget" + 405: String "UBO" + 408: String "ubo" + 450: String "textureposition" + 455: String "samplerposition" + 466: String "normal" + 470: String "textureNormal" + 475: String "samplerNormal" + 484: String "albedo" + 488: String "textureAlbedo" + 493: String "samplerAlbedo" + 552: String "N" + 571: String "L" + 592: String "V" + 605: String "lightCosInnerAngle" + 611: String "lightCosOuterAngle" + 617: String "lightRange" + 623: String "dir" + 638: String "cosDir" + 646: String "spotEffect" + 655: String "heightAttenuation" + 663: String "NdotL" + 672: String "diff" + 679: String "R" + 688: String "NdotR" + 697: String "spec" + Name 5 "main" + Name 31 "textureProj(vf4;f1;vf2;" + Name 28 "P" + Name 29 "layer" + Name 30 "offset" + Name 56 "filterPCF(vf4;f1;" + Name 54 "sc" + Name 55 "layer" + Name 74 "shadow(vf3;vf3;" + Name 72 "fragcolor" + Name 73 "fragPos" + Name 89 "@main(vf2;" + Name 88 "inUV" + Name 99 "shadow" + Name 104 "shadowCoord" + Name 139 "dist" + Name 149 "textureShadowMap" + Name 159 "samplerShadowMap" + Name 202 "sizeQueryTemp" + Name 215 "texDim" + Name 228 "elements" + Name 235 "levels" + Name 242 "scale" + Name 248 "dx" + Name 259 "dy" + Name 270 "shadowFactor" + Name 275 "count" + Name 281 "range" + Name 287 "x" + Name 303 "y" + Name 328 "param" + Name 330 "param" + Name 332 "param" + Name 353 "i" + Name 367 "shadowClip" + Name 379 "Light" + MemberName 379(Light) 0 "position" + MemberName 379(Light) 1 "target" + MemberName 379(Light) 2 "color" + MemberName 379(Light) 3 "viewMatrix" + Name 394 "UBO" + MemberName 394(UBO) 0 "viewPos" + MemberName 394(UBO) 1 "lights" + MemberName 394(UBO) 2 "useShadows" + MemberName 394(UBO) 3 "displayDebugTarget" + Name 406 "ubo" + MemberName 406(ubo) 0 "ubo" + Name 413 "" + Name 421 "shadowFactor" + Name 426 "param" + Name 428 "param" + Name 442 "fragPos" + Name 448 "textureposition" + Name 453 "samplerposition" + Name 464 "normal" + Name 468 "textureNormal" + Name 473 "samplerNormal" + Name 482 "albedo" + Name 486 "textureAlbedo" + Name 491 "samplerAlbedo" + Name 514 "fragcolor" + Name 518 "param" + Name 519 "param" + Name 550 "N" + Name 557 "i" + Name 569 "L" + Name 581 "dist" + Name 590 "V" + Name 603 "lightCosInnerAngle" + Name 609 "lightCosOuterAngle" + Name 615 "lightRange" + Name 621 "dir" + Name 636 "cosDir" + Name 644 "spotEffect" + Name 653 "heightAttenuation" + Name 661 "NdotL" + Name 670 "diff" + Name 677 "R" + Name 686 "NdotR" + Name 695 "spec" + Name 737 "param" + Name 739 "param" + Name 750 "inUV" + Name 752 "inUV" + Name 755 "@entryPointOutput" + Name 756 "param" + Decorate 149(textureShadowMap) DescriptorSet 0 + Decorate 149(textureShadowMap) Binding 5 + Decorate 159(samplerShadowMap) DescriptorSet 0 + Decorate 159(samplerShadowMap) Binding 5 + MemberDecorate 379(Light) 0 Offset 0 + MemberDecorate 379(Light) 1 Offset 16 + MemberDecorate 379(Light) 2 Offset 32 + MemberDecorate 379(Light) 3 RowMajor + MemberDecorate 379(Light) 3 Offset 48 + MemberDecorate 379(Light) 3 MatrixStride 16 + Decorate 392 ArrayStride 112 + MemberDecorate 394(UBO) 0 Offset 0 + MemberDecorate 394(UBO) 1 Offset 16 + MemberDecorate 394(UBO) 2 Offset 352 + MemberDecorate 394(UBO) 3 Offset 356 + MemberDecorate 406(ubo) 0 Offset 0 + Decorate 406(ubo) Block + Decorate 413 DescriptorSet 0 + Decorate 413 Binding 4 + Decorate 448(textureposition) DescriptorSet 0 + Decorate 448(textureposition) Binding 1 + Decorate 453(samplerposition) DescriptorSet 0 + Decorate 453(samplerposition) Binding 1 + Decorate 468(textureNormal) DescriptorSet 0 + Decorate 468(textureNormal) Binding 2 + Decorate 473(samplerNormal) DescriptorSet 0 + Decorate 473(samplerNormal) Binding 2 + Decorate 486(textureAlbedo) DescriptorSet 0 + Decorate 486(textureAlbedo) Binding 3 + Decorate 491(samplerAlbedo) DescriptorSet 0 + Decorate 491(samplerAlbedo) Binding 3 + Decorate 752(inUV) Location 0 + Decorate 755(@entryPointOutput) Location 0 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 10: TypeInt 32 0 + 13: 10(int) Constant 32 + 14: 10(int) Constant 6 + 15: 10(int) Constant 0 + 11: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 12 13 14 15 + 16: 10(int) Constant 3 + 8: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 9 13 16 15 + 17: TypeVector 7(float) 4 + 18: 10(int) Constant 4 + 19: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 18 + 20: TypePointer Function 17(fvec4) + 21: TypePointer Function 7(float) + 22: TypeVector 7(float) 2 + 23: 10(int) Constant 2 + 24: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 23 + 25: TypePointer Function 22(fvec2) + 26: TypeFunction 7(float) 20(ptr) 21(ptr) 25(ptr) + 27: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 8 19 8 24 + 34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 35 + 37: 10(int) Constant 1 + 38: 10(int) Constant 5 + 36: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 37 18 34 38 + 33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 32 27 34 15 15 36 32 16 15 + 42: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 43 19 34 15 15 33 18 37 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 46: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 47 8 34 15 15 33 18 23 + 49: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 50 24 34 15 15 33 18 16 + 52: TypeFunction 7(float) 20(ptr) 21(ptr) + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 8 19 8 + 58: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 57 53 34 15 15 36 57 16 15 + 62: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 63 19 34 15 15 58 18 37 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 47 8 34 15 15 58 18 23 + 67: TypeVector 7(float) 3 + 68: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 16 + 69: TypePointer Function 67(fvec3) + 70: TypeFunction 67(fvec3) 69(ptr) 69(ptr) + 71: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 68 68 68 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 75 71 34 15 15 36 75 16 15 + 80: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 81 68 34 15 15 76 18 37 + 83: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 84 68 34 15 15 76 18 23 + 86: TypeFunction 17(fvec4) 25(ptr) + 87: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 19 24 + 91: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 90 87 34 15 15 36 90 16 15 + 95: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 96 24 34 15 15 91 18 37 + 101: 10(int) Constant 62 + 100: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 75 8 34 101 15 33 18 + 102: 7(float) Constant 1065353216 + 107: 10(int) Constant 63 + 105: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 106 19 34 107 15 33 18 + 116: 7(float) Constant 1056964608 + 126: 7(float) Constant 3212836864 + 127: TypeBool + 129: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 133: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 135: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 142: 10(int) Constant 68 + 140: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 141 8 34 142 15 33 18 + 143: TypeImage 7(float) 2D array sampled format:Unknown + 147: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 0(Unknown) + 144: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 145 15 34 142 15 36 146 147 16 + 148: TypePointer UniformConstant 143 +149(textureShadowMap): 148(ptr) Variable UniformConstant + 152: 10(int) Constant 8 + 150: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 151 144 34 142 15 36 151 149(textureShadowMap) 152 + 154: TypeSampler + 155: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 156 37 34 142 15 36 157 147 16 + 158: TypePointer UniformConstant 154 +159(samplerShadowMap): 158(ptr) Variable UniformConstant + 160: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 161 155 34 142 15 36 161 159(samplerShadowMap) 152 + 163: TypeSampledImage 143 + 164: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 165 15 34 142 15 36 166 147 16 + 181: 7(float) Constant 0 + 182: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 187: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 189: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 193: 7(float) Constant 1048576000 + 199: TypeVector 10(int) 3 + 200: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 11 16 + 201: TypePointer Function 199(ivec3) + 205: 10(int) Constant 80 + 203: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 204 200 34 205 15 58 18 + 209: TypeInt 32 1 + 211: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 210 13 18 15 + 212: TypeVector 209(int) 2 + 213: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 211 23 + 214: TypePointer Function 212(ivec2) + 216: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 217 213 34 205 15 58 18 + 218: TypePointer Function 10(int) + 222: TypePointer Function 209(int) + 229: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 230 211 34 205 15 58 18 + 236: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 237 211 34 205 15 58 18 + 245: 10(int) Constant 81 + 243: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 244 8 34 245 15 58 18 + 246: 7(float) Constant 1069547520 + 251: 10(int) Constant 82 + 249: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 250 8 34 251 15 58 18 + 262: 10(int) Constant 83 + 260: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 261 8 34 262 15 58 18 + 273: 10(int) Constant 85 + 271: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 272 8 34 273 15 58 18 + 278: 10(int) Constant 86 + 276: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 277 211 34 278 15 58 18 + 279: 209(int) Constant 0 + 284: 10(int) Constant 87 + 282: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 283 211 34 284 15 58 18 + 285: 209(int) Constant 1 + 290: 10(int) Constant 89 + 288: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 289 211 34 290 15 58 18 + 301: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 306: 10(int) Constant 91 + 304: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 305 211 34 306 15 58 18 + 317: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 356: 10(int) Constant 102 + 354: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 355 211 34 356 15 76 18 + 364: 209(int) Constant 3 + 365: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 370: 10(int) Constant 104 + 368: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 369 19 34 370 15 76 18 + 376: TypeMatrix 17(fvec4) 4 + 378: 127(bool) ConstantTrue + 377: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 19 18 378 + 379(Light): TypeStruct 17(fvec4) 17(fvec4) 17(fvec4) 376 + 382: 10(int) Constant 46 + 383: 10(int) Constant 14 + 380: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 381 19 34 382 383 15 15 16 + 384: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 381 19 34 382 383 15 15 16 + 385: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 381 19 34 382 383 15 15 16 + 388: 10(int) Constant 47 + 389: 10(int) Constant 21 + 386: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 387 377 34 388 389 15 15 16 + 390: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 391 37 34 370 15 36 391 15 16 380 384 385 386 + 392: TypeArray 379(Light) 16 + 393: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 390 16 + 394(UBO): TypeStruct 17(fvec4) 392 209(int) 209(int) + 395: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 381 19 34 382 383 15 15 16 + 398: 10(int) Constant 53 + 396: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 397 393 34 398 383 15 15 16 + 401: 10(int) Constant 55 + 402: 10(int) Constant 24 + 399: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 400 211 34 401 402 15 15 16 + 403: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 400 211 34 401 402 15 15 16 + 404: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 405 37 34 370 15 36 405 15 16 395 396 399 403 + 406(ubo): TypeStruct 394(UBO) + 409: 10(int) Constant 58 + 410: 10(int) Constant 37 + 407: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 408 404 34 409 410 15 15 16 + 411: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 408 37 34 370 15 36 408 15 16 407 + 412: TypePointer Uniform 406(ubo) + 413: 412(ptr) Variable Uniform + 414: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 35 411 34 370 15 36 35 413 152 + 416: TypePointer Uniform 376 + 423: 10(int) Constant 108 + 422: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 272 8 34 423 15 76 18 + 444: 10(int) Constant 121 + 443: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 84 68 34 444 15 91 18 + 445: TypeImage 7(float) 2D sampled format:Unknown + 446: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 145 15 34 444 15 36 146 147 16 + 447: TypePointer UniformConstant 445 +448(textureposition): 447(ptr) Variable UniformConstant + 449: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 450 446 34 444 15 36 450 448(textureposition) 152 + 452: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 156 37 34 444 15 36 157 147 16 +453(samplerposition): 158(ptr) Variable UniformConstant + 454: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 455 452 34 444 15 36 455 453(samplerposition) 152 + 457: TypeSampledImage 445 + 458: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 165 15 34 444 15 36 166 147 16 + 467: 10(int) Constant 122 + 465: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 466 68 34 467 15 91 18 +468(textureNormal): 447(ptr) Variable UniformConstant + 469: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 470 446 34 467 15 36 470 468(textureNormal) 152 + 472: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 156 37 34 467 15 36 157 147 16 +473(samplerNormal): 158(ptr) Variable UniformConstant + 474: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 475 472 34 467 15 36 475 473(samplerNormal) 152 + 485: 10(int) Constant 123 + 483: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 484 19 34 485 15 91 18 +486(textureAlbedo): 447(ptr) Variable UniformConstant + 487: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 488 446 34 485 15 36 488 486(textureAlbedo) 152 + 490: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 156 37 34 485 15 36 157 147 16 +491(samplerAlbedo): 158(ptr) Variable UniformConstant + 492: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 493 490 34 485 15 36 493 491(samplerAlbedo) 152 + 499: TypePointer Uniform 209(int) + 502: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 516: 10(int) Constant 131 + 515: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 81 68 34 516 15 91 18 + 517: 67(fvec3) ConstantComposite 102 102 102 + 547: 7(float) Constant 1036831949 + 553: 10(int) Constant 152 + 551: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 552 68 34 553 15 91 18 + 559: 10(int) Constant 154 + 558: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 355 211 34 559 15 91 18 + 567: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 572: 10(int) Constant 157 + 570: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 571 68 34 572 15 91 18 + 574: TypePointer Uniform 17(fvec4) + 583: 10(int) Constant 159 + 582: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 141 8 34 583 15 91 18 + 593: 10(int) Constant 163 + 591: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 592 68 34 593 15 91 18 + 606: 10(int) Constant 166 + 604: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 605 8 34 606 15 91 18 + 607: 7(float) Constant 1064781546 + 612: 10(int) Constant 167 + 610: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 611 8 34 612 15 91 18 + 613: 7(float) Constant 1063781322 + 618: 10(int) Constant 168 + 616: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 617 8 34 618 15 91 18 + 619: 7(float) Constant 1120403456 + 624: 10(int) Constant 171 + 622: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 623 68 34 624 15 91 18 + 639: 10(int) Constant 174 + 637: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 638 8 34 639 15 91 18 + 647: 10(int) Constant 175 + 645: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 646 8 34 647 15 91 18 + 656: 10(int) Constant 176 + 654: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 655 8 34 656 15 91 18 + 664: 10(int) Constant 179 + 662: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 663 8 34 664 15 91 18 + 673: 10(int) Constant 180 + 671: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 672 68 34 673 15 91 18 + 680: 10(int) Constant 183 + 678: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 679 68 34 680 15 91 18 + 689: 10(int) Constant 184 + 687: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 688 8 34 689 15 91 18 + 698: 10(int) Constant 185 + 696: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 697 68 34 698 15 91 18 + 700: 7(float) Constant 1098907648 + 705: 7(float) Constant 1075838976 + 717: 209(int) Constant 2 + 733: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 128 13 23 15 + 751: TypePointer Input 22(fvec2) + 752(inUV): 751(ptr) Variable Input + 754: TypePointer Output 17(fvec4) +755(@entryPointOutput): 754(ptr) Variable Output + 5(main): 3 Function None 4 + 6: Label + 750(inUV): 25(ptr) Variable Function + 756(param): 25(ptr) Variable Function + 753: 22(fvec2) Load 752(inUV) + Store 750(inUV) 753 + 757: 22(fvec2) Load 750(inUV) + Store 756(param) 757 + 758: 17(fvec4) FunctionCall 89(@main(vf2;) 756(param) + Store 755(@entryPointOutput) 758 + Return + FunctionEnd +31(textureProj(vf4;f1;vf2;): 7(float) Function None 26 + 28(P): 20(ptr) FunctionParameter + 29(layer): 21(ptr) FunctionParameter + 30(offset): 25(ptr) FunctionParameter + 39: Label + 99(shadow): 21(ptr) Variable Function +104(shadowCoord): 20(ptr) Variable Function + 139(dist): 21(ptr) Variable Function + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 33 + 41: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 34 15 15 15 15 + 44: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 42 28(P) 45 + 48: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 46 29(layer) 45 + 51: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 49 30(offset) 45 + 98: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 33 31(textureProj(vf4;f1;vf2;) + Store 99(shadow) 102 + 103: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 100 102 45 + 108: 17(fvec4) Load 28(P) + 109: 21(ptr) AccessChain 28(P) 16 + 110: 7(float) Load 109 + 111: 17(fvec4) CompositeConstruct 110 110 110 110 + 112: 17(fvec4) FDiv 108 111 + Store 104(shadowCoord) 112 + 113: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 105 112 45 + 114: 17(fvec4) Load 104(shadowCoord) + 115: 22(fvec2) VectorShuffle 114 114 0 1 + 117: 22(fvec2) VectorTimesScalar 115 116 + 118: 22(fvec2) CompositeConstruct 116 116 + 119: 22(fvec2) FAdd 117 118 + 120: 21(ptr) AccessChain 104(shadowCoord) 15 + 121: 7(float) CompositeExtract 119 0 + Store 120 121 + 122: 21(ptr) AccessChain 104(shadowCoord) 37 + 123: 7(float) CompositeExtract 119 1 + Store 122 123 + 124: 21(ptr) AccessChain 104(shadowCoord) 23 + 125: 7(float) Load 124 + 130: 127(bool) FOrdGreaterThan 125 126 + 131: 21(ptr) AccessChain 104(shadowCoord) 23 + 132: 7(float) Load 131 + 134: 127(bool) FOrdLessThan 132 102 + 136: 127(bool) LogicalAnd 130 134 + SelectionMerge 138 None + BranchConditional 136 137 138 + 137: Label + 153: 143 Load 149(textureShadowMap) + 162: 154 Load 159(samplerShadowMap) + 167: 163 SampledImage 153 162 + 168: 17(fvec4) Load 104(shadowCoord) + 169: 22(fvec2) VectorShuffle 168 168 0 1 + 170: 22(fvec2) Load 30(offset) + 171: 22(fvec2) FAdd 169 170 + 172: 7(float) Load 29(layer) + 173: 7(float) CompositeExtract 171 0 + 174: 7(float) CompositeExtract 171 1 + 175: 67(fvec3) CompositeConstruct 173 174 172 + 176: 17(fvec4) ImageSampleImplicitLod 167 175 + 177: 7(float) CompositeExtract 176 0 + Store 139(dist) 177 + 178: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 140 177 45 + 179: 21(ptr) AccessChain 104(shadowCoord) 16 + 180: 7(float) Load 179 + 183: 127(bool) FOrdGreaterThan 180 181 + 184: 7(float) Load 139(dist) + 185: 21(ptr) AccessChain 104(shadowCoord) 23 + 186: 7(float) Load 185 + 188: 127(bool) FOrdLessThan 184 186 + 190: 127(bool) LogicalAnd 183 188 + SelectionMerge 192 None + BranchConditional 190 191 192 + 191: Label + Store 99(shadow) 193 + 194: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 100 193 45 + Branch 192 + 192: Label + Branch 138 + 138: Label + 195: 7(float) Load 99(shadow) + ReturnValue 195 + FunctionEnd +56(filterPCF(vf4;f1;): 7(float) Function None 52 + 54(sc): 20(ptr) FunctionParameter + 55(layer): 21(ptr) FunctionParameter + 59: Label +202(sizeQueryTemp): 201(ptr) Variable Function + 215(texDim): 214(ptr) Variable Function + 228(elements): 222(ptr) Variable Function + 235(levels): 222(ptr) Variable Function + 242(scale): 21(ptr) Variable Function + 248(dx): 21(ptr) Variable Function + 259(dy): 21(ptr) Variable Function +270(shadowFactor): 21(ptr) Variable Function + 275(count): 222(ptr) Variable Function + 281(range): 222(ptr) Variable Function + 287(x): 222(ptr) Variable Function + 303(y): 222(ptr) Variable Function + 328(param): 20(ptr) Variable Function + 330(param): 21(ptr) Variable Function + 332(param): 25(ptr) Variable Function + 60: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 58 + 61: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 34 15 15 15 15 + 64: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 62 54(sc) 45 + 66: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 65 55(layer) 45 + 198: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 58 56(filterPCF(vf4;f1;) + 206: 143 Load 149(textureShadowMap) + 207: 199(ivec3) ImageQuerySizeLod 206 15 + Store 202(sizeQueryTemp) 207 + 208: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 203 207 45 + 219: 218(ptr) AccessChain 202(sizeQueryTemp) 15 + 220: 10(int) Load 219 + 221: 209(int) Bitcast 220 + 223: 222(ptr) AccessChain 215(texDim) 15 + Store 223 221 + 224: 218(ptr) AccessChain 202(sizeQueryTemp) 37 + 225: 10(int) Load 224 + 226: 209(int) Bitcast 225 + 227: 222(ptr) AccessChain 215(texDim) 37 + Store 227 226 + 231: 218(ptr) AccessChain 202(sizeQueryTemp) 23 + 232: 10(int) Load 231 + 233: 209(int) Bitcast 232 + Store 228(elements) 233 + 234: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 229 233 45 + 238: 143 Load 149(textureShadowMap) + 239: 10(int) ImageQueryLevels 238 + 240: 209(int) Bitcast 239 + Store 235(levels) 240 + 241: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 236 240 45 + Store 242(scale) 246 + 247: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 243 246 45 + 252: 7(float) Load 242(scale) + 253: 7(float) FMul 252 102 + 254: 222(ptr) AccessChain 215(texDim) 15 + 255: 209(int) Load 254 + 256: 7(float) ConvertSToF 255 + 257: 7(float) FDiv 253 256 + Store 248(dx) 257 + 258: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 249 257 45 + 263: 7(float) Load 242(scale) + 264: 7(float) FMul 263 102 + 265: 222(ptr) AccessChain 215(texDim) 37 + 266: 209(int) Load 265 + 267: 7(float) ConvertSToF 266 + 268: 7(float) FDiv 264 267 + Store 259(dy) 268 + 269: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 260 268 45 + Store 270(shadowFactor) 181 + 274: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 271 181 45 + Store 275(count) 279 + 280: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 276 279 45 + Store 281(range) 285 + 286: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 282 285 45 + 291: 209(int) Load 281(range) + 292: 209(int) SNegate 291 + Store 287(x) 292 + 293: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 288 292 45 + Branch 294 + 294: Label + LoopMerge 296 297 None + Branch 298 + 298: Label + 299: 209(int) Load 287(x) + 300: 209(int) Load 281(range) + 302: 127(bool) SLessThanEqual 299 300 + BranchConditional 302 295 296 + 295: Label + 307: 209(int) Load 281(range) + 308: 209(int) SNegate 307 + Store 303(y) 308 + 309: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 304 308 45 + Branch 310 + 310: Label + LoopMerge 312 313 None + Branch 314 + 314: Label + 315: 209(int) Load 303(y) + 316: 209(int) Load 281(range) + 318: 127(bool) SLessThanEqual 315 316 + BranchConditional 318 311 312 + 311: Label + 319: 7(float) Load 248(dx) + 320: 209(int) Load 287(x) + 321: 7(float) ConvertSToF 320 + 322: 7(float) FMul 319 321 + 323: 7(float) Load 259(dy) + 324: 209(int) Load 303(y) + 325: 7(float) ConvertSToF 324 + 326: 7(float) FMul 323 325 + 327: 22(fvec2) CompositeConstruct 322 326 + 329: 17(fvec4) Load 54(sc) + Store 328(param) 329 + 331: 7(float) Load 55(layer) + Store 330(param) 331 + Store 332(param) 327 + 333: 7(float) FunctionCall 31(textureProj(vf4;f1;vf2;) 328(param) 330(param) 332(param) + 334: 7(float) Load 270(shadowFactor) + 335: 7(float) FAdd 334 333 + Store 270(shadowFactor) 335 + 336: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 271 335 45 + 337: 209(int) Load 275(count) + 338: 209(int) IAdd 337 285 + Store 275(count) 338 + 339: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 276 338 45 + Branch 313 + 313: Label + 340: 209(int) Load 303(y) + 341: 209(int) IAdd 340 285 + Store 303(y) 341 + 342: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 304 341 45 + Branch 310 + 312: Label + Branch 297 + 297: Label + 343: 209(int) Load 287(x) + 344: 209(int) IAdd 343 285 + Store 287(x) 344 + 345: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 288 344 45 + Branch 294 + 296: Label + 346: 7(float) Load 270(shadowFactor) + 347: 209(int) Load 275(count) + 348: 7(float) ConvertSToF 347 + 349: 7(float) FDiv 346 348 + ReturnValue 349 + FunctionEnd +74(shadow(vf3;vf3;): 67(fvec3) Function None 70 + 72(fragcolor): 69(ptr) FunctionParameter + 73(fragPos): 69(ptr) FunctionParameter + 77: Label + 353(i): 222(ptr) Variable Function + 367(shadowClip): 20(ptr) Variable Function +421(shadowFactor): 21(ptr) Variable Function + 426(param): 20(ptr) Variable Function + 428(param): 21(ptr) Variable Function + 78: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 76 + 79: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 34 15 15 15 15 + 82: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 80 72(fragcolor) 45 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 83 73(fragPos) 45 + 352: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 76 74(shadow(vf3;vf3;) + Store 353(i) 279 + 357: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 354 279 45 + Branch 358 + 358: Label + LoopMerge 360 361 None + Branch 362 + 362: Label + 363: 209(int) Load 353(i) + 366: 127(bool) SLessThan 363 364 + BranchConditional 366 359 360 + 359: Label + 371: 67(fvec3) Load 73(fragPos) + 372: 7(float) CompositeExtract 371 0 + 373: 7(float) CompositeExtract 371 1 + 374: 7(float) CompositeExtract 371 2 + 375: 17(fvec4) CompositeConstruct 372 373 374 102 + 415: 209(int) Load 353(i) + 417: 416(ptr) AccessChain 413 279 285 415 364 + 418: 376 Load 417 + 419: 17(fvec4) VectorTimesMatrix 375 418 + Store 367(shadowClip) 419 + 420: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 368 419 45 + 424: 209(int) Load 353(i) + 425: 7(float) ConvertSToF 424 + 427: 17(fvec4) Load 367(shadowClip) + Store 426(param) 427 + Store 428(param) 425 + 429: 7(float) FunctionCall 56(filterPCF(vf4;f1;) 426(param) 428(param) + Store 421(shadowFactor) 429 + 430: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 422 429 45 + 431: 7(float) Load 421(shadowFactor) + 432: 67(fvec3) Load 72(fragcolor) + 433: 67(fvec3) VectorTimesScalar 432 431 + Store 72(fragcolor) 433 + 434: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 80 433 45 + Branch 361 + 361: Label + 435: 209(int) Load 353(i) + 436: 209(int) IAdd 435 285 + Store 353(i) 436 + 437: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 354 436 45 + Branch 358 + 360: Label + 438: 67(fvec3) Load 72(fragcolor) + ReturnValue 438 + FunctionEnd + 89(@main(vf2;): 17(fvec4) Function None 86 + 88(inUV): 25(ptr) FunctionParameter + 92: Label + 442(fragPos): 69(ptr) Variable Function + 464(normal): 69(ptr) Variable Function + 482(albedo): 20(ptr) Variable Function + 514(fragcolor): 69(ptr) Variable Function + 518(param): 69(ptr) Variable Function + 519(param): 69(ptr) Variable Function + 550(N): 69(ptr) Variable Function + 557(i): 222(ptr) Variable Function + 569(L): 69(ptr) Variable Function + 581(dist): 21(ptr) Variable Function + 590(V): 69(ptr) Variable Function +603(lightCosInnerAngle): 21(ptr) Variable Function +609(lightCosOuterAngle): 21(ptr) Variable Function + 615(lightRange): 21(ptr) Variable Function + 621(dir): 69(ptr) Variable Function + 636(cosDir): 21(ptr) Variable Function + 644(spotEffect): 21(ptr) Variable Function +653(heightAttenuation): 21(ptr) Variable Function + 661(NdotL): 21(ptr) Variable Function + 670(diff): 69(ptr) Variable Function + 677(R): 69(ptr) Variable Function + 686(NdotR): 21(ptr) Variable Function + 695(spec): 69(ptr) Variable Function + 737(param): 69(ptr) Variable Function + 739(param): 69(ptr) Variable Function + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 91 + 94: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 34 15 15 15 15 + 97: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 95 88(inUV) 45 + 441: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 91 89(@main(vf2;) + 451: 445 Load 448(textureposition) + 456: 154 Load 453(samplerposition) + 459: 457 SampledImage 451 456 + 460: 22(fvec2) Load 88(inUV) + 461: 17(fvec4) ImageSampleImplicitLod 459 460 + 462: 67(fvec3) VectorShuffle 461 461 0 1 2 + Store 442(fragPos) 462 + 463: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 443 462 45 + 471: 445 Load 468(textureNormal) + 476: 154 Load 473(samplerNormal) + 477: 457 SampledImage 471 476 + 478: 22(fvec2) Load 88(inUV) + 479: 17(fvec4) ImageSampleImplicitLod 477 478 + 480: 67(fvec3) VectorShuffle 479 479 0 1 2 + Store 464(normal) 480 + 481: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 465 480 45 + 489: 445 Load 486(textureAlbedo) + 494: 154 Load 491(samplerAlbedo) + 495: 457 SampledImage 489 494 + 496: 22(fvec2) Load 88(inUV) + 497: 17(fvec4) ImageSampleImplicitLod 495 496 + Store 482(albedo) 497 + 498: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 483 497 45 + 500: 499(ptr) AccessChain 413 279 364 + 501: 209(int) Load 500 + 503: 127(bool) SGreaterThan 501 279 + SelectionMerge 505 None + BranchConditional 503 504 505 + 504: Label + 506: 499(ptr) AccessChain 413 279 364 + 507: 209(int) Load 506 + SelectionMerge 513 None + Switch 507 513 + case 1: 508 + case 2: 509 + case 3: 510 + case 4: 511 + case 5: 512 + 508: Label + Store 518(param) 517 + 520: 67(fvec3) Load 442(fragPos) + Store 519(param) 520 + 521: 67(fvec3) FunctionCall 74(shadow(vf3;vf3;) 518(param) 519(param) + Store 514(fragcolor) 521 + 522: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 521 45 + Branch 513 + 509: Label + 524: 67(fvec3) Load 442(fragPos) + Store 514(fragcolor) 524 + 525: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 524 45 + Branch 513 + 510: Label + 527: 67(fvec3) Load 464(normal) + Store 514(fragcolor) 527 + 528: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 527 45 + Branch 513 + 511: Label + 530: 17(fvec4) Load 482(albedo) + 531: 67(fvec3) VectorShuffle 530 530 0 1 2 + Store 514(fragcolor) 531 + 532: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 531 45 + Branch 513 + 512: Label + 534: 17(fvec4) Load 482(albedo) + 535: 67(fvec3) VectorShuffle 534 534 3 3 3 + Store 514(fragcolor) 535 + 536: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 535 45 + Branch 513 + 513: Label + 539: 67(fvec3) Load 514(fragcolor) + 540: 7(float) CompositeExtract 539 0 + 541: 7(float) CompositeExtract 539 1 + 542: 7(float) CompositeExtract 539 2 + 543: 17(fvec4) CompositeConstruct 540 541 542 102 + ReturnValue 543 + 505: Label + 545: 17(fvec4) Load 482(albedo) + 546: 67(fvec3) VectorShuffle 545 545 0 1 2 + 548: 67(fvec3) VectorTimesScalar 546 547 + Store 514(fragcolor) 548 + 549: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 548 45 + 554: 67(fvec3) Load 464(normal) + 555: 67(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 554 + Store 550(N) 555 + 556: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 551 555 45 + Store 557(i) 279 + 560: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 558 279 45 + Branch 561 + 561: Label + LoopMerge 563 564 None + Branch 565 + 565: Label + 566: 209(int) Load 557(i) + 568: 127(bool) SLessThan 566 364 + BranchConditional 568 562 563 + 562: Label + 573: 209(int) Load 557(i) + 575: 574(ptr) AccessChain 413 279 285 573 279 + 576: 17(fvec4) Load 575 + 577: 67(fvec3) VectorShuffle 576 576 0 1 2 + 578: 67(fvec3) Load 442(fragPos) + 579: 67(fvec3) FSub 577 578 + Store 569(L) 579 + 580: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 570 579 45 + 584: 67(fvec3) Load 569(L) + 585: 7(float) ExtInst 2(GLSL.std.450) 66(Length) 584 + Store 581(dist) 585 + 586: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 582 585 45 + 587: 67(fvec3) Load 569(L) + 588: 67(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 587 + Store 569(L) 588 + 589: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 570 588 45 + 594: 574(ptr) AccessChain 413 279 279 + 595: 17(fvec4) Load 594 + 596: 67(fvec3) VectorShuffle 595 595 0 1 2 + 597: 67(fvec3) Load 442(fragPos) + 598: 67(fvec3) FSub 596 597 + Store 590(V) 598 + 599: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 591 598 45 + 600: 67(fvec3) Load 590(V) + 601: 67(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 600 + Store 590(V) 601 + 602: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 591 601 45 + Store 603(lightCosInnerAngle) 607 + 608: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 604 607 45 + Store 609(lightCosOuterAngle) 613 + 614: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 610 613 45 + Store 615(lightRange) 619 + 620: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 616 619 45 + 625: 209(int) Load 557(i) + 626: 574(ptr) AccessChain 413 279 285 625 279 + 627: 17(fvec4) Load 626 + 628: 67(fvec3) VectorShuffle 627 627 0 1 2 + 629: 209(int) Load 557(i) + 630: 574(ptr) AccessChain 413 279 285 629 285 + 631: 17(fvec4) Load 630 + 632: 67(fvec3) VectorShuffle 631 631 0 1 2 + 633: 67(fvec3) FSub 628 632 + 634: 67(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 633 + Store 621(dir) 634 + 635: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 622 634 45 + 640: 67(fvec3) Load 569(L) + 641: 67(fvec3) Load 621(dir) + 642: 7(float) Dot 640 641 + Store 636(cosDir) 642 + 643: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 637 642 45 + 648: 7(float) Load 609(lightCosOuterAngle) + 649: 7(float) Load 603(lightCosInnerAngle) + 650: 7(float) Load 636(cosDir) + 651: 7(float) ExtInst 2(GLSL.std.450) 49(SmoothStep) 648 649 650 + Store 644(spotEffect) 651 + 652: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 645 651 45 + 657: 7(float) Load 615(lightRange) + 658: 7(float) Load 581(dist) + 659: 7(float) ExtInst 2(GLSL.std.450) 49(SmoothStep) 657 181 658 + Store 653(heightAttenuation) 659 + 660: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 654 659 45 + 665: 67(fvec3) Load 550(N) + 666: 67(fvec3) Load 569(L) + 667: 7(float) Dot 665 666 + 668: 7(float) ExtInst 2(GLSL.std.450) 40(FMax) 181 667 + Store 661(NdotL) 668 + 669: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 662 668 45 + 674: 7(float) Load 661(NdotL) + 675: 67(fvec3) CompositeConstruct 674 674 674 + Store 670(diff) 675 + 676: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 671 675 45 + 681: 67(fvec3) Load 569(L) + 682: 67(fvec3) FNegate 681 + 683: 67(fvec3) Load 550(N) + 684: 67(fvec3) ExtInst 2(GLSL.std.450) 71(Reflect) 682 683 + Store 677(R) 684 + 685: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 678 684 45 + 690: 67(fvec3) Load 677(R) + 691: 67(fvec3) Load 590(V) + 692: 7(float) Dot 690 691 + 693: 7(float) ExtInst 2(GLSL.std.450) 40(FMax) 181 692 + Store 686(NdotR) 693 + 694: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 687 693 45 + 699: 7(float) Load 686(NdotR) + 701: 7(float) ExtInst 2(GLSL.std.450) 26(Pow) 699 700 + 702: 21(ptr) AccessChain 482(albedo) 16 + 703: 7(float) Load 702 + 704: 7(float) FMul 701 703 + 706: 7(float) FMul 704 705 + 707: 67(fvec3) CompositeConstruct 706 706 706 + Store 695(spec) 707 + 708: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 696 707 45 + 709: 67(fvec3) Load 670(diff) + 710: 67(fvec3) Load 695(spec) + 711: 67(fvec3) FAdd 709 710 + 712: 7(float) Load 644(spotEffect) + 713: 67(fvec3) VectorTimesScalar 711 712 + 714: 7(float) Load 653(heightAttenuation) + 715: 67(fvec3) VectorTimesScalar 713 714 + 716: 209(int) Load 557(i) + 718: 574(ptr) AccessChain 413 279 285 716 717 + 719: 17(fvec4) Load 718 + 720: 67(fvec3) VectorShuffle 719 719 0 1 2 + 721: 67(fvec3) FMul 715 720 + 722: 17(fvec4) Load 482(albedo) + 723: 67(fvec3) VectorShuffle 722 722 0 1 2 + 724: 67(fvec3) FMul 721 723 + 725: 67(fvec3) Load 514(fragcolor) + 726: 67(fvec3) FAdd 725 724 + Store 514(fragcolor) 726 + 727: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 726 45 + Branch 564 + 564: Label + 728: 209(int) Load 557(i) + 729: 209(int) IAdd 728 285 + Store 557(i) 729 + 730: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 558 729 45 + Branch 561 + 563: Label + 731: 499(ptr) AccessChain 413 279 717 + 732: 209(int) Load 731 + 734: 127(bool) SGreaterThan 732 279 + SelectionMerge 736 None + BranchConditional 734 735 736 + 735: Label + 738: 67(fvec3) Load 514(fragcolor) + Store 737(param) 738 + 740: 67(fvec3) Load 442(fragPos) + Store 739(param) 740 + 741: 67(fvec3) FunctionCall 74(shadow(vf3;vf3;) 737(param) 739(param) + Store 514(fragcolor) 741 + 742: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 515 741 45 + Branch 736 + 736: Label + 743: 67(fvec3) Load 514(fragcolor) + 744: 7(float) CompositeExtract 743 0 + 745: 7(float) CompositeExtract 743 1 + 746: 7(float) CompositeExtract 743 2 + 747: 17(fvec4) CompositeConstruct 744 745 746 102 + ReturnValue 747 + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.hlsl.geom.out b/Test/baseResults/spv.debuginfo.hlsl.geom.out new file mode 100644 index 000000000..f629f2ce1 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.hlsl.geom.out @@ -0,0 +1,459 @@ +spv.debuginfo.hlsl.geom +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 323 + + Capability Geometry + Capability MultiViewport + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 5 "main" 228 235 240 246 251 256 261 272 279 284 308 311 + ExecutionMode 5 Triangles + ExecutionMode 5 Invocations 2 + ExecutionMode 5 OutputTriangleStrip + ExecutionMode 5 OutputVertices 3 + 9: String "float" + 12: String "uint" + 24: String "Pos" + 26: String "" + 30: String "Color" + 35: String "VSOutput" + 46: String "PrimitiveID" + 51: String "LightVec" + 57: String "GSOutput" + 67: String "@main" + 73: String "input" + 77: String "outStream" + 81: String "InvocationID" + 87: String "int" + 92: String "i" + 104: String "bool" + 109: String "output" + 130: String "projection" + 134: String "modelview" + 138: String "lightPos" + 142: String "UBO" + 146: String "ubo" + 177: String "pos" + 185: String "worldPos" + 195: String "lPos" + 230: String "outStream.Pos" + 237: String "outStream.ViewportIndex" + 242: String "outStream.PrimitiveID" + 248: String "outStream.Normal" + 253: String "outStream.Color" + 258: String "outStream.ViewVec" + 263: String "outStream.LightVec" + Name 5 "main" + Name 22 "VSOutput" + MemberName 22(VSOutput) 0 "Pos" + MemberName 22(VSOutput) 1 "Normal" + MemberName 22(VSOutput) 2 "Color" + Name 42 "GSOutput" + MemberName 42(GSOutput) 0 "Pos" + MemberName 42(GSOutput) 1 "ViewportIndex" + MemberName 42(GSOutput) 2 "PrimitiveID" + MemberName 42(GSOutput) 3 "Normal" + MemberName 42(GSOutput) 4 "Color" + MemberName 42(GSOutput) 5 "ViewVec" + MemberName 42(GSOutput) 6 "LightVec" + Name 66 "@main(struct-VSOutput-vf4-vf3-vf31[3];struct-GSOutput-vf4-u1-u1-vf3-vf3-vf3-vf31;u1;u1;" + Name 62 "input" + Name 63 "outStream" + Name 64 "InvocationID" + Name 65 "PrimitiveID" + Name 90 "i" + Name 107 "output" + Name 128 "UBO" + MemberName 128(UBO) 0 "projection" + MemberName 128(UBO) 1 "modelview" + MemberName 128(UBO) 2 "lightPos" + Name 144 "ubo" + MemberName 144(ubo) 0 "ubo" + Name 150 "" + Name 175 "pos" + Name 183 "worldPos" + Name 193 "lPos" + Name 228 "outStream.Pos" + Name 235 "outStream.ViewportIndex" + Name 240 "outStream.PrimitiveID" + Name 246 "outStream.Normal" + Name 251 "outStream.Color" + Name 256 "outStream.ViewVec" + Name 261 "outStream.LightVec" + Name 269 "input" + Name 272 "input.Pos" + Name 279 "input.Normal" + Name 284 "input.Color" + Name 306 "InvocationID" + Name 308 "InvocationID" + Name 310 "PrimitiveID" + Name 311 "PrimitiveID" + Name 313 "outStream" + Name 314 "param" + Name 316 "param" + Name 317 "param" + Name 319 "param" + Decorate 124 ArrayStride 64 + Decorate 126 ArrayStride 64 + MemberDecorate 128(UBO) 0 RowMajor + MemberDecorate 128(UBO) 0 Offset 0 + MemberDecorate 128(UBO) 0 MatrixStride 16 + MemberDecorate 128(UBO) 1 RowMajor + MemberDecorate 128(UBO) 1 Offset 128 + MemberDecorate 128(UBO) 1 MatrixStride 16 + MemberDecorate 128(UBO) 2 Offset 256 + MemberDecorate 144(ubo) 0 Offset 0 + Decorate 144(ubo) Block + Decorate 150 DescriptorSet 0 + Decorate 150 Binding 0 + Decorate 228(outStream.Pos) BuiltIn Position + Decorate 235(outStream.ViewportIndex) BuiltIn ViewportIndex + Decorate 240(outStream.PrimitiveID) BuiltIn PrimitiveId + Decorate 246(outStream.Normal) Location 0 + Decorate 251(outStream.Color) Location 1 + Decorate 256(outStream.ViewVec) Location 2 + Decorate 261(outStream.LightVec) Location 3 + Decorate 272(input.Pos) BuiltIn Position + Decorate 279(input.Normal) Location 0 + Decorate 284(input.Color) Location 1 + Decorate 308(InvocationID) BuiltIn InvocationId + Decorate 311(PrimitiveID) BuiltIn PrimitiveId + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 10: TypeInt 32 0 + 13: 10(int) Constant 32 + 14: 10(int) Constant 6 + 15: 10(int) Constant 0 + 11: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 12 13 14 15 + 16: 10(int) Constant 3 + 8: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 9 13 16 15 + 17: TypeVector 7(float) 4 + 18: 10(int) Constant 4 + 19: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 18 + 20: TypeVector 7(float) 3 + 21: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 16 + 22(VSOutput): TypeStruct 17(fvec4) 20(fvec3) 20(fvec3) + 25: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 26 + 27: 10(int) Constant 37 + 28: 10(int) Constant 13 + 23: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 24 19 25 27 28 15 15 16 + 31: 10(int) Constant 39 + 32: 10(int) Constant 34 + 29: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 30 21 25 31 32 15 15 16 + 33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 30 21 25 31 32 15 15 16 + 36: 10(int) Constant 1 + 38: 10(int) Constant 5 + 37: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 36 18 25 38 + 34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 35 36 25 15 15 37 35 15 16 23 29 33 + 39: TypeArray 22(VSOutput) 16 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 34 16 + 41: TypePointer Function 39 + 42(GSOutput): TypeStruct 17(fvec4) 10(int) 10(int) 20(fvec3) 20(fvec3) 20(fvec3) 20(fvec3) + 44: 10(int) Constant 44 + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 24 19 25 44 28 15 15 16 + 47: 10(int) Constant 46 + 48: 10(int) Constant 19 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 46 11 25 47 48 15 15 16 + 49: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 46 11 25 47 48 15 15 16 + 52: 10(int) Constant 50 + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 51 21 25 52 27 15 15 16 + 53: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 51 21 25 52 27 15 15 16 + 54: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 51 21 25 52 27 15 15 16 + 55: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 51 21 25 52 27 15 15 16 + 56: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 57 36 25 15 15 37 57 15 16 43 45 49 50 53 54 55 + 58: TypePointer Function 42(GSOutput) + 59: TypePointer Function 10(int) + 60: TypeFunction 3 41(ptr) 58(ptr) 59(ptr) 59(ptr) + 61: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 3 40 56 11 11 + 68: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 67 61 25 15 15 37 67 16 15 + 72: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 73 40 25 15 15 68 18 36 + 75: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 78: 10(int) Constant 2 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 77 56 25 15 15 68 18 78 + 80: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 81 11 25 15 15 68 18 16 + 83: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 46 11 25 15 15 68 18 18 + 86: TypeInt 32 1 + 88: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 87 13 18 15 + 89: TypePointer Function 86(int) + 93: 10(int) Constant 57 + 91: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 92 88 25 93 15 68 18 + 94: 86(int) Constant 0 + 102: 86(int) Constant 3 + 103: TypeBool + 105: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 104 13 78 15 + 110: 10(int) Constant 59 + 108: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 109 56 25 110 15 68 18 + 111: 7(float) Constant 0 + 112: 17(fvec4) ConstantComposite 111 111 111 111 + 113: 20(fvec3) ConstantComposite 111 111 111 + 114:42(GSOutput) ConstantComposite 112 15 15 113 113 113 113 + 117: 86(int) Constant 1 + 118: TypePointer Function 20(fvec3) + 121: TypeMatrix 17(fvec4) 4 + 123: 103(bool) ConstantTrue + 122: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 19 18 123 + 124: TypeArray 121 78 + 125: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 122 78 + 126: TypeArray 121 78 + 127: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 122 78 + 128(UBO): TypeStruct 124 126 17(fvec4) + 131: 10(int) Constant 28 + 132: 10(int) Constant 21 + 129: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 130 125 25 131 132 15 15 16 + 135: 10(int) Constant 29 + 136: 10(int) Constant 20 + 133: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 134 127 25 135 136 15 15 16 + 139: 10(int) Constant 30 + 140: 10(int) Constant 17 + 137: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 138 19 25 139 140 15 15 16 + 143: 10(int) Constant 60 + 141: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 142 36 25 143 15 37 142 15 16 129 133 137 + 144(ubo): TypeStruct 128(UBO) + 147: 10(int) Constant 33 + 145: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 146 141 25 147 27 15 15 16 + 148: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 146 36 25 143 15 37 146 15 16 145 + 149: TypePointer Uniform 144(ubo) + 150: 149(ptr) Variable Uniform + 152: 10(int) Constant 8 + 151: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 26 148 25 143 15 37 26 150 152 + 154: TypePointer Uniform 121 + 157: TypeMatrix 20(fvec3) 3 + 158: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 21 16 123 + 168: 86(int) Constant 4 + 170: 86(int) Constant 2 + 174: TypePointer Function 17(fvec4) + 178: 10(int) Constant 63 + 176: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 177 19 25 178 15 68 18 + 186: 10(int) Constant 64 + 184: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 185 19 25 186 15 68 18 + 196: 10(int) Constant 66 + 194: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 195 21 25 196 15 68 18 + 197: TypePointer Uniform 17(fvec4) + 206: 86(int) Constant 6 + 212: 86(int) Constant 5 + 227: TypePointer Output 17(fvec4) +228(outStream.Pos): 227(ptr) Variable Output + 231: 10(int) Constant 75 + 229: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 230 19 25 231 15 37 230 228(outStream.Pos) 152 + 234: TypePointer Output 10(int) +235(outStream.ViewportIndex): 234(ptr) Variable Output + 236: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 237 11 25 231 15 37 237 235(outStream.ViewportIndex) 152 +240(outStream.PrimitiveID): 234(ptr) Variable Output + 241: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 242 11 25 231 15 37 242 240(outStream.PrimitiveID) 152 + 245: TypePointer Output 20(fvec3) +246(outStream.Normal): 245(ptr) Variable Output + 247: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 248 21 25 231 15 37 248 246(outStream.Normal) 152 +251(outStream.Color): 245(ptr) Variable Output + 252: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 253 21 25 231 15 37 253 251(outStream.Color) 152 +256(outStream.ViewVec): 245(ptr) Variable Output + 257: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 258 21 25 231 15 37 258 256(outStream.ViewVec) 152 +261(outStream.LightVec): 245(ptr) Variable Output + 262: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 263 21 25 231 15 37 263 261(outStream.LightVec) 152 + 270: TypeArray 17(fvec4) 16 + 271: TypePointer Input 270 + 272(input.Pos): 271(ptr) Variable Input + 273: TypePointer Input 17(fvec4) + 277: TypeArray 20(fvec3) 16 + 278: TypePointer Input 277 +279(input.Normal): 278(ptr) Variable Input + 280: TypePointer Input 20(fvec3) +284(input.Color): 278(ptr) Variable Input + 307: TypePointer Input 10(int) +308(InvocationID): 307(ptr) Variable Input +311(PrimitiveID): 307(ptr) Variable Input + 5(main): 3 Function None 4 + 6: Label + 269(input): 41(ptr) Variable Function +306(InvocationID): 59(ptr) Variable Function +310(PrimitiveID): 59(ptr) Variable Function + 313(outStream): 58(ptr) Variable Function + 314(param): 41(ptr) Variable Function + 316(param): 58(ptr) Variable Function + 317(param): 59(ptr) Variable Function + 319(param): 59(ptr) Variable Function + 274: 273(ptr) AccessChain 272(input.Pos) 94 + 275: 17(fvec4) Load 274 + 276: 174(ptr) AccessChain 269(input) 94 94 + Store 276 275 + 281: 280(ptr) AccessChain 279(input.Normal) 94 + 282: 20(fvec3) Load 281 + 283: 118(ptr) AccessChain 269(input) 94 117 + Store 283 282 + 285: 280(ptr) AccessChain 284(input.Color) 94 + 286: 20(fvec3) Load 285 + 287: 118(ptr) AccessChain 269(input) 94 170 + Store 287 286 + 288: 273(ptr) AccessChain 272(input.Pos) 117 + 289: 17(fvec4) Load 288 + 290: 174(ptr) AccessChain 269(input) 117 94 + Store 290 289 + 291: 280(ptr) AccessChain 279(input.Normal) 117 + 292: 20(fvec3) Load 291 + 293: 118(ptr) AccessChain 269(input) 117 117 + Store 293 292 + 294: 280(ptr) AccessChain 284(input.Color) 117 + 295: 20(fvec3) Load 294 + 296: 118(ptr) AccessChain 269(input) 117 170 + Store 296 295 + 297: 273(ptr) AccessChain 272(input.Pos) 170 + 298: 17(fvec4) Load 297 + 299: 174(ptr) AccessChain 269(input) 170 94 + Store 299 298 + 300: 280(ptr) AccessChain 279(input.Normal) 170 + 301: 20(fvec3) Load 300 + 302: 118(ptr) AccessChain 269(input) 170 117 + Store 302 301 + 303: 280(ptr) AccessChain 284(input.Color) 170 + 304: 20(fvec3) Load 303 + 305: 118(ptr) AccessChain 269(input) 170 170 + Store 305 304 + 309: 10(int) Load 308(InvocationID) + Store 306(InvocationID) 309 + 312: 10(int) Load 311(PrimitiveID) + Store 310(PrimitiveID) 312 + 315: 39 Load 269(input) + Store 314(param) 315 + 318: 10(int) Load 306(InvocationID) + Store 317(param) 318 + 320: 10(int) Load 310(PrimitiveID) + Store 319(param) 320 + 321: 3 FunctionCall 66(@main(struct-VSOutput-vf4-vf3-vf31[3];struct-GSOutput-vf4-u1-u1-vf3-vf3-vf3-vf31;u1;u1;) 314(param) 316(param) 317(param) 319(param) + 322:42(GSOutput) Load 316(param) + Store 313(outStream) 322 + Return + FunctionEnd +66(@main(struct-VSOutput-vf4-vf3-vf31[3];struct-GSOutput-vf4-u1-u1-vf3-vf3-vf3-vf31;u1;u1;): 3 Function None 60 + 62(input): 41(ptr) FunctionParameter + 63(outStream): 58(ptr) FunctionParameter +64(InvocationID): 59(ptr) FunctionParameter + 65(PrimitiveID): 59(ptr) FunctionParameter + 69: Label + 90(i): 89(ptr) Variable Function + 107(output): 58(ptr) Variable Function + 175(pos): 174(ptr) Variable Function + 183(worldPos): 174(ptr) Variable Function + 193(lPos): 118(ptr) Variable Function + 70: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 68 + 71: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 25 15 15 15 15 + 74: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 72 62(input) 75 + 79: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 76 63(outStream) 75 + 82: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 80 64(InvocationID) 75 + 84: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 83 65(PrimitiveID) 75 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 68 66(@main(struct-VSOutput-vf4-vf3-vf31[3];struct-GSOutput-vf4-u1-u1-vf3-vf3-vf3-vf31;u1;u1;) + Store 90(i) 94 + 95: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 91 94 75 + Branch 96 + 96: Label + LoopMerge 98 99 None + Branch 100 + 100: Label + 101: 86(int) Load 90(i) + 106: 103(bool) SLessThan 101 102 + BranchConditional 106 97 98 + 97: Label + Store 107(output) 114 + 115: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 108 114 75 + 116: 86(int) Load 90(i) + 119: 118(ptr) AccessChain 62(input) 116 117 + 120: 20(fvec3) Load 119 + 153: 10(int) Load 64(InvocationID) + 155: 154(ptr) AccessChain 150 94 117 153 + 156: 121 Load 155 + 159: 17(fvec4) CompositeExtract 156 0 + 160: 20(fvec3) VectorShuffle 159 159 0 1 2 + 161: 17(fvec4) CompositeExtract 156 1 + 162: 20(fvec3) VectorShuffle 161 161 0 1 2 + 163: 17(fvec4) CompositeExtract 156 2 + 164: 20(fvec3) VectorShuffle 163 163 0 1 2 + 165: 157 CompositeConstruct 160 162 164 + 166: 20(fvec3) VectorTimesMatrix 120 165 + 167: 118(ptr) AccessChain 107(output) 102 + Store 167 166 + 169: 86(int) Load 90(i) + 171: 118(ptr) AccessChain 62(input) 169 170 + 172: 20(fvec3) Load 171 + 173: 118(ptr) AccessChain 107(output) 168 + Store 173 172 + 179: 86(int) Load 90(i) + 180: 174(ptr) AccessChain 62(input) 179 94 + 181: 17(fvec4) Load 180 + Store 175(pos) 181 + 182: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 176 181 75 + 187: 17(fvec4) Load 175(pos) + 188: 10(int) Load 64(InvocationID) + 189: 154(ptr) AccessChain 150 94 117 188 + 190: 121 Load 189 + 191: 17(fvec4) VectorTimesMatrix 187 190 + Store 183(worldPos) 191 + 192: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 184 191 75 + 198: 197(ptr) AccessChain 150 94 170 + 199: 17(fvec4) Load 198 + 200: 10(int) Load 64(InvocationID) + 201: 154(ptr) AccessChain 150 94 117 200 + 202: 121 Load 201 + 203: 17(fvec4) VectorTimesMatrix 199 202 + 204: 20(fvec3) VectorShuffle 203 203 0 1 2 + Store 193(lPos) 204 + 205: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 194 204 75 + 207: 20(fvec3) Load 193(lPos) + 208: 17(fvec4) Load 183(worldPos) + 209: 20(fvec3) VectorShuffle 208 208 0 1 2 + 210: 20(fvec3) FSub 207 209 + 211: 118(ptr) AccessChain 107(output) 206 + Store 211 210 + 213: 17(fvec4) Load 183(worldPos) + 214: 20(fvec3) VectorShuffle 213 213 0 1 2 + 215: 20(fvec3) FNegate 214 + 216: 118(ptr) AccessChain 107(output) 212 + Store 216 215 + 217: 17(fvec4) Load 183(worldPos) + 218: 10(int) Load 64(InvocationID) + 219: 154(ptr) AccessChain 150 94 94 218 + 220: 121 Load 219 + 221: 17(fvec4) VectorTimesMatrix 217 220 + 222: 174(ptr) AccessChain 107(output) 94 + Store 222 221 + 223: 10(int) Load 64(InvocationID) + 224: 59(ptr) AccessChain 107(output) 117 + Store 224 223 + 225: 10(int) Load 65(PrimitiveID) + 226: 59(ptr) AccessChain 107(output) 170 + Store 226 225 + 232: 174(ptr) AccessChain 107(output) 94 + 233: 17(fvec4) Load 232 + Store 228(outStream.Pos) 233 + 238: 59(ptr) AccessChain 107(output) 117 + 239: 10(int) Load 238 + Store 235(outStream.ViewportIndex) 239 + 243: 59(ptr) AccessChain 107(output) 170 + 244: 10(int) Load 243 + Store 240(outStream.PrimitiveID) 244 + 249: 118(ptr) AccessChain 107(output) 102 + 250: 20(fvec3) Load 249 + Store 246(outStream.Normal) 250 + 254: 118(ptr) AccessChain 107(output) 168 + 255: 20(fvec3) Load 254 + Store 251(outStream.Color) 255 + 259: 118(ptr) AccessChain 107(output) 212 + 260: 20(fvec3) Load 259 + Store 256(outStream.ViewVec) 260 + 264: 118(ptr) AccessChain 107(output) 206 + 265: 20(fvec3) Load 264 + Store 261(outStream.LightVec) 265 + EmitVertex + Branch 99 + 99: Label + 266: 86(int) Load 90(i) + 267: 86(int) IAdd 266 117 + Store 90(i) 267 + 268: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 91 267 75 + Branch 96 + 98: Label + EndPrimitive + Return + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.hlsl.tesc.out b/Test/baseResults/spv.debuginfo.hlsl.tesc.out new file mode 100644 index 000000000..c3f063117 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.hlsl.tesc.out @@ -0,0 +1,812 @@ +spv.debuginfo.hlsl.tesc +WARNING: 0:158: '' : attribute does not apply to entry point + +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 596 + + Capability Tessellation + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 5 "main" 488 495 502 536 545 552 559 574 589 + ExecutionMode 5 OutputVertices 4 + ExecutionMode 5 Quads + ExecutionMode 5 SpacingEqual + ExecutionMode 5 VertexOrderCw + 9: String "float" + 12: String "uint" + 26: String "screenSpaceTessFactor" + 29: String "" + 37: String "p0" + 41: String "p1" + 48: String "bool" + 55: String "frustumCheck" + 61: String "Pos" + 64: String "inUV" + 73: String "Normal" + 77: String "UV" + 81: String "VSOutput" + 91: String "TessLevelOuter" + 95: String "TessLevelInner" + 98: String "ConstantsHSOutput" + 103: String "ConstantsHS" + 109: String "patch" + 120: String "HSOutput" + 126: String "@main" + 134: String "InvocationID" + 139: String "midPoint" + 150: String "radius" + 160: String "v0" + 170: String "modelview" + 175: String "lightPos" + 179: String "frustumPlanes" + 182: String "tessellatedEdgeSize" + 186: String "viewportDim" + 190: String "UBO" + 193: String "ubo" + 201: String "int" + 212: String "clip0" + 229: String "clip1" + 294: String "pos" + 300: String "type.2d.image" + 302: String "@type.2d.image" + 307: String "textureHeight" + 311: String "type.sampler" + 312: String "@type.sampler" + 316: String "samplerHeight" + 320: String "type.sampled.image" + 321: String "@type.sampled.image" + 337: String "i" + 374: String "output" + Name 5 "main" + Name 25 "screenSpaceTessFactor(vf4;vf4;" + Name 23 "p0" + Name 24 "p1" + Name 54 "frustumCheck(vf4;vf2;" + Name 52 "Pos" + Name 53 "inUV" + Name 68 "VSOutput" + MemberName 68(VSOutput) 0 "Pos" + MemberName 68(VSOutput) 1 "Normal" + MemberName 68(VSOutput) 2 "UV" + Name 89 "ConstantsHSOutput" + MemberName 89(ConstantsHSOutput) 0 "TessLevelOuter" + MemberName 89(ConstantsHSOutput) 1 "TessLevelInner" + Name 102 "ConstantsHS(struct-VSOutput-vf4-vf3-vf21[4];" + Name 101 "patch" + Name 112 "HSOutput" + MemberName 112(HSOutput) 0 "Pos" + MemberName 112(HSOutput) 1 "Normal" + MemberName 112(HSOutput) 2 "UV" + Name 125 "@main(struct-VSOutput-vf4-vf3-vf21[4];u1;" + Name 123 "patch" + Name 124 "InvocationID" + Name 137 "midPoint" + Name 148 "radius" + Name 158 "v0" + Name 168 "UBO" + MemberName 168(UBO) 0 "projection" + MemberName 168(UBO) 1 "modelview" + MemberName 168(UBO) 2 "lightPos" + MemberName 168(UBO) 3 "frustumPlanes" + MemberName 168(UBO) 4 "displacementFactor" + MemberName 168(UBO) 5 "tessellationFactor" + MemberName 168(UBO) 6 "viewportDim" + MemberName 168(UBO) 7 "tessellatedEdgeSize" + Name 191 "ubo" + MemberName 191(ubo) 0 "ubo" + Name 197 "" + Name 210 "clip0" + Name 227 "clip1" + Name 292 "pos" + Name 305 "textureHeight" + Name 314 "samplerHeight" + Name 335 "i" + Name 372 "output" + Name 381 "param" + Name 384 "param" + Name 406 "param" + Name 409 "param" + Name 414 "param" + Name 417 "param" + Name 422 "param" + Name 425 "param" + Name 430 "param" + Name 433 "param" + Name 462 "output" + Name 485 "patch" + Name 488 "patch.Pos" + Name 495 "patch.Normal" + Name 502 "patch.UV" + Name 534 "InvocationID" + Name 536 "InvocationID" + Name 538 "flattenTemp" + Name 539 "param" + Name 541 "param" + Name 545 "@entryPointOutput.Pos" + Name 552 "@entryPointOutput.Normal" + Name 559 "@entryPointOutput.UV" + Name 569 "@patchConstantResult" + Name 570 "param" + Name 574 "@patchConstantOutput.TessLevelOuter" + Name 589 "@patchConstantOutput.TessLevelInner" + Decorate 166 ArrayStride 16 + MemberDecorate 168(UBO) 0 RowMajor + MemberDecorate 168(UBO) 0 Offset 0 + MemberDecorate 168(UBO) 0 MatrixStride 16 + MemberDecorate 168(UBO) 1 RowMajor + MemberDecorate 168(UBO) 1 Offset 64 + MemberDecorate 168(UBO) 1 MatrixStride 16 + MemberDecorate 168(UBO) 2 Offset 128 + MemberDecorate 168(UBO) 3 Offset 144 + MemberDecorate 168(UBO) 4 Offset 240 + MemberDecorate 168(UBO) 5 Offset 244 + MemberDecorate 168(UBO) 6 Offset 248 + MemberDecorate 168(UBO) 7 Offset 256 + MemberDecorate 191(ubo) 0 Offset 0 + Decorate 191(ubo) Block + Decorate 197 DescriptorSet 0 + Decorate 197 Binding 0 + Decorate 305(textureHeight) DescriptorSet 0 + Decorate 305(textureHeight) Binding 1 + Decorate 314(samplerHeight) DescriptorSet 0 + Decorate 314(samplerHeight) Binding 1 + Decorate 488(patch.Pos) BuiltIn Position + Decorate 495(patch.Normal) Location 0 + Decorate 502(patch.UV) Location 1 + Decorate 536(InvocationID) BuiltIn InvocationId + Decorate 545(@entryPointOutput.Pos) BuiltIn Position + Decorate 552(@entryPointOutput.Normal) Location 0 + Decorate 559(@entryPointOutput.UV) Location 1 + Decorate 574(@patchConstantOutput.TessLevelOuter) Patch + Decorate 574(@patchConstantOutput.TessLevelOuter) BuiltIn TessLevelOuter + Decorate 589(@patchConstantOutput.TessLevelInner) Patch + Decorate 589(@patchConstantOutput.TessLevelInner) BuiltIn TessLevelInner + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 10: TypeInt 32 0 + 13: 10(int) Constant 32 + 14: 10(int) Constant 6 + 15: 10(int) Constant 0 + 11: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 12 13 14 15 + 16: 10(int) Constant 3 + 8: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 9 13 16 15 + 17: TypeVector 7(float) 4 + 18: 10(int) Constant 4 + 19: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 18 + 20: TypePointer Function 17(fvec4) + 21: TypeFunction 7(float) 20(ptr) 20(ptr) + 22: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 8 19 19 + 28: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 29 + 31: 10(int) Constant 1 + 32: 10(int) Constant 5 + 30: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 31 18 28 32 + 27: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 26 22 28 15 15 30 26 16 15 + 36: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 37 19 28 15 15 27 18 31 + 39: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 42: 10(int) Constant 2 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 41 19 28 15 15 27 18 42 + 44: TypeVector 7(float) 2 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 42 + 46: TypePointer Function 44(fvec2) + 47: TypeBool + 49: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 50: TypeFunction 47(bool) 20(ptr) 46(ptr) + 51: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 49 19 45 + 56: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 55 51 28 15 15 30 55 16 15 + 60: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 61 19 28 15 15 56 18 31 + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 64 45 28 15 15 56 18 42 + 66: TypeVector 7(float) 3 + 67: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 16 + 68(VSOutput): TypeStruct 17(fvec4) 66(fvec3) 44(fvec2) + 70: 10(int) Constant 44 + 71: 10(int) Constant 13 + 69: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 61 19 28 70 71 15 15 16 + 74: 10(int) Constant 45 + 75: 10(int) Constant 35 + 72: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 73 67 28 74 75 15 15 16 + 78: 10(int) Constant 46 + 79: 10(int) Constant 31 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 77 45 28 78 79 15 15 16 + 80: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 81 31 28 15 15 30 81 15 16 69 72 76 + 82: TypeArray 68(VSOutput) 18 + 83: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 80 18 + 84: TypePointer Function 82 + 85: TypeArray 7(float) 18 + 86: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 8 18 + 87: TypeArray 7(float) 42 + 88: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 8 42 +89(ConstantsHSOutput): TypeStruct 85 87 + 92: 10(int) Constant 58 + 93: 10(int) Constant 25 + 90: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 91 86 28 92 93 15 15 16 + 96: 10(int) Constant 59 + 94: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 95 88 28 96 93 15 15 16 + 97: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 98 31 28 15 15 30 98 15 16 90 94 + 99: TypeFunction 89(ConstantsHSOutput) 84(ptr) + 100: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 97 83 + 104: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 103 100 28 15 15 30 103 16 15 + 108: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 109 83 28 15 15 104 18 31 + 111: TypePointer Function 10(int) + 112(HSOutput): TypeStruct 17(fvec4) 66(fvec3) 44(fvec2) + 114: 10(int) Constant 51 + 113: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 61 19 28 114 13 15 15 16 + 116: 10(int) Constant 52 + 115: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 73 67 28 116 75 15 15 16 + 118: 10(int) Constant 53 + 117: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 77 45 28 118 79 15 15 16 + 119: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 120 31 28 15 15 30 120 15 16 113 115 117 + 121: TypeFunction 112(HSOutput) 84(ptr) 111(ptr) + 122: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 119 83 11 + 127: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 126 122 28 15 15 30 126 16 15 + 131: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 109 83 28 15 15 127 18 31 + 133: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 134 11 28 15 15 127 18 42 + 140: 10(int) Constant 67 + 138: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 139 19 28 140 15 27 18 + 141: 7(float) Constant 1056964608 + 147: TypePointer Function 7(float) + 151: 10(int) Constant 69 + 149: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 150 8 28 151 15 27 18 + 155: 7(float) Constant 1073741824 + 161: 10(int) Constant 72 + 159: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 160 19 28 161 15 27 18 + 163: TypeMatrix 17(fvec4) 4 + 165: 47(bool) ConstantTrue + 164: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 19 18 165 + 166: TypeArray 17(fvec4) 14 + 167: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 19 14 + 168(UBO): TypeStruct 163 163 17(fvec4) 166 7(float) 7(float) 44(fvec2) 7(float) + 171: 10(int) Constant 29 + 172: 10(int) Constant 20 + 169: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 170 164 28 171 172 15 15 16 + 173: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 170 164 28 171 172 15 15 16 + 176: 10(int) Constant 30 + 177: 10(int) Constant 17 + 174: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 175 19 28 176 177 15 15 16 + 180: 10(int) Constant 22 + 178: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 179 167 28 79 180 15 15 16 + 183: 10(int) Constant 27 + 181: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 182 8 28 75 183 15 15 16 + 184: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 182 8 28 75 183 15 15 16 + 187: 10(int) Constant 34 + 185: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 186 45 28 187 172 15 15 16 + 188: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 182 8 28 75 183 15 15 16 + 189: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 190 31 28 161 15 30 190 15 16 169 173 174 178 181 184 185 188 + 191(ubo): TypeStruct 168(UBO) + 194: 10(int) Constant 37 + 192: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 193 189 28 194 194 15 15 16 + 195: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 193 31 28 161 15 30 193 15 16 192 + 196: TypePointer Uniform 191(ubo) + 197: 196(ptr) Variable Uniform + 199: 10(int) Constant 8 + 198: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 29 195 28 161 15 30 29 197 199 + 200: TypeInt 32 1 + 202: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 201 13 18 15 + 203: 200(int) Constant 0 + 204: 200(int) Constant 1 + 205: TypePointer Uniform 163 + 213: 10(int) Constant 75 + 211: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 212 19 28 213 15 27 18 + 216: 7(float) Constant 0 + 217: 66(fvec3) ConstantComposite 216 216 216 + 230: 10(int) Constant 76 + 228: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 229 19 28 230 15 27 18 + 254: 200(int) Constant 6 + 255: TypePointer Uniform 44(fvec2) + 277: 200(int) Constant 7 + 278: TypePointer Uniform 7(float) + 282: 200(int) Constant 5 + 286: 7(float) Constant 1065353216 + 287: 7(float) Constant 1115684864 + 295: 10(int) Constant 98 + 293: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 294 19 28 295 15 56 18 + 298: TypeImage 7(float) 2D sampled format:Unknown + 301: 10(int) Constant 99 + 303: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 0(Unknown) + 299: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 300 15 28 301 15 30 302 303 16 + 304: TypePointer UniformConstant 298 +305(textureHeight): 304(ptr) Variable UniformConstant + 306: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 307 299 28 301 15 30 307 305(textureHeight) 199 + 309: TypeSampler + 310: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 311 31 28 301 15 30 312 303 16 + 313: TypePointer UniformConstant 309 +314(samplerHeight): 313(ptr) Variable UniformConstant + 315: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 316 310 28 301 15 30 316 314(samplerHeight) 199 + 318: TypeSampledImage 298 + 319: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 320 15 28 301 15 30 321 303 16 + 326: 200(int) Constant 4 + 334: TypePointer Function 200(int) + 338: 10(int) Constant 102 + 336: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 337 202 28 338 15 56 18 + 346: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 349: 200(int) Constant 3 + 351: TypePointer Uniform 17(fvec4) + 355: 7(float) Constant 1090519040 + 357: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 361: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 362: 47(bool) ConstantFalse + 367: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 371: TypePointer Function 89(ConstantsHSOutput) + 375: 10(int) Constant 113 + 373: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 374 97 28 375 15 104 18 + 376: 85 ConstantComposite 216 216 216 216 + 377: 87 ConstantComposite 216 216 + 378:89(ConstantsHSOutput) ConstantComposite 376 377 + 380: 200(int) Constant 2 + 388: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 389: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 402: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 48 13 42 15 + 461: TypePointer Function 112(HSOutput) + 464: 10(int) Constant 159 + 463: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 374 119 28 464 15 127 18 + 465: 17(fvec4) ConstantComposite 216 216 216 216 + 466: 44(fvec2) ConstantComposite 216 216 + 467:112(HSOutput) ConstantComposite 465 217 466 + 474: TypePointer Function 66(fvec3) + 486: TypeArray 17(fvec4) 18 + 487: TypePointer Input 486 + 488(patch.Pos): 487(ptr) Variable Input + 489: TypePointer Input 17(fvec4) + 493: TypeArray 66(fvec3) 18 + 494: TypePointer Input 493 +495(patch.Normal): 494(ptr) Variable Input + 496: TypePointer Input 66(fvec3) + 500: TypeArray 44(fvec2) 18 + 501: TypePointer Input 500 + 502(patch.UV): 501(ptr) Variable Input + 503: TypePointer Input 44(fvec2) + 535: TypePointer Input 10(int) +536(InvocationID): 535(ptr) Variable Input + 544: TypePointer Output 486 +545(@entryPointOutput.Pos): 544(ptr) Variable Output + 549: TypePointer Output 17(fvec4) + 551: TypePointer Output 493 +552(@entryPointOutput.Normal): 551(ptr) Variable Output + 556: TypePointer Output 66(fvec3) + 558: TypePointer Output 500 +559(@entryPointOutput.UV): 558(ptr) Variable Output + 563: TypePointer Output 44(fvec2) + 573: TypePointer Output 85 +574(@patchConstantOutput.TessLevelOuter): 573(ptr) Variable Output + 577: TypePointer Output 7(float) + 588: TypePointer Output 87 +589(@patchConstantOutput.TessLevelInner): 588(ptr) Variable Output + 5(main): 3 Function None 4 + 6: Label + 485(patch): 84(ptr) Variable Function +534(InvocationID): 111(ptr) Variable Function +538(flattenTemp): 461(ptr) Variable Function + 539(param): 84(ptr) Variable Function + 541(param): 111(ptr) Variable Function +569(@patchConstantResult): 371(ptr) Variable Function + 570(param): 84(ptr) Variable Function + 490: 489(ptr) AccessChain 488(patch.Pos) 203 + 491: 17(fvec4) Load 490 + 492: 20(ptr) AccessChain 485(patch) 203 203 + Store 492 491 + 497: 496(ptr) AccessChain 495(patch.Normal) 203 + 498: 66(fvec3) Load 497 + 499: 474(ptr) AccessChain 485(patch) 203 204 + Store 499 498 + 504: 503(ptr) AccessChain 502(patch.UV) 203 + 505: 44(fvec2) Load 504 + 506: 46(ptr) AccessChain 485(patch) 203 380 + Store 506 505 + 507: 489(ptr) AccessChain 488(patch.Pos) 204 + 508: 17(fvec4) Load 507 + 509: 20(ptr) AccessChain 485(patch) 204 203 + Store 509 508 + 510: 496(ptr) AccessChain 495(patch.Normal) 204 + 511: 66(fvec3) Load 510 + 512: 474(ptr) AccessChain 485(patch) 204 204 + Store 512 511 + 513: 503(ptr) AccessChain 502(patch.UV) 204 + 514: 44(fvec2) Load 513 + 515: 46(ptr) AccessChain 485(patch) 204 380 + Store 515 514 + 516: 489(ptr) AccessChain 488(patch.Pos) 380 + 517: 17(fvec4) Load 516 + 518: 20(ptr) AccessChain 485(patch) 380 203 + Store 518 517 + 519: 496(ptr) AccessChain 495(patch.Normal) 380 + 520: 66(fvec3) Load 519 + 521: 474(ptr) AccessChain 485(patch) 380 204 + Store 521 520 + 522: 503(ptr) AccessChain 502(patch.UV) 380 + 523: 44(fvec2) Load 522 + 524: 46(ptr) AccessChain 485(patch) 380 380 + Store 524 523 + 525: 489(ptr) AccessChain 488(patch.Pos) 349 + 526: 17(fvec4) Load 525 + 527: 20(ptr) AccessChain 485(patch) 349 203 + Store 527 526 + 528: 496(ptr) AccessChain 495(patch.Normal) 349 + 529: 66(fvec3) Load 528 + 530: 474(ptr) AccessChain 485(patch) 349 204 + Store 530 529 + 531: 503(ptr) AccessChain 502(patch.UV) 349 + 532: 44(fvec2) Load 531 + 533: 46(ptr) AccessChain 485(patch) 349 380 + Store 533 532 + 537: 10(int) Load 536(InvocationID) + Store 534(InvocationID) 537 + 540: 82 Load 485(patch) + Store 539(param) 540 + 542: 10(int) Load 534(InvocationID) + Store 541(param) 542 + 543:112(HSOutput) FunctionCall 125(@main(struct-VSOutput-vf4-vf3-vf21[4];u1;) 539(param) 541(param) + Store 538(flattenTemp) 543 + 546: 10(int) Load 536(InvocationID) + 547: 20(ptr) AccessChain 538(flattenTemp) 203 + 548: 17(fvec4) Load 547 + 550: 549(ptr) AccessChain 545(@entryPointOutput.Pos) 546 + Store 550 548 + 553: 10(int) Load 536(InvocationID) + 554: 474(ptr) AccessChain 538(flattenTemp) 204 + 555: 66(fvec3) Load 554 + 557: 556(ptr) AccessChain 552(@entryPointOutput.Normal) 553 + Store 557 555 + 560: 10(int) Load 536(InvocationID) + 561: 46(ptr) AccessChain 538(flattenTemp) 380 + 562: 44(fvec2) Load 561 + 564: 563(ptr) AccessChain 559(@entryPointOutput.UV) 560 + Store 564 562 + ControlBarrier 42 18 15 + 565: 10(int) Load 536(InvocationID) + 566: 47(bool) IEqual 565 203 + SelectionMerge 568 None + BranchConditional 566 567 568 + 567: Label + 571: 82 Load 485(patch) + Store 570(param) 571 + 572:89(ConstantsHSOutput) FunctionCall 102(ConstantsHS(struct-VSOutput-vf4-vf3-vf21[4];) 570(param) + Store 569(@patchConstantResult) 572 + 575: 147(ptr) AccessChain 569(@patchConstantResult) 203 203 + 576: 7(float) Load 575 + 578: 577(ptr) AccessChain 574(@patchConstantOutput.TessLevelOuter) 203 + Store 578 576 + 579: 147(ptr) AccessChain 569(@patchConstantResult) 203 204 + 580: 7(float) Load 579 + 581: 577(ptr) AccessChain 574(@patchConstantOutput.TessLevelOuter) 204 + Store 581 580 + 582: 147(ptr) AccessChain 569(@patchConstantResult) 203 380 + 583: 7(float) Load 582 + 584: 577(ptr) AccessChain 574(@patchConstantOutput.TessLevelOuter) 380 + Store 584 583 + 585: 147(ptr) AccessChain 569(@patchConstantResult) 203 349 + 586: 7(float) Load 585 + 587: 577(ptr) AccessChain 574(@patchConstantOutput.TessLevelOuter) 349 + Store 587 586 + 590: 147(ptr) AccessChain 569(@patchConstantResult) 204 203 + 591: 7(float) Load 590 + 592: 577(ptr) AccessChain 589(@patchConstantOutput.TessLevelInner) 203 + Store 592 591 + 593: 147(ptr) AccessChain 569(@patchConstantResult) 204 204 + 594: 7(float) Load 593 + 595: 577(ptr) AccessChain 589(@patchConstantOutput.TessLevelInner) 204 + Store 595 594 + Branch 568 + 568: Label + Return + FunctionEnd +25(screenSpaceTessFactor(vf4;vf4;): 7(float) Function None 21 + 23(p0): 20(ptr) FunctionParameter + 24(p1): 20(ptr) FunctionParameter + 33: Label + 137(midPoint): 20(ptr) Variable Function + 148(radius): 147(ptr) Variable Function + 158(v0): 20(ptr) Variable Function + 210(clip0): 20(ptr) Variable Function + 227(clip1): 20(ptr) Variable Function + 34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 27 + 35: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 28 15 15 15 15 + 38: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 36 23(p0) 39 + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 40 24(p1) 39 + 136: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 27 25(screenSpaceTessFactor(vf4;vf4;) + 142: 17(fvec4) Load 23(p0) + 143: 17(fvec4) Load 24(p1) + 144: 17(fvec4) FAdd 142 143 + 145: 17(fvec4) VectorTimesScalar 144 141 + Store 137(midPoint) 145 + 146: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 138 145 39 + 152: 17(fvec4) Load 23(p0) + 153: 17(fvec4) Load 24(p1) + 154: 7(float) ExtInst 2(GLSL.std.450) 67(Distance) 152 153 + 156: 7(float) FDiv 154 155 + Store 148(radius) 156 + 157: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 149 156 39 + 162: 17(fvec4) Load 137(midPoint) + 206: 205(ptr) AccessChain 197 203 204 + 207: 163 Load 206 + 208: 17(fvec4) VectorTimesMatrix 162 207 + Store 158(v0) 208 + 209: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 159 208 39 + 214: 17(fvec4) Load 158(v0) + 215: 7(float) Load 148(radius) + 218: 7(float) CompositeExtract 217 0 + 219: 7(float) CompositeExtract 217 1 + 220: 7(float) CompositeExtract 217 2 + 221: 17(fvec4) CompositeConstruct 215 218 219 220 + 222: 17(fvec4) FSub 214 221 + 223: 205(ptr) AccessChain 197 203 203 + 224: 163 Load 223 + 225: 17(fvec4) VectorTimesMatrix 222 224 + Store 210(clip0) 225 + 226: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 211 225 39 + 231: 17(fvec4) Load 158(v0) + 232: 7(float) Load 148(radius) + 233: 7(float) CompositeExtract 217 0 + 234: 7(float) CompositeExtract 217 1 + 235: 7(float) CompositeExtract 217 2 + 236: 17(fvec4) CompositeConstruct 232 233 234 235 + 237: 17(fvec4) FAdd 231 236 + 238: 205(ptr) AccessChain 197 203 203 + 239: 163 Load 238 + 240: 17(fvec4) VectorTimesMatrix 237 239 + Store 227(clip1) 240 + 241: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 228 240 39 + 242: 147(ptr) AccessChain 210(clip0) 16 + 243: 7(float) Load 242 + 244: 17(fvec4) Load 210(clip0) + 245: 17(fvec4) CompositeConstruct 243 243 243 243 + 246: 17(fvec4) FDiv 244 245 + Store 210(clip0) 246 + 247: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 211 246 39 + 248: 147(ptr) AccessChain 227(clip1) 16 + 249: 7(float) Load 248 + 250: 17(fvec4) Load 227(clip1) + 251: 17(fvec4) CompositeConstruct 249 249 249 249 + 252: 17(fvec4) FDiv 250 251 + Store 227(clip1) 252 + 253: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 228 252 39 + 256: 255(ptr) AccessChain 197 203 254 + 257: 44(fvec2) Load 256 + 258: 17(fvec4) Load 210(clip0) + 259: 44(fvec2) VectorShuffle 258 258 0 1 + 260: 44(fvec2) FMul 259 257 + 261: 147(ptr) AccessChain 210(clip0) 15 + 262: 7(float) CompositeExtract 260 0 + Store 261 262 + 263: 147(ptr) AccessChain 210(clip0) 31 + 264: 7(float) CompositeExtract 260 1 + Store 263 264 + 265: 255(ptr) AccessChain 197 203 254 + 266: 44(fvec2) Load 265 + 267: 17(fvec4) Load 227(clip1) + 268: 44(fvec2) VectorShuffle 267 267 0 1 + 269: 44(fvec2) FMul 268 266 + 270: 147(ptr) AccessChain 227(clip1) 15 + 271: 7(float) CompositeExtract 269 0 + Store 270 271 + 272: 147(ptr) AccessChain 227(clip1) 31 + 273: 7(float) CompositeExtract 269 1 + Store 272 273 + 274: 17(fvec4) Load 210(clip0) + 275: 17(fvec4) Load 227(clip1) + 276: 7(float) ExtInst 2(GLSL.std.450) 67(Distance) 274 275 + 279: 278(ptr) AccessChain 197 203 277 + 280: 7(float) Load 279 + 281: 7(float) FDiv 276 280 + 283: 278(ptr) AccessChain 197 203 282 + 284: 7(float) Load 283 + 285: 7(float) FMul 281 284 + 288: 7(float) ExtInst 2(GLSL.std.450) 43(FClamp) 285 286 287 + ReturnValue 288 + FunctionEnd +54(frustumCheck(vf4;vf2;): 47(bool) Function None 50 + 52(Pos): 20(ptr) FunctionParameter + 53(inUV): 46(ptr) FunctionParameter + 57: Label + 292(pos): 20(ptr) Variable Function + 335(i): 334(ptr) Variable Function + 58: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 56 + 59: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 28 15 15 15 15 + 62: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 60 52(Pos) 39 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 63 53(inUV) 39 + 291: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 56 54(frustumCheck(vf4;vf2;) + 296: 17(fvec4) Load 52(Pos) + Store 292(pos) 296 + 297: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 293 296 39 + 308: 298 Load 305(textureHeight) + 317: 309 Load 314(samplerHeight) + 322: 318 SampledImage 308 317 + 323: 44(fvec2) Load 53(inUV) + 324: 17(fvec4) ImageSampleExplicitLod 322 323 Lod 216 + 325: 7(float) CompositeExtract 324 0 + 327: 278(ptr) AccessChain 197 203 326 + 328: 7(float) Load 327 + 329: 7(float) FMul 325 328 + 330: 147(ptr) AccessChain 292(pos) 31 + 331: 7(float) Load 330 + 332: 7(float) FSub 331 329 + 333: 147(ptr) AccessChain 292(pos) 31 + Store 333 332 + Store 335(i) 203 + 339: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 336 203 39 + Branch 340 + 340: Label + LoopMerge 342 343 None + Branch 344 + 344: Label + 345: 200(int) Load 335(i) + 347: 47(bool) SLessThan 345 254 + BranchConditional 347 341 342 + 341: Label + 348: 17(fvec4) Load 292(pos) + 350: 200(int) Load 335(i) + 352: 351(ptr) AccessChain 197 203 349 350 + 353: 17(fvec4) Load 352 + 354: 7(float) Dot 348 353 + 356: 7(float) FAdd 354 355 + 358: 47(bool) FOrdLessThan 356 216 + SelectionMerge 360 None + BranchConditional 358 359 360 + 359: Label + ReturnValue 362 + 360: Label + Branch 343 + 343: Label + 364: 200(int) Load 335(i) + 365: 200(int) IAdd 364 204 + Store 335(i) 365 + 366: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 336 365 39 + Branch 340 + 342: Label + ReturnValue 165 + FunctionEnd +102(ConstantsHS(struct-VSOutput-vf4-vf3-vf21[4];):89(ConstantsHSOutput) Function None 99 + 101(patch): 84(ptr) FunctionParameter + 105: Label + 372(output): 371(ptr) Variable Function + 381(param): 20(ptr) Variable Function + 384(param): 46(ptr) Variable Function + 406(param): 20(ptr) Variable Function + 409(param): 20(ptr) Variable Function + 414(param): 20(ptr) Variable Function + 417(param): 20(ptr) Variable Function + 422(param): 20(ptr) Variable Function + 425(param): 20(ptr) Variable Function + 430(param): 20(ptr) Variable Function + 433(param): 20(ptr) Variable Function + 106: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 104 + 107: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 28 15 15 15 15 + 110: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 108 101(patch) 39 + 370: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 104 102(ConstantsHS(struct-VSOutput-vf4-vf3-vf21[4];) + Store 372(output) 378 + 379: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 373 378 39 + 382: 20(ptr) AccessChain 101(patch) 203 203 + 383: 17(fvec4) Load 382 + Store 381(param) 383 + 385: 46(ptr) AccessChain 101(patch) 203 380 + 386: 44(fvec2) Load 385 + Store 384(param) 386 + 387: 47(bool) FunctionCall 54(frustumCheck(vf4;vf2;) 381(param) 384(param) + 390: 47(bool) LogicalNot 387 + SelectionMerge 392 None + BranchConditional 390 391 399 + 391: Label + 393: 147(ptr) AccessChain 372(output) 204 203 + Store 393 216 + 394: 147(ptr) AccessChain 372(output) 204 204 + Store 394 216 + 395: 147(ptr) AccessChain 372(output) 203 203 + Store 395 216 + 396: 147(ptr) AccessChain 372(output) 203 204 + Store 396 216 + 397: 147(ptr) AccessChain 372(output) 203 380 + Store 397 216 + 398: 147(ptr) AccessChain 372(output) 203 349 + Store 398 216 + Branch 392 + 399: Label + 400: 278(ptr) AccessChain 197 203 282 + 401: 7(float) Load 400 + 403: 47(bool) FOrdGreaterThan 401 216 + SelectionMerge 405 None + BranchConditional 403 404 450 + 404: Label + 407: 20(ptr) AccessChain 101(patch) 349 203 + 408: 17(fvec4) Load 407 + Store 406(param) 408 + 410: 20(ptr) AccessChain 101(patch) 203 203 + 411: 17(fvec4) Load 410 + Store 409(param) 411 + 412: 7(float) FunctionCall 25(screenSpaceTessFactor(vf4;vf4;) 406(param) 409(param) + 413: 147(ptr) AccessChain 372(output) 203 203 + Store 413 412 + 415: 20(ptr) AccessChain 101(patch) 203 203 + 416: 17(fvec4) Load 415 + Store 414(param) 416 + 418: 20(ptr) AccessChain 101(patch) 204 203 + 419: 17(fvec4) Load 418 + Store 417(param) 419 + 420: 7(float) FunctionCall 25(screenSpaceTessFactor(vf4;vf4;) 414(param) 417(param) + 421: 147(ptr) AccessChain 372(output) 203 204 + Store 421 420 + 423: 20(ptr) AccessChain 101(patch) 204 203 + 424: 17(fvec4) Load 423 + Store 422(param) 424 + 426: 20(ptr) AccessChain 101(patch) 380 203 + 427: 17(fvec4) Load 426 + Store 425(param) 427 + 428: 7(float) FunctionCall 25(screenSpaceTessFactor(vf4;vf4;) 422(param) 425(param) + 429: 147(ptr) AccessChain 372(output) 203 380 + Store 429 428 + 431: 20(ptr) AccessChain 101(patch) 380 203 + 432: 17(fvec4) Load 431 + Store 430(param) 432 + 434: 20(ptr) AccessChain 101(patch) 349 203 + 435: 17(fvec4) Load 434 + Store 433(param) 435 + 436: 7(float) FunctionCall 25(screenSpaceTessFactor(vf4;vf4;) 430(param) 433(param) + 437: 147(ptr) AccessChain 372(output) 203 349 + Store 437 436 + 438: 147(ptr) AccessChain 372(output) 203 203 + 439: 7(float) Load 438 + 440: 147(ptr) AccessChain 372(output) 203 349 + 441: 7(float) Load 440 + 442: 7(float) ExtInst 2(GLSL.std.450) 46(FMix) 439 441 141 + 443: 147(ptr) AccessChain 372(output) 204 203 + Store 443 442 + 444: 147(ptr) AccessChain 372(output) 203 380 + 445: 7(float) Load 444 + 446: 147(ptr) AccessChain 372(output) 203 204 + 447: 7(float) Load 446 + 448: 7(float) ExtInst 2(GLSL.std.450) 46(FMix) 445 447 141 + 449: 147(ptr) AccessChain 372(output) 204 204 + Store 449 448 + Branch 405 + 450: Label + 451: 147(ptr) AccessChain 372(output) 204 203 + Store 451 286 + 452: 147(ptr) AccessChain 372(output) 204 204 + Store 452 286 + 453: 147(ptr) AccessChain 372(output) 203 203 + Store 453 286 + 454: 147(ptr) AccessChain 372(output) 203 204 + Store 454 286 + 455: 147(ptr) AccessChain 372(output) 203 380 + Store 455 286 + 456: 147(ptr) AccessChain 372(output) 203 349 + Store 456 286 + Branch 405 + 405: Label + Branch 392 + 392: Label + 457:89(ConstantsHSOutput) Load 372(output) + ReturnValue 457 + FunctionEnd +125(@main(struct-VSOutput-vf4-vf3-vf21[4];u1;):112(HSOutput) Function None 121 + 123(patch): 84(ptr) FunctionParameter +124(InvocationID): 111(ptr) FunctionParameter + 128: Label + 462(output): 461(ptr) Variable Function + 129: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 127 + 130: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 28 15 15 15 15 + 132: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 131 123(patch) 39 + 135: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 133 124(InvocationID) 39 + 460: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 127 125(@main(struct-VSOutput-vf4-vf3-vf21[4];u1;) + Store 462(output) 467 + 468: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 463 467 39 + 469: 10(int) Load 124(InvocationID) + 470: 20(ptr) AccessChain 123(patch) 469 203 + 471: 17(fvec4) Load 470 + 472: 20(ptr) AccessChain 462(output) 203 + Store 472 471 + 473: 10(int) Load 124(InvocationID) + 475: 474(ptr) AccessChain 123(patch) 473 204 + 476: 66(fvec3) Load 475 + 477: 474(ptr) AccessChain 462(output) 204 + Store 477 476 + 478: 10(int) Load 124(InvocationID) + 479: 46(ptr) AccessChain 123(patch) 478 380 + 480: 44(fvec2) Load 479 + 481: 46(ptr) AccessChain 462(output) 380 + Store 481 480 + 482:112(HSOutput) Load 462(output) + ReturnValue 482 + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.hlsl.tese.out b/Test/baseResults/spv.debuginfo.hlsl.tese.out new file mode 100644 index 000000000..216dd8238 --- /dev/null +++ b/Test/baseResults/spv.debuginfo.hlsl.tese.out @@ -0,0 +1,589 @@ +spv.debuginfo.hlsl.tese +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 434 + + Capability Tessellation + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 5 "main" 325 340 349 358 365 371 411 415 419 422 425 428 431 + ExecutionMode 5 Quads + 9: String "float" + 12: String "uint" + 25: String "TessLevelOuter" + 27: String "" + 31: String "TessLevelInner" + 34: String "ConstantsHSOutput" + 48: String "Pos" + 51: String "Normal" + 55: String "UV" + 59: String "HSOutput" + 67: String "WorldPos" + 77: String "DSOutput" + 84: String "@main" + 90: String "input" + 94: String "TessCoord" + 97: String "patch" + 103: String "output" + 113: String "uv1" + 116: String "int" + 131: String "uv2" + 151: String "n1" + 162: String "n2" + 181: String "pos1" + 192: String "pos2" + 203: String "pos" + 214: String "type.2d.image" + 216: String "@type.2d.image" + 221: String "displacementMapTexture" + 226: String "type.sampler" + 227: String "@type.sampler" + 231: String "displacementMapSampler" + 235: String "type.sampled.image" + 236: String "@type.sampled.image" + 250: String "modelview" + 255: String "lightPos" + 259: String "frustumPlanes" + 262: String "tessellatedEdgeSize" + 266: String "viewportDim" + 270: String "UBO" + 273: String "ubo" + Name 5 "main" + Name 23 "ConstantsHSOutput" + MemberName 23(ConstantsHSOutput) 0 "TessLevelOuter" + MemberName 23(ConstantsHSOutput) 1 "TessLevelInner" + Name 46 "HSOutput" + MemberName 46(HSOutput) 0 "Pos" + MemberName 46(HSOutput) 1 "Normal" + MemberName 46(HSOutput) 2 "UV" + Name 62 "DSOutput" + MemberName 62(DSOutput) 0 "Pos" + MemberName 62(DSOutput) 1 "Normal" + MemberName 62(DSOutput) 2 "UV" + MemberName 62(DSOutput) 3 "ViewVec" + MemberName 62(DSOutput) 4 "LightVec" + MemberName 62(DSOutput) 5 "EyePos" + MemberName 62(DSOutput) 6 "WorldPos" + Name 83 "@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];" + Name 80 "input" + Name 81 "TessCoord" + Name 82 "patch" + Name 101 "output" + Name 111 "uv1" + Name 129 "uv2" + Name 149 "n1" + Name 160 "n2" + Name 179 "pos1" + Name 190 "pos2" + Name 201 "pos" + Name 219 "displacementMapTexture" + Name 229 "displacementMapSampler" + Name 248 "UBO" + MemberName 248(UBO) 0 "projection" + MemberName 248(UBO) 1 "modelview" + MemberName 248(UBO) 2 "lightPos" + MemberName 248(UBO) 3 "frustumPlanes" + MemberName 248(UBO) 4 "displacementFactor" + MemberName 248(UBO) 5 "tessellationFactor" + MemberName 248(UBO) 6 "viewportDim" + MemberName 248(UBO) 7 "tessellatedEdgeSize" + Name 271 "ubo" + MemberName 271(ubo) 0 "ubo" + Name 276 "" + Name 323 "input" + Name 325 "input.TessLevelOuter" + Name 340 "input.TessLevelInner" + Name 347 "TessCoord" + Name 349 "TessCoord" + Name 355 "patch" + Name 358 "patch.Pos" + Name 365 "patch.Normal" + Name 371 "patch.UV" + Name 403 "flattenTemp" + Name 405 "param" + Name 407 "param" + Name 411 "@entryPointOutput.Pos" + Name 415 "@entryPointOutput.Normal" + Name 419 "@entryPointOutput.UV" + Name 422 "@entryPointOutput.ViewVec" + Name 425 "@entryPointOutput.LightVec" + Name 428 "@entryPointOutput.EyePos" + Name 431 "@entryPointOutput.WorldPos" + Decorate 219(displacementMapTexture) DescriptorSet 0 + Decorate 219(displacementMapTexture) Binding 1 + Decorate 229(displacementMapSampler) DescriptorSet 0 + Decorate 229(displacementMapSampler) Binding 1 + Decorate 246 ArrayStride 16 + MemberDecorate 248(UBO) 0 RowMajor + MemberDecorate 248(UBO) 0 Offset 0 + MemberDecorate 248(UBO) 0 MatrixStride 16 + MemberDecorate 248(UBO) 1 RowMajor + MemberDecorate 248(UBO) 1 Offset 64 + MemberDecorate 248(UBO) 1 MatrixStride 16 + MemberDecorate 248(UBO) 2 Offset 128 + MemberDecorate 248(UBO) 3 Offset 144 + MemberDecorate 248(UBO) 4 Offset 240 + MemberDecorate 248(UBO) 5 Offset 244 + MemberDecorate 248(UBO) 6 Offset 248 + MemberDecorate 248(UBO) 7 Offset 256 + MemberDecorate 271(ubo) 0 Offset 0 + Decorate 271(ubo) Block + Decorate 276 DescriptorSet 0 + Decorate 276 Binding 0 + Decorate 325(input.TessLevelOuter) Patch + Decorate 325(input.TessLevelOuter) BuiltIn TessLevelOuter + Decorate 340(input.TessLevelInner) Patch + Decorate 340(input.TessLevelInner) BuiltIn TessLevelInner + Decorate 349(TessCoord) Patch + Decorate 349(TessCoord) BuiltIn TessCoord + Decorate 358(patch.Pos) BuiltIn Position + Decorate 365(patch.Normal) Location 0 + Decorate 371(patch.UV) Location 1 + Decorate 411(@entryPointOutput.Pos) BuiltIn Position + Decorate 415(@entryPointOutput.Normal) Location 0 + Decorate 419(@entryPointOutput.UV) Location 1 + Decorate 422(@entryPointOutput.ViewVec) Location 2 + Decorate 425(@entryPointOutput.LightVec) Location 3 + Decorate 428(@entryPointOutput.EyePos) Location 4 + Decorate 431(@entryPointOutput.WorldPos) Location 5 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 10: TypeInt 32 0 + 13: 10(int) Constant 32 + 14: 10(int) Constant 6 + 15: 10(int) Constant 0 + 11: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 12 13 14 15 + 16: 10(int) Constant 3 + 8: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 9 13 16 15 + 17: 10(int) Constant 4 + 18: TypeArray 7(float) 17 + 19: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 8 17 + 20: 10(int) Constant 2 + 21: TypeArray 7(float) 20 + 22: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 8 20 +23(ConstantsHSOutput): TypeStruct 18 21 + 26: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 27 + 28: 10(int) Constant 51 + 29: 10(int) Constant 25 + 24: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 25 19 26 28 29 15 15 16 + 32: 10(int) Constant 52 + 30: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 31 22 26 32 29 15 15 16 + 35: 10(int) Constant 1 + 37: 10(int) Constant 5 + 36: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 35 17 26 37 + 33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 34 35 26 15 15 36 34 15 16 24 30 + 38: TypePointer Function 23(ConstantsHSOutput) + 39: TypeVector 7(float) 2 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 20 + 41: TypePointer Function 39(fvec2) + 42: TypeVector 7(float) 4 + 43: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 17 + 44: TypeVector 7(float) 3 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 16 + 46(HSOutput): TypeStruct 42(fvec4) 44(fvec3) 39(fvec2) + 49: 10(int) Constant 44 + 47: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 48 43 26 49 13 15 15 16 + 52: 10(int) Constant 45 + 53: 10(int) Constant 35 + 50: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 51 45 26 52 53 15 15 16 + 56: 10(int) Constant 46 + 57: 10(int) Constant 31 + 54: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 55 40 26 56 57 15 15 16 + 58: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 59 35 26 15 15 36 59 15 16 47 50 54 + 60: TypeArray 46(HSOutput) 17 + 61: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 58 17 + 62(DSOutput): TypeStruct 42(fvec4) 44(fvec3) 39(fvec2) 44(fvec3) 44(fvec3) 44(fvec3) 44(fvec3) + 64: 10(int) Constant 57 + 65: 10(int) Constant 13 + 63: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 48 43 26 64 65 15 15 16 + 68: 10(int) Constant 63 + 69: 10(int) Constant 37 + 66: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 67 45 26 68 69 15 15 16 + 71: 10(int) Constant 59 + 70: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 55 40 26 71 57 15 15 16 + 72: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 67 45 26 68 69 15 15 16 + 73: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 67 45 26 68 69 15 15 16 + 74: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 67 45 26 68 69 15 15 16 + 75: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 67 45 26 68 69 15 15 16 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 77 35 26 15 15 36 77 15 16 63 66 70 72 73 74 75 + 78: TypeFunction 62(DSOutput) 38(ptr) 41(ptr) 60 + 79: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 76 33 40 58 + 85: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 84 79 26 15 15 36 84 16 15 + 89: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 90 33 26 15 15 85 17 35 + 92: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 93: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 94 40 26 15 15 85 17 20 + 96: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 97 58 26 15 15 85 17 16 + 100: TypePointer Function 62(DSOutput) + 104: 10(int) Constant 70 + 102: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 103 76 26 104 15 85 17 + 105: 7(float) Constant 0 + 106: 42(fvec4) ConstantComposite 105 105 105 105 + 107: 44(fvec3) ConstantComposite 105 105 105 + 108: 39(fvec2) ConstantComposite 105 105 + 109:62(DSOutput) ConstantComposite 106 107 108 107 107 107 107 + 114: 10(int) Constant 71 + 112: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 113 40 26 114 15 85 17 + 115: TypeInt 32 1 + 117: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 116 13 17 15 + 118: 115(int) Constant 0 + 119: 115(int) Constant 2 + 121: 115(int) Constant 1 + 123: TypePointer Function 7(float) + 132: 10(int) Constant 72 + 130: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 131 40 26 132 15 85 17 + 133: 115(int) Constant 3 + 148: TypePointer Function 44(fvec3) + 152: 10(int) Constant 75 + 150: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 151 45 26 152 15 85 17 + 163: 10(int) Constant 76 + 161: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 162 45 26 163 15 85 17 + 178: TypePointer Function 42(fvec4) + 182: 10(int) Constant 80 + 180: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 181 43 26 182 15 85 17 + 193: 10(int) Constant 81 + 191: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 192 43 26 193 15 85 17 + 204: 10(int) Constant 82 + 202: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 203 43 26 204 15 85 17 + 212: TypeImage 7(float) 2D sampled format:Unknown + 215: 10(int) Constant 84 + 217: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 0(Unknown) + 213: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 214 15 26 215 15 36 216 217 16 + 218: TypePointer UniformConstant 212 +219(displacementMapTexture): 218(ptr) Variable UniformConstant + 222: 10(int) Constant 8 + 220: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 221 213 26 215 15 36 221 219(displacementMapTexture) 222 + 224: TypeSampler + 225: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 226 35 26 215 15 36 227 217 16 + 228: TypePointer UniformConstant 224 +229(displacementMapSampler): 228(ptr) Variable UniformConstant + 230: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 231 225 26 215 15 36 231 229(displacementMapSampler) 222 + 233: TypeSampledImage 212 + 234: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 235 15 26 215 15 36 236 217 16 + 242: TypeMatrix 42(fvec4) 4 + 244: TypeBool + 245: 244(bool) ConstantTrue + 243: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 43 17 245 + 246: TypeArray 42(fvec4) 14 + 247: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 5(SAbs) 43 14 + 248(UBO): TypeStruct 242 242 42(fvec4) 246 7(float) 7(float) 39(fvec2) 7(float) + 251: 10(int) Constant 29 + 252: 10(int) Constant 20 + 249: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 250 243 26 251 252 15 15 16 + 253: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 250 243 26 251 252 15 15 16 + 256: 10(int) Constant 30 + 257: 10(int) Constant 17 + 254: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 255 43 26 256 257 15 15 16 + 260: 10(int) Constant 22 + 258: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 259 247 26 57 260 15 15 16 + 263: 10(int) Constant 27 + 261: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 262 8 26 53 263 15 15 16 + 264: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 262 8 26 53 263 15 15 16 + 267: 10(int) Constant 34 + 265: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 266 40 26 267 252 15 15 16 + 268: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 262 8 26 53 263 15 15 16 + 269: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 270 35 26 215 15 36 270 15 16 249 253 254 258 261 264 265 268 + 271(ubo): TypeStruct 248(UBO) + 272: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 273 269 26 69 69 15 15 16 + 274: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 273 35 26 215 15 36 273 15 16 272 + 275: TypePointer Uniform 271(ubo) + 276: 275(ptr) Variable Uniform + 277: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 27 274 26 215 15 36 27 276 222 + 278: 115(int) Constant 4 + 279: TypePointer Uniform 7(float) + 288: TypePointer Uniform 242 + 300: TypePointer Uniform 42(fvec4) + 309: 115(int) Constant 6 + 313: 115(int) Constant 5 + 324: TypePointer Input 18 +325(input.TessLevelOuter): 324(ptr) Variable Input + 326: TypePointer Input 7(float) + 339: TypePointer Input 21 +340(input.TessLevelInner): 339(ptr) Variable Input + 348: TypePointer Input 44(fvec3) + 349(TessCoord): 348(ptr) Variable Input + 354: TypePointer Function 60 + 356: TypeArray 42(fvec4) 17 + 357: TypePointer Input 356 + 358(patch.Pos): 357(ptr) Variable Input + 359: TypePointer Input 42(fvec4) + 363: TypeArray 44(fvec3) 17 + 364: TypePointer Input 363 +365(patch.Normal): 364(ptr) Variable Input + 369: TypeArray 39(fvec2) 17 + 370: TypePointer Input 369 + 371(patch.UV): 370(ptr) Variable Input + 372: TypePointer Input 39(fvec2) + 410: TypePointer Output 42(fvec4) +411(@entryPointOutput.Pos): 410(ptr) Variable Output + 414: TypePointer Output 44(fvec3) +415(@entryPointOutput.Normal): 414(ptr) Variable Output + 418: TypePointer Output 39(fvec2) +419(@entryPointOutput.UV): 418(ptr) Variable Output +422(@entryPointOutput.ViewVec): 414(ptr) Variable Output +425(@entryPointOutput.LightVec): 414(ptr) Variable Output +428(@entryPointOutput.EyePos): 414(ptr) Variable Output +431(@entryPointOutput.WorldPos): 414(ptr) Variable Output + 5(main): 3 Function None 4 + 6: Label + 323(input): 38(ptr) Variable Function + 347(TessCoord): 41(ptr) Variable Function + 355(patch): 354(ptr) Variable Function +403(flattenTemp): 100(ptr) Variable Function + 405(param): 38(ptr) Variable Function + 407(param): 41(ptr) Variable Function + 327: 326(ptr) AccessChain 325(input.TessLevelOuter) 118 + 328: 7(float) Load 327 + 329: 123(ptr) AccessChain 323(input) 118 118 + Store 329 328 + 330: 326(ptr) AccessChain 325(input.TessLevelOuter) 121 + 331: 7(float) Load 330 + 332: 123(ptr) AccessChain 323(input) 118 121 + Store 332 331 + 333: 326(ptr) AccessChain 325(input.TessLevelOuter) 119 + 334: 7(float) Load 333 + 335: 123(ptr) AccessChain 323(input) 118 119 + Store 335 334 + 336: 326(ptr) AccessChain 325(input.TessLevelOuter) 133 + 337: 7(float) Load 336 + 338: 123(ptr) AccessChain 323(input) 118 133 + Store 338 337 + 341: 326(ptr) AccessChain 340(input.TessLevelInner) 118 + 342: 7(float) Load 341 + 343: 123(ptr) AccessChain 323(input) 121 118 + Store 343 342 + 344: 326(ptr) AccessChain 340(input.TessLevelInner) 121 + 345: 7(float) Load 344 + 346: 123(ptr) AccessChain 323(input) 121 121 + Store 346 345 + 350: 44(fvec3) Load 349(TessCoord) + 351: 7(float) CompositeExtract 350 0 + 352: 7(float) CompositeExtract 350 1 + 353: 39(fvec2) CompositeConstruct 351 352 + Store 347(TessCoord) 353 + 360: 359(ptr) AccessChain 358(patch.Pos) 118 + 361: 42(fvec4) Load 360 + 362: 178(ptr) AccessChain 355(patch) 118 118 + Store 362 361 + 366: 348(ptr) AccessChain 365(patch.Normal) 118 + 367: 44(fvec3) Load 366 + 368: 148(ptr) AccessChain 355(patch) 118 121 + Store 368 367 + 373: 372(ptr) AccessChain 371(patch.UV) 118 + 374: 39(fvec2) Load 373 + 375: 41(ptr) AccessChain 355(patch) 118 119 + Store 375 374 + 376: 359(ptr) AccessChain 358(patch.Pos) 121 + 377: 42(fvec4) Load 376 + 378: 178(ptr) AccessChain 355(patch) 121 118 + Store 378 377 + 379: 348(ptr) AccessChain 365(patch.Normal) 121 + 380: 44(fvec3) Load 379 + 381: 148(ptr) AccessChain 355(patch) 121 121 + Store 381 380 + 382: 372(ptr) AccessChain 371(patch.UV) 121 + 383: 39(fvec2) Load 382 + 384: 41(ptr) AccessChain 355(patch) 121 119 + Store 384 383 + 385: 359(ptr) AccessChain 358(patch.Pos) 119 + 386: 42(fvec4) Load 385 + 387: 178(ptr) AccessChain 355(patch) 119 118 + Store 387 386 + 388: 348(ptr) AccessChain 365(patch.Normal) 119 + 389: 44(fvec3) Load 388 + 390: 148(ptr) AccessChain 355(patch) 119 121 + Store 390 389 + 391: 372(ptr) AccessChain 371(patch.UV) 119 + 392: 39(fvec2) Load 391 + 393: 41(ptr) AccessChain 355(patch) 119 119 + Store 393 392 + 394: 359(ptr) AccessChain 358(patch.Pos) 133 + 395: 42(fvec4) Load 394 + 396: 178(ptr) AccessChain 355(patch) 133 118 + Store 396 395 + 397: 348(ptr) AccessChain 365(patch.Normal) 133 + 398: 44(fvec3) Load 397 + 399: 148(ptr) AccessChain 355(patch) 133 121 + Store 399 398 + 400: 372(ptr) AccessChain 371(patch.UV) 133 + 401: 39(fvec2) Load 400 + 402: 41(ptr) AccessChain 355(patch) 133 119 + Store 402 401 + 404: 60 Load 355(patch) + 406:23(ConstantsHSOutput) Load 323(input) + Store 405(param) 406 + 408: 39(fvec2) Load 347(TessCoord) + Store 407(param) 408 + 409:62(DSOutput) FunctionCall 83(@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];) 405(param) 407(param) 404 + Store 403(flattenTemp) 409 + 412: 178(ptr) AccessChain 403(flattenTemp) 118 + 413: 42(fvec4) Load 412 + Store 411(@entryPointOutput.Pos) 413 + 416: 148(ptr) AccessChain 403(flattenTemp) 121 + 417: 44(fvec3) Load 416 + Store 415(@entryPointOutput.Normal) 417 + 420: 41(ptr) AccessChain 403(flattenTemp) 119 + 421: 39(fvec2) Load 420 + Store 419(@entryPointOutput.UV) 421 + 423: 148(ptr) AccessChain 403(flattenTemp) 133 + 424: 44(fvec3) Load 423 + Store 422(@entryPointOutput.ViewVec) 424 + 426: 148(ptr) AccessChain 403(flattenTemp) 278 + 427: 44(fvec3) Load 426 + Store 425(@entryPointOutput.LightVec) 427 + 429: 148(ptr) AccessChain 403(flattenTemp) 313 + 430: 44(fvec3) Load 429 + Store 428(@entryPointOutput.EyePos) 430 + 432: 148(ptr) AccessChain 403(flattenTemp) 309 + 433: 44(fvec3) Load 432 + Store 431(@entryPointOutput.WorldPos) 433 + Return + FunctionEnd +83(@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];):62(DSOutput) Function None 78 + 80(input): 38(ptr) FunctionParameter + 81(TessCoord): 41(ptr) FunctionParameter + 82(patch): 60 FunctionParameter + 86: Label + 101(output): 100(ptr) Variable Function + 111(uv1): 41(ptr) Variable Function + 129(uv2): 41(ptr) Variable Function + 149(n1): 148(ptr) Variable Function + 160(n2): 148(ptr) Variable Function + 179(pos1): 178(ptr) Variable Function + 190(pos2): 178(ptr) Variable Function + 201(pos): 178(ptr) Variable Function + 87: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 85 + 88: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 26 15 15 15 15 + 91: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 89 80(input) 92 + 95: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 93 81(TessCoord) 92 + 98: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 96 82(patch) 92 + 99: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 85 83(@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];) + Store 101(output) 109 + 110: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 102 109 92 + 120: 39(fvec2) CompositeExtract 82(patch) 0 2 + 122: 39(fvec2) CompositeExtract 82(patch) 1 2 + 124: 123(ptr) AccessChain 81(TessCoord) 15 + 125: 7(float) Load 124 + 126: 39(fvec2) CompositeConstruct 125 125 + 127: 39(fvec2) ExtInst 2(GLSL.std.450) 46(FMix) 120 122 126 + Store 111(uv1) 127 + 128: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 112 127 92 + 134: 39(fvec2) CompositeExtract 82(patch) 3 2 + 135: 39(fvec2) CompositeExtract 82(patch) 2 2 + 136: 123(ptr) AccessChain 81(TessCoord) 15 + 137: 7(float) Load 136 + 138: 39(fvec2) CompositeConstruct 137 137 + 139: 39(fvec2) ExtInst 2(GLSL.std.450) 46(FMix) 134 135 138 + Store 129(uv2) 139 + 140: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 130 139 92 + 141: 39(fvec2) Load 111(uv1) + 142: 39(fvec2) Load 129(uv2) + 143: 123(ptr) AccessChain 81(TessCoord) 35 + 144: 7(float) Load 143 + 145: 39(fvec2) CompositeConstruct 144 144 + 146: 39(fvec2) ExtInst 2(GLSL.std.450) 46(FMix) 141 142 145 + 147: 41(ptr) AccessChain 101(output) 119 + Store 147 146 + 153: 44(fvec3) CompositeExtract 82(patch) 0 1 + 154: 44(fvec3) CompositeExtract 82(patch) 1 1 + 155: 123(ptr) AccessChain 81(TessCoord) 15 + 156: 7(float) Load 155 + 157: 44(fvec3) CompositeConstruct 156 156 156 + 158: 44(fvec3) ExtInst 2(GLSL.std.450) 46(FMix) 153 154 157 + Store 149(n1) 158 + 159: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 150 158 92 + 164: 44(fvec3) CompositeExtract 82(patch) 3 1 + 165: 44(fvec3) CompositeExtract 82(patch) 2 1 + 166: 123(ptr) AccessChain 81(TessCoord) 15 + 167: 7(float) Load 166 + 168: 44(fvec3) CompositeConstruct 167 167 167 + 169: 44(fvec3) ExtInst 2(GLSL.std.450) 46(FMix) 164 165 168 + Store 160(n2) 169 + 170: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 161 169 92 + 171: 44(fvec3) Load 149(n1) + 172: 44(fvec3) Load 160(n2) + 173: 123(ptr) AccessChain 81(TessCoord) 35 + 174: 7(float) Load 173 + 175: 44(fvec3) CompositeConstruct 174 174 174 + 176: 44(fvec3) ExtInst 2(GLSL.std.450) 46(FMix) 171 172 175 + 177: 148(ptr) AccessChain 101(output) 121 + Store 177 176 + 183: 42(fvec4) CompositeExtract 82(patch) 0 0 + 184: 42(fvec4) CompositeExtract 82(patch) 1 0 + 185: 123(ptr) AccessChain 81(TessCoord) 15 + 186: 7(float) Load 185 + 187: 42(fvec4) CompositeConstruct 186 186 186 186 + 188: 42(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 183 184 187 + Store 179(pos1) 188 + 189: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 180 188 92 + 194: 42(fvec4) CompositeExtract 82(patch) 3 0 + 195: 42(fvec4) CompositeExtract 82(patch) 2 0 + 196: 123(ptr) AccessChain 81(TessCoord) 15 + 197: 7(float) Load 196 + 198: 42(fvec4) CompositeConstruct 197 197 197 197 + 199: 42(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 194 195 198 + Store 190(pos2) 199 + 200: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 191 199 92 + 205: 42(fvec4) Load 179(pos1) + 206: 42(fvec4) Load 190(pos2) + 207: 123(ptr) AccessChain 81(TessCoord) 35 + 208: 7(float) Load 207 + 209: 42(fvec4) CompositeConstruct 208 208 208 208 + 210: 42(fvec4) ExtInst 2(GLSL.std.450) 46(FMix) 205 206 209 + Store 201(pos) 210 + 211: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 202 210 92 + 223: 212 Load 219(displacementMapTexture) + 232: 224 Load 229(displacementMapSampler) + 237: 233 SampledImage 223 232 + 238: 41(ptr) AccessChain 101(output) 119 + 239: 39(fvec2) Load 238 + 240: 42(fvec4) ImageSampleExplicitLod 237 239 Lod 105 + 241: 7(float) CompositeExtract 240 0 + 280: 279(ptr) AccessChain 276 118 278 + 281: 7(float) Load 280 + 282: 7(float) FMul 241 281 + 283: 123(ptr) AccessChain 201(pos) 35 + 284: 7(float) Load 283 + 285: 7(float) FSub 284 282 + 286: 123(ptr) AccessChain 201(pos) 35 + Store 286 285 + 287: 42(fvec4) Load 201(pos) + 289: 288(ptr) AccessChain 276 118 121 + 290: 242 Load 289 + 291: 42(fvec4) VectorTimesMatrix 287 290 + 292: 288(ptr) AccessChain 276 118 118 + 293: 242 Load 292 + 294: 42(fvec4) VectorTimesMatrix 291 293 + 295: 178(ptr) AccessChain 101(output) 118 + Store 295 294 + 296: 42(fvec4) Load 201(pos) + 297: 44(fvec3) VectorShuffle 296 296 0 1 2 + 298: 44(fvec3) FNegate 297 + 299: 148(ptr) AccessChain 101(output) 133 + Store 299 298 + 301: 300(ptr) AccessChain 276 118 119 + 302: 42(fvec4) Load 301 + 303: 44(fvec3) VectorShuffle 302 302 0 1 2 + 304: 148(ptr) AccessChain 101(output) 133 + 305: 44(fvec3) Load 304 + 306: 44(fvec3) FAdd 303 305 + 307: 44(fvec3) ExtInst 2(GLSL.std.450) 69(Normalize) 306 + 308: 148(ptr) AccessChain 101(output) 278 + Store 308 307 + 310: 42(fvec4) Load 201(pos) + 311: 44(fvec3) VectorShuffle 310 310 0 1 2 + 312: 148(ptr) AccessChain 101(output) 309 + Store 312 311 + 314: 42(fvec4) Load 201(pos) + 315: 288(ptr) AccessChain 276 118 121 + 316: 242 Load 315 + 317: 42(fvec4) VectorTimesMatrix 314 316 + 318: 44(fvec3) VectorShuffle 317 317 0 1 2 + 319: 148(ptr) AccessChain 101(output) 313 + Store 319 318 + 320:62(DSOutput) Load 101(output) + ReturnValue 320 + FunctionEnd diff --git a/Test/baseResults/spv.debuginfo.hlsl.vert.out b/Test/baseResults/spv.debuginfo.hlsl.vert.out new file mode 100644 index 000000000..6e1ce400d --- /dev/null +++ b/Test/baseResults/spv.debuginfo.hlsl.vert.out @@ -0,0 +1,580 @@ +spv.debuginfo.hlsl.vert +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 443 + + Capability Shader + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "NonSemantic.Shader.DebugInfo.100" + 2: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 5 "main" 392 395 399 402 405 408 412 416 424 428 431 434 437 440 + 9: String "float" + 12: String "uint" + 23: String "int" + 28: String "instanceRot" + 30: String "" + 35: String "UV" + 42: String "instanceScale" + 46: String "instanceTexIndex" + 50: String "VSInput" + 59: String "Pos" + 63: String "LightVec" + 70: String "VSOutput" + 75: String "@main" + 81: String "input" + 88: String "output" + 116: String "s" + 127: String "modelview" + 132: String "lightPos" + 136: String "globSpeed" + 140: String "UBO" + 143: String "ubo" + 159: String "c" + 173: String "mx" + 202: String "my" + 230: String "mz" + 244: String "rotMat" + 270: String "gRotMat" + 289: String "locPos" + 302: String "pos" + 361: String "lPos" + Name 5 "main" + Name 26 "VSInput" + MemberName 26(VSInput) 0 "Pos" + MemberName 26(VSInput) 1 "Normal" + MemberName 26(VSInput) 2 "UV" + MemberName 26(VSInput) 3 "Color" + MemberName 26(VSInput) 4 "instancePos" + MemberName 26(VSInput) 5 "instanceRot" + MemberName 26(VSInput) 6 "instanceScale" + MemberName 26(VSInput) 7 "instanceTexIndex" + Name 57 "VSOutput" + MemberName 57(VSOutput) 0 "Pos" + MemberName 57(VSOutput) 1 "Normal" + MemberName 57(VSOutput) 2 "Color" + MemberName 57(VSOutput) 3 "UV" + MemberName 57(VSOutput) 4 "ViewVec" + MemberName 57(VSOutput) 5 "LightVec" + Name 74 "@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;" + Name 73 "input" + Name 86 "output" + Name 114 "s" + Name 125 "UBO" + MemberName 125(UBO) 0 "projection" + MemberName 125(UBO) 1 "modelview" + MemberName 125(UBO) 2 "lightPos" + MemberName 125(UBO) 3 "locSpeed" + MemberName 125(UBO) 4 "globSpeed" + Name 141 "ubo" + MemberName 141(ubo) 0 "ubo" + Name 147 "" + Name 157 "c" + Name 171 "mx" + Name 200 "my" + Name 228 "mz" + Name 242 "rotMat" + Name 268 "gRotMat" + Name 287 "locPos" + Name 300 "pos" + Name 359 "lPos" + Name 390 "input" + Name 392 "input.Pos" + Name 395 "input.Normal" + Name 399 "input.UV" + Name 402 "input.Color" + Name 405 "input.instancePos" + Name 408 "input.instanceRot" + Name 412 "input.instanceScale" + Name 416 "input.instanceTexIndex" + Name 419 "flattenTemp" + Name 420 "param" + Name 424 "@entryPointOutput.Pos" + Name 428 "@entryPointOutput.Normal" + Name 431 "@entryPointOutput.Color" + Name 434 "@entryPointOutput.UV" + Name 437 "@entryPointOutput.ViewVec" + Name 440 "@entryPointOutput.LightVec" + MemberDecorate 125(UBO) 0 RowMajor + MemberDecorate 125(UBO) 0 Offset 0 + MemberDecorate 125(UBO) 0 MatrixStride 16 + MemberDecorate 125(UBO) 1 RowMajor + MemberDecorate 125(UBO) 1 Offset 64 + MemberDecorate 125(UBO) 1 MatrixStride 16 + MemberDecorate 125(UBO) 2 Offset 128 + MemberDecorate 125(UBO) 3 Offset 144 + MemberDecorate 125(UBO) 4 Offset 148 + MemberDecorate 141(ubo) 0 Offset 0 + Decorate 141(ubo) Block + Decorate 147 DescriptorSet 0 + Decorate 147 Binding 0 + Decorate 392(input.Pos) Location 0 + Decorate 395(input.Normal) Location 1 + Decorate 399(input.UV) Location 2 + Decorate 402(input.Color) Location 3 + Decorate 405(input.instancePos) Location 4 + Decorate 408(input.instanceRot) Location 5 + Decorate 412(input.instanceScale) Location 6 + Decorate 416(input.instanceTexIndex) Location 7 + Decorate 424(@entryPointOutput.Pos) BuiltIn Position + Decorate 428(@entryPointOutput.Normal) Location 0 + Decorate 431(@entryPointOutput.Color) Location 1 + Decorate 434(@entryPointOutput.UV) Location 2 + Decorate 437(@entryPointOutput.ViewVec) Location 3 + Decorate 440(@entryPointOutput.LightVec) Location 4 + 3: TypeVoid + 4: TypeFunction 3 + 7: TypeFloat 32 + 10: TypeInt 32 0 + 13: 10(int) Constant 32 + 14: 10(int) Constant 6 + 15: 10(int) Constant 0 + 11: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 12 13 14 15 + 16: 10(int) Constant 3 + 8: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 9 13 16 15 + 17: TypeVector 7(float) 3 + 18: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 16 + 19: TypeVector 7(float) 2 + 20: 10(int) Constant 2 + 21: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 20 + 22: TypeInt 32 1 + 25: 10(int) Constant 4 + 24: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 2(RoundEven) 23 13 25 15 + 26(VSInput): TypeStruct 17(fvec3) 17(fvec3) 19(fvec2) 17(fvec3) 17(fvec3) 17(fvec3) 7(float) 22(int) + 29: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 35(Modf) 0 30 + 31: 10(int) Constant 35 + 32: 10(int) Constant 40 + 27: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 28 18 29 31 32 15 15 16 + 33: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 28 18 29 31 32 15 15 16 + 36: 10(int) Constant 30 + 37: 10(int) Constant 31 + 34: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 35 21 29 36 37 15 15 16 + 38: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 28 18 29 31 32 15 15 16 + 39: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 28 18 29 31 32 15 15 16 + 40: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 28 18 29 31 32 15 15 16 + 43: 10(int) Constant 36 + 44: 10(int) Constant 41 + 41: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 42 8 29 43 44 15 15 16 + 47: 10(int) Constant 37 + 48: 10(int) Constant 42 + 45: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 46 24 29 47 48 15 15 16 + 51: 10(int) Constant 1 + 53: 10(int) Constant 5 + 52: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 1(Round) 51 25 29 53 + 49: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 50 51 29 15 15 52 50 15 16 27 33 34 38 39 40 41 45 + 54: TypePointer Function 26(VSInput) + 55: TypeVector 7(float) 4 + 56: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 6(FSign) 8 25 + 57(VSOutput): TypeStruct 55(fvec4) 17(fvec3) 17(fvec3) 17(fvec3) 17(fvec3) 17(fvec3) + 60: 10(int) Constant 53 + 61: 10(int) Constant 13 + 58: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 59 56 29 60 61 15 15 16 + 64: 10(int) Constant 58 + 62: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 63 18 29 64 47 15 15 16 + 65: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 63 18 29 64 47 15 15 16 + 66: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 63 18 29 64 47 15 15 16 + 67: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 63 18 29 64 47 15 15 16 + 68: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 63 18 29 64 47 15 15 16 + 69: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 70 51 29 15 15 52 70 15 16 58 62 65 66 67 68 + 71: TypeFunction 57(VSOutput) 54(ptr) + 72: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 8(Floor) 16 69 49 + 76: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 20(Cosh) 75 72 29 15 15 52 75 16 15 + 80: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 81 49 29 15 15 76 25 51 + 83: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 31(Sqrt) + 85: TypePointer Function 57(VSOutput) + 89: 10(int) Constant 63 + 87: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 88 69 29 89 15 76 25 + 90: 7(float) Constant 0 + 91: 55(fvec4) ConstantComposite 90 90 90 90 + 92: 17(fvec3) ConstantComposite 90 90 90 + 93:57(VSOutput) ConstantComposite 91 92 92 92 92 92 + 95: 22(int) Constant 2 + 96: 22(int) Constant 3 + 97: TypePointer Function 17(fvec3) + 101: TypePointer Function 19(fvec2) + 104: 22(int) Constant 7 + 105: TypePointer Function 22(int) + 113: TypePointer Function 7(float) + 117: 10(int) Constant 68 + 115: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 116 8 29 117 15 76 25 + 118: 22(int) Constant 5 + 121: TypeMatrix 55(fvec4) 4 + 123: TypeBool + 124: 123(bool) ConstantTrue + 122: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 56 25 124 + 125(UBO): TypeStruct 121 121 55(fvec4) 7(float) 7(float) + 128: 10(int) Constant 43 + 129: 10(int) Constant 20 + 126: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 127 122 29 128 129 15 15 16 + 130: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 127 122 29 128 129 15 15 16 + 133: 10(int) Constant 44 + 134: 10(int) Constant 17 + 131: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 132 56 29 133 134 15 15 16 + 137: 10(int) Constant 46 + 135: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 136 8 29 137 134 15 15 16 + 138: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 136 8 29 137 134 15 15 16 + 139: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 140 51 29 117 15 52 140 15 16 126 130 131 135 138 + 141(ubo): TypeStruct 125(UBO) + 144: 10(int) Constant 49 + 142: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 11(Radians) 143 139 29 144 47 15 15 16 + 145: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 10(Fract) 143 51 29 117 15 52 143 15 16 142 + 146: TypePointer Uniform 141(ubo) + 147: 146(ptr) Variable Uniform + 149: 10(int) Constant 8 + 148: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 18(Atan) 30 145 29 117 15 52 30 147 149 + 150: 22(int) Constant 0 + 151: TypePointer Uniform 7(float) + 160: 10(int) Constant 69 + 158: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 159 8 29 160 15 76 25 + 168: TypeMatrix 17(fvec3) 3 + 169: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 108 18 16 124 + 170: TypePointer Function 168 + 174: 10(int) Constant 71 + 172: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 173 169 29 174 15 76 25 + 180: 7(float) Constant 1065353216 + 203: 10(int) Constant 79 + 201: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 202 169 29 203 15 76 25 + 231: 10(int) Constant 87 + 229: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 230 169 29 231 15 76 25 + 245: 10(int) Constant 91 + 243: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 244 169 29 245 15 76 25 + 254: 22(int) Constant 4 + 267: TypePointer Function 121 + 271: 10(int) Constant 96 + 269: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 270 122 29 271 15 76 25 + 276: TypePointer Function 55(fvec4) + 278: 22(int) Constant 1 + 279: 55(fvec4) ConstantComposite 90 180 90 90 + 285: 55(fvec4) ConstantComposite 90 90 90 180 + 290: 10(int) Constant 101 + 288: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 289 56 29 290 15 76 25 + 303: 10(int) Constant 102 + 301: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 302 56 29 303 15 76 25 + 306: 22(int) Constant 6 + 321: TypePointer Uniform 121 + 362: 10(int) Constant 108 + 360: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 26(Pow) 361 18 29 362 15 76 25 + 363: TypePointer Uniform 55(fvec4) + 391: TypePointer Input 17(fvec3) + 392(input.Pos): 391(ptr) Variable Input +395(input.Normal): 391(ptr) Variable Input + 398: TypePointer Input 19(fvec2) + 399(input.UV): 398(ptr) Variable Input +402(input.Color): 391(ptr) Variable Input +405(input.instancePos): 391(ptr) Variable Input +408(input.instanceRot): 391(ptr) Variable Input + 411: TypePointer Input 7(float) +412(input.instanceScale): 411(ptr) Variable Input + 415: TypePointer Input 22(int) +416(input.instanceTexIndex): 415(ptr) Variable Input + 423: TypePointer Output 55(fvec4) +424(@entryPointOutput.Pos): 423(ptr) Variable Output + 427: TypePointer Output 17(fvec3) +428(@entryPointOutput.Normal): 427(ptr) Variable Output +431(@entryPointOutput.Color): 427(ptr) Variable Output +434(@entryPointOutput.UV): 427(ptr) Variable Output +437(@entryPointOutput.ViewVec): 427(ptr) Variable Output +440(@entryPointOutput.LightVec): 427(ptr) Variable Output + 5(main): 3 Function None 4 + 6: Label + 390(input): 54(ptr) Variable Function +419(flattenTemp): 85(ptr) Variable Function + 420(param): 54(ptr) Variable Function + 393: 17(fvec3) Load 392(input.Pos) + 394: 97(ptr) AccessChain 390(input) 150 + Store 394 393 + 396: 17(fvec3) Load 395(input.Normal) + 397: 97(ptr) AccessChain 390(input) 278 + Store 397 396 + 400: 19(fvec2) Load 399(input.UV) + 401: 101(ptr) AccessChain 390(input) 95 + Store 401 400 + 403: 17(fvec3) Load 402(input.Color) + 404: 97(ptr) AccessChain 390(input) 96 + Store 404 403 + 406: 17(fvec3) Load 405(input.instancePos) + 407: 97(ptr) AccessChain 390(input) 254 + Store 407 406 + 409: 17(fvec3) Load 408(input.instanceRot) + 410: 97(ptr) AccessChain 390(input) 118 + Store 410 409 + 413: 7(float) Load 412(input.instanceScale) + 414: 113(ptr) AccessChain 390(input) 306 + Store 414 413 + 417: 22(int) Load 416(input.instanceTexIndex) + 418: 105(ptr) AccessChain 390(input) 104 + Store 418 417 + 421: 26(VSInput) Load 390(input) + Store 420(param) 421 + 422:57(VSOutput) FunctionCall 74(@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;) 420(param) + Store 419(flattenTemp) 422 + 425: 276(ptr) AccessChain 419(flattenTemp) 150 + 426: 55(fvec4) Load 425 + Store 424(@entryPointOutput.Pos) 426 + 429: 97(ptr) AccessChain 419(flattenTemp) 278 + 430: 17(fvec3) Load 429 + Store 428(@entryPointOutput.Normal) 430 + 432: 97(ptr) AccessChain 419(flattenTemp) 95 + 433: 17(fvec3) Load 432 + Store 431(@entryPointOutput.Color) 433 + 435: 97(ptr) AccessChain 419(flattenTemp) 96 + 436: 17(fvec3) Load 435 + Store 434(@entryPointOutput.UV) 436 + 438: 97(ptr) AccessChain 419(flattenTemp) 254 + 439: 17(fvec3) Load 438 + Store 437(@entryPointOutput.ViewVec) 439 + 441: 97(ptr) AccessChain 419(flattenTemp) 118 + 442: 17(fvec3) Load 441 + Store 440(@entryPointOutput.LightVec) 442 + Return + FunctionEnd +74(@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;):57(VSOutput) Function None 71 + 73(input): 54(ptr) FunctionParameter + 77: Label + 86(output): 85(ptr) Variable Function + 114(s): 113(ptr) Variable Function + 157(c): 113(ptr) Variable Function + 171(mx): 170(ptr) Variable Function + 200(my): 170(ptr) Variable Function + 228(mz): 170(ptr) Variable Function + 242(rotMat): 170(ptr) Variable Function + 268(gRotMat): 267(ptr) Variable Function + 287(locPos): 276(ptr) Variable Function + 300(pos): 276(ptr) Variable Function + 359(lPos): 97(ptr) Variable Function + 78: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(Acosh) 76 + 79: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103 29 15 15 15 15 + 82: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 28(Log) 80 73(input) 83 + 84: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 101 76 74(@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;) + Store 86(output) 93 + 94: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 87 93 83 + 98: 97(ptr) AccessChain 73(input) 96 + 99: 17(fvec3) Load 98 + 100: 97(ptr) AccessChain 86(output) 95 + Store 100 99 + 102: 101(ptr) AccessChain 73(input) 95 + 103: 19(fvec2) Load 102 + 106: 105(ptr) AccessChain 73(input) 104 + 107: 22(int) Load 106 + 108: 7(float) ConvertSToF 107 + 109: 7(float) CompositeExtract 103 0 + 110: 7(float) CompositeExtract 103 1 + 111: 17(fvec3) CompositeConstruct 109 110 108 + 112: 97(ptr) AccessChain 86(output) 96 + Store 112 111 + 119: 113(ptr) AccessChain 73(input) 118 15 + 120: 7(float) Load 119 + 152: 151(ptr) AccessChain 147 150 96 + 153: 7(float) Load 152 + 154: 7(float) FAdd 120 153 + 155: 7(float) ExtInst 2(GLSL.std.450) 13(Sin) 154 + Store 114(s) 155 + 156: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 115 155 83 + 161: 113(ptr) AccessChain 73(input) 118 15 + 162: 7(float) Load 161 + 163: 151(ptr) AccessChain 147 150 96 + 164: 7(float) Load 163 + 165: 7(float) FAdd 162 164 + 166: 7(float) ExtInst 2(GLSL.std.450) 14(Cos) 165 + Store 157(c) 166 + 167: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 158 166 83 + 175: 7(float) Load 157(c) + 176: 7(float) Load 114(s) + 177: 7(float) FNegate 176 + 178: 7(float) Load 114(s) + 179: 7(float) Load 157(c) + 181: 17(fvec3) CompositeConstruct 175 177 90 + 182: 17(fvec3) CompositeConstruct 178 179 90 + 183: 17(fvec3) CompositeConstruct 90 90 180 + 184: 168 CompositeConstruct 181 182 183 + Store 171(mx) 184 + 185: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 172 184 83 + 186: 113(ptr) AccessChain 73(input) 118 51 + 187: 7(float) Load 186 + 188: 151(ptr) AccessChain 147 150 96 + 189: 7(float) Load 188 + 190: 7(float) FAdd 187 189 + 191: 7(float) ExtInst 2(GLSL.std.450) 13(Sin) 190 + Store 114(s) 191 + 192: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 115 191 83 + 193: 113(ptr) AccessChain 73(input) 118 51 + 194: 7(float) Load 193 + 195: 151(ptr) AccessChain 147 150 96 + 196: 7(float) Load 195 + 197: 7(float) FAdd 194 196 + 198: 7(float) ExtInst 2(GLSL.std.450) 14(Cos) 197 + Store 157(c) 198 + 199: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 158 198 83 + 204: 7(float) Load 157(c) + 205: 7(float) Load 114(s) + 206: 7(float) FNegate 205 + 207: 7(float) Load 114(s) + 208: 7(float) Load 157(c) + 209: 17(fvec3) CompositeConstruct 204 90 206 + 210: 17(fvec3) CompositeConstruct 90 180 90 + 211: 17(fvec3) CompositeConstruct 207 90 208 + 212: 168 CompositeConstruct 209 210 211 + Store 200(my) 212 + 213: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 201 212 83 + 214: 113(ptr) AccessChain 73(input) 118 20 + 215: 7(float) Load 214 + 216: 151(ptr) AccessChain 147 150 96 + 217: 7(float) Load 216 + 218: 7(float) FAdd 215 217 + 219: 7(float) ExtInst 2(GLSL.std.450) 13(Sin) 218 + Store 114(s) 219 + 220: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 115 219 83 + 221: 113(ptr) AccessChain 73(input) 118 20 + 222: 7(float) Load 221 + 223: 151(ptr) AccessChain 147 150 96 + 224: 7(float) Load 223 + 225: 7(float) FAdd 222 224 + 226: 7(float) ExtInst 2(GLSL.std.450) 14(Cos) 225 + Store 157(c) 226 + 227: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 158 226 83 + 232: 7(float) Load 157(c) + 233: 7(float) Load 114(s) + 234: 7(float) FNegate 233 + 235: 7(float) Load 114(s) + 236: 7(float) Load 157(c) + 237: 17(fvec3) CompositeConstruct 180 90 90 + 238: 17(fvec3) CompositeConstruct 90 232 234 + 239: 17(fvec3) CompositeConstruct 90 235 236 + 240: 168 CompositeConstruct 237 238 239 + Store 228(mz) 240 + 241: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 229 240 83 + 246: 168 Load 171(mx) + 247: 168 Load 200(my) + 248: 168 MatrixTimesMatrix 246 247 + 249: 168 Load 228(mz) + 250: 168 MatrixTimesMatrix 248 249 + Store 242(rotMat) 250 + 251: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 243 250 83 + 252: 113(ptr) AccessChain 73(input) 118 51 + 253: 7(float) Load 252 + 255: 151(ptr) AccessChain 147 150 254 + 256: 7(float) Load 255 + 257: 7(float) FAdd 253 256 + 258: 7(float) ExtInst 2(GLSL.std.450) 13(Sin) 257 + Store 114(s) 258 + 259: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 115 258 83 + 260: 113(ptr) AccessChain 73(input) 118 51 + 261: 7(float) Load 260 + 262: 151(ptr) AccessChain 147 150 254 + 263: 7(float) Load 262 + 264: 7(float) FAdd 261 263 + 265: 7(float) ExtInst 2(GLSL.std.450) 14(Cos) 264 + Store 157(c) 265 + 266: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 158 265 83 + 272: 7(float) Load 157(c) + 273: 7(float) Load 114(s) + 274: 7(float) FNegate 273 + 275: 55(fvec4) CompositeConstruct 272 90 274 90 + 277: 276(ptr) AccessChain 268(gRotMat) 150 + Store 277 275 + 280: 276(ptr) AccessChain 268(gRotMat) 278 + Store 280 279 + 281: 7(float) Load 114(s) + 282: 7(float) Load 157(c) + 283: 55(fvec4) CompositeConstruct 281 90 282 90 + 284: 276(ptr) AccessChain 268(gRotMat) 95 + Store 284 283 + 286: 276(ptr) AccessChain 268(gRotMat) 96 + Store 286 285 + 291: 97(ptr) AccessChain 73(input) 150 + 292: 17(fvec3) Load 291 + 293: 168 Load 242(rotMat) + 294: 17(fvec3) VectorTimesMatrix 292 293 + 295: 7(float) CompositeExtract 294 0 + 296: 7(float) CompositeExtract 294 1 + 297: 7(float) CompositeExtract 294 2 + 298: 55(fvec4) CompositeConstruct 295 296 297 180 + Store 287(locPos) 298 + 299: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 288 298 83 + 304: 55(fvec4) Load 287(locPos) + 305: 17(fvec3) VectorShuffle 304 304 0 1 2 + 307: 113(ptr) AccessChain 73(input) 306 + 308: 7(float) Load 307 + 309: 17(fvec3) VectorTimesScalar 305 308 + 310: 97(ptr) AccessChain 73(input) 254 + 311: 17(fvec3) Load 310 + 312: 17(fvec3) FAdd 309 311 + 313: 7(float) CompositeExtract 312 0 + 314: 7(float) CompositeExtract 312 1 + 315: 7(float) CompositeExtract 312 2 + 316: 55(fvec4) CompositeConstruct 313 314 315 180 + Store 300(pos) 316 + 317: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 301 316 83 + 318: 55(fvec4) Load 300(pos) + 319: 121 Load 268(gRotMat) + 320: 55(fvec4) VectorTimesMatrix 318 319 + 322: 321(ptr) AccessChain 147 150 278 + 323: 121 Load 322 + 324: 55(fvec4) VectorTimesMatrix 320 323 + 325: 321(ptr) AccessChain 147 150 150 + 326: 121 Load 325 + 327: 55(fvec4) VectorTimesMatrix 324 326 + 328: 276(ptr) AccessChain 86(output) 150 + Store 328 327 + 329: 97(ptr) AccessChain 73(input) 278 + 330: 17(fvec3) Load 329 + 331: 168 Load 242(rotMat) + 332: 17(fvec3) VectorTimesMatrix 330 331 + 333: 121 Load 268(gRotMat) + 334: 321(ptr) AccessChain 147 150 278 + 335: 121 Load 334 + 336: 121 MatrixTimesMatrix 333 335 + 337: 55(fvec4) CompositeExtract 336 0 + 338: 17(fvec3) VectorShuffle 337 337 0 1 2 + 339: 55(fvec4) CompositeExtract 336 1 + 340: 17(fvec3) VectorShuffle 339 339 0 1 2 + 341: 55(fvec4) CompositeExtract 336 2 + 342: 17(fvec3) VectorShuffle 341 341 0 1 2 + 343: 168 CompositeConstruct 338 340 342 + 344: 17(fvec3) VectorTimesMatrix 332 343 + 345: 97(ptr) AccessChain 86(output) 278 + Store 345 344 + 346: 97(ptr) AccessChain 73(input) 150 + 347: 17(fvec3) Load 346 + 348: 97(ptr) AccessChain 73(input) 254 + 349: 17(fvec3) Load 348 + 350: 17(fvec3) FAdd 347 349 + 351: 7(float) CompositeExtract 350 0 + 352: 7(float) CompositeExtract 350 1 + 353: 7(float) CompositeExtract 350 2 + 354: 55(fvec4) CompositeConstruct 351 352 353 180 + 355: 321(ptr) AccessChain 147 150 278 + 356: 121 Load 355 + 357: 55(fvec4) VectorTimesMatrix 354 356 + Store 300(pos) 357 + 358: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 301 357 83 + 364: 363(ptr) AccessChain 147 150 95 + 365: 55(fvec4) Load 364 + 366: 17(fvec3) VectorShuffle 365 365 0 1 2 + 367: 321(ptr) AccessChain 147 150 278 + 368: 121 Load 367 + 369: 55(fvec4) CompositeExtract 368 0 + 370: 17(fvec3) VectorShuffle 369 369 0 1 2 + 371: 55(fvec4) CompositeExtract 368 1 + 372: 17(fvec3) VectorShuffle 371 371 0 1 2 + 373: 55(fvec4) CompositeExtract 368 2 + 374: 17(fvec3) VectorShuffle 373 373 0 1 2 + 375: 168 CompositeConstruct 370 372 374 + 376: 17(fvec3) VectorTimesMatrix 366 375 + Store 359(lPos) 376 + 377: 3 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 29(Exp2) 360 376 83 + 378: 17(fvec3) Load 359(lPos) + 379: 55(fvec4) Load 300(pos) + 380: 17(fvec3) VectorShuffle 379 379 0 1 2 + 381: 17(fvec3) FSub 378 380 + 382: 97(ptr) AccessChain 86(output) 118 + Store 382 381 + 383: 55(fvec4) Load 300(pos) + 384: 17(fvec3) VectorShuffle 383 383 0 1 2 + 385: 17(fvec3) FNegate 384 + 386: 97(ptr) AccessChain 86(output) 254 + Store 386 385 + 387:57(VSOutput) Load 86(output) + ReturnValue 387 + FunctionEnd diff --git a/Test/spv.debuginfo.glsl.comp b/Test/spv.debuginfo.glsl.comp new file mode 100644 index 000000000..c37d05d72 --- /dev/null +++ b/Test/spv.debuginfo.glsl.comp @@ -0,0 +1,177 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#version 450 + +struct Particle { + vec4 pos; + vec4 vel; + vec4 uv; + vec4 normal; + float pinned; +}; + +layout(std430, binding = 0) buffer ParticleIn { + Particle particleIn[ ]; +}; + +layout(std430, binding = 1) buffer ParticleOut { + Particle particleOut[ ]; +}; + +// todo: use shared memory to speed up calculation + +layout (local_size_x = 10, local_size_y = 10) in; + +layout (binding = 2) uniform UBO +{ + float deltaT; + float particleMass; + float springStiffness; + float damping; + float restDistH; + float restDistV; + float restDistD; + float sphereRadius; + vec4 spherePos; + vec4 gravity; + ivec2 particleCount; +} params; + +layout (push_constant) uniform PushConsts { + uint calculateNormals; +} pushConsts; + +vec3 springForce(vec3 p0, vec3 p1, float restDist) +{ + vec3 dist = p0 - p1; + return normalize(dist) * params.springStiffness * (length(dist) - restDist); +} + +void main() +{ + uvec3 id = gl_GlobalInvocationID; + + uint index = id.y * params.particleCount.x + id.x; + if (index > params.particleCount.x * params.particleCount.y) + return; + + // Pinned? + if (particleIn[index].pinned == 1.0) { + particleOut[index].pos = particleOut[index].pos; + particleOut[index].vel = vec4(0.0); + return; + } + + // Initial force from gravity + vec3 force = params.gravity.xyz * params.particleMass; + + vec3 pos = particleIn[index].pos.xyz; + vec3 vel = particleIn[index].vel.xyz; + + // Spring forces from neighboring particles + // left + if (id.x > 0) { + force += springForce(particleIn[index-1].pos.xyz, pos, params.restDistH); + } + // right + if (id.x < params.particleCount.x - 1) { + force += springForce(particleIn[index + 1].pos.xyz, pos, params.restDistH); + } + // upper + if (id.y < params.particleCount.y - 1) { + force += springForce(particleIn[index + params.particleCount.x].pos.xyz, pos, params.restDistV); + } + // lower + if (id.y > 0) { + force += springForce(particleIn[index - params.particleCount.x].pos.xyz, pos, params.restDistV); + } + // upper-left + if ((id.x > 0) && (id.y < params.particleCount.y - 1)) { + force += springForce(particleIn[index + params.particleCount.x - 1].pos.xyz, pos, params.restDistD); + } + // lower-left + if ((id.x > 0) && (id.y > 0)) { + force += springForce(particleIn[index - params.particleCount.x - 1].pos.xyz, pos, params.restDistD); + } + // upper-right + if ((id.x < params.particleCount.x - 1) && (id.y < params.particleCount.y - 1)) { + force += springForce(particleIn[index + params.particleCount.x + 1].pos.xyz, pos, params.restDistD); + } + // lower-right + if ((id.x < params.particleCount.x - 1) && (id.y > 0)) { + force += springForce(particleIn[index - params.particleCount.x + 1].pos.xyz, pos, params.restDistD); + } + + force += (-params.damping * vel); + + // Integrate + vec3 f = force * (1.0 / params.particleMass); + particleOut[index].pos = vec4(pos + vel * params.deltaT + 0.5 * f * params.deltaT * params.deltaT, 1.0); + particleOut[index].vel = vec4(vel + f * params.deltaT, 0.0); + + // Sphere collision + vec3 sphereDist = particleOut[index].pos.xyz - params.spherePos.xyz; + if (length(sphereDist) < params.sphereRadius + 0.01) { + // If the particle is inside the sphere, push it to the outer radius + particleOut[index].pos.xyz = params.spherePos.xyz + normalize(sphereDist) * (params.sphereRadius + 0.01); + // Cancel out velocity + particleOut[index].vel = vec4(0.0); + } + + // Normals + if (pushConsts.calculateNormals == 1) { + vec3 normal = vec3(0.0); + vec3 a, b, c; + if (id.y > 0) { + if (id.x > 0) { + a = particleIn[index - 1].pos.xyz - pos; + b = particleIn[index - params.particleCount.x - 1].pos.xyz - pos; + c = particleIn[index - params.particleCount.x].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + if (id.x < params.particleCount.x - 1) { + a = particleIn[index - params.particleCount.x].pos.xyz - pos; + b = particleIn[index - params.particleCount.x + 1].pos.xyz - pos; + c = particleIn[index + 1].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + } + if (id.y < params.particleCount.y - 1) { + if (id.x > 0) { + a = particleIn[index + params.particleCount.x].pos.xyz - pos; + b = particleIn[index + params.particleCount.x - 1].pos.xyz - pos; + c = particleIn[index - 1].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + if (id.x < params.particleCount.x - 1) { + a = particleIn[index + 1].pos.xyz - pos; + b = particleIn[index + params.particleCount.x + 1].pos.xyz - pos; + c = particleIn[index + params.particleCount.x].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + } + particleOut[index].normal = vec4(normalize(normal), 0.0f); + } +} diff --git a/Test/spv.debuginfo.glsl.frag b/Test/spv.debuginfo.glsl.frag new file mode 100644 index 000000000..bf5f622d9 --- /dev/null +++ b/Test/spv.debuginfo.glsl.frag @@ -0,0 +1,192 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#version 450 + +layout (binding = 1) uniform sampler2D samplerposition; +layout (binding = 2) uniform sampler2D samplerNormal; +layout (binding = 3) uniform sampler2D samplerAlbedo; +layout (binding = 5) uniform sampler2DArray samplerShadowMap; + +layout (location = 0) in vec2 inUV; + +layout (location = 0) out vec4 outFragColor; + +#define LIGHT_COUNT 3 +#define SHADOW_FACTOR 0.25 +#define AMBIENT_LIGHT 0.1 +#define USE_PCF + +struct Light +{ + vec4 position; + vec4 target; + vec4 color; + mat4 viewMatrix; +}; + +layout (binding = 4) uniform UBO +{ + vec4 viewPos; + Light lights[LIGHT_COUNT]; + int useShadows; + int debugDisplayTarget; +} ubo; + +float textureProj(vec4 P, float layer, vec2 offset) +{ + float shadow = 1.0; + vec4 shadowCoord = P / P.w; + shadowCoord.st = shadowCoord.st * 0.5 + 0.5; + + if (shadowCoord.z > -1.0 && shadowCoord.z < 1.0) + { + float dist = texture(samplerShadowMap, vec3(shadowCoord.st + offset, layer)).r; + if (shadowCoord.w > 0.0 && dist < shadowCoord.z) + { + shadow = SHADOW_FACTOR; + } + } + return shadow; +} + +float filterPCF(vec4 sc, float layer) +{ + ivec2 texDim = textureSize(samplerShadowMap, 0).xy; + float scale = 1.5; + float dx = scale * 1.0 / float(texDim.x); + float dy = scale * 1.0 / float(texDim.y); + + float shadowFactor = 0.0; + int count = 0; + int range = 1; + + for (int x = -range; x <= range; x++) + { + for (int y = -range; y <= range; y++) + { + shadowFactor += textureProj(sc, layer, vec2(dx*x, dy*y)); + count++; + } + + } + return shadowFactor / count; +} + +vec3 shadow(vec3 fragcolor, vec3 fragpos) { + for(int i = 0; i < LIGHT_COUNT; ++i) + { + vec4 shadowClip = ubo.lights[i].viewMatrix * vec4(fragpos, 1.0); + + float shadowFactor; + #ifdef USE_PCF + shadowFactor= filterPCF(shadowClip, i); + #else + shadowFactor = textureProj(shadowClip, i, vec2(0.0)); + #endif + + fragcolor *= shadowFactor; + } + return fragcolor; +} + +void main() +{ + // Get G-Buffer values + vec3 fragPos = texture(samplerposition, inUV).rgb; + vec3 normal = texture(samplerNormal, inUV).rgb; + vec4 albedo = texture(samplerAlbedo, inUV); + + // Debug display + if (ubo.debugDisplayTarget > 0) { + switch (ubo.debugDisplayTarget) { + case 1: + outFragColor.rgb = shadow(vec3(1.0), fragPos).rgb; + break; + case 2: + outFragColor.rgb = fragPos; + break; + case 3: + outFragColor.rgb = normal; + break; + case 4: + outFragColor.rgb = albedo.rgb; + break; + case 5: + outFragColor.rgb = albedo.aaa; + break; + } + outFragColor.a = 1.0; + return; + } + + // Ambient part + vec3 fragcolor = albedo.rgb * AMBIENT_LIGHT; + + vec3 N = normalize(normal); + + for(int i = 0; i < LIGHT_COUNT; ++i) + { + // Vector to light + vec3 L = ubo.lights[i].position.xyz - fragPos; + // Distance from light to fragment position + float dist = length(L); + L = normalize(L); + + // Viewer to fragment + vec3 V = ubo.viewPos.xyz - fragPos; + V = normalize(V); + + float lightCosInnerAngle = cos(radians(15.0)); + float lightCosOuterAngle = cos(radians(25.0)); + float lightRange = 100.0; + + // Direction vector from source to target + vec3 dir = normalize(ubo.lights[i].position.xyz - ubo.lights[i].target.xyz); + + // Dual cone spot light with smooth transition between inner and outer angle + float cosDir = dot(L, dir); + float spotEffect = smoothstep(lightCosOuterAngle, lightCosInnerAngle, cosDir); + float heightAttenuation = smoothstep(lightRange, 0.0f, dist); + + // Diffuse lighting + float NdotL = max(0.0, dot(N, L)); + vec3 diff = vec3(NdotL); + + // Specular lighting + vec3 R = reflect(-L, N); + float NdotR = max(0.0, dot(R, V)); + vec3 spec = vec3(pow(NdotR, 16.0) * albedo.a * 2.5); + + fragcolor += vec3((diff + spec) * spotEffect * heightAttenuation) * ubo.lights[i].color.rgb * albedo.rgb; + } + + // Shadow calculations in a separate pass + if (ubo.useShadows > 0) + { + fragcolor = shadow(fragcolor, fragPos); + } + + outFragColor = vec4(fragcolor, 1.0); +} diff --git a/Test/spv.debuginfo.glsl.geom b/Test/spv.debuginfo.glsl.geom new file mode 100644 index 000000000..756885f67 --- /dev/null +++ b/Test/spv.debuginfo.glsl.geom @@ -0,0 +1,69 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#version 450 + +#extension GL_ARB_viewport_array : enable + +layout (triangles, invocations = 2) in; +layout (triangle_strip, max_vertices = 3) out; + +layout (binding = 0) uniform UBO +{ + mat4 projection[2]; + mat4 modelview[2]; + vec4 lightPos; +} ubo; + +layout (location = 0) in vec3 inNormal[]; +layout (location = 1) in vec3 inColor[]; + +layout (location = 0) out vec3 outNormal; +layout (location = 1) out vec3 outColor; +layout (location = 2) out vec3 outViewVec; +layout (location = 3) out vec3 outLightVec; + +void main(void) +{ + for(int i = 0; i < gl_in.length(); i++) + { + outNormal = mat3(ubo.modelview[gl_InvocationID]) * inNormal[i]; + outColor = inColor[i]; + + vec4 pos = gl_in[i].gl_Position; + vec4 worldPos = (ubo.modelview[gl_InvocationID] * pos); + + vec3 lPos = vec3(ubo.modelview[gl_InvocationID] * ubo.lightPos); + outLightVec = lPos - worldPos.xyz; + outViewVec = -worldPos.xyz; + + gl_Position = ubo.projection[gl_InvocationID] * worldPos; + + // Set the viewport index that the vertex will be emitted to + gl_ViewportIndex = gl_InvocationID; + gl_PrimitiveID = gl_PrimitiveIDIn; + EmitVertex(); + } + EndPrimitive(); +} diff --git a/Test/spv.debuginfo.glsl.tesc b/Test/spv.debuginfo.glsl.tesc new file mode 100644 index 000000000..41c8fe3ad --- /dev/null +++ b/Test/spv.debuginfo.glsl.tesc @@ -0,0 +1,140 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#version 450 + +layout(set = 0, binding = 0) uniform UBO +{ + mat4 projection; + mat4 modelview; + vec4 lightPos; + vec4 frustumPlanes[6]; + float displacementFactor; + float tessellationFactor; + vec2 viewportDim; + float tessellatedEdgeSize; +} ubo; + +layout(set = 0, binding = 1) uniform sampler2D samplerHeight; + +layout (vertices = 4) out; + +layout (location = 0) in vec3 inNormal[]; +layout (location = 1) in vec2 inUV[]; + +layout (location = 0) out vec3 outNormal[4]; +layout (location = 1) out vec2 outUV[4]; + +// Calculate the tessellation factor based on screen space +// dimensions of the edge +float screenSpaceTessFactor(vec4 p0, vec4 p1) +{ + // Calculate edge mid point + vec4 midPoint = 0.5 * (p0 + p1); + // Sphere radius as distance between the control points + float radius = distance(p0, p1) / 2.0; + + // View space + vec4 v0 = ubo.modelview * midPoint; + + // Project into clip space + vec4 clip0 = (ubo.projection * (v0 - vec4(radius, vec3(0.0)))); + vec4 clip1 = (ubo.projection * (v0 + vec4(radius, vec3(0.0)))); + + // Get normalized device coordinates + clip0 /= clip0.w; + clip1 /= clip1.w; + + // Convert to viewport coordinates + clip0.xy *= ubo.viewportDim; + clip1.xy *= ubo.viewportDim; + + // Return the tessellation factor based on the screen size + // given by the distance of the two edge control points in screen space + // and a reference (min.) tessellation size for the edge set by the application + return clamp(distance(clip0, clip1) / ubo.tessellatedEdgeSize * ubo.tessellationFactor, 1.0, 64.0); +} + +// Checks the current's patch visibility against the frustum using a sphere check +// Sphere radius is given by the patch size +bool frustumCheck() +{ + // Fixed radius (increase if patch size is increased in example) + const float radius = 8.0f; + vec4 pos = gl_in[gl_InvocationID].gl_Position; + pos.y -= textureLod(samplerHeight, inUV[0], 0.0).r * ubo.displacementFactor; + + // Check sphere against frustum planes + for (int i = 0; i < 6; i++) { + if (dot(pos, ubo.frustumPlanes[i]) + radius < 0.0) + { + return false; + } + } + return true; +} + +void main() +{ + if (gl_InvocationID == 0) + { + if (!frustumCheck()) + { + gl_TessLevelInner[0] = 0.0; + gl_TessLevelInner[1] = 0.0; + gl_TessLevelOuter[0] = 0.0; + gl_TessLevelOuter[1] = 0.0; + gl_TessLevelOuter[2] = 0.0; + gl_TessLevelOuter[3] = 0.0; + } + else + { + if (ubo.tessellationFactor > 0.0) + { + gl_TessLevelOuter[0] = screenSpaceTessFactor(gl_in[3].gl_Position, gl_in[0].gl_Position); + gl_TessLevelOuter[1] = screenSpaceTessFactor(gl_in[0].gl_Position, gl_in[1].gl_Position); + gl_TessLevelOuter[2] = screenSpaceTessFactor(gl_in[1].gl_Position, gl_in[2].gl_Position); + gl_TessLevelOuter[3] = screenSpaceTessFactor(gl_in[2].gl_Position, gl_in[3].gl_Position); + gl_TessLevelInner[0] = mix(gl_TessLevelOuter[0], gl_TessLevelOuter[3], 0.5); + gl_TessLevelInner[1] = mix(gl_TessLevelOuter[2], gl_TessLevelOuter[1], 0.5); + } + else + { + // Tessellation factor can be set to zero by example + // to demonstrate a simple passthrough + gl_TessLevelInner[0] = 1.0; + gl_TessLevelInner[1] = 1.0; + gl_TessLevelOuter[0] = 1.0; + gl_TessLevelOuter[1] = 1.0; + gl_TessLevelOuter[2] = 1.0; + gl_TessLevelOuter[3] = 1.0; + } + } + + } + + gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; + outNormal[gl_InvocationID] = inNormal[gl_InvocationID]; + outUV[gl_InvocationID] = inUV[gl_InvocationID]; +} diff --git a/Test/spv.debuginfo.glsl.tese b/Test/spv.debuginfo.glsl.tese new file mode 100644 index 000000000..f24ed949c --- /dev/null +++ b/Test/spv.debuginfo.glsl.tese @@ -0,0 +1,78 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#version 450 + +layout (set = 0, binding = 0) uniform UBO +{ + mat4 projection; + mat4 modelview; + vec4 lightPos; + vec4 frustumPlanes[6]; + float displacementFactor; + float tessellationFactor; + vec2 viewportDim; + float tessellatedEdgeSize; +} ubo; + +layout (set = 0, binding = 1) uniform sampler2D displacementMap; + +layout(quads, equal_spacing, cw) in; + +layout (location = 0) in vec3 inNormal[]; +layout (location = 1) in vec2 inUV[]; + +layout (location = 0) out vec3 outNormal; +layout (location = 1) out vec2 outUV; +layout (location = 2) out vec3 outViewVec; +layout (location = 3) out vec3 outLightVec; +layout (location = 4) out vec3 outEyePos; +layout (location = 5) out vec3 outWorldPos; + +void main() +{ + // Interpolate UV coordinates + vec2 uv1 = mix(inUV[0], inUV[1], gl_TessCoord.x); + vec2 uv2 = mix(inUV[3], inUV[2], gl_TessCoord.x); + outUV = mix(uv1, uv2, gl_TessCoord.y); + + vec3 n1 = mix(inNormal[0], inNormal[1], gl_TessCoord.x); + vec3 n2 = mix(inNormal[3], inNormal[2], gl_TessCoord.x); + outNormal = mix(n1, n2, gl_TessCoord.y); + + // Interpolate positions + vec4 pos1 = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x); + vec4 pos2 = mix(gl_in[3].gl_Position, gl_in[2].gl_Position, gl_TessCoord.x); + vec4 pos = mix(pos1, pos2, gl_TessCoord.y); + // Displace + pos.y -= textureLod(displacementMap, outUV, 0.0).r * ubo.displacementFactor; + // Perspective projection + gl_Position = ubo.projection * ubo.modelview * pos; + + // Calculate vectors for lighting based on tessellated position + outViewVec = -pos.xyz; + outLightVec = normalize(ubo.lightPos.xyz + outViewVec); + outWorldPos = pos.xyz; + outEyePos = vec3(ubo.modelview * pos); +} diff --git a/Test/spv.debuginfo.glsl.vert b/Test/spv.debuginfo.glsl.vert new file mode 100644 index 000000000..d922d9579 --- /dev/null +++ b/Test/spv.debuginfo.glsl.vert @@ -0,0 +1,105 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#version 450 + +// Vertex attributes +layout (location = 0) in vec3 inPos; +layout (location = 1) in vec3 inNormal; +layout (location = 2) in vec2 inUV; +layout (location = 3) in vec3 inColor; + +// Instanced attributes +layout (location = 4) in vec3 instancePos; +layout (location = 5) in vec3 instanceRot; +layout (location = 6) in float instanceScale; +layout (location = 7) in int instanceTexIndex; + +layout (binding = 0) uniform UBO +{ + mat4 projection; + mat4 modelview; + vec4 lightPos; + float locSpeed; + float globSpeed; +} ubo; + +layout (location = 0) out vec3 outNormal; +layout (location = 1) out vec3 outColor; +layout (location = 2) out vec3 outUV; +layout (location = 3) out vec3 outViewVec; +layout (location = 4) out vec3 outLightVec; + +void main() +{ + outColor = inColor; + outUV = vec3(inUV, instanceTexIndex); + + mat3 mx, my, mz; + + // rotate around x + float s = sin(instanceRot.x + ubo.locSpeed); + float c = cos(instanceRot.x + ubo.locSpeed); + + mx[0] = vec3(c, s, 0.0); + mx[1] = vec3(-s, c, 0.0); + mx[2] = vec3(0.0, 0.0, 1.0); + + // rotate around y + s = sin(instanceRot.y + ubo.locSpeed); + c = cos(instanceRot.y + ubo.locSpeed); + + my[0] = vec3(c, 0.0, s); + my[1] = vec3(0.0, 1.0, 0.0); + my[2] = vec3(-s, 0.0, c); + + // rot around z + s = sin(instanceRot.z + ubo.locSpeed); + c = cos(instanceRot.z + ubo.locSpeed); + + mz[0] = vec3(1.0, 0.0, 0.0); + mz[1] = vec3(0.0, c, s); + mz[2] = vec3(0.0, -s, c); + + mat3 rotMat = mz * my * mx; + + mat4 gRotMat; + s = sin(instanceRot.y + ubo.globSpeed); + c = cos(instanceRot.y + ubo.globSpeed); + gRotMat[0] = vec4(c, 0.0, s, 0.0); + gRotMat[1] = vec4(0.0, 1.0, 0.0, 0.0); + gRotMat[2] = vec4(-s, 0.0, c, 0.0); + gRotMat[3] = vec4(0.0, 0.0, 0.0, 1.0); + + vec4 locPos = vec4(inPos.xyz * rotMat, 1.0); + vec4 pos = vec4((locPos.xyz * instanceScale) + instancePos, 1.0); + + gl_Position = ubo.projection * ubo.modelview * gRotMat * pos; + outNormal = mat3(ubo.modelview * gRotMat) * inverse(rotMat) * inNormal; + + pos = ubo.modelview * vec4(inPos.xyz + instancePos, 1.0); + vec3 lPos = mat3(ubo.modelview) * ubo.lightPos.xyz; + outLightVec = lPos - pos.xyz; + outViewVec = -pos.xyz; +} diff --git a/Test/spv.debuginfo.hlsl.comp b/Test/spv.debuginfo.hlsl.comp new file mode 100644 index 000000000..b700534e0 --- /dev/null +++ b/Test/spv.debuginfo.hlsl.comp @@ -0,0 +1,184 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Google LLC +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +struct Particle { + float4 pos; + float4 vel; + float4 uv; + float4 normal; + float pinned; +}; + +[[vk::binding(0)]] +StructuredBuffer particleIn; +[[vk::binding(1)]] +RWStructuredBuffer particleOut; + +struct UBO +{ + float deltaT; + float particleMass; + float springStiffness; + float damping; + float restDistH; + float restDistV; + float restDistD; + float sphereRadius; + float4 spherePos; + float4 gravity; + int2 particleCount; +}; + +cbuffer ubo : register(b2) +{ + UBO params; +}; + +#ifdef GLSLANG +layout ( push_constant ) cbuffer PushConstants +{ + uint calculateNormals; +} pushConstants; +#else +struct PushConstants +{ + uint calculateNormals; +}; + +[[vk::push_constant]] +PushConstants pushConstants; +#endif + +float3 springForce(float3 p0, float3 p1, float restDist) +{ + float3 dist = p0 - p1; + return normalize(dist) * params.springStiffness * (length(dist) - restDist); +} + +[numthreads(10, 10, 1)] +void main(uint3 id : SV_DispatchThreadID) +{ + uint index = id.y * params.particleCount.x + id.x; + if (index > params.particleCount.x * params.particleCount.y) + return; + + // Pinned? + if (particleIn[index].pinned == 1.0) { + particleOut[index].pos = particleOut[index].pos; + particleOut[index].vel = float4(0, 0, 0, 0); + return; + } + + // Initial force from gravity + float3 force = params.gravity.xyz * params.particleMass; + + float3 pos = particleIn[index].pos.xyz; + float3 vel = particleIn[index].vel.xyz; + + // Spring forces from neighboring particles + // left + if (id.x > 0) { + force += springForce(particleIn[index-1].pos.xyz, pos, params.restDistH); + } + // right + if (id.x < params.particleCount.x - 1) { + force += springForce(particleIn[index + 1].pos.xyz, pos, params.restDistH); + } + // upper + if (id.y < params.particleCount.y - 1) { + force += springForce(particleIn[index + params.particleCount.x].pos.xyz, pos, params.restDistV); + } + // lower + if (id.y > 0) { + force += springForce(particleIn[index - params.particleCount.x].pos.xyz, pos, params.restDistV); + } + // upper-left + if ((id.x > 0) && (id.y < params.particleCount.y - 1)) { + force += springForce(particleIn[index + params.particleCount.x - 1].pos.xyz, pos, params.restDistD); + } + // lower-left + if ((id.x > 0) && (id.y > 0)) { + force += springForce(particleIn[index - params.particleCount.x - 1].pos.xyz, pos, params.restDistD); + } + // upper-right + if ((id.x < params.particleCount.x - 1) && (id.y < params.particleCount.y - 1)) { + force += springForce(particleIn[index + params.particleCount.x + 1].pos.xyz, pos, params.restDistD); + } + // lower-right + if ((id.x < params.particleCount.x - 1) && (id.y > 0)) { + force += springForce(particleIn[index - params.particleCount.x + 1].pos.xyz, pos, params.restDistD); + } + + force += (-params.damping * vel); + + // Integrate + float3 f = force * (1.0 / params.particleMass); + particleOut[index].pos = float4(pos + vel * params.deltaT + 0.5 * f * params.deltaT * params.deltaT, 1.0); + particleOut[index].vel = float4(vel + f * params.deltaT, 0.0); + + // Sphere collision + float3 sphereDist = particleOut[index].pos.xyz - params.spherePos.xyz; + if (length(sphereDist) < params.sphereRadius + 0.01) { + // If the particle is inside the sphere, push it to the outer radius + particleOut[index].pos.xyz = params.spherePos.xyz + normalize(sphereDist) * (params.sphereRadius + 0.01); + // Cancel out velocity + particleOut[index].vel = float4(0, 0, 0, 0); + } + + // Normals + if (pushConstants.calculateNormals == 1) { + float3 normal = float3(0, 0, 0); + float3 a, b, c; + if (id.y > 0) { + if (id.x > 0) { + a = particleIn[index - 1].pos.xyz - pos; + b = particleIn[index - params.particleCount.x - 1].pos.xyz - pos; + c = particleIn[index - params.particleCount.x].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + if (id.x < params.particleCount.x - 1) { + a = particleIn[index - params.particleCount.x].pos.xyz - pos; + b = particleIn[index - params.particleCount.x + 1].pos.xyz - pos; + c = particleIn[index + 1].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + } + if (id.y < params.particleCount.y - 1) { + if (id.x > 0) { + a = particleIn[index + params.particleCount.x].pos.xyz - pos; + b = particleIn[index + params.particleCount.x - 1].pos.xyz - pos; + c = particleIn[index - 1].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + if (id.x < params.particleCount.x - 1) { + a = particleIn[index + 1].pos.xyz - pos; + b = particleIn[index + params.particleCount.x + 1].pos.xyz - pos; + c = particleIn[index + params.particleCount.x].pos.xyz - pos; + normal += cross(a,b) + cross(b,c); + } + } + particleOut[index].normal = float4(normalize(normal), 0.0f); + } +} diff --git a/Test/spv.debuginfo.hlsl.frag b/Test/spv.debuginfo.hlsl.frag new file mode 100644 index 000000000..93072d4b1 --- /dev/null +++ b/Test/spv.debuginfo.hlsl.frag @@ -0,0 +1,197 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Google LLC +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +Texture2D textureposition : register(t1); +SamplerState samplerposition : register(s1); +Texture2D textureNormal : register(t2); +SamplerState samplerNormal : register(s2); +Texture2D textureAlbedo : register(t3); +SamplerState samplerAlbedo : register(s3); +// Depth from the light's point of view +//layout (binding = 5) uniform sampler2DShadow samplerShadowMap; +Texture2DArray textureShadowMap : register(t5); +SamplerState samplerShadowMap : register(s5); + +#define LIGHT_COUNT 3 +#define SHADOW_FACTOR 0.25 +#define AMBIENT_LIGHT 0.1 +#define USE_PCF + +struct Light +{ + float4 position; + float4 target; + float4 color; + float4x4 viewMatrix; +}; + +struct UBO +{ + float4 viewPos; + Light lights[LIGHT_COUNT]; + int useShadows; + int displayDebugTarget; +}; + +cbuffer ubo : register(b4) { UBO ubo; } + +float textureProj(float4 P, float layer, float2 offset) +{ + float shadow = 1.0; + float4 shadowCoord = P / P.w; + shadowCoord.xy = shadowCoord.xy * 0.5 + 0.5; + + if (shadowCoord.z > -1.0 && shadowCoord.z < 1.0) + { + float dist = textureShadowMap.Sample(samplerShadowMap, float3(shadowCoord.xy + offset, layer)).r; + if (shadowCoord.w > 0.0 && dist < shadowCoord.z) + { + shadow = SHADOW_FACTOR; + } + } + return shadow; +} + +float filterPCF(float4 sc, float layer) +{ + int2 texDim; int elements; int levels; + textureShadowMap.GetDimensions(0, texDim.x, texDim.y, elements, levels); + float scale = 1.5; + float dx = scale * 1.0 / float(texDim.x); + float dy = scale * 1.0 / float(texDim.y); + + float shadowFactor = 0.0; + int count = 0; + int range = 1; + + for (int x = -range; x <= range; x++) + { + for (int y = -range; y <= range; y++) + { + shadowFactor += textureProj(sc, layer, float2(dx*x, dy*y)); + count++; + } + + } + return shadowFactor / count; +} + +float3 shadow(float3 fragcolor, float3 fragPos) { + for (int i = 0; i < LIGHT_COUNT; ++i) + { + float4 shadowClip = mul(ubo.lights[i].viewMatrix, float4(fragPos.xyz, 1.0)); + + float shadowFactor; + #ifdef USE_PCF + shadowFactor= filterPCF(shadowClip, i); + #else + shadowFactor = textureProj(shadowClip, i, float2(0.0, 0.0)); + #endif + + fragcolor *= shadowFactor; + } + return fragcolor; +} + +float4 main([[vk::location(0)]] float2 inUV : TEXCOORD0) : SV_TARGET +{ + // Get G-Buffer values + float3 fragPos = textureposition.Sample(samplerposition, inUV).rgb; + float3 normal = textureNormal.Sample(samplerNormal, inUV).rgb; + float4 albedo = textureAlbedo.Sample(samplerAlbedo, inUV); + + float3 fragcolor; + + // Debug display + if (ubo.displayDebugTarget > 0) { + switch (ubo.displayDebugTarget) { + case 1: + fragcolor.rgb = shadow(float3(1.0, 1.0, 1.0), fragPos); + break; + case 2: + fragcolor.rgb = fragPos; + break; + case 3: + fragcolor.rgb = normal; + break; + case 4: + fragcolor.rgb = albedo.rgb; + break; + case 5: + fragcolor.rgb = albedo.aaa; + break; + } + return float4(fragcolor, 1.0); + } + + // Ambient part + fragcolor = albedo.rgb * AMBIENT_LIGHT; + + float3 N = normalize(normal); + + for(int i = 0; i < LIGHT_COUNT; ++i) + { + // Vector to light + float3 L = ubo.lights[i].position.xyz - fragPos; + // Distance from light to fragment position + float dist = length(L); + L = normalize(L); + + // Viewer to fragment + float3 V = ubo.viewPos.xyz - fragPos; + V = normalize(V); + + float lightCosInnerAngle = cos(radians(15.0)); + float lightCosOuterAngle = cos(radians(25.0)); + float lightRange = 100.0; + + // Direction vector from source to target + float3 dir = normalize(ubo.lights[i].position.xyz - ubo.lights[i].target.xyz); + + // Dual cone spot light with smooth transition between inner and outer angle + float cosDir = dot(L, dir); + float spotEffect = smoothstep(lightCosOuterAngle, lightCosInnerAngle, cosDir); + float heightAttenuation = smoothstep(lightRange, 0.0f, dist); + + // Diffuse lighting + float NdotL = max(0.0, dot(N, L)); + float3 diff = NdotL.xxx; + + // Specular lighting + float3 R = reflect(-L, N); + float NdotR = max(0.0, dot(R, V)); + float3 spec = (pow(NdotR, 16.0) * albedo.a * 2.5).xxx; + + fragcolor += float3((diff + spec) * spotEffect * heightAttenuation) * ubo.lights[i].color.rgb * albedo.rgb; + } + + // Shadow calculations in a separate pass + if (ubo.useShadows > 0) + { + fragcolor = shadow(fragcolor, fragPos); + } + + return float4(fragcolor, 1); +} diff --git a/Test/spv.debuginfo.hlsl.geom b/Test/spv.debuginfo.hlsl.geom new file mode 100644 index 000000000..71f9b7c11 --- /dev/null +++ b/Test/spv.debuginfo.hlsl.geom @@ -0,0 +1,79 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Google LLC +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +struct UBO +{ + float4x4 projection[2]; + float4x4 modelview[2]; + float4 lightPos; +}; + +cbuffer ubo : register(b0) { UBO ubo; } + +struct VSOutput +{ + float4 Pos : SV_POSITION; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float3 Color : COLOR0; +}; + +struct GSOutput +{ + float4 Pos : SV_POSITION; + uint ViewportIndex : SV_ViewportArrayIndex; + uint PrimitiveID : SV_PrimitiveID; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float3 Color : COLOR0; +[[vk::location(2)]] float3 ViewVec : TEXCOOR1; +[[vk::location(3)]] float3 LightVec : TEXCOOR2; +}; + +[maxvertexcount(3)] +[instance(2)] +void main(triangle VSOutput input[3], inout TriangleStream outStream, uint InvocationID : SV_GSInstanceID, uint PrimitiveID : SV_PrimitiveID) +{ + for(int i = 0; i < 3; i++) + { + GSOutput output = (GSOutput)0; + output.Normal = mul((float3x3)ubo.modelview[InvocationID], input[i].Normal); + output.Color = input[i].Color; + + float4 pos = input[i].Pos; + float4 worldPos = mul(ubo.modelview[InvocationID], pos); + + float3 lPos = mul(ubo.modelview[InvocationID], ubo.lightPos).xyz; + output.LightVec = lPos - worldPos.xyz; + output.ViewVec = -worldPos.xyz; + + output.Pos = mul(ubo.projection[InvocationID], worldPos); + + // Set the viewport index that the vertex will be emitted to + output.ViewportIndex = InvocationID; + output.PrimitiveID = PrimitiveID; + outStream.Append( output ); + } + + outStream.RestartStrip(); +} diff --git a/Test/spv.debuginfo.hlsl.tesc b/Test/spv.debuginfo.hlsl.tesc new file mode 100644 index 000000000..ba5270158 --- /dev/null +++ b/Test/spv.debuginfo.hlsl.tesc @@ -0,0 +1,164 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Google LLC +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +struct UBO +{ + float4x4 projection; + float4x4 modelview; + float4 lightPos; + float4 frustumPlanes[6]; + float displacementFactor; + float tessellationFactor; + float2 viewportDim; + float tessellatedEdgeSize; +}; +cbuffer ubo : register(b0) { UBO ubo; }; + +Texture2D textureHeight : register(t1); +SamplerState samplerHeight : register(s1); + +struct VSOutput +{ + float4 Pos : SV_POSITION; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float2 UV : TEXCOORD0; +}; + +struct HSOutput +{ +[[vk::location(2)]] float4 Pos : SV_POSITION; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float2 UV : TEXCOORD0; +}; + +struct ConstantsHSOutput +{ + float TessLevelOuter[4] : SV_TessFactor; + float TessLevelInner[2] : SV_InsideTessFactor; +}; + +// Calculate the tessellation factor based on screen space +// dimensions of the edge +float screenSpaceTessFactor(float4 p0, float4 p1) +{ + // Calculate edge mid point + float4 midPoint = 0.5 * (p0 + p1); + // Sphere radius as distance between the control points + float radius = distance(p0, p1) / 2.0; + + // View space + float4 v0 = mul(ubo.modelview, midPoint); + + // Project into clip space + float4 clip0 = mul(ubo.projection, (v0 - float4(radius, float3(0.0, 0.0, 0.0)))); + float4 clip1 = mul(ubo.projection, (v0 + float4(radius, float3(0.0, 0.0, 0.0)))); + + // Get normalized device coordinates + clip0 /= clip0.w; + clip1 /= clip1.w; + + // Convert to viewport coordinates + clip0.xy *= ubo.viewportDim; + clip1.xy *= ubo.viewportDim; + + // Return the tessellation factor based on the screen size + // given by the distance of the two edge control points in screen space + // and a reference (min.) tessellation size for the edge set by the application + return clamp(distance(clip0, clip1) / ubo.tessellatedEdgeSize * ubo.tessellationFactor, 1.0, 64.0); +} + +// Checks the current's patch visibility against the frustum using a sphere check +// Sphere radius is given by the patch size +bool frustumCheck(float4 Pos, float2 inUV) +{ + // Fixed radius (increase if patch size is increased in example) + const float radius = 8.0f; + float4 pos = Pos; + pos.y -= textureHeight.SampleLevel(samplerHeight, inUV, 0.0).r * ubo.displacementFactor; + + // Check sphere against frustum planes + for (int i = 0; i < 6; i++) { + if (dot(pos, ubo.frustumPlanes[i]) + radius < 0.0) + { + return false; + } + } + return true; +} + +ConstantsHSOutput ConstantsHS(InputPatch patch) +{ + ConstantsHSOutput output = (ConstantsHSOutput)0; + + if (!frustumCheck(patch[0].Pos, patch[0].UV)) + { + output.TessLevelInner[0] = 0.0; + output.TessLevelInner[1] = 0.0; + output.TessLevelOuter[0] = 0.0; + output.TessLevelOuter[1] = 0.0; + output.TessLevelOuter[2] = 0.0; + output.TessLevelOuter[3] = 0.0; + } + else + { + if (ubo.tessellationFactor > 0.0) + { + output.TessLevelOuter[0] = screenSpaceTessFactor(patch[3].Pos, patch[0].Pos); + output.TessLevelOuter[1] = screenSpaceTessFactor(patch[0].Pos, patch[1].Pos); + output.TessLevelOuter[2] = screenSpaceTessFactor(patch[1].Pos, patch[2].Pos); + output.TessLevelOuter[3] = screenSpaceTessFactor(patch[2].Pos, patch[3].Pos); + output.TessLevelInner[0] = lerp(output.TessLevelOuter[0], output.TessLevelOuter[3], 0.5); + output.TessLevelInner[1] = lerp(output.TessLevelOuter[2], output.TessLevelOuter[1], 0.5); + } + else + { + // Tessellation factor can be set to zero by example + // to demonstrate a simple passthrough + output.TessLevelInner[0] = 1.0; + output.TessLevelInner[1] = 1.0; + output.TessLevelOuter[0] = 1.0; + output.TessLevelOuter[1] = 1.0; + output.TessLevelOuter[2] = 1.0; + output.TessLevelOuter[3] = 1.0; + } + } + + return output; +} + +[domain("quad")] +[partitioning("integer")] +[outputtopology("triangle_cw")] +[outputcontrolpoints(4)] +[patchconstantfunc("ConstantsHS")] +[maxtessfactor(20.0f)] +HSOutput main(InputPatch patch, uint InvocationID : SV_OutputControlPointID) +{ + HSOutput output = (HSOutput)0; + output.Pos = patch[InvocationID].Pos; + output.Normal = patch[InvocationID].Normal; + output.UV = patch[InvocationID].UV; + return output; +} diff --git a/Test/spv.debuginfo.hlsl.tese b/Test/spv.debuginfo.hlsl.tese new file mode 100644 index 000000000..e7add05bf --- /dev/null +++ b/Test/spv.debuginfo.hlsl.tese @@ -0,0 +1,94 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Google LLC +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +struct UBO +{ + float4x4 projection; + float4x4 modelview; + float4 lightPos; + float4 frustumPlanes[6]; + float displacementFactor; + float tessellationFactor; + float2 viewportDim; + float tessellatedEdgeSize; +}; +cbuffer ubo : register(b0) { UBO ubo; }; + +Texture2D displacementMapTexture : register(t1); +SamplerState displacementMapSampler : register(s1); + +struct HSOutput +{ +[[vk::location(2)]] float4 Pos : SV_POSITION; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float2 UV : TEXCOORD0; +}; + +struct ConstantsHSOutput +{ + float TessLevelOuter[4] : SV_TessFactor; + float TessLevelInner[2] : SV_InsideTessFactor; +}; + +struct DSOutput +{ + float4 Pos : SV_POSITION; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float2 UV : TEXCOORD0; +[[vk::location(2)]] float3 ViewVec : TEXCOORD1; +[[vk::location(3)]] float3 LightVec : TEXCOORD2; +[[vk::location(4)]] float3 EyePos : POSITION1; +[[vk::location(5)]] float3 WorldPos : POSITION0; +}; + +[domain("quad")] +DSOutput main(ConstantsHSOutput input, float2 TessCoord : SV_DomainLocation, const OutputPatch patch) +{ + // Interpolate UV coordinates + DSOutput output = (DSOutput)0; + float2 uv1 = lerp(patch[0].UV, patch[1].UV, TessCoord.x); + float2 uv2 = lerp(patch[3].UV, patch[2].UV, TessCoord.x); + output.UV = lerp(uv1, uv2, TessCoord.y); + + float3 n1 = lerp(patch[0].Normal, patch[1].Normal, TessCoord.x); + float3 n2 = lerp(patch[3].Normal, patch[2].Normal, TessCoord.x); + output.Normal = lerp(n1, n2, TessCoord.y); + + // Interpolate positions + float4 pos1 = lerp(patch[0].Pos, patch[1].Pos, TessCoord.x); + float4 pos2 = lerp(patch[3].Pos, patch[2].Pos, TessCoord.x); + float4 pos = lerp(pos1, pos2, TessCoord.y); + // Displace + pos.y -= displacementMapTexture.SampleLevel(displacementMapSampler, output.UV, 0.0).r * ubo.displacementFactor; + // Perspective projection + output.Pos = mul(ubo.projection, mul(ubo.modelview, pos)); + + // Calculate vectors for lighting based on tessellated position + output.ViewVec = -pos.xyz; + output.LightVec = normalize(ubo.lightPos.xyz + output.ViewVec); + output.WorldPos = pos.xyz; + output.EyePos = mul(ubo.modelview, pos).xyz; + return output; +} diff --git a/Test/spv.debuginfo.hlsl.vert b/Test/spv.debuginfo.hlsl.vert new file mode 100644 index 000000000..7d34ef430 --- /dev/null +++ b/Test/spv.debuginfo.hlsl.vert @@ -0,0 +1,112 @@ +/* +The MIT License (MIT) + +Copyright (c) 2022 Google LLC +Copyright (c) 2022 Sascha Willems + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +struct VSInput +{ +[[vk::location(0)]] float3 Pos : POSITION0; +[[vk::location(1)]] float3 Normal : NORMAL0; +[[vk::location(2)]] float2 UV : TEXCOORD0; +[[vk::location(3)]] float3 Color : COLOR0; + +// Instanced attributes +[[vk::location(4)]] float3 instancePos : POSITION1; +[[vk::location(5)]] float3 instanceRot : TEXCOORD1; +[[vk::location(6)]] float instanceScale : TEXCOORD2; +[[vk::location(7)]] int instanceTexIndex : TEXCOORD3; +}; + +struct UBO +{ + float4x4 projection; + float4x4 modelview; + float4 lightPos; + float locSpeed; + float globSpeed; +}; + +cbuffer ubo : register(b0) { UBO ubo; } + +struct VSOutput +{ + float4 Pos : SV_POSITION; +[[vk::location(0)]] float3 Normal : NORMAL0; +[[vk::location(1)]] float3 Color : COLOR0; +[[vk::location(2)]] float3 UV : TEXCOORD0; +[[vk::location(3)]] float3 ViewVec : TEXCOORD1; +[[vk::location(4)]] float3 LightVec : TEXCOORD2; +}; + +VSOutput main(VSInput input) +{ + VSOutput output = (VSOutput)0; + output.Color = input.Color; + output.UV = float3(input.UV, input.instanceTexIndex); + + // rotate around x + float s = sin(input.instanceRot.x + ubo.locSpeed); + float c = cos(input.instanceRot.x + ubo.locSpeed); + + float3x3 mx = { c, -s, 0.0, + s, c, 0.0, + 0.0, 0.0, 1.0 }; + + // rotate around y + s = sin(input.instanceRot.y + ubo.locSpeed); + c = cos(input.instanceRot.y + ubo.locSpeed); + + float3x3 my = { c, 0.0, -s, + 0.0, 1.0, 0.0, + s, 0.0, c }; + + // rot around z + s = sin(input.instanceRot.z + ubo.locSpeed); + c = cos(input.instanceRot.z + ubo.locSpeed); + + float3x3 mz = { 1.0, 0.0, 0.0, + 0.0, c, -s, + 0.0, s, c }; + + float3x3 rotMat = mul(mz, mul(my, mx)); + + float4x4 gRotMat; + s = sin(input.instanceRot.y + ubo.globSpeed); + c = cos(input.instanceRot.y + ubo.globSpeed); + gRotMat[0] = float4(c, 0.0, -s, 0.0); + gRotMat[1] = float4(0.0, 1.0, 0.0, 0.0); + gRotMat[2] = float4(s, 0.0, c, 0.0); + gRotMat[3] = float4(0.0, 0.0, 0.0, 1.0); + + float4 locPos = float4(mul(rotMat, input.Pos.xyz), 1.0); + float4 pos = float4((locPos.xyz * input.instanceScale) + input.instancePos, 1.0); + + output.Pos = mul(ubo.projection, mul(ubo.modelview, mul(gRotMat, pos))); + output.Normal = mul((float3x3)mul(ubo.modelview, gRotMat), mul(rotMat, input.Normal)); + + pos = mul(ubo.modelview, float4(input.Pos.xyz + input.instancePos, 1.0)); + float3 lPos = mul((float3x3)ubo.modelview, ubo.lightPos.xyz); + output.LightVec = lPos - pos.xyz; + output.ViewVec = -pos.xyz; + return output; +} diff --git a/glslang/HLSL/hlslGrammar.cpp b/glslang/HLSL/hlslGrammar.cpp index bd4af922a..a01f24035 100644 --- a/glslang/HLSL/hlslGrammar.cpp +++ b/glslang/HLSL/hlslGrammar.cpp @@ -3428,7 +3428,7 @@ bool HlslGrammar::acceptCompoundStatement(TIntermNode*& retStatement) } } if (compoundStatement) - compoundStatement->setOperator(EOpSequence); + compoundStatement->setOperator(intermediate.getDebugInfo() ? EOpScope : EOpSequence); retStatement = compoundStatement; diff --git a/glslang/HLSL/hlslParseHelper.cpp b/glslang/HLSL/hlslParseHelper.cpp index ffa1d7a65..62e46a093 100644 --- a/glslang/HLSL/hlslParseHelper.cpp +++ b/glslang/HLSL/hlslParseHelper.cpp @@ -2442,6 +2442,11 @@ void HlslParseContext::remapNonEntryPointIO(TFunction& function) clearUniformInputOutput(function[i].type->getQualifier()); } +TIntermNode* HlslParseContext::handleDeclare(const TSourceLoc& loc, TIntermTyped* var) +{ + return intermediate.addUnaryNode(EOpDeclare, var, loc, TType(EbtVoid)); +} + // Handle function returns, including type conversions to the function return type // if necessary. TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermTyped* value) @@ -8035,11 +8040,16 @@ TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TStr if (flattenVar) flatten(*symbol->getAsVariable(), symbolTable.atGlobalLevel()); - if (initializer == nullptr) - return nullptr; + TVariable* variable = symbol->getAsVariable(); + + if (initializer == nullptr) { + if (intermediate.getDebugInfo()) + return executeDeclaration(loc, variable); + else + return nullptr; + } // Deal with initializer - TVariable* variable = symbol->getAsVariable(); if (variable == nullptr) { error(loc, "initializer requires a variable, not a member", identifier.c_str(), ""); return nullptr; @@ -8106,6 +8116,24 @@ TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TStrin return nullptr; } +// Return a declaration of a temporary variable +// +// This is used to force a variable to be declared in the correct scope +// when debug information is being generated. + +TIntermNode* HlslParseContext::executeDeclaration(const TSourceLoc& loc, TVariable* variable) +{ + // + // Identifier must be of type temporary. + // + TStorageQualifier qualifier = variable->getType().getQualifier().storage; + if (qualifier != EvqTemporary) + return nullptr; + + TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); + return handleDeclare(loc, intermSymbol); +} + // // Handle all types of initializers from the grammar. // diff --git a/glslang/HLSL/hlslParseHelper.h b/glslang/HLSL/hlslParseHelper.h index 8bebb0e2b..96d85f434 100644 --- a/glslang/HLSL/hlslParseHelper.h +++ b/glslang/HLSL/hlslParseHelper.h @@ -87,6 +87,7 @@ public: void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node); void remapEntryPointIO(TFunction& function, TVariable*& returnValue, TVector& inputs, TVector& outputs); void remapNonEntryPointIO(TFunction& function); + TIntermNode* handleDeclare(const TSourceLoc&, TIntermTyped*); TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*); void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg); TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right); @@ -243,6 +244,7 @@ protected: TIntermSymbol* makeInternalVariableNode(const TSourceLoc&, const char* name, const TType&) const; TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&, bool track); void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&, bool track); + TIntermNode* executeDeclaration(const TSourceLoc&, TVariable* variable); TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer, TIntermTyped* scalarInit); bool isScalarConstructor(const TIntermNode*); diff --git a/glslang/Include/glslang_c_interface.h b/glslang/Include/glslang_c_interface.h index 9e5909ce8..5553205d1 100644 --- a/glslang/Include/glslang_c_interface.h +++ b/glslang/Include/glslang_c_interface.h @@ -207,6 +207,8 @@ typedef struct glslang_spv_options_s { bool optimize_size; bool disassemble; bool validate; + bool emit_nonsemantic_shader_debug_info; + bool emit_nonsemantic_shader_debug_source; } glslang_spv_options_t; #ifdef __cplusplus diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index a64ed6837..e9595cd43 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -67,6 +67,7 @@ class TIntermediate; enum TOperator { EOpNull, // if in a node, should only mean a node is still being built EOpSequence, // denotes a list of statements, or parameters, etc. + EOpScope, // Used by debugging to denote a scoped list of statements EOpLinkerObjects, // for aggregate node of objects the linker may need, if not reference by the rest of the AST EOpFunctionCall, EOpFunction, // For function definition @@ -91,6 +92,8 @@ enum TOperator { EOpCopyObject, + EOpDeclare, // Used by debugging to force declaration of variable in correct scope + // (u)int* -> bool EOpConvInt8ToBool, EOpConvUint8ToBool, diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 14fd053a7..6a43ef3e8 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -2733,10 +2733,10 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init TIntermAggregate* loopSequence = (initializer == nullptr || initializer->getAsAggregate() == nullptr) ? makeAggregate(initializer, loc) : initializer->getAsAggregate(); - if (loopSequence != nullptr && loopSequence->getOp() == EOpSequence) + if (loopSequence != nullptr && (loopSequence->getOp() == EOpSequence || loopSequence->getOp() == EOpScope)) loopSequence->setOp(EOpNull); loopSequence = growAggregate(loopSequence, node); - loopSequence->setOperator(EOpSequence); + loopSequence->setOperator(getDebugInfo() ? EOpScope : EOpSequence); return loopSequence; } diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index a5ba40e6d..5b15b3134 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -1839,6 +1839,7 @@ void TShader::setOverrideVersion(int version) overrideVersion = version; } +void TShader::setDebugInfo(bool debugInfo) { intermediate->setDebugInfo(debugInfo); } void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); } void TShader::setDxPositionW(bool invert) { intermediate->setDxPositionW(invert); } void TShader::setEnhancedMsgs() { intermediate->setEnhancedMsgs(); } diff --git a/glslang/MachineIndependent/glslang.m4 b/glslang/MachineIndependent/glslang.m4 index 3ab7a3c0a..7d32548c8 100644 --- a/glslang/MachineIndependent/glslang.m4 +++ b/glslang/MachineIndependent/glslang.m4 @@ -3726,7 +3726,7 @@ compound_statement } RIGHT_BRACE { if ($3 && $3->getAsAggregate()) - $3->getAsAggregate()->setOperator(EOpSequence); + $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); $$ = $3; } ; diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index d77c83158..8669a6ba3 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -151,7 +151,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %parse-param {glslang::TParseContext* pParseContext} %lex-param {parseContext} -%pure-parser // enable thread safety +%define api.pure // enable thread safety %expect 1 // One shift reduce conflict because of if | else %token CONST BOOL INT UINT FLOAT @@ -3726,7 +3726,7 @@ compound_statement } RIGHT_BRACE { if ($3 && $3->getAsAggregate()) - $3->getAsAggregate()->setOperator(EOpSequence); + $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); $$ = $3; } ; diff --git a/glslang/MachineIndependent/glslang_tab.cpp b/glslang/MachineIndependent/glslang_tab.cpp index 4e4768eaa..f12503f69 100644 --- a/glslang/MachineIndependent/glslang_tab.cpp +++ b/glslang/MachineIndependent/glslang_tab.cpp @@ -11085,7 +11085,7 @@ yyreduce: #line 3727 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) - (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } #line 11092 "MachineIndependent/glslang_tab.cpp" diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index d8a3aab5d..808ddb2eb 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -665,6 +665,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpConstructReference: out.debug << "Construct reference type"; break; + case EOpDeclare: out.debug << "Declare"; break; + #ifndef GLSLANG_WEB case EOpSpirvInst: out.debug << "spirv_instruction"; break; #endif @@ -692,6 +694,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node switch (node->getOp()) { case EOpSequence: out.debug << "Sequence\n"; return true; + case EOpScope: out.debug << "Scope\n"; return true; case EOpLinkerObjects: out.debug << "Linker Objects\n"; return true; case EOpComma: out.debug << "Comma"; break; case EOpFunction: out.debug << "Function Definition: " << node->getName(); break; @@ -1107,7 +1110,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node default: out.debug.message(EPrefixError, "Bad aggregation op"); } - if (node->getOp() != EOpSequence && node->getOp() != EOpParameters) + if (node->getOp() != EOpSequence && node->getOp() != EOpScope && node->getOp() != EOpParameters) out.debug << " (" << node->getCompleteString() << ")"; out.debug << "\n"; diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 6e60155aa..72665f2d8 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -319,6 +319,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(autoMapLocations); MERGE_TRUE(invertY); MERGE_TRUE(dxPositionW); + MERGE_TRUE(debugInfo); MERGE_TRUE(flattenUniformArrays); MERGE_TRUE(useUnknownFormat); MERGE_TRUE(hlslOffsets); diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index ddeaa3530..736e7a43d 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -292,6 +292,7 @@ public: invertY(false), dxPositionW(false), enhancedMsgs(false), + debugInfo(false), useStorageBuffer(false), invariantAll(false), nanMinMaxClamp(false), @@ -461,6 +462,12 @@ public: const std::string& getEntryPointName() const { return entryPointName; } const std::string& getEntryPointMangledName() const { return entryPointMangledName; } + void setDebugInfo(bool debuginfo) + { + debugInfo = debuginfo; + } + bool getDebugInfo() const { return debugInfo; } + void setInvertY(bool invert) { invertY = invert; @@ -1109,6 +1116,7 @@ protected: bool invertY; bool dxPositionW; bool enhancedMsgs; + bool debugInfo; bool useStorageBuffer; bool invariantAll; bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index e44339db5..0fdff4fcd 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -472,6 +472,7 @@ public: GLSLANG_EXPORT void addProcesses(const std::vector&); GLSLANG_EXPORT void setUniqueId(unsigned long long id); GLSLANG_EXPORT void setOverrideVersion(int version); + GLSLANG_EXPORT void setDebugInfo(bool debugInfo); // IO resolver binding data: see comments in ShaderLang.cpp GLSLANG_EXPORT void setShiftBinding(TResourceType res, unsigned int base); diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp index d3e38bb7f..597425762 100644 --- a/gtests/Hlsl.FromFile.cpp +++ b/gtests/Hlsl.FromFile.cpp @@ -65,6 +65,7 @@ using HlslLegalizeTest = GlslangTest<::testing::TestWithParam>; using HlslDX9CompatibleTest = GlslangTest<::testing::TestWithParam>; using HlslLegalDebugTest = GlslangTest<::testing::TestWithParam>; +using HlslNonSemanticShaderDebugInfoTest = GlslangTest<::testing::TestWithParam>; // Compiling HLSL to pre-legalized SPIR-V under Vulkan semantics. Expected // to successfully generate both AST and SPIR-V. @@ -136,6 +137,13 @@ TEST_P(HlslLegalDebugTest, FromFile) "/baseResults/", true, true); } +TEST_P(HlslNonSemanticShaderDebugInfoTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, + Target::Spv, true, GetParam().entryPoint, "/baseResults/", false, false, true); +} + // clang-format off INSTANTIATE_TEST_SUITE_P( ToSpirv, HlslCompileTest, @@ -527,7 +535,21 @@ INSTANTIATE_TEST_SUITE_P( }), FileNameAsCustomTestSuffix ); +// clang-format on +// clang-format off +INSTANTIATE_TEST_SUITE_P( + ToSpirv, HlslNonSemanticShaderDebugInfoTest, + ::testing::ValuesIn(std::vector{ + {"spv.debuginfo.hlsl.vert", "main"}, + {"spv.debuginfo.hlsl.frag", "main"}, + {"spv.debuginfo.hlsl.comp", "main"}, + {"spv.debuginfo.hlsl.geom", "main"}, + {"spv.debuginfo.hlsl.tesc", "main"}, + {"spv.debuginfo.hlsl.tese", "main"}, + }), + FileNameAsCustomTestSuffix +); // clang-format on } // anonymous namespace diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index 5d60ccde7..dac7e7a78 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -80,6 +80,7 @@ using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam>; using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam>; using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam>; +using CompileVulkanToNonSemanticShaderDebugInfoTest = GlslangTest<::testing::TestWithParam>; // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully // generate SPIR-V. @@ -229,6 +230,13 @@ TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile) Target::Spv); } +TEST_P(CompileVulkanToNonSemanticShaderDebugInfoTest, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0, + Target::Spv, true, "", "/baseResults/", false, false, true); +} + // clang-format off INSTANTIATE_TEST_SUITE_P( Glsl, CompileVulkanToSpirvTest, @@ -812,6 +820,7 @@ INSTANTIATE_TEST_SUITE_P( })), FileNameAsCustomTestSuffix ); + INSTANTIATE_TEST_SUITE_P( Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest, ::testing::ValuesIn(std::vector({ @@ -819,6 +828,19 @@ INSTANTIATE_TEST_SUITE_P( })), FileNameAsCustomTestSuffix ); + +INSTANTIATE_TEST_SUITE_P( + Glsl, CompileVulkanToNonSemanticShaderDebugInfoTest, + ::testing::ValuesIn(std::vector({ + "spv.debuginfo.glsl.vert", + "spv.debuginfo.glsl.frag", + "spv.debuginfo.glsl.comp", + "spv.debuginfo.glsl.geom", + "spv.debuginfo.glsl.tesc", + "spv.debuginfo.glsl.tese" + })), + FileNameAsCustomTestSuffix +); // clang-format on } // anonymous namespace diff --git a/gtests/TestFixture.h b/gtests/TestFixture.h index 5b66dece7..d087d6ddc 100644 --- a/gtests/TestFixture.h +++ b/gtests/TestFixture.h @@ -217,6 +217,7 @@ public: EShTextureSamplerTransformMode texSampTransMode = EShTexSampTransKeep, bool enableOptimizer = false, bool enableDebug = false, + bool enableNonSemanticShaderDebugInfo = false, bool automap = true) { const EShLanguage stage = GetShaderStage(GetSuffix(shaderName)); @@ -263,6 +264,8 @@ public: std::vector spirv_binary; options().disableOptimizer = !enableOptimizer; options().generateDebugInfo = enableDebug; + options().emitNonSemanticShaderDebugInfo = enableNonSemanticShaderDebugInfo; + options().emitNonSemanticShaderDebugSource = enableNonSemanticShaderDebugInfo; glslang::GlslangToSpv(*program.getIntermediate(stage), spirv_binary, &logger, &options()); @@ -448,7 +451,8 @@ public: const std::string& entryPointName="", const std::string& baseDir="/baseResults/", const bool enableOptimizer = false, - const bool enableDebug = false) + const bool enableDebug = false, + const bool enableNonSemanticShaderDebugInfo = false) { const std::string inputFname = testDir + "/" + testName; const std::string expectedOutputFname = @@ -464,7 +468,8 @@ public: if (enableDebug) controls = static_cast(controls | EShMsgDebugInfo); GlslangResult result = compileAndLink(testName, input, entryPointName, controls, clientTargetVersion, - targetLanguageVersion, false, EShTexSampTransKeep, enableOptimizer, enableDebug, automap); + targetLanguageVersion, false, EShTexSampTransKeep, enableOptimizer, enableDebug, + enableNonSemanticShaderDebugInfo, automap); // Generate the hybrid output in the way of glslangValidator. std::ostringstream stream; diff --git a/license-checker.cfg b/license-checker.cfg index 51ce2762c..15b8f9729 100644 --- a/license-checker.cfg +++ b/license-checker.cfg @@ -36,6 +36,7 @@ "SPIRV/GLSL.*.h", "SPIRV/NonSemanticDebugPrintf.h", + "SPIRV/NonSemanticShaderDebugInfo100.h", "SPIRV/spirv.hpp" ] }