diff --git a/SPIRV/GLSL.std.450.h b/SPIRV/GLSL.std.450.h index d1c9b5c1d44f791dfa1146fd85f81893143bb43a..df31092bec0254591771b0c5ae25bc3b64feb908 100755 --- a/SPIRV/GLSL.std.450.h +++ b/SPIRV/GLSL.std.450.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2014-2015 The Khronos Group Inc. +** Copyright (c) 2014-2016 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"), @@ -27,8 +27,8 @@ #ifndef GLSLstd450_H #define GLSLstd450_H -const int GLSLstd450Version = 99; -const int GLSLstd450Revision = 3; +static const int GLSLstd450Version = 100; +static const int GLSLstd450Revision = 1; enum GLSLstd450 { GLSLstd450Bad = 0, // Don't use @@ -83,7 +83,7 @@ enum GLSLstd450 { GLSLstd450UClamp = 44, GLSLstd450SClamp = 45, GLSLstd450FMix = 46, - GLSLstd450IMix = 47, + GLSLstd450IMix = 47, // Reserved GLSLstd450Step = 48, GLSLstd450SmoothStep = 49, @@ -121,6 +121,10 @@ enum GLSLstd450 { GLSLstd450InterpolateAtSample = 77, GLSLstd450InterpolateAtOffset = 78, + GLSLstd450NMin = 79, + GLSLstd450NMax = 80, + GLSLstd450NClamp = 81, + GLSLstd450Count }; diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index ed86cc2d77bd1c485c5040caaaddfa765418bcfa..864902ccb14f16ac1a3ef5481aa03060e6cc31c5 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1,5 +1,6 @@ // -//Copyright (C) 2014 LunarG, Inc. +//Copyright (C) 2014-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -95,6 +96,7 @@ protected: spv::Id getSampledType(const glslang::TSampler&); spv::Id convertGlslangToSpvType(const glslang::TType& type); spv::Id convertGlslangToSpvType(const glslang::TType& type, glslang::TLayoutPacking, const glslang::TQualifier&); + spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim); spv::Id accessChainLoad(const glslang::TType& type); glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const; int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); @@ -195,6 +197,8 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type) else if (type.getQualifier().isPipeOutput()) return spv::StorageClassOutput; else if (type.getQualifier().isUniformOrBuffer()) { + if (type.getQualifier().layoutPushConstant) + return spv::StorageClassPushConstant; if (type.getBasicType() == glslang::EbtBlock) return spv::StorageClassUniform; else if (type.getBasicType() == glslang::EbtAtomicUint) @@ -225,6 +229,7 @@ spv::Dim TranslateDimensionality(const glslang::TSampler& sampler) case glslang::EsdCube: return spv::DimCube; case glslang::EsdRect: return spv::DimRect; case glslang::EsdBuffer: return spv::DimBuffer; + case glslang::EsdSubpass: return spv::DimSubpassData; default: assert(0); return spv::Dim2D; @@ -376,6 +381,8 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI case glslang::EbvPosition: return spv::BuiltInPosition; case glslang::EbvVertexId: return spv::BuiltInVertexId; case glslang::EbvInstanceId: return spv::BuiltInInstanceId; + case glslang::EbvVertexIndex: return spv::BuiltInVertexIndex; + case glslang::EbvInstanceIndex: return spv::BuiltInInstanceIndex; case glslang::EbvBaseVertex: case glslang::EbvBaseInstance: case glslang::EbvDrawId: @@ -492,6 +499,25 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy } } +// Return whether or not the given type is something that should be tied to a +// descriptor set. +bool IsDescriptorResource(const glslang::TType& type) +{ + // uniform and buffer blocks are included + if (type.getBasicType() == glslang::EbtBlock) + return type.getQualifier().isUniformOrBuffer(); + + // non block... + // basically samplerXXX/subpass/sampler/texture are all included + // if they are the global-scope-class, not the function parameter + // (or local, if they ever exist) class. + if (type.getBasicType() == glslang::EbtSampler) + return type.getQualifier().isUniformOrBuffer(); + + // None of the above. + return false; +} + void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& parent) { if (child.layoutMatrix == glslang::ElmNone) @@ -708,7 +734,7 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) } // Only process non-linkage-only nodes for generating actual static uses - if (! linkageOnly) { + if (! linkageOnly || symbol->getQualifier().isSpecConstant()) { // Prepare to generate code for the access // L-value chains will be computed left to right. We're on the symbol now, @@ -717,10 +743,14 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) builder.clearAccessChain(); // For now, we consider all user variables as being in memory, so they are pointers, - // except for "const in" arguments to a function, which are an intermediate object. - // See comments in handleUserFunctionCall(). - glslang::TStorageQualifier qualifier = symbol->getQualifier().storage; - if (qualifier == glslang::EvqConstReadOnly && constReadOnlyParameters.find(symbol->getId()) != constReadOnlyParameters.end()) + // except for + // A) "const in" arguments to a function, which are an intermediate object. + // See comments in handleUserFunctionCall(). + // B) Specialization constants (normal constant don't even come in as a variable), + // These are also pure R-values. + glslang::TQualifier qualifier = symbol->getQualifier(); + if ((qualifier.storage == glslang::EvqConstReadOnly && constReadOnlyParameters.find(symbol->getId()) != constReadOnlyParameters.end()) || + qualifier.isSpecConstant()) builder.setAccessChainRValue(id); else builder.setAccessChainLValue(id); @@ -1110,9 +1140,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt { if (node->isUserDefined()) result = handleUserFunctionCall(node); - assert(result); - builder.clearAccessChain(); - builder.setAccessChainRValue(result); + //assert(result); // this can happen for bad shaders because the call graph completeness checking is not yet done + if (result) { + builder.clearAccessChain(); + builder.setAccessChainRValue(result); + } else + spv::MissingFunctionality("missing user function; linker needs to catch that"); return false; } @@ -1157,12 +1190,15 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructUVec3: case glslang::EOpConstructUVec4: case glslang::EOpConstructStruct: + case glslang::EOpConstructTextureSampler: { std::vector<spv::Id> arguments; translateArguments(*node, arguments); spv::Id resultTypeId = convertGlslangToSpvType(node->getType()); spv::Id constructed; - if (node->getOp() == glslang::EOpConstructStruct || node->getType().isArray()) { + if (node->getOp() == glslang::EOpConstructTextureSampler) + constructed = builder.createOp(spv::OpSampledImage, resultTypeId, arguments); + else if (node->getOp() == glslang::EOpConstructStruct || node->getType().isArray()) { std::vector<spv::Id> constituents; for (int c = 0; c < (int)arguments.size(); ++c) constituents.push_back(arguments[c]); @@ -1640,11 +1676,17 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtSampler: { const glslang::TSampler& sampler = type.getSampler(); - // an image is present, make its type - spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), sampler.shadow, sampler.arrayed, sampler.ms, - sampler.image ? 2 : 1, TranslateImageFormat(type)); - if (! sampler.image) { - spvType = builder.makeSampledImageType(spvType); + if (sampler.sampler) { + // pure sampler + spvType = builder.makeSamplerType(); + } else { + // an image is present, make its type + spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), sampler.shadow, sampler.arrayed, sampler.ms, + sampler.image ? 2 : 1, TranslateImageFormat(type)); + if (sampler.combined) { + // already has both image and sampler, make the combined type + spvType = builder.makeSampledImageType(spvType); + } } } break; @@ -1790,12 +1832,10 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // make the arrays for (int dim = type.getArraySizes()->getNumDims() - 1; dim > 0; --dim) { - int size = type.getArraySizes()->getDimSize(dim); - assert(size > 0); - spvType = builder.makeArrayType(spvType, size, stride); + spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), dim), stride); if (stride > 0) builder.addDecoration(spvType, spv::DecorationArrayStride, stride); - stride *= size; + stride *= type.getArraySizes()->getDimSize(dim); } } else { // single-dimensional array, and don't yet have stride @@ -1810,7 +1850,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeRuntimeArray(spvType); } else { assert(type.getOuterArraySize() > 0); - spvType = builder.makeArrayType(spvType, type.getOuterArraySize(), stride); + spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), 0), stride); } if (stride > 0) builder.addDecoration(spvType, spv::DecorationArrayStride, stride); @@ -1819,6 +1859,26 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty return spvType; } +// Turn the expression forming the array size into an id. +// This is not quite trivial, because of specialization constants. +// Sometimes, a raw constant is turned into an Id, and sometimes +// a specialization constant expression is. +spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arraySizes, int dim) +{ + // First, see if this is sized with a node, meaning a specialization constant: + glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim); + if (specNode != nullptr) { + builder.clearAccessChain(); + specNode->traverse(this); + return accessChainLoad(specNode->getAsTyped()->getType()); + } + + // Otherwise, need a compile-time (front end) size, get it: + int size = arraySizes.getDimSize(dim); + assert(size > 0); + return builder.makeUintConstant(size); +} + // Wrap the builder's accessChainLoad to: // - localize handling of RelaxedPrecision // - use the SPIR-V inferred type instead of another conversion of the glslang type @@ -1891,7 +1951,7 @@ int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, gl // 'currentOffset' should be passed in already initialized, ready to modify, and reflecting // the migration of data from nextOffset -> currentOffset. It should be -1 on the first call. // -1 means a non-forced member offset (no decoration needed). -void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, +void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& /*structType*/, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) { // this will get a positive value when deemed necessary @@ -2169,6 +2229,24 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO std::vector<spv::Id> operands; auto opIt = arguments.begin(); operands.push_back(*(opIt++)); + + // Handle subpass operations + // TODO: GLSL should change to have the "MS" only on the type rather than the + // built-in function. + if (cracked.subpass) { + // add on the (0,0) coordinate + spv::Id zero = builder.makeIntConstant(0); + std::vector<spv::Id> comps; + comps.push_back(zero); + comps.push_back(zero); + operands.push_back(builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps)); + if (sampler.ms) { + operands.push_back(spv::ImageOperandsSampleMask); + operands.push_back(*(opIt++)); + } + return builder.createOp(spv::OpImageRead, convertGlslangToSpvType(node->getType()), operands); + } + operands.push_back(*(opIt++)); if (node->getOp() == glslang::EOpImageLoad) { if (sampler.ms) { @@ -3109,7 +3187,7 @@ spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vector } // For glslang ops that map to SPV atomic opCodes -spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy) { spv::Op opCode = spv::OpNop; @@ -3244,8 +3322,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpMix: if (isFloat) libCall = spv::GLSLstd450FMix; - else - libCall = spv::GLSLstd450IMix; + else { + opCode = spv::OpSelect; + spv::MissingFunctionality("translating integer mix to OpSelect"); + } builder.promoteScalar(precision, operands.front(), operands.back()); break; case glslang::EOpStep: @@ -3439,6 +3519,8 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (! symbol->getType().isStruct()) { addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); + if (symbol->getType().getQualifier().hasSpecConstantId()) + addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); if (symbol->getQualifier().hasLocation()) builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); if (symbol->getQualifier().hasIndex()) @@ -3463,8 +3545,14 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } if (symbol->getQualifier().hasSet()) builder.addDecoration(id, spv::DecorationDescriptorSet, symbol->getQualifier().layoutSet); + else if (IsDescriptorResource(symbol->getType())) { + // default to 0 + builder.addDecoration(id, spv::DecorationDescriptorSet, 0); + } if (symbol->getQualifier().hasBinding()) builder.addDecoration(id, spv::DecorationBinding, symbol->getQualifier().layoutBinding); + if (symbol->getQualifier().hasAttachment()) + builder.addDecoration(id, spv::DecorationInputAttachmentIndex, symbol->getQualifier().layoutAttachment); if (glslangIntermediate->getXfbMode()) { builder.addCapability(spv::CapabilityTransformFeedback); if (symbol->getQualifier().hasXfbStride()) @@ -3510,7 +3598,7 @@ void TGlslangToSpvTraverser::addMemberDecoration(spv::Id id, int member, spv::De } // Make a full tree of instructions to build a SPIR-V specialization constant, -// or regularly constant if possible. +// or regular constant if possible. // // TBD: this is not yet done, nor verified to be the best design, it does do the leaf symbols though // @@ -3523,10 +3611,38 @@ spv::Id TGlslangToSpvTraverser::createSpvSpecConstant(const glslang::TIntermType { assert(node.getQualifier().storage == glslang::EvqConst); - // hand off to the non-spec-constant path - assert(node.getAsConstantUnion() != nullptr || node.getAsSymbolNode() != nullptr); - int nextConst = 0; - return createSpvConstant(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), nextConst, false); + if (! node.getQualifier().specConstant) { + // hand off to the non-spec-constant path + assert(node.getAsConstantUnion() != nullptr || node.getAsSymbolNode() != nullptr); + int nextConst = 0; + return createSpvConstant(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), + nextConst, false); + } + + // We now know we have a specialization constant to build + + if (node.getAsSymbolNode() && node.getQualifier().hasSpecConstantId()) { + // this is a direct literal assigned to a layout(constant_id=) declaration + int nextConst = 0; + return createSpvConstant(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), + nextConst, true); + } else { + // gl_WorkgroupSize is a special case until the front-end handles hierarchical specialization constants, + // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ... + if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) { + std::vector<spv::Id> dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) + addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); + } + return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); + } else { + spv::MissingFunctionality("specialization-constant expression trees"); + return spv::NoResult; + } + } } // Use 'consts' as the flattened glslang source of scalar constants to recursively diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp index a6290477790c5e44f5dce8b309d2d2971c058631..965867efb0281fc7ed2225b596afaf3aa560d562 100755 --- a/SPIRV/SPVRemapper.cpp +++ b/SPIRV/SPVRemapper.cpp @@ -437,7 +437,7 @@ namespace spv { } // Store IDs from instruction in our map - for (int op = 0; op < spv::InstructionDesc[opCode].operands.getNum(); ++op, --numOperands) { + for (int op = 0; numOperands > 0; ++op, --numOperands) { switch (spv::InstructionDesc[opCode].operands.getClass(op)) { case spv::OperandId: idFn(asId(word++)); diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 2d6e50ece7bdb687c6a0dea2582f996204e8117f..c6699444b15db5389fa46160ccf77c70b05a3e4c 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1,5 +1,6 @@ // -//Copyright (C) 2014 LunarG, Inc. +//Copyright (C) 2014-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -308,11 +309,9 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) // TODO: performance: track arrays per stride // If a stride is supplied (non-zero) make an array. // If no stride (0), reuse previous array types. -Id Builder::makeArrayType(Id element, unsigned size, int stride) +// 'size' is an Id of a constant or specialization constant of the array size +Id Builder::makeArrayType(Id element, Id sizeId, int stride) { - // First, we need a constant instruction for the size - Id sizeId = makeUintConstant(size); - Instruction* type; if (stride == 0) { // try to find existing type @@ -518,8 +517,12 @@ int Builder::getNumTypeConstituents(Id typeId) const return 1; case OpTypeVector: case OpTypeMatrix: - case OpTypeArray: return instr->getImmediateOperand(1); + case OpTypeArray: + { + Id lengthId = instr->getImmediateOperand(1); + return module.getInstruction(lengthId)->getImmediateOperand(0); + } case OpTypeStruct: return instr->getNumOperands(); default: @@ -647,16 +650,19 @@ Id Builder::makeBoolConstant(bool b, bool specConstant) Instruction* constant; Op opcode = specConstant ? (b ? OpSpecConstantTrue : OpSpecConstantFalse) : (b ? OpConstantTrue : OpConstantFalse); - // See if we already made it - Id existing = 0; - for (int i = 0; i < (int)groupedConstants[OpTypeBool].size(); ++i) { - constant = groupedConstants[OpTypeBool][i]; - if (constant->getTypeId() == typeId && constant->getOpCode() == opcode) - existing = constant->getResultId(); - } + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = 0; + for (int i = 0; i < (int)groupedConstants[OpTypeBool].size(); ++i) { + constant = groupedConstants[OpTypeBool][i]; + if (constant->getTypeId() == typeId && constant->getOpCode() == opcode) + existing = constant->getResultId(); + } - if (existing) - return existing; + if (existing) + return existing; + } // Make it Instruction* c = new Instruction(getUniqueId(), typeId, opcode); @@ -670,9 +676,14 @@ Id Builder::makeBoolConstant(bool b, bool specConstant) Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) { Op opcode = specConstant ? OpSpecConstant : OpConstant; - Id existing = findScalarConstant(OpTypeInt, opcode, typeId, value); - if (existing) - return existing; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(OpTypeInt, opcode, typeId, value); + if (existing) + return existing; + } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); @@ -688,9 +699,14 @@ Id Builder::makeFloatConstant(float f, bool specConstant) Op opcode = specConstant ? OpSpecConstant : OpConstant; Id typeId = makeFloatType(32); unsigned value = *(unsigned int*)&f; - Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, value); - if (existing) - return existing; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, value); + if (existing) + return existing; + } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); @@ -708,9 +724,14 @@ Id Builder::makeDoubleConstant(double d, bool specConstant) unsigned long long value = *(unsigned long long*)&d; unsigned op1 = value & 0xFFFFFFFF; unsigned op2 = value >> 32; - Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, op1, op2); - if (existing) - return existing; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(OpTypeFloat, opcode, typeId, op1, op2); + if (existing) + return existing; + } Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(op1); @@ -751,8 +772,9 @@ Id Builder::findCompositeConstant(Op typeClass, std::vector<Id>& comps) const } // Comments in header -Id Builder::makeCompositeConstant(Id typeId, std::vector<Id>& members) +Id Builder::makeCompositeConstant(Id typeId, std::vector<Id>& members, bool specConstant) { + Op opcode = specConstant ? OpSpecConstantComposite : OpConstantComposite; assert(typeId); Op typeClass = getTypeClass(typeId); @@ -767,11 +789,13 @@ Id Builder::makeCompositeConstant(Id typeId, std::vector<Id>& members) return makeFloatConstant(0.0); } - Id existing = findCompositeConstant(typeClass, members); - if (existing) - return existing; + if (! specConstant) { + Id existing = findCompositeConstant(typeClass, members); + if (existing) + return existing; + } - Instruction* c = new Instruction(getUniqueId(), typeId, OpConstantComposite); + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); for (int op = 0; op < (int)members.size(); ++op) c->addIdOperand(members[op]); constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(c)); diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index b2daffb609519afe8a5a24ff348d1d464548e047..d6dc612184e8c16d661636d1609ebbf9ac61ad17 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -1,5 +1,6 @@ // -//Copyright (C) 2014 LunarG, Inc. +//Copyright (C) 2014-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -104,7 +105,7 @@ public: Id makeStructResultType(Id type0, Id type1); Id makeVectorType(Id component, int size); Id makeMatrixType(Id component, int cols, int rows); - Id makeArrayType(Id element, unsigned size, int stride); // 0 means no stride decoration + Id makeArrayType(Id element, Id sizeId, int stride); // 0 stride means no stride decoration Id makeRuntimeArray(Id element); Id makeFunctionType(Id returnType, const std::vector<Id>& paramTypes); Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format); @@ -189,7 +190,7 @@ public: Id makeDoubleConstant(double d, bool specConstant = false); // Turn the array of constants into a proper spv constant of the requested type. - Id makeCompositeConstant(Id type, std::vector<Id>& comps); + Id makeCompositeConstant(Id type, std::vector<Id>& comps, bool specConst = false); // Methods for adding information outside the CFG. Instruction* addEntryPoint(ExecutionModel, Function*, const char* name); diff --git a/SPIRV/disassemble.cpp b/SPIRV/disassemble.cpp index 08f905ef71e9d5008d7f00666c7153fc6e5ad293..b2d30bec866ada9178fd200f7d10f8fbd914b110 100755 --- a/SPIRV/disassemble.cpp +++ b/SPIRV/disassemble.cpp @@ -473,6 +473,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, else out << OperandClassParams[operandClass].getName(stream[word++]); --numOperands; + break; } } @@ -531,7 +532,6 @@ void GLSLstd450GetDebugNames(const char** names) names[GLSLstd450SClamp] = "SClamp"; names[GLSLstd450UClamp] = "UClamp"; names[GLSLstd450FMix] = "FMix"; - names[GLSLstd450IMix] = "IMix"; names[GLSLstd450Step] = "Step"; names[GLSLstd450SmoothStep] = "SmoothStep"; names[GLSLstd450Fma] = "Fma"; diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index 64a55f996727addebbe806ba687ce89c8425e72b..7cf1c87f0814cfe1bb83dc7878b7c0c09e421b48 100755 --- a/SPIRV/doc.cpp +++ b/SPIRV/doc.cpp @@ -712,7 +712,7 @@ const char* KernelProfilingInfoString(int info) } } -const int CapabilityCeiling = 57; +const int CapabilityCeiling = 58; const char* CapabilityString(int info) { @@ -775,6 +775,7 @@ const char* CapabilityString(int info) case 54: return "GeometryStreams"; case 55: return "StorageImageReadWithoutFormat"; case 56: return "StorageImageWriteWithoutFormat"; + case 57: return "MultiViewport"; case CapabilityCeiling: default: return "Bad"; @@ -1104,6 +1105,7 @@ const char* OpcodeString(int op) case 317: return "OpNoLine"; case 318: return "OpAtomicFlagTestAndSet"; case 319: return "OpAtomicFlagClear"; + case 320: return "OpImageSparseRead"; case OpcodeCeiling: default: @@ -1311,7 +1313,6 @@ void Parameterize() CapabilityParams[CapabilityTessellation].caps.push_back(CapabilityShader); CapabilityParams[CapabilityVector16].caps.push_back(CapabilityKernel); CapabilityParams[CapabilityFloat16Buffer].caps.push_back(CapabilityKernel); - CapabilityParams[CapabilityFloat16].caps.push_back(CapabilityFloat16Buffer); CapabilityParams[CapabilityInt64Atomics].caps.push_back(CapabilityInt64); CapabilityParams[CapabilityImageBasic].caps.push_back(CapabilityKernel); CapabilityParams[CapabilityImageReadWrite].caps.push_back(CapabilityImageBasic); @@ -1353,6 +1354,7 @@ void Parameterize() CapabilityParams[CapabilityGeometryStreams].caps.push_back(CapabilityGeometry); CapabilityParams[CapabilityStorageImageReadWithoutFormat].caps.push_back(CapabilityShader); CapabilityParams[CapabilityStorageImageWriteWithoutFormat].caps.push_back(CapabilityShader); + CapabilityParams[CapabilityMultiViewport].caps.push_back(CapabilityGeometry); AddressingParams[AddressingModelPhysical32].caps.push_back(CapabilityAddresses); AddressingParams[AddressingModelPhysical64].caps.push_back(CapabilityAddresses); @@ -1362,7 +1364,7 @@ void Parameterize() MemoryParams[MemoryModelOpenCL].caps.push_back(CapabilityKernel); MemorySemanticsParams[MemorySemanticsUniformMemoryShift].caps.push_back(CapabilityShader); - MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityShader); + MemorySemanticsParams[MemorySemanticsAtomicCounterMemoryShift].caps.push_back(CapabilityAtomicStorage); ExecutionModelParams[ExecutionModelVertex].caps.push_back(CapabilityShader); ExecutionModelParams[ExecutionModelTessellationControl].caps.push_back(CapabilityTessellation); @@ -1528,7 +1530,7 @@ void Parameterize() DecorationParams[DecorationFlat].caps.push_back(CapabilityShader); DecorationParams[DecorationPatch].caps.push_back(CapabilityTessellation); DecorationParams[DecorationCentroid].caps.push_back(CapabilityShader); - DecorationParams[DecorationSample].caps.push_back(CapabilityShader); + DecorationParams[DecorationSample].caps.push_back(CapabilitySampleRateShading); DecorationParams[DecorationInvariant].caps.push_back(CapabilityShader); DecorationParams[DecorationConstant].caps.push_back(CapabilityKernel); DecorationParams[DecorationUniform].caps.push_back(CapabilityShader); @@ -1537,14 +1539,14 @@ void Parameterize() DecorationParams[DecorationStream].caps.push_back(CapabilityGeometryStreams); DecorationParams[DecorationLocation].caps.push_back(CapabilityShader); DecorationParams[DecorationComponent].caps.push_back(CapabilityShader); + DecorationParams[DecorationOffset].caps.push_back(CapabilityShader); DecorationParams[DecorationIndex].caps.push_back(CapabilityShader); DecorationParams[DecorationBinding].caps.push_back(CapabilityShader); DecorationParams[DecorationDescriptorSet].caps.push_back(CapabilityShader); DecorationParams[DecorationXfbBuffer].caps.push_back(CapabilityTransformFeedback); DecorationParams[DecorationXfbStride].caps.push_back(CapabilityTransformFeedback); DecorationParams[DecorationArrayStride].caps.push_back(CapabilityShader); - DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityShader); - DecorationParams[DecorationBuiltIn].caps.push_back(CapabilityShader); + DecorationParams[DecorationMatrixStride].caps.push_back(CapabilityMatrix); DecorationParams[DecorationFuncParamAttr].caps.push_back(CapabilityKernel); DecorationParams[DecorationFPRoundingMode].caps.push_back(CapabilityKernel); DecorationParams[DecorationFPFastMathMode].caps.push_back(CapabilityKernel); @@ -1556,8 +1558,8 @@ void Parameterize() BuiltInParams[BuiltInPosition].caps.push_back(CapabilityShader); BuiltInParams[BuiltInPointSize].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInClipDistance].caps.push_back(CapabilityClipDistance); + BuiltInParams[BuiltInCullDistance].caps.push_back(CapabilityCullDistance); BuiltInParams[BuiltInVertexId].caps.push_back(CapabilityShader); BuiltInParams[BuiltInVertexId].desc = "Vertex ID, which takes on values 0, 1, 2, . . . ."; @@ -1576,7 +1578,7 @@ void Parameterize() BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityGeometry); BuiltInParams[BuiltInInvocationId].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInLayer].caps.push_back(CapabilityGeometry); - BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityGeometry); + BuiltInParams[BuiltInViewportIndex].caps.push_back(CapabilityMultiViewport); BuiltInParams[BuiltInTessLevelOuter].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInTessLevelInner].caps.push_back(CapabilityTessellation); BuiltInParams[BuiltInTessCoord].caps.push_back(CapabilityTessellation); @@ -1584,9 +1586,9 @@ void Parameterize() BuiltInParams[BuiltInFragCoord].caps.push_back(CapabilityShader); BuiltInParams[BuiltInPointCoord].caps.push_back(CapabilityShader); BuiltInParams[BuiltInFrontFacing].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSampleId].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilityShader); - BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilityShader); + BuiltInParams[BuiltInSampleId].caps.push_back(CapabilitySampleRateShading); + BuiltInParams[BuiltInSamplePosition].caps.push_back(CapabilitySampleRateShading); + BuiltInParams[BuiltInSampleMask].caps.push_back(CapabilitySampleRateShading); BuiltInParams[BuiltInFragDepth].caps.push_back(CapabilityShader); BuiltInParams[BuiltInHelperInvocation].caps.push_back(CapabilityShader); BuiltInParams[BuiltInWorkDim].caps.push_back(CapabilityKernel); @@ -1962,6 +1964,12 @@ void Parameterize() InstructionDesc[OpImageSparseDrefGather].operands.push(OperandVariableIds, "", true); InstructionDesc[OpImageSparseDrefGather].capabilities.push_back(CapabilitySparseResidency); + InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Image'"); + InstructionDesc[OpImageSparseRead].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[OpImageSparseRead].operands.push(OperandImageOperands, "", true); + InstructionDesc[OpImageSparseRead].operands.push(OperandVariableIds, "", true); + InstructionDesc[OpImageSparseRead].capabilities.push_back(CapabilitySparseResidency); + InstructionDesc[OpImageSparseTexelsResident].operands.push(OperandId, "'Resident Code'"); InstructionDesc[OpImageSparseTexelsResident].capabilities.push_back(CapabilitySparseResidency); diff --git a/SPIRV/doc.h b/SPIRV/doc.h index accdd65dc306b770ac2c39d1981b8bdbe1f11d4a..948b6fe0476f644408ae1e5e3d359ef5b64a1113 100755 --- a/SPIRV/doc.h +++ b/SPIRV/doc.h @@ -243,7 +243,7 @@ protected: int resultPresent : 1; }; -const int OpcodeCeiling = 320; +const int OpcodeCeiling = 321; // The set of objects that hold all the instruction/operand // parameterization information. diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index 65331d24c6f808337ec3ccaefe0265c16080b5f4..5620aba7d4148d8d99e361cfbcb802b01bc8f9cb 100755 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -1,877 +1,879 @@ -// Copyright (c) 2014-2015 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. - -// This header is automatically generated by the same tool that creates -// the Binary Section of the SPIR-V specification. - -// Enumeration tokens for SPIR-V, in various styles: -// C, C++, C++11, JSON, Lua, Python -// -// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL -// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL -// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL -// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL -// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] -// -// Some tokens act like mask values, which can be OR'd together, -// while others are mutually exclusive. The mask-like ones have -// "Mask" in their name, and a parallel enum that has the shift -// amount (1 << x) for each corresponding enumerant. - -#ifndef spirv_HPP -#define spirv_HPP - -namespace spv { - -typedef unsigned int Id; - -#define SPV_VERSION 10000 -#define SPV_REVISION 2 - -static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 2; -static const unsigned int OpCodeMask = 0xffff; -static const unsigned int WordCountShift = 16; - -enum SourceLanguage { - SourceLanguageUnknown = 0, - SourceLanguageESSL = 1, - SourceLanguageGLSL = 2, - SourceLanguageOpenCL_C = 3, - SourceLanguageOpenCL_CPP = 4, -}; - -enum ExecutionModel { - ExecutionModelVertex = 0, - ExecutionModelTessellationControl = 1, - ExecutionModelTessellationEvaluation = 2, - ExecutionModelGeometry = 3, - ExecutionModelFragment = 4, - ExecutionModelGLCompute = 5, - ExecutionModelKernel = 6, -}; - -enum AddressingModel { - AddressingModelLogical = 0, - AddressingModelPhysical32 = 1, - AddressingModelPhysical64 = 2, -}; - -enum MemoryModel { - MemoryModelSimple = 0, - MemoryModelGLSL450 = 1, - MemoryModelOpenCL = 2, -}; - -enum ExecutionMode { - ExecutionModeInvocations = 0, - ExecutionModeSpacingEqual = 1, - ExecutionModeSpacingFractionalEven = 2, - ExecutionModeSpacingFractionalOdd = 3, - ExecutionModeVertexOrderCw = 4, - ExecutionModeVertexOrderCcw = 5, - ExecutionModePixelCenterInteger = 6, - ExecutionModeOriginUpperLeft = 7, - ExecutionModeOriginLowerLeft = 8, - ExecutionModeEarlyFragmentTests = 9, - ExecutionModePointMode = 10, - ExecutionModeXfb = 11, - ExecutionModeDepthReplacing = 12, - ExecutionModeDepthGreater = 14, - ExecutionModeDepthLess = 15, - ExecutionModeDepthUnchanged = 16, - ExecutionModeLocalSize = 17, - ExecutionModeLocalSizeHint = 18, - ExecutionModeInputPoints = 19, - ExecutionModeInputLines = 20, - ExecutionModeInputLinesAdjacency = 21, - ExecutionModeTriangles = 22, - ExecutionModeInputTrianglesAdjacency = 23, - ExecutionModeQuads = 24, - ExecutionModeIsolines = 25, - ExecutionModeOutputVertices = 26, - ExecutionModeOutputPoints = 27, - ExecutionModeOutputLineStrip = 28, - ExecutionModeOutputTriangleStrip = 29, - ExecutionModeVecTypeHint = 30, - ExecutionModeContractionOff = 31, -}; - -enum StorageClass { - StorageClassUniformConstant = 0, - StorageClassInput = 1, - StorageClassUniform = 2, - StorageClassOutput = 3, - StorageClassWorkgroup = 4, - StorageClassCrossWorkgroup = 5, - StorageClassPrivate = 6, - StorageClassFunction = 7, - StorageClassGeneric = 8, - StorageClassPushConstant = 9, - StorageClassAtomicCounter = 10, - StorageClassImage = 11, -}; - -enum Dim { - Dim1D = 0, - Dim2D = 1, - Dim3D = 2, - DimCube = 3, - DimRect = 4, - DimBuffer = 5, - DimSubpassData = 6, -}; - -enum SamplerAddressingMode { - SamplerAddressingModeNone = 0, - SamplerAddressingModeClampToEdge = 1, - SamplerAddressingModeClamp = 2, - SamplerAddressingModeRepeat = 3, - SamplerAddressingModeRepeatMirrored = 4, -}; - -enum SamplerFilterMode { - SamplerFilterModeNearest = 0, - SamplerFilterModeLinear = 1, -}; - -enum ImageFormat { - ImageFormatUnknown = 0, - ImageFormatRgba32f = 1, - ImageFormatRgba16f = 2, - ImageFormatR32f = 3, - ImageFormatRgba8 = 4, - ImageFormatRgba8Snorm = 5, - ImageFormatRg32f = 6, - ImageFormatRg16f = 7, - ImageFormatR11fG11fB10f = 8, - ImageFormatR16f = 9, - ImageFormatRgba16 = 10, - ImageFormatRgb10A2 = 11, - ImageFormatRg16 = 12, - ImageFormatRg8 = 13, - ImageFormatR16 = 14, - ImageFormatR8 = 15, - ImageFormatRgba16Snorm = 16, - ImageFormatRg16Snorm = 17, - ImageFormatRg8Snorm = 18, - ImageFormatR16Snorm = 19, - ImageFormatR8Snorm = 20, - ImageFormatRgba32i = 21, - ImageFormatRgba16i = 22, - ImageFormatRgba8i = 23, - ImageFormatR32i = 24, - ImageFormatRg32i = 25, - ImageFormatRg16i = 26, - ImageFormatRg8i = 27, - ImageFormatR16i = 28, - ImageFormatR8i = 29, - ImageFormatRgba32ui = 30, - ImageFormatRgba16ui = 31, - ImageFormatRgba8ui = 32, - ImageFormatR32ui = 33, - ImageFormatRgb10a2ui = 34, - ImageFormatRg32ui = 35, - ImageFormatRg16ui = 36, - ImageFormatRg8ui = 37, - ImageFormatR16ui = 38, - ImageFormatR8ui = 39, -}; - -enum ImageChannelOrder { - ImageChannelOrderR = 0, - ImageChannelOrderA = 1, - ImageChannelOrderRG = 2, - ImageChannelOrderRA = 3, - ImageChannelOrderRGB = 4, - ImageChannelOrderRGBA = 5, - ImageChannelOrderBGRA = 6, - ImageChannelOrderARGB = 7, - ImageChannelOrderIntensity = 8, - ImageChannelOrderLuminance = 9, - ImageChannelOrderRx = 10, - ImageChannelOrderRGx = 11, - ImageChannelOrderRGBx = 12, - ImageChannelOrderDepth = 13, - ImageChannelOrderDepthStencil = 14, - ImageChannelOrdersRGB = 15, - ImageChannelOrdersRGBx = 16, - ImageChannelOrdersRGBA = 17, - ImageChannelOrdersBGRA = 18, -}; - -enum ImageChannelDataType { - ImageChannelDataTypeSnormInt8 = 0, - ImageChannelDataTypeSnormInt16 = 1, - ImageChannelDataTypeUnormInt8 = 2, - ImageChannelDataTypeUnormInt16 = 3, - ImageChannelDataTypeUnormShort565 = 4, - ImageChannelDataTypeUnormShort555 = 5, - ImageChannelDataTypeUnormInt101010 = 6, - ImageChannelDataTypeSignedInt8 = 7, - ImageChannelDataTypeSignedInt16 = 8, - ImageChannelDataTypeSignedInt32 = 9, - ImageChannelDataTypeUnsignedInt8 = 10, - ImageChannelDataTypeUnsignedInt16 = 11, - ImageChannelDataTypeUnsignedInt32 = 12, - ImageChannelDataTypeHalfFloat = 13, - ImageChannelDataTypeFloat = 14, - ImageChannelDataTypeUnormInt24 = 15, - ImageChannelDataTypeUnormInt101010_2 = 16, -}; - -enum ImageOperandsShift { - ImageOperandsBiasShift = 0, - ImageOperandsLodShift = 1, - ImageOperandsGradShift = 2, - ImageOperandsConstOffsetShift = 3, - ImageOperandsOffsetShift = 4, - ImageOperandsConstOffsetsShift = 5, - ImageOperandsSampleShift = 6, - ImageOperandsMinLodShift = 7, -}; - -enum ImageOperandsMask { - ImageOperandsMaskNone = 0, - ImageOperandsBiasMask = 0x00000001, - ImageOperandsLodMask = 0x00000002, - ImageOperandsGradMask = 0x00000004, - ImageOperandsConstOffsetMask = 0x00000008, - ImageOperandsOffsetMask = 0x00000010, - ImageOperandsConstOffsetsMask = 0x00000020, - ImageOperandsSampleMask = 0x00000040, - ImageOperandsMinLodMask = 0x00000080, -}; - -enum FPFastMathModeShift { - FPFastMathModeNotNaNShift = 0, - FPFastMathModeNotInfShift = 1, - FPFastMathModeNSZShift = 2, - FPFastMathModeAllowRecipShift = 3, - FPFastMathModeFastShift = 4, -}; - -enum FPFastMathModeMask { - FPFastMathModeMaskNone = 0, - FPFastMathModeNotNaNMask = 0x00000001, - FPFastMathModeNotInfMask = 0x00000002, - FPFastMathModeNSZMask = 0x00000004, - FPFastMathModeAllowRecipMask = 0x00000008, - FPFastMathModeFastMask = 0x00000010, -}; - -enum FPRoundingMode { - FPRoundingModeRTE = 0, - FPRoundingModeRTZ = 1, - FPRoundingModeRTP = 2, - FPRoundingModeRTN = 3, -}; - -enum LinkageType { - LinkageTypeExport = 0, - LinkageTypeImport = 1, -}; - -enum AccessQualifier { - AccessQualifierReadOnly = 0, - AccessQualifierWriteOnly = 1, - AccessQualifierReadWrite = 2, -}; - -enum FunctionParameterAttribute { - FunctionParameterAttributeZext = 0, - FunctionParameterAttributeSext = 1, - FunctionParameterAttributeByVal = 2, - FunctionParameterAttributeSret = 3, - FunctionParameterAttributeNoAlias = 4, - FunctionParameterAttributeNoCapture = 5, - FunctionParameterAttributeNoWrite = 6, - FunctionParameterAttributeNoReadWrite = 7, -}; - -enum Decoration { - DecorationRelaxedPrecision = 0, - DecorationSpecId = 1, - DecorationBlock = 2, - DecorationBufferBlock = 3, - DecorationRowMajor = 4, - DecorationColMajor = 5, - DecorationArrayStride = 6, - DecorationMatrixStride = 7, - DecorationGLSLShared = 8, - DecorationGLSLPacked = 9, - DecorationCPacked = 10, - DecorationBuiltIn = 11, - DecorationNoPerspective = 13, - DecorationFlat = 14, - DecorationPatch = 15, - DecorationCentroid = 16, - DecorationSample = 17, - DecorationInvariant = 18, - DecorationRestrict = 19, - DecorationAliased = 20, - DecorationVolatile = 21, - DecorationConstant = 22, - DecorationCoherent = 23, - DecorationNonWritable = 24, - DecorationNonReadable = 25, - DecorationUniform = 26, - DecorationSaturatedConversion = 28, - DecorationStream = 29, - DecorationLocation = 30, - DecorationComponent = 31, - DecorationIndex = 32, - DecorationBinding = 33, - DecorationDescriptorSet = 34, - DecorationOffset = 35, - DecorationXfbBuffer = 36, - DecorationXfbStride = 37, - DecorationFuncParamAttr = 38, - DecorationFPRoundingMode = 39, - DecorationFPFastMathMode = 40, - DecorationLinkageAttributes = 41, - DecorationNoContraction = 42, - DecorationInputAttachmentIndex = 43, - DecorationAlignment = 44, -}; - -enum BuiltIn { - BuiltInPosition = 0, - BuiltInPointSize = 1, - BuiltInClipDistance = 3, - BuiltInCullDistance = 4, - BuiltInVertexId = 5, - BuiltInInstanceId = 6, - BuiltInPrimitiveId = 7, - BuiltInInvocationId = 8, - BuiltInLayer = 9, - BuiltInViewportIndex = 10, - BuiltInTessLevelOuter = 11, - BuiltInTessLevelInner = 12, - BuiltInTessCoord = 13, - BuiltInPatchVertices = 14, - BuiltInFragCoord = 15, - BuiltInPointCoord = 16, - BuiltInFrontFacing = 17, - BuiltInSampleId = 18, - BuiltInSamplePosition = 19, - BuiltInSampleMask = 20, - BuiltInFragDepth = 22, - BuiltInHelperInvocation = 23, - BuiltInNumWorkgroups = 24, - BuiltInWorkgroupSize = 25, - BuiltInWorkgroupId = 26, - BuiltInLocalInvocationId = 27, - BuiltInGlobalInvocationId = 28, - BuiltInLocalInvocationIndex = 29, - BuiltInWorkDim = 30, - BuiltInGlobalSize = 31, - BuiltInEnqueuedWorkgroupSize = 32, - BuiltInGlobalOffset = 33, - BuiltInGlobalLinearId = 34, - BuiltInSubgroupSize = 36, - BuiltInSubgroupMaxSize = 37, - BuiltInNumSubgroups = 38, - BuiltInNumEnqueuedSubgroups = 39, - BuiltInSubgroupId = 40, - BuiltInSubgroupLocalInvocationId = 41, - BuiltInVertexIndex = 42, - BuiltInInstanceIndex = 43, -}; - -enum SelectionControlShift { - SelectionControlFlattenShift = 0, - SelectionControlDontFlattenShift = 1, -}; - -enum SelectionControlMask { - SelectionControlMaskNone = 0, - SelectionControlFlattenMask = 0x00000001, - SelectionControlDontFlattenMask = 0x00000002, -}; - -enum LoopControlShift { - LoopControlUnrollShift = 0, - LoopControlDontUnrollShift = 1, -}; - -enum LoopControlMask { - LoopControlMaskNone = 0, - LoopControlUnrollMask = 0x00000001, - LoopControlDontUnrollMask = 0x00000002, -}; - -enum FunctionControlShift { - FunctionControlInlineShift = 0, - FunctionControlDontInlineShift = 1, - FunctionControlPureShift = 2, - FunctionControlConstShift = 3, -}; - -enum FunctionControlMask { - FunctionControlMaskNone = 0, - FunctionControlInlineMask = 0x00000001, - FunctionControlDontInlineMask = 0x00000002, - FunctionControlPureMask = 0x00000004, - FunctionControlConstMask = 0x00000008, -}; - -enum MemorySemanticsShift { - MemorySemanticsAcquireShift = 1, - MemorySemanticsReleaseShift = 2, - MemorySemanticsAcquireReleaseShift = 3, - MemorySemanticsSequentiallyConsistentShift = 4, - MemorySemanticsUniformMemoryShift = 6, - MemorySemanticsSubgroupMemoryShift = 7, - MemorySemanticsWorkgroupMemoryShift = 8, - MemorySemanticsCrossWorkgroupMemoryShift = 9, - MemorySemanticsAtomicCounterMemoryShift = 10, - MemorySemanticsImageMemoryShift = 11, -}; - -enum MemorySemanticsMask { - MemorySemanticsMaskNone = 0, - MemorySemanticsAcquireMask = 0x00000002, - MemorySemanticsReleaseMask = 0x00000004, - MemorySemanticsAcquireReleaseMask = 0x00000008, - MemorySemanticsSequentiallyConsistentMask = 0x00000010, - MemorySemanticsUniformMemoryMask = 0x00000040, - MemorySemanticsSubgroupMemoryMask = 0x00000080, - MemorySemanticsWorkgroupMemoryMask = 0x00000100, - MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, - MemorySemanticsAtomicCounterMemoryMask = 0x00000400, - MemorySemanticsImageMemoryMask = 0x00000800, -}; - -enum MemoryAccessShift { - MemoryAccessVolatileShift = 0, - MemoryAccessAlignedShift = 1, - MemoryAccessNontemporalShift = 2, -}; - -enum MemoryAccessMask { - MemoryAccessMaskNone = 0, - MemoryAccessVolatileMask = 0x00000001, - MemoryAccessAlignedMask = 0x00000002, - MemoryAccessNontemporalMask = 0x00000004, -}; - -enum Scope { - ScopeCrossDevice = 0, - ScopeDevice = 1, - ScopeWorkgroup = 2, - ScopeSubgroup = 3, - ScopeInvocation = 4, -}; - -enum GroupOperation { - GroupOperationReduce = 0, - GroupOperationInclusiveScan = 1, - GroupOperationExclusiveScan = 2, -}; - -enum KernelEnqueueFlags { - KernelEnqueueFlagsNoWait = 0, - KernelEnqueueFlagsWaitKernel = 1, - KernelEnqueueFlagsWaitWorkGroup = 2, -}; - -enum KernelProfilingInfoShift { - KernelProfilingInfoCmdExecTimeShift = 0, -}; - -enum KernelProfilingInfoMask { - KernelProfilingInfoMaskNone = 0, - KernelProfilingInfoCmdExecTimeMask = 0x00000001, -}; - -enum Capability { - CapabilityMatrix = 0, - CapabilityShader = 1, - CapabilityGeometry = 2, - CapabilityTessellation = 3, - CapabilityAddresses = 4, - CapabilityLinkage = 5, - CapabilityKernel = 6, - CapabilityVector16 = 7, - CapabilityFloat16Buffer = 8, - CapabilityFloat16 = 9, - CapabilityFloat64 = 10, - CapabilityInt64 = 11, - CapabilityInt64Atomics = 12, - CapabilityImageBasic = 13, - CapabilityImageReadWrite = 14, - CapabilityImageMipmap = 15, - CapabilityPipes = 17, - CapabilityGroups = 18, - CapabilityDeviceEnqueue = 19, - CapabilityLiteralSampler = 20, - CapabilityAtomicStorage = 21, - CapabilityInt16 = 22, - CapabilityTessellationPointSize = 23, - CapabilityGeometryPointSize = 24, - CapabilityImageGatherExtended = 25, - CapabilityStorageImageMultisample = 27, - CapabilityUniformBufferArrayDynamicIndexing = 28, - CapabilitySampledImageArrayDynamicIndexing = 29, - CapabilityStorageBufferArrayDynamicIndexing = 30, - CapabilityStorageImageArrayDynamicIndexing = 31, - CapabilityClipDistance = 32, - CapabilityCullDistance = 33, - CapabilityImageCubeArray = 34, - CapabilitySampleRateShading = 35, - CapabilityImageRect = 36, - CapabilitySampledRect = 37, - CapabilityGenericPointer = 38, - CapabilityInt8 = 39, - CapabilityInputAttachment = 40, - CapabilitySparseResidency = 41, - CapabilityMinLod = 42, - CapabilitySampled1D = 43, - CapabilityImage1D = 44, - CapabilitySampledCubeArray = 45, - CapabilitySampledBuffer = 46, - CapabilityImageBuffer = 47, - CapabilityImageMSArray = 48, - CapabilityStorageImageExtendedFormats = 49, - CapabilityImageQuery = 50, - CapabilityDerivativeControl = 51, - CapabilityInterpolationFunction = 52, - CapabilityTransformFeedback = 53, - CapabilityGeometryStreams = 54, - CapabilityStorageImageReadWithoutFormat = 55, - CapabilityStorageImageWriteWithoutFormat = 56, -}; - -enum Op { - OpNop = 0, - OpUndef = 1, - OpSourceContinued = 2, - OpSource = 3, - OpSourceExtension = 4, - OpName = 5, - OpMemberName = 6, - OpString = 7, - OpLine = 8, - OpExtension = 10, - OpExtInstImport = 11, - OpExtInst = 12, - OpMemoryModel = 14, - OpEntryPoint = 15, - OpExecutionMode = 16, - OpCapability = 17, - OpTypeVoid = 19, - OpTypeBool = 20, - OpTypeInt = 21, - OpTypeFloat = 22, - OpTypeVector = 23, - OpTypeMatrix = 24, - OpTypeImage = 25, - OpTypeSampler = 26, - OpTypeSampledImage = 27, - OpTypeArray = 28, - OpTypeRuntimeArray = 29, - OpTypeStruct = 30, - OpTypeOpaque = 31, - OpTypePointer = 32, - OpTypeFunction = 33, - OpTypeEvent = 34, - OpTypeDeviceEvent = 35, - OpTypeReserveId = 36, - OpTypeQueue = 37, - OpTypePipe = 38, - OpTypeForwardPointer = 39, - OpConstantTrue = 41, - OpConstantFalse = 42, - OpConstant = 43, - OpConstantComposite = 44, - OpConstantSampler = 45, - OpConstantNull = 46, - OpSpecConstantTrue = 48, - OpSpecConstantFalse = 49, - OpSpecConstant = 50, - OpSpecConstantComposite = 51, - OpSpecConstantOp = 52, - OpFunction = 54, - OpFunctionParameter = 55, - OpFunctionEnd = 56, - OpFunctionCall = 57, - OpVariable = 59, - OpImageTexelPointer = 60, - OpLoad = 61, - OpStore = 62, - OpCopyMemory = 63, - OpCopyMemorySized = 64, - OpAccessChain = 65, - OpInBoundsAccessChain = 66, - OpPtrAccessChain = 67, - OpArrayLength = 68, - OpGenericPtrMemSemantics = 69, - OpInBoundsPtrAccessChain = 70, - OpDecorate = 71, - OpMemberDecorate = 72, - OpDecorationGroup = 73, - OpGroupDecorate = 74, - OpGroupMemberDecorate = 75, - OpVectorExtractDynamic = 77, - OpVectorInsertDynamic = 78, - OpVectorShuffle = 79, - OpCompositeConstruct = 80, - OpCompositeExtract = 81, - OpCompositeInsert = 82, - OpCopyObject = 83, - OpTranspose = 84, - OpSampledImage = 86, - OpImageSampleImplicitLod = 87, - OpImageSampleExplicitLod = 88, - OpImageSampleDrefImplicitLod = 89, - OpImageSampleDrefExplicitLod = 90, - OpImageSampleProjImplicitLod = 91, - OpImageSampleProjExplicitLod = 92, - OpImageSampleProjDrefImplicitLod = 93, - OpImageSampleProjDrefExplicitLod = 94, - OpImageFetch = 95, - OpImageGather = 96, - OpImageDrefGather = 97, - OpImageRead = 98, - OpImageWrite = 99, - OpImage = 100, - OpImageQueryFormat = 101, - OpImageQueryOrder = 102, - OpImageQuerySizeLod = 103, - OpImageQuerySize = 104, - OpImageQueryLod = 105, - OpImageQueryLevels = 106, - OpImageQuerySamples = 107, - OpConvertFToU = 109, - OpConvertFToS = 110, - OpConvertSToF = 111, - OpConvertUToF = 112, - OpUConvert = 113, - OpSConvert = 114, - OpFConvert = 115, - OpQuantizeToF16 = 116, - OpConvertPtrToU = 117, - OpSatConvertSToU = 118, - OpSatConvertUToS = 119, - OpConvertUToPtr = 120, - OpPtrCastToGeneric = 121, - OpGenericCastToPtr = 122, - OpGenericCastToPtrExplicit = 123, - OpBitcast = 124, - OpSNegate = 126, - OpFNegate = 127, - OpIAdd = 128, - OpFAdd = 129, - OpISub = 130, - OpFSub = 131, - OpIMul = 132, - OpFMul = 133, - OpUDiv = 134, - OpSDiv = 135, - OpFDiv = 136, - OpUMod = 137, - OpSRem = 138, - OpSMod = 139, - OpFRem = 140, - OpFMod = 141, - OpVectorTimesScalar = 142, - OpMatrixTimesScalar = 143, - OpVectorTimesMatrix = 144, - OpMatrixTimesVector = 145, - OpMatrixTimesMatrix = 146, - OpOuterProduct = 147, - OpDot = 148, - OpIAddCarry = 149, - OpISubBorrow = 150, - OpUMulExtended = 151, - OpSMulExtended = 152, - OpAny = 154, - OpAll = 155, - OpIsNan = 156, - OpIsInf = 157, - OpIsFinite = 158, - OpIsNormal = 159, - OpSignBitSet = 160, - OpLessOrGreater = 161, - OpOrdered = 162, - OpUnordered = 163, - OpLogicalEqual = 164, - OpLogicalNotEqual = 165, - OpLogicalOr = 166, - OpLogicalAnd = 167, - OpLogicalNot = 168, - OpSelect = 169, - OpIEqual = 170, - OpINotEqual = 171, - OpUGreaterThan = 172, - OpSGreaterThan = 173, - OpUGreaterThanEqual = 174, - OpSGreaterThanEqual = 175, - OpULessThan = 176, - OpSLessThan = 177, - OpULessThanEqual = 178, - OpSLessThanEqual = 179, - OpFOrdEqual = 180, - OpFUnordEqual = 181, - OpFOrdNotEqual = 182, - OpFUnordNotEqual = 183, - OpFOrdLessThan = 184, - OpFUnordLessThan = 185, - OpFOrdGreaterThan = 186, - OpFUnordGreaterThan = 187, - OpFOrdLessThanEqual = 188, - OpFUnordLessThanEqual = 189, - OpFOrdGreaterThanEqual = 190, - OpFUnordGreaterThanEqual = 191, - OpShiftRightLogical = 194, - OpShiftRightArithmetic = 195, - OpShiftLeftLogical = 196, - OpBitwiseOr = 197, - OpBitwiseXor = 198, - OpBitwiseAnd = 199, - OpNot = 200, - OpBitFieldInsert = 201, - OpBitFieldSExtract = 202, - OpBitFieldUExtract = 203, - OpBitReverse = 204, - OpBitCount = 205, - OpDPdx = 207, - OpDPdy = 208, - OpFwidth = 209, - OpDPdxFine = 210, - OpDPdyFine = 211, - OpFwidthFine = 212, - OpDPdxCoarse = 213, - OpDPdyCoarse = 214, - OpFwidthCoarse = 215, - OpEmitVertex = 218, - OpEndPrimitive = 219, - OpEmitStreamVertex = 220, - OpEndStreamPrimitive = 221, - OpControlBarrier = 224, - OpMemoryBarrier = 225, - OpAtomicLoad = 227, - OpAtomicStore = 228, - OpAtomicExchange = 229, - OpAtomicCompareExchange = 230, - OpAtomicCompareExchangeWeak = 231, - OpAtomicIIncrement = 232, - OpAtomicIDecrement = 233, - OpAtomicIAdd = 234, - OpAtomicISub = 235, - OpAtomicSMin = 236, - OpAtomicUMin = 237, - OpAtomicSMax = 238, - OpAtomicUMax = 239, - OpAtomicAnd = 240, - OpAtomicOr = 241, - OpAtomicXor = 242, - OpPhi = 245, - OpLoopMerge = 246, - OpSelectionMerge = 247, - OpLabel = 248, - OpBranch = 249, - OpBranchConditional = 250, - OpSwitch = 251, - OpKill = 252, - OpReturn = 253, - OpReturnValue = 254, - OpUnreachable = 255, - OpLifetimeStart = 256, - OpLifetimeStop = 257, - OpGroupAsyncCopy = 259, - OpGroupWaitEvents = 260, - OpGroupAll = 261, - OpGroupAny = 262, - OpGroupBroadcast = 263, - OpGroupIAdd = 264, - OpGroupFAdd = 265, - OpGroupFMin = 266, - OpGroupUMin = 267, - OpGroupSMin = 268, - OpGroupFMax = 269, - OpGroupUMax = 270, - OpGroupSMax = 271, - OpReadPipe = 274, - OpWritePipe = 275, - OpReservedReadPipe = 276, - OpReservedWritePipe = 277, - OpReserveReadPipePackets = 278, - OpReserveWritePipePackets = 279, - OpCommitReadPipe = 280, - OpCommitWritePipe = 281, - OpIsValidReserveId = 282, - OpGetNumPipePackets = 283, - OpGetMaxPipePackets = 284, - OpGroupReserveReadPipePackets = 285, - OpGroupReserveWritePipePackets = 286, - OpGroupCommitReadPipe = 287, - OpGroupCommitWritePipe = 288, - OpEnqueueMarker = 291, - OpEnqueueKernel = 292, - OpGetKernelNDrangeSubGroupCount = 293, - OpGetKernelNDrangeMaxSubGroupSize = 294, - OpGetKernelWorkGroupSize = 295, - OpGetKernelPreferredWorkGroupSizeMultiple = 296, - OpRetainEvent = 297, - OpReleaseEvent = 298, - OpCreateUserEvent = 299, - OpIsValidEvent = 300, - OpSetUserEventStatus = 301, - OpCaptureEventProfilingInfo = 302, - OpGetDefaultQueue = 303, - OpBuildNDRange = 304, - OpImageSparseSampleImplicitLod = 305, - OpImageSparseSampleExplicitLod = 306, - OpImageSparseSampleDrefImplicitLod = 307, - OpImageSparseSampleDrefExplicitLod = 308, - OpImageSparseSampleProjImplicitLod = 309, - OpImageSparseSampleProjExplicitLod = 310, - OpImageSparseSampleProjDrefImplicitLod = 311, - OpImageSparseSampleProjDrefExplicitLod = 312, - OpImageSparseFetch = 313, - OpImageSparseGather = 314, - OpImageSparseDrefGather = 315, - OpImageSparseTexelsResident = 316, - OpNoLine = 317, - OpAtomicFlagTestAndSet = 318, - OpAtomicFlagClear = 319, -}; - -// Overload operator| for mask bit combining - -inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } -inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } -inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } -inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } -inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } -inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } -inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } -inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } - -} // end namespace spv - -#endif // #ifndef spirv_HPP +// Copyright (c) 2014-2016 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. + +// This header is automatically generated by the same tool that creates +// the Binary Section of the SPIR-V specification. + +// Enumeration tokens for SPIR-V, in various styles: +// C, C++, C++11, JSON, Lua, Python +// +// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL +// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL +// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL +// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL +// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL'] +// +// Some tokens act like mask values, which can be OR'd together, +// while others are mutually exclusive. The mask-like ones have +// "Mask" in their name, and a parallel enum that has the shift +// amount (1 << x) for each corresponding enumerant. + +#ifndef spirv_HPP +#define spirv_HPP + +namespace spv { + +typedef unsigned int Id; + +#define SPV_VERSION 0x10000 +#define SPV_REVISION 3 + +static const unsigned int MagicNumber = 0x07230203; +static const unsigned int Version = 0x00010000; +static const unsigned int Revision = 3; +static const unsigned int OpCodeMask = 0xffff; +static const unsigned int WordCountShift = 16; + +enum SourceLanguage { + SourceLanguageUnknown = 0, + SourceLanguageESSL = 1, + SourceLanguageGLSL = 2, + SourceLanguageOpenCL_C = 3, + SourceLanguageOpenCL_CPP = 4, +}; + +enum ExecutionModel { + ExecutionModelVertex = 0, + ExecutionModelTessellationControl = 1, + ExecutionModelTessellationEvaluation = 2, + ExecutionModelGeometry = 3, + ExecutionModelFragment = 4, + ExecutionModelGLCompute = 5, + ExecutionModelKernel = 6, +}; + +enum AddressingModel { + AddressingModelLogical = 0, + AddressingModelPhysical32 = 1, + AddressingModelPhysical64 = 2, +}; + +enum MemoryModel { + MemoryModelSimple = 0, + MemoryModelGLSL450 = 1, + MemoryModelOpenCL = 2, +}; + +enum ExecutionMode { + ExecutionModeInvocations = 0, + ExecutionModeSpacingEqual = 1, + ExecutionModeSpacingFractionalEven = 2, + ExecutionModeSpacingFractionalOdd = 3, + ExecutionModeVertexOrderCw = 4, + ExecutionModeVertexOrderCcw = 5, + ExecutionModePixelCenterInteger = 6, + ExecutionModeOriginUpperLeft = 7, + ExecutionModeOriginLowerLeft = 8, + ExecutionModeEarlyFragmentTests = 9, + ExecutionModePointMode = 10, + ExecutionModeXfb = 11, + ExecutionModeDepthReplacing = 12, + ExecutionModeDepthGreater = 14, + ExecutionModeDepthLess = 15, + ExecutionModeDepthUnchanged = 16, + ExecutionModeLocalSize = 17, + ExecutionModeLocalSizeHint = 18, + ExecutionModeInputPoints = 19, + ExecutionModeInputLines = 20, + ExecutionModeInputLinesAdjacency = 21, + ExecutionModeTriangles = 22, + ExecutionModeInputTrianglesAdjacency = 23, + ExecutionModeQuads = 24, + ExecutionModeIsolines = 25, + ExecutionModeOutputVertices = 26, + ExecutionModeOutputPoints = 27, + ExecutionModeOutputLineStrip = 28, + ExecutionModeOutputTriangleStrip = 29, + ExecutionModeVecTypeHint = 30, + ExecutionModeContractionOff = 31, +}; + +enum StorageClass { + StorageClassUniformConstant = 0, + StorageClassInput = 1, + StorageClassUniform = 2, + StorageClassOutput = 3, + StorageClassWorkgroup = 4, + StorageClassCrossWorkgroup = 5, + StorageClassPrivate = 6, + StorageClassFunction = 7, + StorageClassGeneric = 8, + StorageClassPushConstant = 9, + StorageClassAtomicCounter = 10, + StorageClassImage = 11, +}; + +enum Dim { + Dim1D = 0, + Dim2D = 1, + Dim3D = 2, + DimCube = 3, + DimRect = 4, + DimBuffer = 5, + DimSubpassData = 6, +}; + +enum SamplerAddressingMode { + SamplerAddressingModeNone = 0, + SamplerAddressingModeClampToEdge = 1, + SamplerAddressingModeClamp = 2, + SamplerAddressingModeRepeat = 3, + SamplerAddressingModeRepeatMirrored = 4, +}; + +enum SamplerFilterMode { + SamplerFilterModeNearest = 0, + SamplerFilterModeLinear = 1, +}; + +enum ImageFormat { + ImageFormatUnknown = 0, + ImageFormatRgba32f = 1, + ImageFormatRgba16f = 2, + ImageFormatR32f = 3, + ImageFormatRgba8 = 4, + ImageFormatRgba8Snorm = 5, + ImageFormatRg32f = 6, + ImageFormatRg16f = 7, + ImageFormatR11fG11fB10f = 8, + ImageFormatR16f = 9, + ImageFormatRgba16 = 10, + ImageFormatRgb10A2 = 11, + ImageFormatRg16 = 12, + ImageFormatRg8 = 13, + ImageFormatR16 = 14, + ImageFormatR8 = 15, + ImageFormatRgba16Snorm = 16, + ImageFormatRg16Snorm = 17, + ImageFormatRg8Snorm = 18, + ImageFormatR16Snorm = 19, + ImageFormatR8Snorm = 20, + ImageFormatRgba32i = 21, + ImageFormatRgba16i = 22, + ImageFormatRgba8i = 23, + ImageFormatR32i = 24, + ImageFormatRg32i = 25, + ImageFormatRg16i = 26, + ImageFormatRg8i = 27, + ImageFormatR16i = 28, + ImageFormatR8i = 29, + ImageFormatRgba32ui = 30, + ImageFormatRgba16ui = 31, + ImageFormatRgba8ui = 32, + ImageFormatR32ui = 33, + ImageFormatRgb10a2ui = 34, + ImageFormatRg32ui = 35, + ImageFormatRg16ui = 36, + ImageFormatRg8ui = 37, + ImageFormatR16ui = 38, + ImageFormatR8ui = 39, +}; + +enum ImageChannelOrder { + ImageChannelOrderR = 0, + ImageChannelOrderA = 1, + ImageChannelOrderRG = 2, + ImageChannelOrderRA = 3, + ImageChannelOrderRGB = 4, + ImageChannelOrderRGBA = 5, + ImageChannelOrderBGRA = 6, + ImageChannelOrderARGB = 7, + ImageChannelOrderIntensity = 8, + ImageChannelOrderLuminance = 9, + ImageChannelOrderRx = 10, + ImageChannelOrderRGx = 11, + ImageChannelOrderRGBx = 12, + ImageChannelOrderDepth = 13, + ImageChannelOrderDepthStencil = 14, + ImageChannelOrdersRGB = 15, + ImageChannelOrdersRGBx = 16, + ImageChannelOrdersRGBA = 17, + ImageChannelOrdersBGRA = 18, +}; + +enum ImageChannelDataType { + ImageChannelDataTypeSnormInt8 = 0, + ImageChannelDataTypeSnormInt16 = 1, + ImageChannelDataTypeUnormInt8 = 2, + ImageChannelDataTypeUnormInt16 = 3, + ImageChannelDataTypeUnormShort565 = 4, + ImageChannelDataTypeUnormShort555 = 5, + ImageChannelDataTypeUnormInt101010 = 6, + ImageChannelDataTypeSignedInt8 = 7, + ImageChannelDataTypeSignedInt16 = 8, + ImageChannelDataTypeSignedInt32 = 9, + ImageChannelDataTypeUnsignedInt8 = 10, + ImageChannelDataTypeUnsignedInt16 = 11, + ImageChannelDataTypeUnsignedInt32 = 12, + ImageChannelDataTypeHalfFloat = 13, + ImageChannelDataTypeFloat = 14, + ImageChannelDataTypeUnormInt24 = 15, + ImageChannelDataTypeUnormInt101010_2 = 16, +}; + +enum ImageOperandsShift { + ImageOperandsBiasShift = 0, + ImageOperandsLodShift = 1, + ImageOperandsGradShift = 2, + ImageOperandsConstOffsetShift = 3, + ImageOperandsOffsetShift = 4, + ImageOperandsConstOffsetsShift = 5, + ImageOperandsSampleShift = 6, + ImageOperandsMinLodShift = 7, +}; + +enum ImageOperandsMask { + ImageOperandsMaskNone = 0, + ImageOperandsBiasMask = 0x00000001, + ImageOperandsLodMask = 0x00000002, + ImageOperandsGradMask = 0x00000004, + ImageOperandsConstOffsetMask = 0x00000008, + ImageOperandsOffsetMask = 0x00000010, + ImageOperandsConstOffsetsMask = 0x00000020, + ImageOperandsSampleMask = 0x00000040, + ImageOperandsMinLodMask = 0x00000080, +}; + +enum FPFastMathModeShift { + FPFastMathModeNotNaNShift = 0, + FPFastMathModeNotInfShift = 1, + FPFastMathModeNSZShift = 2, + FPFastMathModeAllowRecipShift = 3, + FPFastMathModeFastShift = 4, +}; + +enum FPFastMathModeMask { + FPFastMathModeMaskNone = 0, + FPFastMathModeNotNaNMask = 0x00000001, + FPFastMathModeNotInfMask = 0x00000002, + FPFastMathModeNSZMask = 0x00000004, + FPFastMathModeAllowRecipMask = 0x00000008, + FPFastMathModeFastMask = 0x00000010, +}; + +enum FPRoundingMode { + FPRoundingModeRTE = 0, + FPRoundingModeRTZ = 1, + FPRoundingModeRTP = 2, + FPRoundingModeRTN = 3, +}; + +enum LinkageType { + LinkageTypeExport = 0, + LinkageTypeImport = 1, +}; + +enum AccessQualifier { + AccessQualifierReadOnly = 0, + AccessQualifierWriteOnly = 1, + AccessQualifierReadWrite = 2, +}; + +enum FunctionParameterAttribute { + FunctionParameterAttributeZext = 0, + FunctionParameterAttributeSext = 1, + FunctionParameterAttributeByVal = 2, + FunctionParameterAttributeSret = 3, + FunctionParameterAttributeNoAlias = 4, + FunctionParameterAttributeNoCapture = 5, + FunctionParameterAttributeNoWrite = 6, + FunctionParameterAttributeNoReadWrite = 7, +}; + +enum Decoration { + DecorationRelaxedPrecision = 0, + DecorationSpecId = 1, + DecorationBlock = 2, + DecorationBufferBlock = 3, + DecorationRowMajor = 4, + DecorationColMajor = 5, + DecorationArrayStride = 6, + DecorationMatrixStride = 7, + DecorationGLSLShared = 8, + DecorationGLSLPacked = 9, + DecorationCPacked = 10, + DecorationBuiltIn = 11, + DecorationNoPerspective = 13, + DecorationFlat = 14, + DecorationPatch = 15, + DecorationCentroid = 16, + DecorationSample = 17, + DecorationInvariant = 18, + DecorationRestrict = 19, + DecorationAliased = 20, + DecorationVolatile = 21, + DecorationConstant = 22, + DecorationCoherent = 23, + DecorationNonWritable = 24, + DecorationNonReadable = 25, + DecorationUniform = 26, + DecorationSaturatedConversion = 28, + DecorationStream = 29, + DecorationLocation = 30, + DecorationComponent = 31, + DecorationIndex = 32, + DecorationBinding = 33, + DecorationDescriptorSet = 34, + DecorationOffset = 35, + DecorationXfbBuffer = 36, + DecorationXfbStride = 37, + DecorationFuncParamAttr = 38, + DecorationFPRoundingMode = 39, + DecorationFPFastMathMode = 40, + DecorationLinkageAttributes = 41, + DecorationNoContraction = 42, + DecorationInputAttachmentIndex = 43, + DecorationAlignment = 44, +}; + +enum BuiltIn { + BuiltInPosition = 0, + BuiltInPointSize = 1, + BuiltInClipDistance = 3, + BuiltInCullDistance = 4, + BuiltInVertexId = 5, + BuiltInInstanceId = 6, + BuiltInPrimitiveId = 7, + BuiltInInvocationId = 8, + BuiltInLayer = 9, + BuiltInViewportIndex = 10, + BuiltInTessLevelOuter = 11, + BuiltInTessLevelInner = 12, + BuiltInTessCoord = 13, + BuiltInPatchVertices = 14, + BuiltInFragCoord = 15, + BuiltInPointCoord = 16, + BuiltInFrontFacing = 17, + BuiltInSampleId = 18, + BuiltInSamplePosition = 19, + BuiltInSampleMask = 20, + BuiltInFragDepth = 22, + BuiltInHelperInvocation = 23, + BuiltInNumWorkgroups = 24, + BuiltInWorkgroupSize = 25, + BuiltInWorkgroupId = 26, + BuiltInLocalInvocationId = 27, + BuiltInGlobalInvocationId = 28, + BuiltInLocalInvocationIndex = 29, + BuiltInWorkDim = 30, + BuiltInGlobalSize = 31, + BuiltInEnqueuedWorkgroupSize = 32, + BuiltInGlobalOffset = 33, + BuiltInGlobalLinearId = 34, + BuiltInSubgroupSize = 36, + BuiltInSubgroupMaxSize = 37, + BuiltInNumSubgroups = 38, + BuiltInNumEnqueuedSubgroups = 39, + BuiltInSubgroupId = 40, + BuiltInSubgroupLocalInvocationId = 41, + BuiltInVertexIndex = 42, + BuiltInInstanceIndex = 43, +}; + +enum SelectionControlShift { + SelectionControlFlattenShift = 0, + SelectionControlDontFlattenShift = 1, +}; + +enum SelectionControlMask { + SelectionControlMaskNone = 0, + SelectionControlFlattenMask = 0x00000001, + SelectionControlDontFlattenMask = 0x00000002, +}; + +enum LoopControlShift { + LoopControlUnrollShift = 0, + LoopControlDontUnrollShift = 1, +}; + +enum LoopControlMask { + LoopControlMaskNone = 0, + LoopControlUnrollMask = 0x00000001, + LoopControlDontUnrollMask = 0x00000002, +}; + +enum FunctionControlShift { + FunctionControlInlineShift = 0, + FunctionControlDontInlineShift = 1, + FunctionControlPureShift = 2, + FunctionControlConstShift = 3, +}; + +enum FunctionControlMask { + FunctionControlMaskNone = 0, + FunctionControlInlineMask = 0x00000001, + FunctionControlDontInlineMask = 0x00000002, + FunctionControlPureMask = 0x00000004, + FunctionControlConstMask = 0x00000008, +}; + +enum MemorySemanticsShift { + MemorySemanticsAcquireShift = 1, + MemorySemanticsReleaseShift = 2, + MemorySemanticsAcquireReleaseShift = 3, + MemorySemanticsSequentiallyConsistentShift = 4, + MemorySemanticsUniformMemoryShift = 6, + MemorySemanticsSubgroupMemoryShift = 7, + MemorySemanticsWorkgroupMemoryShift = 8, + MemorySemanticsCrossWorkgroupMemoryShift = 9, + MemorySemanticsAtomicCounterMemoryShift = 10, + MemorySemanticsImageMemoryShift = 11, +}; + +enum MemorySemanticsMask { + MemorySemanticsMaskNone = 0, + MemorySemanticsAcquireMask = 0x00000002, + MemorySemanticsReleaseMask = 0x00000004, + MemorySemanticsAcquireReleaseMask = 0x00000008, + MemorySemanticsSequentiallyConsistentMask = 0x00000010, + MemorySemanticsUniformMemoryMask = 0x00000040, + MemorySemanticsSubgroupMemoryMask = 0x00000080, + MemorySemanticsWorkgroupMemoryMask = 0x00000100, + MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200, + MemorySemanticsAtomicCounterMemoryMask = 0x00000400, + MemorySemanticsImageMemoryMask = 0x00000800, +}; + +enum MemoryAccessShift { + MemoryAccessVolatileShift = 0, + MemoryAccessAlignedShift = 1, + MemoryAccessNontemporalShift = 2, +}; + +enum MemoryAccessMask { + MemoryAccessMaskNone = 0, + MemoryAccessVolatileMask = 0x00000001, + MemoryAccessAlignedMask = 0x00000002, + MemoryAccessNontemporalMask = 0x00000004, +}; + +enum Scope { + ScopeCrossDevice = 0, + ScopeDevice = 1, + ScopeWorkgroup = 2, + ScopeSubgroup = 3, + ScopeInvocation = 4, +}; + +enum GroupOperation { + GroupOperationReduce = 0, + GroupOperationInclusiveScan = 1, + GroupOperationExclusiveScan = 2, +}; + +enum KernelEnqueueFlags { + KernelEnqueueFlagsNoWait = 0, + KernelEnqueueFlagsWaitKernel = 1, + KernelEnqueueFlagsWaitWorkGroup = 2, +}; + +enum KernelProfilingInfoShift { + KernelProfilingInfoCmdExecTimeShift = 0, +}; + +enum KernelProfilingInfoMask { + KernelProfilingInfoMaskNone = 0, + KernelProfilingInfoCmdExecTimeMask = 0x00000001, +}; + +enum Capability { + CapabilityMatrix = 0, + CapabilityShader = 1, + CapabilityGeometry = 2, + CapabilityTessellation = 3, + CapabilityAddresses = 4, + CapabilityLinkage = 5, + CapabilityKernel = 6, + CapabilityVector16 = 7, + CapabilityFloat16Buffer = 8, + CapabilityFloat16 = 9, + CapabilityFloat64 = 10, + CapabilityInt64 = 11, + CapabilityInt64Atomics = 12, + CapabilityImageBasic = 13, + CapabilityImageReadWrite = 14, + CapabilityImageMipmap = 15, + CapabilityPipes = 17, + CapabilityGroups = 18, + CapabilityDeviceEnqueue = 19, + CapabilityLiteralSampler = 20, + CapabilityAtomicStorage = 21, + CapabilityInt16 = 22, + CapabilityTessellationPointSize = 23, + CapabilityGeometryPointSize = 24, + CapabilityImageGatherExtended = 25, + CapabilityStorageImageMultisample = 27, + CapabilityUniformBufferArrayDynamicIndexing = 28, + CapabilitySampledImageArrayDynamicIndexing = 29, + CapabilityStorageBufferArrayDynamicIndexing = 30, + CapabilityStorageImageArrayDynamicIndexing = 31, + CapabilityClipDistance = 32, + CapabilityCullDistance = 33, + CapabilityImageCubeArray = 34, + CapabilitySampleRateShading = 35, + CapabilityImageRect = 36, + CapabilitySampledRect = 37, + CapabilityGenericPointer = 38, + CapabilityInt8 = 39, + CapabilityInputAttachment = 40, + CapabilitySparseResidency = 41, + CapabilityMinLod = 42, + CapabilitySampled1D = 43, + CapabilityImage1D = 44, + CapabilitySampledCubeArray = 45, + CapabilitySampledBuffer = 46, + CapabilityImageBuffer = 47, + CapabilityImageMSArray = 48, + CapabilityStorageImageExtendedFormats = 49, + CapabilityImageQuery = 50, + CapabilityDerivativeControl = 51, + CapabilityInterpolationFunction = 52, + CapabilityTransformFeedback = 53, + CapabilityGeometryStreams = 54, + CapabilityStorageImageReadWithoutFormat = 55, + CapabilityStorageImageWriteWithoutFormat = 56, + CapabilityMultiViewport = 57, +}; + +enum Op { + OpNop = 0, + OpUndef = 1, + OpSourceContinued = 2, + OpSource = 3, + OpSourceExtension = 4, + OpName = 5, + OpMemberName = 6, + OpString = 7, + OpLine = 8, + OpExtension = 10, + OpExtInstImport = 11, + OpExtInst = 12, + OpMemoryModel = 14, + OpEntryPoint = 15, + OpExecutionMode = 16, + OpCapability = 17, + OpTypeVoid = 19, + OpTypeBool = 20, + OpTypeInt = 21, + OpTypeFloat = 22, + OpTypeVector = 23, + OpTypeMatrix = 24, + OpTypeImage = 25, + OpTypeSampler = 26, + OpTypeSampledImage = 27, + OpTypeArray = 28, + OpTypeRuntimeArray = 29, + OpTypeStruct = 30, + OpTypeOpaque = 31, + OpTypePointer = 32, + OpTypeFunction = 33, + OpTypeEvent = 34, + OpTypeDeviceEvent = 35, + OpTypeReserveId = 36, + OpTypeQueue = 37, + OpTypePipe = 38, + OpTypeForwardPointer = 39, + OpConstantTrue = 41, + OpConstantFalse = 42, + OpConstant = 43, + OpConstantComposite = 44, + OpConstantSampler = 45, + OpConstantNull = 46, + OpSpecConstantTrue = 48, + OpSpecConstantFalse = 49, + OpSpecConstant = 50, + OpSpecConstantComposite = 51, + OpSpecConstantOp = 52, + OpFunction = 54, + OpFunctionParameter = 55, + OpFunctionEnd = 56, + OpFunctionCall = 57, + OpVariable = 59, + OpImageTexelPointer = 60, + OpLoad = 61, + OpStore = 62, + OpCopyMemory = 63, + OpCopyMemorySized = 64, + OpAccessChain = 65, + OpInBoundsAccessChain = 66, + OpPtrAccessChain = 67, + OpArrayLength = 68, + OpGenericPtrMemSemantics = 69, + OpInBoundsPtrAccessChain = 70, + OpDecorate = 71, + OpMemberDecorate = 72, + OpDecorationGroup = 73, + OpGroupDecorate = 74, + OpGroupMemberDecorate = 75, + OpVectorExtractDynamic = 77, + OpVectorInsertDynamic = 78, + OpVectorShuffle = 79, + OpCompositeConstruct = 80, + OpCompositeExtract = 81, + OpCompositeInsert = 82, + OpCopyObject = 83, + OpTranspose = 84, + OpSampledImage = 86, + OpImageSampleImplicitLod = 87, + OpImageSampleExplicitLod = 88, + OpImageSampleDrefImplicitLod = 89, + OpImageSampleDrefExplicitLod = 90, + OpImageSampleProjImplicitLod = 91, + OpImageSampleProjExplicitLod = 92, + OpImageSampleProjDrefImplicitLod = 93, + OpImageSampleProjDrefExplicitLod = 94, + OpImageFetch = 95, + OpImageGather = 96, + OpImageDrefGather = 97, + OpImageRead = 98, + OpImageWrite = 99, + OpImage = 100, + OpImageQueryFormat = 101, + OpImageQueryOrder = 102, + OpImageQuerySizeLod = 103, + OpImageQuerySize = 104, + OpImageQueryLod = 105, + OpImageQueryLevels = 106, + OpImageQuerySamples = 107, + OpConvertFToU = 109, + OpConvertFToS = 110, + OpConvertSToF = 111, + OpConvertUToF = 112, + OpUConvert = 113, + OpSConvert = 114, + OpFConvert = 115, + OpQuantizeToF16 = 116, + OpConvertPtrToU = 117, + OpSatConvertSToU = 118, + OpSatConvertUToS = 119, + OpConvertUToPtr = 120, + OpPtrCastToGeneric = 121, + OpGenericCastToPtr = 122, + OpGenericCastToPtrExplicit = 123, + OpBitcast = 124, + OpSNegate = 126, + OpFNegate = 127, + OpIAdd = 128, + OpFAdd = 129, + OpISub = 130, + OpFSub = 131, + OpIMul = 132, + OpFMul = 133, + OpUDiv = 134, + OpSDiv = 135, + OpFDiv = 136, + OpUMod = 137, + OpSRem = 138, + OpSMod = 139, + OpFRem = 140, + OpFMod = 141, + OpVectorTimesScalar = 142, + OpMatrixTimesScalar = 143, + OpVectorTimesMatrix = 144, + OpMatrixTimesVector = 145, + OpMatrixTimesMatrix = 146, + OpOuterProduct = 147, + OpDot = 148, + OpIAddCarry = 149, + OpISubBorrow = 150, + OpUMulExtended = 151, + OpSMulExtended = 152, + OpAny = 154, + OpAll = 155, + OpIsNan = 156, + OpIsInf = 157, + OpIsFinite = 158, + OpIsNormal = 159, + OpSignBitSet = 160, + OpLessOrGreater = 161, + OpOrdered = 162, + OpUnordered = 163, + OpLogicalEqual = 164, + OpLogicalNotEqual = 165, + OpLogicalOr = 166, + OpLogicalAnd = 167, + OpLogicalNot = 168, + OpSelect = 169, + OpIEqual = 170, + OpINotEqual = 171, + OpUGreaterThan = 172, + OpSGreaterThan = 173, + OpUGreaterThanEqual = 174, + OpSGreaterThanEqual = 175, + OpULessThan = 176, + OpSLessThan = 177, + OpULessThanEqual = 178, + OpSLessThanEqual = 179, + OpFOrdEqual = 180, + OpFUnordEqual = 181, + OpFOrdNotEqual = 182, + OpFUnordNotEqual = 183, + OpFOrdLessThan = 184, + OpFUnordLessThan = 185, + OpFOrdGreaterThan = 186, + OpFUnordGreaterThan = 187, + OpFOrdLessThanEqual = 188, + OpFUnordLessThanEqual = 189, + OpFOrdGreaterThanEqual = 190, + OpFUnordGreaterThanEqual = 191, + OpShiftRightLogical = 194, + OpShiftRightArithmetic = 195, + OpShiftLeftLogical = 196, + OpBitwiseOr = 197, + OpBitwiseXor = 198, + OpBitwiseAnd = 199, + OpNot = 200, + OpBitFieldInsert = 201, + OpBitFieldSExtract = 202, + OpBitFieldUExtract = 203, + OpBitReverse = 204, + OpBitCount = 205, + OpDPdx = 207, + OpDPdy = 208, + OpFwidth = 209, + OpDPdxFine = 210, + OpDPdyFine = 211, + OpFwidthFine = 212, + OpDPdxCoarse = 213, + OpDPdyCoarse = 214, + OpFwidthCoarse = 215, + OpEmitVertex = 218, + OpEndPrimitive = 219, + OpEmitStreamVertex = 220, + OpEndStreamPrimitive = 221, + OpControlBarrier = 224, + OpMemoryBarrier = 225, + OpAtomicLoad = 227, + OpAtomicStore = 228, + OpAtomicExchange = 229, + OpAtomicCompareExchange = 230, + OpAtomicCompareExchangeWeak = 231, + OpAtomicIIncrement = 232, + OpAtomicIDecrement = 233, + OpAtomicIAdd = 234, + OpAtomicISub = 235, + OpAtomicSMin = 236, + OpAtomicUMin = 237, + OpAtomicSMax = 238, + OpAtomicUMax = 239, + OpAtomicAnd = 240, + OpAtomicOr = 241, + OpAtomicXor = 242, + OpPhi = 245, + OpLoopMerge = 246, + OpSelectionMerge = 247, + OpLabel = 248, + OpBranch = 249, + OpBranchConditional = 250, + OpSwitch = 251, + OpKill = 252, + OpReturn = 253, + OpReturnValue = 254, + OpUnreachable = 255, + OpLifetimeStart = 256, + OpLifetimeStop = 257, + OpGroupAsyncCopy = 259, + OpGroupWaitEvents = 260, + OpGroupAll = 261, + OpGroupAny = 262, + OpGroupBroadcast = 263, + OpGroupIAdd = 264, + OpGroupFAdd = 265, + OpGroupFMin = 266, + OpGroupUMin = 267, + OpGroupSMin = 268, + OpGroupFMax = 269, + OpGroupUMax = 270, + OpGroupSMax = 271, + OpReadPipe = 274, + OpWritePipe = 275, + OpReservedReadPipe = 276, + OpReservedWritePipe = 277, + OpReserveReadPipePackets = 278, + OpReserveWritePipePackets = 279, + OpCommitReadPipe = 280, + OpCommitWritePipe = 281, + OpIsValidReserveId = 282, + OpGetNumPipePackets = 283, + OpGetMaxPipePackets = 284, + OpGroupReserveReadPipePackets = 285, + OpGroupReserveWritePipePackets = 286, + OpGroupCommitReadPipe = 287, + OpGroupCommitWritePipe = 288, + OpEnqueueMarker = 291, + OpEnqueueKernel = 292, + OpGetKernelNDrangeSubGroupCount = 293, + OpGetKernelNDrangeMaxSubGroupSize = 294, + OpGetKernelWorkGroupSize = 295, + OpGetKernelPreferredWorkGroupSizeMultiple = 296, + OpRetainEvent = 297, + OpReleaseEvent = 298, + OpCreateUserEvent = 299, + OpIsValidEvent = 300, + OpSetUserEventStatus = 301, + OpCaptureEventProfilingInfo = 302, + OpGetDefaultQueue = 303, + OpBuildNDRange = 304, + OpImageSparseSampleImplicitLod = 305, + OpImageSparseSampleExplicitLod = 306, + OpImageSparseSampleDrefImplicitLod = 307, + OpImageSparseSampleDrefExplicitLod = 308, + OpImageSparseSampleProjImplicitLod = 309, + OpImageSparseSampleProjExplicitLod = 310, + OpImageSparseSampleProjDrefImplicitLod = 311, + OpImageSparseSampleProjDrefExplicitLod = 312, + OpImageSparseFetch = 313, + OpImageSparseGather = 314, + OpImageSparseDrefGather = 315, + OpImageSparseTexelsResident = 316, + OpNoLine = 317, + OpAtomicFlagTestAndSet = 318, + OpAtomicFlagClear = 319, + OpImageSparseRead = 320, +}; + +// Overload operator| for mask bit combining + +inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } +inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); } +inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); } +inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); } +inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); } +inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } +inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } +inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } + +} // end namespace spv + +#endif // #ifndef spirv_HPP diff --git a/Test/baseResults/310.comp.out b/Test/baseResults/310.comp.out index e61d2aae69279e6a29fcd937fd29f07e07efe73a..ff438e3ae811cebdb006d7afd611f18e8866fc4e 100644 --- a/Test/baseResults/310.comp.out +++ b/Test/baseResults/310.comp.out @@ -8,7 +8,7 @@ ERROR: 0:39: 'location qualifier on input' : not supported in this stage: comput ERROR: 0:40: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:41: 'out' : global storage output qualifier cannot be used in a compute shader ERROR: 0:44: 'shared' : cannot apply layout qualifiers to a shared variable -ERROR: 0:44: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:44: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:45: 'shared' : cannot initialize this type of qualifier ERROR: 0:47: 'local_size' : can only apply to 'in' ERROR: 0:47: 'local_size' : can only apply to 'in' diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index 6d7b36186fea557a61100ba8ae8734e35ac66947..3b0dfaea5b0c632714f86d961da19ef65d10ebb8 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -9,7 +9,6 @@ ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sa ERROR: 0:13: 'uniform' : too many storage qualifiers ERROR: 0:18: '=' : global const initializers must be constant 'const int' ERROR: 0:20: 'const' : no qualifiers allowed for function return -ERROR: 0:27: '' : constant expression required ERROR: 0:27: '' : array size must be a constant integer expression ERROR: 0:38: 'j' : undeclared identifier ERROR: 0:38: '=' : cannot convert from 'temp float' to 'temp int' @@ -33,7 +32,6 @@ ERROR: 0:85: 'patch' : not supported in this stage: vertex ERROR: 0:85: '' : vertex input cannot be further qualified ERROR: 0:86: 'patch' : not supported in this stage: vertex ERROR: 0:100: '=' : global const initializers must be constant 'const int' -ERROR: 0:101: '' : constant expression required ERROR: 0:101: '' : array size must be a constant integer expression ERROR: 0:107: '' : image variables not declared 'writeonly' must have a format layout qualifier ERROR: 0:114: 'imageAtomicMin' : only supported on image with format r32i or r32ui @@ -53,7 +51,7 @@ ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:157: 'assign' : cannot convert from 'const float' to 'temp int' ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found ERROR: 0:158: 'assign' : cannot convert from 'const float' to 'temp int' -ERROR: 52 compilation errors. No code generated. +ERROR: 50 compilation errors. No code generated. Shader version: 420 diff --git a/Test/baseResults/430.comp.out b/Test/baseResults/430.comp.out index 398965939ab98e6f22f4a733d2d9828cb0c58615..aecf42fcf6d8e23943e0b03d86fde72f042cbb2d 100644 --- a/Test/baseResults/430.comp.out +++ b/Test/baseResults/430.comp.out @@ -7,7 +7,7 @@ ERROR: 0:43: 'location qualifier on input' : not supported in this stage: comput ERROR: 0:44: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:45: 'out' : global storage output qualifier cannot be used in a compute shader ERROR: 0:48: 'shared' : cannot apply layout qualifiers to a shared variable -ERROR: 0:48: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:48: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:49: 'shared' : cannot initialize this type of qualifier ERROR: 0:51: 'local_size' : can only apply to 'in' ERROR: 0:51: 'local_size' : can only apply to 'in' diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index 30e2cafe153c8c5d983de5b15776b27b842aa2ca..8cfd20c03cb74b35603361e8b361ff9e652cae91 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -1,6 +1,6 @@ 430.vert Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:3: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:3: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:7: 'input block' : not supported in this stage: vertex ERROR: 0:7: 'location qualifier on in/out block' : not supported for this version or the enabled extensions ERROR: 0:8: 'location qualifier on in/out block' : not supported for this version or the enabled extensions diff --git a/Test/baseResults/constErrors.frag.out b/Test/baseResults/constErrors.frag.out index 6f12aecdd4a65df5d3eca5a5e3fd87a9ec33e06a..f04c7369ff6e1d17a62dd1e613d4be5d628ba4d2 100644 --- a/Test/baseResults/constErrors.frag.out +++ b/Test/baseResults/constErrors.frag.out @@ -1,14 +1,11 @@ constErrors.frag ERROR: 0:14: 'non-constant initializer' : not supported for this version or the enabled extensions -ERROR: 0:17: '' : constant expression required ERROR: 0:17: '' : array size must be a constant integer expression -ERROR: 0:18: '' : constant expression required ERROR: 0:18: '' : array size must be a constant integer expression -ERROR: 0:19: '' : constant expression required ERROR: 0:19: '' : array size must be a constant integer expression ERROR: 0:27: '=' : global const initializers must be constant 'const structure{global 3-component vector of float v3, global 2-component vector of int iv2}' ERROR: 0:33: '=' : global const initializers must be constant 'const structure{global 3-component vector of float v3, global 2-component vector of int iv2, global 2X4 matrix of float m}' -ERROR: 9 compilation errors. No code generated. +ERROR: 6 compilation errors. No code generated. Shader version: 330 diff --git a/Test/baseResults/nonVulkan.frag.out b/Test/baseResults/nonVulkan.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..10c693c0abc6ea3c64882014a7540ae708fda09b --- /dev/null +++ b/Test/baseResults/nonVulkan.frag.out @@ -0,0 +1,30 @@ +nonVulkan.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:3: 'constant_id' : only allowed when generating SPIR-V +ERROR: 0:4: 'input_attachment_index' : only allowed when using GLSL for Vulkan +ERROR: 0:4: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:5: 'push_constant' : only allowed when using GLSL for Vulkan +ERROR: 4 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'arraySize' (specialization-constant const int) +0:? 12 (const int) +0:? 'foo' (temp int) +0:? 'ubi' (layout(column_major std430 push_constant ) uniform block{layout(column_major std430 offset=0 ) uniform int a}) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point + +Shader version: 450 +ERROR: node is still EOpNull! +0:? Linker Objects +0:? 'arraySize' (specialization-constant const int) +0:? 12 (const int) +0:? 'foo' (temp int) +0:? 'ubi' (layout(column_major std430 push_constant ) uniform block{layout(column_major std430 offset=0 ) uniform int a}) + diff --git a/Test/baseResults/specExamples.vert.out b/Test/baseResults/specExamples.vert.out index bec3fb32ffc1b4329bef3a1eb3b6be3b5a274b32..eb399e1b9f562d15313e92c8b48950b7d300906a 100644 --- a/Test/baseResults/specExamples.vert.out +++ b/Test/baseResults/specExamples.vert.out @@ -1,6 +1,6 @@ specExamples.vert Warning, version 430 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:29: 'location' : can only appy to uniform, buffer, in, or out storage qualifiers +ERROR: 0:29: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers ERROR: 0:31: 'triangles' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) ERROR: 0:31: 'invocations' : there is no such layout identifier for this stage taking an assigned value ERROR: 0:33: 'lines' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4) diff --git a/Test/baseResults/spv.100ops.frag.out b/Test/baseResults/spv.100ops.frag.out index 1d00037cd5adb62a84d70ebd926a26b04d7da06e..9b40c920eb25c3b9c0454d0f5547223315159ed9 100755 --- a/Test/baseResults/spv.100ops.frag.out +++ b/Test/baseResults/spv.100ops.frag.out @@ -7,13 +7,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 48 +// Id's are bound by 49 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 36 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 21 26 37 + ExecutionMode 4 OriginUpperLeft Source ESSL 310 Name 4 "main" Name 8 "foo(" @@ -22,7 +22,7 @@ Linked fragment stage: Name 17 "z" Name 21 "low" Name 26 "high" - Name 36 "Color" + Name 37 "Color" Decorate 8(foo() RelaxedPrecision Decorate 11(face1) RelaxedPrecision Decorate 13(face2) RelaxedPrecision @@ -34,9 +34,8 @@ Linked fragment stage: Decorate 26(high) RelaxedPrecision Decorate 27 RelaxedPrecision Decorate 32 RelaxedPrecision - Decorate 33 RelaxedPrecision - Decorate 36(Color) RelaxedPrecision - Decorate 37 RelaxedPrecision + Decorate 34 RelaxedPrecision + Decorate 37(Color) RelaxedPrecision Decorate 38 RelaxedPrecision Decorate 39 RelaxedPrecision Decorate 40 RelaxedPrecision @@ -45,6 +44,7 @@ Linked fragment stage: Decorate 43 RelaxedPrecision Decorate 44 RelaxedPrecision Decorate 45 RelaxedPrecision + Decorate 46 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -57,47 +57,48 @@ Linked fragment stage: 15: TypeInt 32 1 16: TypePointer Function 15(int) 18: 15(int) Constant 3 - 19: 15(int) Constant 2 - 20: TypePointer UniformConstant 15(int) - 21(low): 20(ptr) Variable UniformConstant - 24: 15(int) Constant 1 - 26(high): 20(ptr) Variable UniformConstant + 19: 6(float) Constant 1073741824 + 20: TypePointer Input 6(float) + 21(low): 20(ptr) Variable Input + 24: 6(float) Constant 1065353216 + 26(high): 20(ptr) Variable Input 28: TypeBool - 34: TypeVector 6(float) 4 - 35: TypePointer Output 34(fvec4) - 36(Color): 35(ptr) Variable Output + 33: 15(int) Constant 1 + 35: TypeVector 6(float) 4 + 36: TypePointer Output 35(fvec4) + 37(Color): 36(ptr) Variable Output 4(main): 2 Function None 3 5: Label 17(z): 16(ptr) Variable Function Store 11(face1) 12 Store 13(face2) 14 Store 17(z) 18 - 22: 15(int) Load 21(low) - 23: 15(int) IMul 19 22 - 25: 15(int) IAdd 23 24 - 27: 15(int) Load 26(high) - 29: 28(bool) SLessThan 25 27 + 22: 6(float) Load 21(low) + 23: 6(float) FMul 19 22 + 25: 6(float) FAdd 23 24 + 27: 6(float) Load 26(high) + 29: 28(bool) FOrdLessThan 25 27 SelectionMerge 31 None BranchConditional 29 30 31 30: Label 32: 15(int) Load 17(z) - 33: 15(int) IAdd 32 24 - Store 17(z) 33 + 34: 15(int) IAdd 32 33 + Store 17(z) 34 Branch 31 31: Label - 37: 6(float) Load 11(face1) - 38: 15(int) Load 17(z) - 39: 6(float) ConvertSToF 38 - 40: 34(fvec4) CompositeConstruct 39 39 39 39 - 41: 34(fvec4) VectorTimesScalar 40 37 - 42: 6(float) FunctionCall 8(foo() - 43: 34(fvec4) CompositeConstruct 42 42 42 42 - 44: 34(fvec4) FAdd 41 43 - Store 36(Color) 44 + 38: 6(float) Load 11(face1) + 39: 15(int) Load 17(z) + 40: 6(float) ConvertSToF 39 + 41: 35(fvec4) CompositeConstruct 40 40 40 40 + 42: 35(fvec4) VectorTimesScalar 41 38 + 43: 6(float) FunctionCall 8(foo() + 44: 35(fvec4) CompositeConstruct 43 43 43 43 + 45: 35(fvec4) FAdd 42 44 + Store 37(Color) 45 Return FunctionEnd 8(foo(): 6(float) Function None 7 9: Label - 45: 6(float) Load 13(face2) - ReturnValue 45 + 46: 6(float) Load 13(face2) + ReturnValue 46 FunctionEnd diff --git a/Test/baseResults/spv.130.frag.out b/Test/baseResults/spv.130.frag.out index ad8ecc78494eb7b25ff999909e7db5fab276df47..8d881f505020b7d205d63fb176426244377582d2 100644 --- a/Test/baseResults/spv.130.frag.out +++ b/Test/baseResults/spv.130.frag.out @@ -7,7 +7,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 213 +// Id's are bound by 205 Capability Shader Capability ClipDistance @@ -18,7 +18,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 17 68 79 99 173 184 185 186 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 SourceExtension "GL_ARB_gpu_shader5" SourceExtension "GL_ARB_shader_texture_lod" @@ -61,14 +61,25 @@ Linked fragment stage: Name 199 "s2DRS" Name 203 "s1D" Name 204 "s2DS" - Name 206 "f" - Name 208 "v2" - Name 210 "v3" - Name 212 "v4" + Decorate 21(samp2D) DescriptorSet 0 + Decorate 37(samp2DA) DescriptorSet 0 + Decorate 47(samp2DR) DescriptorSet 0 + Decorate 55(samp2DS) DescriptorSet 0 + Decorate 72(Sca) DescriptorSet 0 + Decorate 87(Isca) DescriptorSet 0 + Decorate 103(Usca) DescriptorSet 0 + Decorate 118(Scas) DescriptorSet 0 + Decorate 167(sampC) DescriptorSet 0 Decorate 173(gl_ClipDistance) BuiltIn ClipDistance Decorate 184(fflat) Flat Decorate 186(fnop) NoPerspective + Decorate 193(bounds) DescriptorSet 0 Decorate 193(bounds) Binding 0 + Decorate 194(s2D) DescriptorSet 0 + Decorate 195(s2DR) DescriptorSet 0 + Decorate 199(s2DRS) DescriptorSet 0 + Decorate 203(s1D) DescriptorSet 0 + Decorate 204(s2DS) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 14: TypeFloat 32 @@ -177,14 +188,6 @@ Linked fragment stage: 202: TypePointer UniformConstant 201 203(s1D): 202(ptr) Variable UniformConstant 204(s2DS): 54(ptr) Variable UniformConstant - 205: TypePointer UniformConstant 14(float) - 206(f): 205(ptr) Variable UniformConstant - 207: TypePointer UniformConstant 23(fvec2) - 208(v2): 207(ptr) Variable UniformConstant - 209: TypePointer UniformConstant 39(fvec3) - 210(v3): 209(ptr) Variable UniformConstant - 211: TypePointer UniformConstant 15(fvec4) - 212(v4): 211(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 168: 165 Load 167(sampC) diff --git a/Test/baseResults/spv.140.frag.out b/Test/baseResults/spv.140.frag.out index 288272e299c0117022d17062488d64f4ae8f39e6..f302478c532d6210bd525f68b2cbb3f8864ddf17 100755 --- a/Test/baseResults/spv.140.frag.out +++ b/Test/baseResults/spv.140.frag.out @@ -15,7 +15,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 16 28 33 43 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "foo(" @@ -40,6 +40,9 @@ Linked fragment stage: Name 100 "bname" Decorate 16(gl_FrontFacing) BuiltIn FrontFacing Decorate 33(gl_ClipDistance) BuiltIn ClipDistance + Decorate 55(sampR) DescriptorSet 0 + Decorate 63(sampB) DescriptorSet 0 + Decorate 87(samp2Da) DescriptorSet 0 Decorate 90 ArrayStride 64 Decorate 91 ArrayStride 64 MemberDecorate 92(bn) 0 RowMajor @@ -58,9 +61,11 @@ Linked fragment stage: MemberDecorate 92(bn) 4 Offset 640 MemberDecorate 92(bn) 4 MatrixStride 16 Decorate 92(bn) Block + Decorate 94 DescriptorSet 0 Decorate 96 ArrayStride 16 MemberDecorate 97(bi) 0 Offset 0 Decorate 97(bi) Block + Decorate 100(bname) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.150.vert.out b/Test/baseResults/spv.150.vert.out index 3e86aec20be2f91ff4d2fdb1901c92ffae1364d1..5ccf1a812b658359fd3113f814763627ce21fd26 100755 --- a/Test/baseResults/spv.150.vert.out +++ b/Test/baseResults/spv.150.vert.out @@ -5,13 +5,13 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 67 +// Id's are bound by 63 Capability Shader Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 13 17 39 65 66 + EntryPoint Vertex 4 "main" 13 17 23 38 62 Source GLSL 150 Name 4 "main" Name 11 "gl_PerVertex" @@ -21,26 +21,23 @@ Linked vertex stage: Name 13 "" Name 17 "iv4" Name 23 "ps" - Name 35 "s1" - MemberName 35(s1) 0 "a" - MemberName 35(s1) 1 "a2" - MemberName 35(s1) 2 "b" - Name 37 "s2" - MemberName 37(s2) 0 "c" - MemberName 37(s2) 1 "d" - Name 39 "s2out" - Name 41 "i" - Name 48 "s2D" - Name 63 "ui" - Name 65 "gl_VertexID" - Name 66 "gl_InstanceID" + Name 34 "s1" + MemberName 34(s1) 0 "a" + MemberName 34(s1) 1 "a2" + MemberName 34(s1) 2 "b" + Name 36 "s2" + MemberName 36(s2) 0 "c" + MemberName 36(s2) 1 "d" + Name 38 "s2out" + Name 40 "i" + Name 47 "s2D" + Name 62 "ui" MemberDecorate 11(gl_PerVertex) 0 Invariant MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance Decorate 11(gl_PerVertex) Block - Decorate 65(gl_VertexID) BuiltIn VertexId - Decorate 66(gl_InstanceID) BuiltIn InstanceId + Decorate 47(s2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -57,58 +54,54 @@ Linked vertex stage: 17(iv4): 16(ptr) Variable Input 19: TypePointer Output 7(fvec4) 21: 14(int) Constant 1 - 22: TypePointer UniformConstant 6(float) - 23(ps): 22(ptr) Variable UniformConstant + 22: TypePointer Input 6(float) + 23(ps): 22(ptr) Variable Input 25: TypePointer Output 6(float) 27: 14(int) Constant 2 28: 8(int) Constant 0 - 29: TypePointer Input 6(float) - 33: 8(int) Constant 3 - 34: TypeArray 7(fvec4) 33 - 35(s1): TypeStruct 14(int) 14(int) 34 - 36: TypeArray 35(s1) 9 - 37(s2): TypeStruct 14(int) 36 - 38: TypePointer Output 37(s2) - 39(s2out): 38(ptr) Variable Output - 40: TypePointer Function 14(int) - 45: TypeImage 6(float) 2D sampled format:Unknown - 46: TypeSampledImage 45 - 47: TypePointer UniformConstant 46 - 48(s2D): 47(ptr) Variable UniformConstant - 50: TypeVector 6(float) 2 - 51: 6(float) Constant 1056964608 - 52: 50(fvec2) ConstantComposite 51 51 - 53: 6(float) Constant 0 - 56: TypeVector 6(float) 3 - 57: 56(fvec3) ConstantComposite 51 51 51 - 60: 6(float) Constant 1078774989 - 62: TypePointer UniformConstant 14(int) - 63(ui): 62(ptr) Variable UniformConstant - 64: TypePointer Input 14(int) - 65(gl_VertexID): 64(ptr) Variable Input -66(gl_InstanceID): 64(ptr) Variable Input + 32: 8(int) Constant 3 + 33: TypeArray 7(fvec4) 32 + 34(s1): TypeStruct 14(int) 14(int) 33 + 35: TypeArray 34(s1) 9 + 36(s2): TypeStruct 14(int) 35 + 37: TypePointer Output 36(s2) + 38(s2out): 37(ptr) Variable Output + 39: TypePointer Function 14(int) + 44: TypeImage 6(float) 2D sampled format:Unknown + 45: TypeSampledImage 44 + 46: TypePointer UniformConstant 45 + 47(s2D): 46(ptr) Variable UniformConstant + 49: TypeVector 6(float) 2 + 50: 6(float) Constant 1056964608 + 51: 49(fvec2) ConstantComposite 50 50 + 52: 6(float) Constant 0 + 55: TypeVector 6(float) 3 + 56: 55(fvec3) ConstantComposite 50 50 50 + 59: 6(float) Constant 1078774989 + 61: TypePointer Input 14(int) + 62(ui): 61(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 41(i): 40(ptr) Variable Function + 40(i): 39(ptr) Variable Function 18: 7(fvec4) Load 17(iv4) 20: 19(ptr) AccessChain 13 15 Store 20 18 24: 6(float) Load 23(ps) 26: 25(ptr) AccessChain 13 21 Store 26 24 - 30: 29(ptr) AccessChain 17(iv4) 28 - 31: 6(float) Load 30 - 32: 25(ptr) AccessChain 13 27 27 - Store 32 31 - 42: 14(int) Load 41(i) - 43: 6(float) Load 23(ps) - 44: 25(ptr) AccessChain 39(s2out) 21 42 27 27 33 - Store 44 43 - 49: 46 Load 48(s2D) - 54: 7(fvec4) ImageSampleExplicitLod 49 52 Lod 53 - 55: 46 Load 48(s2D) - 58: 7(fvec4) ImageSampleProjExplicitLod 55 57 Lod 53 - 59: 46 Load 48(s2D) - 61: 7(fvec4) ImageSampleExplicitLod 59 52 Lod 60 + 29: 22(ptr) AccessChain 17(iv4) 28 + 30: 6(float) Load 29 + 31: 25(ptr) AccessChain 13 27 27 + Store 31 30 + 41: 14(int) Load 40(i) + 42: 6(float) Load 23(ps) + 43: 25(ptr) AccessChain 38(s2out) 21 41 27 27 32 + Store 43 42 + 48: 45 Load 47(s2D) + 53: 7(fvec4) ImageSampleExplicitLod 48 51 Lod 52 + 54: 45 Load 47(s2D) + 57: 7(fvec4) ImageSampleProjExplicitLod 54 56 Lod 52 + 58: 45 Load 47(s2D) + 60: 7(fvec4) ImageSampleExplicitLod 58 51 Lod 59 Return FunctionEnd diff --git a/Test/baseResults/spv.300BuiltIns.vert.out b/Test/baseResults/spv.300BuiltIns.vert.out index a8dd6221bb27ed18e3c7a7e6a3a757a53387b8e1..ab07f4a86adeb76e5dcc758ca99db8e24a97b695 100755 --- a/Test/baseResults/spv.300BuiltIns.vert.out +++ b/Test/baseResults/spv.300BuiltIns.vert.out @@ -7,88 +7,73 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 49 +// Id's are bound by 42 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 11 24 27 48 + EntryPoint Vertex 4 "main" 10 14 21 34 Source ESSL 310 Name 4 "main" - Name 8 "i" - Name 11 "gl_VertexID" - Name 16 "j" - Name 22 "gl_PerVertex" - MemberName 22(gl_PerVertex) 0 "gl_Position" - MemberName 22(gl_PerVertex) 1 "gl_PointSize" - Name 24 "" - Name 27 "ps" - Name 48 "gl_InstanceID" - Decorate 8(i) RelaxedPrecision - Decorate 11(gl_VertexID) BuiltIn VertexId - Decorate 16(j) RelaxedPrecision - MemberDecorate 22(gl_PerVertex) 0 Invariant - MemberDecorate 22(gl_PerVertex) 0 BuiltIn Position - MemberDecorate 22(gl_PerVertex) 1 BuiltIn PointSize - Decorate 22(gl_PerVertex) Block - Decorate 27(ps) RelaxedPrecision - Decorate 28 RelaxedPrecision - Decorate 32 RelaxedPrecision - Decorate 39 RelaxedPrecision - Decorate 42 RelaxedPrecision - Decorate 48(gl_InstanceID) BuiltIn InstanceId + Name 8 "gl_PerVertex" + MemberName 8(gl_PerVertex) 0 "gl_Position" + MemberName 8(gl_PerVertex) 1 "gl_PointSize" + Name 10 "" + Name 14 "ps" + Name 21 "gl_VertexIndex" + Name 34 "gl_InstanceIndex" + MemberDecorate 8(gl_PerVertex) 0 Invariant + MemberDecorate 8(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 8(gl_PerVertex) 1 BuiltIn PointSize + Decorate 8(gl_PerVertex) Block + Decorate 14(ps) RelaxedPrecision + Decorate 15 RelaxedPrecision + Decorate 21(gl_VertexIndex) BuiltIn VertexIndex + Decorate 30 RelaxedPrecision + Decorate 34(gl_InstanceIndex) BuiltIn InstanceIndex 2: TypeVoid 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 4 - 10: TypePointer Input 6(int) - 11(gl_VertexID): 10(ptr) Variable Input - 14: 6(int) Constant 10 - 20: TypeFloat 32 - 21: TypeVector 20(float) 4 -22(gl_PerVertex): TypeStruct 21(fvec4) 20(float) - 23: TypePointer Output 22(gl_PerVertex) - 24: 23(ptr) Variable Output - 25: 6(int) Constant 0 - 26: TypePointer Input 20(float) - 27(ps): 26(ptr) Variable Input - 30: TypePointer Output 21(fvec4) - 38: 6(int) Constant 1 - 40: TypePointer Output 20(float) -48(gl_InstanceID): 10(ptr) Variable Input + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8(gl_PerVertex): TypeStruct 7(fvec4) 6(float) + 9: TypePointer Output 8(gl_PerVertex) + 10: 9(ptr) Variable Output + 11: TypeInt 32 1 + 12: 11(int) Constant 0 + 13: TypePointer Input 6(float) + 14(ps): 13(ptr) Variable Input + 17: TypePointer Output 7(fvec4) + 19: 11(int) Constant 4 + 20: TypePointer Input 11(int) +21(gl_VertexIndex): 20(ptr) Variable Input + 29: 11(int) Constant 1 + 31: TypePointer Output 6(float) + 33: 11(int) Constant 5 +34(gl_InstanceIndex): 20(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 8(i): 7(ptr) Variable Function - 16(j): 7(ptr) Variable Function - 12: 6(int) Load 11(gl_VertexID) - 13: 6(int) IMul 9 12 - 15: 6(int) ISub 13 14 - Store 8(i) 15 - 17: 6(int) Load 11(gl_VertexID) - 18: 6(int) IMul 9 17 - 19: 6(int) ISub 18 14 - Store 16(j) 19 - 28: 20(float) Load 27(ps) - 29: 21(fvec4) CompositeConstruct 28 28 28 28 - 31: 30(ptr) AccessChain 24 25 - Store 31 29 - 32: 6(int) Load 8(i) - 33: 20(float) ConvertSToF 32 - 34: 30(ptr) AccessChain 24 25 - 35: 21(fvec4) Load 34 - 36: 21(fvec4) VectorTimesScalar 35 33 - 37: 30(ptr) AccessChain 24 25 - Store 37 36 - 39: 20(float) Load 27(ps) - 41: 40(ptr) AccessChain 24 38 - Store 41 39 - 42: 6(int) Load 16(j) - 43: 20(float) ConvertSToF 42 - 44: 40(ptr) AccessChain 24 38 - 45: 20(float) Load 44 - 46: 20(float) FMul 45 43 - 47: 40(ptr) AccessChain 24 38 - Store 47 46 + 15: 6(float) Load 14(ps) + 16: 7(fvec4) CompositeConstruct 15 15 15 15 + 18: 17(ptr) AccessChain 10 12 + Store 18 16 + 22: 11(int) Load 21(gl_VertexIndex) + 23: 11(int) ISub 19 22 + 24: 6(float) ConvertSToF 23 + 25: 17(ptr) AccessChain 10 12 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) VectorTimesScalar 26 24 + 28: 17(ptr) AccessChain 10 12 + Store 28 27 + 30: 6(float) Load 14(ps) + 32: 31(ptr) AccessChain 10 29 + Store 32 30 + 35: 11(int) Load 34(gl_InstanceIndex) + 36: 11(int) ISub 33 35 + 37: 6(float) ConvertSToF 36 + 38: 31(ptr) AccessChain 10 29 + 39: 6(float) Load 38 + 40: 6(float) FMul 39 37 + 41: 31(ptr) AccessChain 10 29 + Store 41 40 Return FunctionEnd diff --git a/Test/baseResults/spv.300layout.frag.out b/Test/baseResults/spv.300layout.frag.out index ed39d5a687cc6849ae13fd39c6d249aa4aa73754..e340c1b22ae4b35999f8826962dffcb1ccf916d3 100755 --- a/Test/baseResults/spv.300layout.frag.out +++ b/Test/baseResults/spv.300layout.frag.out @@ -13,7 +13,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 9 11 15 26 29 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source ESSL 310 Name 4 "main" Name 9 "c" diff --git a/Test/baseResults/spv.300layout.vert.out b/Test/baseResults/spv.300layout.vert.out index f940f7aa315ba7c42f3e8313340222f5ed9b1069..859794a32877cfbcce4ad81cc56bf1d12b01b3f9 100644 --- a/Test/baseResults/spv.300layout.vert.out +++ b/Test/baseResults/spv.300layout.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 165 +// Id's are bound by 163 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 99 101 109 121 129 163 164 + EntryPoint Vertex 4 "main" 9 11 98 100 108 114 120 128 Source ESSL 310 Name 4 "main" Name 9 "pos" @@ -29,21 +29,19 @@ Linked vertex stage: MemberName 45(T3) 2 "N2" MemberName 45(T3) 3 "uv3a" Name 47 "" - Name 79 "T2" - MemberName 79(T2) 0 "b" - MemberName 79(T2) 1 "t2m" - Name 81 "" - Name 99 "color" - Name 101 "c" - Name 109 "iout" - Name 115 "uiuin" - Name 121 "aiv2" - Name 127 "S" - MemberName 127(S) 0 "c" - MemberName 127(S) 1 "f" - Name 129 "s" - Name 163 "gl_VertexID" - Name 164 "gl_InstanceID" + Name 78 "T2" + MemberName 78(T2) 0 "b" + MemberName 78(T2) 1 "t2m" + Name 80 "" + Name 98 "color" + Name 100 "c" + Name 108 "iout" + Name 114 "uiuin" + Name 120 "aiv2" + Name 126 "S" + MemberName 126(S) 0 "c" + MemberName 126(S) 1 "f" + Name 128 "s" Decorate 11(p) Location 3 MemberDecorate 17(Transform) 0 RowMajor MemberDecorate 17(Transform) 0 Offset 0 @@ -56,19 +54,29 @@ Linked vertex stage: MemberDecorate 17(Transform) 2 MatrixStride 16 MemberDecorate 17(Transform) 3 Offset 176 Decorate 17(Transform) Block + Decorate 19(tblock) DescriptorSet 0 + Decorate 44 ArrayStride 16 MemberDecorate 45(T3) 0 ColMajor + MemberDecorate 45(T3) 0 Offset 0 + MemberDecorate 45(T3) 0 MatrixStride 16 MemberDecorate 45(T3) 1 RowMajor + MemberDecorate 45(T3) 1 Offset 64 + MemberDecorate 45(T3) 1 MatrixStride 16 MemberDecorate 45(T3) 2 ColMajor - Decorate 45(T3) GLSLShared + MemberDecorate 45(T3) 2 Offset 128 + MemberDecorate 45(T3) 2 MatrixStride 16 + MemberDecorate 45(T3) 3 Offset 160 Decorate 45(T3) Block - MemberDecorate 79(T2) 1 RowMajor - Decorate 79(T2) GLSLShared - Decorate 79(T2) Block - Decorate 101(c) Location 7 - Decorate 109(iout) Flat - Decorate 121(aiv2) Location 9 - Decorate 163(gl_VertexID) BuiltIn VertexId - Decorate 164(gl_InstanceID) BuiltIn InstanceId + Decorate 47 DescriptorSet 0 + MemberDecorate 78(T2) 0 Offset 0 + MemberDecorate 78(T2) 1 RowMajor + MemberDecorate 78(T2) 1 Offset 16 + MemberDecorate 78(T2) 1 MatrixStride 16 + Decorate 78(T2) Block + Decorate 80 DescriptorSet 0 + Decorate 100(c) Location 7 + Decorate 108(iout) Flat + Decorate 120(aiv2) Location 9 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -95,42 +103,40 @@ Linked vertex stage: 45(T3): TypeStruct 13 13 40 44 46: TypePointer Uniform 45(T3) 47: 46(ptr) Variable Uniform - 78: TypeBool - 79(T2): TypeStruct 78(bool) 13 - 80: TypePointer Uniform 79(T2) - 81: 80(ptr) Variable Uniform - 98: TypePointer Output 14(fvec3) - 99(color): 98(ptr) Variable Output - 100: TypePointer Input 14(fvec3) - 101(c): 100(ptr) Variable Input - 103: 16(int) Constant 2 - 104: TypePointer Uniform 15 - 108: TypePointer Output 16(int) - 109(iout): 108(ptr) Variable Output - 110: 16(int) Constant 3 - 111: TypePointer Uniform 16(int) - 114: TypePointer UniformConstant 41(int) - 115(uiuin): 114(ptr) Variable UniformConstant - 119: TypeVector 16(int) 2 - 120: TypePointer Input 119(ivec2) - 121(aiv2): 120(ptr) Variable Input - 122: 41(int) Constant 1 - 123: TypePointer Input 16(int) - 127(S): TypeStruct 14(fvec3) 6(float) - 128: TypePointer Output 127(S) - 129(s): 128(ptr) Variable Output - 132: 41(int) Constant 0 - 133: TypePointer Input 6(float) - 136: TypePointer Output 6(float) + 78(T2): TypeStruct 41(int) 13 + 79: TypePointer Uniform 78(T2) + 80: 79(ptr) Variable Uniform + 97: TypePointer Output 14(fvec3) + 98(color): 97(ptr) Variable Output + 99: TypePointer Input 14(fvec3) + 100(c): 99(ptr) Variable Input + 102: 16(int) Constant 2 + 103: TypePointer Uniform 15 + 107: TypePointer Output 16(int) + 108(iout): 107(ptr) Variable Output + 109: 16(int) Constant 3 + 110: TypePointer Uniform 16(int) + 113: TypePointer Input 41(int) + 114(uiuin): 113(ptr) Variable Input + 118: TypeVector 16(int) 2 + 119: TypePointer Input 118(ivec2) + 120(aiv2): 119(ptr) Variable Input + 121: 41(int) Constant 1 + 122: TypePointer Input 16(int) + 126(S): TypeStruct 14(fvec3) 6(float) + 127: TypePointer Output 126(S) + 128(s): 127(ptr) Variable Output + 131: 41(int) Constant 0 + 132: TypePointer Input 6(float) + 135: TypePointer Output 6(float) + 137: TypeBool 138: TypePointer Uniform 14(fvec3) 141: 6(float) Constant 1065353216 142: 14(fvec3) ConstantComposite 141 141 141 - 143: TypeVector 78(bool) 3 + 143: TypeVector 137(bool) 3 149: TypePointer Uniform 42(ivec3) 152: 41(int) Constant 5 153: 42(ivec3) ConstantComposite 152 152 152 -163(gl_VertexID): 123(ptr) Variable Input -164(gl_InstanceID): 123(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(p) @@ -181,63 +187,63 @@ Linked vertex stage: 75: 7(fvec4) CompositeExtract 64 3 76: 7(fvec4) FAdd 74 75 77: 13 CompositeConstruct 67 70 73 76 - 82: 21(ptr) AccessChain 81 24 - 83: 13 Load 82 - 84: 7(fvec4) CompositeExtract 77 0 - 85: 7(fvec4) CompositeExtract 83 0 - 86: 7(fvec4) FAdd 84 85 - 87: 7(fvec4) CompositeExtract 77 1 - 88: 7(fvec4) CompositeExtract 83 1 - 89: 7(fvec4) FAdd 87 88 - 90: 7(fvec4) CompositeExtract 77 2 - 91: 7(fvec4) CompositeExtract 83 2 - 92: 7(fvec4) FAdd 90 91 - 93: 7(fvec4) CompositeExtract 77 3 - 94: 7(fvec4) CompositeExtract 83 3 - 95: 7(fvec4) FAdd 93 94 - 96: 13 CompositeConstruct 86 89 92 95 - 97: 7(fvec4) VectorTimesMatrix 12 96 - Store 9(pos) 97 - 102: 14(fvec3) Load 101(c) - 105: 104(ptr) AccessChain 19(tblock) 103 - 106: 15 Load 105 - 107: 14(fvec3) VectorTimesMatrix 102 106 - Store 99(color) 107 - 112: 111(ptr) AccessChain 19(tblock) 110 - 113: 16(int) Load 112 - 116: 41(int) Load 115(uiuin) - 117: 16(int) Bitcast 116 - 118: 16(int) IAdd 113 117 - 124: 123(ptr) AccessChain 121(aiv2) 122 - 125: 16(int) Load 124 - 126: 16(int) IAdd 118 125 - Store 109(iout) 126 - 130: 14(fvec3) Load 101(c) - 131: 98(ptr) AccessChain 129(s) 20 - Store 131 130 - 134: 133(ptr) AccessChain 11(p) 132 - 135: 6(float) Load 134 - 137: 136(ptr) AccessChain 129(s) 24 - Store 137 135 - 139: 138(ptr) AccessChain 47 103 24 + 81: 21(ptr) AccessChain 80 24 + 82: 13 Load 81 + 83: 7(fvec4) CompositeExtract 77 0 + 84: 7(fvec4) CompositeExtract 82 0 + 85: 7(fvec4) FAdd 83 84 + 86: 7(fvec4) CompositeExtract 77 1 + 87: 7(fvec4) CompositeExtract 82 1 + 88: 7(fvec4) FAdd 86 87 + 89: 7(fvec4) CompositeExtract 77 2 + 90: 7(fvec4) CompositeExtract 82 2 + 91: 7(fvec4) FAdd 89 90 + 92: 7(fvec4) CompositeExtract 77 3 + 93: 7(fvec4) CompositeExtract 82 3 + 94: 7(fvec4) FAdd 92 93 + 95: 13 CompositeConstruct 85 88 91 94 + 96: 7(fvec4) VectorTimesMatrix 12 95 + Store 9(pos) 96 + 101: 14(fvec3) Load 100(c) + 104: 103(ptr) AccessChain 19(tblock) 102 + 105: 15 Load 104 + 106: 14(fvec3) VectorTimesMatrix 101 105 + Store 98(color) 106 + 111: 110(ptr) AccessChain 19(tblock) 109 + 112: 16(int) Load 111 + 115: 41(int) Load 114(uiuin) + 116: 16(int) Bitcast 115 + 117: 16(int) IAdd 112 116 + 123: 122(ptr) AccessChain 120(aiv2) 121 + 124: 16(int) Load 123 + 125: 16(int) IAdd 117 124 + Store 108(iout) 125 + 129: 14(fvec3) Load 100(c) + 130: 97(ptr) AccessChain 128(s) 20 + Store 130 129 + 133: 132(ptr) AccessChain 11(p) 131 + 134: 6(float) Load 133 + 136: 135(ptr) AccessChain 128(s) 24 + Store 136 134 + 139: 138(ptr) AccessChain 47 102 24 140: 14(fvec3) Load 139 144: 143(bvec3) FOrdNotEqual 140 142 - 145: 78(bool) Any 144 - 146: 78(bool) LogicalNot 145 + 145: 137(bool) Any 144 + 146: 137(bool) LogicalNot 145 SelectionMerge 148 None BranchConditional 146 147 148 147: Label - 150: 149(ptr) AccessChain 47 110 103 + 150: 149(ptr) AccessChain 47 109 102 151: 42(ivec3) Load 150 154: 143(bvec3) INotEqual 151 153 - 155: 78(bool) Any 154 + 155: 137(bool) Any 154 Branch 148 148: Label - 156: 78(bool) Phi 145 5 155 147 + 156: 137(bool) Phi 145 5 155 147 SelectionMerge 158 None BranchConditional 156 157 158 157: Label - 159: 98(ptr) AccessChain 129(s) 20 + 159: 97(ptr) AccessChain 128(s) 20 160: 14(fvec3) Load 159 161: 14(fvec3) CompositeConstruct 141 141 141 162: 14(fvec3) FAdd 160 161 diff --git a/Test/baseResults/spv.300layoutp.vert.out b/Test/baseResults/spv.300layoutp.vert.out index 5baf51fb2e87cca4e6c644cdd755a306414baebc..ebad96358f65d9fcb651a0ad9072e8aa5a217381 100755 --- a/Test/baseResults/spv.300layoutp.vert.out +++ b/Test/baseResults/spv.300layoutp.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 117 +// Id's are bound by 115 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 51 53 61 73 81 115 116 + EntryPoint Vertex 4 "main" 9 11 50 52 60 72 80 Source ESSL 310 Name 4 "main" Name 9 "pos" @@ -29,21 +29,19 @@ Linked vertex stage: MemberName 33(T3) 2 "N2" MemberName 33(T3) 3 "uv3a" Name 35 "" - Name 43 "T2" - MemberName 43(T2) 0 "b" - MemberName 43(T2) 1 "t2m" - Name 45 "" - Name 51 "color" - Name 53 "c" - Name 61 "iout" - Name 67 "uiuin" - Name 73 "aiv2" - Name 79 "S" - MemberName 79(S) 0 "c" - MemberName 79(S) 1 "f" - Name 81 "s" - Name 115 "gl_VertexID" - Name 116 "gl_InstanceID" + Name 42 "T2" + MemberName 42(T2) 0 "b" + MemberName 42(T2) 1 "t2m" + Name 44 "" + Name 50 "color" + Name 52 "c" + Name 60 "iout" + Name 66 "uiuin" + Name 72 "aiv2" + Name 78 "S" + MemberName 78(S) 0 "c" + MemberName 78(S) 1 "f" + Name 80 "s" Decorate 11(p) Location 3 MemberDecorate 17(Transform) 0 RowMajor MemberDecorate 17(Transform) 0 Offset 0 @@ -56,19 +54,29 @@ Linked vertex stage: MemberDecorate 17(Transform) 2 MatrixStride 16 MemberDecorate 17(Transform) 3 Offset 176 Decorate 17(Transform) Block + Decorate 19(tblock) DescriptorSet 0 + Decorate 32 ArrayStride 16 MemberDecorate 33(T3) 0 ColMajor + MemberDecorate 33(T3) 0 Offset 0 + MemberDecorate 33(T3) 0 MatrixStride 16 MemberDecorate 33(T3) 1 RowMajor + MemberDecorate 33(T3) 1 Offset 64 + MemberDecorate 33(T3) 1 MatrixStride 16 MemberDecorate 33(T3) 2 ColMajor - Decorate 33(T3) GLSLShared + MemberDecorate 33(T3) 2 Offset 128 + MemberDecorate 33(T3) 2 MatrixStride 16 + MemberDecorate 33(T3) 3 Offset 160 Decorate 33(T3) Block - MemberDecorate 43(T2) 1 RowMajor - Decorate 43(T2) GLSLShared - Decorate 43(T2) Block - Decorate 53(c) Location 7 - Decorate 61(iout) Flat - Decorate 73(aiv2) Location 9 - Decorate 115(gl_VertexID) BuiltIn VertexId - Decorate 116(gl_InstanceID) BuiltIn InstanceId + Decorate 35 DescriptorSet 0 + MemberDecorate 42(T2) 0 Offset 0 + MemberDecorate 42(T2) 1 RowMajor + MemberDecorate 42(T2) 1 Offset 16 + MemberDecorate 42(T2) 1 MatrixStride 16 + Decorate 42(T2) Block + Decorate 44 DescriptorSet 0 + Decorate 52(c) Location 7 + Decorate 60(iout) Flat + Decorate 72(aiv2) Location 9 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -95,42 +103,40 @@ Linked vertex stage: 33(T3): TypeStruct 13 13 28 32 34: TypePointer Uniform 33(T3) 35: 34(ptr) Variable Uniform - 42: TypeBool - 43(T2): TypeStruct 42(bool) 13 - 44: TypePointer Uniform 43(T2) - 45: 44(ptr) Variable Uniform - 50: TypePointer Output 14(fvec3) - 51(color): 50(ptr) Variable Output - 52: TypePointer Input 14(fvec3) - 53(c): 52(ptr) Variable Input - 55: 16(int) Constant 2 - 56: TypePointer Uniform 15 - 60: TypePointer Output 16(int) - 61(iout): 60(ptr) Variable Output - 62: 16(int) Constant 3 - 63: TypePointer Uniform 16(int) - 66: TypePointer UniformConstant 29(int) - 67(uiuin): 66(ptr) Variable UniformConstant - 71: TypeVector 16(int) 2 - 72: TypePointer Input 71(ivec2) - 73(aiv2): 72(ptr) Variable Input - 74: 29(int) Constant 1 - 75: TypePointer Input 16(int) - 79(S): TypeStruct 14(fvec3) 6(float) - 80: TypePointer Output 79(S) - 81(s): 80(ptr) Variable Output - 84: 29(int) Constant 0 - 85: TypePointer Input 6(float) - 88: TypePointer Output 6(float) + 42(T2): TypeStruct 29(int) 13 + 43: TypePointer Uniform 42(T2) + 44: 43(ptr) Variable Uniform + 49: TypePointer Output 14(fvec3) + 50(color): 49(ptr) Variable Output + 51: TypePointer Input 14(fvec3) + 52(c): 51(ptr) Variable Input + 54: 16(int) Constant 2 + 55: TypePointer Uniform 15 + 59: TypePointer Output 16(int) + 60(iout): 59(ptr) Variable Output + 61: 16(int) Constant 3 + 62: TypePointer Uniform 16(int) + 65: TypePointer Private 29(int) + 66(uiuin): 65(ptr) Variable Private + 70: TypeVector 16(int) 2 + 71: TypePointer Input 70(ivec2) + 72(aiv2): 71(ptr) Variable Input + 73: 29(int) Constant 1 + 74: TypePointer Input 16(int) + 78(S): TypeStruct 14(fvec3) 6(float) + 79: TypePointer Output 78(S) + 80(s): 79(ptr) Variable Output + 83: 29(int) Constant 0 + 84: TypePointer Input 6(float) + 87: TypePointer Output 6(float) + 89: TypeBool 90: TypePointer Uniform 14(fvec3) 93: 6(float) Constant 1065353216 94: 14(fvec3) ConstantComposite 93 93 93 - 95: TypeVector 42(bool) 3 + 95: TypeVector 89(bool) 3 101: TypePointer Uniform 30(ivec3) 104: 29(int) Constant 5 105: 30(ivec3) ConstantComposite 104 104 104 -115(gl_VertexID): 75(ptr) Variable Input -116(gl_InstanceID): 75(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(p) @@ -145,51 +151,51 @@ Linked vertex stage: 39: 21(ptr) AccessChain 35 20 40: 13 Load 39 41: 13 MatrixTimesMatrix 38 40 - 46: 21(ptr) AccessChain 45 24 - 47: 13 Load 46 - 48: 13 MatrixTimesMatrix 41 47 - 49: 7(fvec4) VectorTimesMatrix 12 48 - Store 9(pos) 49 - 54: 14(fvec3) Load 53(c) - 57: 56(ptr) AccessChain 19(tblock) 55 - 58: 15 Load 57 - 59: 14(fvec3) VectorTimesMatrix 54 58 - Store 51(color) 59 - 64: 63(ptr) AccessChain 19(tblock) 62 - 65: 16(int) Load 64 - 68: 29(int) Load 67(uiuin) - 69: 16(int) Bitcast 68 - 70: 16(int) IAdd 65 69 - 76: 75(ptr) AccessChain 73(aiv2) 74 - 77: 16(int) Load 76 - 78: 16(int) IAdd 70 77 - Store 61(iout) 78 - 82: 14(fvec3) Load 53(c) - 83: 50(ptr) AccessChain 81(s) 20 - Store 83 82 - 86: 85(ptr) AccessChain 11(p) 84 - 87: 6(float) Load 86 - 89: 88(ptr) AccessChain 81(s) 24 - Store 89 87 - 91: 90(ptr) AccessChain 35 55 24 + 45: 21(ptr) AccessChain 44 24 + 46: 13 Load 45 + 47: 13 MatrixTimesMatrix 41 46 + 48: 7(fvec4) VectorTimesMatrix 12 47 + Store 9(pos) 48 + 53: 14(fvec3) Load 52(c) + 56: 55(ptr) AccessChain 19(tblock) 54 + 57: 15 Load 56 + 58: 14(fvec3) VectorTimesMatrix 53 57 + Store 50(color) 58 + 63: 62(ptr) AccessChain 19(tblock) 61 + 64: 16(int) Load 63 + 67: 29(int) Load 66(uiuin) + 68: 16(int) Bitcast 67 + 69: 16(int) IAdd 64 68 + 75: 74(ptr) AccessChain 72(aiv2) 73 + 76: 16(int) Load 75 + 77: 16(int) IAdd 69 76 + Store 60(iout) 77 + 81: 14(fvec3) Load 52(c) + 82: 49(ptr) AccessChain 80(s) 20 + Store 82 81 + 85: 84(ptr) AccessChain 11(p) 83 + 86: 6(float) Load 85 + 88: 87(ptr) AccessChain 80(s) 24 + Store 88 86 + 91: 90(ptr) AccessChain 35 54 24 92: 14(fvec3) Load 91 96: 95(bvec3) FOrdNotEqual 92 94 - 97: 42(bool) Any 96 - 98: 42(bool) LogicalNot 97 + 97: 89(bool) Any 96 + 98: 89(bool) LogicalNot 97 SelectionMerge 100 None BranchConditional 98 99 100 99: Label - 102: 101(ptr) AccessChain 35 62 55 + 102: 101(ptr) AccessChain 35 61 54 103: 30(ivec3) Load 102 106: 95(bvec3) INotEqual 103 105 - 107: 42(bool) Any 106 + 107: 89(bool) Any 106 Branch 100 100: Label - 108: 42(bool) Phi 97 5 107 99 + 108: 89(bool) Phi 97 5 107 99 SelectionMerge 110 None BranchConditional 108 109 110 109: Label - 111: 50(ptr) AccessChain 81(s) 20 + 111: 49(ptr) AccessChain 80(s) 20 112: 14(fvec3) Load 111 113: 14(fvec3) CompositeConstruct 93 93 93 114: 14(fvec3) FAdd 112 113 diff --git a/Test/baseResults/spv.310.comp.out b/Test/baseResults/spv.310.comp.out index 1a34d0878665d4430743126f841e3466aab6afe3..fa23af921bbf95c4339e93b77e9e76512b86f5ad 100755 --- a/Test/baseResults/spv.310.comp.out +++ b/Test/baseResults/spv.310.comp.out @@ -33,12 +33,22 @@ Linked compute stage: MemberName 48(outs) 1 "va" Name 50 "outnames" Name 53 "gl_LocalInvocationID" - Decorate 13(outb) GLSLShared + Decorate 12 ArrayStride 16 + MemberDecorate 13(outb) 0 Offset 0 + MemberDecorate 13(outb) 1 Offset 4 + MemberDecorate 13(outb) 2 Offset 8 + MemberDecorate 13(outb) 3 Offset 16 Decorate 13(outb) BufferBlock - Decorate 24(outbna) GLSLShared + Decorate 15(outbname) DescriptorSet 0 + MemberDecorate 24(outbna) 0 Offset 0 + MemberDecorate 24(outbna) 1 Offset 16 Decorate 24(outbna) BufferBlock - Decorate 48(outs) GLSLShared + Decorate 26(outbnamena) DescriptorSet 0 + Decorate 47 ArrayStride 16 + MemberDecorate 48(outs) 0 Offset 0 + MemberDecorate 48(outs) 1 Offset 16 Decorate 48(outs) BufferBlock + Decorate 50(outnames) DescriptorSet 0 Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId Decorate 66 BuiltIn WorkgroupSize 2: TypeVoid diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 81ae28e20aec745d3afd57dcb95859b26a8c9a4b..a851500c05221b030167d04d3e5894abf875c4cf 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -16,7 +16,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 13 1025 1031 1036 1048 1074 1095 1097 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 400 SourceExtension "GL_ARB_separate_shader_objects" Name 4 "main" @@ -52,8 +52,12 @@ Linked fragment stage: Name 1078 "isamp2DA" Name 1095 "gl_FragCoord" Name 1097 "vl2" + Decorate 17(u2drs) DescriptorSet 0 + Decorate 1023(arrayedSampler) DescriptorSet 0 Decorate 1025(i) Flat Decorate 1036(gl_ClipDistance) BuiltIn ClipDistance + Decorate 1052(samp2dr) DescriptorSet 0 + Decorate 1078(isamp2DA) DescriptorSet 0 Decorate 1095(gl_FragCoord) BuiltIn FragCoord Decorate 1097(vl2) Location 6 2: TypeVoid diff --git a/Test/baseResults/spv.420.geom.out b/Test/baseResults/spv.420.geom.out index 0d659c5bc44a93c8dadffba77cd02495946544af..09fffb8ea6a8c6d081a946ab028e2e34e5feb77a 100644 --- a/Test/baseResults/spv.420.geom.out +++ b/Test/baseResults/spv.420.geom.out @@ -7,7 +7,7 @@ Linked geometry stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 74 +// Id's are bound by 72 Capability Geometry Capability GeometryPointSize @@ -36,7 +36,6 @@ Linked geometry stage: Name 46 "coord" Name 64 "i" Name 67 "indexable" - Name 73 "v4" MemberDecorate 9(gl_PerVertex) 0 BuiltIn PointSize Decorate 9(gl_PerVertex) Block MemberDecorate 21(gl_PerVertex) 0 BuiltIn PointSize @@ -46,6 +45,7 @@ Linked geometry stage: Decorate 28(gl_ViewportIndex) Stream 0 Decorate 28(gl_ViewportIndex) BuiltIn ViewportIndex Decorate 33(gl_InvocationID) BuiltIn InvocationId + Decorate 41(s2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -94,12 +94,10 @@ Linked geometry stage: 60: 15(int) Constant 2 61: 50(ivec2) ConstantComposite 60 16 62: 52 ConstantComposite 53 55 57 59 61 - 63: TypePointer UniformConstant 15(int) - 64(i): 63(ptr) Variable UniformConstant + 63: TypePointer Private 15(int) + 64(i): 63(ptr) Variable Private 66: TypePointer Function 52 68: TypePointer Function 50(ivec2) - 72: TypePointer UniformConstant 35(fvec4) - 73(v4): 72(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 8(p): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.430.vert.out b/Test/baseResults/spv.430.vert.out index 2bf2aafd032742e6f60fa149b78acefc519c8df4..a851b1c4103ea030006d0fd0bb6cf69c268f31d8 100755 --- a/Test/baseResults/spv.430.vert.out +++ b/Test/baseResults/spv.430.vert.out @@ -7,13 +7,13 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 69 +// Id's are bound by 63 Capability Shader Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 12 23 34 44 45 65 67 68 + EntryPoint Vertex 4 "main" 12 23 34 38 41 42 62 Source GLSL 430 Name 4 "main" Name 10 "gl_PerVertex" @@ -21,58 +21,57 @@ Linked vertex stage: Name 12 "" Name 23 "bad" Name 34 "badorder3" - Name 39 "f" - Name 43 "uv4" - Name 44 "badorder" - Name 45 "badorder2" - Name 46 "boundblock" - MemberName 46(boundblock) 0 "aoeu" - Name 48 "boundInst" - Name 49 "anonblock" - MemberName 49(anonblock) 0 "aoeu" - Name 51 "" - Name 55 "sampb1" - Name 58 "sampb2" - Name 59 "sampb4" - Name 62 "S" - MemberName 62(S) 0 "a" - MemberName 62(S) 1 "b" - MemberName 62(S) 2 "c" - Name 63 "SS" - MemberName 63(SS) 0 "b" - MemberName 63(SS) 1 "s" - MemberName 63(SS) 2 "c" - Name 65 "var" - Name 67 "gl_VertexID" - Name 68 "gl_InstanceID" + Name 38 "f" + Name 41 "badorder" + Name 42 "badorder2" + Name 43 "boundblock" + MemberName 43(boundblock) 0 "aoeu" + Name 45 "boundInst" + Name 46 "anonblock" + MemberName 46(anonblock) 0 "aoeu" + Name 48 "" + Name 52 "sampb1" + Name 55 "sampb2" + Name 56 "sampb4" + Name 59 "S" + MemberName 59(S) 0 "a" + MemberName 59(S) 1 "b" + MemberName 59(S) 2 "c" + Name 60 "SS" + MemberName 60(SS) 0 "b" + MemberName 60(SS) 1 "s" + MemberName 60(SS) 2 "c" + Name 62 "var" MemberDecorate 10(gl_PerVertex) 0 BuiltIn ClipDistance Decorate 10(gl_PerVertex) Block Decorate 34(badorder3) Flat - Decorate 43(uv4) Location 4 - Decorate 45(badorder2) Invariant - Decorate 46(boundblock) GLSLShared - Decorate 46(boundblock) Block - Decorate 48(boundInst) Binding 3 - Decorate 49(anonblock) GLSLShared - Decorate 49(anonblock) Block - Decorate 51 Binding 7 - Decorate 55(sampb1) Binding 4 - Decorate 58(sampb2) Binding 5 - Decorate 59(sampb4) Binding 31 - MemberDecorate 62(S) 0 Flat - MemberDecorate 62(S) 0 Location 1 - MemberDecorate 62(S) 1 Flat - MemberDecorate 62(S) 1 Location 2 - MemberDecorate 62(S) 2 Flat - MemberDecorate 62(S) 2 Location 3 - MemberDecorate 63(SS) 0 Flat - MemberDecorate 63(SS) 0 Location 0 - MemberDecorate 63(SS) 1 Flat - MemberDecorate 63(SS) 1 Location 1 - MemberDecorate 63(SS) 2 Flat - MemberDecorate 63(SS) 2 Location 4 - Decorate 67(gl_VertexID) BuiltIn VertexId - Decorate 68(gl_InstanceID) BuiltIn InstanceId + Decorate 42(badorder2) Invariant + MemberDecorate 43(boundblock) 0 Offset 0 + Decorate 43(boundblock) Block + Decorate 45(boundInst) DescriptorSet 0 + Decorate 45(boundInst) Binding 3 + MemberDecorate 46(anonblock) 0 Offset 0 + Decorate 46(anonblock) Block + Decorate 48 DescriptorSet 0 + Decorate 48 Binding 7 + Decorate 52(sampb1) DescriptorSet 0 + Decorate 52(sampb1) Binding 4 + Decorate 55(sampb2) DescriptorSet 0 + Decorate 55(sampb2) Binding 5 + Decorate 56(sampb4) DescriptorSet 0 + Decorate 56(sampb4) Binding 31 + MemberDecorate 59(S) 0 Flat + MemberDecorate 59(S) 0 Location 1 + MemberDecorate 59(S) 1 Flat + MemberDecorate 59(S) 1 Location 2 + MemberDecorate 59(S) 2 Flat + MemberDecorate 59(S) 2 Location 3 + MemberDecorate 60(SS) 0 Flat + MemberDecorate 60(SS) 0 Location 0 + MemberDecorate 60(SS) 1 Flat + MemberDecorate 60(SS) 1 Location 1 + MemberDecorate 60(SS) 2 Flat + MemberDecorate 60(SS) 2 Location 4 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -99,35 +98,29 @@ Linked vertex stage: 33: TypePointer Output 19(fvec4) 34(badorder3): 33(ptr) Variable Output 35: TypePointer Input 19(fvec4) - 38: TypePointer UniformConstant 6(float) - 39(f): 38(ptr) Variable UniformConstant - 42: TypePointer UniformConstant 19(fvec4) - 43(uv4): 42(ptr) Variable UniformConstant - 44(badorder): 35(ptr) Variable Input - 45(badorder2): 33(ptr) Variable Output - 46(boundblock): TypeStruct 13(int) - 47: TypePointer Uniform 46(boundblock) - 48(boundInst): 47(ptr) Variable Uniform - 49(anonblock): TypeStruct 13(int) - 50: TypePointer Uniform 49(anonblock) - 51: 50(ptr) Variable Uniform - 52: TypeImage 6(float) 2D sampled format:Unknown - 53: TypeSampledImage 52 + 38(f): 25(ptr) Variable Input + 41(badorder): 35(ptr) Variable Input + 42(badorder2): 33(ptr) Variable Output + 43(boundblock): TypeStruct 13(int) + 44: TypePointer Uniform 43(boundblock) + 45(boundInst): 44(ptr) Variable Uniform + 46(anonblock): TypeStruct 13(int) + 47: TypePointer Uniform 46(anonblock) + 48: 47(ptr) Variable Uniform + 49: TypeImage 6(float) 2D sampled format:Unknown + 50: TypeSampledImage 49 + 51: TypePointer UniformConstant 50 + 52(sampb1): 51(ptr) Variable UniformConstant + 53: TypeArray 50 20 54: TypePointer UniformConstant 53 - 55(sampb1): 54(ptr) Variable UniformConstant - 56: TypeArray 53 20 - 57: TypePointer UniformConstant 56 - 58(sampb2): 57(ptr) Variable UniformConstant - 59(sampb4): 54(ptr) Variable UniformConstant - 60: TypeVector 7(int) 2 - 61: TypeVector 6(float) 3 - 62(S): TypeStruct 6(float) 60(ivec2) 61(fvec3) - 63(SS): TypeStruct 19(fvec4) 62(S) 19(fvec4) - 64: TypePointer Output 63(SS) - 65(var): 64(ptr) Variable Output - 66: TypePointer Input 13(int) - 67(gl_VertexID): 66(ptr) Variable Input -68(gl_InstanceID): 66(ptr) Variable Input + 55(sampb2): 54(ptr) Variable UniformConstant + 56(sampb4): 51(ptr) Variable UniformConstant + 57: TypeVector 7(int) 2 + 58: TypeVector 6(float) 3 + 59(S): TypeStruct 6(float) 57(ivec2) 58(fvec3) + 60(SS): TypeStruct 19(fvec4) 59(S) 19(fvec4) + 61: TypePointer Output 60(SS) + 62(var): 61(ptr) Variable Output 4(main): 2 Function None 3 5: Label 18: 17(ptr) AccessChain 12 14 15 @@ -143,8 +136,8 @@ Linked vertex stage: Store 34(badorder3) 37 Branch 32 32: Label - 40: 6(float) Load 39(f) - 41: 17(ptr) AccessChain 12 14 14 - Store 41 40 + 39: 6(float) Load 38(f) + 40: 17(ptr) AccessChain 12 14 14 + Store 40 39 Return FunctionEnd diff --git a/Test/baseResults/spv.AofA.frag.out b/Test/baseResults/spv.AofA.frag.out index 1e41c3b8c1f6f6d0cb034b0094a8635cd36efdac..0dbf69ceda26eb7e37388ba34afe995674e4cd91 100644 --- a/Test/baseResults/spv.AofA.frag.out +++ b/Test/baseResults/spv.AofA.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 39 44 78 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 39 44 68 70 72 78 + ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" Name 17 "foo(f1[5][7];" @@ -33,8 +33,14 @@ Linked fragment stage: Name 94 "uAofA" MemberName 94(uAofA) 0 "f" Name 98 "nameAofA" - Decorate 94(uAofA) GLSLShared + Decorate 68(i) Flat + Decorate 70(j) Flat + Decorate 72(k) Flat + Decorate 92 ArrayStride 16 + Decorate 93 ArrayStride 64 + MemberDecorate 94(uAofA) 0 Offset 0 Decorate 94(uAofA) Block + Decorate 98(nameAofA) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -74,10 +80,10 @@ Linked fragment stage: 64: TypeArray 62 63 65: TypePointer Private 64 66(many): 65(ptr) Variable Private - 67: TypePointer UniformConstant 21(int) - 68(i): 67(ptr) Variable UniformConstant - 70(j): 67(ptr) Variable UniformConstant - 72(k): 67(ptr) Variable UniformConstant + 67: TypePointer Input 21(int) + 68(i): 67(ptr) Variable Input + 70(j): 67(ptr) Variable Input + 72(k): 67(ptr) Variable Input 77: TypePointer Input 6(float) 78(infloat): 77(ptr) Variable Input 80: TypePointer Private 6(float) diff --git a/Test/baseResults/spv.Operations.frag.out b/Test/baseResults/spv.Operations.frag.out index 16b0013cf87c54c6c86ac5fa34149fbc5e7ae20a..b3a6d2835291ed22cde6b8cca6c656940ae2fce1 100755 --- a/Test/baseResults/spv.Operations.frag.out +++ b/Test/baseResults/spv.Operations.frag.out @@ -7,13 +7,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 507 +// Id's are bound by 509 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 483 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 22 212 288 485 503 508 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "v" @@ -27,52 +27,56 @@ Linked fragment stage: Name 288 "uui" Name 305 "b" Name 342 "ub42" - Name 483 "FragColor" - Name 501 "uiv4" - Name 503 "ub" - Name 506 "uuv4" + Name 485 "FragColor" + Name 503 "uiv4" + Name 505 "ub" + Name 508 "uuv4" + Decorate 22(ui) Flat + Decorate 288(uui) Flat + Decorate 503(uiv4) Flat + Decorate 508(uuv4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypePointer Function 7(fvec4) - 10: TypePointer UniformConstant 7(fvec4) - 11(uv4): 10(ptr) Variable UniformConstant + 10: TypePointer Input 7(fvec4) + 11(uv4): 10(ptr) Variable Input 18: TypeInt 32 1 19: TypePointer Function 18(int) - 21: TypePointer UniformConstant 18(int) - 22(ui): 21(ptr) Variable UniformConstant + 21: TypePointer Input 18(int) + 22(ui): 21(ptr) Variable Input 141: TypeInt 32 0 142: 141(int) Constant 0 143: TypePointer Function 6(float) 178: TypeBool 179: TypeVector 178(bool) 4 - 180: TypePointer UniformConstant 179(bvec4) - 181(ub41): 180(ptr) Variable UniformConstant - 211: TypePointer UniformConstant 6(float) - 212(uf): 211(ptr) Variable UniformConstant + 180: TypePointer Private 179(bvec4) + 181(ub41): 180(ptr) Variable Private + 211: TypePointer Input 6(float) + 212(uf): 211(ptr) Variable Input 284: TypePointer Function 141(int) - 287: TypePointer UniformConstant 141(int) - 288(uui): 287(ptr) Variable UniformConstant + 287: TypePointer Input 141(int) + 288(uui): 287(ptr) Variable Input 304: TypePointer Function 178(bool) - 342(ub42): 180(ptr) Variable UniformConstant - 396: 18(int) Constant 2 - 403: 18(int) Constant 1 - 433: TypeVector 6(float) 3 - 452: 6(float) Constant 1073741824 - 459: 6(float) Constant 1065353216 - 464: 18(int) Constant 66 - 470: 18(int) Constant 17 - 482: TypePointer Output 7(fvec4) - 483(FragColor): 482(ptr) Variable Output - 499: TypeVector 18(int) 4 - 500: TypePointer UniformConstant 499(ivec4) - 501(uiv4): 500(ptr) Variable UniformConstant - 502: TypePointer UniformConstant 178(bool) - 503(ub): 502(ptr) Variable UniformConstant - 504: TypeVector 141(int) 4 - 505: TypePointer UniformConstant 504(ivec4) - 506(uuv4): 505(ptr) Variable UniformConstant + 342(ub42): 180(ptr) Variable Private + 398: 18(int) Constant 2 + 405: 18(int) Constant 1 + 435: TypeVector 6(float) 3 + 454: 6(float) Constant 1073741824 + 461: 6(float) Constant 1065353216 + 466: 18(int) Constant 66 + 472: 18(int) Constant 17 + 484: TypePointer Output 7(fvec4) + 485(FragColor): 484(ptr) Variable Output + 501: TypeVector 18(int) 4 + 502: TypePointer Input 501(ivec4) + 503(uiv4): 502(ptr) Variable Input + 504: TypePointer Private 178(bool) + 505(ub): 504(ptr) Variable Private + 506: TypeVector 141(int) 4 + 507: TypePointer Input 506(ivec4) + 508(uuv4): 507(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(v): 8(ptr) Variable Function @@ -80,7 +84,7 @@ Linked fragment stage: 188(f): 143(ptr) Variable Function 285(u): 284(ptr) Variable Function 305(b): 304(ptr) Variable Function - 484: 8(ptr) Variable Function + 486: 8(ptr) Variable Function 12: 7(fvec4) Load 11(uv4) 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 Store 9(v) 13 @@ -529,137 +533,142 @@ Linked fragment stage: 388: 18(int) Load 20(i) 389: 18(int) Load 22(ui) 390: 178(bool) INotEqual 388 389 - 391: 18(int) Load 20(i) - 392: 18(int) Load 22(ui) - 393: 178(bool) IEqual 391 392 - 394: 178(bool) LogicalAnd 390 393 - 395: 18(int) Load 20(i) - 397: 178(bool) INotEqual 395 396 - 398: 178(bool) LogicalNotEqual 394 397 + SelectionMerge 392 None + BranchConditional 390 391 392 + 391: Label + 393: 18(int) Load 20(i) + 394: 18(int) Load 22(ui) + 395: 178(bool) IEqual 393 394 + Branch 392 + 392: Label + 396: 178(bool) Phi 390 386 395 391 + 397: 18(int) Load 20(i) + 399: 178(bool) INotEqual 397 398 + 400: 178(bool) LogicalNotEqual 396 399 Branch 387 387: Label - 399: 178(bool) Phi 384 365 398 386 - SelectionMerge 401 None - BranchConditional 399 400 401 - 400: Label - 402: 18(int) Load 20(i) - 404: 18(int) IAdd 402 403 - Store 20(i) 404 - Branch 401 - 401: Label - 405: 6(float) Load 212(uf) - 406: 6(float) Load 212(uf) - 407: 6(float) FAdd 405 406 + 401: 178(bool) Phi 384 365 400 392 + SelectionMerge 403 None + BranchConditional 401 402 403 + 402: Label + 404: 18(int) Load 20(i) + 406: 18(int) IAdd 404 405 + Store 20(i) 406 + Branch 403 + 403: Label + 407: 6(float) Load 212(uf) 408: 6(float) Load 212(uf) - 409: 6(float) FMul 407 408 + 409: 6(float) FAdd 407 408 410: 6(float) Load 212(uf) - 411: 6(float) FSub 409 410 + 411: 6(float) FMul 409 410 412: 6(float) Load 212(uf) - 413: 6(float) FDiv 411 412 - Store 188(f) 413 - 414: 7(fvec4) Load 9(v) - 415: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 414 - 416: 6(float) Load 188(f) - 417: 6(float) FAdd 416 415 - Store 188(f) 417 - 418: 7(fvec4) Load 9(v) - 419: 7(fvec4) Load 9(v) - 420: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 418 419 - 421: 6(float) Load 188(f) - 422: 6(float) FAdd 421 420 - Store 188(f) 422 - 423: 7(fvec4) Load 9(v) - 424: 7(fvec4) Load 9(v) - 425: 6(float) Dot 423 424 - 426: 6(float) Load 188(f) - 427: 6(float) FAdd 426 425 - Store 188(f) 427 + 413: 6(float) FSub 411 412 + 414: 6(float) Load 212(uf) + 415: 6(float) FDiv 413 414 + Store 188(f) 415 + 416: 7(fvec4) Load 9(v) + 417: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 416 + 418: 6(float) Load 188(f) + 419: 6(float) FAdd 418 417 + Store 188(f) 419 + 420: 7(fvec4) Load 9(v) + 421: 7(fvec4) Load 9(v) + 422: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 420 421 + 423: 6(float) Load 188(f) + 424: 6(float) FAdd 423 422 + Store 188(f) 424 + 425: 7(fvec4) Load 9(v) + 426: 7(fvec4) Load 9(v) + 427: 6(float) Dot 425 426 428: 6(float) Load 188(f) - 429: 6(float) Load 212(uf) - 430: 6(float) FMul 428 429 - 431: 6(float) Load 188(f) - 432: 6(float) FAdd 431 430 - Store 188(f) 432 - 434: 7(fvec4) Load 9(v) - 435: 433(fvec3) VectorShuffle 434 434 0 1 2 + 429: 6(float) FAdd 428 427 + Store 188(f) 429 + 430: 6(float) Load 188(f) + 431: 6(float) Load 212(uf) + 432: 6(float) FMul 430 431 + 433: 6(float) Load 188(f) + 434: 6(float) FAdd 433 432 + Store 188(f) 434 436: 7(fvec4) Load 9(v) - 437: 433(fvec3) VectorShuffle 436 436 0 1 2 - 438: 433(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 435 437 - 439: 6(float) CompositeExtract 438 0 - 440: 6(float) Load 188(f) - 441: 6(float) FAdd 440 439 - Store 188(f) 441 + 437: 435(fvec3) VectorShuffle 436 436 0 1 2 + 438: 7(fvec4) Load 9(v) + 439: 435(fvec3) VectorShuffle 438 438 0 1 2 + 440: 435(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 437 439 + 441: 6(float) CompositeExtract 440 0 442: 6(float) Load 188(f) - 443: 6(float) Load 212(uf) - 444: 178(bool) FOrdEqual 442 443 - 445: 178(bool) LogicalNot 444 - SelectionMerge 447 None - BranchConditional 445 446 447 - 446: Label - 448: 6(float) Load 188(f) - 449: 6(float) Load 212(uf) - 450: 178(bool) FOrdNotEqual 448 449 - 451: 6(float) Load 188(f) - 453: 178(bool) FOrdNotEqual 451 452 - 454: 178(bool) LogicalAnd 450 453 - Branch 447 - 447: Label - 455: 178(bool) Phi 444 401 454 446 - SelectionMerge 457 None - BranchConditional 455 456 457 - 456: Label - 458: 6(float) Load 188(f) - 460: 6(float) FAdd 458 459 - Store 188(f) 460 - Branch 457 - 457: Label - 461: 18(int) Load 22(ui) - 462: 18(int) Load 20(i) - 463: 18(int) BitwiseAnd 462 461 - Store 20(i) 463 - 465: 18(int) Load 20(i) - 466: 18(int) BitwiseOr 465 464 - Store 20(i) 466 - 467: 18(int) Load 22(ui) - 468: 18(int) Load 20(i) - 469: 18(int) BitwiseXor 468 467 - Store 20(i) 469 - 471: 18(int) Load 20(i) - 472: 18(int) SMod 471 470 - Store 20(i) 472 + 443: 6(float) FAdd 442 441 + Store 188(f) 443 + 444: 6(float) Load 188(f) + 445: 6(float) Load 212(uf) + 446: 178(bool) FOrdEqual 444 445 + 447: 178(bool) LogicalNot 446 + SelectionMerge 449 None + BranchConditional 447 448 449 + 448: Label + 450: 6(float) Load 188(f) + 451: 6(float) Load 212(uf) + 452: 178(bool) FOrdNotEqual 450 451 + 453: 6(float) Load 188(f) + 455: 178(bool) FOrdNotEqual 453 454 + 456: 178(bool) LogicalAnd 452 455 + Branch 449 + 449: Label + 457: 178(bool) Phi 446 403 456 448 + SelectionMerge 459 None + BranchConditional 457 458 459 + 458: Label + 460: 6(float) Load 188(f) + 462: 6(float) FAdd 460 461 + Store 188(f) 462 + Branch 459 + 459: Label + 463: 18(int) Load 22(ui) + 464: 18(int) Load 20(i) + 465: 18(int) BitwiseAnd 464 463 + Store 20(i) 465 + 467: 18(int) Load 20(i) + 468: 18(int) BitwiseOr 467 466 + Store 20(i) 468 + 469: 18(int) Load 22(ui) + 470: 18(int) Load 20(i) + 471: 18(int) BitwiseXor 470 469 + Store 20(i) 471 473: 18(int) Load 20(i) - 474: 18(int) ShiftRightArithmetic 473 396 + 474: 18(int) SMod 473 472 Store 20(i) 474 - 475: 18(int) Load 22(ui) - 476: 18(int) Load 20(i) - 477: 18(int) ShiftLeftLogical 476 475 - Store 20(i) 477 + 475: 18(int) Load 20(i) + 476: 18(int) ShiftRightArithmetic 475 398 + Store 20(i) 476 + 477: 18(int) Load 22(ui) 478: 18(int) Load 20(i) - 479: 18(int) Not 478 + 479: 18(int) ShiftLeftLogical 478 477 Store 20(i) 479 - 480: 178(bool) Load 305(b) - 481: 178(bool) LogicalNot 480 - Store 305(b) 481 - 485: 178(bool) Load 305(b) - SelectionMerge 487 None - BranchConditional 485 486 496 - 486: Label - 488: 18(int) Load 20(i) - 489: 6(float) ConvertSToF 488 - 490: 7(fvec4) CompositeConstruct 489 489 489 489 - 491: 6(float) Load 188(f) + 480: 18(int) Load 20(i) + 481: 18(int) Not 480 + Store 20(i) 481 + 482: 178(bool) Load 305(b) + 483: 178(bool) LogicalNot 482 + Store 305(b) 483 + 487: 178(bool) Load 305(b) + SelectionMerge 489 None + BranchConditional 487 488 498 + 488: Label + 490: 18(int) Load 20(i) + 491: 6(float) ConvertSToF 490 492: 7(fvec4) CompositeConstruct 491 491 491 491 - 493: 7(fvec4) FAdd 490 492 - 494: 7(fvec4) Load 9(v) - 495: 7(fvec4) FAdd 493 494 - Store 484 495 - Branch 487 - 496: Label - 497: 7(fvec4) Load 9(v) - Store 484 497 - Branch 487 - 487: Label - 498: 7(fvec4) Load 484 - Store 483(FragColor) 498 + 493: 6(float) Load 188(f) + 494: 7(fvec4) CompositeConstruct 493 493 493 493 + 495: 7(fvec4) FAdd 492 494 + 496: 7(fvec4) Load 9(v) + 497: 7(fvec4) FAdd 495 496 + Store 486 497 + Branch 489 + 498: Label + 499: 7(fvec4) Load 9(v) + Store 486 499 + Branch 489 + 489: Label + 500: 7(fvec4) Load 486 + Store 485(FragColor) 500 Return FunctionEnd diff --git a/Test/baseResults/spv.accessChain.frag.out b/Test/baseResults/spv.accessChain.frag.out index b434c700f2e1ae86ffa66f621fc0fe709b50173b..e9a9d81bc26452f2f8bbf15f01932e875f6c46fa 100755 --- a/Test/baseResults/spv.accessChain.frag.out +++ b/Test/baseResults/spv.accessChain.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 65 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 65 149 + ExecutionMode 4 OriginUpperLeft Source GLSL 420 Name 4 "main" Name 8 "S" @@ -72,6 +72,7 @@ Linked fragment stage: Name 190 "param" Name 194 "param" Decorate 65(OutColor) Location 0 + Decorate 149(u) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -92,8 +93,8 @@ Linked fragment stage: 141: 6(float) Constant 0 142: 7(fvec3) ConstantComposite 141 141 141 143: TypePointer Function 8(S) - 148: TypePointer UniformConstant 13(int) - 149(u): 148(ptr) Variable UniformConstant + 148: TypePointer Input 13(int) + 149(u): 148(ptr) Variable Input 4(main): 2 Function None 3 5: Label 144(s): 143(ptr) Variable Function diff --git a/Test/baseResults/spv.aggOps.frag.out b/Test/baseResults/spv.aggOps.frag.out index abac38745905195200397981a40e2744c4d72a24..4888bea495091ff68162b21370f1fe158bb2e4c5 100644 --- a/Test/baseResults/spv.aggOps.frag.out +++ b/Test/baseResults/spv.aggOps.frag.out @@ -7,13 +7,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 378 +// Id's are bound by 215 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 16 41 90 374 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 16 41 101 213 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 8 "s1" @@ -23,34 +23,47 @@ Linked fragment stage: Name 16 "u" Name 37 "b" Name 41 "w" - Name 55 "s2" - MemberName 55(s2) 0 "i" - MemberName 55(s2) 1 "f" - MemberName 55(s2) 2 "s1_1" - Name 57 "foo2a" - Name 59 "foo2b" - Name 82 "v" - Name 86 "samp2D" - Name 90 "coord" - Name 341 "s1" - MemberName 341(s1) 0 "i" - MemberName 341(s1) 1 "f" - Name 342 "s2" - MemberName 342(s2) 0 "i" - MemberName 342(s2) 1 "f" - MemberName 342(s2) 2 "s1_1" - Name 343 "bn" - MemberName 343(bn) 0 "foo2a" - Name 345 "bi" - Name 374 "color" - Name 377 "foo1" - MemberDecorate 341(s1) 0 Offset 0 - MemberDecorate 341(s1) 1 Offset 4 - MemberDecorate 342(s2) 0 Offset 0 - MemberDecorate 342(s2) 1 Offset 4 - MemberDecorate 342(s2) 2 Offset 16 - MemberDecorate 343(bn) 0 Offset 0 - Decorate 343(bn) Block + Name 55 "s1" + MemberName 55(s1) 0 "i" + MemberName 55(s1) 1 "f" + Name 56 "s2" + MemberName 56(s2) 0 "i" + MemberName 56(s2) 1 "f" + MemberName 56(s2) 2 "s1_1" + Name 57 "ub1" + MemberName 57(ub1) 0 "foo2a" + Name 59 "uName1" + Name 64 "s1" + MemberName 64(s1) 0 "i" + MemberName 64(s1) 1 "f" + Name 65 "s2" + MemberName 65(s2) 0 "i" + MemberName 65(s2) 1 "f" + MemberName 65(s2) 2 "s1_1" + Name 66 "ub2" + MemberName 66(ub2) 0 "foo2b" + Name 68 "uName2" + Name 93 "v" + Name 97 "samp2D" + Name 101 "coord" + Name 213 "color" + MemberDecorate 55(s1) 0 Offset 0 + MemberDecorate 55(s1) 1 Offset 4 + MemberDecorate 56(s2) 0 Offset 0 + MemberDecorate 56(s2) 1 Offset 4 + MemberDecorate 56(s2) 2 Offset 16 + MemberDecorate 57(ub1) 0 Offset 0 + Decorate 57(ub1) Block + Decorate 59(uName1) DescriptorSet 0 + MemberDecorate 64(s1) 0 Offset 0 + MemberDecorate 64(s1) 1 Offset 4 + MemberDecorate 65(s2) 0 Offset 0 + MemberDecorate 65(s2) 1 Offset 4 + MemberDecorate 65(s2) 2 Offset 8 + MemberDecorate 66(ub2) 0 Offset 0 + Decorate 66(ub2) BufferBlock + Decorate 68(uName2) DescriptorSet 0 + Decorate 97(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -74,44 +87,43 @@ Linked fragment stage: 39: 7(float) Constant 1099431936 40: 8(s1) ConstantComposite 38 39 41(w): 15(ptr) Variable Input - 55(s2): TypeStruct 6(int) 7(float) 8(s1) - 56: TypePointer UniformConstant 55(s2) - 57(foo2a): 56(ptr) Variable UniformConstant - 59(foo2b): 56(ptr) Variable UniformConstant - 61: TypeBool - 81: TypePointer Function 14(fvec4) - 83: TypeImage 7(float) 2D sampled format:Unknown - 84: TypeSampledImage 83 - 85: TypePointer UniformConstant 84 - 86(samp2D): 85(ptr) Variable UniformConstant - 88: TypeVector 7(float) 2 - 89: TypePointer Input 88(fvec2) - 90(coord): 89(ptr) Variable Input - 95: 7(float) Constant 1073741824 - 101: TypeVector 61(bool) 4 - 106: 7(float) Constant 1077936128 - 115: 7(float) Constant 1082130432 - 121: TypeVector 61(bool) 2 - 126: 7(float) Constant 1084227584 - 232: 7(float) Constant 1086324736 - 338: 7(float) Constant 1088421888 - 341(s1): TypeStruct 6(int) 7(float) - 342(s2): TypeStruct 6(int) 7(float) 341(s1) - 343(bn): TypeStruct 342(s2) - 344: TypePointer Uniform 343(bn) - 345(bi): 344(ptr) Variable Uniform - 346: 6(int) Constant 0 - 347: TypePointer Uniform 342(s2) - 370: 7(float) Constant 1090519040 - 373: TypePointer Output 14(fvec4) - 374(color): 373(ptr) Variable Output - 376: TypePointer UniformConstant 8(s1) - 377(foo1): 376(ptr) Variable UniformConstant + 55(s1): TypeStruct 6(int) 7(float) + 56(s2): TypeStruct 6(int) 7(float) 55(s1) + 57(ub1): TypeStruct 56(s2) + 58: TypePointer Uniform 57(ub1) + 59(uName1): 58(ptr) Variable Uniform + 60: 6(int) Constant 0 + 61: TypePointer Uniform 56(s2) + 64(s1): TypeStruct 6(int) 7(float) + 65(s2): TypeStruct 6(int) 7(float) 64(s1) + 66(ub2): TypeStruct 65(s2) + 67: TypePointer Uniform 66(ub2) + 68(uName2): 67(ptr) Variable Uniform + 69: TypePointer Uniform 65(s2) + 72: TypeBool + 92: TypePointer Function 14(fvec4) + 94: TypeImage 7(float) 2D sampled format:Unknown + 95: TypeSampledImage 94 + 96: TypePointer UniformConstant 95 + 97(samp2D): 96(ptr) Variable UniformConstant + 99: TypeVector 7(float) 2 + 100: TypePointer Input 99(fvec2) + 101(coord): 100(ptr) Variable Input + 106: 7(float) Constant 1073741824 + 112: TypeVector 72(bool) 4 + 117: 7(float) Constant 1077936128 + 126: 7(float) Constant 1082130432 + 132: TypeVector 72(bool) 2 + 137: 7(float) Constant 1084227584 + 173: 7(float) Constant 1086324736 + 209: 7(float) Constant 1088421888 + 212: TypePointer Output 14(fvec4) + 213(color): 212(ptr) Variable Output 4(main): 2 Function None 3 5: Label 13(a): 12(ptr) Variable Function 37(b): 12(ptr) Variable Function - 82(v): 81(ptr) Variable Function + 93(v): 92(ptr) Variable Function 19: 18(ptr) AccessChain 16(u) 17 20: 7(float) Load 19 21: 6(int) ConvertFToS 20 @@ -140,325 +152,159 @@ Linked fragment stage: 53: 8(s1) CompositeConstruct 50 52 54: 11 CompositeConstruct 40 47 53 Store 37(b) 54 - 58: 55(s2) Load 57(foo2a) - 60: 55(s2) Load 59(foo2b) - 62: 6(int) CompositeExtract 58 0 - 63: 6(int) CompositeExtract 60 0 - 64: 61(bool) IEqual 62 63 - 65: 7(float) CompositeExtract 58 1 - 66: 7(float) CompositeExtract 60 1 - 67: 61(bool) FOrdEqual 65 66 - 68: 61(bool) LogicalAnd 64 67 - 69: 8(s1) CompositeExtract 58 2 - 70: 8(s1) CompositeExtract 60 2 - 71: 6(int) CompositeExtract 69 0 - 72: 6(int) CompositeExtract 70 0 - 73: 61(bool) IEqual 71 72 - 74: 7(float) CompositeExtract 69 1 - 75: 7(float) CompositeExtract 70 1 - 76: 61(bool) FOrdEqual 74 75 - 77: 61(bool) LogicalAnd 73 76 - 78: 61(bool) LogicalAnd 68 77 - SelectionMerge 80 None - BranchConditional 78 79 93 - 79: Label - 87: 84 Load 86(samp2D) - 91: 88(fvec2) Load 90(coord) - 92: 14(fvec4) ImageSampleImplicitLod 87 91 - Store 82(v) 92 - Branch 80 - 93: Label - 94: 84 Load 86(samp2D) - 96: 88(fvec2) Load 90(coord) - 97: 88(fvec2) VectorTimesScalar 96 95 - 98: 14(fvec4) ImageSampleImplicitLod 94 97 - Store 82(v) 98 - Branch 80 - 80: Label - 99: 14(fvec4) Load 16(u) - 100: 14(fvec4) Load 82(v) - 102: 101(bvec4) FOrdEqual 99 100 - 103: 61(bool) All 102 - SelectionMerge 105 None - BranchConditional 103 104 105 + 62: 61(ptr) AccessChain 59(uName1) 60 + 63: 56(s2) Load 62 + 70: 69(ptr) AccessChain 68(uName2) 60 + 71: 65(s2) Load 70 + 73: 6(int) CompositeExtract 63 0 + 74: 6(int) CompositeExtract 71 0 + 75: 72(bool) IEqual 73 74 + 76: 7(float) CompositeExtract 63 1 + 77: 7(float) CompositeExtract 71 1 + 78: 72(bool) FOrdEqual 76 77 + 79: 72(bool) LogicalAnd 75 78 + 80: 55(s1) CompositeExtract 63 2 + 81: 64(s1) CompositeExtract 71 2 + 82: 6(int) CompositeExtract 80 0 + 83: 6(int) CompositeExtract 81 0 + 84: 72(bool) IEqual 82 83 + 85: 7(float) CompositeExtract 80 1 + 86: 7(float) CompositeExtract 81 1 + 87: 72(bool) FOrdEqual 85 86 + 88: 72(bool) LogicalAnd 84 87 + 89: 72(bool) LogicalAnd 79 88 + SelectionMerge 91 None + BranchConditional 89 90 104 + 90: Label + 98: 95 Load 97(samp2D) + 102: 99(fvec2) Load 101(coord) + 103: 14(fvec4) ImageSampleImplicitLod 98 102 + Store 93(v) 103 + Branch 91 104: Label - 107: 14(fvec4) Load 82(v) - 108: 14(fvec4) VectorTimesScalar 107 106 - Store 82(v) 108 - Branch 105 - 105: Label - 109: 14(fvec4) Load 16(u) - 110: 14(fvec4) Load 82(v) - 111: 101(bvec4) FOrdNotEqual 109 110 - 112: 61(bool) Any 111 - SelectionMerge 114 None - BranchConditional 112 113 114 - 113: Label - 116: 14(fvec4) Load 82(v) - 117: 14(fvec4) VectorTimesScalar 116 115 - Store 82(v) 117 - Branch 114 - 114: Label - 118: 88(fvec2) Load 90(coord) - 119: 14(fvec4) Load 82(v) - 120: 88(fvec2) VectorShuffle 119 119 1 3 - 122: 121(bvec2) FOrdEqual 118 120 - 123: 61(bool) All 122 + 105: 95 Load 97(samp2D) + 107: 99(fvec2) Load 101(coord) + 108: 99(fvec2) VectorTimesScalar 107 106 + 109: 14(fvec4) ImageSampleImplicitLod 105 108 + Store 93(v) 109 + Branch 91 + 91: Label + 110: 14(fvec4) Load 16(u) + 111: 14(fvec4) Load 93(v) + 113: 112(bvec4) FOrdEqual 110 111 + 114: 72(bool) All 113 + SelectionMerge 116 None + BranchConditional 114 115 116 + 115: Label + 118: 14(fvec4) Load 93(v) + 119: 14(fvec4) VectorTimesScalar 118 117 + Store 93(v) 119 + Branch 116 + 116: Label + 120: 14(fvec4) Load 16(u) + 121: 14(fvec4) Load 93(v) + 122: 112(bvec4) FOrdNotEqual 120 121 + 123: 72(bool) Any 122 SelectionMerge 125 None BranchConditional 123 124 125 124: Label - 127: 14(fvec4) Load 82(v) + 127: 14(fvec4) Load 93(v) 128: 14(fvec4) VectorTimesScalar 127 126 - Store 82(v) 128 + Store 93(v) 128 Branch 125 125: Label - 129: 11 Load 13(a) - 130: 11 Load 37(b) - 131: 8(s1) CompositeExtract 129 0 - 132: 8(s1) CompositeExtract 130 0 - 133: 6(int) CompositeExtract 131 0 - 134: 6(int) CompositeExtract 132 0 - 135: 61(bool) IEqual 133 134 - 136: 7(float) CompositeExtract 131 1 - 137: 7(float) CompositeExtract 132 1 - 138: 61(bool) FOrdEqual 136 137 - 139: 61(bool) LogicalAnd 135 138 - 140: 8(s1) CompositeExtract 129 1 - 141: 8(s1) CompositeExtract 130 1 - 142: 6(int) CompositeExtract 140 0 - 143: 6(int) CompositeExtract 141 0 - 144: 61(bool) IEqual 142 143 - 145: 7(float) CompositeExtract 140 1 - 146: 7(float) CompositeExtract 141 1 - 147: 61(bool) FOrdEqual 145 146 - 148: 61(bool) LogicalAnd 144 147 - 149: 61(bool) LogicalAnd 139 148 - 150: 8(s1) CompositeExtract 129 2 - 151: 8(s1) CompositeExtract 130 2 - 152: 6(int) CompositeExtract 150 0 + 129: 99(fvec2) Load 101(coord) + 130: 14(fvec4) Load 93(v) + 131: 99(fvec2) VectorShuffle 130 130 1 3 + 133: 132(bvec2) FOrdEqual 129 131 + 134: 72(bool) All 133 + SelectionMerge 136 None + BranchConditional 134 135 136 + 135: Label + 138: 14(fvec4) Load 93(v) + 139: 14(fvec4) VectorTimesScalar 138 137 + Store 93(v) 139 + Branch 136 + 136: Label + 140: 11 Load 13(a) + 141: 11 Load 37(b) + 142: 8(s1) CompositeExtract 140 0 + 143: 8(s1) CompositeExtract 141 0 + 144: 6(int) CompositeExtract 142 0 + 145: 6(int) CompositeExtract 143 0 + 146: 72(bool) IEqual 144 145 + 147: 7(float) CompositeExtract 142 1 + 148: 7(float) CompositeExtract 143 1 + 149: 72(bool) FOrdEqual 147 148 + 150: 72(bool) LogicalAnd 146 149 + 151: 8(s1) CompositeExtract 140 1 + 152: 8(s1) CompositeExtract 141 1 153: 6(int) CompositeExtract 151 0 - 154: 61(bool) IEqual 152 153 - 155: 7(float) CompositeExtract 150 1 + 154: 6(int) CompositeExtract 152 0 + 155: 72(bool) IEqual 153 154 156: 7(float) CompositeExtract 151 1 - 157: 61(bool) FOrdEqual 155 156 - 158: 61(bool) LogicalAnd 154 157 - 159: 61(bool) LogicalAnd 149 158 - 160: 8(s1) CompositeExtract 129 3 - 161: 8(s1) CompositeExtract 130 3 - 162: 6(int) CompositeExtract 160 0 + 157: 7(float) CompositeExtract 152 1 + 158: 72(bool) FOrdEqual 156 157 + 159: 72(bool) LogicalAnd 155 158 + 160: 72(bool) LogicalAnd 150 159 + 161: 8(s1) CompositeExtract 140 2 + 162: 8(s1) CompositeExtract 141 2 163: 6(int) CompositeExtract 161 0 - 164: 61(bool) IEqual 162 163 - 165: 7(float) CompositeExtract 160 1 + 164: 6(int) CompositeExtract 162 0 + 165: 72(bool) IEqual 163 164 166: 7(float) CompositeExtract 161 1 - 167: 61(bool) FOrdEqual 165 166 - 168: 61(bool) LogicalAnd 164 167 - 169: 61(bool) LogicalAnd 159 168 - 170: 8(s1) CompositeExtract 129 4 - 171: 8(s1) CompositeExtract 130 4 - 172: 6(int) CompositeExtract 170 0 - 173: 6(int) CompositeExtract 171 0 - 174: 61(bool) IEqual 172 173 - 175: 7(float) CompositeExtract 170 1 - 176: 7(float) CompositeExtract 171 1 - 177: 61(bool) FOrdEqual 175 176 - 178: 61(bool) LogicalAnd 174 177 - 179: 61(bool) LogicalAnd 169 178 - 180: 8(s1) CompositeExtract 129 5 - 181: 8(s1) CompositeExtract 130 5 - 182: 6(int) CompositeExtract 180 0 - 183: 6(int) CompositeExtract 181 0 - 184: 61(bool) IEqual 182 183 - 185: 7(float) CompositeExtract 180 1 - 186: 7(float) CompositeExtract 181 1 - 187: 61(bool) FOrdEqual 185 186 - 188: 61(bool) LogicalAnd 184 187 - 189: 61(bool) LogicalAnd 179 188 - 190: 8(s1) CompositeExtract 129 6 - 191: 8(s1) CompositeExtract 130 6 - 192: 6(int) CompositeExtract 190 0 - 193: 6(int) CompositeExtract 191 0 - 194: 61(bool) IEqual 192 193 - 195: 7(float) CompositeExtract 190 1 - 196: 7(float) CompositeExtract 191 1 - 197: 61(bool) FOrdEqual 195 196 - 198: 61(bool) LogicalAnd 194 197 - 199: 61(bool) LogicalAnd 189 198 - 200: 8(s1) CompositeExtract 129 7 - 201: 8(s1) CompositeExtract 130 7 - 202: 6(int) CompositeExtract 200 0 - 203: 6(int) CompositeExtract 201 0 - 204: 61(bool) IEqual 202 203 - 205: 7(float) CompositeExtract 200 1 - 206: 7(float) CompositeExtract 201 1 - 207: 61(bool) FOrdEqual 205 206 - 208: 61(bool) LogicalAnd 204 207 - 209: 61(bool) LogicalAnd 199 208 - 210: 8(s1) CompositeExtract 129 8 - 211: 8(s1) CompositeExtract 130 8 - 212: 6(int) CompositeExtract 210 0 - 213: 6(int) CompositeExtract 211 0 - 214: 61(bool) IEqual 212 213 - 215: 7(float) CompositeExtract 210 1 - 216: 7(float) CompositeExtract 211 1 - 217: 61(bool) FOrdEqual 215 216 - 218: 61(bool) LogicalAnd 214 217 - 219: 61(bool) LogicalAnd 209 218 - 220: 8(s1) CompositeExtract 129 9 - 221: 8(s1) CompositeExtract 130 9 - 222: 6(int) CompositeExtract 220 0 - 223: 6(int) CompositeExtract 221 0 - 224: 61(bool) IEqual 222 223 - 225: 7(float) CompositeExtract 220 1 - 226: 7(float) CompositeExtract 221 1 - 227: 61(bool) FOrdEqual 225 226 - 228: 61(bool) LogicalAnd 224 227 - 229: 61(bool) LogicalAnd 219 228 - SelectionMerge 231 None - BranchConditional 229 230 231 - 230: Label - 233: 14(fvec4) Load 82(v) - 234: 14(fvec4) VectorTimesScalar 233 232 - Store 82(v) 234 - Branch 231 - 231: Label - 235: 11 Load 13(a) - 236: 11 Load 37(b) - 237: 8(s1) CompositeExtract 235 0 - 238: 8(s1) CompositeExtract 236 0 - 239: 6(int) CompositeExtract 237 0 - 240: 6(int) CompositeExtract 238 0 - 241: 61(bool) INotEqual 239 240 - 242: 7(float) CompositeExtract 237 1 - 243: 7(float) CompositeExtract 238 1 - 244: 61(bool) FOrdNotEqual 242 243 - 245: 61(bool) LogicalOr 241 244 - 246: 8(s1) CompositeExtract 235 1 - 247: 8(s1) CompositeExtract 236 1 - 248: 6(int) CompositeExtract 246 0 - 249: 6(int) CompositeExtract 247 0 - 250: 61(bool) INotEqual 248 249 - 251: 7(float) CompositeExtract 246 1 - 252: 7(float) CompositeExtract 247 1 - 253: 61(bool) FOrdNotEqual 251 252 - 254: 61(bool) LogicalOr 250 253 - 255: 61(bool) LogicalOr 245 254 - 256: 8(s1) CompositeExtract 235 2 - 257: 8(s1) CompositeExtract 236 2 - 258: 6(int) CompositeExtract 256 0 - 259: 6(int) CompositeExtract 257 0 - 260: 61(bool) INotEqual 258 259 - 261: 7(float) CompositeExtract 256 1 - 262: 7(float) CompositeExtract 257 1 - 263: 61(bool) FOrdNotEqual 261 262 - 264: 61(bool) LogicalOr 260 263 - 265: 61(bool) LogicalOr 255 264 - 266: 8(s1) CompositeExtract 235 3 - 267: 8(s1) CompositeExtract 236 3 - 268: 6(int) CompositeExtract 266 0 - 269: 6(int) CompositeExtract 267 0 - 270: 61(bool) INotEqual 268 269 - 271: 7(float) CompositeExtract 266 1 - 272: 7(float) CompositeExtract 267 1 - 273: 61(bool) FOrdNotEqual 271 272 - 274: 61(bool) LogicalOr 270 273 - 275: 61(bool) LogicalOr 265 274 - 276: 8(s1) CompositeExtract 235 4 - 277: 8(s1) CompositeExtract 236 4 - 278: 6(int) CompositeExtract 276 0 - 279: 6(int) CompositeExtract 277 0 - 280: 61(bool) INotEqual 278 279 - 281: 7(float) CompositeExtract 276 1 - 282: 7(float) CompositeExtract 277 1 - 283: 61(bool) FOrdNotEqual 281 282 - 284: 61(bool) LogicalOr 280 283 - 285: 61(bool) LogicalOr 275 284 - 286: 8(s1) CompositeExtract 235 5 - 287: 8(s1) CompositeExtract 236 5 - 288: 6(int) CompositeExtract 286 0 - 289: 6(int) CompositeExtract 287 0 - 290: 61(bool) INotEqual 288 289 - 291: 7(float) CompositeExtract 286 1 - 292: 7(float) CompositeExtract 287 1 - 293: 61(bool) FOrdNotEqual 291 292 - 294: 61(bool) LogicalOr 290 293 - 295: 61(bool) LogicalOr 285 294 - 296: 8(s1) CompositeExtract 235 6 - 297: 8(s1) CompositeExtract 236 6 - 298: 6(int) CompositeExtract 296 0 - 299: 6(int) CompositeExtract 297 0 - 300: 61(bool) INotEqual 298 299 - 301: 7(float) CompositeExtract 296 1 - 302: 7(float) CompositeExtract 297 1 - 303: 61(bool) FOrdNotEqual 301 302 - 304: 61(bool) LogicalOr 300 303 - 305: 61(bool) LogicalOr 295 304 - 306: 8(s1) CompositeExtract 235 7 - 307: 8(s1) CompositeExtract 236 7 - 308: 6(int) CompositeExtract 306 0 - 309: 6(int) CompositeExtract 307 0 - 310: 61(bool) INotEqual 308 309 - 311: 7(float) CompositeExtract 306 1 - 312: 7(float) CompositeExtract 307 1 - 313: 61(bool) FOrdNotEqual 311 312 - 314: 61(bool) LogicalOr 310 313 - 315: 61(bool) LogicalOr 305 314 - 316: 8(s1) CompositeExtract 235 8 - 317: 8(s1) CompositeExtract 236 8 - 318: 6(int) CompositeExtract 316 0 - 319: 6(int) CompositeExtract 317 0 - 320: 61(bool) INotEqual 318 319 - 321: 7(float) CompositeExtract 316 1 - 322: 7(float) CompositeExtract 317 1 - 323: 61(bool) FOrdNotEqual 321 322 - 324: 61(bool) LogicalOr 320 323 - 325: 61(bool) LogicalOr 315 324 - 326: 8(s1) CompositeExtract 235 9 - 327: 8(s1) CompositeExtract 236 9 - 328: 6(int) CompositeExtract 326 0 - 329: 6(int) CompositeExtract 327 0 - 330: 61(bool) INotEqual 328 329 - 331: 7(float) CompositeExtract 326 1 - 332: 7(float) CompositeExtract 327 1 - 333: 61(bool) FOrdNotEqual 331 332 - 334: 61(bool) LogicalOr 330 333 - 335: 61(bool) LogicalOr 325 334 - SelectionMerge 337 None - BranchConditional 335 336 337 - 336: Label - 339: 14(fvec4) Load 82(v) - 340: 14(fvec4) VectorTimesScalar 339 338 - Store 82(v) 340 - Branch 337 - 337: Label - 348: 347(ptr) AccessChain 345(bi) 346 - 349: 342(s2) Load 348 - 350: 55(s2) Load 57(foo2a) - 351: 6(int) CompositeExtract 349 0 - 352: 6(int) CompositeExtract 350 0 - 353: 61(bool) INotEqual 351 352 - 354: 7(float) CompositeExtract 349 1 - 355: 7(float) CompositeExtract 350 1 - 356: 61(bool) FOrdNotEqual 354 355 - 357: 61(bool) LogicalOr 353 356 - 358: 341(s1) CompositeExtract 349 2 - 359: 8(s1) CompositeExtract 350 2 - 360: 6(int) CompositeExtract 358 0 - 361: 6(int) CompositeExtract 359 0 - 362: 61(bool) INotEqual 360 361 - 363: 7(float) CompositeExtract 358 1 - 364: 7(float) CompositeExtract 359 1 - 365: 61(bool) FOrdNotEqual 363 364 - 366: 61(bool) LogicalOr 362 365 - 367: 61(bool) LogicalOr 357 366 - SelectionMerge 369 None - BranchConditional 367 368 369 - 368: Label - 371: 14(fvec4) Load 82(v) - 372: 14(fvec4) VectorTimesScalar 371 370 - Store 82(v) 372 - Branch 369 - 369: Label - 375: 14(fvec4) Load 82(v) - Store 374(color) 375 + 167: 7(float) CompositeExtract 162 1 + 168: 72(bool) FOrdEqual 166 167 + 169: 72(bool) LogicalAnd 165 168 + 170: 72(bool) LogicalAnd 160 169 + SelectionMerge 172 None + BranchConditional 170 171 172 + 171: Label + 174: 14(fvec4) Load 93(v) + 175: 14(fvec4) VectorTimesScalar 174 173 + Store 93(v) 175 + Branch 172 + 172: Label + 176: 11 Load 13(a) + 177: 11 Load 37(b) + 178: 8(s1) CompositeExtract 176 0 + 179: 8(s1) CompositeExtract 177 0 + 180: 6(int) CompositeExtract 178 0 + 181: 6(int) CompositeExtract 179 0 + 182: 72(bool) INotEqual 180 181 + 183: 7(float) CompositeExtract 178 1 + 184: 7(float) CompositeExtract 179 1 + 185: 72(bool) FOrdNotEqual 183 184 + 186: 72(bool) LogicalOr 182 185 + 187: 8(s1) CompositeExtract 176 1 + 188: 8(s1) CompositeExtract 177 1 + 189: 6(int) CompositeExtract 187 0 + 190: 6(int) CompositeExtract 188 0 + 191: 72(bool) INotEqual 189 190 + 192: 7(float) CompositeExtract 187 1 + 193: 7(float) CompositeExtract 188 1 + 194: 72(bool) FOrdNotEqual 192 193 + 195: 72(bool) LogicalOr 191 194 + 196: 72(bool) LogicalOr 186 195 + 197: 8(s1) CompositeExtract 176 2 + 198: 8(s1) CompositeExtract 177 2 + 199: 6(int) CompositeExtract 197 0 + 200: 6(int) CompositeExtract 198 0 + 201: 72(bool) INotEqual 199 200 + 202: 7(float) CompositeExtract 197 1 + 203: 7(float) CompositeExtract 198 1 + 204: 72(bool) FOrdNotEqual 202 203 + 205: 72(bool) LogicalOr 201 204 + 206: 72(bool) LogicalOr 196 205 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 210: 14(fvec4) Load 93(v) + 211: 14(fvec4) VectorTimesScalar 210 209 + Store 93(v) 211 + Branch 208 + 208: Label + 214: 14(fvec4) Load 93(v) + Store 213(color) 214 Return FunctionEnd diff --git a/Test/baseResults/spv.always-discard.frag.out b/Test/baseResults/spv.always-discard.frag.out index 8c19b7b3eeff648c2ae6e2e94ce66eda7eba6820..9102b3bb527d3ea6e4a8420316e334c18cd4715d 100644 --- a/Test/baseResults/spv.always-discard.frag.out +++ b/Test/baseResults/spv.always-discard.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 21 59 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "white" diff --git a/Test/baseResults/spv.always-discard2.frag.out b/Test/baseResults/spv.always-discard2.frag.out index 896382e10e3fc006b1ec4e626ac176ae3588104f..7984c8322fd616af41088760567d8ad6f6cc9e07 100755 --- a/Test/baseResults/spv.always-discard2.frag.out +++ b/Test/baseResults/spv.always-discard2.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 21 38 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "white" diff --git a/Test/baseResults/spv.atomic.comp.out b/Test/baseResults/spv.atomic.comp.out index bdf16fe5d9ba92c31010aeb8bf6dc4b929481f5f..bc8d9b81448a48f9301b25800d532ac57f02c460 100755 --- a/Test/baseResults/spv.atomic.comp.out +++ b/Test/baseResults/spv.atomic.comp.out @@ -1,132 +1,205 @@ spv.atomic.comp Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +Shader version: 310 +Requested GL_ARB_gl_spirv +local_size = (1, 1, 1) +0:? Sequence +0:14 Function Definition: func(au1; (global highp uint) +0:14 Function Parameters: +0:14 'c' (in highp atomic_uint) +0:16 Sequence +0:16 Branch: Return with expression +0:16 AtomicCounterIncrement (global highp uint) +0:16 'c' (in highp atomic_uint) +0:19 Function Definition: main( (global void) +0:19 Function Parameters: +0:21 Sequence +0:21 MemoryBarrierAtomicCounter (global void) +0:22 Function Call: func(au1; (global highp uint) +0:22 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:23 Sequence +0:23 move second child to first child (temp highp uint) +0:23 'val' (temp highp uint) +0:23 AtomicCounter (global highp uint) +0:23 direct index (layout(binding=0 offset=4 ) temp highp atomic_uint) +0:23 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:23 Constant: +0:23 2 (const int) +0:24 AtomicCounterDecrement (global highp uint) +0:24 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:36 Function Definition: atoms( (global void) +0:36 Function Parameters: +0:38 Sequence +0:38 Sequence +0:38 move second child to first child (temp highp int) +0:38 'origi' (temp highp int) +0:38 AtomicAdd (global highp int) +0:38 'atomi' (shared highp int) +0:38 Constant: +0:38 3 (const int) +0:39 Sequence +0:39 move second child to first child (temp highp uint) +0:39 'origu' (temp highp uint) +0:39 AtomicAnd (global highp uint) +0:39 'atomu' (shared highp uint) +0:39 'value' (shared highp uint) +0:40 move second child to first child (temp highp uint) +0:40 'origu' (temp highp uint) +0:40 AtomicOr (global highp uint) +0:40 'atomu' (shared highp uint) +0:40 Constant: +0:40 7 (const uint) +0:41 move second child to first child (temp highp uint) +0:41 'origu' (temp highp uint) +0:41 AtomicXor (global highp uint) +0:41 'atomu' (shared highp uint) +0:41 Constant: +0:41 7 (const uint) +0:42 move second child to first child (temp highp uint) +0:42 'origu' (temp highp uint) +0:42 AtomicMin (global highp uint) +0:42 'atomu' (shared highp uint) +0:42 'value' (shared highp uint) +0:43 move second child to first child (temp highp int) +0:43 'origi' (temp highp int) +0:43 AtomicMax (global highp int) +0:43 'atomi' (shared highp int) +0:43 Constant: +0:43 7 (const int) +0:44 move second child to first child (temp highp int) +0:44 'origi' (temp highp int) +0:44 AtomicExchange (global highp int) +0:44 'atomi' (shared highp int) +0:44 'origi' (temp highp int) +0:45 move second child to first child (temp highp uint) +0:45 'origu' (temp highp uint) +0:45 AtomicCompSwap (global highp uint) +0:45 'atomu' (shared highp uint) +0:45 Constant: +0:45 10 (const uint) +0:45 'value' (shared highp uint) +0:46 AtomicAdd (global highp int) +0:46 direct index (temp highp int) +0:46 n_frames_rendered: direct index for structure (layout(column_major std140 offset=16 ) buffer highp 4-component vector of int) +0:46 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:? Linker Objects +0:? 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:? 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:? 'value' (shared highp uint) +0:? 'arrX' (global 1-element array of highp int) +0:? 'arrY' (global 1-element array of highp int) +0:? 'arrZ' (global 1-element array of highp int) +0:? 'atomi' (shared highp int) +0:? 'atomu' (shared highp uint) +0:? 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) + Linked compute stage: -TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class? -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 75 +Shader version: 310 +Requested GL_ARB_gl_spirv +local_size = (1, 1, 1) +0:? Sequence +0:14 Function Definition: func(au1; (global highp uint) +0:14 Function Parameters: +0:14 'c' (in highp atomic_uint) +0:16 Sequence +0:16 Branch: Return with expression +0:16 AtomicCounterIncrement (global highp uint) +0:16 'c' (in highp atomic_uint) +0:19 Function Definition: main( (global void) +0:19 Function Parameters: +0:21 Sequence +0:21 MemoryBarrierAtomicCounter (global void) +0:22 Function Call: func(au1; (global highp uint) +0:22 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:23 Sequence +0:23 move second child to first child (temp highp uint) +0:23 'val' (temp highp uint) +0:23 AtomicCounter (global highp uint) +0:23 direct index (layout(binding=0 offset=4 ) temp highp atomic_uint) +0:23 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:23 Constant: +0:23 2 (const int) +0:24 AtomicCounterDecrement (global highp uint) +0:24 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:36 Function Definition: atoms( (global void) +0:36 Function Parameters: +0:38 Sequence +0:38 Sequence +0:38 move second child to first child (temp highp int) +0:38 'origi' (temp highp int) +0:38 AtomicAdd (global highp int) +0:38 'atomi' (shared highp int) +0:38 Constant: +0:38 3 (const int) +0:39 Sequence +0:39 move second child to first child (temp highp uint) +0:39 'origu' (temp highp uint) +0:39 AtomicAnd (global highp uint) +0:39 'atomu' (shared highp uint) +0:39 'value' (shared highp uint) +0:40 move second child to first child (temp highp uint) +0:40 'origu' (temp highp uint) +0:40 AtomicOr (global highp uint) +0:40 'atomu' (shared highp uint) +0:40 Constant: +0:40 7 (const uint) +0:41 move second child to first child (temp highp uint) +0:41 'origu' (temp highp uint) +0:41 AtomicXor (global highp uint) +0:41 'atomu' (shared highp uint) +0:41 Constant: +0:41 7 (const uint) +0:42 move second child to first child (temp highp uint) +0:42 'origu' (temp highp uint) +0:42 AtomicMin (global highp uint) +0:42 'atomu' (shared highp uint) +0:42 'value' (shared highp uint) +0:43 move second child to first child (temp highp int) +0:43 'origi' (temp highp int) +0:43 AtomicMax (global highp int) +0:43 'atomi' (shared highp int) +0:43 Constant: +0:43 7 (const int) +0:44 move second child to first child (temp highp int) +0:44 'origi' (temp highp int) +0:44 AtomicExchange (global highp int) +0:44 'atomi' (shared highp int) +0:44 'origi' (temp highp int) +0:45 move second child to first child (temp highp uint) +0:45 'origu' (temp highp uint) +0:45 AtomicCompSwap (global highp uint) +0:45 'atomu' (shared highp uint) +0:45 Constant: +0:45 10 (const uint) +0:45 'value' (shared highp uint) +0:46 AtomicAdd (global highp int) +0:46 direct index (temp highp int) +0:46 n_frames_rendered: direct index for structure (layout(column_major std140 offset=16 ) buffer highp 4-component vector of int) +0:46 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) +0:46 Constant: +0:46 1 (const int) +0:46 Constant: +0:46 2 (const int) +0:46 Constant: +0:46 1 (const int) +0:? Linker Objects +0:? 'counter' (layout(binding=0 offset=0 ) uniform highp atomic_uint) +0:? 'countArr' (layout(binding=0 offset=4 ) uniform 4-element array of highp atomic_uint) +0:? 'value' (shared highp uint) +0:? 'arrX' (global 1-element array of highp int) +0:? 'arrY' (global 1-element array of highp int) +0:? 'arrZ' (global 1-element array of highp int) +0:? 'atomi' (shared highp int) +0:? 'atomu' (shared highp uint) +0:? 'result' (layout(binding=0 column_major std140 ) restrict buffer block{layout(column_major std140 offset=0 ) buffer highp float f, layout(column_major std140 offset=16 ) buffer highp 4-component vector of int n_frames_rendered}) - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" - ExecutionMode 4 LocalSize 1 1 1 - Source ESSL 310 - Name 4 "main" - Name 10 "func(au1;" - Name 9 "c" - Name 12 "atoms(" - Name 21 "counter" - Name 22 "param" - Name 25 "val" - Name 29 "countArr" - Name 36 "origi" - Name 38 "atomi" - Name 41 "origu" - Name 43 "atomu" - Name 45 "value" - Name 62 "dataSSB" - MemberName 62(dataSSB) 0 "f" - MemberName 62(dataSSB) 1 "n_frames_rendered" - Name 64 "result" - Name 72 "arrX" - Name 73 "arrY" - Name 74 "arrZ" - Decorate 21(counter) Binding 0 - Decorate 29(countArr) Binding 0 - MemberDecorate 62(dataSSB) 0 Offset 0 - MemberDecorate 62(dataSSB) 1 Offset 16 - Decorate 62(dataSSB) BufferBlock - Decorate 64(result) Binding 0 - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 0 - 7: TypePointer Function 6(int) - 8: TypeFunction 6(int) 7(ptr) - 14: 6(int) Constant 1 - 15: 6(int) Constant 0 - 19: 6(int) Constant 1024 - 20: TypePointer AtomicCounter 6(int) - 21(counter): 20(ptr) Variable AtomicCounter - 26: 6(int) Constant 4 - 27: TypeArray 6(int) 26 - 28: TypePointer AtomicCounter 27 - 29(countArr): 28(ptr) Variable AtomicCounter - 30: TypeInt 32 1 - 31: 30(int) Constant 2 - 35: TypePointer Function 30(int) - 37: TypePointer Workgroup 30(int) - 38(atomi): 37(ptr) Variable Workgroup - 39: 30(int) Constant 3 - 42: TypePointer Workgroup 6(int) - 43(atomu): 42(ptr) Variable Workgroup - 44: TypePointer UniformConstant 6(int) - 45(value): 44(ptr) Variable UniformConstant - 48: 6(int) Constant 7 - 53: 30(int) Constant 7 - 57: 6(int) Constant 10 - 60: TypeFloat 32 - 61: TypeVector 30(int) 4 - 62(dataSSB): TypeStruct 60(float) 61(ivec4) - 63: TypePointer Uniform 62(dataSSB) - 64(result): 63(ptr) Variable Uniform - 65: 30(int) Constant 1 - 66: 6(int) Constant 2 - 67: TypePointer Uniform 30(int) - 70: TypeArray 30(int) 14 - 71: TypePointer Private 70 - 72(arrX): 71(ptr) Variable Private - 73(arrY): 71(ptr) Variable Private - 74(arrZ): 71(ptr) Variable Private - 4(main): 2 Function None 3 - 5: Label - 22(param): 7(ptr) Variable Function - 25(val): 7(ptr) Variable Function - MemoryBarrier 14 19 - 23: 6(int) Load 21(counter) - Store 22(param) 23 - 24: 6(int) FunctionCall 10(func(au1;) 22(param) - 32: 20(ptr) AccessChain 29(countArr) 31 - 33: 6(int) AtomicLoad 32 14 15 - Store 25(val) 33 - 34: 6(int) AtomicIDecrement 21(counter) 14 15 - Return - FunctionEnd - 10(func(au1;): 6(int) Function None 8 - 9(c): 7(ptr) FunctionParameter - 11: Label - 16: 6(int) AtomicIIncrement 9(c) 14 15 - ReturnValue 16 - FunctionEnd - 12(atoms(): 2 Function None 3 - 13: Label - 36(origi): 35(ptr) Variable Function - 41(origu): 7(ptr) Variable Function - 40: 30(int) AtomicIAdd 38(atomi) 14 15 39 - Store 36(origi) 40 - 46: 6(int) Load 45(value) - 47: 6(int) AtomicAnd 43(atomu) 14 15 46 - Store 41(origu) 47 - 49: 6(int) AtomicOr 43(atomu) 14 15 48 - Store 41(origu) 49 - 50: 6(int) AtomicXor 43(atomu) 14 15 48 - Store 41(origu) 50 - 51: 6(int) Load 45(value) - 52: 6(int) AtomicUMin 43(atomu) 14 15 51 - Store 41(origu) 52 - 54: 30(int) AtomicSMax 38(atomi) 14 15 53 - Store 36(origi) 54 - 55: 30(int) Load 36(origi) - 56: 30(int) AtomicExchange 38(atomi) 14 15 55 - Store 36(origi) 56 - 58: 6(int) Load 45(value) - 59: 6(int) AtomicCompareExchange 43(atomu) 14 15 15 58 57 - Store 41(origu) 59 - 68: 67(ptr) AccessChain 64(result) 65 66 - 69: 30(int) AtomicIAdd 68 14 15 65 - Return - FunctionEnd diff --git a/Test/baseResults/spv.bitCast.frag.out b/Test/baseResults/spv.bitCast.frag.out index 53f2d965859bc5123d1f6672aea7188792c99a44..b0dc810494348a682b2f9e841c1c3772135c2267 100644 --- a/Test/baseResults/spv.bitCast.frag.out +++ b/Test/baseResults/spv.bitCast.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 154 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 14 26 37 48 89 98 107 116 122 130 139 148 154 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "idata" @@ -32,6 +32,14 @@ Linked fragment stage: Name 139 "u3" Name 148 "u4" Name 154 "fragColor" + Decorate 89(i1) Flat + Decorate 98(i2) Flat + Decorate 107(i3) Flat + Decorate 116(i4) Flat + Decorate 122(u1) Flat + Decorate 130(u2) Flat + Decorate 139(u3) Flat + Decorate 148(u4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -40,22 +48,22 @@ Linked fragment stage: 10: 6(int) Constant 0 11: 7(ivec4) ConstantComposite 10 10 10 10 12: TypeFloat 32 - 13: TypePointer UniformConstant 12(float) - 14(f1): 13(ptr) Variable UniformConstant + 13: TypePointer Input 12(float) + 14(f1): 13(ptr) Variable Input 17: TypeInt 32 0 18: 17(int) Constant 0 19: TypePointer Function 6(int) 24: TypeVector 12(float) 2 - 25: TypePointer UniformConstant 24(fvec2) - 26(f2): 25(ptr) Variable UniformConstant + 25: TypePointer Input 24(fvec2) + 26(f2): 25(ptr) Variable Input 28: TypeVector 6(int) 2 35: TypeVector 12(float) 3 - 36: TypePointer UniformConstant 35(fvec3) - 37(f3): 36(ptr) Variable UniformConstant + 36: TypePointer Input 35(fvec3) + 37(f3): 36(ptr) Variable Input 39: TypeVector 6(int) 3 46: TypeVector 12(float) 4 - 47: TypePointer UniformConstant 46(fvec4) - 48(f4): 47(ptr) Variable UniformConstant + 47: TypePointer Input 46(fvec4) + 48(f4): 47(ptr) Variable Input 53: TypeVector 17(int) 4 54: TypePointer Function 53(ivec4) 56: 53(ivec4) ConstantComposite 18 18 18 18 @@ -65,23 +73,23 @@ Linked fragment stage: 84: TypePointer Function 46(fvec4) 86: 12(float) Constant 0 87: 46(fvec4) ConstantComposite 86 86 86 86 - 88: TypePointer UniformConstant 6(int) - 89(i1): 88(ptr) Variable UniformConstant + 88: TypePointer Input 6(int) + 89(i1): 88(ptr) Variable Input 92: TypePointer Function 12(float) - 97: TypePointer UniformConstant 28(ivec2) - 98(i2): 97(ptr) Variable UniformConstant - 106: TypePointer UniformConstant 39(ivec3) - 107(i3): 106(ptr) Variable UniformConstant - 115: TypePointer UniformConstant 7(ivec4) - 116(i4): 115(ptr) Variable UniformConstant - 121: TypePointer UniformConstant 17(int) - 122(u1): 121(ptr) Variable UniformConstant - 129: TypePointer UniformConstant 65(ivec2) - 130(u2): 129(ptr) Variable UniformConstant - 138: TypePointer UniformConstant 73(ivec3) - 139(u3): 138(ptr) Variable UniformConstant - 147: TypePointer UniformConstant 53(ivec4) - 148(u4): 147(ptr) Variable UniformConstant + 97: TypePointer Input 28(ivec2) + 98(i2): 97(ptr) Variable Input + 106: TypePointer Input 39(ivec3) + 107(i3): 106(ptr) Variable Input + 115: TypePointer Input 7(ivec4) + 116(i4): 115(ptr) Variable Input + 121: TypePointer Input 17(int) + 122(u1): 121(ptr) Variable Input + 129: TypePointer Input 65(ivec2) + 130(u2): 129(ptr) Variable Input + 138: TypePointer Input 73(ivec3) + 139(u3): 138(ptr) Variable Input + 147: TypePointer Input 53(ivec4) + 148(u4): 147(ptr) Variable Input 153: TypePointer Output 46(fvec4) 154(fragColor): 153(ptr) Variable Output 159: TypeBool diff --git a/Test/baseResults/spv.bool.vert.out b/Test/baseResults/spv.bool.vert.out index 7f85e6b0685139228f1e14056c2f4e6dea11f843..f11fe39805aee1c52cbabb915488f64b58c77f11 100644 --- a/Test/baseResults/spv.bool.vert.out +++ b/Test/baseResults/spv.bool.vert.out @@ -7,14 +7,14 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 50 +// Id's are bound by 49 Capability Shader Capability ClipDistance Capability CullDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 24 48 49 + EntryPoint Vertex 4 "main" 24 Source GLSL 450 Name 4 "main" Name 10 "foo(b1;" @@ -29,17 +29,14 @@ Linked vertex stage: MemberName 29(ubname) 0 "b" Name 31 "ubinst" Name 32 "param" - Name 48 "gl_VertexID" - Name 49 "gl_InstanceID" MemberDecorate 22(gl_PerVertex) 0 BuiltIn Position MemberDecorate 22(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 22(gl_PerVertex) 2 BuiltIn ClipDistance MemberDecorate 22(gl_PerVertex) 3 BuiltIn CullDistance Decorate 22(gl_PerVertex) Block - Decorate 29(ubname) GLSLShared + MemberDecorate 29(ubname) 0 Offset 0 Decorate 29(ubname) Block - Decorate 48(gl_VertexID) BuiltIn VertexId - Decorate 49(gl_InstanceID) BuiltIn InstanceId + Decorate 31(ubinst) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -57,38 +54,37 @@ Linked vertex stage: 25: TypeInt 32 1 26: 25(int) Constant 0 27: TypePointer Function 18(fvec4) - 29(ubname): TypeStruct 6(bool) + 29(ubname): TypeStruct 19(int) 30: TypePointer Uniform 29(ubname) 31(ubinst): 30(ptr) Variable Uniform - 33: TypePointer Uniform 6(bool) - 39: 17(float) Constant 0 - 40: 18(fvec4) ConstantComposite 39 39 39 39 - 42: 17(float) Constant 1065353216 - 43: 18(fvec4) ConstantComposite 42 42 42 42 - 45: TypePointer Output 18(fvec4) - 47: TypePointer Input 25(int) - 48(gl_VertexID): 47(ptr) Variable Input -49(gl_InstanceID): 47(ptr) Variable Input + 33: TypePointer Uniform 19(int) + 36: 19(int) Constant 0 + 41: 17(float) Constant 0 + 42: 18(fvec4) ConstantComposite 41 41 41 41 + 44: 17(float) Constant 1065353216 + 45: 18(fvec4) ConstantComposite 44 44 44 44 + 47: TypePointer Output 18(fvec4) 4(main): 2 Function None 3 5: Label 28: 27(ptr) Variable Function 32(param): 7(ptr) Variable Function 34: 33(ptr) AccessChain 31(ubinst) 26 - 35: 6(bool) Load 34 - Store 32(param) 35 - 36: 6(bool) FunctionCall 10(foo(b1;) 32(param) - SelectionMerge 38 None - BranchConditional 36 37 41 - 37: Label - Store 28 40 - Branch 38 - 41: Label - Store 28 43 - Branch 38 - 38: Label - 44: 18(fvec4) Load 28 - 46: 45(ptr) AccessChain 24 26 - Store 46 44 + 35: 19(int) Load 34 + 37: 6(bool) INotEqual 35 36 + Store 32(param) 37 + 38: 6(bool) FunctionCall 10(foo(b1;) 32(param) + SelectionMerge 40 None + BranchConditional 38 39 43 + 39: Label + Store 28 42 + Branch 40 + 43: Label + Store 28 45 + Branch 40 + 40: Label + 46: 18(fvec4) Load 28 + 48: 47(ptr) AccessChain 24 26 + Store 48 46 Return FunctionEnd 10(foo(b1;): 6(bool) Function None 8 diff --git a/Test/baseResults/spv.branch-return.vert.out b/Test/baseResults/spv.branch-return.vert.out index 19bc3e04ede55232197ef693a3e874eab041e694..217a863fc9f1c12352df874005ccc8a2e9056d8e 100644 --- a/Test/baseResults/spv.branch-return.vert.out +++ b/Test/baseResults/spv.branch-return.vert.out @@ -7,30 +7,28 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 39 +// Id's are bound by 38 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 8 20 38 + EntryPoint Vertex 4 "main" 8 20 Source ESSL 310 Name 4 "main" - Name 8 "gl_InstanceID" + Name 8 "gl_InstanceIndex" Name 18 "gl_PerVertex" MemberName 18(gl_PerVertex) 0 "gl_Position" MemberName 18(gl_PerVertex) 1 "gl_PointSize" Name 20 "" - Name 38 "gl_VertexID" - Decorate 8(gl_InstanceID) BuiltIn InstanceId + Decorate 8(gl_InstanceIndex) BuiltIn InstanceIndex MemberDecorate 18(gl_PerVertex) 0 BuiltIn Position MemberDecorate 18(gl_PerVertex) 1 BuiltIn PointSize Decorate 18(gl_PerVertex) Block - Decorate 38(gl_VertexID) BuiltIn VertexId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Input 6(int) -8(gl_InstanceID): 7(ptr) Variable Input +8(gl_InstanceIndex): 7(ptr) Variable Input 16: TypeFloat 32 17: TypeVector 16(float) 4 18(gl_PerVertex): TypeStruct 17(fvec4) 16(float) @@ -44,10 +42,9 @@ Linked vertex stage: 31: TypeInt 32 0 32: 31(int) Constant 0 33: TypePointer Output 16(float) - 38(gl_VertexID): 7(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 9: 6(int) Load 8(gl_InstanceID) + 9: 6(int) Load 8(gl_InstanceIndex) SelectionMerge 14 None Switch 9 14 case 0: 10 diff --git a/Test/baseResults/spv.conditionalDiscard.frag.out b/Test/baseResults/spv.conditionalDiscard.frag.out index 7336328199e8420720e8e69fd4076a0b67ca1e4c..ef7e3b4cf91523c4d7496eb8ad6f120183f8ce59 100755 --- a/Test/baseResults/spv.conditionalDiscard.frag.out +++ b/Test/baseResults/spv.conditionalDiscard.frag.out @@ -13,13 +13,14 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 17 34 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 9 "v" Name 13 "tex" Name 17 "coord" Name 34 "gl_FragColor" + Decorate 13(tex) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.conversion.frag.out b/Test/baseResults/spv.conversion.frag.out index a88007a1ca49a41b1ed5044fc26c35ca92fd5f9b..bc91569857ccec998c82f9f73c635ba1f873c208 100755 --- a/Test/baseResults/spv.conversion.frag.out +++ b/Test/baseResults/spv.conversion.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 39 53 157 322 446 448 450 452 454 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "b" @@ -62,13 +62,13 @@ Linked fragment stage: 6: TypeBool 7: TypePointer Function 6(bool) 9: TypeInt 32 1 - 10: TypePointer UniformConstant 9(int) - 11(u_i): 10(ptr) Variable UniformConstant + 10: TypePointer Private 9(int) + 11(u_i): 10(ptr) Variable Private 13: TypeInt 32 0 14: 13(int) Constant 0 16: TypeFloat 32 - 17: TypePointer UniformConstant 16(float) - 18(u_f): 17(ptr) Variable UniformConstant + 17: TypePointer Private 16(float) + 18(u_f): 17(ptr) Variable Private 20: 16(float) Constant 0 23: TypeVector 6(bool) 2 24: TypePointer Function 23(bvec2) @@ -86,22 +86,22 @@ Linked fragment stage: 66: TypeVector 9(int) 2 67: TypePointer Function 66(ivec2) 69: TypeVector 16(float) 2 - 70: TypePointer UniformConstant 69(fvec2) - 71(u_f2): 70(ptr) Variable UniformConstant + 70: TypePointer Private 69(fvec2) + 71(u_f2): 70(ptr) Variable Private 75: 66(ivec2) ConstantComposite 62 62 76: 66(ivec2) ConstantComposite 63 63 79: TypeVector 9(int) 3 80: TypePointer Function 79(ivec3) 82: TypeVector 16(float) 3 - 83: TypePointer UniformConstant 82(fvec3) - 84(u_f3): 83(ptr) Variable UniformConstant + 83: TypePointer Private 82(fvec3) + 84(u_f3): 83(ptr) Variable Private 88: 79(ivec3) ConstantComposite 62 62 62 89: 79(ivec3) ConstantComposite 63 63 63 92: TypeVector 9(int) 4 93: TypePointer Function 92(ivec4) 95: TypeVector 16(float) 4 - 96: TypePointer UniformConstant 95(fvec4) - 97(u_f4): 96(ptr) Variable UniformConstant + 96: TypePointer Private 95(fvec4) + 97(u_f4): 96(ptr) Variable Private 101: 92(ivec4) ConstantComposite 62 62 62 62 102: 92(ivec4) ConstantComposite 63 63 63 63 105: TypePointer Function 16(float) @@ -124,24 +124,24 @@ Linked fragment stage: 322(gl_FragColor): 321(ptr) Variable Output 367: 13(int) Constant 2 380: 13(int) Constant 3 - 427: TypePointer UniformConstant 6(bool) - 428(u_b): 427(ptr) Variable UniformConstant - 429: TypePointer UniformConstant 23(bvec2) - 430(u_b2): 429(ptr) Variable UniformConstant - 431: TypePointer UniformConstant 31(bvec3) - 432(u_b3): 431(ptr) Variable UniformConstant - 433: TypePointer UniformConstant 43(bvec4) - 434(u_b4): 433(ptr) Variable UniformConstant - 435: TypePointer UniformConstant 66(ivec2) - 436(u_i2): 435(ptr) Variable UniformConstant - 437: TypePointer UniformConstant 79(ivec3) - 438(u_i3): 437(ptr) Variable UniformConstant - 439: TypePointer UniformConstant 92(ivec4) - 440(u_i4): 439(ptr) Variable UniformConstant - 441(i_b): 427(ptr) Variable UniformConstant - 442(i_b2): 429(ptr) Variable UniformConstant - 443(i_b3): 431(ptr) Variable UniformConstant - 444(i_b4): 433(ptr) Variable UniformConstant + 427: TypePointer Private 6(bool) + 428(u_b): 427(ptr) Variable Private + 429: TypePointer Private 23(bvec2) + 430(u_b2): 429(ptr) Variable Private + 431: TypePointer Private 31(bvec3) + 432(u_b3): 431(ptr) Variable Private + 433: TypePointer Private 43(bvec4) + 434(u_b4): 433(ptr) Variable Private + 435: TypePointer Private 66(ivec2) + 436(u_i2): 435(ptr) Variable Private + 437: TypePointer Private 79(ivec3) + 438(u_i3): 437(ptr) Variable Private + 439: TypePointer Private 92(ivec4) + 440(u_i4): 439(ptr) Variable Private + 441(i_b): 427(ptr) Variable Private + 442(i_b2): 429(ptr) Variable Private + 443(i_b3): 431(ptr) Variable Private + 444(i_b4): 433(ptr) Variable Private 445: TypePointer Input 66(ivec2) 446(i_i2): 445(ptr) Variable Input 447: TypePointer Input 79(ivec3) diff --git a/Test/baseResults/spv.dataOut.frag.out b/Test/baseResults/spv.dataOut.frag.out index 67723d4d1ea2c033b7a23f53f25e4cb140fdc492..651c96e3d157d290106d159fe3bf53f48509dcf1 100755 --- a/Test/baseResults/spv.dataOut.frag.out +++ b/Test/baseResults/spv.dataOut.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 12 16 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 12 "gl_FragData" diff --git a/Test/baseResults/spv.dataOutIndirect.frag.out b/Test/baseResults/spv.dataOutIndirect.frag.out index 1b22e228b233c8a868a1f334008c1fbb0c06a464..d1227a5bba015ee5775245e4b84948da1936aa4c 100755 --- a/Test/baseResults/spv.dataOutIndirect.frag.out +++ b/Test/baseResults/spv.dataOutIndirect.frag.out @@ -5,38 +5,47 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 22 +// Id's are bound by 26 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 18 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 12 22 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" - Name 12 "gl_FragData" - Name 15 "i" - Name 18 "Color" + Name 12 "fcolor" + Name 14 "b" + MemberName 14(b) 0 "i" + Name 16 "bName" + Name 22 "Color" + MemberDecorate 14(b) 0 Offset 0 + Decorate 14(b) Block + Decorate 16(bName) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 7: TypeVector 6(float) 4 8: TypeInt 32 0 - 9: 8(int) Constant 32 + 9: 8(int) Constant 4 10: TypeArray 7(fvec4) 9 11: TypePointer Output 10 - 12(gl_FragData): 11(ptr) Variable Output + 12(fcolor): 11(ptr) Variable Output 13: TypeInt 32 1 - 14: TypePointer UniformConstant 13(int) - 15(i): 14(ptr) Variable UniformConstant - 17: TypePointer Input 7(fvec4) - 18(Color): 17(ptr) Variable Input - 20: TypePointer Output 7(fvec4) + 14(b): TypeStruct 13(int) + 15: TypePointer Uniform 14(b) + 16(bName): 15(ptr) Variable Uniform + 17: 13(int) Constant 0 + 18: TypePointer Uniform 13(int) + 21: TypePointer Input 7(fvec4) + 22(Color): 21(ptr) Variable Input + 24: TypePointer Output 7(fvec4) 4(main): 2 Function None 3 5: Label - 16: 13(int) Load 15(i) - 19: 7(fvec4) Load 18(Color) - 21: 20(ptr) AccessChain 12(gl_FragData) 16 - Store 21 19 + 19: 18(ptr) AccessChain 16(bName) 17 + 20: 13(int) Load 19 + 23: 7(fvec4) Load 22(Color) + 25: 24(ptr) AccessChain 12(fcolor) 20 + Store 25 23 Return FunctionEnd diff --git a/Test/baseResults/spv.dataOutIndirect.vert.out b/Test/baseResults/spv.dataOutIndirect.vert.out index c0182b5f0f5c28ff6333a0a163fb79e6d48cc3af..797c65180b7658ede2aee075389f7424c4cac4bb 100755 --- a/Test/baseResults/spv.dataOutIndirect.vert.out +++ b/Test/baseResults/spv.dataOutIndirect.vert.out @@ -7,23 +7,19 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 41 +// Id's are bound by 38 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 25 28 34 39 40 + EntryPoint Vertex 4 "main" 25 28 34 Source GLSL 140 Name 4 "main" Name 8 "i" Name 25 "colorOut" Name 28 "color" Name 34 "gl_Position" - Name 39 "gl_VertexID" - Name 40 "gl_InstanceID" Decorate 34(gl_Position) BuiltIn Position - Decorate 39(gl_VertexID) BuiltIn VertexId - Decorate 40(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -43,9 +39,6 @@ Linked vertex stage: 30: TypePointer Output 20(fvec4) 34(gl_Position): 30(ptr) Variable Output 35: 6(int) Constant 2 - 38: TypePointer Input 6(int) - 39(gl_VertexID): 38(ptr) Variable Input -40(gl_InstanceID): 38(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.deepRvalue.frag.out b/Test/baseResults/spv.deepRvalue.frag.out index d579ef82f9b2fa3bd74b0de851c67c8ddf6a8e8b..b4894383e5cc1644c4d6cc0969f1faa776a5c6f7 100644 --- a/Test/baseResults/spv.deepRvalue.frag.out +++ b/Test/baseResults/spv.deepRvalue.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 149 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 330 Name 4 "main" Name 9 "v1" @@ -31,6 +31,7 @@ Linked fragment stage: MemberName 134(str) 2 "c" Name 136 "t" Name 149 "gl_FragColor" + Decorate 111(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.depthOut.frag.out b/Test/baseResults/spv.depthOut.frag.out index dff7388b3939abcad7cc8e8daa9761d2866a6e0c..6242391fd3a65629490add2a7ad3ce16506741f4 100755 --- a/Test/baseResults/spv.depthOut.frag.out +++ b/Test/baseResults/spv.depthOut.frag.out @@ -13,7 +13,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 8 10 14 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft ExecutionMode 4 DepthGreater ExecutionMode 4 DepthReplacing Source GLSL 450 diff --git a/Test/baseResults/spv.discard-dce.frag.out b/Test/baseResults/spv.discard-dce.frag.out index dd1d629607b35c8fb5165f47b3b86e3ab6971bfa..7668233ba20e563845b07bf5643ebc7ee99a89ba 100755 --- a/Test/baseResults/spv.discard-dce.frag.out +++ b/Test/baseResults/spv.discard-dce.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 21 59 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "white" diff --git a/Test/baseResults/spv.do-simple.vert.out b/Test/baseResults/spv.do-simple.vert.out index d3f090f840e256f3c10ca4b875771b08a47e3dcb..c0862d1e199a9c784b66fda2b307399a6b6adc83 100755 --- a/Test/baseResults/spv.do-simple.vert.out +++ b/Test/baseResults/spv.do-simple.vert.out @@ -7,19 +7,15 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 24 +// Id's are bound by 21 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 22 23 + EntryPoint Vertex 4 "main" Source ESSL 310 Name 4 "main" Name 8 "i" - Name 22 "gl_VertexID" - Name 23 "gl_InstanceID" - Decorate 22(gl_VertexID) BuiltIn VertexId - Decorate 23(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -28,9 +24,6 @@ Linked vertex stage: 15: 6(int) Constant 1 18: 6(int) Constant 10 19: TypeBool - 21: TypePointer Input 6(int) - 22(gl_VertexID): 21(ptr) Variable Input -23(gl_InstanceID): 21(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out index 98fa18496941e98a9f3b1dea158253800e7d6452..ebfe85d0e6b1d9809d2df30004b78f4f6c7a2453 100644 --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 46 +// Id's are bound by 43 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 44 45 + EntryPoint Vertex 4 "main" Source ESSL 310 Name 4 "main" Name 8 "i" @@ -23,10 +23,6 @@ Linked vertex stage: Name 33 "E" Name 35 "F" Name 41 "G" - Name 44 "gl_VertexID" - Name 45 "gl_InstanceID" - Decorate 44(gl_VertexID) BuiltIn VertexId - Decorate 45(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -41,9 +37,6 @@ Linked vertex stage: 36: 6(int) Constant 99 39: 6(int) Constant 19 42: 6(int) Constant 12 - 43: TypePointer Input 6(int) - 44(gl_VertexID): 43(ptr) Variable Input -45(gl_InstanceID): 43(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.doWhileLoop.frag.out b/Test/baseResults/spv.doWhileLoop.frag.out index 86423ea793c9407e88d3234623dd5224d175c3f3..1d12af108d4dcd4f6b8e415fa451266ee384a19a 100755 --- a/Test/baseResults/spv.doWhileLoop.frag.out +++ b/Test/baseResults/spv.doWhileLoop.frag.out @@ -5,20 +5,20 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 35 +// Id's are bound by 34 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 33 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 17 27 32 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 18 "bigColor" - Name 28 "d" - Name 33 "gl_FragColor" + Name 17 "bigColor" + Name 27 "d" + Name 32 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -26,16 +26,15 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 17: TypePointer UniformConstant 7(fvec4) - 18(bigColor): 17(ptr) Variable UniformConstant - 22: TypeInt 32 0 - 23: 22(int) Constant 0 - 24: TypePointer Function 6(float) - 27: TypePointer UniformConstant 6(float) - 28(d): 27(ptr) Variable UniformConstant - 30: TypeBool - 32: TypePointer Output 7(fvec4) -33(gl_FragColor): 32(ptr) Variable Output + 17(bigColor): 10(ptr) Variable Input + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer Input 6(float) + 27(d): 26(ptr) Variable Input + 29: TypeBool + 31: TypePointer Output 7(fvec4) +32(gl_FragColor): 31(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -46,19 +45,19 @@ Linked fragment stage: LoopMerge 15 16 None Branch 14 14: Label - 19: 7(fvec4) Load 18(bigColor) - 20: 7(fvec4) Load 9(color) - 21: 7(fvec4) FAdd 20 19 - Store 9(color) 21 + 18: 7(fvec4) Load 17(bigColor) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 Branch 16 16: Label - 25: 24(ptr) AccessChain 9(color) 23 - 26: 6(float) Load 25 - 29: 6(float) Load 28(d) - 31: 30(bool) FOrdLessThan 26 29 - BranchConditional 31 13 15 + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d) + 30: 29(bool) FOrdLessThan 25 28 + BranchConditional 30 13 15 15: Label - 34: 7(fvec4) Load 9(color) - Store 33(gl_FragColor) 34 + 33: 7(fvec4) Load 9(color) + Store 32(gl_FragColor) 33 Return FunctionEnd diff --git a/Test/baseResults/spv.double.comp.out b/Test/baseResults/spv.double.comp.out index 52ed78c50b368f439432c68b65c72772c37508c5..fcd2f02b560cb2977f10700350a6545e61ea1537 100755 --- a/Test/baseResults/spv.double.comp.out +++ b/Test/baseResults/spv.double.comp.out @@ -7,7 +7,7 @@ Linked compute stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 62 +// Id's are bound by 60 Capability Shader Capability Float64 @@ -27,12 +27,14 @@ Linked compute stage: Name 33 "gl_LocalInvocationID" Name 49 "aa" Name 54 "globalCoef" - Name 58 "roll" - Name 61 "destTex" - Decorate 8(bufName) GLSLShared + Name 59 "destTex" + MemberDecorate 8(bufName) 0 Offset 0 + MemberDecorate 8(bufName) 1 Offset 8 Decorate 8(bufName) BufferBlock + Decorate 10(bufInst) DescriptorSet 0 Decorate 26(gl_GlobalInvocationID) BuiltIn GlobalInvocationId Decorate 33(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 59(destTex) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -67,11 +69,9 @@ Linked compute stage: 53: 47(fvec4) ConstantComposite 50 51 52 50 55: 7(float) Constant 0 1072693248 56: 7(float) Constant 3229815407 1074340298 - 57: TypePointer UniformConstant 7(float) - 58(roll): 57(ptr) Variable UniformConstant - 59: TypeImage 6(float) 2D nonsampled format:Unknown - 60: TypePointer UniformConstant 59 - 61(destTex): 60(ptr) Variable UniformConstant + 57: TypeImage 6(float) 2D nonsampled format:Unknown + 58: TypePointer UniformConstant 57 + 59(destTex): 58(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 22(storePos): 21(ptr) Variable Function diff --git a/Test/baseResults/spv.earlyReturnDiscard.frag.out b/Test/baseResults/spv.earlyReturnDiscard.frag.out index 76888484a3a372406ab5378732a816e266971604..7e6409e63fa2367f012e4448e0e89a6ce0f08a1f 100755 --- a/Test/baseResults/spv.earlyReturnDiscard.frag.out +++ b/Test/baseResults/spv.earlyReturnDiscard.frag.out @@ -5,29 +5,29 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 112 +// Id's are bound by 110 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 18 107 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 14 17 19 25 30 39 51 63 105 109 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 13 "color2" - Name 15 "otherColor" - Name 18 "c" - Name 21 "d" - Name 27 "bigColor" - Name 32 "smallColor" - Name 41 "minimum" - Name 53 "threshhold" - Name 65 "threshhold2" - Name 79 "b" - Name 107 "gl_FragColor" - Name 111 "threshhold3" + Name 14 "otherColor" + Name 17 "c" + Name 19 "d" + Name 25 "bigColor" + Name 30 "smallColor" + Name 39 "minimum" + Name 51 "threshhold" + Name 63 "threshhold2" + Name 77 "b" + Name 105 "gl_FragColor" + Name 109 "threshhold3" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -35,141 +35,139 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 14: TypePointer UniformConstant 7(fvec4) - 15(otherColor): 14(ptr) Variable UniformConstant - 17: TypePointer Input 6(float) - 18(c): 17(ptr) Variable Input - 20: TypePointer UniformConstant 6(float) - 21(d): 20(ptr) Variable UniformConstant - 23: TypeBool - 27(bigColor): 14(ptr) Variable UniformConstant - 32(smallColor): 14(ptr) Variable UniformConstant - 36: TypeInt 32 0 - 37: 36(int) Constant 2 - 38: TypePointer Function 6(float) - 41(minimum): 20(ptr) Variable UniformConstant - 49: 6(float) Constant 1065353216 - 53(threshhold): 20(ptr) Variable UniformConstant - 62: 36(int) Constant 3 - 65(threshhold2): 20(ptr) Variable UniformConstant - 78: TypePointer UniformConstant 23(bool) - 79(b): 78(ptr) Variable UniformConstant - 87: 36(int) Constant 0 - 106: TypePointer Output 7(fvec4) -107(gl_FragColor): 106(ptr) Variable Output -111(threshhold3): 20(ptr) Variable UniformConstant + 14(otherColor): 10(ptr) Variable Input + 16: TypePointer Input 6(float) + 17(c): 16(ptr) Variable Input + 19(d): 16(ptr) Variable Input + 21: TypeBool + 25(bigColor): 10(ptr) Variable Input + 30(smallColor): 10(ptr) Variable Input + 34: TypeInt 32 0 + 35: 34(int) Constant 2 + 36: TypePointer Function 6(float) + 39(minimum): 16(ptr) Variable Input + 47: 6(float) Constant 1065353216 + 51(threshhold): 16(ptr) Variable Input + 60: 34(int) Constant 3 + 63(threshhold2): 16(ptr) Variable Input + 76: TypePointer Private 21(bool) + 77(b): 76(ptr) Variable Private + 85: 34(int) Constant 0 + 104: TypePointer Output 7(fvec4) +105(gl_FragColor): 104(ptr) Variable Output +109(threshhold3): 16(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 13(color2): 8(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 - 16: 7(fvec4) Load 15(otherColor) - Store 13(color2) 16 - 19: 6(float) Load 18(c) - 22: 6(float) Load 21(d) - 24: 23(bool) FOrdGreaterThan 19 22 - SelectionMerge 26 None - BranchConditional 24 25 31 - 25: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - Branch 26 - 31: Label - 33: 7(fvec4) Load 32(smallColor) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - Branch 26 - 26: Label - 39: 38(ptr) AccessChain 9(color) 37 - 40: 6(float) Load 39 - 42: 6(float) Load 41(minimum) - 43: 23(bool) FOrdLessThan 40 42 - SelectionMerge 45 None - BranchConditional 43 44 45 - 44: Label + 15: 7(fvec4) Load 14(otherColor) + Store 13(color2) 15 + 18: 6(float) Load 17(c) + 20: 6(float) Load 19(d) + 22: 21(bool) FOrdGreaterThan 18 20 + SelectionMerge 24 None + BranchConditional 22 23 29 + 23: Label + 26: 7(fvec4) Load 25(bigColor) + 27: 7(fvec4) Load 9(color) + 28: 7(fvec4) FAdd 27 26 + Store 9(color) 28 + Branch 24 + 29: Label + 31: 7(fvec4) Load 30(smallColor) + 32: 7(fvec4) Load 9(color) + 33: 7(fvec4) FAdd 32 31 + Store 9(color) 33 + Branch 24 + 24: Label + 37: 36(ptr) AccessChain 9(color) 35 + 38: 6(float) Load 37 + 40: 6(float) Load 39(minimum) + 41: 21(bool) FOrdLessThan 38 40 + SelectionMerge 43 None + BranchConditional 41 42 43 + 42: Label Return - 45: Label - 47: 38(ptr) AccessChain 9(color) 37 - 48: 6(float) Load 47 - 50: 6(float) FAdd 48 49 - Store 47 50 - 51: 38(ptr) AccessChain 9(color) 37 - 52: 6(float) Load 51 - 54: 6(float) Load 53(threshhold) - 55: 23(bool) FOrdGreaterThan 52 54 - SelectionMerge 57 None - BranchConditional 55 56 57 - 56: Label + 43: Label + 45: 36(ptr) AccessChain 9(color) 35 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 + 49: 36(ptr) AccessChain 9(color) 35 + 50: 6(float) Load 49 + 52: 6(float) Load 51(threshhold) + 53: 21(bool) FOrdGreaterThan 50 52 + SelectionMerge 55 None + BranchConditional 53 54 55 + 54: Label Kill - 57: Label - 59: 7(fvec4) Load 9(color) - 60: 7(fvec4) CompositeConstruct 49 49 49 49 - 61: 7(fvec4) FAdd 59 60 - Store 9(color) 61 - 63: 38(ptr) AccessChain 9(color) 62 - 64: 6(float) Load 63 - 66: 6(float) Load 65(threshhold2) - 67: 23(bool) FOrdGreaterThan 64 66 - SelectionMerge 69 None - BranchConditional 67 68 99 - 68: Label - 70: 38(ptr) AccessChain 9(color) 37 - 71: 6(float) Load 70 - 72: 6(float) Load 65(threshhold2) - 73: 23(bool) FOrdGreaterThan 71 72 - SelectionMerge 75 None - BranchConditional 73 74 77 - 74: Label + 55: Label + 57: 7(fvec4) Load 9(color) + 58: 7(fvec4) CompositeConstruct 47 47 47 47 + 59: 7(fvec4) FAdd 57 58 + Store 9(color) 59 + 61: 36(ptr) AccessChain 9(color) 60 + 62: 6(float) Load 61 + 64: 6(float) Load 63(threshhold2) + 65: 21(bool) FOrdGreaterThan 62 64 + SelectionMerge 67 None + BranchConditional 65 66 97 + 66: Label + 68: 36(ptr) AccessChain 9(color) 35 + 69: 6(float) Load 68 + 70: 6(float) Load 63(threshhold2) + 71: 21(bool) FOrdGreaterThan 69 70 + SelectionMerge 73 None + BranchConditional 71 72 75 + 72: Label Return - 77: Label - 80: 23(bool) Load 79(b) - SelectionMerge 82 None - BranchConditional 80 81 86 - 81: Label - 83: 38(ptr) AccessChain 9(color) 37 - 84: 6(float) Load 83 - 85: 6(float) FAdd 84 49 - Store 83 85 - Branch 82 - 86: Label - 88: 38(ptr) AccessChain 9(color) 87 - 89: 6(float) Load 88 - 90: 6(float) Load 41(minimum) - 91: 23(bool) FOrdLessThan 89 90 - SelectionMerge 93 None - BranchConditional 91 92 95 - 92: Label + 75: Label + 78: 21(bool) Load 77(b) + SelectionMerge 80 None + BranchConditional 78 79 84 + 79: Label + 81: 36(ptr) AccessChain 9(color) 35 + 82: 6(float) Load 81 + 83: 6(float) FAdd 82 47 + Store 81 83 + Branch 80 + 84: Label + 86: 36(ptr) AccessChain 9(color) 85 + 87: 6(float) Load 86 + 88: 6(float) Load 39(minimum) + 89: 21(bool) FOrdLessThan 87 88 + SelectionMerge 91 None + BranchConditional 89 90 93 + 90: Label Kill - 95: Label - 96: 7(fvec4) Load 9(color) - 97: 7(fvec4) CompositeConstruct 49 49 49 49 - 98: 7(fvec4) FAdd 96 97 - Store 9(color) 98 - Branch 93 - 93: Label - Branch 82 - 82: Label - Branch 75 - 75: Label - Branch 69 - 99: Label - 100: 23(bool) Load 79(b) - SelectionMerge 102 None - BranchConditional 100 101 104 - 101: Label + 93: Label + 94: 7(fvec4) Load 9(color) + 95: 7(fvec4) CompositeConstruct 47 47 47 47 + 96: 7(fvec4) FAdd 94 95 + Store 9(color) 96 + Branch 91 + 91: Label + Branch 80 + 80: Label + Branch 73 + 73: Label + Branch 67 + 97: Label + 98: 21(bool) Load 77(b) + SelectionMerge 100 None + BranchConditional 98 99 102 + 99: Label Kill - 104: Label + 102: Label Return - 102: Label - Branch 69 - 69: Label - 108: 7(fvec4) Load 9(color) - 109: 7(fvec4) Load 13(color2) - 110: 7(fvec4) FMul 108 109 - Store 107(gl_FragColor) 110 + 100: Label + Branch 67 + 67: Label + 106: 7(fvec4) Load 9(color) + 107: 7(fvec4) Load 13(color2) + 108: 7(fvec4) FMul 106 107 + Store 105(gl_FragColor) 108 Return FunctionEnd diff --git a/Test/baseResults/spv.flowControl.frag.out b/Test/baseResults/spv.flowControl.frag.out index 2ca252e7086e978a2050330a6c3e477dcf17cd27..7ca61b7a9c5b39c494287eb9db1d572bac35c97c 100755 --- a/Test/baseResults/spv.flowControl.frag.out +++ b/Test/baseResults/spv.flowControl.frag.out @@ -5,24 +5,24 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 41 +// Id's are bound by 39 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 18 37 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 14 17 19 25 30 35 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 13 "color2" - Name 15 "otherColor" - Name 18 "c" - Name 21 "d" - Name 27 "bigColor" - Name 32 "smallColor" - Name 37 "gl_FragColor" + Name 14 "otherColor" + Name 17 "c" + Name 19 "d" + Name 25 "bigColor" + Name 30 "smallColor" + Name 35 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -30,46 +30,44 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 14: TypePointer UniformConstant 7(fvec4) - 15(otherColor): 14(ptr) Variable UniformConstant - 17: TypePointer Input 6(float) - 18(c): 17(ptr) Variable Input - 20: TypePointer UniformConstant 6(float) - 21(d): 20(ptr) Variable UniformConstant - 23: TypeBool - 27(bigColor): 14(ptr) Variable UniformConstant - 32(smallColor): 14(ptr) Variable UniformConstant - 36: TypePointer Output 7(fvec4) -37(gl_FragColor): 36(ptr) Variable Output + 14(otherColor): 10(ptr) Variable Input + 16: TypePointer Input 6(float) + 17(c): 16(ptr) Variable Input + 19(d): 16(ptr) Variable Input + 21: TypeBool + 25(bigColor): 10(ptr) Variable Input + 30(smallColor): 10(ptr) Variable Input + 34: TypePointer Output 7(fvec4) +35(gl_FragColor): 34(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 13(color2): 8(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 - 16: 7(fvec4) Load 15(otherColor) - Store 13(color2) 16 - 19: 6(float) Load 18(c) - 22: 6(float) Load 21(d) - 24: 23(bool) FOrdGreaterThan 19 22 - SelectionMerge 26 None - BranchConditional 24 25 31 - 25: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - Branch 26 - 31: Label - 33: 7(fvec4) Load 32(smallColor) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - Branch 26 - 26: Label - 38: 7(fvec4) Load 9(color) - 39: 7(fvec4) Load 13(color2) - 40: 7(fvec4) FMul 38 39 - Store 37(gl_FragColor) 40 + 15: 7(fvec4) Load 14(otherColor) + Store 13(color2) 15 + 18: 6(float) Load 17(c) + 20: 6(float) Load 19(d) + 22: 21(bool) FOrdGreaterThan 18 20 + SelectionMerge 24 None + BranchConditional 22 23 29 + 23: Label + 26: 7(fvec4) Load 25(bigColor) + 27: 7(fvec4) Load 9(color) + 28: 7(fvec4) FAdd 27 26 + Store 9(color) 28 + Branch 24 + 29: Label + 31: 7(fvec4) Load 30(smallColor) + 32: 7(fvec4) Load 9(color) + 33: 7(fvec4) FAdd 32 31 + Store 9(color) 33 + Branch 24 + 24: Label + 36: 7(fvec4) Load 9(color) + 37: 7(fvec4) Load 13(color2) + 38: 7(fvec4) FMul 36 37 + Store 35(gl_FragColor) 38 Return FunctionEnd diff --git a/Test/baseResults/spv.for-complex-condition.vert.out b/Test/baseResults/spv.for-complex-condition.vert.out index 3e0e5a730de2e783b35f1f024d85b501f5eedb62..fab7f3d9472e9e26eec24c93b95bf1a7b2e8f1e8 100644 --- a/Test/baseResults/spv.for-complex-condition.vert.out +++ b/Test/baseResults/spv.for-complex-condition.vert.out @@ -7,23 +7,19 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 37 +// Id's are bound by 35 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 18 31 35 36 + EntryPoint Vertex 4 "main" 18 31 Source GLSL 450 Name 4 "main" Name 8 "i" Name 18 "flag" Name 31 "r" - Name 35 "gl_VertexID" - Name 36 "gl_InstanceID" Decorate 18(flag) Location 0 Decorate 31(r) Location 0 - Decorate 35(gl_VertexID) BuiltIn VertexId - Decorate 36(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -37,8 +33,6 @@ Linked vertex stage: 27: 6(int) Constant 15 30: TypePointer Output 6(int) 31(r): 30(ptr) Variable Output - 35(gl_VertexID): 17(ptr) Variable Input -36(gl_InstanceID): 17(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out index f7530b73e0207cb310a167a1c230c2e8e7c759a4..0ea2f143901ff2b182218dafc6ab2f53cbf55fd1 100644 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 48 +// Id's are bound by 45 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 46 47 + EntryPoint Vertex 4 "main" Source ESSL 310 Name 4 "main" Name 8 "i" @@ -23,10 +23,6 @@ Linked vertex stage: Name 38 "E" Name 39 "F" Name 43 "G" - Name 46 "gl_VertexID" - Name 47 "gl_InstanceID" - Decorate 46(gl_VertexID) BuiltIn VertexId - Decorate 47(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -39,9 +35,6 @@ Linked vertex stage: 31: 6(int) Constant 3 40: 6(int) Constant 12 44: 6(int) Constant 99 - 45: TypePointer Input 6(int) - 46(gl_VertexID): 45(ptr) Variable Input -47(gl_InstanceID): 45(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.for-nobody.vert.out b/Test/baseResults/spv.for-nobody.vert.out index 820dd5ec48bcddd999793fda9d2ef54b78234b79..a127b7099c1c19f270a8dda762b32f51e15a0c47 100644 --- a/Test/baseResults/spv.for-nobody.vert.out +++ b/Test/baseResults/spv.for-nobody.vert.out @@ -7,21 +7,17 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 28 +// Id's are bound by 25 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 23 26 27 + EntryPoint Vertex 4 "main" 23 Source GLSL 450 Name 4 "main" Name 8 "i" Name 23 "r" - Name 26 "gl_VertexID" - Name 27 "gl_InstanceID" Decorate 23(r) Location 0 - Decorate 26(gl_VertexID) BuiltIn VertexId - Decorate 27(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -32,9 +28,6 @@ Linked vertex stage: 20: 6(int) Constant 1 22: TypePointer Output 6(int) 23(r): 22(ptr) Variable Output - 25: TypePointer Input 6(int) - 26(gl_VertexID): 25(ptr) Variable Input -27(gl_InstanceID): 25(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.for-notest.vert.out b/Test/baseResults/spv.for-notest.vert.out index b2618c1e3d9acf951e603955533738931420af9c..67706701ea103ca1ae0ce1b0ae666c4af7b549d2 100644 --- a/Test/baseResults/spv.for-notest.vert.out +++ b/Test/baseResults/spv.for-notest.vert.out @@ -7,21 +7,17 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 23 +// Id's are bound by 20 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 15 21 22 + EntryPoint Vertex 4 "main" 15 Source GLSL 450 Name 4 "main" Name 8 "i" Name 15 "r" - Name 21 "gl_VertexID" - Name 22 "gl_InstanceID" Decorate 15(r) Location 0 - Decorate 21(gl_VertexID) BuiltIn VertexId - Decorate 22(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -30,9 +26,6 @@ Linked vertex stage: 14: TypePointer Output 6(int) 15(r): 14(ptr) Variable Output 18: 6(int) Constant 1 - 20: TypePointer Input 6(int) - 21(gl_VertexID): 20(ptr) Variable Input -22(gl_InstanceID): 20(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.for-simple.vert.out b/Test/baseResults/spv.for-simple.vert.out index c8af4c5b51f94b0ca25a89fc0940f4c6ff10c339..52a047ff09954bff1ea7cfd7497e376c8993dbfe 100755 --- a/Test/baseResults/spv.for-simple.vert.out +++ b/Test/baseResults/spv.for-simple.vert.out @@ -7,20 +7,16 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 27 +// Id's are bound by 24 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 25 26 + EntryPoint Vertex 4 "main" Source ESSL 310 Name 4 "main" Name 8 "i" Name 19 "j" - Name 25 "gl_VertexID" - Name 26 "gl_InstanceID" - Decorate 25(gl_VertexID) BuiltIn VertexId - Decorate 26(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -30,9 +26,6 @@ Linked vertex stage: 17: TypeBool 20: 6(int) Constant 12 22: 6(int) Constant 1 - 24: TypePointer Input 6(int) - 25(gl_VertexID): 24(ptr) Variable Input -26(gl_InstanceID): 24(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.forLoop.frag.out b/Test/baseResults/spv.forLoop.frag.out index 1d6c425af45335cb6f9e8af12d8cfe731cc76dcb..e606f9ccb941fa5b4497b3bcd2584c01323bc388 100755 --- a/Test/baseResults/spv.forLoop.frag.out +++ b/Test/baseResults/spv.forLoop.frag.out @@ -5,30 +5,32 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 132 +// Id's are bound by 131 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 37 105 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 24 28 36 53 104 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 15 "i" Name 24 "Count" - Name 29 "bigColor" - Name 37 "gl_FragColor" - Name 40 "sum" - Name 42 "i" - Name 54 "v4" - Name 64 "i" - Name 72 "tv4" - Name 89 "r" - Name 95 "i" - Name 105 "f" - Name 118 "i" + Name 28 "bigColor" + Name 36 "gl_FragColor" + Name 39 "sum" + Name 41 "i" + Name 53 "v4" + Name 63 "i" + Name 71 "tv4" + Name 88 "r" + Name 94 "i" + Name 104 "f" + Name 117 "i" + Decorate 24(Count) Flat + Decorate 53(v4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -39,39 +41,38 @@ Linked fragment stage: 13: TypeInt 32 1 14: TypePointer Function 13(int) 16: 13(int) Constant 0 - 23: TypePointer UniformConstant 13(int) - 24(Count): 23(ptr) Variable UniformConstant + 23: TypePointer Input 13(int) + 24(Count): 23(ptr) Variable Input 26: TypeBool - 28: TypePointer UniformConstant 7(fvec4) - 29(bigColor): 28(ptr) Variable UniformConstant - 34: 13(int) Constant 1 - 36: TypePointer Output 7(fvec4) -37(gl_FragColor): 36(ptr) Variable Output - 39: TypePointer Function 6(float) - 41: 6(float) Constant 0 - 49: 13(int) Constant 4 - 51: TypeInt 32 0 - 52: TypeVector 51(int) 4 - 53: TypePointer UniformConstant 52(ivec4) - 54(v4): 53(ptr) Variable UniformConstant - 56: TypePointer UniformConstant 51(int) - 77: 51(int) Constant 4 - 90: TypeVector 6(float) 3 - 104: TypePointer Input 6(float) - 105(f): 104(ptr) Variable Input - 107: 51(int) Constant 3 - 125: 13(int) Constant 16 + 28(bigColor): 10(ptr) Variable Input + 33: 13(int) Constant 1 + 35: TypePointer Output 7(fvec4) +36(gl_FragColor): 35(ptr) Variable Output + 38: TypePointer Function 6(float) + 40: 6(float) Constant 0 + 48: 13(int) Constant 4 + 50: TypeInt 32 0 + 51: TypeVector 50(int) 4 + 52: TypePointer Input 51(ivec4) + 53(v4): 52(ptr) Variable Input + 55: TypePointer Input 50(int) + 76: 50(int) Constant 4 + 89: TypeVector 6(float) 3 + 103: TypePointer Input 6(float) + 104(f): 103(ptr) Variable Input + 106: 50(int) Constant 3 + 124: 13(int) Constant 16 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 15(i): 14(ptr) Variable Function - 40(sum): 39(ptr) Variable Function - 42(i): 14(ptr) Variable Function - 64(i): 14(ptr) Variable Function - 72(tv4): 8(ptr) Variable Function - 89(r): 8(ptr) Variable Function - 95(i): 14(ptr) Variable Function - 118(i): 14(ptr) Variable Function + 39(sum): 38(ptr) Variable Function + 41(i): 14(ptr) Variable Function + 63(i): 14(ptr) Variable Function + 71(tv4): 8(ptr) Variable Function + 88(r): 8(ptr) Variable Function + 94(i): 14(ptr) Variable Function + 117(i): 14(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 Store 15(i) 16 @@ -85,130 +86,130 @@ Linked fragment stage: 27: 26(bool) SLessThan 22 25 BranchConditional 27 18 19 18: Label - 30: 7(fvec4) Load 29(bigColor) - 31: 7(fvec4) Load 9(color) - 32: 7(fvec4) FAdd 31 30 - Store 9(color) 32 + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 Branch 20 20: Label - 33: 13(int) Load 15(i) - 35: 13(int) IAdd 33 34 - Store 15(i) 35 + 32: 13(int) Load 15(i) + 34: 13(int) IAdd 32 33 + Store 15(i) 34 Branch 17 19: Label - 38: 7(fvec4) Load 9(color) - Store 37(gl_FragColor) 38 - Store 40(sum) 41 - Store 42(i) 16 - Branch 43 - 43: Label - LoopMerge 45 46 None - Branch 47 - 47: Label - 48: 13(int) Load 42(i) - 50: 26(bool) SLessThan 48 49 - BranchConditional 50 44 45 - 44: Label - 55: 13(int) Load 42(i) - 57: 56(ptr) AccessChain 54(v4) 55 - 58: 51(int) Load 57 - 59: 6(float) ConvertUToF 58 - 60: 6(float) Load 40(sum) - 61: 6(float) FAdd 60 59 - Store 40(sum) 61 - Branch 46 - 46: Label - 62: 13(int) Load 42(i) - 63: 13(int) IAdd 62 34 - Store 42(i) 63 - Branch 43 - 45: Label - Store 64(i) 16 - Branch 65 - 65: Label - LoopMerge 67 68 None - Branch 69 - 69: Label - 70: 13(int) Load 64(i) - 71: 26(bool) SLessThan 70 49 - BranchConditional 71 66 67 - 66: Label - 73: 13(int) Load 64(i) - 74: 13(int) Load 64(i) - 75: 56(ptr) AccessChain 54(v4) 74 - 76: 51(int) Load 75 - 78: 51(int) IMul 76 77 - 79: 6(float) ConvertUToF 78 - 80: 39(ptr) AccessChain 72(tv4) 73 - Store 80 79 - Branch 68 - 68: Label - 81: 13(int) Load 64(i) - 82: 13(int) IAdd 81 34 - Store 64(i) 82 - Branch 65 - 67: Label - 83: 6(float) Load 40(sum) - 84: 7(fvec4) CompositeConstruct 83 83 83 83 - 85: 7(fvec4) Load 72(tv4) - 86: 7(fvec4) FAdd 84 85 - 87: 7(fvec4) Load 37(gl_FragColor) - 88: 7(fvec4) FAdd 87 86 - Store 37(gl_FragColor) 88 - 91: 7(fvec4) Load 11(BaseColor) - 92: 90(fvec3) VectorShuffle 91 91 0 1 2 - 93: 7(fvec4) Load 89(r) - 94: 7(fvec4) VectorShuffle 93 92 4 5 6 3 - Store 89(r) 94 - Store 95(i) 16 - Branch 96 - 96: Label - LoopMerge 98 99 None - Branch 100 - 100: Label - 101: 13(int) Load 95(i) - 102: 13(int) Load 24(Count) - 103: 26(bool) SLessThan 101 102 - BranchConditional 103 97 98 - 97: Label - 106: 6(float) Load 105(f) - 108: 39(ptr) AccessChain 89(r) 107 - Store 108 106 - Branch 99 - 99: Label - 109: 13(int) Load 95(i) - 110: 13(int) IAdd 109 34 - Store 95(i) 110 - Branch 96 - 98: Label - 111: 7(fvec4) Load 89(r) - 112: 90(fvec3) VectorShuffle 111 111 0 1 2 - 113: 7(fvec4) Load 37(gl_FragColor) - 114: 90(fvec3) VectorShuffle 113 113 0 1 2 - 115: 90(fvec3) FAdd 114 112 - 116: 7(fvec4) Load 37(gl_FragColor) - 117: 7(fvec4) VectorShuffle 116 115 4 5 6 3 - Store 37(gl_FragColor) 117 - Store 118(i) 16 - Branch 119 - 119: Label - LoopMerge 121 122 None - Branch 123 - 123: Label - 124: 13(int) Load 118(i) - 126: 26(bool) SLessThan 124 125 - BranchConditional 126 120 121 - 120: Label - 127: 6(float) Load 105(f) - 128: 7(fvec4) Load 37(gl_FragColor) - 129: 7(fvec4) VectorTimesScalar 128 127 - Store 37(gl_FragColor) 129 - Branch 122 - 122: Label - 130: 13(int) Load 118(i) - 131: 13(int) IAdd 130 49 - Store 118(i) 131 - Branch 119 - 121: Label + 37: 7(fvec4) Load 9(color) + Store 36(gl_FragColor) 37 + Store 39(sum) 40 + Store 41(i) 16 + Branch 42 + 42: Label + LoopMerge 44 45 None + Branch 46 + 46: Label + 47: 13(int) Load 41(i) + 49: 26(bool) SLessThan 47 48 + BranchConditional 49 43 44 + 43: Label + 54: 13(int) Load 41(i) + 56: 55(ptr) AccessChain 53(v4) 54 + 57: 50(int) Load 56 + 58: 6(float) ConvertUToF 57 + 59: 6(float) Load 39(sum) + 60: 6(float) FAdd 59 58 + Store 39(sum) 60 + Branch 45 + 45: Label + 61: 13(int) Load 41(i) + 62: 13(int) IAdd 61 33 + Store 41(i) 62 + Branch 42 + 44: Label + Store 63(i) 16 + Branch 64 + 64: Label + LoopMerge 66 67 None + Branch 68 + 68: Label + 69: 13(int) Load 63(i) + 70: 26(bool) SLessThan 69 48 + BranchConditional 70 65 66 + 65: Label + 72: 13(int) Load 63(i) + 73: 13(int) Load 63(i) + 74: 55(ptr) AccessChain 53(v4) 73 + 75: 50(int) Load 74 + 77: 50(int) IMul 75 76 + 78: 6(float) ConvertUToF 77 + 79: 38(ptr) AccessChain 71(tv4) 72 + Store 79 78 + Branch 67 + 67: Label + 80: 13(int) Load 63(i) + 81: 13(int) IAdd 80 33 + Store 63(i) 81 + Branch 64 + 66: Label + 82: 6(float) Load 39(sum) + 83: 7(fvec4) CompositeConstruct 82 82 82 82 + 84: 7(fvec4) Load 71(tv4) + 85: 7(fvec4) FAdd 83 84 + 86: 7(fvec4) Load 36(gl_FragColor) + 87: 7(fvec4) FAdd 86 85 + Store 36(gl_FragColor) 87 + 90: 7(fvec4) Load 11(BaseColor) + 91: 89(fvec3) VectorShuffle 90 90 0 1 2 + 92: 7(fvec4) Load 88(r) + 93: 7(fvec4) VectorShuffle 92 91 4 5 6 3 + Store 88(r) 93 + Store 94(i) 16 + Branch 95 + 95: Label + LoopMerge 97 98 None + Branch 99 + 99: Label + 100: 13(int) Load 94(i) + 101: 13(int) Load 24(Count) + 102: 26(bool) SLessThan 100 101 + BranchConditional 102 96 97 + 96: Label + 105: 6(float) Load 104(f) + 107: 38(ptr) AccessChain 88(r) 106 + Store 107 105 + Branch 98 + 98: Label + 108: 13(int) Load 94(i) + 109: 13(int) IAdd 108 33 + Store 94(i) 109 + Branch 95 + 97: Label + 110: 7(fvec4) Load 88(r) + 111: 89(fvec3) VectorShuffle 110 110 0 1 2 + 112: 7(fvec4) Load 36(gl_FragColor) + 113: 89(fvec3) VectorShuffle 112 112 0 1 2 + 114: 89(fvec3) FAdd 113 111 + 115: 7(fvec4) Load 36(gl_FragColor) + 116: 7(fvec4) VectorShuffle 115 114 4 5 6 3 + Store 36(gl_FragColor) 116 + Store 117(i) 16 + Branch 118 + 118: Label + LoopMerge 120 121 None + Branch 122 + 122: Label + 123: 13(int) Load 117(i) + 125: 26(bool) SLessThan 123 124 + BranchConditional 125 119 120 + 119: Label + 126: 6(float) Load 104(f) + 127: 7(fvec4) Load 36(gl_FragColor) + 128: 7(fvec4) VectorTimesScalar 127 126 + Store 36(gl_FragColor) 128 + Branch 121 + 121: Label + 129: 13(int) Load 117(i) + 130: 13(int) IAdd 129 48 + Store 117(i) 130 + Branch 118 + 120: Label Return FunctionEnd diff --git a/Test/baseResults/spv.forwardFun.frag.out b/Test/baseResults/spv.forwardFun.frag.out index 0ce0c2e4f0d37c734c87d934ff2ca18e1cc92913..346523cbce9d68829c76becb57ea441de1d59d52 100755 --- a/Test/baseResults/spv.forwardFun.frag.out +++ b/Test/baseResults/spv.forwardFun.frag.out @@ -5,13 +5,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 61 +// Id's are bound by 60 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 20 30 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 20 30 36 59 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 6 "bar(" @@ -24,7 +24,7 @@ Linked fragment stage: Name 27 "f" Name 30 "gl_FragColor" Name 36 "d" - Name 60 "bigColor" + Name 59 "bigColor" 2: TypeVoid 3: TypeFunction 2 8: TypeFloat 32 @@ -37,8 +37,8 @@ Linked fragment stage: 26: TypePointer Function 8(float) 29: TypePointer Output 12(fvec4) 30(gl_FragColor): 29(ptr) Variable Output - 35: TypePointer UniformConstant 8(float) - 36(d): 35(ptr) Variable UniformConstant + 35: TypePointer Input 8(float) + 36(d): 35(ptr) Variable Input 38: 8(float) Constant 1082549862 39: TypeBool 43: 8(float) Constant 1067030938 @@ -46,8 +46,7 @@ Linked fragment stage: 49: TypeInt 32 0 50: 49(int) Constant 0 53: 49(int) Constant 1 - 59: TypePointer UniformConstant 12(fvec4) - 60(bigColor): 59(ptr) Variable UniformConstant + 59(bigColor): 19(ptr) Variable Input 4(main): 2 Function None 3 5: Label 18(color): 13(ptr) Variable Function diff --git a/Test/baseResults/spv.functionCall.frag.out b/Test/baseResults/spv.functionCall.frag.out index 3e3fbd5284443a0b577c18ef324b64f559bf55c2..db40dd51ae4898f18e1043ebcbd5be180dda1736 100755 --- a/Test/baseResults/spv.functionCall.frag.out +++ b/Test/baseResults/spv.functionCall.frag.out @@ -1,17 +1,21 @@ spv.functionCall.frag +WARNING: 0:3: varying deprecated in version 130; may be removed in future release +WARNING: 0:4: varying deprecated in version 130; may be removed in future release +WARNING: 0:5: varying deprecated in version 130; may be removed in future release + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 77 +// Id's are bound by 76 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 58 69 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 35 58 69 75 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 11 "foo(vf4;" @@ -27,7 +31,7 @@ Linked fragment stage: Name 64 "f" Name 66 "g" Name 69 "gl_FragColor" - Name 76 "bigColor" + Name 75 "bigColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -42,8 +46,8 @@ Linked fragment stage: 24: 23(int) Constant 0 25: TypePointer Function 6(float) 28: 23(int) Constant 1 - 34: TypePointer UniformConstant 6(float) - 35(d): 34(ptr) Variable UniformConstant + 34: TypePointer Input 6(float) + 35(d): 34(ptr) Variable Input 37: 6(float) Constant 1082549862 38: TypeBool 42: 6(float) Constant 1067030938 @@ -53,8 +57,7 @@ Linked fragment stage: 58(BaseColor): 57(ptr) Variable Input 68: TypePointer Output 7(fvec4) 69(gl_FragColor): 68(ptr) Variable Output - 75: TypePointer UniformConstant 7(fvec4) - 76(bigColor): 75(ptr) Variable UniformConstant + 75(bigColor): 57(ptr) Variable Input 4(main): 2 Function None 3 5: Label 56(color): 8(ptr) Variable Function diff --git a/Test/baseResults/spv.functionSemantics.frag.out b/Test/baseResults/spv.functionSemantics.frag.out index 9978539f9bc153927219a0b4040e0ab0e8189ac6..aa2abd847c193853e4d381cd828a7748c88d6b4f 100755 --- a/Test/baseResults/spv.functionSemantics.frag.out +++ b/Test/baseResults/spv.functionSemantics.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 152 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 76 152 + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 15 "foo(i1;i1;i1;i1;i1;i1;" @@ -65,8 +65,8 @@ Linked fragment stage: 66: 17(float) Constant 1084227584 67: TypeInt 32 0 68: 67(int) Constant 1 - 75: TypePointer UniformConstant 17(float) - 76(u): 75(ptr) Variable UniformConstant + 75: TypePointer Input 17(float) + 76(u): 75(ptr) Variable Input 78: 17(float) Constant 1078774989 79: TypeBool 84: 6(int) Constant 1000000 diff --git a/Test/baseResults/spv.image.frag.out b/Test/baseResults/spv.image.frag.out index ca9c588de4b6fab84ccb121d0bdd8bfa2b934c86..9cb1ec4d5d6810fab1fc811b79dbf38114413b4e 100644 --- a/Test/baseResults/spv.image.frag.out +++ b/Test/baseResults/spv.image.frag.out @@ -20,8 +20,8 @@ Linked fragment stage: Capability StorageImageWriteWithoutFormat 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 362 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 132 142 152 248 362 377 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "iv" @@ -47,20 +47,39 @@ Linked fragment stage: Name 357 "wo2D" Name 362 "fragData" Name 377 "ic4D" + Decorate 15(i1D) DescriptorSet 0 Decorate 15(i1D) Binding 0 + Decorate 27(i2D) DescriptorSet 0 Decorate 27(i2D) Binding 1 + Decorate 38(i3D) DescriptorSet 0 Decorate 38(i3D) Binding 2 + Decorate 45(iCube) DescriptorSet 0 Decorate 45(iCube) Binding 3 + Decorate 55(iCubeArray) DescriptorSet 0 Decorate 55(iCubeArray) Binding 4 + Decorate 62(i2DRect) DescriptorSet 0 Decorate 62(i2DRect) Binding 5 + Decorate 72(i1DArray) DescriptorSet 0 Decorate 72(i1DArray) Binding 6 + Decorate 82(i2DArray) DescriptorSet 0 Decorate 82(i2DArray) Binding 7 + Decorate 89(iBuffer) DescriptorSet 0 Decorate 89(iBuffer) Binding 8 + Decorate 98(i2DMS) DescriptorSet 0 Decorate 98(i2DMS) Binding 9 + Decorate 108(i2DMSArray) DescriptorSet 0 Decorate 108(i2DMSArray) Binding 10 + Decorate 132(ic1D) Flat + Decorate 142(ic2D) Flat + Decorate 152(ic3D) Flat + Decorate 232(ii1D) DescriptorSet 0 Decorate 232(ii1D) Binding 11 + Decorate 245(ui2D) DescriptorSet 0 Decorate 245(ui2D) Binding 12 + Decorate 248(value) Flat + Decorate 357(wo2D) DescriptorSet 0 Decorate 357(wo2D) Binding 1 + Decorate 377(ic4D) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -110,12 +129,12 @@ Linked fragment stage: 126: TypePointer Function 125(fvec4) 128: 12(float) Constant 0 129: 125(fvec4) ConstantComposite 128 128 128 128 - 131: TypePointer UniformConstant 6(int) - 132(ic1D): 131(ptr) Variable UniformConstant - 141: TypePointer UniformConstant 29(ivec2) - 142(ic2D): 141(ptr) Variable UniformConstant - 151: TypePointer UniformConstant 7(ivec3) - 152(ic3D): 151(ptr) Variable UniformConstant + 131: TypePointer Input 6(int) + 132(ic1D): 131(ptr) Variable Input + 141: TypePointer Input 29(ivec2) + 142(ic2D): 141(ptr) Variable Input + 151: TypePointer Input 7(ivec3) + 152(ic3D): 151(ptr) Variable Input 210: 6(int) Constant 1 216: 6(int) Constant 2 220: 6(int) Constant 3 @@ -130,8 +149,8 @@ Linked fragment stage: 243: TypeImage 18(int) 2D nonsampled format:R32ui 244: TypePointer UniformConstant 243 245(ui2D): 244(ptr) Variable UniformConstant - 247: TypePointer UniformConstant 18(int) - 248(value): 247(ptr) Variable UniformConstant + 247: TypePointer Input 18(int) + 248(value): 247(ptr) Variable Input 250: TypePointer Image 18(int) 256: 6(int) Constant 11 270: 6(int) Constant 12 @@ -149,8 +168,8 @@ Linked fragment stage: 362(fragData): 361(ptr) Variable Output 368: TypeBool 375: TypeVector 6(int) 4 - 376: TypePointer UniformConstant 375(ivec4) - 377(ic4D): 376(ptr) Variable UniformConstant + 376: TypePointer Input 375(ivec4) + 377(ic4D): 376(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(iv): 8(ptr) Variable Function diff --git a/Test/baseResults/spv.intOps.vert.out b/Test/baseResults/spv.intOps.vert.out index 86a52190d96c82127b027cc22a0735d0f30bc541..bbab470fa8cd2f6616eb4930c2fbb28c953096a3 100644 --- a/Test/baseResults/spv.intOps.vert.out +++ b/Test/baseResults/spv.intOps.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 270 +// Id's are bound by 268 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 15 21 26 47 67 83 100 121 142 146 156 173 182 247 268 269 + EntryPoint Vertex 4 "main" 9 15 21 26 47 67 83 100 121 142 146 156 173 182 247 Source ESSL 310 Name 4 "main" Name 9 "iout" @@ -44,12 +44,8 @@ Linked vertex stage: Name 173 "u3" Name 182 "i3" Name 247 "v4" - Name 268 "gl_VertexID" - Name 269 "gl_InstanceID" Decorate 261 RelaxedPrecision Decorate 265 RelaxedPrecision - Decorate 268(gl_VertexID) BuiltIn VertexId - Decorate 269(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -117,8 +113,6 @@ Linked vertex stage: 182(i3): 181(ptr) Variable Input 246: TypePointer Input 19(fvec4) 247(v4): 246(ptr) Variable Input -268(gl_VertexID): 155(ptr) Variable Input -269(gl_InstanceID): 155(ptr) Variable Input 4(main): 2 Function None 3 5: Label 30(u2out): 29(ptr) Variable Function diff --git a/Test/baseResults/spv.interpOps.frag.out b/Test/baseResults/spv.interpOps.frag.out index c132b4411582460107ceb7ac683675e43767771a..a5076421ba9dc06a7ec66247b227a249ca73ea39 100644 --- a/Test/baseResults/spv.interpOps.frag.out +++ b/Test/baseResults/spv.interpOps.frag.out @@ -7,14 +7,14 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 101 +// Id's are bound by 100 Capability Shader Capability InterpolationFunction 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 13 24 33 41 99 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 13 24 33 41 47 72 98 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "f4" @@ -23,8 +23,10 @@ Linked fragment stage: Name 33 "if3" Name 41 "if4" Name 47 "samp" - Name 73 "offset" - Name 99 "fragColor" + Name 72 "offset" + Name 98 "fragColor" + Decorate 47(samp) Flat + Decorate 72(offset) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -46,12 +48,11 @@ Linked fragment stage: 40: TypePointer Input 7(fvec4) 41(if4): 40(ptr) Variable Input 45: TypeInt 32 1 - 46: TypePointer UniformConstant 45(int) - 47(samp): 46(ptr) Variable UniformConstant - 72: TypePointer UniformConstant 22(fvec2) - 73(offset): 72(ptr) Variable UniformConstant - 98: TypePointer Output 7(fvec4) - 99(fragColor): 98(ptr) Variable Output + 46: TypePointer Input 45(int) + 47(samp): 46(ptr) Variable Input + 72(offset): 23(ptr) Variable Input + 97: TypePointer Output 7(fvec4) + 98(fragColor): 97(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(f4): 8(ptr) Variable Function @@ -108,35 +109,35 @@ Linked fragment stage: 70: 7(fvec4) Load 9(f4) 71: 7(fvec4) FAdd 70 69 Store 9(f4) 71 - 74: 22(fvec2) Load 73(offset) - 75: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 13(if1) 74 - 76: 17(ptr) AccessChain 9(f4) 16 - 77: 6(float) Load 76 - 78: 6(float) FAdd 77 75 - 79: 17(ptr) AccessChain 9(f4) 16 - Store 79 78 - 80: 22(fvec2) Load 73(offset) - 81: 22(fvec2) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 24(if2) 80 - 82: 7(fvec4) Load 9(f4) - 83: 22(fvec2) VectorShuffle 82 82 0 1 - 84: 22(fvec2) FAdd 83 81 - 85: 7(fvec4) Load 9(f4) - 86: 7(fvec4) VectorShuffle 85 84 4 5 2 3 - Store 9(f4) 86 - 87: 22(fvec2) Load 73(offset) - 88: 31(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 33(if3) 87 - 89: 7(fvec4) Load 9(f4) - 90: 31(fvec3) VectorShuffle 89 89 0 1 2 - 91: 31(fvec3) FAdd 90 88 - 92: 7(fvec4) Load 9(f4) - 93: 7(fvec4) VectorShuffle 92 91 4 5 6 3 - Store 9(f4) 93 - 94: 22(fvec2) Load 73(offset) - 95: 7(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 41(if4) 94 - 96: 7(fvec4) Load 9(f4) - 97: 7(fvec4) FAdd 96 95 - Store 9(f4) 97 - 100: 7(fvec4) Load 9(f4) - Store 99(fragColor) 100 + 73: 22(fvec2) Load 72(offset) + 74: 6(float) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 13(if1) 73 + 75: 17(ptr) AccessChain 9(f4) 16 + 76: 6(float) Load 75 + 77: 6(float) FAdd 76 74 + 78: 17(ptr) AccessChain 9(f4) 16 + Store 78 77 + 79: 22(fvec2) Load 72(offset) + 80: 22(fvec2) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 24(if2) 79 + 81: 7(fvec4) Load 9(f4) + 82: 22(fvec2) VectorShuffle 81 81 0 1 + 83: 22(fvec2) FAdd 82 80 + 84: 7(fvec4) Load 9(f4) + 85: 7(fvec4) VectorShuffle 84 83 4 5 2 3 + Store 9(f4) 85 + 86: 22(fvec2) Load 72(offset) + 87: 31(fvec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 33(if3) 86 + 88: 7(fvec4) Load 9(f4) + 89: 31(fvec3) VectorShuffle 88 88 0 1 2 + 90: 31(fvec3) FAdd 89 87 + 91: 7(fvec4) Load 9(f4) + 92: 7(fvec4) VectorShuffle 91 90 4 5 6 3 + Store 9(f4) 92 + 93: 22(fvec2) Load 72(offset) + 94: 7(fvec4) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 41(if4) 93 + 95: 7(fvec4) Load 9(f4) + 96: 7(fvec4) FAdd 95 94 + Store 9(f4) 96 + 99: 7(fvec4) Load 9(f4) + Store 98(fragColor) 99 Return FunctionEnd diff --git a/Test/baseResults/spv.layoutNested.vert.out b/Test/baseResults/spv.layoutNested.vert.out index 399e283b66589a050037210bc17b54a99ee9de03..4f3d67c146c89edd737cf05fb942502c3d61dafa 100644 --- a/Test/baseResults/spv.layoutNested.vert.out +++ b/Test/baseResults/spv.layoutNested.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 70 +// Id's are bound by 67 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 63 66 68 69 + EntryPoint Vertex 4 "main" 63 66 Source GLSL 450 Name 4 "main" Name 14 "S" @@ -92,8 +92,6 @@ Linked vertex stage: MemberName 64(S) 1 "b" MemberName 64(S) 2 "c" Name 66 "soutinv" - Name 68 "gl_VertexID" - Name 69 "gl_InstanceID" Decorate 13 ArrayStride 32 MemberDecorate 14(S) 0 Offset 0 MemberDecorate 14(S) 1 ColMajor @@ -175,8 +173,6 @@ Linked vertex stage: MemberDecorate 64(S) 1 Invariant MemberDecorate 64(S) 2 Invariant Decorate 66(soutinv) Invariant - Decorate 68(gl_VertexID) BuiltIn VertexId - Decorate 69(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -240,9 +236,6 @@ Linked vertex stage: 64(S): TypeStruct 8(ivec3) 13 7(int) 65: TypePointer Output 64(S) 66(soutinv): 65(ptr) Variable Output - 67: TypePointer Input 6(int) - 68(gl_VertexID): 67(ptr) Variable Input -69(gl_InstanceID): 67(ptr) Variable Input 4(main): 2 Function None 3 5: Label Return diff --git a/Test/baseResults/spv.length.frag.out b/Test/baseResults/spv.length.frag.out index c7e8ad8fd05deccd879ee415a88ce9dd053dd438..81f98a61c2ba1aafbfdc92d74a902eb6b60f1c84 100755 --- a/Test/baseResults/spv.length.frag.out +++ b/Test/baseResults/spv.length.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 14 26 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "t" @@ -39,8 +39,8 @@ Linked fragment stage: 28: 24(fvec4) ConstantComposite 27 27 27 27 29: 10(int) Constant 3 30: TypeArray 24(fvec4) 29 - 31: TypePointer UniformConstant 30 - 32(u): 31(ptr) Variable UniformConstant + 31: TypePointer Private 30 + 32(u): 31(ptr) Variable Private 4(main): 2 Function None 3 5: Label 9(t): 8(ptr) Variable Function diff --git a/Test/baseResults/spv.localAggregates.frag.out b/Test/baseResults/spv.localAggregates.frag.out index db540dc185f87c280dc876ff047850cc8401ceb0..14f56092434f3da0726f210056cde2c409c34368 100755 --- a/Test/baseResults/spv.localAggregates.frag.out +++ b/Test/baseResults/spv.localAggregates.frag.out @@ -1,18 +1,20 @@ spv.localAggregates.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 138 +// Id's are bound by 143 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 40 98 108 - ExecutionMode 4 OriginLowerLeft - Source GLSL 140 + EntryPoint Fragment 4 "main" 18 43 93 101 111 138 142 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 Name 4 "main" Name 8 "s1" MemberName 8(s1) 0 "i" @@ -23,26 +25,69 @@ Linked fragment stage: MemberName 10(s2) 2 "s1_1" MemberName 10(s2) 3 "bleh" Name 12 "locals2" - Name 13 "s3" - MemberName 13(s3) 0 "s2_1" - MemberName 13(s3) 1 "i" - MemberName 13(s3) 2 "f" - MemberName 13(s3) 3 "s1_1" - Name 15 "foo3" - Name 36 "localFArray" - Name 40 "coord" - Name 49 "localIArray" - Name 68 "x" - Name 70 "localArray" - Name 75 "i" - Name 84 "a" - Name 90 "condition" - Name 98 "color" - Name 108 "gl_FragColor" - Name 128 "samp2D" - Name 134 "foo" - Name 135 "foo2" - Name 137 "uFloatArray" + Name 13 "s1" + MemberName 13(s1) 0 "i" + MemberName 13(s1) 1 "f" + Name 14 "s2" + MemberName 14(s2) 0 "i" + MemberName 14(s2) 1 "f" + MemberName 14(s2) 2 "s1_1" + MemberName 14(s2) 3 "bleh" + Name 15 "s1" + MemberName 15(s1) 0 "i" + MemberName 15(s1) 1 "f" + Name 16 "s3" + MemberName 16(s3) 0 "s2_1" + MemberName 16(s3) 1 "i" + MemberName 16(s3) 2 "f" + MemberName 16(s3) 3 "s1_1" + Name 18 "foo3" + Name 39 "localFArray" + Name 43 "coord" + Name 52 "localIArray" + Name 71 "x" + Name 73 "localArray" + Name 78 "i" + Name 87 "a" + Name 93 "condition" + Name 101 "color" + Name 111 "gl_FragColor" + Name 131 "samp2D" + Name 136 "s1" + MemberName 136(s1) 0 "i" + MemberName 136(s1) 1 "f" + Name 138 "foo" + Name 139 "s1" + MemberName 139(s1) 0 "i" + MemberName 139(s1) 1 "f" + Name 140 "s2" + MemberName 140(s2) 0 "i" + MemberName 140(s2) 1 "f" + MemberName 140(s2) 2 "s1_1" + MemberName 140(s2) 3 "bleh" + Name 142 "foo2" + MemberDecorate 13(s1) 0 Flat + MemberDecorate 13(s1) 1 Flat + MemberDecorate 14(s2) 0 Flat + MemberDecorate 14(s2) 1 Flat + MemberDecorate 14(s2) 2 Flat + MemberDecorate 14(s2) 3 Flat + MemberDecorate 15(s1) 0 Flat + MemberDecorate 15(s1) 1 Flat + MemberDecorate 16(s3) 0 Flat + MemberDecorate 16(s3) 1 Flat + MemberDecorate 16(s3) 2 Flat + MemberDecorate 16(s3) 3 Flat + Decorate 93(condition) Flat + Decorate 131(samp2D) DescriptorSet 0 + MemberDecorate 136(s1) 0 Flat + MemberDecorate 136(s1) 1 Flat + MemberDecorate 139(s1) 0 Flat + MemberDecorate 139(s1) 1 Flat + MemberDecorate 140(s2) 0 Flat + MemberDecorate 140(s2) 1 Flat + MemberDecorate 140(s2) 2 Flat + MemberDecorate 140(s2) 3 Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -51,166 +96,171 @@ Linked fragment stage: 9: TypeVector 7(float) 4 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) 11: TypePointer Function 10(s2) - 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1) - 14: TypePointer UniformConstant 13(s3) - 15(foo3): 14(ptr) Variable UniformConstant - 16: 6(int) Constant 0 - 17: TypePointer UniformConstant 10(s2) - 20: TypePointer UniformConstant 6(int) - 23: TypeBool - 27: 6(int) Constant 2 - 28: 6(int) Constant 1 - 29: 7(float) Constant 1065353216 - 30: TypePointer Function 7(float) - 32: TypeInt 32 0 - 33: 32(int) Constant 16 - 34: TypeArray 7(float) 33 - 35: TypePointer Function 34 - 37: 6(int) Constant 4 - 38: TypeVector 7(float) 2 - 39: TypePointer Input 38(fvec2) - 40(coord): 39(ptr) Variable Input - 41: 32(int) Constant 0 - 42: TypePointer Input 7(float) - 46: 32(int) Constant 8 - 47: TypeArray 6(int) 46 - 48: TypePointer Function 47 - 52: TypePointer Function 6(int) - 69: 6(int) Constant 5 - 82: 6(int) Constant 16 - 86: 7(float) Constant 0 - 90(condition): 20(ptr) Variable UniformConstant - 96: 6(int) Constant 3 - 97: TypePointer Input 9(fvec4) - 98(color): 97(ptr) Variable Input - 100: TypePointer Function 9(fvec4) - 102: 32(int) Constant 1 - 105: 32(int) Constant 2 - 107: TypePointer Output 9(fvec4) -108(gl_FragColor): 107(ptr) Variable Output - 125: TypeImage 7(float) 2D sampled format:Unknown - 126: TypeSampledImage 125 - 127: TypePointer UniformConstant 126 - 128(samp2D): 127(ptr) Variable UniformConstant - 133: TypePointer UniformConstant 8(s1) - 134(foo): 133(ptr) Variable UniformConstant - 135(foo2): 17(ptr) Variable UniformConstant - 136: TypePointer UniformConstant 34 -137(uFloatArray): 136(ptr) Variable UniformConstant + 13(s1): TypeStruct 6(int) 7(float) + 14(s2): TypeStruct 6(int) 7(float) 13(s1) 9(fvec4) + 15(s1): TypeStruct 6(int) 7(float) + 16(s3): TypeStruct 14(s2) 6(int) 7(float) 15(s1) + 17: TypePointer Input 16(s3) + 18(foo3): 17(ptr) Variable Input + 19: 6(int) Constant 0 + 20: TypePointer Input 14(s2) + 23: TypePointer Input 6(int) + 26: TypeBool + 30: 6(int) Constant 2 + 31: 6(int) Constant 1 + 32: 7(float) Constant 1065353216 + 33: TypePointer Function 7(float) + 35: TypeInt 32 0 + 36: 35(int) Constant 16 + 37: TypeArray 7(float) 36 + 38: TypePointer Function 37 + 40: 6(int) Constant 4 + 41: TypeVector 7(float) 2 + 42: TypePointer Input 41(fvec2) + 43(coord): 42(ptr) Variable Input + 44: 35(int) Constant 0 + 45: TypePointer Input 7(float) + 49: 35(int) Constant 8 + 50: TypeArray 6(int) 49 + 51: TypePointer Function 50 + 55: TypePointer Function 6(int) + 72: 6(int) Constant 5 + 85: 6(int) Constant 16 + 89: 7(float) Constant 0 + 93(condition): 23(ptr) Variable Input + 99: 6(int) Constant 3 + 100: TypePointer Input 9(fvec4) + 101(color): 100(ptr) Variable Input + 103: TypePointer Function 9(fvec4) + 105: 35(int) Constant 1 + 108: 35(int) Constant 2 + 110: TypePointer Output 9(fvec4) +111(gl_FragColor): 110(ptr) Variable Output + 128: TypeImage 7(float) 2D sampled format:Unknown + 129: TypeSampledImage 128 + 130: TypePointer UniformConstant 129 + 131(samp2D): 130(ptr) Variable UniformConstant + 136(s1): TypeStruct 6(int) 7(float) + 137: TypePointer Input 136(s1) + 138(foo): 137(ptr) Variable Input + 139(s1): TypeStruct 6(int) 7(float) + 140(s2): TypeStruct 6(int) 7(float) 139(s1) 9(fvec4) + 141: TypePointer Input 140(s2) + 142(foo2): 141(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12(locals2): 11(ptr) Variable Function - 36(localFArray): 35(ptr) Variable Function - 49(localIArray): 48(ptr) Variable Function - 68(x): 52(ptr) Variable Function - 70(localArray): 35(ptr) Variable Function - 75(i): 52(ptr) Variable Function - 84(a): 35(ptr) Variable Function - 18: 17(ptr) AccessChain 15(foo3) 16 - 19: 10(s2) Load 18 - Store 12(locals2) 19 - 21: 20(ptr) AccessChain 15(foo3) 16 16 - 22: 6(int) Load 21 - 24: 23(bool) SGreaterThan 22 16 - SelectionMerge 26 None - BranchConditional 24 25 54 - 25: Label - 31: 30(ptr) AccessChain 12(locals2) 27 28 - Store 31 29 - 43: 42(ptr) AccessChain 40(coord) 41 - 44: 7(float) Load 43 - 45: 30(ptr) AccessChain 36(localFArray) 37 - Store 45 44 - 50: 20(ptr) AccessChain 15(foo3) 16 16 - 51: 6(int) Load 50 - 53: 52(ptr) AccessChain 49(localIArray) 27 - Store 53 51 - Branch 26 - 54: Label - 55: 42(ptr) AccessChain 40(coord) 41 - 56: 7(float) Load 55 - 57: 30(ptr) AccessChain 12(locals2) 27 28 - Store 57 56 - 58: 30(ptr) AccessChain 36(localFArray) 37 - Store 58 29 - 59: 52(ptr) AccessChain 49(localIArray) 27 - Store 59 16 - Branch 26 - 26: Label - 60: 52(ptr) AccessChain 49(localIArray) 27 - 61: 6(int) Load 60 - 62: 23(bool) IEqual 61 16 - SelectionMerge 64 None - BranchConditional 62 63 64 - 63: Label - 65: 30(ptr) AccessChain 36(localFArray) 37 - 66: 7(float) Load 65 - 67: 7(float) FAdd 66 29 - Store 65 67 - Branch 64 - 64: Label - Store 68(x) 69 - 71: 6(int) Load 68(x) - 72: 42(ptr) AccessChain 40(coord) 41 - 73: 7(float) Load 72 - 74: 30(ptr) AccessChain 70(localArray) 71 - Store 74 73 - Store 75(i) 16 - Branch 76 - 76: Label - LoopMerge 78 79 None - Branch 80 - 80: Label - 81: 6(int) Load 75(i) - 83: 23(bool) SLessThan 81 82 - BranchConditional 83 77 78 - 77: Label - 85: 6(int) Load 75(i) - 87: 30(ptr) AccessChain 84(a) 85 - Store 87 86 + 39(localFArray): 38(ptr) Variable Function + 52(localIArray): 51(ptr) Variable Function + 71(x): 55(ptr) Variable Function + 73(localArray): 38(ptr) Variable Function + 78(i): 55(ptr) Variable Function + 87(a): 38(ptr) Variable Function + 21: 20(ptr) AccessChain 18(foo3) 19 + 22: 14(s2) Load 21 + Store 12(locals2) 22 + 24: 23(ptr) AccessChain 18(foo3) 19 19 + 25: 6(int) Load 24 + 27: 26(bool) SGreaterThan 25 19 + SelectionMerge 29 None + BranchConditional 27 28 57 + 28: Label + 34: 33(ptr) AccessChain 12(locals2) 30 31 + Store 34 32 + 46: 45(ptr) AccessChain 43(coord) 44 + 47: 7(float) Load 46 + 48: 33(ptr) AccessChain 39(localFArray) 40 + Store 48 47 + 53: 23(ptr) AccessChain 18(foo3) 19 19 + 54: 6(int) Load 53 + 56: 55(ptr) AccessChain 52(localIArray) 30 + Store 56 54 + Branch 29 + 57: Label + 58: 45(ptr) AccessChain 43(coord) 44 + 59: 7(float) Load 58 + 60: 33(ptr) AccessChain 12(locals2) 30 31 + Store 60 59 + 61: 33(ptr) AccessChain 39(localFArray) 40 + Store 61 32 + 62: 55(ptr) AccessChain 52(localIArray) 30 + Store 62 19 + Branch 29 + 29: Label + 63: 55(ptr) AccessChain 52(localIArray) 30 + 64: 6(int) Load 63 + 65: 26(bool) IEqual 64 19 + SelectionMerge 67 None + BranchConditional 65 66 67 + 66: Label + 68: 33(ptr) AccessChain 39(localFArray) 40 + 69: 7(float) Load 68 + 70: 7(float) FAdd 69 32 + Store 68 70 + Branch 67 + 67: Label + Store 71(x) 72 + 74: 6(int) Load 71(x) + 75: 45(ptr) AccessChain 43(coord) 44 + 76: 7(float) Load 75 + 77: 33(ptr) AccessChain 73(localArray) 74 + Store 77 76 + Store 78(i) 19 + Branch 79 + 79: Label + LoopMerge 81 82 None + Branch 83 + 83: Label + 84: 6(int) Load 78(i) + 86: 26(bool) SLessThan 84 85 + BranchConditional 86 80 81 + 80: Label + 88: 6(int) Load 78(i) + 90: 33(ptr) AccessChain 87(a) 88 + Store 90 89 + Branch 82 + 82: Label + 91: 6(int) Load 78(i) + 92: 6(int) IAdd 91 31 + Store 78(i) 92 Branch 79 - 79: Label - 88: 6(int) Load 75(i) - 89: 6(int) IAdd 88 28 - Store 75(i) 89 - Branch 76 - 78: Label - 91: 6(int) Load 90(condition) - 92: 23(bool) IEqual 91 28 - SelectionMerge 94 None - BranchConditional 92 93 94 - 93: Label - 95: 34 Load 70(localArray) - Store 84(a) 95 - Branch 94 - 94: Label - 99: 9(fvec4) Load 98(color) - 101: 100(ptr) AccessChain 12(locals2) 96 - Store 101 99 - 103: 42(ptr) AccessChain 40(coord) 102 - 104: 7(float) Load 103 - 106: 30(ptr) AccessChain 12(locals2) 96 105 - Store 106 104 - 109: 100(ptr) AccessChain 12(locals2) 96 - 110: 9(fvec4) Load 109 - 111: 30(ptr) AccessChain 36(localFArray) 37 - 112: 7(float) Load 111 - 113: 30(ptr) AccessChain 12(locals2) 27 28 - 114: 7(float) Load 113 - 115: 7(float) FAdd 112 114 - 116: 6(int) Load 68(x) - 117: 30(ptr) AccessChain 70(localArray) 116 - 118: 7(float) Load 117 - 119: 7(float) FAdd 115 118 - 120: 6(int) Load 68(x) - 121: 30(ptr) AccessChain 84(a) 120 - 122: 7(float) Load 121 - 123: 7(float) FAdd 119 122 - 124: 9(fvec4) VectorTimesScalar 110 123 - 129: 126 Load 128(samp2D) - 130: 38(fvec2) Load 40(coord) - 131: 9(fvec4) ImageSampleImplicitLod 129 130 - 132: 9(fvec4) FMul 124 131 - Store 108(gl_FragColor) 132 + 81: Label + 94: 6(int) Load 93(condition) + 95: 26(bool) IEqual 94 31 + SelectionMerge 97 None + BranchConditional 95 96 97 + 96: Label + 98: 37 Load 73(localArray) + Store 87(a) 98 + Branch 97 + 97: Label + 102: 9(fvec4) Load 101(color) + 104: 103(ptr) AccessChain 12(locals2) 99 + Store 104 102 + 106: 45(ptr) AccessChain 43(coord) 105 + 107: 7(float) Load 106 + 109: 33(ptr) AccessChain 12(locals2) 99 108 + Store 109 107 + 112: 103(ptr) AccessChain 12(locals2) 99 + 113: 9(fvec4) Load 112 + 114: 33(ptr) AccessChain 39(localFArray) 40 + 115: 7(float) Load 114 + 116: 33(ptr) AccessChain 12(locals2) 30 31 + 117: 7(float) Load 116 + 118: 7(float) FAdd 115 117 + 119: 6(int) Load 71(x) + 120: 33(ptr) AccessChain 73(localArray) 119 + 121: 7(float) Load 120 + 122: 7(float) FAdd 118 121 + 123: 6(int) Load 71(x) + 124: 33(ptr) AccessChain 87(a) 123 + 125: 7(float) Load 124 + 126: 7(float) FAdd 122 125 + 127: 9(fvec4) VectorTimesScalar 113 126 + 132: 129 Load 131(samp2D) + 133: 41(fvec2) Load 43(coord) + 134: 9(fvec4) ImageSampleImplicitLod 132 133 + 135: 9(fvec4) FMul 127 134 + Store 111(gl_FragColor) 135 Return FunctionEnd diff --git a/Test/baseResults/spv.loops.frag.out b/Test/baseResults/spv.loops.frag.out index 994dd96d0b57965633a2046f04c61c012baacbc5..952f7941790f9c5ca0a9a5a2bf3580c5839f9a98 100755 --- a/Test/baseResults/spv.loops.frag.out +++ b/Test/baseResults/spv.loops.frag.out @@ -5,70 +5,54 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 743 +// Id's are bound by 725 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 616 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 54 57 71 106 114 118 131 137 157 160 171 308 344 350 366 380 418 450 469 512 544 552 562 588 615 624 629 649 687 698 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 54 "d" - Name 58 "bigColor" - Name 72 "bigColor1_1" - Name 107 "d2" - Name 115 "d3" - Name 119 "bigColor1_2" - Name 132 "bigColor1_3" - Name 138 "d4" - Name 149 "i" - Name 158 "Count" - Name 161 "bigColor2" - Name 172 "bigColor3" - Name 180 "i" - Name 196 "i" - Name 232 "i" - Name 255 "i" - Name 280 "i" - Name 309 "bigColor4" - Name 345 "bigColor5" - Name 351 "d5" - Name 367 "d6" - Name 381 "bigColor6" - Name 419 "d7" - Name 451 "bigColor7" - Name 470 "d8" - Name 513 "d9" - Name 545 "d10" - Name 553 "d11" - Name 563 "d12" - Name 589 "bigColor8" - Name 616 "gl_FragColor" - Name 625 "d14" - Name 630 "d15" - Name 650 "d16" - Name 688 "d18" - Name 699 "d17" - Name 726 "d13" - Name 727 "d19" - Name 728 "d20" - Name 729 "d21" - Name 730 "d22" - Name 731 "d23" - Name 732 "d24" - Name 733 "d25" - Name 734 "d26" - Name 735 "d27" - Name 736 "d28" - Name 737 "d29" - Name 738 "d30" - Name 739 "d31" - Name 740 "d32" - Name 741 "d33" - Name 742 "d34" + Name 57 "bigColor" + Name 71 "bigColor1_1" + Name 106 "d2" + Name 114 "d3" + Name 118 "bigColor1_2" + Name 131 "bigColor1_3" + Name 137 "d4" + Name 148 "i" + Name 157 "Count" + Name 160 "bigColor2" + Name 171 "bigColor3" + Name 179 "i" + Name 195 "i" + Name 231 "i" + Name 254 "i" + Name 279 "i" + Name 308 "bigColor4" + Name 344 "bigColor5" + Name 350 "d5" + Name 366 "d6" + Name 380 "bigColor6" + Name 418 "d7" + Name 450 "bigColor7" + Name 469 "d8" + Name 512 "d9" + Name 544 "d10" + Name 552 "d11" + Name 562 "d12" + Name 588 "bigColor8" + Name 615 "gl_FragColor" + Name 624 "d14" + Name 629 "d15" + Name 649 "d16" + Name 687 "d18" + Name 698 "d17" + Decorate 157(Count) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -85,83 +69,65 @@ Linked fragment stage: 29: 7(fvec4) ConstantComposite 25 25 25 25 35: 6(float) Constant 1059648963 39: 7(fvec4) ConstantComposite 35 35 35 35 - 53: TypePointer UniformConstant 6(float) - 54(d): 53(ptr) Variable UniformConstant - 57: TypePointer UniformConstant 7(fvec4) - 58(bigColor): 57(ptr) Variable UniformConstant - 67: 20(int) Constant 2 - 72(bigColor1_1): 57(ptr) Variable UniformConstant - 76: 20(int) Constant 3 - 94: 6(float) Constant 1109917696 - 97: 6(float) Constant 1065353216 - 107(d2): 53(ptr) Variable UniformConstant - 112: 20(int) Constant 1 - 115(d3): 53(ptr) Variable UniformConstant -119(bigColor1_2): 57(ptr) Variable UniformConstant -132(bigColor1_3): 57(ptr) Variable UniformConstant - 138(d4): 53(ptr) Variable UniformConstant - 147: TypeInt 32 1 - 148: TypePointer Function 147(int) - 150: 147(int) Constant 0 - 157: TypePointer UniformConstant 147(int) - 158(Count): 157(ptr) Variable UniformConstant - 161(bigColor2): 57(ptr) Variable UniformConstant - 166: 147(int) Constant 1 - 172(bigColor3): 57(ptr) Variable UniformConstant - 187: 147(int) Constant 42 - 203: 147(int) Constant 100 - 207: 6(float) Constant 1101004800 - 239: 147(int) Constant 120 - 309(bigColor4): 57(ptr) Variable UniformConstant - 345(bigColor5): 57(ptr) Variable UniformConstant - 351(d5): 53(ptr) Variable UniformConstant - 367(d6): 53(ptr) Variable UniformConstant - 381(bigColor6): 57(ptr) Variable UniformConstant - 419(d7): 53(ptr) Variable UniformConstant - 446: 6(float) Constant 0 - 451(bigColor7): 57(ptr) Variable UniformConstant - 470(d8): 53(ptr) Variable UniformConstant - 487: 6(float) Constant 1073741824 - 513(d9): 53(ptr) Variable UniformConstant - 529: 6(float) Constant 1084227584 - 545(d10): 53(ptr) Variable UniformConstant - 553(d11): 53(ptr) Variable UniformConstant - 563(d12): 53(ptr) Variable UniformConstant - 587: 6(float) Constant 1092616192 - 589(bigColor8): 57(ptr) Variable UniformConstant - 615: TypePointer Output 7(fvec4) -616(gl_FragColor): 615(ptr) Variable Output - 625(d14): 53(ptr) Variable UniformConstant - 630(d15): 53(ptr) Variable UniformConstant - 650(d16): 53(ptr) Variable UniformConstant - 688(d18): 53(ptr) Variable UniformConstant - 699(d17): 53(ptr) Variable UniformConstant - 726(d13): 53(ptr) Variable UniformConstant - 727(d19): 53(ptr) Variable UniformConstant - 728(d20): 53(ptr) Variable UniformConstant - 729(d21): 53(ptr) Variable UniformConstant - 730(d22): 53(ptr) Variable UniformConstant - 731(d23): 53(ptr) Variable UniformConstant - 732(d24): 53(ptr) Variable UniformConstant - 733(d25): 53(ptr) Variable UniformConstant - 734(d26): 53(ptr) Variable UniformConstant - 735(d27): 53(ptr) Variable UniformConstant - 736(d28): 53(ptr) Variable UniformConstant - 737(d29): 53(ptr) Variable UniformConstant - 738(d30): 53(ptr) Variable UniformConstant - 739(d31): 53(ptr) Variable UniformConstant - 740(d32): 53(ptr) Variable UniformConstant - 741(d33): 53(ptr) Variable UniformConstant - 742(d34): 53(ptr) Variable UniformConstant + 53: TypePointer Input 6(float) + 54(d): 53(ptr) Variable Input + 57(bigColor): 10(ptr) Variable Input + 66: 20(int) Constant 2 + 71(bigColor1_1): 10(ptr) Variable Input + 75: 20(int) Constant 3 + 93: 6(float) Constant 1109917696 + 96: 6(float) Constant 1065353216 + 106(d2): 53(ptr) Variable Input + 111: 20(int) Constant 1 + 114(d3): 53(ptr) Variable Input +118(bigColor1_2): 10(ptr) Variable Input +131(bigColor1_3): 10(ptr) Variable Input + 137(d4): 53(ptr) Variable Input + 146: TypeInt 32 1 + 147: TypePointer Function 146(int) + 149: 146(int) Constant 0 + 156: TypePointer Input 146(int) + 157(Count): 156(ptr) Variable Input + 160(bigColor2): 10(ptr) Variable Input + 165: 146(int) Constant 1 + 171(bigColor3): 10(ptr) Variable Input + 186: 146(int) Constant 42 + 202: 146(int) Constant 100 + 206: 6(float) Constant 1101004800 + 238: 146(int) Constant 120 + 308(bigColor4): 10(ptr) Variable Input + 344(bigColor5): 10(ptr) Variable Input + 350(d5): 53(ptr) Variable Input + 366(d6): 53(ptr) Variable Input + 380(bigColor6): 10(ptr) Variable Input + 418(d7): 53(ptr) Variable Input + 445: 6(float) Constant 0 + 450(bigColor7): 10(ptr) Variable Input + 469(d8): 53(ptr) Variable Input + 486: 6(float) Constant 1073741824 + 512(d9): 53(ptr) Variable Input + 528: 6(float) Constant 1084227584 + 544(d10): 53(ptr) Variable Input + 552(d11): 53(ptr) Variable Input + 562(d12): 53(ptr) Variable Input + 586: 6(float) Constant 1092616192 + 588(bigColor8): 10(ptr) Variable Input + 614: TypePointer Output 7(fvec4) +615(gl_FragColor): 614(ptr) Variable Output + 624(d14): 53(ptr) Variable Input + 629(d15): 53(ptr) Variable Input + 649(d16): 53(ptr) Variable Input + 687(d18): 53(ptr) Variable Input + 698(d17): 53(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function - 149(i): 148(ptr) Variable Function - 180(i): 148(ptr) Variable Function - 196(i): 148(ptr) Variable Function - 232(i): 148(ptr) Variable Function - 255(i): 148(ptr) Variable Function - 280(i): 148(ptr) Variable Function + 148(i): 147(ptr) Variable Function + 179(i): 147(ptr) Variable Function + 195(i): 147(ptr) Variable Function + 231(i): 147(ptr) Variable Function + 254(i): 147(ptr) Variable Function + 279(i): 147(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 Branch 13 @@ -211,932 +177,932 @@ Linked fragment stage: 56: 18(bool) FOrdLessThan 52 55 BranchConditional 56 47 48 47: Label - 59: 7(fvec4) Load 58(bigColor) - 60: 7(fvec4) Load 9(color) - 61: 7(fvec4) FAdd 60 59 - Store 9(color) 61 + 58: 7(fvec4) Load 57(bigColor) + 59: 7(fvec4) Load 9(color) + 60: 7(fvec4) FAdd 59 58 + Store 9(color) 60 Branch 49 49: Label Branch 46 48: Label - Branch 62 - 62: Label - LoopMerge 64 65 None - Branch 66 - 66: Label - 68: 22(ptr) AccessChain 9(color) 67 - 69: 6(float) Load 68 - 70: 6(float) Load 54(d) - 71: 18(bool) FOrdLessThan 69 70 - BranchConditional 71 63 64 - 63: Label - 73: 7(fvec4) Load 72(bigColor1_1) - 74: 7(fvec4) Load 9(color) - 75: 7(fvec4) FAdd 74 73 - Store 9(color) 75 - 77: 22(ptr) AccessChain 9(color) 76 - 78: 6(float) Load 77 - 79: 6(float) Load 54(d) - 80: 18(bool) FOrdLessThan 78 79 - SelectionMerge 82 None - BranchConditional 80 81 82 - 81: Label - Branch 65 - 82: Label - 84: 7(fvec4) Load 72(bigColor1_1) - 85: 7(fvec4) Load 9(color) - 86: 7(fvec4) FAdd 85 84 - Store 9(color) 86 - Branch 65 - 65: Label - Branch 62 - 64: Label - Branch 87 - 87: Label - LoopMerge 89 90 None - Branch 91 - 91: Label - 92: 22(ptr) AccessChain 9(color) 21 - 93: 6(float) Load 92 - 95: 18(bool) FOrdLessThan 93 94 - BranchConditional 95 88 89 - 88: Label - 96: 7(fvec4) Load 9(color) - 98: 7(fvec4) CompositeConstruct 97 97 97 97 - 99: 7(fvec4) FAdd 96 98 - Store 9(color) 99 - Branch 90 - 90: Label - Branch 87 - 89: Label - Branch 100 - 100: Label - LoopMerge 102 103 None - Branch 104 - 104: Label - 105: 22(ptr) AccessChain 9(color) 76 - 106: 6(float) Load 105 - 108: 6(float) Load 107(d2) - 109: 18(bool) FOrdLessThan 106 108 - SelectionMerge 111 None - BranchConditional 109 110 111 - 110: Label - 113: 22(ptr) AccessChain 9(color) 112 - 114: 6(float) Load 113 - 116: 6(float) Load 115(d3) - 117: 18(bool) FOrdLessThan 114 116 - Branch 111 - 111: Label - 118: 18(bool) Phi 109 104 117 110 - BranchConditional 118 101 102 - 101: Label - 120: 7(fvec4) Load 119(bigColor1_2) - 121: 7(fvec4) Load 9(color) - 122: 7(fvec4) FAdd 121 120 - Store 9(color) 122 + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 67: 22(ptr) AccessChain 9(color) 66 + 68: 6(float) Load 67 + 69: 6(float) Load 54(d) + 70: 18(bool) FOrdLessThan 68 69 + BranchConditional 70 62 63 + 62: Label + 72: 7(fvec4) Load 71(bigColor1_1) + 73: 7(fvec4) Load 9(color) + 74: 7(fvec4) FAdd 73 72 + Store 9(color) 74 + 76: 22(ptr) AccessChain 9(color) 75 + 77: 6(float) Load 76 + 78: 6(float) Load 54(d) + 79: 18(bool) FOrdLessThan 77 78 + SelectionMerge 81 None + BranchConditional 79 80 81 + 80: Label + Branch 64 + 81: Label + 83: 7(fvec4) Load 71(bigColor1_1) + 84: 7(fvec4) Load 9(color) + 85: 7(fvec4) FAdd 84 83 + Store 9(color) 85 + Branch 64 + 64: Label + Branch 61 + 63: Label + Branch 86 + 86: Label + LoopMerge 88 89 None + Branch 90 + 90: Label + 91: 22(ptr) AccessChain 9(color) 21 + 92: 6(float) Load 91 + 94: 18(bool) FOrdLessThan 92 93 + BranchConditional 94 87 88 + 87: Label + 95: 7(fvec4) Load 9(color) + 97: 7(fvec4) CompositeConstruct 96 96 96 96 + 98: 7(fvec4) FAdd 95 97 + Store 9(color) 98 + Branch 89 + 89: Label + Branch 86 + 88: Label + Branch 99 + 99: Label + LoopMerge 101 102 None Branch 103 103: Label - Branch 100 + 104: 22(ptr) AccessChain 9(color) 75 + 105: 6(float) Load 104 + 107: 6(float) Load 106(d2) + 108: 18(bool) FOrdLessThan 105 107 + SelectionMerge 110 None + BranchConditional 108 109 110 + 109: Label + 112: 22(ptr) AccessChain 9(color) 111 + 113: 6(float) Load 112 + 115: 6(float) Load 114(d3) + 116: 18(bool) FOrdLessThan 113 115 + Branch 110 + 110: Label + 117: 18(bool) Phi 108 103 116 109 + BranchConditional 117 100 101 + 100: Label + 119: 7(fvec4) Load 118(bigColor1_2) + 120: 7(fvec4) Load 9(color) + 121: 7(fvec4) FAdd 120 119 + Store 9(color) 121 + Branch 102 102: Label - Branch 123 - 123: Label - LoopMerge 125 126 None - Branch 127 - 127: Label - 128: 22(ptr) AccessChain 9(color) 67 - 129: 6(float) Load 128 - 130: 6(float) Load 115(d3) - 131: 18(bool) FOrdLessThan 129 130 - BranchConditional 131 124 125 - 124: Label - 133: 7(fvec4) Load 132(bigColor1_3) - 134: 7(fvec4) Load 9(color) - 135: 7(fvec4) FAdd 134 133 - Store 9(color) 135 - 136: 22(ptr) AccessChain 9(color) 112 - 137: 6(float) Load 136 - 139: 6(float) Load 138(d4) - 140: 18(bool) FOrdLessThan 137 139 - SelectionMerge 142 None - BranchConditional 140 141 142 - 141: Label - Branch 125 - 142: Label - 144: 7(fvec4) Load 132(bigColor1_3) - 145: 7(fvec4) Load 9(color) - 146: 7(fvec4) FAdd 145 144 - Store 9(color) 146 - Branch 126 - 126: Label - Branch 123 - 125: Label - Store 149(i) 150 - Branch 151 - 151: Label - LoopMerge 153 154 None - Branch 155 - 155: Label - 156: 147(int) Load 149(i) - 159: 147(int) Load 158(Count) - 160: 18(bool) SLessThan 156 159 - BranchConditional 160 152 153 - 152: Label - 162: 7(fvec4) Load 161(bigColor2) - 163: 7(fvec4) Load 9(color) - 164: 7(fvec4) FAdd 163 162 - Store 9(color) 164 - Branch 154 - 154: Label - 165: 147(int) Load 149(i) - 167: 147(int) IAdd 165 166 - Store 149(i) 167 - Branch 151 - 153: Label + Branch 99 + 101: Label + Branch 122 + 122: Label + LoopMerge 124 125 None + Branch 126 + 126: Label + 127: 22(ptr) AccessChain 9(color) 66 + 128: 6(float) Load 127 + 129: 6(float) Load 114(d3) + 130: 18(bool) FOrdLessThan 128 129 + BranchConditional 130 123 124 + 123: Label + 132: 7(fvec4) Load 131(bigColor1_3) + 133: 7(fvec4) Load 9(color) + 134: 7(fvec4) FAdd 133 132 + Store 9(color) 134 + 135: 22(ptr) AccessChain 9(color) 111 + 136: 6(float) Load 135 + 138: 6(float) Load 137(d4) + 139: 18(bool) FOrdLessThan 136 138 + SelectionMerge 141 None + BranchConditional 139 140 141 + 140: Label + Branch 124 + 141: Label + 143: 7(fvec4) Load 131(bigColor1_3) + 144: 7(fvec4) Load 9(color) + 145: 7(fvec4) FAdd 144 143 + Store 9(color) 145 + Branch 125 + 125: Label + Branch 122 + 124: Label + Store 148(i) 149 + Branch 150 + 150: Label + LoopMerge 152 153 None + Branch 154 + 154: Label + 155: 146(int) Load 148(i) + 158: 146(int) Load 157(Count) + 159: 18(bool) SLessThan 155 158 + BranchConditional 159 151 152 + 151: Label + 161: 7(fvec4) Load 160(bigColor2) + 162: 7(fvec4) Load 9(color) + 163: 7(fvec4) FAdd 162 161 + Store 9(color) 163 + Branch 153 + 153: Label + 164: 146(int) Load 148(i) + 166: 146(int) IAdd 164 165 + Store 148(i) 166 + Branch 150 + 152: Label + Branch 167 + 167: Label + LoopMerge 169 170 None Branch 168 168: Label - LoopMerge 170 171 None - Branch 169 - 169: Label - 173: 7(fvec4) Load 172(bigColor3) - 174: 7(fvec4) Load 9(color) - 175: 7(fvec4) FAdd 174 173 - Store 9(color) 175 - Branch 171 - 171: Label - 176: 22(ptr) AccessChain 9(color) 21 - 177: 6(float) Load 176 - 178: 6(float) Load 107(d2) - 179: 18(bool) FOrdLessThan 177 178 - BranchConditional 179 168 170 + 172: 7(fvec4) Load 171(bigColor3) + 173: 7(fvec4) Load 9(color) + 174: 7(fvec4) FAdd 173 172 + Store 9(color) 174 + Branch 170 170: Label - Store 180(i) 150 - Branch 181 - 181: Label - LoopMerge 183 184 None - Branch 185 - 185: Label - 186: 147(int) Load 180(i) - 188: 18(bool) SLessThan 186 187 - BranchConditional 188 182 183 - 182: Label - 189: 6(float) Load 115(d3) - 190: 22(ptr) AccessChain 9(color) 67 - 191: 6(float) Load 190 - 192: 6(float) FAdd 191 189 - 193: 22(ptr) AccessChain 9(color) 67 - Store 193 192 - Branch 184 - 184: Label - 194: 147(int) Load 180(i) - 195: 147(int) IAdd 194 166 - Store 180(i) 195 - Branch 181 - 183: Label - Store 196(i) 150 - Branch 197 - 197: Label - LoopMerge 199 200 None - Branch 201 - 201: Label - 202: 147(int) Load 196(i) - 204: 18(bool) SLessThan 202 203 - BranchConditional 204 198 199 - 198: Label - 205: 22(ptr) AccessChain 9(color) 67 - 206: 6(float) Load 205 - 208: 18(bool) FOrdLessThan 206 207 - SelectionMerge 210 None - BranchConditional 208 209 214 - 209: Label - 211: 22(ptr) AccessChain 9(color) 21 - 212: 6(float) Load 211 - 213: 6(float) FAdd 212 97 - Store 211 213 - Branch 210 - 214: Label - 215: 22(ptr) AccessChain 9(color) 112 - 216: 6(float) Load 215 - 217: 6(float) FAdd 216 97 - Store 215 217 - Branch 210 - 210: Label - 218: 22(ptr) AccessChain 9(color) 76 - 219: 6(float) Load 218 - 220: 18(bool) FOrdLessThan 219 207 - SelectionMerge 222 None - BranchConditional 220 221 222 - 221: Label - 223: 22(ptr) AccessChain 9(color) 67 - 224: 6(float) Load 223 - 225: 22(ptr) AccessChain 9(color) 112 - 226: 6(float) Load 225 - 227: 18(bool) FOrdGreaterThan 224 226 - SelectionMerge 229 None - BranchConditional 227 228 229 - 228: Label - Branch 229 - 229: Label - Branch 222 - 222: Label - Branch 200 - 200: Label - 230: 147(int) Load 196(i) - 231: 147(int) IAdd 230 166 - Store 196(i) 231 - Branch 197 - 199: Label - Store 232(i) 150 - Branch 233 - 233: Label - LoopMerge 235 236 None - Branch 237 - 237: Label - 238: 147(int) Load 232(i) - 240: 18(bool) SLessThan 238 239 - BranchConditional 240 234 235 - 234: Label - 241: 22(ptr) AccessChain 9(color) 67 - 242: 6(float) Load 241 - 243: 18(bool) FOrdLessThan 242 207 - SelectionMerge 245 None - BranchConditional 243 244 249 - 244: Label - 246: 22(ptr) AccessChain 9(color) 21 - 247: 6(float) Load 246 - 248: 6(float) FAdd 247 97 - Store 246 248 - Branch 245 - 249: Label - 250: 22(ptr) AccessChain 9(color) 112 - 251: 6(float) Load 250 - 252: 6(float) FAdd 251 97 - Store 250 252 - Branch 245 - 245: Label - Branch 236 - 236: Label - 253: 147(int) Load 232(i) - 254: 147(int) IAdd 253 166 - Store 232(i) 254 - Branch 233 - 235: Label - Store 255(i) 150 - Branch 256 - 256: Label - LoopMerge 258 259 None - Branch 260 - 260: Label - 261: 147(int) Load 255(i) - 262: 18(bool) SLessThan 261 187 - BranchConditional 262 257 258 - 257: Label - 263: 6(float) Load 115(d3) - 264: 22(ptr) AccessChain 9(color) 67 - 265: 6(float) Load 264 - 266: 6(float) FAdd 265 263 - 267: 22(ptr) AccessChain 9(color) 67 - Store 267 266 - 268: 22(ptr) AccessChain 9(color) 21 - 269: 6(float) Load 268 - 270: 6(float) Load 138(d4) - 271: 18(bool) FOrdLessThan 269 270 - SelectionMerge 273 None - BranchConditional 271 272 273 - 272: Label - Branch 259 - 273: Label - 275: 22(ptr) AccessChain 9(color) 76 - 276: 6(float) Load 275 - 277: 6(float) FAdd 276 97 - Store 275 277 - Branch 259 - 259: Label - 278: 147(int) Load 255(i) - 279: 147(int) IAdd 278 166 - Store 255(i) 279 - Branch 256 - 258: Label - Store 280(i) 150 - Branch 281 - 281: Label - LoopMerge 283 284 None - Branch 285 - 285: Label - 286: 147(int) Load 280(i) - 287: 18(bool) SLessThan 286 187 - BranchConditional 287 282 283 - 282: Label - 288: 6(float) Load 115(d3) - 289: 22(ptr) AccessChain 9(color) 67 - 290: 6(float) Load 289 - 291: 6(float) FAdd 290 288 - 292: 22(ptr) AccessChain 9(color) 67 - Store 292 291 - 293: 22(ptr) AccessChain 9(color) 21 - 294: 6(float) Load 293 - 295: 6(float) Load 138(d4) - 296: 18(bool) FOrdLessThan 294 295 - SelectionMerge 298 None - BranchConditional 296 297 298 - 297: Label - Branch 283 - 298: Label - 300: 22(ptr) AccessChain 9(color) 76 - 301: 6(float) Load 300 - 302: 6(float) FAdd 301 97 - Store 300 302 - Branch 284 - 284: Label - 303: 147(int) Load 280(i) - 304: 147(int) IAdd 303 166 - Store 280(i) 304 - Branch 281 - 283: Label + 175: 22(ptr) AccessChain 9(color) 21 + 176: 6(float) Load 175 + 177: 6(float) Load 106(d2) + 178: 18(bool) FOrdLessThan 176 177 + BranchConditional 178 167 169 + 169: Label + Store 179(i) 149 + Branch 180 + 180: Label + LoopMerge 182 183 None + Branch 184 + 184: Label + 185: 146(int) Load 179(i) + 187: 18(bool) SLessThan 185 186 + BranchConditional 187 181 182 + 181: Label + 188: 6(float) Load 114(d3) + 189: 22(ptr) AccessChain 9(color) 66 + 190: 6(float) Load 189 + 191: 6(float) FAdd 190 188 + 192: 22(ptr) AccessChain 9(color) 66 + Store 192 191 + Branch 183 + 183: Label + 193: 146(int) Load 179(i) + 194: 146(int) IAdd 193 165 + Store 179(i) 194 + Branch 180 + 182: Label + Store 195(i) 149 + Branch 196 + 196: Label + LoopMerge 198 199 None + Branch 200 + 200: Label + 201: 146(int) Load 195(i) + 203: 18(bool) SLessThan 201 202 + BranchConditional 203 197 198 + 197: Label + 204: 22(ptr) AccessChain 9(color) 66 + 205: 6(float) Load 204 + 207: 18(bool) FOrdLessThan 205 206 + SelectionMerge 209 None + BranchConditional 207 208 213 + 208: Label + 210: 22(ptr) AccessChain 9(color) 21 + 211: 6(float) Load 210 + 212: 6(float) FAdd 211 96 + Store 210 212 + Branch 209 + 213: Label + 214: 22(ptr) AccessChain 9(color) 111 + 215: 6(float) Load 214 + 216: 6(float) FAdd 215 96 + Store 214 216 + Branch 209 + 209: Label + 217: 22(ptr) AccessChain 9(color) 75 + 218: 6(float) Load 217 + 219: 18(bool) FOrdLessThan 218 206 + SelectionMerge 221 None + BranchConditional 219 220 221 + 220: Label + 222: 22(ptr) AccessChain 9(color) 66 + 223: 6(float) Load 222 + 224: 22(ptr) AccessChain 9(color) 111 + 225: 6(float) Load 224 + 226: 18(bool) FOrdGreaterThan 223 225 + SelectionMerge 228 None + BranchConditional 226 227 228 + 227: Label + Branch 228 + 228: Label + Branch 221 + 221: Label + Branch 199 + 199: Label + 229: 146(int) Load 195(i) + 230: 146(int) IAdd 229 165 + Store 195(i) 230 + Branch 196 + 198: Label + Store 231(i) 149 + Branch 232 + 232: Label + LoopMerge 234 235 None + Branch 236 + 236: Label + 237: 146(int) Load 231(i) + 239: 18(bool) SLessThan 237 238 + BranchConditional 239 233 234 + 233: Label + 240: 22(ptr) AccessChain 9(color) 66 + 241: 6(float) Load 240 + 242: 18(bool) FOrdLessThan 241 206 + SelectionMerge 244 None + BranchConditional 242 243 248 + 243: Label + 245: 22(ptr) AccessChain 9(color) 21 + 246: 6(float) Load 245 + 247: 6(float) FAdd 246 96 + Store 245 247 + Branch 244 + 248: Label + 249: 22(ptr) AccessChain 9(color) 111 + 250: 6(float) Load 249 + 251: 6(float) FAdd 250 96 + Store 249 251 + Branch 244 + 244: Label + Branch 235 + 235: Label + 252: 146(int) Load 231(i) + 253: 146(int) IAdd 252 165 + Store 231(i) 253 + Branch 232 + 234: Label + Store 254(i) 149 + Branch 255 + 255: Label + LoopMerge 257 258 None + Branch 259 + 259: Label + 260: 146(int) Load 254(i) + 261: 18(bool) SLessThan 260 186 + BranchConditional 261 256 257 + 256: Label + 262: 6(float) Load 114(d3) + 263: 22(ptr) AccessChain 9(color) 66 + 264: 6(float) Load 263 + 265: 6(float) FAdd 264 262 + 266: 22(ptr) AccessChain 9(color) 66 + Store 266 265 + 267: 22(ptr) AccessChain 9(color) 21 + 268: 6(float) Load 267 + 269: 6(float) Load 137(d4) + 270: 18(bool) FOrdLessThan 268 269 + SelectionMerge 272 None + BranchConditional 270 271 272 + 271: Label + Branch 258 + 272: Label + 274: 22(ptr) AccessChain 9(color) 75 + 275: 6(float) Load 274 + 276: 6(float) FAdd 275 96 + Store 274 276 + Branch 258 + 258: Label + 277: 146(int) Load 254(i) + 278: 146(int) IAdd 277 165 + Store 254(i) 278 + Branch 255 + 257: Label + Store 279(i) 149 + Branch 280 + 280: Label + LoopMerge 282 283 None + Branch 284 + 284: Label + 285: 146(int) Load 279(i) + 286: 18(bool) SLessThan 285 186 + BranchConditional 286 281 282 + 281: Label + 287: 6(float) Load 114(d3) + 288: 22(ptr) AccessChain 9(color) 66 + 289: 6(float) Load 288 + 290: 6(float) FAdd 289 287 + 291: 22(ptr) AccessChain 9(color) 66 + Store 291 290 + 292: 22(ptr) AccessChain 9(color) 21 + 293: 6(float) Load 292 + 294: 6(float) Load 137(d4) + 295: 18(bool) FOrdLessThan 293 294 + SelectionMerge 297 None + BranchConditional 295 296 297 + 296: Label + Branch 282 + 297: Label + 299: 22(ptr) AccessChain 9(color) 75 + 300: 6(float) Load 299 + 301: 6(float) FAdd 300 96 + Store 299 301 + Branch 283 + 283: Label + 302: 146(int) Load 279(i) + 303: 146(int) IAdd 302 165 + Store 279(i) 303 + Branch 280 + 282: Label + Branch 304 + 304: Label + LoopMerge 306 307 None Branch 305 305: Label - LoopMerge 307 308 None - Branch 306 - 306: Label - 310: 7(fvec4) Load 309(bigColor4) - 311: 7(fvec4) Load 9(color) - 312: 7(fvec4) FAdd 311 310 - Store 9(color) 312 - 313: 22(ptr) AccessChain 9(color) 21 - 314: 6(float) Load 313 - 315: 6(float) Load 138(d4) - 316: 18(bool) FOrdLessThan 314 315 - SelectionMerge 318 None - BranchConditional 316 317 318 - 317: Label - Branch 308 - 318: Label - 320: 22(ptr) AccessChain 9(color) 112 - 321: 6(float) Load 320 - 322: 6(float) Load 138(d4) - 323: 18(bool) FOrdLessThan 321 322 - SelectionMerge 325 None - BranchConditional 323 324 331 - 324: Label - 326: 6(float) Load 138(d4) - 327: 22(ptr) AccessChain 9(color) 112 - 328: 6(float) Load 327 - 329: 6(float) FAdd 328 326 - 330: 22(ptr) AccessChain 9(color) 112 - Store 330 329 - Branch 325 - 331: Label - 332: 6(float) Load 138(d4) - 333: 22(ptr) AccessChain 9(color) 21 - 334: 6(float) Load 333 - 335: 6(float) FAdd 334 332 - 336: 22(ptr) AccessChain 9(color) 21 - Store 336 335 - Branch 325 - 325: Label - Branch 308 - 308: Label - 337: 22(ptr) AccessChain 9(color) 67 - 338: 6(float) Load 337 - 339: 6(float) Load 138(d4) - 340: 18(bool) FOrdLessThan 338 339 - BranchConditional 340 305 307 + 309: 7(fvec4) Load 308(bigColor4) + 310: 7(fvec4) Load 9(color) + 311: 7(fvec4) FAdd 310 309 + Store 9(color) 311 + 312: 22(ptr) AccessChain 9(color) 21 + 313: 6(float) Load 312 + 314: 6(float) Load 137(d4) + 315: 18(bool) FOrdLessThan 313 314 + SelectionMerge 317 None + BranchConditional 315 316 317 + 316: Label + Branch 307 + 317: Label + 319: 22(ptr) AccessChain 9(color) 111 + 320: 6(float) Load 319 + 321: 6(float) Load 137(d4) + 322: 18(bool) FOrdLessThan 320 321 + SelectionMerge 324 None + BranchConditional 322 323 330 + 323: Label + 325: 6(float) Load 137(d4) + 326: 22(ptr) AccessChain 9(color) 111 + 327: 6(float) Load 326 + 328: 6(float) FAdd 327 325 + 329: 22(ptr) AccessChain 9(color) 111 + Store 329 328 + Branch 324 + 330: Label + 331: 6(float) Load 137(d4) + 332: 22(ptr) AccessChain 9(color) 21 + 333: 6(float) Load 332 + 334: 6(float) FAdd 333 331 + 335: 22(ptr) AccessChain 9(color) 21 + Store 335 334 + Branch 324 + 324: Label + Branch 307 307: Label + 336: 22(ptr) AccessChain 9(color) 66 + 337: 6(float) Load 336 + 338: 6(float) Load 137(d4) + 339: 18(bool) FOrdLessThan 337 338 + BranchConditional 339 304 306 + 306: Label + Branch 340 + 340: Label + LoopMerge 342 343 None Branch 341 341: Label - LoopMerge 343 344 None - Branch 342 - 342: Label - 346: 7(fvec4) Load 345(bigColor5) - 347: 7(fvec4) Load 9(color) - 348: 7(fvec4) FAdd 347 346 - Store 9(color) 348 - 349: 22(ptr) AccessChain 9(color) 112 - 350: 6(float) Load 349 - 352: 6(float) Load 351(d5) - 353: 18(bool) FOrdLessThan 350 352 - SelectionMerge 355 None - BranchConditional 353 354 355 - 354: Label - 356: 6(float) Load 351(d5) - 357: 22(ptr) AccessChain 9(color) 112 - 358: 6(float) Load 357 - 359: 6(float) FAdd 358 356 - 360: 22(ptr) AccessChain 9(color) 112 - Store 360 359 - Branch 355 - 355: Label - Branch 344 - 344: Label - 361: 22(ptr) AccessChain 9(color) 21 - 362: 6(float) Load 361 - 363: 6(float) Load 351(d5) - 364: 18(bool) FOrdLessThan 362 363 - BranchConditional 364 341 343 + 345: 7(fvec4) Load 344(bigColor5) + 346: 7(fvec4) Load 9(color) + 347: 7(fvec4) FAdd 346 345 + Store 9(color) 347 + 348: 22(ptr) AccessChain 9(color) 111 + 349: 6(float) Load 348 + 351: 6(float) Load 350(d5) + 352: 18(bool) FOrdLessThan 349 351 + SelectionMerge 354 None + BranchConditional 352 353 354 + 353: Label + 355: 6(float) Load 350(d5) + 356: 22(ptr) AccessChain 9(color) 111 + 357: 6(float) Load 356 + 358: 6(float) FAdd 357 355 + 359: 22(ptr) AccessChain 9(color) 111 + Store 359 358 + Branch 354 + 354: Label + Branch 343 343: Label - 365: 22(ptr) AccessChain 9(color) 21 - 366: 6(float) Load 365 - 368: 6(float) Load 367(d6) - 369: 18(bool) FOrdLessThan 366 368 - SelectionMerge 371 None - BranchConditional 369 370 385 - 370: Label - Branch 372 - 372: Label - LoopMerge 374 375 None - Branch 376 - 376: Label - 377: 22(ptr) AccessChain 9(color) 112 - 378: 6(float) Load 377 - 379: 6(float) Load 367(d6) - 380: 18(bool) FOrdLessThan 378 379 - BranchConditional 380 373 374 - 373: Label - 382: 7(fvec4) Load 381(bigColor6) - 383: 7(fvec4) Load 9(color) - 384: 7(fvec4) FAdd 383 382 - Store 9(color) 384 - Branch 375 - 375: Label - Branch 372 - 374: Label + 360: 22(ptr) AccessChain 9(color) 21 + 361: 6(float) Load 360 + 362: 6(float) Load 350(d5) + 363: 18(bool) FOrdLessThan 361 362 + BranchConditional 363 340 342 + 342: Label + 364: 22(ptr) AccessChain 9(color) 21 + 365: 6(float) Load 364 + 367: 6(float) Load 366(d6) + 368: 18(bool) FOrdLessThan 365 367 + SelectionMerge 370 None + BranchConditional 368 369 384 + 369: Label Branch 371 + 371: Label + LoopMerge 373 374 None + Branch 375 + 375: Label + 376: 22(ptr) AccessChain 9(color) 111 + 377: 6(float) Load 376 + 378: 6(float) Load 366(d6) + 379: 18(bool) FOrdLessThan 377 378 + BranchConditional 379 372 373 + 372: Label + 381: 7(fvec4) Load 380(bigColor6) + 382: 7(fvec4) Load 9(color) + 383: 7(fvec4) FAdd 382 381 + Store 9(color) 383 + Branch 374 + 374: Label + Branch 371 + 373: Label + Branch 370 + 384: Label + Branch 385 385: Label - Branch 386 - 386: Label - LoopMerge 388 389 None - Branch 390 - 390: Label - 391: 22(ptr) AccessChain 9(color) 67 - 392: 6(float) Load 391 - 393: 6(float) Load 367(d6) - 394: 18(bool) FOrdLessThan 392 393 - BranchConditional 394 387 388 - 387: Label - 395: 53(ptr) AccessChain 381(bigColor6) 67 - 396: 6(float) Load 395 - 397: 22(ptr) AccessChain 9(color) 67 - 398: 6(float) Load 397 - 399: 6(float) FAdd 398 396 - 400: 22(ptr) AccessChain 9(color) 67 - Store 400 399 - Branch 389 - 389: Label - Branch 386 - 388: Label - Branch 371 - 371: Label - 401: 22(ptr) AccessChain 9(color) 21 - 402: 6(float) Load 401 - 403: 6(float) Load 367(d6) - 404: 18(bool) FOrdLessThan 402 403 - SelectionMerge 406 None - BranchConditional 404 405 425 - 405: Label - Branch 407 - 407: Label - LoopMerge 409 410 None - Branch 411 - 411: Label - 412: 22(ptr) AccessChain 9(color) 112 - 413: 6(float) Load 412 - 414: 6(float) Load 367(d6) - 415: 18(bool) FOrdLessThan 413 414 - BranchConditional 415 408 409 - 408: Label - 416: 7(fvec4) Load 381(bigColor6) - 417: 7(fvec4) Load 9(color) - 418: 7(fvec4) FAdd 417 416 - Store 9(color) 418 - 420: 6(float) Load 419(d7) - 421: 18(bool) FOrdLessThan 420 97 - SelectionMerge 423 None - BranchConditional 421 422 423 - 422: Label - Branch 409 - 423: Label - Branch 410 - 410: Label - Branch 407 - 409: Label + LoopMerge 387 388 None + Branch 389 + 389: Label + 390: 22(ptr) AccessChain 9(color) 66 + 391: 6(float) Load 390 + 392: 6(float) Load 366(d6) + 393: 18(bool) FOrdLessThan 391 392 + BranchConditional 393 386 387 + 386: Label + 394: 53(ptr) AccessChain 380(bigColor6) 66 + 395: 6(float) Load 394 + 396: 22(ptr) AccessChain 9(color) 66 + 397: 6(float) Load 396 + 398: 6(float) FAdd 397 395 + 399: 22(ptr) AccessChain 9(color) 66 + Store 399 398 + Branch 388 + 388: Label + Branch 385 + 387: Label + Branch 370 + 370: Label + 400: 22(ptr) AccessChain 9(color) 21 + 401: 6(float) Load 400 + 402: 6(float) Load 366(d6) + 403: 18(bool) FOrdLessThan 401 402 + SelectionMerge 405 None + BranchConditional 403 404 424 + 404: Label Branch 406 + 406: Label + LoopMerge 408 409 None + Branch 410 + 410: Label + 411: 22(ptr) AccessChain 9(color) 111 + 412: 6(float) Load 411 + 413: 6(float) Load 366(d6) + 414: 18(bool) FOrdLessThan 412 413 + BranchConditional 414 407 408 + 407: Label + 415: 7(fvec4) Load 380(bigColor6) + 416: 7(fvec4) Load 9(color) + 417: 7(fvec4) FAdd 416 415 + Store 9(color) 417 + 419: 6(float) Load 418(d7) + 420: 18(bool) FOrdLessThan 419 96 + SelectionMerge 422 None + BranchConditional 420 421 422 + 421: Label + Branch 408 + 422: Label + Branch 409 + 409: Label + Branch 406 + 408: Label + Branch 405 + 424: Label + Branch 425 425: Label - Branch 426 - 426: Label - LoopMerge 428 429 None - Branch 430 - 430: Label - 431: 22(ptr) AccessChain 9(color) 67 - 432: 6(float) Load 431 - 433: 6(float) Load 367(d6) - 434: 18(bool) FOrdLessThan 432 433 - BranchConditional 434 427 428 - 427: Label - 435: 53(ptr) AccessChain 381(bigColor6) 67 - 436: 6(float) Load 435 - 437: 22(ptr) AccessChain 9(color) 67 - 438: 6(float) Load 437 - 439: 6(float) FAdd 438 436 - 440: 22(ptr) AccessChain 9(color) 67 - Store 440 439 - Branch 429 - 429: Label - Branch 426 - 428: Label - Branch 406 - 406: Label + LoopMerge 427 428 None + Branch 429 + 429: Label + 430: 22(ptr) AccessChain 9(color) 66 + 431: 6(float) Load 430 + 432: 6(float) Load 366(d6) + 433: 18(bool) FOrdLessThan 431 432 + BranchConditional 433 426 427 + 426: Label + 434: 53(ptr) AccessChain 380(bigColor6) 66 + 435: 6(float) Load 434 + 436: 22(ptr) AccessChain 9(color) 66 + 437: 6(float) Load 436 + 438: 6(float) FAdd 437 435 + 439: 22(ptr) AccessChain 9(color) 66 + Store 439 438 + Branch 428 + 428: Label + Branch 425 + 427: Label + Branch 405 + 405: Label + Branch 440 + 440: Label + LoopMerge 442 443 None Branch 441 441: Label - LoopMerge 443 444 None - Branch 442 - 442: Label - 445: 6(float) Load 419(d7) - 447: 18(bool) FOrdLessThan 445 446 - SelectionMerge 449 None - BranchConditional 447 448 449 - 448: Label - Branch 443 - 449: Label - 452: 7(fvec4) Load 451(bigColor7) - 453: 7(fvec4) Load 9(color) - 454: 7(fvec4) FAdd 453 452 - Store 9(color) 454 - 455: 6(float) Load 419(d7) - 456: 18(bool) FOrdLessThan 455 97 - SelectionMerge 458 None - BranchConditional 456 457 458 - 457: Label - 459: 22(ptr) AccessChain 9(color) 67 - 460: 6(float) Load 459 - 461: 6(float) FAdd 460 97 - Store 459 461 - Branch 443 - 458: Label - 463: 7(fvec4) Load 11(BaseColor) - 464: 7(fvec4) Load 9(color) - 465: 7(fvec4) FAdd 464 463 - Store 9(color) 465 - Branch 444 - 444: Label - BranchConditional 19 441 443 + 444: 6(float) Load 418(d7) + 446: 18(bool) FOrdLessThan 444 445 + SelectionMerge 448 None + BranchConditional 446 447 448 + 447: Label + Branch 442 + 448: Label + 451: 7(fvec4) Load 450(bigColor7) + 452: 7(fvec4) Load 9(color) + 453: 7(fvec4) FAdd 452 451 + Store 9(color) 453 + 454: 6(float) Load 418(d7) + 455: 18(bool) FOrdLessThan 454 96 + SelectionMerge 457 None + BranchConditional 455 456 457 + 456: Label + 458: 22(ptr) AccessChain 9(color) 66 + 459: 6(float) Load 458 + 460: 6(float) FAdd 459 96 + Store 458 460 + Branch 442 + 457: Label + 462: 7(fvec4) Load 11(BaseColor) + 463: 7(fvec4) Load 9(color) + 464: 7(fvec4) FAdd 463 462 + Store 9(color) 464 + Branch 443 443: Label + BranchConditional 19 440 442 + 442: Label + Branch 465 + 465: Label + LoopMerge 467 468 None Branch 466 466: Label - LoopMerge 468 469 None - Branch 467 - 467: Label - 471: 6(float) Load 470(d8) - 472: 18(bool) FOrdLessThan 471 446 - SelectionMerge 474 None - BranchConditional 472 473 474 - 473: Label - Branch 468 - 474: Label - 476: 7(fvec4) Load 451(bigColor7) - 477: 7(fvec4) Load 9(color) - 478: 7(fvec4) FAdd 477 476 - Store 9(color) 478 - 479: 6(float) Load 470(d8) - 480: 18(bool) FOrdLessThan 479 97 - SelectionMerge 482 None - BranchConditional 480 481 482 - 481: Label - 483: 22(ptr) AccessChain 9(color) 67 - 484: 6(float) Load 483 - 485: 6(float) FAdd 484 97 - Store 483 485 - 486: 6(float) Load 470(d8) - 488: 18(bool) FOrdLessThan 486 487 - SelectionMerge 490 None - BranchConditional 488 489 494 - 489: Label - 491: 22(ptr) AccessChain 9(color) 112 - 492: 6(float) Load 491 - 493: 6(float) FAdd 492 97 - Store 491 493 - Branch 490 - 494: Label - 495: 22(ptr) AccessChain 9(color) 21 - 496: 6(float) Load 495 - 497: 6(float) FAdd 496 97 - Store 495 497 - Branch 490 - 490: Label - Branch 468 - 482: Label - 499: 7(fvec4) Load 11(BaseColor) - 500: 7(fvec4) Load 9(color) - 501: 7(fvec4) FAdd 500 499 - Store 9(color) 501 - Branch 469 - 469: Label - 502: 22(ptr) AccessChain 9(color) 67 - 503: 6(float) Load 502 - 504: 6(float) Load 470(d8) - 505: 18(bool) FOrdLessThan 503 504 - BranchConditional 505 466 468 + 470: 6(float) Load 469(d8) + 471: 18(bool) FOrdLessThan 470 445 + SelectionMerge 473 None + BranchConditional 471 472 473 + 472: Label + Branch 467 + 473: Label + 475: 7(fvec4) Load 450(bigColor7) + 476: 7(fvec4) Load 9(color) + 477: 7(fvec4) FAdd 476 475 + Store 9(color) 477 + 478: 6(float) Load 469(d8) + 479: 18(bool) FOrdLessThan 478 96 + SelectionMerge 481 None + BranchConditional 479 480 481 + 480: Label + 482: 22(ptr) AccessChain 9(color) 66 + 483: 6(float) Load 482 + 484: 6(float) FAdd 483 96 + Store 482 484 + 485: 6(float) Load 469(d8) + 487: 18(bool) FOrdLessThan 485 486 + SelectionMerge 489 None + BranchConditional 487 488 493 + 488: Label + 490: 22(ptr) AccessChain 9(color) 111 + 491: 6(float) Load 490 + 492: 6(float) FAdd 491 96 + Store 490 492 + Branch 489 + 493: Label + 494: 22(ptr) AccessChain 9(color) 21 + 495: 6(float) Load 494 + 496: 6(float) FAdd 495 96 + Store 494 496 + Branch 489 + 489: Label + Branch 467 + 481: Label + 498: 7(fvec4) Load 11(BaseColor) + 499: 7(fvec4) Load 9(color) + 500: 7(fvec4) FAdd 499 498 + Store 9(color) 500 + Branch 468 468: Label - Branch 506 - 506: Label - LoopMerge 508 509 None - Branch 510 - 510: Label - 511: 22(ptr) AccessChain 9(color) 76 - 512: 6(float) Load 511 - 514: 6(float) Load 513(d9) - 515: 18(bool) FOrdLessThan 512 514 - BranchConditional 515 507 508 - 507: Label - 516: 6(float) Load 513(d9) - 517: 6(float) Load 470(d8) - 518: 18(bool) FOrdGreaterThan 516 517 - SelectionMerge 520 None - BranchConditional 518 519 520 - 519: Label - 521: 22(ptr) AccessChain 9(color) 21 - 522: 6(float) Load 521 - 523: 6(float) Load 419(d7) - 524: 18(bool) FOrdLessThanEqual 522 523 - SelectionMerge 526 None - BranchConditional 524 525 526 - 525: Label - 527: 22(ptr) AccessChain 9(color) 67 - 528: 6(float) Load 527 - 530: 18(bool) FOrdEqual 528 529 - SelectionMerge 532 None - BranchConditional 530 531 536 - 531: Label - 533: 22(ptr) AccessChain 9(color) 76 - 534: 6(float) Load 533 - 535: 6(float) FAdd 534 97 - Store 533 535 - Branch 532 - 536: Label - Branch 508 - 532: Label - Branch 526 - 526: Label - Branch 520 - 520: Label - Branch 509 - 509: Label - Branch 506 - 508: Label - Branch 538 - 538: Label - LoopMerge 540 541 None - Branch 542 - 542: Label - 543: 22(ptr) AccessChain 9(color) 67 - 544: 6(float) Load 543 - 546: 6(float) Load 545(d10) - 547: 18(bool) FOrdLessThan 544 546 - BranchConditional 547 539 540 - 539: Label - 548: 22(ptr) AccessChain 9(color) 112 - 549: 6(float) Load 548 - 550: 6(float) FAdd 549 97 - Store 548 550 - 551: 22(ptr) AccessChain 9(color) 112 - 552: 6(float) Load 551 - 554: 6(float) Load 553(d11) - 555: 18(bool) FOrdLessThan 552 554 - SelectionMerge 557 None - BranchConditional 555 556 557 - 556: Label - 558: 22(ptr) AccessChain 9(color) 67 - 559: 6(float) Load 558 - 560: 6(float) FAdd 559 97 - Store 558 560 - 561: 22(ptr) AccessChain 9(color) 76 - 562: 6(float) Load 561 - 564: 6(float) Load 563(d12) - 565: 18(bool) FOrdLessThan 562 564 - SelectionMerge 567 None - BranchConditional 565 566 571 - 566: Label - 568: 22(ptr) AccessChain 9(color) 76 - 569: 6(float) Load 568 - 570: 6(float) FAdd 569 97 - Store 568 570 - Branch 567 - 571: Label - 572: 22(ptr) AccessChain 9(color) 21 - 573: 6(float) Load 572 - 574: 6(float) FAdd 573 97 - Store 572 574 - Branch 567 - 567: Label - Branch 541 - 557: Label - 576: 7(fvec4) Load 9(color) - 577: 7(fvec4) CompositeConstruct 97 97 97 97 - 578: 7(fvec4) FAdd 576 577 - Store 9(color) 578 - Branch 540 - 541: Label - Branch 538 - 540: Label - Branch 580 - 580: Label - LoopMerge 582 583 None - Branch 584 - 584: Label - 585: 22(ptr) AccessChain 9(color) 21 - 586: 6(float) Load 585 - 588: 18(bool) FOrdLessThan 586 587 - BranchConditional 588 581 582 - 581: Label - 590: 7(fvec4) Load 589(bigColor8) - 591: 7(fvec4) Load 9(color) - 592: 7(fvec4) FAdd 591 590 - Store 9(color) 592 - 593: 22(ptr) AccessChain 9(color) 67 - 594: 6(float) Load 593 - 595: 6(float) Load 470(d8) - 596: 18(bool) FOrdLessThan 594 595 - SelectionMerge 598 None - BranchConditional 596 597 598 - 597: Label - 599: 22(ptr) AccessChain 9(color) 76 - 600: 6(float) Load 599 - 601: 6(float) Load 367(d6) - 602: 18(bool) FOrdLessThan 600 601 - SelectionMerge 604 None - BranchConditional 602 603 604 - 603: Label - Branch 583 - 604: Label - Branch 598 - 598: Label - 606: 53(ptr) AccessChain 589(bigColor8) 21 - 607: 6(float) Load 606 - 608: 22(ptr) AccessChain 9(color) 112 - 609: 6(float) Load 608 - 610: 6(float) FAdd 609 607 - 611: 22(ptr) AccessChain 9(color) 112 - Store 611 610 - Branch 583 - 583: Label - Branch 580 - 582: Label - 612: 7(fvec4) Load 9(color) - 613: 7(fvec4) CompositeConstruct 97 97 97 97 - 614: 7(fvec4) FAdd 612 613 - Store 9(color) 614 - 617: 7(fvec4) Load 9(color) - Store 616(gl_FragColor) 617 - Branch 618 - 618: Label - LoopMerge 620 621 None - Branch 622 - 622: Label - 623: 22(ptr) AccessChain 9(color) 21 - 624: 6(float) Load 623 - 626: 6(float) Load 625(d14) - 627: 18(bool) FOrdLessThan 624 626 - BranchConditional 627 619 620 - 619: Label - 628: 22(ptr) AccessChain 9(color) 112 - 629: 6(float) Load 628 - 631: 6(float) Load 630(d15) - 632: 18(bool) FOrdLessThan 629 631 - SelectionMerge 634 None - BranchConditional 632 633 636 - 633: Label + 501: 22(ptr) AccessChain 9(color) 66 + 502: 6(float) Load 501 + 503: 6(float) Load 469(d8) + 504: 18(bool) FOrdLessThan 502 503 + BranchConditional 504 465 467 + 467: Label + Branch 505 + 505: Label + LoopMerge 507 508 None + Branch 509 + 509: Label + 510: 22(ptr) AccessChain 9(color) 75 + 511: 6(float) Load 510 + 513: 6(float) Load 512(d9) + 514: 18(bool) FOrdLessThan 511 513 + BranchConditional 514 506 507 + 506: Label + 515: 6(float) Load 512(d9) + 516: 6(float) Load 469(d8) + 517: 18(bool) FOrdGreaterThan 515 516 + SelectionMerge 519 None + BranchConditional 517 518 519 + 518: Label + 520: 22(ptr) AccessChain 9(color) 21 + 521: 6(float) Load 520 + 522: 6(float) Load 418(d7) + 523: 18(bool) FOrdLessThanEqual 521 522 + SelectionMerge 525 None + BranchConditional 523 524 525 + 524: Label + 526: 22(ptr) AccessChain 9(color) 66 + 527: 6(float) Load 526 + 529: 18(bool) FOrdEqual 527 528 + SelectionMerge 531 None + BranchConditional 529 530 535 + 530: Label + 532: 22(ptr) AccessChain 9(color) 75 + 533: 6(float) Load 532 + 534: 6(float) FAdd 533 96 + Store 532 534 + Branch 531 + 535: Label + Branch 507 + 531: Label + Branch 525 + 525: Label + Branch 519 + 519: Label + Branch 508 + 508: Label + Branch 505 + 507: Label + Branch 537 + 537: Label + LoopMerge 539 540 None + Branch 541 + 541: Label + 542: 22(ptr) AccessChain 9(color) 66 + 543: 6(float) Load 542 + 545: 6(float) Load 544(d10) + 546: 18(bool) FOrdLessThan 543 545 + BranchConditional 546 538 539 + 538: Label + 547: 22(ptr) AccessChain 9(color) 111 + 548: 6(float) Load 547 + 549: 6(float) FAdd 548 96 + Store 547 549 + 550: 22(ptr) AccessChain 9(color) 111 + 551: 6(float) Load 550 + 553: 6(float) Load 552(d11) + 554: 18(bool) FOrdLessThan 551 553 + SelectionMerge 556 None + BranchConditional 554 555 556 + 555: Label + 557: 22(ptr) AccessChain 9(color) 66 + 558: 6(float) Load 557 + 559: 6(float) FAdd 558 96 + Store 557 559 + 560: 22(ptr) AccessChain 9(color) 75 + 561: 6(float) Load 560 + 563: 6(float) Load 562(d12) + 564: 18(bool) FOrdLessThan 561 563 + SelectionMerge 566 None + BranchConditional 564 565 570 + 565: Label + 567: 22(ptr) AccessChain 9(color) 75 + 568: 6(float) Load 567 + 569: 6(float) FAdd 568 96 + Store 567 569 + Branch 566 + 570: Label + 571: 22(ptr) AccessChain 9(color) 21 + 572: 6(float) Load 571 + 573: 6(float) FAdd 572 96 + Store 571 573 + Branch 566 + 566: Label + Branch 540 + 556: Label + 575: 7(fvec4) Load 9(color) + 576: 7(fvec4) CompositeConstruct 96 96 96 96 + 577: 7(fvec4) FAdd 575 576 + Store 9(color) 577 + Branch 539 + 540: Label + Branch 537 + 539: Label + Branch 579 + 579: Label + LoopMerge 581 582 None + Branch 583 + 583: Label + 584: 22(ptr) AccessChain 9(color) 21 + 585: 6(float) Load 584 + 587: 18(bool) FOrdLessThan 585 586 + BranchConditional 587 580 581 + 580: Label + 589: 7(fvec4) Load 588(bigColor8) + 590: 7(fvec4) Load 9(color) + 591: 7(fvec4) FAdd 590 589 + Store 9(color) 591 + 592: 22(ptr) AccessChain 9(color) 66 + 593: 6(float) Load 592 + 594: 6(float) Load 469(d8) + 595: 18(bool) FOrdLessThan 593 594 + SelectionMerge 597 None + BranchConditional 595 596 597 + 596: Label + 598: 22(ptr) AccessChain 9(color) 75 + 599: 6(float) Load 598 + 600: 6(float) Load 366(d6) + 601: 18(bool) FOrdLessThan 599 600 + SelectionMerge 603 None + BranchConditional 601 602 603 + 602: Label + Branch 582 + 603: Label + Branch 597 + 597: Label + 605: 53(ptr) AccessChain 588(bigColor8) 21 + 606: 6(float) Load 605 + 607: 22(ptr) AccessChain 9(color) 111 + 608: 6(float) Load 607 + 609: 6(float) FAdd 608 606 + 610: 22(ptr) AccessChain 9(color) 111 + Store 610 609 + Branch 582 + 582: Label + Branch 579 + 581: Label + 611: 7(fvec4) Load 9(color) + 612: 7(fvec4) CompositeConstruct 96 96 96 96 + 613: 7(fvec4) FAdd 611 612 + Store 9(color) 613 + 616: 7(fvec4) Load 9(color) + Store 615(gl_FragColor) 616 + Branch 617 + 617: Label + LoopMerge 619 620 None + Branch 621 + 621: Label + 622: 22(ptr) AccessChain 9(color) 21 + 623: 6(float) Load 622 + 625: 6(float) Load 624(d14) + 626: 18(bool) FOrdLessThan 623 625 + BranchConditional 626 618 619 + 618: Label + 627: 22(ptr) AccessChain 9(color) 111 + 628: 6(float) Load 627 + 630: 6(float) Load 629(d15) + 631: 18(bool) FOrdLessThan 628 630 + SelectionMerge 633 None + BranchConditional 631 632 635 + 632: Label Return - 636: Label - 637: 7(fvec4) Load 9(color) - 638: 7(fvec4) CompositeConstruct 97 97 97 97 - 639: 7(fvec4) FAdd 637 638 - Store 9(color) 639 - Branch 634 - 634: Label - Branch 621 - 621: Label - Branch 618 - 620: Label - 640: 7(fvec4) Load 9(color) - 641: 7(fvec4) CompositeConstruct 97 97 97 97 - 642: 7(fvec4) FAdd 640 641 - Store 9(color) 642 - Branch 643 - 643: Label - LoopMerge 645 646 None - Branch 647 - 647: Label - 648: 22(ptr) AccessChain 9(color) 76 - 649: 6(float) Load 648 - 651: 6(float) Load 650(d16) - 652: 18(bool) FOrdLessThan 649 651 - BranchConditional 652 644 645 - 644: Label - 653: 22(ptr) AccessChain 9(color) 76 - 654: 6(float) Load 653 - 655: 6(float) FAdd 654 97 - Store 653 655 - Branch 646 - 646: Label - Branch 643 - 645: Label - Branch 656 - 656: Label - LoopMerge 658 659 None - Branch 660 - 660: Label - 661: 22(ptr) AccessChain 9(color) 76 - 662: 6(float) Load 661 - 663: 6(float) Load 107(d2) - 664: 18(bool) FOrdLessThan 662 663 - SelectionMerge 666 None - BranchConditional 664 665 666 - 665: Label - 667: 22(ptr) AccessChain 9(color) 112 - 668: 6(float) Load 667 - 669: 6(float) Load 115(d3) - 670: 18(bool) FOrdLessThan 668 669 - Branch 666 - 666: Label - 671: 18(bool) Phi 664 660 670 665 - BranchConditional 671 657 658 - 657: Label - 672: 7(fvec4) Load 119(bigColor1_2) - 673: 7(fvec4) Load 9(color) - 674: 7(fvec4) FAdd 673 672 - Store 9(color) 674 - 675: 22(ptr) AccessChain 9(color) 67 - 676: 6(float) Load 675 - 677: 6(float) Load 115(d3) - 678: 18(bool) FOrdLessThan 676 677 - SelectionMerge 680 None - BranchConditional 678 679 680 - 679: Label - Return - 680: Label + 635: Label + 636: 7(fvec4) Load 9(color) + 637: 7(fvec4) CompositeConstruct 96 96 96 96 + 638: 7(fvec4) FAdd 636 637 + Store 9(color) 638 + Branch 633 + 633: Label + Branch 620 + 620: Label + Branch 617 + 619: Label + 639: 7(fvec4) Load 9(color) + 640: 7(fvec4) CompositeConstruct 96 96 96 96 + 641: 7(fvec4) FAdd 639 640 + Store 9(color) 641 + Branch 642 + 642: Label + LoopMerge 644 645 None + Branch 646 + 646: Label + 647: 22(ptr) AccessChain 9(color) 75 + 648: 6(float) Load 647 + 650: 6(float) Load 649(d16) + 651: 18(bool) FOrdLessThan 648 650 + BranchConditional 651 643 644 + 643: Label + 652: 22(ptr) AccessChain 9(color) 75 + 653: 6(float) Load 652 + 654: 6(float) FAdd 653 96 + Store 652 654 + Branch 645 + 645: Label + Branch 642 + 644: Label + Branch 655 + 655: Label + LoopMerge 657 658 None Branch 659 659: Label - Branch 656 + 660: 22(ptr) AccessChain 9(color) 75 + 661: 6(float) Load 660 + 662: 6(float) Load 106(d2) + 663: 18(bool) FOrdLessThan 661 662 + SelectionMerge 665 None + BranchConditional 663 664 665 + 664: Label + 666: 22(ptr) AccessChain 9(color) 111 + 667: 6(float) Load 666 + 668: 6(float) Load 114(d3) + 669: 18(bool) FOrdLessThan 667 668 + Branch 665 + 665: Label + 670: 18(bool) Phi 663 659 669 664 + BranchConditional 670 656 657 + 656: Label + 671: 7(fvec4) Load 118(bigColor1_2) + 672: 7(fvec4) Load 9(color) + 673: 7(fvec4) FAdd 672 671 + Store 9(color) 673 + 674: 22(ptr) AccessChain 9(color) 66 + 675: 6(float) Load 674 + 676: 6(float) Load 114(d3) + 677: 18(bool) FOrdLessThan 675 676 + SelectionMerge 679 None + BranchConditional 677 678 679 + 678: Label + Return + 679: Label + Branch 658 658: Label + Branch 655 + 657: Label + Branch 681 + 681: Label + LoopMerge 683 684 None Branch 682 682: Label - LoopMerge 684 685 None - Branch 683 - 683: Label - 686: 22(ptr) AccessChain 9(color) 112 - 687: 6(float) Load 686 - 689: 6(float) Load 688(d18) - 690: 18(bool) FOrdLessThan 687 689 - SelectionMerge 692 None - BranchConditional 690 691 692 - 691: Label + 685: 22(ptr) AccessChain 9(color) 111 + 686: 6(float) Load 685 + 688: 6(float) Load 687(d18) + 689: 18(bool) FOrdLessThan 686 688 + SelectionMerge 691 None + BranchConditional 689 690 691 + 690: Label Return - 692: Label - 694: 7(fvec4) Load 9(color) - 695: 7(fvec4) CompositeConstruct 97 97 97 97 - 696: 7(fvec4) FAdd 694 695 - Store 9(color) 696 - Branch 685 - 685: Label - 697: 22(ptr) AccessChain 9(color) 21 - 698: 6(float) Load 697 - 700: 6(float) Load 699(d17) - 701: 18(bool) FOrdLessThan 698 700 - BranchConditional 701 682 684 + 691: Label + 693: 7(fvec4) Load 9(color) + 694: 7(fvec4) CompositeConstruct 96 96 96 96 + 695: 7(fvec4) FAdd 693 694 + Store 9(color) 695 + Branch 684 684: Label - Branch 702 - 702: Label - LoopMerge 704 705 None - Branch 706 - 706: Label - 707: 22(ptr) AccessChain 9(color) 112 - 708: 6(float) Load 707 - 709: 6(float) Load 650(d16) - 710: 18(bool) FOrdLessThan 708 709 - BranchConditional 710 703 704 - 703: Label - 711: 22(ptr) AccessChain 9(color) 76 - 712: 6(float) Load 711 - 713: 6(float) Load 650(d16) - 714: 18(bool) FOrdLessThan 712 713 - SelectionMerge 716 None - BranchConditional 714 715 718 - 715: Label + 696: 22(ptr) AccessChain 9(color) 21 + 697: 6(float) Load 696 + 699: 6(float) Load 698(d17) + 700: 18(bool) FOrdLessThan 697 699 + BranchConditional 700 681 683 + 683: Label + Branch 701 + 701: Label + LoopMerge 703 704 None + Branch 705 + 705: Label + 706: 22(ptr) AccessChain 9(color) 111 + 707: 6(float) Load 706 + 708: 6(float) Load 649(d16) + 709: 18(bool) FOrdLessThan 707 708 + BranchConditional 709 702 703 + 702: Label + 710: 22(ptr) AccessChain 9(color) 75 + 711: 6(float) Load 710 + 712: 6(float) Load 649(d16) + 713: 18(bool) FOrdLessThan 711 712 + SelectionMerge 715 None + BranchConditional 713 714 717 + 714: Label Kill - 718: Label - 719: 7(fvec4) Load 9(color) - 720: 7(fvec4) CompositeConstruct 97 97 97 97 - 721: 7(fvec4) FAdd 719 720 - Store 9(color) 721 - Branch 716 - 716: Label - Branch 705 - 705: Label - Branch 702 - 704: Label - 722: 7(fvec4) Load 9(color) - 723: 7(fvec4) CompositeConstruct 97 97 97 97 - 724: 7(fvec4) FAdd 722 723 - Store 9(color) 724 - 725: 7(fvec4) Load 9(color) - Store 616(gl_FragColor) 725 + 717: Label + 718: 7(fvec4) Load 9(color) + 719: 7(fvec4) CompositeConstruct 96 96 96 96 + 720: 7(fvec4) FAdd 718 719 + Store 9(color) 720 + Branch 715 + 715: Label + Branch 704 + 704: Label + Branch 701 + 703: Label + 721: 7(fvec4) Load 9(color) + 722: 7(fvec4) CompositeConstruct 96 96 96 96 + 723: 7(fvec4) FAdd 721 722 + Store 9(color) 723 + 724: 7(fvec4) Load 9(color) + Store 615(gl_FragColor) 724 Return FunctionEnd diff --git a/Test/baseResults/spv.loopsArtificial.frag.out b/Test/baseResults/spv.loopsArtificial.frag.out index 7fd04d44ec15f7216344e92788fde18a71f733fb..5f10bd35901cfdc46683b016f6c2ad45b2abc533 100755 --- a/Test/baseResults/spv.loopsArtificial.frag.out +++ b/Test/baseResults/spv.loopsArtificial.frag.out @@ -5,64 +5,36 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 188 +// Id's are bound by 158 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 141 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 17 27 80 140 142 143 144 145 146 147 148 149 150 151 152 153 154 157 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 18 "bigColor4" - Name 28 "d4" - Name 81 "d13" - Name 141 "gl_FragColor" - Name 143 "bigColor" - Name 144 "bigColor1_1" - Name 145 "bigColor1_2" - Name 146 "bigColor1_3" - Name 147 "bigColor2" - Name 148 "bigColor3" - Name 149 "bigColor5" - Name 150 "bigColor6" - Name 151 "bigColor7" - Name 152 "bigColor8" - Name 153 "d" - Name 154 "d2" - Name 155 "d3" - Name 156 "d5" - Name 157 "d6" - Name 158 "d7" - Name 159 "d8" - Name 160 "d9" - Name 161 "d10" - Name 162 "d11" - Name 163 "d12" - Name 164 "d14" - Name 165 "d15" - Name 166 "d16" - Name 167 "d17" - Name 168 "d18" - Name 169 "d19" - Name 170 "d20" - Name 171 "d21" - Name 172 "d22" - Name 173 "d23" - Name 174 "d24" - Name 175 "d25" - Name 176 "d26" - Name 177 "d27" - Name 178 "d28" - Name 179 "d29" - Name 180 "d30" - Name 181 "d31" - Name 182 "d32" - Name 183 "d33" - Name 184 "d34" - Name 187 "Count" + Name 17 "bigColor4" + Name 27 "d4" + Name 80 "d13" + Name 140 "gl_FragColor" + Name 142 "bigColor" + Name 143 "bigColor1_1" + Name 144 "bigColor1_2" + Name 145 "bigColor1_3" + Name 146 "bigColor2" + Name 147 "bigColor3" + Name 148 "bigColor5" + Name 149 "bigColor6" + Name 150 "bigColor7" + Name 151 "bigColor8" + Name 152 "d" + Name 153 "d2" + Name 154 "d3" + Name 157 "Count" + Decorate 157(Count) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -70,67 +42,37 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 17: TypePointer UniformConstant 7(fvec4) - 18(bigColor4): 17(ptr) Variable UniformConstant - 22: TypeInt 32 0 - 23: 22(int) Constant 0 - 24: TypePointer Function 6(float) - 27: TypePointer UniformConstant 6(float) - 28(d4): 27(ptr) Variable UniformConstant - 30: TypeBool - 34: 6(float) Constant 1073741824 - 35: 22(int) Constant 2 - 48: 6(float) Constant 1065353216 - 51: 22(int) Constant 1 - 78: 22(int) Constant 3 - 81(d13): 27(ptr) Variable UniformConstant - 140: TypePointer Output 7(fvec4) -141(gl_FragColor): 140(ptr) Variable Output - 143(bigColor): 17(ptr) Variable UniformConstant -144(bigColor1_1): 17(ptr) Variable UniformConstant -145(bigColor1_2): 17(ptr) Variable UniformConstant -146(bigColor1_3): 17(ptr) Variable UniformConstant - 147(bigColor2): 17(ptr) Variable UniformConstant - 148(bigColor3): 17(ptr) Variable UniformConstant - 149(bigColor5): 17(ptr) Variable UniformConstant - 150(bigColor6): 17(ptr) Variable UniformConstant - 151(bigColor7): 17(ptr) Variable UniformConstant - 152(bigColor8): 17(ptr) Variable UniformConstant - 153(d): 27(ptr) Variable UniformConstant - 154(d2): 27(ptr) Variable UniformConstant - 155(d3): 27(ptr) Variable UniformConstant - 156(d5): 27(ptr) Variable UniformConstant - 157(d6): 27(ptr) Variable UniformConstant - 158(d7): 27(ptr) Variable UniformConstant - 159(d8): 27(ptr) Variable UniformConstant - 160(d9): 27(ptr) Variable UniformConstant - 161(d10): 27(ptr) Variable UniformConstant - 162(d11): 27(ptr) Variable UniformConstant - 163(d12): 27(ptr) Variable UniformConstant - 164(d14): 27(ptr) Variable UniformConstant - 165(d15): 27(ptr) Variable UniformConstant - 166(d16): 27(ptr) Variable UniformConstant - 167(d17): 27(ptr) Variable UniformConstant - 168(d18): 27(ptr) Variable UniformConstant - 169(d19): 27(ptr) Variable UniformConstant - 170(d20): 27(ptr) Variable UniformConstant - 171(d21): 27(ptr) Variable UniformConstant - 172(d22): 27(ptr) Variable UniformConstant - 173(d23): 27(ptr) Variable UniformConstant - 174(d24): 27(ptr) Variable UniformConstant - 175(d25): 27(ptr) Variable UniformConstant - 176(d26): 27(ptr) Variable UniformConstant - 177(d27): 27(ptr) Variable UniformConstant - 178(d28): 27(ptr) Variable UniformConstant - 179(d29): 27(ptr) Variable UniformConstant - 180(d30): 27(ptr) Variable UniformConstant - 181(d31): 27(ptr) Variable UniformConstant - 182(d32): 27(ptr) Variable UniformConstant - 183(d33): 27(ptr) Variable UniformConstant - 184(d34): 27(ptr) Variable UniformConstant - 185: TypeInt 32 1 - 186: TypePointer UniformConstant 185(int) - 187(Count): 186(ptr) Variable UniformConstant + 17(bigColor4): 10(ptr) Variable Input + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer Input 6(float) + 27(d4): 26(ptr) Variable Input + 29: TypeBool + 33: 6(float) Constant 1073741824 + 34: 21(int) Constant 2 + 47: 6(float) Constant 1065353216 + 50: 21(int) Constant 1 + 77: 21(int) Constant 3 + 80(d13): 26(ptr) Variable Input + 139: TypePointer Output 7(fvec4) +140(gl_FragColor): 139(ptr) Variable Output + 142(bigColor): 10(ptr) Variable Input +143(bigColor1_1): 10(ptr) Variable Input +144(bigColor1_2): 10(ptr) Variable Input +145(bigColor1_3): 10(ptr) Variable Input + 146(bigColor2): 10(ptr) Variable Input + 147(bigColor3): 10(ptr) Variable Input + 148(bigColor5): 10(ptr) Variable Input + 149(bigColor6): 10(ptr) Variable Input + 150(bigColor7): 10(ptr) Variable Input + 151(bigColor8): 10(ptr) Variable Input + 152(d): 26(ptr) Variable Input + 153(d2): 26(ptr) Variable Input + 154(d3): 26(ptr) Variable Input + 155: TypeInt 32 1 + 156: TypePointer Input 155(int) + 157(Count): 156(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -141,161 +83,161 @@ Linked fragment stage: LoopMerge 15 16 None Branch 14 14: Label - 19: 7(fvec4) Load 18(bigColor4) - 20: 7(fvec4) Load 9(color) - 21: 7(fvec4) FAdd 20 19 - Store 9(color) 21 - 25: 24(ptr) AccessChain 9(color) 23 - 26: 6(float) Load 25 - 29: 6(float) Load 28(d4) - 31: 30(bool) FOrdLessThan 26 29 - SelectionMerge 33 None - BranchConditional 31 32 33 - 32: Label - 36: 24(ptr) AccessChain 9(color) 35 - 37: 6(float) Load 36 - 38: 6(float) FAdd 37 34 - 39: 24(ptr) AccessChain 9(color) 35 - Store 39 38 - 40: 24(ptr) AccessChain 9(color) 35 - 41: 6(float) Load 40 - 42: 6(float) Load 28(d4) - 43: 30(bool) FOrdLessThan 41 42 - SelectionMerge 45 None - BranchConditional 43 44 45 - 44: Label - 46: 24(ptr) AccessChain 9(color) 23 - 47: 6(float) Load 46 - 49: 6(float) FAdd 47 48 - Store 46 49 + 18: 7(fvec4) Load 17(bigColor4) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d4) + 30: 29(bool) FOrdLessThan 25 28 + SelectionMerge 32 None + BranchConditional 30 31 32 + 31: Label + 35: 23(ptr) AccessChain 9(color) 34 + 36: 6(float) Load 35 + 37: 6(float) FAdd 36 33 + 38: 23(ptr) AccessChain 9(color) 34 + Store 38 37 + 39: 23(ptr) AccessChain 9(color) 34 + 40: 6(float) Load 39 + 41: 6(float) Load 27(d4) + 42: 29(bool) FOrdLessThan 40 41 + SelectionMerge 44 None + BranchConditional 42 43 44 + 43: Label + 45: 23(ptr) AccessChain 9(color) 22 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 Branch 16 - 45: Label - Branch 33 - 33: Label - 52: 24(ptr) AccessChain 9(color) 51 - 53: 6(float) Load 52 - 54: 6(float) Load 28(d4) - 55: 30(bool) FOrdLessThan 53 54 - SelectionMerge 57 None - BranchConditional 55 56 63 - 56: Label - 58: 6(float) Load 28(d4) - 59: 24(ptr) AccessChain 9(color) 51 - 60: 6(float) Load 59 - 61: 6(float) FAdd 60 58 - 62: 24(ptr) AccessChain 9(color) 51 - Store 62 61 - Branch 57 - 63: Label - 64: 6(float) Load 28(d4) - 65: 24(ptr) AccessChain 9(color) 23 - 66: 6(float) Load 65 - 67: 6(float) FAdd 66 64 - 68: 24(ptr) AccessChain 9(color) 23 - Store 68 67 - Branch 57 - 57: Label + 44: Label + Branch 32 + 32: Label + 51: 23(ptr) AccessChain 9(color) 50 + 52: 6(float) Load 51 + 53: 6(float) Load 27(d4) + 54: 29(bool) FOrdLessThan 52 53 + SelectionMerge 56 None + BranchConditional 54 55 62 + 55: Label + 57: 6(float) Load 27(d4) + 58: 23(ptr) AccessChain 9(color) 50 + 59: 6(float) Load 58 + 60: 6(float) FAdd 59 57 + 61: 23(ptr) AccessChain 9(color) 50 + Store 61 60 + Branch 56 + 62: Label + 63: 6(float) Load 27(d4) + 64: 23(ptr) AccessChain 9(color) 22 + 65: 6(float) Load 64 + 66: 6(float) FAdd 65 63 + 67: 23(ptr) AccessChain 9(color) 22 + Store 67 66 + Branch 56 + 56: Label Branch 16 16: Label - 69: 24(ptr) AccessChain 9(color) 35 - 70: 6(float) Load 69 - 71: 6(float) Load 28(d4) - 72: 30(bool) FOrdLessThan 70 71 - BranchConditional 72 13 15 + 68: 23(ptr) AccessChain 9(color) 34 + 69: 6(float) Load 68 + 70: 6(float) Load 27(d4) + 71: 29(bool) FOrdLessThan 69 70 + BranchConditional 71 13 15 15: Label - Branch 73 - 73: Label - LoopMerge 75 76 None - Branch 77 - 77: Label - 79: 24(ptr) AccessChain 9(color) 78 - 80: 6(float) Load 79 - 82: 6(float) Load 81(d13) - 83: 30(bool) FOrdLessThan 80 82 - BranchConditional 83 74 75 - 74: Label - 84: 24(ptr) AccessChain 9(color) 35 - 85: 6(float) Load 84 - 86: 6(float) Load 81(d13) - 87: 30(bool) FOrdLessThan 85 86 - SelectionMerge 89 None - BranchConditional 87 88 93 - 88: Label - 90: 7(fvec4) Load 9(color) - 91: 7(fvec4) CompositeConstruct 48 48 48 48 - 92: 7(fvec4) FAdd 90 91 - Store 9(color) 92 - Branch 89 - 93: Label - 94: 7(fvec4) Load 9(color) - 95: 7(fvec4) CompositeConstruct 48 48 48 48 - 96: 7(fvec4) FSub 94 95 - Store 9(color) 96 - Branch 89 - 89: Label - 97: 7(fvec4) Load 18(bigColor4) - 98: 7(fvec4) Load 9(color) - 99: 7(fvec4) FAdd 98 97 - Store 9(color) 99 - 100: 24(ptr) AccessChain 9(color) 23 - 101: 6(float) Load 100 - 102: 6(float) Load 28(d4) - 103: 30(bool) FOrdLessThan 101 102 - SelectionMerge 105 None - BranchConditional 103 104 105 - 104: Label - 106: 24(ptr) AccessChain 9(color) 35 - 107: 6(float) Load 106 - 108: 6(float) FAdd 107 34 - 109: 24(ptr) AccessChain 9(color) 35 - Store 109 108 - 110: 24(ptr) AccessChain 9(color) 35 - 111: 6(float) Load 110 - 112: 6(float) Load 28(d4) - 113: 30(bool) FOrdLessThan 111 112 - SelectionMerge 115 None - BranchConditional 113 114 115 - 114: Label - 116: 24(ptr) AccessChain 9(color) 23 - 117: 6(float) Load 116 - 118: 6(float) FAdd 117 48 - Store 116 118 - Branch 76 - 115: Label - Branch 105 - 105: Label - 120: 24(ptr) AccessChain 9(color) 51 - 121: 6(float) Load 120 - 122: 6(float) Load 28(d4) - 123: 30(bool) FOrdLessThan 121 122 - SelectionMerge 125 None - BranchConditional 123 124 131 - 124: Label - 126: 6(float) Load 28(d4) - 127: 24(ptr) AccessChain 9(color) 51 - 128: 6(float) Load 127 - 129: 6(float) FAdd 128 126 - 130: 24(ptr) AccessChain 9(color) 51 - Store 130 129 - Branch 125 - 131: Label - 132: 6(float) Load 28(d4) - 133: 24(ptr) AccessChain 9(color) 23 - 134: 6(float) Load 133 - 135: 6(float) FAdd 134 132 - 136: 24(ptr) AccessChain 9(color) 23 - Store 136 135 - Branch 125 - 125: Label - Branch 76 - 76: Label - Branch 73 - 75: Label - 137: 7(fvec4) Load 9(color) - 138: 7(fvec4) CompositeConstruct 48 48 48 48 - 139: 7(fvec4) FAdd 137 138 - Store 9(color) 139 - 142: 7(fvec4) Load 9(color) - Store 141(gl_FragColor) 142 + Branch 72 + 72: Label + LoopMerge 74 75 None + Branch 76 + 76: Label + 78: 23(ptr) AccessChain 9(color) 77 + 79: 6(float) Load 78 + 81: 6(float) Load 80(d13) + 82: 29(bool) FOrdLessThan 79 81 + BranchConditional 82 73 74 + 73: Label + 83: 23(ptr) AccessChain 9(color) 34 + 84: 6(float) Load 83 + 85: 6(float) Load 80(d13) + 86: 29(bool) FOrdLessThan 84 85 + SelectionMerge 88 None + BranchConditional 86 87 92 + 87: Label + 89: 7(fvec4) Load 9(color) + 90: 7(fvec4) CompositeConstruct 47 47 47 47 + 91: 7(fvec4) FAdd 89 90 + Store 9(color) 91 + Branch 88 + 92: Label + 93: 7(fvec4) Load 9(color) + 94: 7(fvec4) CompositeConstruct 47 47 47 47 + 95: 7(fvec4) FSub 93 94 + Store 9(color) 95 + Branch 88 + 88: Label + 96: 7(fvec4) Load 17(bigColor4) + 97: 7(fvec4) Load 9(color) + 98: 7(fvec4) FAdd 97 96 + Store 9(color) 98 + 99: 23(ptr) AccessChain 9(color) 22 + 100: 6(float) Load 99 + 101: 6(float) Load 27(d4) + 102: 29(bool) FOrdLessThan 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 23(ptr) AccessChain 9(color) 34 + 106: 6(float) Load 105 + 107: 6(float) FAdd 106 33 + 108: 23(ptr) AccessChain 9(color) 34 + Store 108 107 + 109: 23(ptr) AccessChain 9(color) 34 + 110: 6(float) Load 109 + 111: 6(float) Load 27(d4) + 112: 29(bool) FOrdLessThan 110 111 + SelectionMerge 114 None + BranchConditional 112 113 114 + 113: Label + 115: 23(ptr) AccessChain 9(color) 22 + 116: 6(float) Load 115 + 117: 6(float) FAdd 116 47 + Store 115 117 + Branch 75 + 114: Label + Branch 104 + 104: Label + 119: 23(ptr) AccessChain 9(color) 50 + 120: 6(float) Load 119 + 121: 6(float) Load 27(d4) + 122: 29(bool) FOrdLessThan 120 121 + SelectionMerge 124 None + BranchConditional 122 123 130 + 123: Label + 125: 6(float) Load 27(d4) + 126: 23(ptr) AccessChain 9(color) 50 + 127: 6(float) Load 126 + 128: 6(float) FAdd 127 125 + 129: 23(ptr) AccessChain 9(color) 50 + Store 129 128 + Branch 124 + 130: Label + 131: 6(float) Load 27(d4) + 132: 23(ptr) AccessChain 9(color) 22 + 133: 6(float) Load 132 + 134: 6(float) FAdd 133 131 + 135: 23(ptr) AccessChain 9(color) 22 + Store 135 134 + Branch 124 + 124: Label + Branch 75 + 75: Label + Branch 72 + 74: Label + 136: 7(fvec4) Load 9(color) + 137: 7(fvec4) CompositeConstruct 47 47 47 47 + 138: 7(fvec4) FAdd 136 137 + Store 9(color) 138 + 141: 7(fvec4) Load 9(color) + Store 140(gl_FragColor) 141 Return FunctionEnd diff --git a/Test/baseResults/spv.matFun.vert.out b/Test/baseResults/spv.matFun.vert.out index 1c239d03c599072b73df75188b2aadf882ea971b..ab48776316176041857339f55df50ad7820a276a 100755 --- a/Test/baseResults/spv.matFun.vert.out +++ b/Test/baseResults/spv.matFun.vert.out @@ -1,17 +1,20 @@ spv.matFun.vert +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 97 +// Id's are bound by 103 Capability Shader + Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 72 76 95 96 - Source GLSL 140 + EntryPoint Vertex 4 "main" 76 81 + Source GLSL 400 Name 4 "main" Name 14 "xf(mf33;vf3;" Name 12 "m" @@ -22,19 +25,32 @@ Linked vertex stage: Name 24 "m4" Name 25 "v" Name 65 "param" - Name 72 "gl_Position" - Name 74 "m4" - Name 76 "v3" - Name 77 "param" - Name 79 "param" - Name 83 "m3" - Name 84 "param" + Name 74 "gl_PerVertex" + MemberName 74(gl_PerVertex) 0 "gl_Position" + MemberName 74(gl_PerVertex) 1 "gl_PointSize" + MemberName 74(gl_PerVertex) 2 "gl_ClipDistance" + Name 76 "" + Name 77 "bl" + MemberName 77(bl) 0 "m4" + MemberName 77(bl) 1 "m3" + Name 79 "bName" + Name 81 "v3" + Name 82 "param" Name 86 "param" - Name 95 "gl_VertexID" - Name 96 "gl_InstanceID" - Decorate 72(gl_Position) BuiltIn Position - Decorate 95(gl_VertexID) BuiltIn VertexId - Decorate 96(gl_InstanceID) BuiltIn InstanceId + Name 89 "param" + Name 93 "param" + MemberDecorate 74(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 74(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 74(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 74(gl_PerVertex) Block + MemberDecorate 77(bl) 0 ColMajor + MemberDecorate 77(bl) 0 Offset 0 + MemberDecorate 77(bl) 0 MatrixStride 16 + MemberDecorate 77(bl) 1 ColMajor + MemberDecorate 77(bl) 1 Offset 64 + MemberDecorate 77(bl) 1 MatrixStride 16 + Decorate 77(bl) Block + Decorate 79(bName) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -55,39 +71,45 @@ Linked vertex stage: 43: 33(int) Constant 2 47: 6(float) Constant 1065353216 48: 6(float) Constant 0 - 71: TypePointer Output 16(fvec4) - 72(gl_Position): 71(ptr) Variable Output - 73: TypePointer UniformConstant 17 - 74(m4): 73(ptr) Variable UniformConstant - 75: TypePointer Input 7(fvec3) - 76(v3): 75(ptr) Variable Input - 82: TypePointer UniformConstant 8 - 83(m3): 82(ptr) Variable UniformConstant - 94: TypePointer Input 33(int) - 95(gl_VertexID): 94(ptr) Variable Input -96(gl_InstanceID): 94(ptr) Variable Input + 71: TypeInt 32 0 + 72: 71(int) Constant 1 + 73: TypeArray 6(float) 72 +74(gl_PerVertex): TypeStruct 16(fvec4) 6(float) 73 + 75: TypePointer Output 74(gl_PerVertex) + 76: 75(ptr) Variable Output + 77(bl): TypeStruct 17 8 + 78: TypePointer Uniform 77(bl) + 79(bName): 78(ptr) Variable Uniform + 80: TypePointer Input 7(fvec3) + 81(v3): 80(ptr) Variable Input + 83: TypePointer Uniform 17 + 90: TypePointer Uniform 8 + 101: TypePointer Output 16(fvec4) 4(main): 2 Function None 3 5: Label - 77(param): 18(ptr) Variable Function - 79(param): 10(ptr) Variable Function - 84(param): 9(ptr) Variable Function + 82(param): 18(ptr) Variable Function 86(param): 10(ptr) Variable Function - 78: 17 Load 74(m4) - Store 77(param) 78 - 80: 7(fvec3) Load 76(v3) - Store 79(param) 80 - 81: 7(fvec3) FunctionCall 26(mxv(mf44;vf3;) 77(param) 79(param) - 85: 8 Load 83(m3) - Store 84(param) 85 - 87: 7(fvec3) Load 76(v3) + 89(param): 9(ptr) Variable Function + 93(param): 10(ptr) Variable Function + 84: 83(ptr) AccessChain 79(bName) 34 + 85: 17 Load 84 + Store 82(param) 85 + 87: 7(fvec3) Load 81(v3) Store 86(param) 87 - 88: 7(fvec3) FunctionCall 14(xf(mf33;vf3;) 84(param) 86(param) - 89: 7(fvec3) FAdd 81 88 - 90: 6(float) CompositeExtract 89 0 - 91: 6(float) CompositeExtract 89 1 - 92: 6(float) CompositeExtract 89 2 - 93: 16(fvec4) CompositeConstruct 90 91 92 47 - Store 72(gl_Position) 93 + 88: 7(fvec3) FunctionCall 26(mxv(mf44;vf3;) 82(param) 86(param) + 91: 90(ptr) AccessChain 79(bName) 39 + 92: 8 Load 91 + Store 89(param) 92 + 94: 7(fvec3) Load 81(v3) + Store 93(param) 94 + 95: 7(fvec3) FunctionCall 14(xf(mf33;vf3;) 89(param) 93(param) + 96: 7(fvec3) FAdd 88 95 + 97: 6(float) CompositeExtract 96 0 + 98: 6(float) CompositeExtract 96 1 + 99: 6(float) CompositeExtract 96 2 + 100: 16(fvec4) CompositeConstruct 97 98 99 47 + 102: 101(ptr) AccessChain 76 34 + Store 102 100 Return FunctionEnd 14(xf(mf33;vf3;): 7(fvec3) Function None 11 diff --git a/Test/baseResults/spv.matrix.frag.out b/Test/baseResults/spv.matrix.frag.out index 62a1636ca195ce02056feb2a15f81a8429d27dd4..8f0d6463825c8543089c0ca0c5413482dc8d6e8f 100644 --- a/Test/baseResults/spv.matrix.frag.out +++ b/Test/baseResults/spv.matrix.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 12 14 28 140 148 166 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 10 "sum34" diff --git a/Test/baseResults/spv.matrix2.frag.out b/Test/baseResults/spv.matrix2.frag.out index b1cd71b9509b24ac1f917d32095d30847a861c36..e0497b09d3c25683cd6b03bd4bc081fd7d5d8df5 100644 --- a/Test/baseResults/spv.matrix2.frag.out +++ b/Test/baseResults/spv.matrix2.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 12 16 37 38 65 87 147 158 181 218 219 220 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 150 Name 4 "main" Name 10 "m34" diff --git a/Test/baseResults/spv.merge-unreachable.frag.out b/Test/baseResults/spv.merge-unreachable.frag.out index 654297684144ba31af9b3900e8283d0feeaa253e..6e326187b2126affed540be4b4c7f6f8a1190e97 100644 --- a/Test/baseResults/spv.merge-unreachable.frag.out +++ b/Test/baseResults/spv.merge-unreachable.frag.out @@ -13,7 +13,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 9 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "v" diff --git a/Test/baseResults/spv.newTexture.frag.out b/Test/baseResults/spv.newTexture.frag.out index 6ef947088f911960b004a1e63c3c142cbbe966ab..1c99ac010466d6fa79c826f3fa1ef33c43d2302d 100755 --- a/Test/baseResults/spv.newTexture.frag.out +++ b/Test/baseResults/spv.newTexture.frag.out @@ -16,7 +16,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 17 26 29 55 81 84 91 247 277 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" Name 9 "v" @@ -49,9 +49,27 @@ Linked fragment stage: Name 271 "usCube" Name 275 "us2DArray" Name 277 "ic4D" + Decorate 13(s2D) DescriptorSet 0 + Decorate 23(sCubeArrayShadow) DescriptorSet 0 + Decorate 42(s3D) DescriptorSet 0 + Decorate 51(s2DArray) DescriptorSet 0 + Decorate 64(s2DShadow) DescriptorSet 0 Decorate 81(ic3D) Flat Decorate 84(ic1D) Flat Decorate 91(ic2D) Flat + Decorate 100(sr) DescriptorSet 0 + Decorate 125(sCube) DescriptorSet 0 + Decorate 136(s2DArrayShadow) DescriptorSet 0 + Decorate 168(is2D) DescriptorSet 0 + Decorate 203(is3D) DescriptorSet 0 + Decorate 215(isCube) DescriptorSet 0 + Decorate 227(is2DArray) DescriptorSet 0 + Decorate 241(sCubeShadow) DescriptorSet 0 + Decorate 259(is2Dms) DescriptorSet 0 + Decorate 263(us2D) DescriptorSet 0 + Decorate 267(us3D) DescriptorSet 0 + Decorate 271(usCube) DescriptorSet 0 + Decorate 275(us2DArray) DescriptorSet 0 Decorate 277(ic4D) Flat 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.nonSquare.vert.out b/Test/baseResults/spv.nonSquare.vert.out index abc7d362b9ce596a12de8aad11786e1b94315749..329a71cb299dfb75eed18d099453efccb2395af3 100755 --- a/Test/baseResults/spv.nonSquare.vert.out +++ b/Test/baseResults/spv.nonSquare.vert.out @@ -1,19 +1,16 @@ spv.nonSquare.vert -WARNING: 0:3: attribute deprecated in version 130; may be removed in future release -WARNING: 0:4: attribute deprecated in version 130; may be removed in future release - Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 94 +// Id's are bound by 90 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 12 28 55 92 93 + EntryPoint Vertex 4 "main" 12 22 28 55 Source GLSL 140 Name 4 "main" Name 9 "a" @@ -23,11 +20,7 @@ Linked vertex stage: Name 22 "m32" Name 28 "gl_Position" Name 55 "v4" - Name 92 "gl_VertexID" - Name 93 "gl_InstanceID" Decorate 28(gl_Position) BuiltIn Position - Decorate 92(gl_VertexID) BuiltIn VertexId - Decorate 93(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -39,8 +32,8 @@ Linked vertex stage: 14: TypeMatrix 10(fvec3) 2 15: TypePointer Function 14 20: TypeMatrix 7(fvec2) 3 - 21: TypePointer UniformConstant 20 - 22(m32): 21(ptr) Variable UniformConstant + 21: TypePointer Output 20 + 22(m32): 21(ptr) Variable Output 26: TypeVector 6(float) 4 27: TypePointer Output 26(fvec4) 28(gl_Position): 27(ptr) Variable Output @@ -90,10 +83,6 @@ Linked vertex stage: 87: 6(float) Constant 1090519040 88: 7(fvec2) ConstantComposite 86 87 89: 79 ConstantComposite 82 84 85 88 - 90: TypeInt 32 1 - 91: TypePointer Input 90(int) - 92(gl_VertexID): 91(ptr) Variable Input -93(gl_InstanceID): 91(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(a): 8(ptr) Variable Function diff --git a/Test/baseResults/spv.precision.frag.out b/Test/baseResults/spv.precision.frag.out index f454b8570c58f55e2303f59c3fb81216301b11be..33e4fb204ad7d29dabd3ad2c0b92d29ac8544464 100755 --- a/Test/baseResults/spv.precision.frag.out +++ b/Test/baseResults/spv.precision.frag.out @@ -13,7 +13,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 23 59 61 73 116 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source ESSL 310 Name 4 "main" Name 12 "foo(vf3;" @@ -106,10 +106,10 @@ Linked fragment stage: 31: 15(bvec2) ConstantComposite 29 30 36: TypeInt 32 1 37: TypePointer Function 36(int) - 39: TypePointer UniformConstant 36(int) -40(uniform_medium): 39(ptr) Variable UniformConstant -42(uniform_high): 39(ptr) Variable UniformConstant - 48(uniform_low): 39(ptr) Variable UniformConstant + 39: TypePointer Private 36(int) +40(uniform_medium): 39(ptr) Variable Private +42(uniform_high): 39(ptr) Variable Private + 48(uniform_low): 39(ptr) Variable Private 52: TypePointer Function 6(float) 54: 6(float) Constant 1078774989 56: 6(float) Constant 1232730691 @@ -125,8 +125,8 @@ Linked fragment stage: 84: TypeVector 36(int) 2 92: TypeInt 32 0 93: 92(int) Constant 0 - 103: TypePointer UniformConstant 15(bvec2) - 104(ub2): 103(ptr) Variable UniformConstant + 103: TypePointer Private 15(bvec2) + 104(ub2): 103(ptr) Variable Private 111: 6(float) Constant 1065353216 114(S): TypeStruct 6(float) 6(float) 115: TypePointer Input 114(S) diff --git a/Test/baseResults/spv.prepost.frag.out b/Test/baseResults/spv.prepost.frag.out index ee77a099643ba2c9af6a70e8f6b0c49ef4952b4f..9581267ba71c2416c3d63e59ba37961918617729 100755 --- a/Test/baseResults/spv.prepost.frag.out +++ b/Test/baseResults/spv.prepost.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 90 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "index" diff --git a/Test/baseResults/spv.pushConstant.vert.out b/Test/baseResults/spv.pushConstant.vert.out new file mode 100644 index 0000000000000000000000000000000000000000..aff99ae9767b6546f276323a807c8e71feea690f --- /dev/null +++ b/Test/baseResults/spv.pushConstant.vert.out @@ -0,0 +1,68 @@ +spv.pushConstant.vert +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 24 + Source GLSL 400 + Name 4 "main" + Name 11 "Material" + MemberName 11(Material) 0 "kind" + MemberName 11(Material) 1 "fa" + Name 13 "matInst" + Name 24 "color" + Decorate 10 ArrayStride 4 + MemberDecorate 11(Material) 0 Offset 0 + MemberDecorate 11(Material) 1 Offset 4 + Decorate 11(Material) Block + Decorate 13(matInst) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(float) 9 + 11(Material): TypeStruct 6(int) 10 + 12: TypePointer PushConstant 11(Material) + 13(matInst): 12(ptr) Variable PushConstant + 14: 6(int) Constant 0 + 15: TypePointer PushConstant 6(int) + 22: TypeVector 7(float) 4 + 23: TypePointer Output 22(fvec4) + 24(color): 23(ptr) Variable Output + 25: 7(float) Constant 1045220557 + 26: 22(fvec4) ConstantComposite 25 25 25 25 + 28: 7(float) Constant 1056964608 + 29: 22(fvec4) ConstantComposite 28 28 28 28 + 31: 7(float) Constant 0 + 32: 22(fvec4) ConstantComposite 31 31 31 31 + 4(main): 2 Function None 3 + 5: Label + 16: 15(ptr) AccessChain 13(matInst) 14 + 17: 6(int) Load 16 + SelectionMerge 21 None + Switch 17 20 + case 1: 18 + case 2: 19 + 20: Label + Store 24(color) 32 + Branch 21 + 18: Label + Store 24(color) 26 + Branch 21 + 19: Label + Store 24(color) 29 + Branch 21 + 21: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.qualifiers.vert.out b/Test/baseResults/spv.qualifiers.vert.out index b8f6085528b2433481588902e1960535ea088711..bedd6912489204ac62a921780c2dc238895c51c3 100755 --- a/Test/baseResults/spv.qualifiers.vert.out +++ b/Test/baseResults/spv.qualifiers.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 21 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 13 15 17 19 23 24 + EntryPoint Vertex 4 "main" 9 11 13 15 17 19 Source GLSL 430 Name 4 "main" Name 9 "outVc" @@ -21,13 +21,9 @@ Linked vertex stage: Name 15 "outVf" Name 17 "outVn" Name 19 "outVcn" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" Decorate 15(outVf) Flat Decorate 17(outVn) NoPerspective Decorate 19(outVcn) NoPerspective - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -40,10 +36,6 @@ Linked vertex stage: 15(outVf): 8(ptr) Variable Output 17(outVn): 8(ptr) Variable Output 19(outVcn): 8(ptr) Variable Output - 21: TypeInt 32 1 - 22: TypePointer Input 21(int) - 23(gl_VertexID): 22(ptr) Variable Input -24(gl_InstanceID): 22(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(inV) diff --git a/Test/baseResults/spv.queryL.frag.out b/Test/baseResults/spv.queryL.frag.out index b347ce896779321cf098e1b095082e36abf1584d..6d2b2b97d269ae23f9ac2fa01853efd4d4a7ac08 100755 --- a/Test/baseResults/spv.queryL.frag.out +++ b/Test/baseResults/spv.queryL.frag.out @@ -18,7 +18,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" Name 9 "lod" @@ -46,6 +46,26 @@ Linked fragment stage: Name 195 "usampCubeA" Name 232 "sampBuf" Name 236 "sampRect" + Decorate 13(samp1D) DescriptorSet 0 + Decorate 24(isamp2D) DescriptorSet 0 + Decorate 36(usamp3D) DescriptorSet 0 + Decorate 49(sampCube) DescriptorSet 0 + Decorate 59(isamp1DA) DescriptorSet 0 + Decorate 69(usamp2DA) DescriptorSet 0 + Decorate 79(isampCubeA) DescriptorSet 0 + Decorate 89(samp1Ds) DescriptorSet 0 + Decorate 99(samp2Ds) DescriptorSet 0 + Decorate 109(sampCubes) DescriptorSet 0 + Decorate 119(samp1DAs) DescriptorSet 0 + Decorate 129(samp2DAs) DescriptorSet 0 + Decorate 139(sampCubeAs) DescriptorSet 0 + Decorate 154(usamp2D) DescriptorSet 0 + Decorate 163(isamp3D) DescriptorSet 0 + Decorate 172(isampCube) DescriptorSet 0 + Decorate 186(samp2DA) DescriptorSet 0 + Decorate 195(usampCubeA) DescriptorSet 0 + Decorate 232(sampBuf) DescriptorSet 0 + Decorate 236(sampRect) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.separate.frag.out b/Test/baseResults/spv.separate.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..2a71a019ece0a8597ccdfbb1704ed831197f7e41 --- /dev/null +++ b/Test/baseResults/spv.separate.frag.out @@ -0,0 +1,427 @@ +spv.separate.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 319 + + Capability Shader + Capability SampledRect + Capability Sampled1D + Capability SampledCubeArray + Capability SampledBuffer + Capability ImageMSArray + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 34 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 6 "foo(" + Name 11 "color" + Name 14 "t2d" + Name 18 "s" + Name 31 "t3d" + Name 34 "i" + Name 41 "sA" + Name 58 "tex2D" + Name 64 "texCube" + Name 71 "texCubeArray" + Name 77 "sShadow" + Name 84 "itexCubeArray" + Name 91 "utexCubeArray" + Name 98 "tex1DArray" + Name 106 "itex1DArray" + Name 113 "utex1D" + Name 120 "itex1D" + Name 127 "utex1DArray" + Name 134 "texBuffer" + Name 146 "tex2DArray" + Name 158 "itex2D" + Name 165 "itex3D" + Name 172 "itexCube" + Name 179 "itex2DArray" + Name 186 "utex2D" + Name 193 "utex3D" + Name 200 "utexCube" + Name 207 "utex2DArray" + Name 214 "itex2DRect" + Name 221 "utex2DRect" + Name 228 "itexBuffer" + Name 235 "utexBuffer" + Name 242 "tex2DMS" + Name 249 "itex2DMS" + Name 256 "utex2DMS" + Name 263 "tex2DMSArray" + Name 270 "itex2DMSArray" + Name 277 "utex2DMSArray" + Name 284 "tex1D" + Name 294 "tex3D" + Name 305 "tex2DRect" + Decorate 14(t2d) DescriptorSet 0 + Decorate 18(s) DescriptorSet 0 + Decorate 31(t3d) DescriptorSet 0 + Decorate 34(i) Flat + Decorate 41(sA) DescriptorSet 0 + Decorate 58(tex2D) DescriptorSet 0 + Decorate 64(texCube) DescriptorSet 0 + Decorate 71(texCubeArray) DescriptorSet 0 + Decorate 77(sShadow) DescriptorSet 0 + Decorate 84(itexCubeArray) DescriptorSet 0 + Decorate 91(utexCubeArray) DescriptorSet 0 + Decorate 98(tex1DArray) DescriptorSet 0 + Decorate 106(itex1DArray) DescriptorSet 0 + Decorate 113(utex1D) DescriptorSet 0 + Decorate 120(itex1D) DescriptorSet 0 + Decorate 127(utex1DArray) DescriptorSet 0 + Decorate 134(texBuffer) DescriptorSet 0 + Decorate 146(tex2DArray) DescriptorSet 0 + Decorate 158(itex2D) DescriptorSet 0 + Decorate 165(itex3D) DescriptorSet 0 + Decorate 172(itexCube) DescriptorSet 0 + Decorate 179(itex2DArray) DescriptorSet 0 + Decorate 186(utex2D) DescriptorSet 0 + Decorate 193(utex3D) DescriptorSet 0 + Decorate 200(utexCube) DescriptorSet 0 + Decorate 207(utex2DArray) DescriptorSet 0 + Decorate 214(itex2DRect) DescriptorSet 0 + Decorate 221(utex2DRect) DescriptorSet 0 + Decorate 228(itexBuffer) DescriptorSet 0 + Decorate 235(utexBuffer) DescriptorSet 0 + Decorate 242(tex2DMS) DescriptorSet 0 + Decorate 249(itex2DMS) DescriptorSet 0 + Decorate 256(utex2DMS) DescriptorSet 0 + Decorate 263(tex2DMSArray) DescriptorSet 0 + Decorate 270(itex2DMSArray) DescriptorSet 0 + Decorate 277(utex2DMSArray) DescriptorSet 0 + Decorate 284(tex1D) DescriptorSet 0 + Decorate 294(tex3D) DescriptorSet 0 + Decorate 305(tex2DRect) DescriptorSet 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypePointer Output 9(fvec4) + 11(color): 10(ptr) Variable Output + 12: TypeImage 8(float) 2D sampled format:Unknown + 13: TypePointer UniformConstant 12 + 14(t2d): 13(ptr) Variable UniformConstant + 16: TypeSampler + 17: TypePointer UniformConstant 16 + 18(s): 17(ptr) Variable UniformConstant + 20: TypeSampledImage 12 + 22: TypeVector 8(float) 2 + 23: 8(float) Constant 1056964608 + 24: 22(fvec2) ConstantComposite 23 23 + 26: TypeImage 8(float) 3D sampled format:Unknown + 27: TypeInt 32 0 + 28: 27(int) Constant 4 + 29: TypeArray 26 28 + 30: TypePointer UniformConstant 29 + 31(t3d): 30(ptr) Variable UniformConstant + 32: TypeInt 32 1 + 33: TypePointer Input 32(int) + 34(i): 33(ptr) Variable Input + 36: TypePointer UniformConstant 26 + 39: TypeArray 16 28 + 40: TypePointer UniformConstant 39 + 41(sA): 40(ptr) Variable UniformConstant + 42: 32(int) Constant 2 + 45: TypeSampledImage 26 + 47: TypeVector 8(float) 3 + 48: 47(fvec3) ConstantComposite 23 23 23 + 58(tex2D): 13(ptr) Variable UniformConstant + 62: TypeImage 8(float) Cube sampled format:Unknown + 63: TypePointer UniformConstant 62 + 64(texCube): 63(ptr) Variable UniformConstant + 67: TypeSampledImage 62 + 69: TypeImage 8(float) Cube array sampled format:Unknown + 70: TypePointer UniformConstant 69 +71(texCubeArray): 70(ptr) Variable UniformConstant + 74: TypeSampledImage 69 + 77(sShadow): 17(ptr) Variable UniformConstant + 79: TypeImage 8(float) Cube depth array sampled format:Unknown + 80: TypeSampledImage 79 + 82: TypeImage 32(int) Cube array sampled format:Unknown + 83: TypePointer UniformConstant 82 +84(itexCubeArray): 83(ptr) Variable UniformConstant + 87: TypeSampledImage 82 + 89: TypeImage 27(int) Cube array sampled format:Unknown + 90: TypePointer UniformConstant 89 +91(utexCubeArray): 90(ptr) Variable UniformConstant + 94: TypeSampledImage 89 + 96: TypeImage 8(float) 1D array sampled format:Unknown + 97: TypePointer UniformConstant 96 + 98(tex1DArray): 97(ptr) Variable UniformConstant + 101: TypeImage 8(float) 1D depth array sampled format:Unknown + 102: TypeSampledImage 101 + 104: TypeImage 32(int) 1D array sampled format:Unknown + 105: TypePointer UniformConstant 104 +106(itex1DArray): 105(ptr) Variable UniformConstant + 109: TypeSampledImage 104 + 111: TypeImage 27(int) 1D sampled format:Unknown + 112: TypePointer UniformConstant 111 + 113(utex1D): 112(ptr) Variable UniformConstant + 116: TypeSampledImage 111 + 118: TypeImage 32(int) 1D sampled format:Unknown + 119: TypePointer UniformConstant 118 + 120(itex1D): 119(ptr) Variable UniformConstant + 123: TypeSampledImage 118 + 125: TypeImage 27(int) 1D array sampled format:Unknown + 126: TypePointer UniformConstant 125 +127(utex1DArray): 126(ptr) Variable UniformConstant + 130: TypeSampledImage 125 + 132: TypeImage 8(float) Buffer sampled format:Unknown + 133: TypePointer UniformConstant 132 + 134(texBuffer): 133(ptr) Variable UniformConstant + 137: TypeSampledImage 132 + 141: TypeImage 8(float) Cube depth sampled format:Unknown + 142: TypeSampledImage 141 + 144: TypeImage 8(float) 2D array sampled format:Unknown + 145: TypePointer UniformConstant 144 + 146(tex2DArray): 145(ptr) Variable UniformConstant + 149: TypeSampledImage 144 + 153: TypeImage 8(float) 2D depth array sampled format:Unknown + 154: TypeSampledImage 153 + 156: TypeImage 32(int) 2D sampled format:Unknown + 157: TypePointer UniformConstant 156 + 158(itex2D): 157(ptr) Variable UniformConstant + 161: TypeSampledImage 156 + 163: TypeImage 32(int) 3D sampled format:Unknown + 164: TypePointer UniformConstant 163 + 165(itex3D): 164(ptr) Variable UniformConstant + 168: TypeSampledImage 163 + 170: TypeImage 32(int) Cube sampled format:Unknown + 171: TypePointer UniformConstant 170 + 172(itexCube): 171(ptr) Variable UniformConstant + 175: TypeSampledImage 170 + 177: TypeImage 32(int) 2D array sampled format:Unknown + 178: TypePointer UniformConstant 177 +179(itex2DArray): 178(ptr) Variable UniformConstant + 182: TypeSampledImage 177 + 184: TypeImage 27(int) 2D sampled format:Unknown + 185: TypePointer UniformConstant 184 + 186(utex2D): 185(ptr) Variable UniformConstant + 189: TypeSampledImage 184 + 191: TypeImage 27(int) 3D sampled format:Unknown + 192: TypePointer UniformConstant 191 + 193(utex3D): 192(ptr) Variable UniformConstant + 196: TypeSampledImage 191 + 198: TypeImage 27(int) Cube sampled format:Unknown + 199: TypePointer UniformConstant 198 + 200(utexCube): 199(ptr) Variable UniformConstant + 203: TypeSampledImage 198 + 205: TypeImage 27(int) 2D array sampled format:Unknown + 206: TypePointer UniformConstant 205 +207(utex2DArray): 206(ptr) Variable UniformConstant + 210: TypeSampledImage 205 + 212: TypeImage 32(int) Rect sampled format:Unknown + 213: TypePointer UniformConstant 212 + 214(itex2DRect): 213(ptr) Variable UniformConstant + 217: TypeSampledImage 212 + 219: TypeImage 27(int) Rect sampled format:Unknown + 220: TypePointer UniformConstant 219 + 221(utex2DRect): 220(ptr) Variable UniformConstant + 224: TypeSampledImage 219 + 226: TypeImage 32(int) Buffer sampled format:Unknown + 227: TypePointer UniformConstant 226 + 228(itexBuffer): 227(ptr) Variable UniformConstant + 231: TypeSampledImage 226 + 233: TypeImage 27(int) Buffer sampled format:Unknown + 234: TypePointer UniformConstant 233 + 235(utexBuffer): 234(ptr) Variable UniformConstant + 238: TypeSampledImage 233 + 240: TypeImage 8(float) 2D multi-sampled sampled format:Unknown + 241: TypePointer UniformConstant 240 + 242(tex2DMS): 241(ptr) Variable UniformConstant + 245: TypeSampledImage 240 + 247: TypeImage 32(int) 2D multi-sampled sampled format:Unknown + 248: TypePointer UniformConstant 247 + 249(itex2DMS): 248(ptr) Variable UniformConstant + 252: TypeSampledImage 247 + 254: TypeImage 27(int) 2D multi-sampled sampled format:Unknown + 255: TypePointer UniformConstant 254 + 256(utex2DMS): 255(ptr) Variable UniformConstant + 259: TypeSampledImage 254 + 261: TypeImage 8(float) 2D array multi-sampled sampled format:Unknown + 262: TypePointer UniformConstant 261 +263(tex2DMSArray): 262(ptr) Variable UniformConstant + 266: TypeSampledImage 261 + 268: TypeImage 32(int) 2D array multi-sampled sampled format:Unknown + 269: TypePointer UniformConstant 268 +270(itex2DMSArray): 269(ptr) Variable UniformConstant + 273: TypeSampledImage 268 + 275: TypeImage 27(int) 2D array multi-sampled sampled format:Unknown + 276: TypePointer UniformConstant 275 +277(utex2DMSArray): 276(ptr) Variable UniformConstant + 280: TypeSampledImage 275 + 282: TypeImage 8(float) 1D sampled format:Unknown + 283: TypePointer UniformConstant 282 + 284(tex1D): 283(ptr) Variable UniformConstant + 287: TypeSampledImage 282 + 291: TypeImage 8(float) 1D depth sampled format:Unknown + 292: TypeSampledImage 291 + 294(tex3D): 36(ptr) Variable UniformConstant + 300: TypeImage 8(float) 2D depth sampled format:Unknown + 301: TypeSampledImage 300 + 303: TypeImage 8(float) Rect sampled format:Unknown + 304: TypePointer UniformConstant 303 + 305(tex2DRect): 304(ptr) Variable UniformConstant + 308: TypeSampledImage 303 + 312: TypeImage 8(float) Rect depth sampled format:Unknown + 313: TypeSampledImage 312 + 317: TypeSampledImage 96 + 4(main): 2 Function None 3 + 5: Label + 15: 12 Load 14(t2d) + 19: 16 Load 18(s) + 21: 20 SampledImage 15 19 + 25: 9(fvec4) ImageSampleImplicitLod 21 24 + Store 11(color) 25 + 35: 32(int) Load 34(i) + 37: 36(ptr) AccessChain 31(t3d) 35 + 38: 26 Load 37 + 43: 17(ptr) AccessChain 41(sA) 42 + 44: 16 Load 43 + 46: 45 SampledImage 38 44 + 49: 9(fvec4) ImageSampleImplicitLod 46 48 + 50: 9(fvec4) Load 11(color) + 51: 9(fvec4) FAdd 50 49 + Store 11(color) 51 + 52: 12 Load 14(t2d) + 53: 16 Load 18(s) + 54: 20 SampledImage 52 53 + 55: 9(fvec4) ImageSampleImplicitLod 54 24 + 56: 9(fvec4) Load 11(color) + 57: 9(fvec4) FAdd 56 55 + Store 11(color) 57 + Return + FunctionEnd + 6(foo(): 2 Function None 3 + 7: Label + 59: 12 Load 58(tex2D) + 60: 16 Load 18(s) + 61: 20 SampledImage 59 60 + 65: 62 Load 64(texCube) + 66: 16 Load 18(s) + 68: 67 SampledImage 65 66 + 72: 69 Load 71(texCubeArray) + 73: 16 Load 18(s) + 75: 74 SampledImage 72 73 + 76: 69 Load 71(texCubeArray) + 78: 16 Load 77(sShadow) + 81: 80 SampledImage 76 78 + 85: 82 Load 84(itexCubeArray) + 86: 16 Load 18(s) + 88: 87 SampledImage 85 86 + 92: 89 Load 91(utexCubeArray) + 93: 16 Load 18(s) + 95: 94 SampledImage 92 93 + 99: 96 Load 98(tex1DArray) + 100: 16 Load 77(sShadow) + 103: 102 SampledImage 99 100 + 107: 104 Load 106(itex1DArray) + 108: 16 Load 18(s) + 110: 109 SampledImage 107 108 + 114: 111 Load 113(utex1D) + 115: 16 Load 18(s) + 117: 116 SampledImage 114 115 + 121: 118 Load 120(itex1D) + 122: 16 Load 18(s) + 124: 123 SampledImage 121 122 + 128: 125 Load 127(utex1DArray) + 129: 16 Load 18(s) + 131: 130 SampledImage 128 129 + 135: 132 Load 134(texBuffer) + 136: 16 Load 18(s) + 138: 137 SampledImage 135 136 + 139: 62 Load 64(texCube) + 140: 16 Load 77(sShadow) + 143: 142 SampledImage 139 140 + 147: 144 Load 146(tex2DArray) + 148: 16 Load 18(s) + 150: 149 SampledImage 147 148 + 151: 144 Load 146(tex2DArray) + 152: 16 Load 77(sShadow) + 155: 154 SampledImage 151 152 + 159: 156 Load 158(itex2D) + 160: 16 Load 18(s) + 162: 161 SampledImage 159 160 + 166: 163 Load 165(itex3D) + 167: 16 Load 18(s) + 169: 168 SampledImage 166 167 + 173: 170 Load 172(itexCube) + 174: 16 Load 18(s) + 176: 175 SampledImage 173 174 + 180: 177 Load 179(itex2DArray) + 181: 16 Load 18(s) + 183: 182 SampledImage 180 181 + 187: 184 Load 186(utex2D) + 188: 16 Load 18(s) + 190: 189 SampledImage 187 188 + 194: 191 Load 193(utex3D) + 195: 16 Load 18(s) + 197: 196 SampledImage 194 195 + 201: 198 Load 200(utexCube) + 202: 16 Load 18(s) + 204: 203 SampledImage 201 202 + 208: 205 Load 207(utex2DArray) + 209: 16 Load 18(s) + 211: 210 SampledImage 208 209 + 215: 212 Load 214(itex2DRect) + 216: 16 Load 18(s) + 218: 217 SampledImage 215 216 + 222: 219 Load 221(utex2DRect) + 223: 16 Load 18(s) + 225: 224 SampledImage 222 223 + 229: 226 Load 228(itexBuffer) + 230: 16 Load 18(s) + 232: 231 SampledImage 229 230 + 236: 233 Load 235(utexBuffer) + 237: 16 Load 18(s) + 239: 238 SampledImage 236 237 + 243: 240 Load 242(tex2DMS) + 244: 16 Load 18(s) + 246: 245 SampledImage 243 244 + 250: 247 Load 249(itex2DMS) + 251: 16 Load 18(s) + 253: 252 SampledImage 250 251 + 257: 254 Load 256(utex2DMS) + 258: 16 Load 18(s) + 260: 259 SampledImage 257 258 + 264: 261 Load 263(tex2DMSArray) + 265: 16 Load 18(s) + 267: 266 SampledImage 264 265 + 271: 268 Load 270(itex2DMSArray) + 272: 16 Load 18(s) + 274: 273 SampledImage 271 272 + 278: 275 Load 277(utex2DMSArray) + 279: 16 Load 18(s) + 281: 280 SampledImage 278 279 + 285: 282 Load 284(tex1D) + 286: 16 Load 18(s) + 288: 287 SampledImage 285 286 + 289: 282 Load 284(tex1D) + 290: 16 Load 77(sShadow) + 293: 292 SampledImage 289 290 + 295: 26 Load 294(tex3D) + 296: 16 Load 18(s) + 297: 45 SampledImage 295 296 + 298: 12 Load 58(tex2D) + 299: 16 Load 77(sShadow) + 302: 301 SampledImage 298 299 + 306: 303 Load 305(tex2DRect) + 307: 16 Load 18(s) + 309: 308 SampledImage 306 307 + 310: 303 Load 305(tex2DRect) + 311: 16 Load 77(sShadow) + 314: 313 SampledImage 310 311 + 315: 96 Load 98(tex1DArray) + 316: 16 Load 18(s) + 318: 317 SampledImage 315 316 + Return + FunctionEnd diff --git a/Test/baseResults/spv.set.vert.out b/Test/baseResults/spv.set.vert.out index 9448bca894d9ba86c03614caebf5cd6b77f4bf3d..72fbaa70dcc7222ef1b55e886b21f0f73e0343a7 100755 --- a/Test/baseResults/spv.set.vert.out +++ b/Test/baseResults/spv.set.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 22 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 23 24 + EntryPoint Vertex 4 "main" 9 Source GLSL 450 Name 4 "main" Name 9 "color" @@ -20,16 +20,12 @@ Linked vertex stage: MemberName 10(setBuf) 0 "color" Name 12 "setBufInst" Name 21 "samp2D" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" - Decorate 10(setBuf) GLSLShared + MemberDecorate 10(setBuf) 0 Offset 0 Decorate 10(setBuf) BufferBlock Decorate 12(setBufInst) DescriptorSet 0 Decorate 12(setBufInst) Binding 8 Decorate 21(samp2D) DescriptorSet 4 Decorate 21(samp2D) Binding 7 - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -46,9 +42,6 @@ Linked vertex stage: 19: TypeSampledImage 18 20: TypePointer UniformConstant 19 21(samp2D): 20(ptr) Variable UniformConstant - 22: TypePointer Input 13(int) - 23(gl_VertexID): 22(ptr) Variable Input -24(gl_InstanceID): 22(ptr) Variable Input 4(main): 2 Function None 3 5: Label 16: 15(ptr) AccessChain 12(setBufInst) 14 diff --git a/Test/baseResults/spv.shiftOps.frag.out b/Test/baseResults/spv.shiftOps.frag.out index 891d68994983760b5bd3b45e007875a86066eaed..39e40ece73746802ee8220b12f9f470614263da8 100644 --- a/Test/baseResults/spv.shiftOps.frag.out +++ b/Test/baseResults/spv.shiftOps.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 9 25 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 9 11 15 25 27 30 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" Name 9 "icolor" @@ -22,25 +22,29 @@ Linked fragment stage: Name 25 "ucolor" Name 27 "u3" Name 30 "i1" + Decorate 11(i3) Flat + Decorate 15(u1) Flat + Decorate 27(u3) Flat + Decorate 30(i1) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypeVector 6(int) 3 8: TypePointer Output 7(ivec3) 9(icolor): 8(ptr) Variable Output - 10: TypePointer UniformConstant 7(ivec3) - 11(i3): 10(ptr) Variable UniformConstant + 10: TypePointer Input 7(ivec3) + 11(i3): 10(ptr) Variable Input 13: TypeInt 32 0 - 14: TypePointer UniformConstant 13(int) - 15(u1): 14(ptr) Variable UniformConstant + 14: TypePointer Input 13(int) + 15(u1): 14(ptr) Variable Input 17: TypeVector 13(int) 3 20: 13(int) Constant 4 24: TypePointer Output 17(ivec3) 25(ucolor): 24(ptr) Variable Output - 26: TypePointer UniformConstant 17(ivec3) - 27(u3): 26(ptr) Variable UniformConstant - 29: TypePointer UniformConstant 6(int) - 30(i1): 29(ptr) Variable UniformConstant + 26: TypePointer Input 17(ivec3) + 27(u3): 26(ptr) Variable Input + 29: TypePointer Input 6(int) + 30(i1): 29(ptr) Variable Input 34: 6(int) Constant 5 4(main): 2 Function None 3 5: Label diff --git a/Test/baseResults/spv.shortCircuit.frag.out b/Test/baseResults/spv.shortCircuit.frag.out index 008f97054ecd57b13113f7d917934220ab570a3b..5b39b1cba56653312f5f371c322616742f1fd528 100644 --- a/Test/baseResults/spv.shortCircuit.frag.out +++ b/Test/baseResults/spv.shortCircuit.frag.out @@ -7,26 +7,28 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 144 +// Id's are bound by 147 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 24 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 12 24 34 113 140 142 + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 8 "foo(" Name 12 "of1" Name 24 "of4" Name 27 "ub" - Name 31 "ui" - Name 41 "uba" - Name 110 "uf" - Name 137 "uiv4" - Name 139 "uv4" - Name 142 "ub41" - Name 143 "ub42" + Name 34 "ui" + Name 44 "uba" + Name 113 "uf" + Name 140 "uiv4" + Name 142 "uv4" + Name 145 "ub41" + Name 146 "ub42" + Decorate 34(ui) Flat + Decorate 140(uiv4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeBool @@ -41,185 +43,191 @@ Linked fragment stage: 23: TypePointer Output 22(fvec4) 24(of4): 23(ptr) Variable Output 25: 22(fvec4) ConstantComposite 21 21 21 21 - 26: TypePointer UniformConstant 6(bool) - 27(ub): 26(ptr) Variable UniformConstant - 29: TypeInt 32 1 - 30: TypePointer UniformConstant 29(int) - 31(ui): 30(ptr) Variable UniformConstant - 33: 29(int) Constant 2 - 41(uba): 26(ptr) Variable UniformConstant - 109: TypePointer UniformConstant 10(float) - 110(uf): 109(ptr) Variable UniformConstant - 113: 10(float) Constant 1082130432 - 135: TypeVector 29(int) 4 - 136: TypePointer UniformConstant 135(ivec4) - 137(uiv4): 136(ptr) Variable UniformConstant - 138: TypePointer UniformConstant 22(fvec4) - 139(uv4): 138(ptr) Variable UniformConstant - 140: TypeVector 6(bool) 4 - 141: TypePointer UniformConstant 140(bvec4) - 142(ub41): 141(ptr) Variable UniformConstant - 143(ub42): 141(ptr) Variable UniformConstant + 26: TypePointer Private 6(bool) + 27(ub): 26(ptr) Variable Private + 32: TypeInt 32 1 + 33: TypePointer Input 32(int) + 34(ui): 33(ptr) Variable Input + 36: 32(int) Constant 2 + 44(uba): 26(ptr) Variable Private + 112: TypePointer Input 10(float) + 113(uf): 112(ptr) Variable Input + 116: 10(float) Constant 1082130432 + 138: TypeVector 32(int) 4 + 139: TypePointer Input 138(ivec4) + 140(uiv4): 139(ptr) Variable Input + 141: TypePointer Input 22(fvec4) + 142(uv4): 141(ptr) Variable Input + 143: TypeVector 6(bool) 4 + 144: TypePointer Private 143(bvec4) + 145(ub41): 144(ptr) Variable Private + 146(ub42): 144(ptr) Variable Private 4(main): 2 Function None 3 5: Label Store 12(of1) 21 Store 24(of4) 25 28: 6(bool) Load 27(ub) - 32: 29(int) Load 31(ui) - 34: 6(bool) SGreaterThan 32 33 - 35: 6(bool) LogicalOr 28 34 - SelectionMerge 37 None - BranchConditional 35 36 37 - 36: Label - 38: 10(float) Load 12(of1) - 39: 10(float) FAdd 38 14 - Store 12(of1) 39 - Branch 37 - 37: Label - 40: 6(bool) Load 27(ub) - 42: 6(bool) Load 41(uba) - 43: 6(bool) LogicalNot 42 - 44: 6(bool) LogicalAnd 40 43 - SelectionMerge 46 None - BranchConditional 44 45 46 - 45: Label - 47: 10(float) Load 12(of1) - 48: 10(float) FAdd 47 14 - Store 12(of1) 48 - Branch 46 - 46: Label - 49: 6(bool) Load 27(ub) - 50: 6(bool) LogicalNot 49 - SelectionMerge 52 None - BranchConditional 50 51 52 - 51: Label - 53: 6(bool) FunctionCall 8(foo() - Branch 52 - 52: Label - 54: 6(bool) Phi 49 46 53 51 - SelectionMerge 56 None - BranchConditional 54 55 56 - 55: Label - 57: 10(float) Load 12(of1) - 58: 10(float) FAdd 57 14 - Store 12(of1) 58 - Branch 56 - 56: Label - 59: 6(bool) Load 27(ub) - SelectionMerge 61 None - BranchConditional 59 60 61 - 60: Label - 62: 6(bool) FunctionCall 8(foo() - Branch 61 - 61: Label - 63: 6(bool) Phi 59 56 62 60 - SelectionMerge 65 None - BranchConditional 63 64 65 - 64: Label - 66: 10(float) Load 12(of1) - 67: 10(float) FAdd 66 14 - Store 12(of1) 67 - Branch 65 - 65: Label - 68: 6(bool) FunctionCall 8(foo() - 69: 6(bool) Load 27(ub) - 70: 6(bool) LogicalOr 68 69 - SelectionMerge 72 None - BranchConditional 70 71 72 - 71: Label - 73: 10(float) Load 12(of1) - 74: 10(float) FAdd 73 14 - Store 12(of1) 74 - Branch 72 - 72: Label - 75: 6(bool) FunctionCall 8(foo() - 76: 6(bool) Load 27(ub) - 77: 6(bool) LogicalAnd 75 76 - SelectionMerge 79 None - BranchConditional 77 78 79 - 78: Label - 80: 10(float) Load 12(of1) - 81: 10(float) FAdd 80 14 - Store 12(of1) 81 - Branch 79 - 79: Label - 82: 6(bool) Load 27(ub) - 83: 6(bool) LogicalNot 82 - SelectionMerge 85 None - BranchConditional 83 84 85 - 84: Label - 86: 10(float) Load 12(of1) - 87: 10(float) FAdd 86 14 - Store 12(of1) 87 - 88: 6(bool) FOrdGreaterThan 87 14 - Branch 85 - 85: Label - 89: 6(bool) Phi 82 79 88 84 - SelectionMerge 91 None - BranchConditional 89 90 91 - 90: Label - 92: 22(fvec4) Load 24(of4) - 93: 22(fvec4) CompositeConstruct 14 14 14 14 - 94: 22(fvec4) FAdd 92 93 - Store 24(of4) 94 - Branch 91 - 91: Label - 95: 10(float) Load 12(of1) - 96: 10(float) FAdd 95 14 - Store 12(of1) 96 - 97: 6(bool) FOrdGreaterThan 96 14 - 98: 6(bool) Load 27(ub) - 99: 6(bool) LogicalOr 97 98 - SelectionMerge 101 None - BranchConditional 99 100 101 - 100: Label - 102: 22(fvec4) Load 24(of4) - 103: 22(fvec4) CompositeConstruct 14 14 14 14 - 104: 22(fvec4) FAdd 102 103 - Store 24(of4) 104 - Branch 101 - 101: Label - 105: 6(bool) Load 27(ub) - 106: 6(bool) LogicalNot 105 - SelectionMerge 108 None - BranchConditional 106 107 108 - 107: Label - 111: 10(float) Load 110(uf) - 112: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 111 - 114: 10(float) FMul 112 113 - 115: 10(float) Load 12(of1) - 116: 6(bool) FOrdGreaterThan 114 115 - Branch 108 - 108: Label - 117: 6(bool) Phi 105 101 116 107 - SelectionMerge 119 None - BranchConditional 117 118 119 - 118: Label - 120: 10(float) Load 12(of1) - 121: 10(float) FAdd 120 14 - Store 12(of1) 121 - Branch 119 - 119: Label - 122: 6(bool) Load 27(ub) - SelectionMerge 124 None - BranchConditional 122 123 124 - 123: Label - 125: 10(float) Load 110(uf) - 126: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 125 - 127: 10(float) FMul 126 113 - 128: 10(float) Load 12(of1) - 129: 6(bool) FOrdGreaterThan 127 128 - Branch 124 - 124: Label - 130: 6(bool) Phi 122 119 129 123 - SelectionMerge 132 None - BranchConditional 130 131 132 - 131: Label - 133: 10(float) Load 12(of1) - 134: 10(float) FAdd 133 14 - Store 12(of1) 134 - Branch 132 - 132: Label + 29: 6(bool) LogicalNot 28 + SelectionMerge 31 None + BranchConditional 29 30 31 + 30: Label + 35: 32(int) Load 34(ui) + 37: 6(bool) SGreaterThan 35 36 + Branch 31 + 31: Label + 38: 6(bool) Phi 28 5 37 30 + SelectionMerge 40 None + BranchConditional 38 39 40 + 39: Label + 41: 10(float) Load 12(of1) + 42: 10(float) FAdd 41 14 + Store 12(of1) 42 + Branch 40 + 40: Label + 43: 6(bool) Load 27(ub) + 45: 6(bool) Load 44(uba) + 46: 6(bool) LogicalNot 45 + 47: 6(bool) LogicalAnd 43 46 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 10(float) Load 12(of1) + 51: 10(float) FAdd 50 14 + Store 12(of1) 51 + Branch 49 + 49: Label + 52: 6(bool) Load 27(ub) + 53: 6(bool) LogicalNot 52 + SelectionMerge 55 None + BranchConditional 53 54 55 + 54: Label + 56: 6(bool) FunctionCall 8(foo() + Branch 55 + 55: Label + 57: 6(bool) Phi 52 49 56 54 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 60: 10(float) Load 12(of1) + 61: 10(float) FAdd 60 14 + Store 12(of1) 61 + Branch 59 + 59: Label + 62: 6(bool) Load 27(ub) + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + 65: 6(bool) FunctionCall 8(foo() + Branch 64 + 64: Label + 66: 6(bool) Phi 62 59 65 63 + SelectionMerge 68 None + BranchConditional 66 67 68 + 67: Label + 69: 10(float) Load 12(of1) + 70: 10(float) FAdd 69 14 + Store 12(of1) 70 + Branch 68 + 68: Label + 71: 6(bool) FunctionCall 8(foo() + 72: 6(bool) Load 27(ub) + 73: 6(bool) LogicalOr 71 72 + SelectionMerge 75 None + BranchConditional 73 74 75 + 74: Label + 76: 10(float) Load 12(of1) + 77: 10(float) FAdd 76 14 + Store 12(of1) 77 + Branch 75 + 75: Label + 78: 6(bool) FunctionCall 8(foo() + 79: 6(bool) Load 27(ub) + 80: 6(bool) LogicalAnd 78 79 + SelectionMerge 82 None + BranchConditional 80 81 82 + 81: Label + 83: 10(float) Load 12(of1) + 84: 10(float) FAdd 83 14 + Store 12(of1) 84 + Branch 82 + 82: Label + 85: 6(bool) Load 27(ub) + 86: 6(bool) LogicalNot 85 + SelectionMerge 88 None + BranchConditional 86 87 88 + 87: Label + 89: 10(float) Load 12(of1) + 90: 10(float) FAdd 89 14 + Store 12(of1) 90 + 91: 6(bool) FOrdGreaterThan 90 14 + Branch 88 + 88: Label + 92: 6(bool) Phi 85 82 91 87 + SelectionMerge 94 None + BranchConditional 92 93 94 + 93: Label + 95: 22(fvec4) Load 24(of4) + 96: 22(fvec4) CompositeConstruct 14 14 14 14 + 97: 22(fvec4) FAdd 95 96 + Store 24(of4) 97 + Branch 94 + 94: Label + 98: 10(float) Load 12(of1) + 99: 10(float) FAdd 98 14 + Store 12(of1) 99 + 100: 6(bool) FOrdGreaterThan 99 14 + 101: 6(bool) Load 27(ub) + 102: 6(bool) LogicalOr 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 22(fvec4) Load 24(of4) + 106: 22(fvec4) CompositeConstruct 14 14 14 14 + 107: 22(fvec4) FAdd 105 106 + Store 24(of4) 107 + Branch 104 + 104: Label + 108: 6(bool) Load 27(ub) + 109: 6(bool) LogicalNot 108 + SelectionMerge 111 None + BranchConditional 109 110 111 + 110: Label + 114: 10(float) Load 113(uf) + 115: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 114 + 117: 10(float) FMul 115 116 + 118: 10(float) Load 12(of1) + 119: 6(bool) FOrdGreaterThan 117 118 + Branch 111 + 111: Label + 120: 6(bool) Phi 108 104 119 110 + SelectionMerge 122 None + BranchConditional 120 121 122 + 121: Label + 123: 10(float) Load 12(of1) + 124: 10(float) FAdd 123 14 + Store 12(of1) 124 + Branch 122 + 122: Label + 125: 6(bool) Load 27(ub) + SelectionMerge 127 None + BranchConditional 125 126 127 + 126: Label + 128: 10(float) Load 113(uf) + 129: 10(float) ExtInst 1(GLSL.std.450) 13(Sin) 128 + 130: 10(float) FMul 129 116 + 131: 10(float) Load 12(of1) + 132: 6(bool) FOrdGreaterThan 130 131 + Branch 127 + 127: Label + 133: 6(bool) Phi 125 122 132 126 + SelectionMerge 135 None + BranchConditional 133 134 135 + 134: Label + 136: 10(float) Load 12(of1) + 137: 10(float) FAdd 136 14 + Store 12(of1) 137 + Branch 135 + 135: Label Return FunctionEnd 8(foo(): 6(bool) Function None 7 diff --git a/Test/baseResults/spv.simpleFunctionCall.frag.out b/Test/baseResults/spv.simpleFunctionCall.frag.out index 8018da8e3d0c02252930bee6d699b5779017d006..458a90dbac18ae4e7fc3eff13913463c7473c0ee 100755 --- a/Test/baseResults/spv.simpleFunctionCall.frag.out +++ b/Test/baseResults/spv.simpleFunctionCall.frag.out @@ -5,20 +5,18 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 23 +// Id's are bound by 19 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 12 17 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 150 Name 4 "main" Name 9 "foo(" Name 12 "BaseColor" Name 17 "gl_FragColor" - Name 20 "bigColor" - Name 22 "d" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -28,10 +26,6 @@ Linked fragment stage: 12(BaseColor): 11(ptr) Variable Input 16: TypePointer Output 7(fvec4) 17(gl_FragColor): 16(ptr) Variable Output - 19: TypePointer UniformConstant 7(fvec4) - 20(bigColor): 19(ptr) Variable UniformConstant - 21: TypePointer UniformConstant 6(float) - 22(d): 21(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 18: 7(fvec4) FunctionCall 9(foo() diff --git a/Test/baseResults/spv.simpleMat.vert.out b/Test/baseResults/spv.simpleMat.vert.out index 042aa9d9d4f52a7f2d681b3d07d7b4d2f99f37d0..3e0f05e19c6b1e6d0d5330d1ba1a8f12774f047a 100755 --- a/Test/baseResults/spv.simpleMat.vert.out +++ b/Test/baseResults/spv.simpleMat.vert.out @@ -1,16 +1,18 @@ spv.simpleMat.vert +WARNING: 0:3: varying deprecated in version 130; may be removed in future release + Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 42 +// Id's are bound by 39 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 15 19 23 34 40 41 + EntryPoint Vertex 4 "main" 9 12 15 19 23 34 Source GLSL 330 Name 4 "main" Name 9 "glPos" @@ -19,10 +21,6 @@ Linked vertex stage: Name 19 "f" Name 23 "am3" Name 34 "arraym" - Name 40 "gl_VertexID" - Name 41 "gl_InstanceID" - Decorate 40(gl_VertexID) BuiltIn VertexId - Decorate 41(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -30,8 +28,8 @@ Linked vertex stage: 8: TypePointer Output 7(fvec4) 9(glPos): 8(ptr) Variable Output 10: TypeMatrix 7(fvec4) 4 - 11: TypePointer UniformConstant 10 - 12(mvp): 11(ptr) Variable UniformConstant + 11: TypePointer Output 10 + 12(mvp): 11(ptr) Variable Output 14: TypePointer Input 7(fvec4) 15(v): 14(ptr) Variable Input 18: TypePointer Output 6(float) @@ -50,9 +48,6 @@ Linked vertex stage: 33: TypePointer Input 32 34(arraym): 33(ptr) Variable Input 35: 24(int) Constant 1 - 39: TypePointer Input 24(int) - 40(gl_VertexID): 39(ptr) Variable Input -41(gl_InstanceID): 39(ptr) Variable Input 4(main): 2 Function None 3 5: Label 13: 10 Load 12(mvp) diff --git a/Test/baseResults/spv.sparseTexture.frag.out b/Test/baseResults/spv.sparseTexture.frag.out index 04e8e92da4cbd030079cbcadb7e2cdff83715209..8b794a457c50e56b8d41b1698ef6216b07280184 100644 --- a/Test/baseResults/spv.sparseTexture.frag.out +++ b/Test/baseResults/spv.sparseTexture.frag.out @@ -15,8 +15,8 @@ Linked fragment stage: Capability SampledCubeArray 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 384 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 33 48 89 360 384 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_ARB_sparse_texture2" Name 4 "main" @@ -45,6 +45,19 @@ Linked fragment stage: Name 289 "s2DRectShadow" Name 360 "offsets" Name 384 "outColor" + Decorate 29(s2D) DescriptorSet 0 + Decorate 44(s3D) DescriptorSet 0 + Decorate 59(isCube) DescriptorSet 0 + Decorate 71(s2DShadow) DescriptorSet 0 + Decorate 86(sCubeArrayShadow) DescriptorSet 0 + Decorate 108(usCubeArray) DescriptorSet 0 + Decorate 140(us2DRect) DescriptorSet 0 + Decorate 154(s2DArrayShadow) DescriptorSet 0 + Decorate 186(s2DMS) DescriptorSet 0 + Decorate 223(is2DArray) DescriptorSet 0 + Decorate 256(sCubeShadow) DescriptorSet 0 + Decorate 289(s2DRectShadow) DescriptorSet 0 + Decorate 360(offsets) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -68,16 +81,16 @@ Linked fragment stage: 28: TypePointer UniformConstant 27 29(s2D): 28(ptr) Variable UniformConstant 31: TypeVector 10(float) 2 - 32: TypePointer UniformConstant 31(fvec2) - 33(c2): 32(ptr) Variable UniformConstant + 32: TypePointer Input 31(fvec2) + 33(c2): 32(ptr) Variable Input 35(ResType): TypeStruct 6(int) 11(fvec4) 41: TypeImage 10(float) 3D sampled format:Unknown 42: TypeSampledImage 41 43: TypePointer UniformConstant 42 44(s3D): 43(ptr) Variable UniformConstant 46: TypeVector 10(float) 3 - 47: TypePointer UniformConstant 46(fvec3) - 48(c3): 47(ptr) Variable UniformConstant + 47: TypePointer Input 46(fvec3) + 48(c3): 47(ptr) Variable Input 50: 10(float) Constant 1073741824 56: TypeImage 6(int) Cube sampled format:Unknown 57: TypeSampledImage 56 @@ -94,8 +107,8 @@ Linked fragment stage: 84: TypeSampledImage 83 85: TypePointer UniformConstant 84 86(sCubeArrayShadow): 85(ptr) Variable UniformConstant - 88: TypePointer UniformConstant 11(fvec4) - 89(c4): 88(ptr) Variable UniformConstant + 88: TypePointer Input 11(fvec4) + 89(c4): 88(ptr) Variable Input 91: 10(float) Constant 1065353216 105: TypeImage 20(int) Cube array sampled format:Unknown 106: TypeSampledImage 105 @@ -147,8 +160,8 @@ Linked fragment stage: 335: 143(ivec2) ConstantComposite 190 190 357: 20(int) Constant 4 358: TypeArray 143(ivec2) 357 - 359: TypePointer UniformConstant 358 - 360(offsets): 359(ptr) Variable UniformConstant + 359: TypePointer Input 358 + 360(offsets): 359(ptr) Variable Input 383: TypePointer Output 11(fvec4) 384(outColor): 383(ptr) Variable Output 387: TypeBool diff --git a/Test/baseResults/spv.sparseTextureClamp.frag.out b/Test/baseResults/spv.sparseTextureClamp.frag.out index 6bf60a81d6a7396619751de51ea01196c4e121df..1922ac12548c5774ed088ad33095c571a8c8fd74 100644 --- a/Test/baseResults/spv.sparseTextureClamp.frag.out +++ b/Test/baseResults/spv.sparseTextureClamp.frag.out @@ -16,8 +16,8 @@ Linked fragment stage: Capability SampledCubeArray 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 345 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 33 36 51 95 345 + ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_ARB_sparse_texture_clamp" Name 4 "main" @@ -45,6 +45,17 @@ Linked fragment stage: Name 286 "s2DRectShadow" Name 305 "is2DArray" Name 345 "outColor" + Decorate 29(s2D) DescriptorSet 0 + Decorate 47(s3D) DescriptorSet 0 + Decorate 63(isCube) DescriptorSet 0 + Decorate 76(s2DShadow) DescriptorSet 0 + Decorate 92(sCubeArrayShadow) DescriptorSet 0 + Decorate 154(us2DRect) DescriptorSet 0 + Decorate 170(s2DArrayShadow) DescriptorSet 0 + Decorate 218(sCubeShadow) DescriptorSet 0 + Decorate 235(usCubeArray) DescriptorSet 0 + Decorate 286(s2DRectShadow) DescriptorSet 0 + Decorate 305(is2DArray) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -68,18 +79,18 @@ Linked fragment stage: 28: TypePointer UniformConstant 27 29(s2D): 28(ptr) Variable UniformConstant 31: TypeVector 10(float) 2 - 32: TypePointer UniformConstant 31(fvec2) - 33(c2): 32(ptr) Variable UniformConstant - 35: TypePointer UniformConstant 10(float) - 36(lodClamp): 35(ptr) Variable UniformConstant + 32: TypePointer Input 31(fvec2) + 33(c2): 32(ptr) Variable Input + 35: TypePointer Input 10(float) + 36(lodClamp): 35(ptr) Variable Input 38(ResType): TypeStruct 6(int) 11(fvec4) 44: TypeImage 10(float) 3D sampled format:Unknown 45: TypeSampledImage 44 46: TypePointer UniformConstant 45 47(s3D): 46(ptr) Variable UniformConstant 49: TypeVector 10(float) 3 - 50: TypePointer UniformConstant 49(fvec3) - 51(c3): 50(ptr) Variable UniformConstant + 50: TypePointer Input 49(fvec3) + 51(c3): 50(ptr) Variable Input 54: 10(float) Constant 1073741824 60: TypeImage 6(int) Cube sampled format:Unknown 61: TypeSampledImage 60 @@ -96,8 +107,8 @@ Linked fragment stage: 90: TypeSampledImage 89 91: TypePointer UniformConstant 90 92(sCubeArrayShadow): 91(ptr) Variable UniformConstant - 94: TypePointer UniformConstant 11(fvec4) - 95(c4): 94(ptr) Variable UniformConstant + 94: TypePointer Input 11(fvec4) + 95(c4): 94(ptr) Variable Input 97: 10(float) Constant 1065353216 142: TypeVector 6(int) 3 143: 6(int) Constant 2 diff --git a/Test/baseResults/spv.specConstant.comp.out b/Test/baseResults/spv.specConstant.comp.out new file mode 100644 index 0000000000000000000000000000000000000000..d1c9b0a6db725020b86a94c85dd29faa553bb0f3 --- /dev/null +++ b/Test/baseResults/spv.specConstant.comp.out @@ -0,0 +1,55 @@ +spv.specConstant.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked compute stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 32 32 1 + Source GLSL 450 + Name 4 "main" + Name 7 "bn" + MemberName 7(bn) 0 "a" + Name 9 "bi" + MemberDecorate 7(bn) 0 Offset 0 + Decorate 7(bn) BufferBlock + Decorate 9(bi) DescriptorSet 0 + Decorate 12 SpecId 18 + Decorate 14 SpecId 19 + Decorate 16 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7(bn): TypeStruct 6(int) + 8: TypePointer Uniform 7(bn) + 9(bi): 8(ptr) Variable Uniform + 10: TypeInt 32 1 + 11: 10(int) Constant 0 + 12: 6(int) SpecConstant 32 + 13: 6(int) Constant 32 + 14: 6(int) SpecConstant 1 + 15: TypeVector 6(int) 3 + 16: 15(ivec3) SpecConstantComposite 12 13 14 + 17: 6(int) Constant 0 + 19: 6(int) Constant 1 + 22: 6(int) Constant 2 + 25: TypePointer Uniform 6(int) + 4(main): 2 Function None 3 + 5: Label + 18: 6(int) CompositeExtract 16 0 + 20: 6(int) CompositeExtract 16 1 + 21: 6(int) IMul 18 20 + 23: 6(int) CompositeExtract 16 2 + 24: 6(int) IMul 21 23 + 26: 25(ptr) AccessChain 9(bi) 11 + Store 26 24 + Return + FunctionEnd diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out new file mode 100644 index 0000000000000000000000000000000000000000..862dc19a8388f5220116d245a60e7f51fbfc8f82 --- /dev/null +++ b/Test/baseResults/spv.specConstant.vert.out @@ -0,0 +1,124 @@ +spv.specConstant.vert +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 72 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 17 19 25 50 + Source GLSL 400 + Name 4 "main" + Name 14 "foo(vf4[s1498];" + Name 13 "p" + Name 17 "color" + Name 19 "ucol" + Name 25 "size" + Name 44 "param" + Name 50 "dupUcol" + Decorate 9 SpecId 16 + Decorate 27 SpecId 17 + Decorate 31 SpecId 22 + Decorate 36 SpecId 19 + Decorate 37 SpecId 18 + Decorate 47 SpecId 116 + Decorate 57 SpecId 117 + Decorate 60 SpecId 122 + Decorate 64 SpecId 119 + Decorate 65 SpecId 118 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 1 + 9: 8(int) SpecConstant 5 + 10: TypeArray 7(fvec4) 9 + 11: TypePointer Function 10 + 12: TypeFunction 2 11(ptr) + 16: TypePointer Output 7(fvec4) + 17(color): 16(ptr) Variable Output + 18: TypePointer Input 10 + 19(ucol): 18(ptr) Variable Input + 20: 8(int) Constant 2 + 21: TypePointer Input 7(fvec4) + 24: TypePointer Output 8(int) + 25(size): 24(ptr) Variable Output + 26: TypeBool + 27: 26(bool) SpecConstantTrue + 30: TypeInt 32 0 + 31: 30(int) SpecConstant 2 + 35: TypeFloat 64 + 36: 35(float) SpecConstant 1413754136 1074340347 + 37: 6(float) SpecConstant 1078523331 + 47: 8(int) SpecConstant 12 + 48: TypeArray 7(fvec4) 47 + 49: TypePointer Input 48 + 50(dupUcol): 49(ptr) Variable Input + 57: 26(bool) SpecConstantTrue + 60: 30(int) SpecConstant 2 + 64: 35(float) SpecConstant 1413754136 1074340347 + 65: 6(float) SpecConstant 1078523331 + 4(main): 2 Function None 3 + 5: Label + 44(param): 11(ptr) Variable Function + 22: 21(ptr) AccessChain 19(ucol) 20 + 23: 7(fvec4) Load 22 + Store 17(color) 23 + Store 25(size) 9 + SelectionMerge 29 None + BranchConditional 27 28 29 + 28: Label + 32: 6(float) ConvertUToF 31 + 33: 7(fvec4) Load 17(color) + 34: 7(fvec4) VectorTimesScalar 33 32 + Store 17(color) 34 + Branch 29 + 29: Label + 38: 35(float) FConvert 37 + 39: 35(float) FDiv 36 38 + 40: 6(float) FConvert 39 + 41: 7(fvec4) Load 17(color) + 42: 7(fvec4) CompositeConstruct 40 40 40 40 + 43: 7(fvec4) FAdd 41 42 + Store 17(color) 43 + 45: 10 Load 19(ucol) + Store 44(param) 45 + 46: 2 FunctionCall 14(foo(vf4[s1498];) 44(param) + Return + FunctionEnd +14(foo(vf4[s1498];): 2 Function None 12 + 13(p): 11(ptr) FunctionParameter + 15: Label + 51: 21(ptr) AccessChain 50(dupUcol) 20 + 52: 7(fvec4) Load 51 + 53: 7(fvec4) Load 17(color) + 54: 7(fvec4) FAdd 53 52 + Store 17(color) 54 + 55: 8(int) Load 25(size) + 56: 8(int) IAdd 55 47 + Store 25(size) 56 + SelectionMerge 59 None + BranchConditional 57 58 59 + 58: Label + 61: 6(float) ConvertUToF 60 + 62: 7(fvec4) Load 17(color) + 63: 7(fvec4) VectorTimesScalar 62 61 + Store 17(color) 63 + Branch 59 + 59: Label + 66: 35(float) FConvert 65 + 67: 35(float) FDiv 64 66 + 68: 6(float) FConvert 67 + 69: 7(fvec4) Load 17(color) + 70: 7(fvec4) CompositeConstruct 68 68 68 68 + 71: 7(fvec4) FAdd 69 70 + Store 17(color) 71 + Return + FunctionEnd diff --git a/Test/baseResults/spv.structAssignment.frag.out b/Test/baseResults/spv.structAssignment.frag.out index 8edb4f01f1b57b6e4b4bbe1952b2b55b97421c48..7c28e103c6bcdc5f9fd7026d7006645d03401403 100755 --- a/Test/baseResults/spv.structAssignment.frag.out +++ b/Test/baseResults/spv.structAssignment.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 31 44 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "lunarStruct1" @@ -33,6 +33,7 @@ Linked fragment stage: Name 40 "samp2D" Name 44 "coord" Name 49 "foo" + Decorate 40(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -40,14 +41,14 @@ Linked fragment stage: 8(lunarStruct1): TypeStruct 6(int) 7(float) 9(lunarStruct2): TypeStruct 6(int) 7(float) 8(lunarStruct1) 10(lunarStruct3): TypeStruct 9(lunarStruct2) 6(int) 7(float) 8(lunarStruct1) - 11: TypePointer UniformConstant 10(lunarStruct3) - 12(foo3): 11(ptr) Variable UniformConstant + 11: TypePointer Private 10(lunarStruct3) + 12(foo3): 11(ptr) Variable Private 13: 6(int) Constant 0 - 14: TypePointer UniformConstant 6(int) + 14: TypePointer Private 6(int) 17: TypeBool 21: TypePointer Function 9(lunarStruct2) - 23: TypePointer UniformConstant 9(lunarStruct2) - 27(foo2): 23(ptr) Variable UniformConstant + 23: TypePointer Private 9(lunarStruct2) + 27(foo2): 23(ptr) Variable Private 29: TypeVector 7(float) 4 30: TypePointer Output 29(fvec4) 31(gl_FragColor): 30(ptr) Variable Output @@ -61,8 +62,8 @@ Linked fragment stage: 42: TypeVector 7(float) 2 43: TypePointer Input 42(fvec2) 44(coord): 43(ptr) Variable Input - 48: TypePointer UniformConstant 8(lunarStruct1) - 49(foo): 48(ptr) Variable UniformConstant + 48: TypePointer Private 8(lunarStruct1) + 49(foo): 48(ptr) Variable Private 4(main): 2 Function None 3 5: Label 22(locals2): 21(ptr) Variable Function diff --git a/Test/baseResults/spv.structDeref.frag.out b/Test/baseResults/spv.structDeref.frag.out index ccfda84d1476c12bd2f7adafa7a01adcc9c1ae7c..78ebdc635f1af64e53d66a063481f862813e9255 100755 --- a/Test/baseResults/spv.structDeref.frag.out +++ b/Test/baseResults/spv.structDeref.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 61 99 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "s0" @@ -44,6 +44,7 @@ Linked fragment stage: Name 99 "gl_FragColor" Name 116 "samp2D" Name 122 "foo2" + Decorate 116(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -55,11 +56,11 @@ Linked fragment stage: 12: 11(int) Constant 12 13: TypeArray 10(s2) 12 14(s3): TypeStruct 13 6(int) 7(float) 9(s1) - 15: TypePointer UniformConstant 14(s3) - 16(foo3): 15(ptr) Variable UniformConstant + 15: TypePointer Private 14(s3) + 16(foo3): 15(ptr) Variable Private 17: 6(int) Constant 0 18: 6(int) Constant 9 - 19: TypePointer UniformConstant 6(int) + 19: TypePointer Private 6(int) 22: TypeBool 26: TypePointer Function 10(s2) 28: 6(int) Constant 1 @@ -78,8 +79,8 @@ Linked fragment stage: 44: TypeArray 9(s1) 43 45: TypePointer Function 44 47: 6(int) Constant 6 - 48: TypePointer UniformConstant 9(s1) - 49(foo1): 48(ptr) Variable UniformConstant + 48: TypePointer Private 9(s1) + 49(foo1): 48(ptr) Variable Private 52: TypePointer Function 8(s0) 54(s00): TypeStruct 8(s0) 55: TypePointer Function 54(s00) @@ -90,15 +91,15 @@ Linked fragment stage: 62: 11(int) Constant 0 63: TypePointer Input 7(float) 67: 11(int) Constant 1 - 70: TypePointer UniformConstant 8(s0) - 71(foo0): 70(ptr) Variable UniformConstant + 70: TypePointer Private 8(s0) + 71(foo0): 70(ptr) Variable Private 75: 7(float) Constant 1073741824 76: 7(float) Constant 1077936128 77: 7(float) Constant 1082130432 78: 7(float) Constant 1084227584 79: 38 ConstantComposite 41 29 75 76 77 78 - 85: TypePointer UniformConstant 54(s00) - 86(foo00): 85(ptr) Variable UniformConstant + 85: TypePointer Private 54(s00) + 86(foo00): 85(ptr) Variable Private 88: TypePointer Function 6(int) 91: 6(int) Constant 5 97: TypeVector 7(float) 4 @@ -109,8 +110,8 @@ Linked fragment stage: 114: TypeSampledImage 113 115: TypePointer UniformConstant 114 116(samp2D): 115(ptr) Variable UniformConstant - 121: TypePointer UniformConstant 10(s2) - 122(foo2): 121(ptr) Variable UniformConstant + 121: TypePointer Private 10(s2) + 122(foo2): 121(ptr) Variable Private 4(main): 2 Function None 3 5: Label 27(locals2): 26(ptr) Variable Function diff --git a/Test/baseResults/spv.structure.frag.out b/Test/baseResults/spv.structure.frag.out index 866a7bdf4eee61b87b32c0301f3cbc1f7fe97894..8d91ed043af8b69e4ab3fb94efb97b89679f31e2 100755 --- a/Test/baseResults/spv.structure.frag.out +++ b/Test/baseResults/spv.structure.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 45 54 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "scale" @@ -28,6 +28,7 @@ Linked fragment stage: Name 50 "samp2D" Name 54 "coord" Name 59 "foo" + Decorate 50(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -46,16 +47,16 @@ Linked fragment stage: 20: TypeArray 18(lunarStruct1) 19 21(lunarStruct2): TypeStruct 13 6(float) 20 22: TypeArray 21(lunarStruct2) 12 - 23: TypePointer UniformConstant 22 - 24(foo2): 23(ptr) Variable UniformConstant + 23: TypePointer Private 22 + 24(foo2): 23(ptr) Variable Private 25: 10(int) Constant 3 26: 10(int) Constant 0 27: 10(int) Constant 4 - 28: TypePointer UniformConstant 10(int) + 28: TypePointer Private 10(int) 31: TypeBool 35: 10(int) Constant 2 36: 11(int) Constant 0 - 37: TypePointer UniformConstant 6(float) + 37: TypePointer Private 6(float) 41: 10(int) Constant 1 44: TypePointer Output 16(fvec4) 45(gl_FragColor): 44(ptr) Variable Output @@ -66,8 +67,8 @@ Linked fragment stage: 52: TypeVector 6(float) 2 53: TypePointer Input 52(fvec2) 54(coord): 53(ptr) Variable Input - 58: TypePointer UniformConstant 18(lunarStruct1) - 59(foo): 58(ptr) Variable UniformConstant + 58: TypePointer Private 18(lunarStruct1) + 59(foo): 58(ptr) Variable Private 4(main): 2 Function None 3 5: Label 8(scale): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.subpass.frag.out b/Test/baseResults/spv.subpass.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..6393f6f221e06f08746d232eda1be10f076810a5 --- /dev/null +++ b/Test/baseResults/spv.subpass.frag.out @@ -0,0 +1,123 @@ +spv.subpass.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 70 + + Capability Shader + Capability InputAttachment + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 15 27 54 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 + Name 4 "main" + Name 11 "foo(iIPM1;" + Name 10 "sb" + Name 15 "icolor" + Name 27 "color" + Name 30 "sub" + Name 35 "subMS" + Name 42 "isub" + Name 46 "isubMS" + Name 54 "ucolor" + Name 57 "usub" + Name 62 "usubMS" + Name 67 "param" + Decorate 30(sub) DescriptorSet 0 + Decorate 30(sub) InputAttachmentIndex 1 + Decorate 35(subMS) DescriptorSet 0 + Decorate 35(subMS) InputAttachmentIndex 2 + Decorate 42(isub) DescriptorSet 0 + Decorate 42(isub) InputAttachmentIndex 3 + Decorate 46(isubMS) DescriptorSet 0 + Decorate 46(isubMS) InputAttachmentIndex 4 + Decorate 57(usub) DescriptorSet 0 + Decorate 57(usub) InputAttachmentIndex 5 + Decorate 62(usubMS) DescriptorSet 0 + Decorate 62(usubMS) InputAttachmentIndex 6 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeImage 6(int) SubpassData multi-sampled nonsampled format:Unknown + 8: TypePointer Function 7 + 9: TypeFunction 2 8(ptr) + 13: TypeVector 6(int) 4 + 14: TypePointer Output 13(ivec4) + 15(icolor): 14(ptr) Variable Output + 17: 6(int) Constant 3 + 18: 6(int) Constant 0 + 19: TypeVector 6(int) 2 + 20: 19(ivec2) ConstantComposite 18 18 + 24: TypeFloat 32 + 25: TypeVector 24(float) 4 + 26: TypePointer Output 25(fvec4) + 27(color): 26(ptr) Variable Output + 28: TypeImage 24(float) SubpassData nonsampled format:Unknown + 29: TypePointer UniformConstant 28 + 30(sub): 29(ptr) Variable UniformConstant + 33: TypeImage 24(float) SubpassData multi-sampled nonsampled format:Unknown + 34: TypePointer UniformConstant 33 + 35(subMS): 34(ptr) Variable UniformConstant + 40: TypeImage 6(int) SubpassData nonsampled format:Unknown + 41: TypePointer UniformConstant 40 + 42(isub): 41(ptr) Variable UniformConstant + 45: TypePointer UniformConstant 7 + 46(isubMS): 45(ptr) Variable UniformConstant + 51: TypeInt 32 0 + 52: TypeVector 51(int) 4 + 53: TypePointer Output 52(ivec4) + 54(ucolor): 53(ptr) Variable Output + 55: TypeImage 51(int) SubpassData nonsampled format:Unknown + 56: TypePointer UniformConstant 55 + 57(usub): 56(ptr) Variable UniformConstant + 60: TypeImage 51(int) SubpassData multi-sampled nonsampled format:Unknown + 61: TypePointer UniformConstant 60 + 62(usubMS): 61(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 67(param): 8(ptr) Variable Function + 31: 28 Load 30(sub) + 32: 25(fvec4) ImageRead 31 20 + Store 27(color) 32 + 36: 33 Load 35(subMS) + 37: 25(fvec4) ImageRead 36 20 Sample 17 + 38: 25(fvec4) Load 27(color) + 39: 25(fvec4) FAdd 38 37 + Store 27(color) 39 + 43: 40 Load 42(isub) + 44: 13(ivec4) ImageRead 43 20 + Store 15(icolor) 44 + 47: 7 Load 46(isubMS) + 48: 13(ivec4) ImageRead 47 20 Sample 17 + 49: 13(ivec4) Load 15(icolor) + 50: 13(ivec4) IAdd 49 48 + Store 15(icolor) 50 + 58: 55 Load 57(usub) + 59: 52(ivec4) ImageRead 58 20 + Store 54(ucolor) 59 + 63: 60 Load 62(usubMS) + 64: 52(ivec4) ImageRead 63 20 Sample 17 + 65: 52(ivec4) Load 54(ucolor) + 66: 52(ivec4) IAdd 65 64 + Store 54(ucolor) 66 + 68: 7 Load 46(isubMS) + Store 67(param) 68 + 69: 2 FunctionCall 11(foo(iIPM1;) 67(param) + Return + FunctionEnd + 11(foo(iIPM1;): 2 Function None 9 + 10(sb): 8(ptr) FunctionParameter + 12: Label + 16: 7 Load 10(sb) + 21: 13(ivec4) ImageRead 16 20 Sample 17 + 22: 13(ivec4) Load 15(icolor) + 23: 13(ivec4) IAdd 22 21 + Store 15(icolor) 23 + Return + FunctionEnd diff --git a/Test/baseResults/spv.switch.frag.out b/Test/baseResults/spv.switch.frag.out index f96ec88f9cf79a29717c630b47ed38ee8ea3227b..87ea4c87ea7caf7895026d20b8254eb4fdf30eaf 100755 --- a/Test/baseResults/spv.switch.frag.out +++ b/Test/baseResults/spv.switch.frag.out @@ -15,8 +15,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 75 227 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 62 75 129 227 233 + ExecutionMode 4 OriginUpperLeft Source ESSL 310 Name 4 "main" Name 15 "foo1(vf4;vf4;i1;" @@ -64,6 +64,7 @@ Linked fragment stage: Decorate 55 RelaxedPrecision Decorate 60(local) RelaxedPrecision Decorate 62(c) RelaxedPrecision + Decorate 62(c) Flat Decorate 63 RelaxedPrecision Decorate 64 RelaxedPrecision Decorate 66 RelaxedPrecision @@ -104,6 +105,7 @@ Linked fragment stage: Decorate 126 RelaxedPrecision Decorate 127 RelaxedPrecision Decorate 129(d) RelaxedPrecision + Decorate 129(d) Flat Decorate 130 RelaxedPrecision Decorate 134 RelaxedPrecision Decorate 135 RelaxedPrecision @@ -185,13 +187,13 @@ Linked fragment stage: 37: 7(fvec4) ConstantComposite 36 36 36 36 48: 6(float) Constant 1065353216 49: 7(fvec4) ConstantComposite 48 48 48 48 - 61: TypePointer UniformConstant 9(int) - 62(c): 61(ptr) Variable UniformConstant + 61: TypePointer Input 9(int) + 62(c): 61(ptr) Variable Input 65: 9(int) Constant 1 72: TypePointer Function 6(float) 74: TypePointer Input 6(float) 75(x): 74(ptr) Variable Input - 129(d): 61(ptr) Variable UniformConstant + 129(d): 61(ptr) Variable Input 156: 9(int) Constant 0 163: 9(int) Constant 10 164: TypeBool @@ -201,8 +203,8 @@ Linked fragment stage: 208: 6(float) Constant 1079739679 226: TypePointer Output 6(float) 227(color): 226(ptr) Variable Output - 232: TypePointer UniformConstant 7(fvec4) - 233(v): 232(ptr) Variable UniformConstant + 232: TypePointer Input 7(fvec4) + 233(v): 232(ptr) Variable Input 241: TypeInt 32 0 242: 241(int) Constant 1 253: 241(int) Constant 2 diff --git a/Test/baseResults/spv.swizzle.frag.out b/Test/baseResults/spv.swizzle.frag.out index 82137e270e3010efedc167c603a551e38b34bff9..471fed1128c7d7160aabcb6125d0af1f48f13ac5 100755 --- a/Test/baseResults/spv.swizzle.frag.out +++ b/Test/baseResults/spv.swizzle.frag.out @@ -5,13 +5,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 109 +// Id's are bound by 108 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 30 69 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 14 30 69 107 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "blendscale" @@ -27,7 +27,7 @@ Linked fragment stage: Name 69 "gl_FragColor" Name 81 "c" Name 83 "rep" - Name 108 "blend" + Name 107 "blend" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -35,8 +35,8 @@ Linked fragment stage: 9: 6(float) Constant 1071971828 10: TypeVector 6(float) 4 11: TypePointer Function 10(fvec4) - 13: TypePointer UniformConstant 10(fvec4) - 14(u): 13(ptr) Variable UniformConstant + 13: TypePointer Input 10(fvec4) + 14(u): 13(ptr) Variable Input 25: TypeInt 32 0 26: 25(int) Constant 2 28: TypeVector 6(float) 2 @@ -45,8 +45,8 @@ Linked fragment stage: 35: 25(int) Constant 0 40: 25(int) Constant 1 54: TypeBool - 55: TypePointer UniformConstant 54(bool) - 56(p): 55(ptr) Variable UniformConstant + 55: TypePointer Private 54(bool) + 56(p): 55(ptr) Variable Private 60: TypePointer Input 6(float) 68: TypePointer Output 10(fvec4) 69(gl_FragColor): 68(ptr) Variable Output @@ -56,8 +56,7 @@ Linked fragment stage: 86: 10(fvec4) ConstantComposite 84 84 84 85 92: 6(float) Constant 3212836864 102: 6(float) Constant 1079613850 - 107: TypePointer UniformConstant 6(float) - 108(blend): 107(ptr) Variable UniformConstant + 107(blend): 60(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.test.frag.out b/Test/baseResults/spv.test.frag.out index 5d9d1205a7f3e64ded757ad9ca2975381c193826..8f1c5260bbaf1915cb4088a3877a819c7554ccca 100755 --- a/Test/baseResults/spv.test.frag.out +++ b/Test/baseResults/spv.test.frag.out @@ -7,26 +7,28 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 56 +// Id's are bound by 55 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 20 38 44 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 20 22 37 43 46 49 + ExecutionMode 4 OriginUpperLeft Source GLSL 400 Name 4 "main" Name 8 "blendscale" Name 12 "v" Name 16 "texSampler2D" Name 20 "t" - Name 23 "scale" - Name 30 "w" - Name 34 "texSampler3D" - Name 38 "coords" - Name 44 "gl_FragColor" - Name 47 "u" - Name 50 "blend" + Name 22 "scale" + Name 29 "w" + Name 33 "texSampler3D" + Name 37 "coords" + Name 43 "gl_FragColor" + Name 46 "u" + Name 49 "blend" + Decorate 16(texSampler2D) DescriptorSet 0 + Decorate 33(texSampler3D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -41,49 +43,48 @@ Linked fragment stage: 18: TypeVector 6(float) 2 19: TypePointer Input 18(fvec2) 20(t): 19(ptr) Variable Input - 22: TypePointer UniformConstant 18(fvec2) - 23(scale): 22(ptr) Variable UniformConstant - 31: TypeImage 6(float) 3D sampled format:Unknown - 32: TypeSampledImage 31 - 33: TypePointer UniformConstant 32 -34(texSampler3D): 33(ptr) Variable UniformConstant - 36: TypeVector 6(float) 3 - 37: TypePointer Input 36(fvec3) - 38(coords): 37(ptr) Variable Input - 43: TypePointer Output 10(fvec4) -44(gl_FragColor): 43(ptr) Variable Output - 46: TypePointer UniformConstant 10(fvec4) - 47(u): 46(ptr) Variable UniformConstant - 49: TypePointer UniformConstant 6(float) - 50(blend): 49(ptr) Variable UniformConstant + 22(scale): 19(ptr) Variable Input + 30: TypeImage 6(float) 3D sampled format:Unknown + 31: TypeSampledImage 30 + 32: TypePointer UniformConstant 31 +33(texSampler3D): 32(ptr) Variable UniformConstant + 35: TypeVector 6(float) 3 + 36: TypePointer Input 35(fvec3) + 37(coords): 36(ptr) Variable Input + 42: TypePointer Output 10(fvec4) +43(gl_FragColor): 42(ptr) Variable Output + 45: TypePointer Input 10(fvec4) + 46(u): 45(ptr) Variable Input + 48: TypePointer Input 6(float) + 49(blend): 48(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function 12(v): 11(ptr) Variable Function - 30(w): 11(ptr) Variable Function + 29(w): 11(ptr) Variable Function Store 8(blendscale) 9 17: 14 Load 16(texSampler2D) 21: 18(fvec2) Load 20(t) - 24: 18(fvec2) Load 23(scale) - 25: 18(fvec2) FAdd 21 24 - 26: 18(fvec2) Load 23(scale) - 27: 18(fvec2) FDiv 25 26 - 28: 10(fvec4) ImageSampleImplicitLod 17 27 - 29: 10(fvec4) VectorShuffle 28 28 3 2 1 0 - Store 12(v) 29 - 35: 32 Load 34(texSampler3D) - 39: 36(fvec3) Load 38(coords) - 40: 10(fvec4) ImageSampleImplicitLod 35 39 - 41: 10(fvec4) Load 12(v) - 42: 10(fvec4) FAdd 40 41 - Store 30(w) 42 - 45: 10(fvec4) Load 30(w) - 48: 10(fvec4) Load 47(u) - 51: 6(float) Load 50(blend) - 52: 6(float) Load 8(blendscale) - 53: 6(float) FMul 51 52 - 54: 10(fvec4) CompositeConstruct 53 53 53 53 - 55: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 45 48 54 - Store 44(gl_FragColor) 55 + 23: 18(fvec2) Load 22(scale) + 24: 18(fvec2) FAdd 21 23 + 25: 18(fvec2) Load 22(scale) + 26: 18(fvec2) FDiv 24 25 + 27: 10(fvec4) ImageSampleImplicitLod 17 26 + 28: 10(fvec4) VectorShuffle 27 27 3 2 1 0 + Store 12(v) 28 + 34: 31 Load 33(texSampler3D) + 38: 35(fvec3) Load 37(coords) + 39: 10(fvec4) ImageSampleImplicitLod 34 38 + 40: 10(fvec4) Load 12(v) + 41: 10(fvec4) FAdd 39 40 + Store 29(w) 41 + 44: 10(fvec4) Load 29(w) + 47: 10(fvec4) Load 46(u) + 50: 6(float) Load 49(blend) + 51: 6(float) Load 8(blendscale) + 52: 6(float) FMul 50 51 + 53: 10(fvec4) CompositeConstruct 52 52 52 52 + 54: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 44 47 53 + Store 43(gl_FragColor) 54 Return FunctionEnd diff --git a/Test/baseResults/spv.test.vert.out b/Test/baseResults/spv.test.vert.out index ef7fd98862fb14e2e618dea49837ccb6ebf3a622..697e468d4fdece5ca0e97f9344f0dc09dcda71e4 100755 --- a/Test/baseResults/spv.test.vert.out +++ b/Test/baseResults/spv.test.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 28 +// Id's are bound by 24 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 11 15 21 26 27 + EntryPoint Vertex 4 "main" 9 11 15 18 21 Source GLSL 140 Name 4 "main" Name 9 "uv" @@ -20,11 +20,7 @@ Linked vertex stage: Name 15 "gl_Position" Name 18 "transform" Name 21 "position" - Name 26 "gl_VertexID" - Name 27 "gl_InstanceID" Decorate 15(gl_Position) BuiltIn Position - Decorate 26(gl_VertexID) BuiltIn VertexId - Decorate 27(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -37,14 +33,10 @@ Linked vertex stage: 14: TypePointer Output 13(fvec4) 15(gl_Position): 14(ptr) Variable Output 16: TypeMatrix 13(fvec4) 4 - 17: TypePointer UniformConstant 16 - 18(transform): 17(ptr) Variable UniformConstant + 17: TypePointer Input 16 + 18(transform): 17(ptr) Variable Input 20: TypePointer Input 13(fvec4) 21(position): 20(ptr) Variable Input - 24: TypeInt 32 1 - 25: TypePointer Input 24(int) - 26(gl_VertexID): 25(ptr) Variable Input -27(gl_InstanceID): 25(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec2) Load 11(uv_in) diff --git a/Test/baseResults/spv.texture.frag.out b/Test/baseResults/spv.texture.frag.out index 91a6832ca993f7872db8fb7275b0fe7192238b5e..df5fe2be19bc1e7e2c16e60a568a54eb9c398818 100755 --- a/Test/baseResults/spv.texture.frag.out +++ b/Test/baseResults/spv.texture.frag.out @@ -1,18 +1,22 @@ spv.texture.frag +WARNING: 0:10: varying deprecated in version 130; may be removed in future release +WARNING: 0:11: varying deprecated in version 130; may be removed in future release +WARNING: 0:12: varying deprecated in version 130; may be removed in future release + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 291 +// Id's are bound by 290 Capability Shader Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 47 276 290 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 47 276 279 282 288 289 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "blendscale" @@ -37,8 +41,14 @@ Linked fragment stage: Name 276 "gl_FragColor" Name 279 "u" Name 282 "blend" - Name 289 "scale" - Name 290 "t" + Name 288 "scale" + Name 289 "t" + Decorate 32(texSampler1D) DescriptorSet 0 + Decorate 72(texSampler2D) DescriptorSet 0 + Decorate 98(texSampler3D) DescriptorSet 0 + Decorate 124(texSamplerCube) DescriptorSet 0 + Decorate 139(shadowSampler1D) DescriptorSet 0 + Decorate 158(shadowSampler2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -97,13 +107,12 @@ Linked fragment stage: 251: 205(ivec2) ConstantComposite 249 250 275: TypePointer Output 22(fvec4) 276(gl_FragColor): 275(ptr) Variable Output - 278: TypePointer UniformConstant 22(fvec4) - 279(u): 278(ptr) Variable UniformConstant - 281: TypePointer UniformConstant 6(float) - 282(blend): 281(ptr) Variable UniformConstant - 288: TypePointer UniformConstant 45(fvec2) - 289(scale): 288(ptr) Variable UniformConstant - 290(t): 46(ptr) Variable Input + 278: TypePointer Input 22(fvec4) + 279(u): 278(ptr) Variable Input + 281: TypePointer Input 6(float) + 282(blend): 281(ptr) Variable Input + 288(scale): 46(ptr) Variable Input + 289(t): 46(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.texture.vert.out b/Test/baseResults/spv.texture.vert.out index 23cf7542115bb86f67d84b0bd9a90d539a7e7339..179e567d4da17bb48c5e96e9d261270a1b50a68d 100755 --- a/Test/baseResults/spv.texture.vert.out +++ b/Test/baseResults/spv.texture.vert.out @@ -5,13 +5,13 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 146 +// Id's are bound by 142 Capability Shader Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 39 140 144 145 + EntryPoint Vertex 4 "main" 39 140 Source GLSL 140 Name 4 "main" Name 8 "lod" @@ -27,11 +27,13 @@ Linked vertex stage: Name 102 "shadowSampler1D" Name 114 "shadowSampler2D" Name 140 "gl_Position" - Name 144 "gl_VertexID" - Name 145 "gl_InstanceID" + Decorate 29(texSampler1D) DescriptorSet 0 + Decorate 54(texSampler2D) DescriptorSet 0 + Decorate 76(texSampler3D) DescriptorSet 0 + Decorate 92(texSamplerCube) DescriptorSet 0 + Decorate 102(shadowSampler1D) DescriptorSet 0 + Decorate 114(shadowSampler2D) DescriptorSet 0 Decorate 140(gl_Position) BuiltIn Position - Decorate 144(gl_VertexID) BuiltIn VertexId - Decorate 145(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -78,10 +80,6 @@ Linked vertex stage: 114(shadowSampler2D): 113(ptr) Variable UniformConstant 139: TypePointer Output 18(fvec4) 140(gl_Position): 139(ptr) Variable Output - 142: TypeInt 32 1 - 143: TypePointer Input 142(int) -144(gl_VertexID): 143(ptr) Variable Input -145(gl_InstanceID): 143(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(lod): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.types.frag.out b/Test/baseResults/spv.types.frag.out index 5355a8f0978212a884dc1b9d394676e018fed8df..4295370d385d8561f019194c2dc1bfb6ce767345 100755 --- a/Test/baseResults/spv.types.frag.out +++ b/Test/baseResults/spv.types.frag.out @@ -5,13 +5,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 268 +// Id's are bound by 260 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 94 104 114 124 134 144 154 164 168 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 91 93 100 102 109 111 118 120 127 129 136 138 145 147 154 156 160 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 8 "b" @@ -28,112 +28,108 @@ Linked fragment stage: Name 64 "i_b4" Name 89 "i" Name 91 "u_i" - Name 94 "i_i" - Name 99 "i2" - Name 101 "u_i2" - Name 104 "i_i2" - Name 109 "i3" - Name 111 "u_i3" - Name 114 "i_i3" - Name 119 "i4" - Name 121 "u_i4" - Name 124 "i_i4" - Name 129 "f" - Name 131 "u_f" - Name 134 "i_f" - Name 139 "f2" - Name 141 "u_f2" - Name 144 "i_f2" - Name 149 "f3" - Name 151 "u_f3" - Name 154 "i_f3" - Name 159 "f4" - Name 161 "u_f4" - Name 164 "i_f4" - Name 168 "gl_FragColor" - Decorate 94(i_i) Flat - Decorate 104(i_i2) Flat - Decorate 114(i_i3) Flat - Decorate 124(i_i4) Flat + Name 93 "i_i" + Name 98 "i2" + Name 100 "u_i2" + Name 102 "i_i2" + Name 107 "i3" + Name 109 "u_i3" + Name 111 "i_i3" + Name 116 "i4" + Name 118 "u_i4" + Name 120 "i_i4" + Name 125 "f" + Name 127 "u_f" + Name 129 "i_f" + Name 134 "f2" + Name 136 "u_f2" + Name 138 "i_f2" + Name 143 "f3" + Name 145 "u_f3" + Name 147 "i_f3" + Name 152 "f4" + Name 154 "u_f4" + Name 156 "i_f4" + Name 160 "gl_FragColor" + Decorate 91(u_i) Flat + Decorate 93(i_i) Flat + Decorate 100(u_i2) Flat + Decorate 102(i_i2) Flat + Decorate 109(u_i3) Flat + Decorate 111(i_i3) Flat + Decorate 118(u_i4) Flat + Decorate 120(i_i4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeBool 7: TypePointer Function 6(bool) - 9: TypePointer UniformConstant 6(bool) - 10(u_b): 9(ptr) Variable UniformConstant - 12(i_b): 9(ptr) Variable UniformConstant + 9: TypePointer Private 6(bool) + 10(u_b): 9(ptr) Variable Private + 12(i_b): 9(ptr) Variable Private 15: TypeVector 6(bool) 2 16: TypePointer Function 15(bvec2) - 18: TypePointer UniformConstant 15(bvec2) - 19(u_b2): 18(ptr) Variable UniformConstant - 22(i_b2): 18(ptr) Variable UniformConstant + 18: TypePointer Private 15(bvec2) + 19(u_b2): 18(ptr) Variable Private + 22(i_b2): 18(ptr) Variable Private 33: TypeVector 6(bool) 3 34: TypePointer Function 33(bvec3) - 36: TypePointer UniformConstant 33(bvec3) - 37(u_b3): 36(ptr) Variable UniformConstant - 40(i_b3): 36(ptr) Variable UniformConstant + 36: TypePointer Private 33(bvec3) + 37(u_b3): 36(ptr) Variable Private + 40(i_b3): 36(ptr) Variable Private 57: TypeVector 6(bool) 4 58: TypePointer Function 57(bvec4) - 60: TypePointer UniformConstant 57(bvec4) - 61(u_b4): 60(ptr) Variable UniformConstant - 64(i_b4): 60(ptr) Variable UniformConstant + 60: TypePointer Private 57(bvec4) + 61(u_b4): 60(ptr) Variable Private + 64(i_b4): 60(ptr) Variable Private 87: TypeInt 32 1 88: TypePointer Function 87(int) - 90: TypePointer UniformConstant 87(int) - 91(u_i): 90(ptr) Variable UniformConstant - 93: TypePointer Input 87(int) - 94(i_i): 93(ptr) Variable Input - 97: TypeVector 87(int) 2 - 98: TypePointer Function 97(ivec2) - 100: TypePointer UniformConstant 97(ivec2) - 101(u_i2): 100(ptr) Variable UniformConstant - 103: TypePointer Input 97(ivec2) - 104(i_i2): 103(ptr) Variable Input - 107: TypeVector 87(int) 3 - 108: TypePointer Function 107(ivec3) - 110: TypePointer UniformConstant 107(ivec3) - 111(u_i3): 110(ptr) Variable UniformConstant - 113: TypePointer Input 107(ivec3) - 114(i_i3): 113(ptr) Variable Input - 117: TypeVector 87(int) 4 - 118: TypePointer Function 117(ivec4) - 120: TypePointer UniformConstant 117(ivec4) - 121(u_i4): 120(ptr) Variable UniformConstant - 123: TypePointer Input 117(ivec4) - 124(i_i4): 123(ptr) Variable Input - 127: TypeFloat 32 - 128: TypePointer Function 127(float) - 130: TypePointer UniformConstant 127(float) - 131(u_f): 130(ptr) Variable UniformConstant - 133: TypePointer Input 127(float) - 134(i_f): 133(ptr) Variable Input - 137: TypeVector 127(float) 2 - 138: TypePointer Function 137(fvec2) - 140: TypePointer UniformConstant 137(fvec2) - 141(u_f2): 140(ptr) Variable UniformConstant - 143: TypePointer Input 137(fvec2) - 144(i_f2): 143(ptr) Variable Input - 147: TypeVector 127(float) 3 - 148: TypePointer Function 147(fvec3) - 150: TypePointer UniformConstant 147(fvec3) - 151(u_f3): 150(ptr) Variable UniformConstant - 153: TypePointer Input 147(fvec3) - 154(i_f3): 153(ptr) Variable Input - 157: TypeVector 127(float) 4 - 158: TypePointer Function 157(fvec4) - 160: TypePointer UniformConstant 157(fvec4) - 161(u_f4): 160(ptr) Variable UniformConstant - 163: TypePointer Input 157(fvec4) - 164(i_f4): 163(ptr) Variable Input - 167: TypePointer Output 157(fvec4) -168(gl_FragColor): 167(ptr) Variable Output - 201: TypeInt 32 0 - 202: 201(int) Constant 0 - 206: 201(int) Constant 1 - 216: 201(int) Constant 2 - 229: 201(int) Constant 3 - 265: 127(float) Constant 1065353216 - 266: 157(fvec4) ConstantComposite 265 265 265 265 + 90: TypePointer Input 87(int) + 91(u_i): 90(ptr) Variable Input + 93(i_i): 90(ptr) Variable Input + 96: TypeVector 87(int) 2 + 97: TypePointer Function 96(ivec2) + 99: TypePointer Input 96(ivec2) + 100(u_i2): 99(ptr) Variable Input + 102(i_i2): 99(ptr) Variable Input + 105: TypeVector 87(int) 3 + 106: TypePointer Function 105(ivec3) + 108: TypePointer Input 105(ivec3) + 109(u_i3): 108(ptr) Variable Input + 111(i_i3): 108(ptr) Variable Input + 114: TypeVector 87(int) 4 + 115: TypePointer Function 114(ivec4) + 117: TypePointer Input 114(ivec4) + 118(u_i4): 117(ptr) Variable Input + 120(i_i4): 117(ptr) Variable Input + 123: TypeFloat 32 + 124: TypePointer Function 123(float) + 126: TypePointer Input 123(float) + 127(u_f): 126(ptr) Variable Input + 129(i_f): 126(ptr) Variable Input + 132: TypeVector 123(float) 2 + 133: TypePointer Function 132(fvec2) + 135: TypePointer Input 132(fvec2) + 136(u_f2): 135(ptr) Variable Input + 138(i_f2): 135(ptr) Variable Input + 141: TypeVector 123(float) 3 + 142: TypePointer Function 141(fvec3) + 144: TypePointer Input 141(fvec3) + 145(u_f3): 144(ptr) Variable Input + 147(i_f3): 144(ptr) Variable Input + 150: TypeVector 123(float) 4 + 151: TypePointer Function 150(fvec4) + 153: TypePointer Input 150(fvec4) + 154(u_f4): 153(ptr) Variable Input + 156(i_f4): 153(ptr) Variable Input + 159: TypePointer Output 150(fvec4) +160(gl_FragColor): 159(ptr) Variable Output + 193: TypeInt 32 0 + 194: 193(int) Constant 0 + 198: 193(int) Constant 1 + 208: 193(int) Constant 2 + 221: 193(int) Constant 3 + 257: 123(float) Constant 1065353216 + 258: 150(fvec4) ConstantComposite 257 257 257 257 4(main): 2 Function None 3 5: Label 8(b): 7(ptr) Variable Function @@ -141,14 +137,14 @@ Linked fragment stage: 35(b3): 34(ptr) Variable Function 59(b4): 58(ptr) Variable Function 89(i): 88(ptr) Variable Function - 99(i2): 98(ptr) Variable Function - 109(i3): 108(ptr) Variable Function - 119(i4): 118(ptr) Variable Function - 129(f): 128(ptr) Variable Function - 139(f2): 138(ptr) Variable Function - 149(f3): 148(ptr) Variable Function - 159(f4): 158(ptr) Variable Function - 169: 158(ptr) Variable Function + 98(i2): 97(ptr) Variable Function + 107(i3): 106(ptr) Variable Function + 116(i4): 115(ptr) Variable Function + 125(f): 124(ptr) Variable Function + 134(f2): 133(ptr) Variable Function + 143(f3): 142(ptr) Variable Function + 152(f4): 151(ptr) Variable Function + 161: 151(ptr) Variable Function 11: 6(bool) Load 10(u_b) 13: 6(bool) Load 12(i_b) 14: 6(bool) LogicalAnd 11 13 @@ -211,134 +207,134 @@ Linked fragment stage: 86: 57(bvec4) CompositeConstruct 85 85 85 85 Store 59(b4) 86 92: 87(int) Load 91(u_i) - 95: 87(int) Load 94(i_i) - 96: 87(int) IAdd 92 95 - Store 89(i) 96 - 102: 97(ivec2) Load 101(u_i2) - 105: 97(ivec2) Load 104(i_i2) - 106: 97(ivec2) IAdd 102 105 - Store 99(i2) 106 - 112: 107(ivec3) Load 111(u_i3) - 115: 107(ivec3) Load 114(i_i3) - 116: 107(ivec3) IAdd 112 115 - Store 109(i3) 116 - 122: 117(ivec4) Load 121(u_i4) - 125: 117(ivec4) Load 124(i_i4) - 126: 117(ivec4) IAdd 122 125 - Store 119(i4) 126 - 132: 127(float) Load 131(u_f) - 135: 127(float) Load 134(i_f) - 136: 127(float) FAdd 132 135 - Store 129(f) 136 - 142: 137(fvec2) Load 141(u_f2) - 145: 137(fvec2) Load 144(i_f2) - 146: 137(fvec2) FAdd 142 145 - Store 139(f2) 146 - 152: 147(fvec3) Load 151(u_f3) - 155: 147(fvec3) Load 154(i_f3) - 156: 147(fvec3) FAdd 152 155 - Store 149(f3) 156 - 162: 157(fvec4) Load 161(u_f4) - 165: 157(fvec4) Load 164(i_f4) - 166: 157(fvec4) FAdd 162 165 - Store 159(f4) 166 - 170: 6(bool) Load 8(b) - 171: 15(bvec2) Load 17(b2) - 172: 6(bool) CompositeExtract 171 0 - 173: 6(bool) LogicalOr 170 172 - 174: 15(bvec2) Load 17(b2) - 175: 6(bool) CompositeExtract 174 1 - 176: 6(bool) LogicalOr 173 175 - 177: 33(bvec3) Load 35(b3) - 178: 6(bool) CompositeExtract 177 0 - 179: 6(bool) LogicalOr 176 178 - 180: 33(bvec3) Load 35(b3) - 181: 6(bool) CompositeExtract 180 1 - 182: 6(bool) LogicalOr 179 181 - 183: 33(bvec3) Load 35(b3) - 184: 6(bool) CompositeExtract 183 2 - 185: 6(bool) LogicalOr 182 184 - 186: 57(bvec4) Load 59(b4) - 187: 6(bool) CompositeExtract 186 0 - 188: 6(bool) LogicalOr 185 187 - 189: 57(bvec4) Load 59(b4) - 190: 6(bool) CompositeExtract 189 1 - 191: 6(bool) LogicalOr 188 190 - 192: 57(bvec4) Load 59(b4) - 193: 6(bool) CompositeExtract 192 2 - 194: 6(bool) LogicalOr 191 193 - 195: 57(bvec4) Load 59(b4) - 196: 6(bool) CompositeExtract 195 3 - 197: 6(bool) LogicalOr 194 196 - SelectionMerge 199 None - BranchConditional 197 198 264 - 198: Label - 200: 87(int) Load 89(i) - 203: 88(ptr) AccessChain 99(i2) 202 - 204: 87(int) Load 203 - 205: 87(int) IAdd 200 204 - 207: 88(ptr) AccessChain 99(i2) 206 - 208: 87(int) Load 207 - 209: 87(int) IAdd 205 208 - 210: 88(ptr) AccessChain 109(i3) 202 - 211: 87(int) Load 210 - 212: 87(int) IAdd 209 211 - 213: 88(ptr) AccessChain 109(i3) 206 - 214: 87(int) Load 213 - 215: 87(int) IAdd 212 214 - 217: 88(ptr) AccessChain 109(i3) 216 - 218: 87(int) Load 217 - 219: 87(int) IAdd 215 218 - 220: 88(ptr) AccessChain 119(i4) 202 - 221: 87(int) Load 220 - 222: 87(int) IAdd 219 221 - 223: 88(ptr) AccessChain 119(i4) 206 - 224: 87(int) Load 223 - 225: 87(int) IAdd 222 224 - 226: 88(ptr) AccessChain 119(i4) 216 - 227: 87(int) Load 226 - 228: 87(int) IAdd 225 227 - 230: 88(ptr) AccessChain 119(i4) 229 - 231: 87(int) Load 230 - 232: 87(int) IAdd 228 231 - 233: 127(float) ConvertSToF 232 - 234: 127(float) Load 129(f) - 235: 127(float) FAdd 233 234 - 236: 128(ptr) AccessChain 139(f2) 202 - 237: 127(float) Load 236 - 238: 127(float) FAdd 235 237 - 239: 128(ptr) AccessChain 139(f2) 206 - 240: 127(float) Load 239 - 241: 127(float) FAdd 238 240 - 242: 128(ptr) AccessChain 149(f3) 202 - 243: 127(float) Load 242 - 244: 127(float) FAdd 241 243 - 245: 128(ptr) AccessChain 149(f3) 206 - 246: 127(float) Load 245 - 247: 127(float) FAdd 244 246 - 248: 128(ptr) AccessChain 149(f3) 216 - 249: 127(float) Load 248 - 250: 127(float) FAdd 247 249 - 251: 128(ptr) AccessChain 159(f4) 202 - 252: 127(float) Load 251 - 253: 127(float) FAdd 250 252 - 254: 128(ptr) AccessChain 159(f4) 206 - 255: 127(float) Load 254 - 256: 127(float) FAdd 253 255 - 257: 128(ptr) AccessChain 159(f4) 216 - 258: 127(float) Load 257 - 259: 127(float) FAdd 256 258 - 260: 128(ptr) AccessChain 159(f4) 229 - 261: 127(float) Load 260 - 262: 127(float) FAdd 259 261 - 263: 157(fvec4) CompositeConstruct 262 262 262 262 - Store 169 263 - Branch 199 - 264: Label - Store 169 266 - Branch 199 - 199: Label - 267: 157(fvec4) Load 169 - Store 168(gl_FragColor) 267 + 94: 87(int) Load 93(i_i) + 95: 87(int) IAdd 92 94 + Store 89(i) 95 + 101: 96(ivec2) Load 100(u_i2) + 103: 96(ivec2) Load 102(i_i2) + 104: 96(ivec2) IAdd 101 103 + Store 98(i2) 104 + 110: 105(ivec3) Load 109(u_i3) + 112: 105(ivec3) Load 111(i_i3) + 113: 105(ivec3) IAdd 110 112 + Store 107(i3) 113 + 119: 114(ivec4) Load 118(u_i4) + 121: 114(ivec4) Load 120(i_i4) + 122: 114(ivec4) IAdd 119 121 + Store 116(i4) 122 + 128: 123(float) Load 127(u_f) + 130: 123(float) Load 129(i_f) + 131: 123(float) FAdd 128 130 + Store 125(f) 131 + 137: 132(fvec2) Load 136(u_f2) + 139: 132(fvec2) Load 138(i_f2) + 140: 132(fvec2) FAdd 137 139 + Store 134(f2) 140 + 146: 141(fvec3) Load 145(u_f3) + 148: 141(fvec3) Load 147(i_f3) + 149: 141(fvec3) FAdd 146 148 + Store 143(f3) 149 + 155: 150(fvec4) Load 154(u_f4) + 157: 150(fvec4) Load 156(i_f4) + 158: 150(fvec4) FAdd 155 157 + Store 152(f4) 158 + 162: 6(bool) Load 8(b) + 163: 15(bvec2) Load 17(b2) + 164: 6(bool) CompositeExtract 163 0 + 165: 6(bool) LogicalOr 162 164 + 166: 15(bvec2) Load 17(b2) + 167: 6(bool) CompositeExtract 166 1 + 168: 6(bool) LogicalOr 165 167 + 169: 33(bvec3) Load 35(b3) + 170: 6(bool) CompositeExtract 169 0 + 171: 6(bool) LogicalOr 168 170 + 172: 33(bvec3) Load 35(b3) + 173: 6(bool) CompositeExtract 172 1 + 174: 6(bool) LogicalOr 171 173 + 175: 33(bvec3) Load 35(b3) + 176: 6(bool) CompositeExtract 175 2 + 177: 6(bool) LogicalOr 174 176 + 178: 57(bvec4) Load 59(b4) + 179: 6(bool) CompositeExtract 178 0 + 180: 6(bool) LogicalOr 177 179 + 181: 57(bvec4) Load 59(b4) + 182: 6(bool) CompositeExtract 181 1 + 183: 6(bool) LogicalOr 180 182 + 184: 57(bvec4) Load 59(b4) + 185: 6(bool) CompositeExtract 184 2 + 186: 6(bool) LogicalOr 183 185 + 187: 57(bvec4) Load 59(b4) + 188: 6(bool) CompositeExtract 187 3 + 189: 6(bool) LogicalOr 186 188 + SelectionMerge 191 None + BranchConditional 189 190 256 + 190: Label + 192: 87(int) Load 89(i) + 195: 88(ptr) AccessChain 98(i2) 194 + 196: 87(int) Load 195 + 197: 87(int) IAdd 192 196 + 199: 88(ptr) AccessChain 98(i2) 198 + 200: 87(int) Load 199 + 201: 87(int) IAdd 197 200 + 202: 88(ptr) AccessChain 107(i3) 194 + 203: 87(int) Load 202 + 204: 87(int) IAdd 201 203 + 205: 88(ptr) AccessChain 107(i3) 198 + 206: 87(int) Load 205 + 207: 87(int) IAdd 204 206 + 209: 88(ptr) AccessChain 107(i3) 208 + 210: 87(int) Load 209 + 211: 87(int) IAdd 207 210 + 212: 88(ptr) AccessChain 116(i4) 194 + 213: 87(int) Load 212 + 214: 87(int) IAdd 211 213 + 215: 88(ptr) AccessChain 116(i4) 198 + 216: 87(int) Load 215 + 217: 87(int) IAdd 214 216 + 218: 88(ptr) AccessChain 116(i4) 208 + 219: 87(int) Load 218 + 220: 87(int) IAdd 217 219 + 222: 88(ptr) AccessChain 116(i4) 221 + 223: 87(int) Load 222 + 224: 87(int) IAdd 220 223 + 225: 123(float) ConvertSToF 224 + 226: 123(float) Load 125(f) + 227: 123(float) FAdd 225 226 + 228: 124(ptr) AccessChain 134(f2) 194 + 229: 123(float) Load 228 + 230: 123(float) FAdd 227 229 + 231: 124(ptr) AccessChain 134(f2) 198 + 232: 123(float) Load 231 + 233: 123(float) FAdd 230 232 + 234: 124(ptr) AccessChain 143(f3) 194 + 235: 123(float) Load 234 + 236: 123(float) FAdd 233 235 + 237: 124(ptr) AccessChain 143(f3) 198 + 238: 123(float) Load 237 + 239: 123(float) FAdd 236 238 + 240: 124(ptr) AccessChain 143(f3) 208 + 241: 123(float) Load 240 + 242: 123(float) FAdd 239 241 + 243: 124(ptr) AccessChain 152(f4) 194 + 244: 123(float) Load 243 + 245: 123(float) FAdd 242 244 + 246: 124(ptr) AccessChain 152(f4) 198 + 247: 123(float) Load 246 + 248: 123(float) FAdd 245 247 + 249: 124(ptr) AccessChain 152(f4) 208 + 250: 123(float) Load 249 + 251: 123(float) FAdd 248 250 + 252: 124(ptr) AccessChain 152(f4) 221 + 253: 123(float) Load 252 + 254: 123(float) FAdd 251 253 + 255: 150(fvec4) CompositeConstruct 254 254 254 254 + Store 161 255 + Branch 191 + 256: Label + Store 161 258 + Branch 191 + 191: Label + 259: 150(fvec4) Load 161 + Store 160(gl_FragColor) 259 Return FunctionEnd diff --git a/Test/baseResults/spv.uint.frag.out b/Test/baseResults/spv.uint.frag.out index 4ac9c58f90637ea1c7024efb50c635ca4c9630ac..7d934ff1ddc0c6609c531236eb84e6852004353b 100755 --- a/Test/baseResults/spv.uint.frag.out +++ b/Test/baseResults/spv.uint.frag.out @@ -12,8 +12,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 15 68 77 200 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 15 68 77 200 202 204 + ExecutionMode 4 OriginUpperLeft Source ESSL 310 Name 4 "main" Name 8 "count" @@ -63,6 +63,7 @@ Linked fragment stage: Decorate 62 RelaxedPrecision Decorate 68(c) RelaxedPrecision Decorate 72(usampler) RelaxedPrecision + Decorate 72(usampler) DescriptorSet 0 Decorate 73 RelaxedPrecision Decorate 77(tc) RelaxedPrecision Decorate 78 RelaxedPrecision @@ -139,7 +140,9 @@ Linked fragment stage: Decorate 198 RelaxedPrecision Decorate 200(f) RelaxedPrecision Decorate 202(v) RelaxedPrecision + Decorate 202(v) Flat Decorate 204(i) RelaxedPrecision + Decorate 204(i) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -192,12 +195,12 @@ Linked fragment stage: 161: 10(int) Constant 2737 199: TypePointer Input 74(float) 200(f): 199(ptr) Variable Input - 201: TypePointer UniformConstant 66(ivec4) - 202(v): 201(ptr) Variable UniformConstant - 203: TypePointer UniformConstant 6(int) - 204(i): 203(ptr) Variable UniformConstant - 205: TypePointer UniformConstant 22(bool) - 206(b): 205(ptr) Variable UniformConstant + 201: TypePointer Input 66(ivec4) + 202(v): 201(ptr) Variable Input + 203: TypePointer Input 6(int) + 204(i): 203(ptr) Variable Input + 205: TypePointer Private 22(bool) + 206(b): 205(ptr) Variable Private 4(main): 2 Function None 3 5: Label 8(count): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.uniformArray.frag.out b/Test/baseResults/spv.uniformArray.frag.out old mode 100755 new mode 100644 index 747aa17e2b6e6aea2d6b5f0936a090b7fa48d27c..e66eda6b109ec04fe3e3ce1299347b39336baaab --- a/Test/baseResults/spv.uniformArray.frag.out +++ b/Test/baseResults/spv.uniformArray.frag.out @@ -10,8 +10,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 47 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 14 25 35 47 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "texColor" @@ -20,6 +20,7 @@ Linked fragment stage: Name 35 "alpha" Name 47 "gl_FragColor" Name 52 "texSampler2D" + Decorate 52(texSampler2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -28,20 +29,20 @@ Linked fragment stage: 10: TypeInt 32 0 11: 10(int) Constant 6 12: TypeArray 7(fvec4) 11 - 13: TypePointer UniformConstant 12 - 14(color): 13(ptr) Variable UniformConstant + 13: TypePointer Input 12 + 14(color): 13(ptr) Variable Input 15: TypeInt 32 1 16: 15(int) Constant 1 - 17: TypePointer UniformConstant 7(fvec4) + 17: TypePointer Input 7(fvec4) 23: TypeVector 6(float) 3 - 24: TypePointer UniformConstant 23(fvec3) - 25(inColor): 24(ptr) Variable UniformConstant + 24: TypePointer Input 23(fvec3) + 25(inColor): 24(ptr) Variable Input 32: 10(int) Constant 16 33: TypeArray 6(float) 32 - 34: TypePointer UniformConstant 33 - 35(alpha): 34(ptr) Variable UniformConstant + 34: TypePointer Input 33 + 35(alpha): 34(ptr) Variable Input 36: 15(int) Constant 12 - 37: TypePointer UniformConstant 6(float) + 37: TypePointer Input 6(float) 40: 10(int) Constant 3 41: TypePointer Function 6(float) 46: TypePointer Output 7(fvec4) diff --git a/Test/baseResults/spv.variableArrayIndex.frag.out b/Test/baseResults/spv.variableArrayIndex.frag.out index 3d8162a6b17f01ae1e0ea04143a860b7c514b156..75ed07eecd57f3bcab0b3f162624d9262bde4622 100755 --- a/Test/baseResults/spv.variableArrayIndex.frag.out +++ b/Test/baseResults/spv.variableArrayIndex.frag.out @@ -1,18 +1,20 @@ spv.variableArrayIndex.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 93 +// Id's are bound by 97 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 54 63 - ExecutionMode 4 OriginLowerLeft - Source GLSL 140 + EntryPoint Fragment 4 "main" 10 21 37 40 58 67 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 Name 4 "main" Name 8 "iLocal" Name 10 "Count" @@ -23,120 +25,157 @@ Linked fragment stage: MemberName 14(lunarStruct2) 0 "i" MemberName 14(lunarStruct2) 1 "f" MemberName 14(lunarStruct2) 2 "s1_1" - Name 18 "lunarStruct3" - MemberName 18(lunarStruct3) 0 "s2_1" - MemberName 18(lunarStruct3) 1 "i" - MemberName 18(lunarStruct3) 2 "f" - MemberName 18(lunarStruct3) 3 "s1_1" - Name 20 "foo3" - Name 30 "scale" - Name 34 "foo2" - Name 36 "foo" - Name 54 "gl_FragColor" - Name 59 "samp2D" - Name 63 "coord" - Name 69 "constructed" + Name 18 "lunarStruct1" + MemberName 18(lunarStruct1) 0 "i" + MemberName 18(lunarStruct1) 1 "f" + Name 19 "lunarStruct3" + MemberName 19(lunarStruct3) 0 "s2_1" + MemberName 19(lunarStruct3) 1 "i" + MemberName 19(lunarStruct3) 2 "f" + MemberName 19(lunarStruct3) 3 "s1_1" + Name 21 "foo3" + Name 31 "scale" + Name 32 "lunarStruct1" + MemberName 32(lunarStruct1) 0 "i" + MemberName 32(lunarStruct1) 1 "f" + Name 33 "lunarStruct2" + MemberName 33(lunarStruct2) 0 "i" + MemberName 33(lunarStruct2) 1 "f" + MemberName 33(lunarStruct2) 2 "s1_1" + Name 37 "foo2" + Name 38 "lunarStruct1" + MemberName 38(lunarStruct1) 0 "i" + MemberName 38(lunarStruct1) 1 "f" + Name 40 "foo" + Name 58 "gl_FragColor" + Name 63 "samp2D" + Name 67 "coord" + Name 73 "constructed" + Decorate 10(Count) Flat + MemberDecorate 13(lunarStruct1) 0 Flat + MemberDecorate 13(lunarStruct1) 1 Flat + MemberDecorate 14(lunarStruct2) 0 Flat + MemberDecorate 14(lunarStruct2) 1 Flat + MemberDecorate 14(lunarStruct2) 2 Flat + MemberDecorate 18(lunarStruct1) 0 Flat + MemberDecorate 18(lunarStruct1) 1 Flat + MemberDecorate 19(lunarStruct3) 0 Flat + MemberDecorate 19(lunarStruct3) 1 Flat + MemberDecorate 19(lunarStruct3) 2 Flat + MemberDecorate 19(lunarStruct3) 3 Flat + MemberDecorate 32(lunarStruct1) 0 Flat + MemberDecorate 32(lunarStruct1) 1 Flat + MemberDecorate 33(lunarStruct2) 0 Flat + MemberDecorate 33(lunarStruct2) 1 Flat + MemberDecorate 33(lunarStruct2) 2 Flat + MemberDecorate 38(lunarStruct1) 0 Flat + MemberDecorate 38(lunarStruct1) 1 Flat + Decorate 63(samp2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) - 9: TypePointer UniformConstant 6(int) - 10(Count): 9(ptr) Variable UniformConstant + 9: TypePointer Input 6(int) + 10(Count): 9(ptr) Variable Input 12: TypeFloat 32 13(lunarStruct1): TypeStruct 6(int) 12(float) 14(lunarStruct2): TypeStruct 6(int) 12(float) 13(lunarStruct1) 15: TypeInt 32 0 16: 15(int) Constant 3 17: TypeArray 14(lunarStruct2) 16 -18(lunarStruct3): TypeStruct 17 6(int) 12(float) 13(lunarStruct1) - 19: TypePointer UniformConstant 18(lunarStruct3) - 20(foo3): 19(ptr) Variable UniformConstant - 21: 6(int) Constant 0 - 22: 6(int) Constant 1 - 25: TypeBool - 29: TypePointer Function 12(float) - 31: 15(int) Constant 5 - 32: TypeArray 14(lunarStruct2) 31 - 33: TypePointer UniformConstant 32 - 34(foo2): 33(ptr) Variable UniformConstant - 35: TypePointer UniformConstant 13(lunarStruct1) - 36(foo): 35(ptr) Variable UniformConstant - 41: 6(int) Constant 2 - 46: TypePointer UniformConstant 12(float) - 52: TypeVector 12(float) 4 - 53: TypePointer Output 52(fvec4) -54(gl_FragColor): 53(ptr) Variable Output - 56: TypeImage 12(float) 2D sampled format:Unknown - 57: TypeSampledImage 56 - 58: TypePointer UniformConstant 57 - 59(samp2D): 58(ptr) Variable UniformConstant - 61: TypeVector 12(float) 2 - 62: TypePointer Input 61(fvec2) - 63(coord): 62(ptr) Variable Input - 67: TypeArray 61(fvec2) 16 - 68: TypePointer Function 67 - 73: 12(float) Constant 1065353216 - 74: 12(float) Constant 1073741824 - 75: 61(fvec2) ConstantComposite 73 74 - 79: TypePointer Function 61(fvec2) +18(lunarStruct1): TypeStruct 6(int) 12(float) +19(lunarStruct3): TypeStruct 17 6(int) 12(float) 18(lunarStruct1) + 20: TypePointer Input 19(lunarStruct3) + 21(foo3): 20(ptr) Variable Input + 22: 6(int) Constant 0 + 23: 6(int) Constant 1 + 26: TypeBool + 30: TypePointer Function 12(float) +32(lunarStruct1): TypeStruct 6(int) 12(float) +33(lunarStruct2): TypeStruct 6(int) 12(float) 32(lunarStruct1) + 34: 15(int) Constant 5 + 35: TypeArray 33(lunarStruct2) 34 + 36: TypePointer Input 35 + 37(foo2): 36(ptr) Variable Input +38(lunarStruct1): TypeStruct 6(int) 12(float) + 39: TypePointer Input 38(lunarStruct1) + 40(foo): 39(ptr) Variable Input + 45: 6(int) Constant 2 + 50: TypePointer Input 12(float) + 56: TypeVector 12(float) 4 + 57: TypePointer Output 56(fvec4) +58(gl_FragColor): 57(ptr) Variable Output + 60: TypeImage 12(float) 2D sampled format:Unknown + 61: TypeSampledImage 60 + 62: TypePointer UniformConstant 61 + 63(samp2D): 62(ptr) Variable UniformConstant + 65: TypeVector 12(float) 2 + 66: TypePointer Input 65(fvec2) + 67(coord): 66(ptr) Variable Input + 71: TypeArray 65(fvec2) 16 + 72: TypePointer Function 71 + 77: 12(float) Constant 1065353216 + 78: 12(float) Constant 1073741824 + 79: 65(fvec2) ConstantComposite 77 78 + 83: TypePointer Function 65(fvec2) 4(main): 2 Function None 3 5: Label 8(iLocal): 7(ptr) Variable Function - 30(scale): 29(ptr) Variable Function - 69(constructed): 68(ptr) Variable Function + 31(scale): 30(ptr) Variable Function + 73(constructed): 72(ptr) Variable Function 11: 6(int) Load 10(Count) Store 8(iLocal) 11 - 23: 9(ptr) AccessChain 20(foo3) 21 22 21 - 24: 6(int) Load 23 - 26: 25(bool) SGreaterThan 24 21 - SelectionMerge 28 None - BranchConditional 26 27 49 - 27: Label - 37: 9(ptr) AccessChain 36(foo) 21 - 38: 6(int) Load 37 - 39: 9(ptr) AccessChain 20(foo3) 21 38 21 - 40: 6(int) Load 39 - 42: 6(int) IAdd 40 41 - 43: 6(int) Load 8(iLocal) - 44: 6(int) IAdd 43 22 - Store 8(iLocal) 44 - 45: 6(int) IAdd 42 44 - 47: 46(ptr) AccessChain 34(foo2) 45 41 22 - 48: 12(float) Load 47 - Store 30(scale) 48 - Branch 28 - 49: Label - 50: 46(ptr) AccessChain 20(foo3) 21 21 41 22 - 51: 12(float) Load 50 - Store 30(scale) 51 - Branch 28 - 28: Label - 55: 12(float) Load 30(scale) - 60: 57 Load 59(samp2D) - 64: 61(fvec2) Load 63(coord) - 65: 52(fvec4) ImageSampleImplicitLod 60 64 - 66: 52(fvec4) VectorTimesScalar 65 55 - Store 54(gl_FragColor) 66 - 70: 61(fvec2) Load 63(coord) - 71: 12(float) Load 30(scale) - 72: 61(fvec2) CompositeConstruct 71 71 - 76: 67 CompositeConstruct 70 72 75 - Store 69(constructed) 76 - 77: 9(ptr) AccessChain 36(foo) 21 - 78: 6(int) Load 77 - 80: 79(ptr) AccessChain 69(constructed) 78 - 81: 61(fvec2) Load 80 - 82: 9(ptr) AccessChain 36(foo) 21 - 83: 6(int) Load 82 - 84: 79(ptr) AccessChain 69(constructed) 83 - 85: 61(fvec2) Load 84 - 86: 12(float) CompositeExtract 81 0 - 87: 12(float) CompositeExtract 81 1 - 88: 12(float) CompositeExtract 85 0 - 89: 12(float) CompositeExtract 85 1 - 90: 52(fvec4) CompositeConstruct 86 87 88 89 - 91: 52(fvec4) Load 54(gl_FragColor) - 92: 52(fvec4) FAdd 91 90 - Store 54(gl_FragColor) 92 + 24: 9(ptr) AccessChain 21(foo3) 22 23 22 + 25: 6(int) Load 24 + 27: 26(bool) SGreaterThan 25 22 + SelectionMerge 29 None + BranchConditional 27 28 53 + 28: Label + 41: 9(ptr) AccessChain 40(foo) 22 + 42: 6(int) Load 41 + 43: 9(ptr) AccessChain 21(foo3) 22 42 22 + 44: 6(int) Load 43 + 46: 6(int) IAdd 44 45 + 47: 6(int) Load 8(iLocal) + 48: 6(int) IAdd 47 23 + Store 8(iLocal) 48 + 49: 6(int) IAdd 46 48 + 51: 50(ptr) AccessChain 37(foo2) 49 45 23 + 52: 12(float) Load 51 + Store 31(scale) 52 + Branch 29 + 53: Label + 54: 50(ptr) AccessChain 21(foo3) 22 22 45 23 + 55: 12(float) Load 54 + Store 31(scale) 55 + Branch 29 + 29: Label + 59: 12(float) Load 31(scale) + 64: 61 Load 63(samp2D) + 68: 65(fvec2) Load 67(coord) + 69: 56(fvec4) ImageSampleImplicitLod 64 68 + 70: 56(fvec4) VectorTimesScalar 69 59 + Store 58(gl_FragColor) 70 + 74: 65(fvec2) Load 67(coord) + 75: 12(float) Load 31(scale) + 76: 65(fvec2) CompositeConstruct 75 75 + 80: 71 CompositeConstruct 74 76 79 + Store 73(constructed) 80 + 81: 9(ptr) AccessChain 40(foo) 22 + 82: 6(int) Load 81 + 84: 83(ptr) AccessChain 73(constructed) 82 + 85: 65(fvec2) Load 84 + 86: 9(ptr) AccessChain 40(foo) 22 + 87: 6(int) Load 86 + 88: 83(ptr) AccessChain 73(constructed) 87 + 89: 65(fvec2) Load 88 + 90: 12(float) CompositeExtract 85 0 + 91: 12(float) CompositeExtract 85 1 + 92: 12(float) CompositeExtract 89 0 + 93: 12(float) CompositeExtract 89 1 + 94: 56(fvec4) CompositeConstruct 90 91 92 93 + 95: 56(fvec4) Load 58(gl_FragColor) + 96: 56(fvec4) FAdd 95 94 + Store 58(gl_FragColor) 96 Return FunctionEnd diff --git a/Test/baseResults/spv.varyingArray.frag.out b/Test/baseResults/spv.varyingArray.frag.out index 91ec96a624a68a356eb8c586b236711780b94cb5..4a7d2ee6268be8792a1b88ecea3a35161eb369c3 100755 --- a/Test/baseResults/spv.varyingArray.frag.out +++ b/Test/baseResults/spv.varyingArray.frag.out @@ -11,7 +11,7 @@ Linked fragment stage: 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Fragment 4 "main" 19 34 39 45 48 - ExecutionMode 4 OriginLowerLeft + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "texColor" @@ -21,6 +21,7 @@ Linked fragment stage: Name 39 "alpha" Name 45 "gl_FragColor" Name 48 "foo" + Decorate 13(texSampler2D) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.varyingArrayIndirect.frag.out b/Test/baseResults/spv.varyingArrayIndirect.frag.out index 01b7e43edfed8007a95843ba898ac9c0c5ccb19e..410fd3c46a16fb87502042cdbcc3590613006900 100755 --- a/Test/baseResults/spv.varyingArrayIndirect.frag.out +++ b/Test/baseResults/spv.varyingArrayIndirect.frag.out @@ -10,8 +10,8 @@ Linked fragment stage: Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 19 30 45 50 56 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 19 22 30 31 45 50 56 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "texColor" @@ -23,6 +23,9 @@ Linked fragment stage: Name 45 "color" Name 50 "alpha" Name 56 "gl_FragColor" + Decorate 13(texSampler2D) DescriptorSet 0 + Decorate 22(b) Flat + Decorate 31(a) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -38,14 +41,14 @@ Linked fragment stage: 18: TypePointer Input 17 19(userIn): 18(ptr) Variable Input 20: TypeInt 32 1 - 21: TypePointer UniformConstant 20(int) - 22(b): 21(ptr) Variable UniformConstant + 21: TypePointer Input 20(int) + 22(b): 21(ptr) Variable Input 24: TypePointer Input 7(fvec4) 27: 15(int) Constant 6 28: TypeArray 7(fvec4) 27 29: TypePointer Input 28 30(TexCoord): 29(ptr) Variable Input - 31(a): 21(ptr) Variable UniformConstant + 31(a): 21(ptr) Variable Input 36: 20(int) Constant 5 40: TypeVector 6(float) 2 45(color): 24(ptr) Variable Input diff --git a/Test/baseResults/spv.voidFunction.frag.out b/Test/baseResults/spv.voidFunction.frag.out index 6b9179b87424db3e121bd7125056a7af4d8af9dd..1d4b694b3fe5b00a5c7c9146f6267fe80747301b 100755 --- a/Test/baseResults/spv.voidFunction.frag.out +++ b/Test/baseResults/spv.voidFunction.frag.out @@ -1,18 +1,20 @@ spv.voidFunction.frag +Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 44 +// Id's are bound by 43 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 37 41 - ExecutionMode 4 OriginLowerLeft - Source GLSL 140 + EntryPoint Fragment 4 "main" 24 37 40 42 + ExecutionMode 4 OriginUpperLeft + Source GLSL 400 Name 4 "main" Name 6 "foo(" Name 8 "foo2(" @@ -20,8 +22,8 @@ Linked fragment stage: Name 22 "outColor" Name 24 "bigColor" Name 37 "gl_FragColor" - Name 41 "BaseColor" - Name 43 "d" + Name 40 "BaseColor" + Name 42 "d" 2: TypeVoid 3: TypeFunction 2 10: TypeFloat 32 @@ -31,17 +33,16 @@ Linked fragment stage: 15: 10(float) Constant 1065353216 20: TypeVector 10(float) 4 21: TypePointer Function 20(fvec4) - 23: TypePointer UniformConstant 20(fvec4) - 24(bigColor): 23(ptr) Variable UniformConstant + 23: TypePointer Input 20(fvec4) + 24(bigColor): 23(ptr) Variable Input 29: TypeInt 32 0 30: 29(int) Constant 0 31: TypePointer Function 10(float) 36: TypePointer Output 20(fvec4) 37(gl_FragColor): 36(ptr) Variable Output - 40: TypePointer Input 20(fvec4) - 41(BaseColor): 40(ptr) Variable Input - 42: TypePointer UniformConstant 10(float) - 43(d): 42(ptr) Variable UniformConstant + 40(BaseColor): 23(ptr) Variable Input + 41: TypePointer Input 10(float) + 42(d): 41(ptr) Variable Input 4(main): 2 Function None 3 5: Label 22(outColor): 21(ptr) Variable Function diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out index 8086e3b0fd816ea3e6b724524cbafab7fe9f8a1e..2ec331024b040cf90a03ff0484d3e44c1ca2b65c 100644 --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -7,12 +7,12 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 44 +// Id's are bound by 41 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 42 43 + EntryPoint Vertex 4 "main" Source ESSL 310 Name 4 "main" Name 8 "i" @@ -20,10 +20,6 @@ Linked vertex stage: Name 27 "B" Name 29 "C" Name 39 "D" - Name 42 "gl_VertexID" - Name 43 "gl_InstanceID" - Decorate 42(gl_VertexID) BuiltIn VertexId - Decorate 43(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -35,9 +31,6 @@ Linked vertex stage: 22: 6(int) Constant 2 31: 6(int) Constant 5 40: 6(int) Constant 3 - 41: TypePointer Input 6(int) - 42(gl_VertexID): 41(ptr) Variable Input -43(gl_InstanceID): 41(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.while-simple.vert.out b/Test/baseResults/spv.while-simple.vert.out index 04f53561a5169b278663bc20c3a03b08551f72dc..0c1c822179fce39a1a28ea85a00972e832b0bcc5 100755 --- a/Test/baseResults/spv.while-simple.vert.out +++ b/Test/baseResults/spv.while-simple.vert.out @@ -7,19 +7,15 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 22 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 23 24 + EntryPoint Vertex 4 "main" Source ESSL 310 Name 4 "main" Name 8 "i" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -28,9 +24,6 @@ Linked vertex stage: 16: 6(int) Constant 10 17: TypeBool 20: 6(int) Constant 1 - 22: TypePointer Input 6(int) - 23(gl_VertexID): 22(ptr) Variable Input -24(gl_InstanceID): 22(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function diff --git a/Test/baseResults/spv.whileLoop.frag.out b/Test/baseResults/spv.whileLoop.frag.out index 56e2d1c4acc18c696f849def10719f202108b4ab..8de5e956e0d3e3b47d0c1d52384f6790f926487b 100755 --- a/Test/baseResults/spv.whileLoop.frag.out +++ b/Test/baseResults/spv.whileLoop.frag.out @@ -5,20 +5,20 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 36 +// Id's are bound by 35 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 34 - ExecutionMode 4 OriginLowerLeft + EntryPoint Fragment 4 "main" 11 24 28 33 + ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" Name 9 "color" Name 11 "BaseColor" Name 24 "d" - Name 29 "bigColor" - Name 34 "gl_FragColor" + Name 28 "bigColor" + Name 33 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -29,13 +29,12 @@ Linked fragment stage: 18: TypeInt 32 0 19: 18(int) Constant 0 20: TypePointer Function 6(float) - 23: TypePointer UniformConstant 6(float) - 24(d): 23(ptr) Variable UniformConstant + 23: TypePointer Input 6(float) + 24(d): 23(ptr) Variable Input 26: TypeBool - 28: TypePointer UniformConstant 7(fvec4) - 29(bigColor): 28(ptr) Variable UniformConstant - 33: TypePointer Output 7(fvec4) -34(gl_FragColor): 33(ptr) Variable Output + 28(bigColor): 10(ptr) Variable Input + 32: TypePointer Output 7(fvec4) +33(gl_FragColor): 32(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -52,15 +51,15 @@ Linked fragment stage: 27: 26(bool) FOrdLessThan 22 25 BranchConditional 27 14 15 14: Label - 30: 7(fvec4) Load 29(bigColor) - 31: 7(fvec4) Load 9(color) - 32: 7(fvec4) FAdd 31 30 - Store 9(color) 32 + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 Branch 16 16: Label Branch 13 15: Label - 35: 7(fvec4) Load 9(color) - Store 34(gl_FragColor) 35 + 34: 7(fvec4) Load 9(color) + Store 33(gl_FragColor) 34 Return FunctionEnd diff --git a/Test/baseResults/vulkan.comp.out b/Test/baseResults/vulkan.comp.out new file mode 100644 index 0000000000000000000000000000000000000000..7f1fd18ac733e8595bd31f473ac6871f6638fc9f --- /dev/null +++ b/Test/baseResults/vulkan.comp.out @@ -0,0 +1,11 @@ +vulkan.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:5: 'local_size' : cannot change previously set size +ERROR: 1 compilation errors. No code generated. + + + +Linked compute stage: + + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..b5b9d91af7acc93255463379000cc9aabf0dcd78 --- /dev/null +++ b/Test/baseResults/vulkan.frag.out @@ -0,0 +1,42 @@ +vulkan.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:14: 'sampler2D' : sampler-constructor requires two arguments +ERROR: 0:15: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:16: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:17: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:18: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:19: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:21: 'sampler3D' : sampler-constructor cannot make an array of samplers +ERROR: 0:22: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type +ERROR: 0:23: 'sampler2D' : sampler-constructor first argument must match type and dimensionality of constructor type +ERROR: 0:24: 'sampler2D' : sampler-constructor second argument presence of shadow must match constructor presence of shadow +ERROR: 0:25: 'sampler2DShadow' : sampler-constructor second argument presence of shadow must match constructor presence of shadow +ERROR: 0:28: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: s2D +ERROR: 0:29: 'sampler3D' : sampler-constructor cannot make an array of samplers +ERROR: 0:29: 'sampler3D' : sampler/image types can only be used in uniform variables or function parameters: s3d +ERROR: 0:29: '=' : cannot convert from 'const float' to 'global 4-element array of sampler3D' +ERROR: 0:39: 'push_constant' : can only be used with a uniform +ERROR: 0:43: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:43: 'push_constant' : can only be used with a block +ERROR: 0:45: 'push_constant' : cannot declare a default, can only be used on a block +ERROR: 0:47: 'push_constant' : requires an instance name +ERROR: 0:52: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:53: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:54: 'subpass' : requires an input_attachment_index layout qualifier +ERROR: 0:60: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:61: 'subpassLoad' : no matching overloaded function found +ERROR: 0:63: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:66: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:66: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:67: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:67: 'uniform' : no qualifiers allowed for function return +ERROR: 0:69: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 31 compilation errors. No code generated. + + + +Linked fragment stage: + +ERROR: Linking fragment stage: Only one push_constant block is allowed per stage + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/vulkan.vert.out b/Test/baseResults/vulkan.vert.out new file mode 100644 index 0000000000000000000000000000000000000000..1e70b5b260b018e2d8d7c82caf9b4f4f136681bf --- /dev/null +++ b/Test/baseResults/vulkan.vert.out @@ -0,0 +1,32 @@ +vulkan.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:3: 'subpass input' : not supported in this stage: vertex +ERROR: 0:4: 'subpass input' : not supported in this stage: vertex +ERROR: 0:5: 'subpass input' : not supported in this stage: vertex +ERROR: 0:6: 'subpass input' : not supported in this stage: vertex +ERROR: 0:7: 'subpass input' : not supported in this stage: vertex +ERROR: 0:8: 'subpass input' : not supported in this stage: vertex +ERROR: 0:12: 'constant_id' : can only be applied to a scalar +ERROR: 0:13: 'constant_id' : specialization-constant id already used +ERROR: 0:13: 'constant_id' : can only be applied to 'const'-qualified scalar +ERROR: 0:13: 'constant_id' : cannot be applied to this type +ERROR: 0:14: 'constant_id' : specialization-constant id is too large +ERROR: 0:15: 'constant_id' : can only be applied to a scalar +ERROR: 0:16: 'constant_id' : specialization-constant id already used +ERROR: 0:16: 'constant_id' : cannot declare a default, can only be used on a scalar +ERROR: 0:20: 'subpassLoad' : no matching overloaded function found +ERROR: 0:20: 'assign' : cannot convert from 'const float' to 'smooth out 4-component vector of float' +ERROR: 0:23: 'atomic counter types' : not allowed when using GLSL for Vulkan +ERROR: 0:24: 'shared' : not allowed when using GLSL for Vulkan +ERROR: 0:25: 'packed' : not allowed when using GLSL for Vulkan +ERROR: 0:32: 'initializer' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:34: '=' : can't use with types containing arrays sized with a specialization constant +ERROR: 0:35: '==' : can't use with types containing arrays sized with a specialization constant +ERROR: 22 compilation errors. No code generated. + + + +Linked vertex stage: + + +SPIR-V is not generated for failed compile or link diff --git a/Test/nonVulkan.frag b/Test/nonVulkan.frag new file mode 100644 index 0000000000000000000000000000000000000000..c8cf46747a8c7fe15aac9ca359c4d35b8f206b76 --- /dev/null +++ b/Test/nonVulkan.frag @@ -0,0 +1,5 @@ +#version 450 + +layout(constant_id = 17) const int arraySize = 12; // ERROR +layout(input_attachment_index = 1) int foo; // ERROR +layout(push_constant) uniform ubn { int a; } ubi; // ERROR \ No newline at end of file diff --git a/Test/spv.100ops.frag b/Test/spv.100ops.frag index b0daf8e2522757e8053b47cb00b243f63a858992..43452a1f11b051589df7e2d68071817d6ec3e840 100644 --- a/Test/spv.100ops.frag +++ b/Test/spv.100ops.frag @@ -2,7 +2,7 @@ lowp float foo(); -uniform int low, high; +in lowp float low, high; lowp float face1 = 11.0; @@ -12,7 +12,7 @@ void main() { int z = 3; - if (2 * low + 1 < high) + if (2.0 * low + 1.0 < high) ++z; Color = face1 * vec4(z) + foo(); diff --git a/Test/spv.130.frag b/Test/spv.130.frag index dcbd5be11fcf0b07e859d3e133f0e998eef809f9..e7fdd388989cc6b5bf4323f086d5cedbd8e79a1b 100644 --- a/Test/spv.130.frag +++ b/Test/spv.130.frag @@ -82,11 +82,6 @@ uniform sampler2DRectShadow s2DRS; uniform sampler1D s1D; uniform sampler2DShadow s2DS; -uniform float f; -uniform vec2 v2; -uniform vec3 v3; -uniform vec4 v4; - void main() { o = textureGather(sampC, vec3(0.2)); diff --git a/Test/spv.150.vert b/Test/spv.150.vert index 686b14b0bb7783425ba3988b56e9999997ef1a04..382e3c9bf86ae3cdac63e2be6530a636fbd50d5f 100644 --- a/Test/spv.150.vert +++ b/Test/spv.150.vert @@ -2,8 +2,8 @@ in vec4 iv4; -uniform float ps; -uniform int ui; +in float ps; +in int ui; uniform sampler2D s2D; invariant gl_Position; diff --git a/Test/spv.300BuiltIns.vert b/Test/spv.300BuiltIns.vert index 0f40c2514450f8078d2f3aa80e190d18f2801a31..46c3f0fedbbd054b050fbadb93e6d58a2f8a1ff3 100644 --- a/Test/spv.300BuiltIns.vert +++ b/Test/spv.300BuiltIns.vert @@ -6,12 +6,9 @@ invariant gl_Position; void main() { - mediump int i = (4 * gl_VertexID - 10); - mediump int j = (4 * gl_VertexID - 10); - gl_Position = vec4(ps); - gl_Position *= float(i); + gl_Position *= float(4 - gl_VertexIndex); gl_PointSize = ps; - gl_PointSize *= float(j); + gl_PointSize *= float(5 - gl_InstanceIndex); } diff --git a/Test/spv.300layout.vert b/Test/spv.300layout.vert index d2db127c18c4f49cfece8f58685df572991d0f4c..81218b5d381bffdc51d022dc2060babb28f1a04d 100644 --- a/Test/spv.300layout.vert +++ b/Test/spv.300layout.vert @@ -28,7 +28,7 @@ layout(column_major) uniform T3 { // shared and column_major uvec3 uv3a[4]; }; -uniform uint uiuin; +in uint uiuin; struct S { vec3 c; diff --git a/Test/spv.300layoutp.vert b/Test/spv.300layoutp.vert index 79d4093cd6d199951401a32c57085dd2d86c3dff..d14aa1cd4b59acb7c09f271fb62527c244362af6 100644 --- a/Test/spv.300layoutp.vert +++ b/Test/spv.300layoutp.vert @@ -7,7 +7,7 @@ out vec4 pos; out vec3 color; flat out int iout; -layout(shared, column_major, row_major) uniform; // default is now shared and row_major +layout(row_major) uniform; // default is now row_major layout(std140) uniform Transform { // layout of this block is std140 mat4 M1; // row_major @@ -28,7 +28,7 @@ layout(column_major) uniform T3 { // shared and column_major uvec3 uv3a[4]; }; -uniform uint uiuin; +uint uiuin; struct S { vec3 c; diff --git a/Test/spv.420.geom b/Test/spv.420.geom index afb04bc925841faadabbe832a15c571b711457a2..92186ae8d6b5e9510b11a3434d20b0a27c4f000f 100644 --- a/Test/spv.420.geom +++ b/Test/spv.420.geom @@ -16,8 +16,8 @@ layout(invocations = 4) in; uniform sampler2D s2D; in vec2 coord[]; -uniform vec4 v4; -uniform int i; + +int i; void main() { diff --git a/Test/spv.430.vert b/Test/spv.430.vert index b5571cccafd05bdc36a140874dabb57efa44413b..d0b05ecde7bf3e09a70322d04c26dd04b5c9489c 100644 --- a/Test/spv.430.vert +++ b/Test/spv.430.vert @@ -1,6 +1,6 @@ #version 430 core -layout(location = 4) uniform vec4 uv4; + out gl_PerVertex { float gl_ClipDistance[]; @@ -13,7 +13,7 @@ highp in vec4 badorder; out invariant vec4 badorder2; out flat vec4 badorder3; -uniform float f; +in float f; void main() { diff --git a/Test/spv.AofA.frag b/Test/spv.AofA.frag index 606d73b0b744568440b67b51644e50d143e3b1a5..62847100e8f8993dd377c8612123c044c17d6021 100644 --- a/Test/spv.AofA.frag +++ b/Test/spv.AofA.frag @@ -12,7 +12,7 @@ float[4][5][6] many[1][2][3]; float g4[4][7]; in float g5[5][7]; -uniform int i, j, k; +flat in int i, j, k; float[4][7] foo(float a[5][7]) { diff --git a/Test/spv.Operations.frag b/Test/spv.Operations.frag index de0fa2d6d4874787af7dd67e259393f6a19f6190..5c8c8af0e55be5c51d47fb3e20ae2fa23b36d938 100644 --- a/Test/spv.Operations.frag +++ b/Test/spv.Operations.frag @@ -1,14 +1,13 @@ #version 450 -uniform ivec4 uiv4; -uniform vec4 uv4; -uniform bool ub; -uniform bvec4 ub41, ub42; -uniform float uf; -uniform int ui; - -uniform uvec4 uuv4; -uniform uint uui; +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bvec4 ub41, ub42; +in float uf; +flat in int ui; +flat in uvec4 uuv4; +flat in uint uui; out vec4 FragColor; diff --git a/Test/spv.accessChain.frag b/Test/spv.accessChain.frag index 0cbf6b3c6f7f798b96aa0b6e96368559e1b0198b..41ec0ca33f8269a3f0832730b145f932ea734367 100644 --- a/Test/spv.accessChain.frag +++ b/Test/spv.accessChain.frag @@ -7,7 +7,7 @@ struct S layout(location = 0) out vec3 OutColor; -uniform int u; +flat in int u; void GetColor1(const S i) { diff --git a/Test/spv.aggOps.frag b/Test/spv.aggOps.frag index c31186df941de0a6bee3067e94842e5e7d67fccb..bc34d7acd4df6b3dd8404ea28bffefc730473f46 100644 --- a/Test/spv.aggOps.frag +++ b/Test/spv.aggOps.frag @@ -17,13 +17,8 @@ struct s2 { s1 s1_1; }; -uniform s1 foo1; -uniform s2 foo2a; -uniform s2 foo2b; - -layout(std140) uniform bn { - s2 foo2a; -} bi; +layout(std140) uniform ub1 { s2 foo2a; } uName1; +layout(std430) buffer ub2 { s2 foo2b; } uName2; void main() { @@ -32,7 +27,7 @@ void main() a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); - if (foo2a == foo2b) + if (uName1.foo2a == uName2.foo2b) v = texture(samp2D, coord); else v = texture(samp2D, 2.0*coord); @@ -52,8 +47,5 @@ void main() if (a != b) v *= 7.0; - if (bi.foo2a != foo2a) - v *= 8.0; - color = v; } diff --git a/Test/spv.atomic.comp b/Test/spv.atomic.comp index 76e0c3dfbeb654e0dedcd8264be7e6f39ff53a00..d1215f7cdbf13d2b5494043d1ce77a51e594f4d7 100644 --- a/Test/spv.atomic.comp +++ b/Test/spv.atomic.comp @@ -1,9 +1,11 @@ #version 310 es +#extension GL_ARB_gl_spirv : enable + layout(binding = 0) uniform atomic_uint counter; layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; -uniform uint value; +shared uint value; int arrX[gl_WorkGroupSize.x]; int arrY[gl_WorkGroupSize.y]; diff --git a/Test/spv.bitCast.frag b/Test/spv.bitCast.frag index db7d453ee0756b6f29a580c95cae2af5345d9d35..73c7e3037cb66d5ceaa6db855792d6532c126f54 100644 --- a/Test/spv.bitCast.frag +++ b/Test/spv.bitCast.frag @@ -1,19 +1,19 @@ #version 450 -uniform int i1; -uniform ivec2 i2; -uniform ivec3 i3; -uniform ivec4 i4; - -uniform uint u1; -uniform uvec2 u2; -uniform uvec3 u3; -uniform uvec4 u4; - -uniform float f1; -uniform vec2 f2; -uniform vec3 f3; -uniform vec4 f4; +flat in int i1; +flat in ivec2 i2; +flat in ivec3 i3; +flat in ivec4 i4; + +flat in uint u1; +flat in uvec2 u2; +flat in uvec3 u3; +flat in uvec4 u4; + +in float f1; +in vec2 f2; +in vec3 f3; +in vec4 f4; out vec4 fragColor; diff --git a/Test/spv.branch-return.vert b/Test/spv.branch-return.vert index e7a7e38704e3501d072cc587ca830f98c320c20b..4b2f5d447cda6682d721f5db909c81d3f4a4df50 100644 --- a/Test/spv.branch-return.vert +++ b/Test/spv.branch-return.vert @@ -1,6 +1,6 @@ #version 310 es void main() { - switch (gl_InstanceID) { + switch (gl_InstanceIndex) { case 0: return; case 1: gl_Position = vec4(0.0); break; case 2: return; diff --git a/Test/spv.conversion.frag b/Test/spv.conversion.frag index dbd14e29d536be87d303b607c5013240679f6066..3b5e5123f7b3655ce5a3d6c11e593ed643d62f42 100644 --- a/Test/spv.conversion.frag +++ b/Test/spv.conversion.frag @@ -1,24 +1,24 @@ #version 140 -uniform bool u_b; -uniform bvec2 u_b2; -uniform bvec3 u_b3; -uniform bvec4 u_b4; +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; -uniform int u_i; -uniform ivec2 u_i2; -uniform ivec3 u_i3; -uniform ivec4 u_i4; - -uniform float u_f; -uniform vec2 u_f2; -uniform vec3 u_f3; -uniform vec4 u_f4; +int u_i; +ivec2 u_i2; +ivec3 u_i3; +ivec4 u_i4; -uniform bool i_b; -uniform bvec2 i_b2; -uniform bvec3 i_b3; -uniform bvec4 i_b4; +float u_f; +vec2 u_f2; +vec3 u_f3; +vec4 u_f4; + +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; flat in int i_i; flat in ivec2 i_i2; diff --git a/Test/spv.dataOutIndirect.frag b/Test/spv.dataOutIndirect.frag index 979a94065706ef96d6765afb1cfde20c975a5cfa..88a32d58291e4ff4f110abc55b7f7b3e22cb7498 100644 --- a/Test/spv.dataOutIndirect.frag +++ b/Test/spv.dataOutIndirect.frag @@ -2,9 +2,11 @@ in vec4 Color; -uniform int i; +out vec4 fcolor[4]; + +uniform b { int i; } bName; void main() { - gl_FragData[i] = Color; + fcolor[bName.i] = Color; } diff --git a/Test/spv.doWhileLoop.frag b/Test/spv.doWhileLoop.frag index f4b52403bed56cbaf13f927a47e67025a819747d..5abdb61be314f7d75a42ea984afaffe7d5adca0b 100644 --- a/Test/spv.doWhileLoop.frag +++ b/Test/spv.doWhileLoop.frag @@ -1,8 +1,8 @@ #version 140 -uniform vec4 bigColor; +in vec4 bigColor; in vec4 BaseColor; -uniform float d; +in float d; void main() { diff --git a/Test/spv.double.comp b/Test/spv.double.comp index 8f4a7893f3b156194fa949c1d94ba90840b30059..6397e6305b75d7bfef083bc00d430d3de69a636a 100644 --- a/Test/spv.double.comp +++ b/Test/spv.double.comp @@ -10,7 +10,7 @@ buffer bufName { double d; } bufInst; -uniform double roll; + uniform writeonly image2D destTex; void main() diff --git a/Test/spv.earlyReturnDiscard.frag b/Test/spv.earlyReturnDiscard.frag index d0d15c2327aa15901f2179a0183836cde6899a51..bba4b76d26f17ef5d4f4f7688ea0b84ae5d1b5f6 100644 --- a/Test/spv.earlyReturnDiscard.frag +++ b/Test/spv.earlyReturnDiscard.frag @@ -1,20 +1,20 @@ #version 140 -uniform float d; -uniform vec4 bigColor, smallColor; -uniform vec4 otherColor; +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; in float c; -uniform float threshhold; -uniform float threshhold2; -uniform float threshhold3; +in float threshhold; +in float threshhold2; +in float threshhold3; -uniform float minimum; +in float minimum; in vec4 BaseColor; -uniform bool b; +bool b; void main() { diff --git a/Test/spv.flowControl.frag b/Test/spv.flowControl.frag index 86046c3282f5a77357ee9a6288c3ee99cc58a045..f10c767307af33bdfe0ef9d4575a7d6255e6801f 100644 --- a/Test/spv.flowControl.frag +++ b/Test/spv.flowControl.frag @@ -1,8 +1,8 @@ #version 140 -uniform float d; -uniform vec4 bigColor, smallColor; -uniform vec4 otherColor; +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; in float c; in vec4 BaseColor; diff --git a/Test/spv.forLoop.frag b/Test/spv.forLoop.frag index 0da72e1941c5814697068e72fd36fdda9a6add4c..dfa58ad42cc65fd2c81996e110010a84c03defcf 100644 --- a/Test/spv.forLoop.frag +++ b/Test/spv.forLoop.frag @@ -1,11 +1,11 @@ #version 140 -uniform vec4 bigColor; +in vec4 bigColor; in vec4 BaseColor; in float f; -uniform int Count; -uniform uvec4 v4; +flat in int Count; +flat in uvec4 v4; void main() { diff --git a/Test/spv.forwardFun.frag b/Test/spv.forwardFun.frag index c113e85f764018abc170aefec3ef0ef1cc46d3a0..0a71521eec98e86cf58f30c346ce7f6aa4fb35cd 100644 --- a/Test/spv.forwardFun.frag +++ b/Test/spv.forwardFun.frag @@ -2,9 +2,9 @@ precision mediump float; -uniform vec4 bigColor; +in vec4 bigColor; in vec4 BaseColor; -uniform float d; +in float d; void bar(); float foo(vec4); diff --git a/Test/spv.functionCall.frag b/Test/spv.functionCall.frag index bf911fd21278e21f9ce56af98763f64281269046..139638d2fe8dcba1ff917bec77fab66e829cf505 100644 --- a/Test/spv.functionCall.frag +++ b/Test/spv.functionCall.frag @@ -1,8 +1,8 @@ #version 140 -uniform vec4 bigColor; -in vec4 BaseColor; -uniform float d; +varying vec4 bigColor; +varying vec4 BaseColor; +varying float d; float h = 0.0; diff --git a/Test/spv.functionSemantics.frag b/Test/spv.functionSemantics.frag index 67ff5f51625faf6df4a8df0053afa3f217650f47..a9b59b761cb105cf87115cb84ac3d4b0f21f93f1 100644 --- a/Test/spv.functionSemantics.frag +++ b/Test/spv.functionSemantics.frag @@ -1,6 +1,6 @@ #version 400 -uniform float u; +in float u; int foo(int a, const int b, in int c, const in int d, out int e, inout int f) { diff --git a/Test/spv.image.frag b/Test/spv.image.frag index 433687dc9533651aa7e39439cbda96db7576f431..30b339ce1a4206bfff7bb71680336006d8960c4c 100644 --- a/Test/spv.image.frag +++ b/Test/spv.image.frag @@ -15,14 +15,14 @@ layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray; layout(r32i, binding = 11) uniform iimage1D ii1D; layout(r32ui, binding = 12) uniform uimage2D ui2D; -writeonly layout(binding = 1) uniform image2D wo2D; +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; -uniform int ic1D; -uniform ivec2 ic2D; -uniform ivec3 ic3D; -uniform ivec4 ic4D; +writeonly layout(binding = 1) uniform image2D wo2D; -uniform uint value; +flat in uint value; out vec4 fragData; diff --git a/Test/spv.interpOps.frag b/Test/spv.interpOps.frag index fccf304a0d94c5b674fa14cfd1ded019acbc955e..afe28dc3a279c084e762c4fb8f57af28dbf1498b 100644 --- a/Test/spv.interpOps.frag +++ b/Test/spv.interpOps.frag @@ -5,8 +5,8 @@ in vec2 if2; in vec3 if3; in vec4 if4; -uniform int samp; -uniform vec2 offset; +flat in int samp; +flat in vec2 offset; out vec4 fragColor; diff --git a/Test/spv.length.frag b/Test/spv.length.frag index 5221c8339df91946adfce5f489e2a75011b45eb0..3b3db0b42897906f435922c0cb61727469c1ea33 100644 --- a/Test/spv.length.frag +++ b/Test/spv.length.frag @@ -1,6 +1,6 @@ #version 140 -uniform vec4 u[3]; +vec4 u[3]; in vec2 v[2]; diff --git a/Test/spv.localAggregates.frag b/Test/spv.localAggregates.frag index 47224ba39510a7561c8415d7d473ae36483d7a09..9bdb11b760298cea168fed49cfb34d64c575d617 100644 --- a/Test/spv.localAggregates.frag +++ b/Test/spv.localAggregates.frag @@ -1,4 +1,4 @@ -#version 140 +#version 400 uniform sampler2D samp2D; in vec2 coord; @@ -24,12 +24,12 @@ struct s3 { }; -uniform s1 foo; -uniform s2 foo2; -uniform s3 foo3; +flat in s1 foo; +flat in s2 foo2; +flat in s3 foo3; -uniform float[16] uFloatArray; -uniform int condition; + +flat in int condition; void main() { diff --git a/Test/spv.loops.frag b/Test/spv.loops.frag index b9e960a6735edc1c201255800741090e35877396..b9ec09975f2e8c84807a905b6612fadf8c081a28 100644 --- a/Test/spv.loops.frag +++ b/Test/spv.loops.frag @@ -1,54 +1,36 @@ #version 140 -uniform vec4 bigColor; -uniform vec4 bigColor1_1; -uniform vec4 bigColor1_2; -uniform vec4 bigColor1_3; -uniform vec4 bigColor2; -uniform vec4 bigColor3; -uniform vec4 bigColor4; -uniform vec4 bigColor5; -uniform vec4 bigColor6; -uniform vec4 bigColor7; -uniform vec4 bigColor8; +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; in vec4 BaseColor; -uniform float d; -uniform float d2; -uniform float d3; -uniform float d4; -uniform float d5; -uniform float d6; -uniform float d7; -uniform float d8; -uniform float d9; -uniform float d10; -uniform float d11; -uniform float d12; -uniform float d13; -uniform float d14; -uniform float d15; -uniform float d16; -uniform float d17; -uniform float d18; -uniform float d19; -uniform float d20; -uniform float d21; -uniform float d22; -uniform float d23; -uniform float d24; -uniform float d25; -uniform float d26; -uniform float d27; -uniform float d28; -uniform float d29; -uniform float d30; -uniform float d31; -uniform float d32; -uniform float d33; -uniform float d34; - -uniform int Count; +in float d; +in float d2; +in float d3; +in float d4; +in float d5; +in float d6; +in float d7; +in float d8; +in float d9; +in float d10; +in float d11; +in float d12; +in float d14; +in float d15; +in float d16; +in float d17; +in float d18; +flat in int Count; void main() { diff --git a/Test/spv.loopsArtificial.frag b/Test/spv.loopsArtificial.frag index 05b3dcbc14c26b365cba10f403b06ea2b8d527ad..ae380b9456d8c8f440a3bc7cb8bc31932b2aea75 100644 --- a/Test/spv.loopsArtificial.frag +++ b/Test/spv.loopsArtificial.frag @@ -1,54 +1,25 @@ #version 140 -uniform vec4 bigColor; -uniform vec4 bigColor1_1; -uniform vec4 bigColor1_2; -uniform vec4 bigColor1_3; -uniform vec4 bigColor2; -uniform vec4 bigColor3; -uniform vec4 bigColor4; -uniform vec4 bigColor5; -uniform vec4 bigColor6; -uniform vec4 bigColor7; -uniform vec4 bigColor8; +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; in vec4 BaseColor; -uniform float d; -uniform float d2; -uniform float d3; -uniform float d4; -uniform float d5; -uniform float d6; -uniform float d7; -uniform float d8; -uniform float d9; -uniform float d10; -uniform float d11; -uniform float d12; -uniform float d13; -uniform float d14; -uniform float d15; -uniform float d16; -uniform float d17; -uniform float d18; -uniform float d19; -uniform float d20; -uniform float d21; -uniform float d22; -uniform float d23; -uniform float d24; -uniform float d25; -uniform float d26; -uniform float d27; -uniform float d28; -uniform float d29; -uniform float d30; -uniform float d31; -uniform float d32; -uniform float d33; -uniform float d34; +in float d; +in float d2; +in float d3; +in float d4; +in float d13; -uniform int Count; +flat in int Count; void main() { diff --git a/Test/spv.matFun.vert b/Test/spv.matFun.vert index 64328d72d3a1a411aa942983cc2c80ad387a904e..49e882f40274431a0296f56d4ad5d11c4160144f 100644 --- a/Test/spv.matFun.vert +++ b/Test/spv.matFun.vert @@ -1,7 +1,9 @@ -#version 140 +#version 400 -uniform mat4 m4; -uniform mat3 m3; +uniform bl { + uniform mat4 m4; + uniform mat3 m3; +} bName; in vec3 v3; @@ -22,5 +24,5 @@ vec3 mxv(mat4 m4, vec3 v) void main() { - gl_Position = vec4(mxv(m4, v3) + xf(m3, v3), 1.0); + gl_Position = vec4(mxv(bName.m4, v3) + xf(bName.m3, v3), 1.0); } diff --git a/Test/spv.nonSquare.vert b/Test/spv.nonSquare.vert index 9ef7055974b80918959b6f319adeb3f17e9ae9fd..9f7125bdf5db34650c2af70b5f6ac97acc9a1a3e 100644 --- a/Test/spv.nonSquare.vert +++ b/Test/spv.nonSquare.vert @@ -1,9 +1,9 @@ #version 140 -attribute vec3 v3; -attribute vec4 v4; +in vec3 v3; +in vec4 v4; -uniform mat3x2 m32; +out mat3x2 m32; const vec2 cv2 = vec2(10.0, 20.0); const mat2x4 m24 = mat2x4(3.0); diff --git a/Test/spv.precision.frag b/Test/spv.precision.frag index 997e4ead61452669e97af24a0b95374d5ded7bb3..090c1a6a1398460b7ee00a14f1f4be676dfd14e2 100644 --- a/Test/spv.precision.frag +++ b/Test/spv.precision.frag @@ -4,10 +4,10 @@ in lowp float lowfin; in mediump float mediumfin; in highp vec4 highfin; -uniform highp int uniform_high; -uniform mediump int uniform_medium; -uniform lowp int uniform_low; -uniform bvec2 ub2; +highp int uniform_high; +mediump int uniform_medium; +lowp int uniform_low; +bvec2 ub2; out mediump vec4 mediumfout; diff --git a/Test/spv.pushConstant.vert b/Test/spv.pushConstant.vert new file mode 100644 index 0000000000000000000000000000000000000000..b1721bc60270b1103df6de3b386ffd1b4a4c54d3 --- /dev/null +++ b/Test/spv.pushConstant.vert @@ -0,0 +1,17 @@ +#version 400 + +layout(push_constant) uniform Material { + int kind; + float fa[3]; +} matInst; + +out vec4 color; + +void main() +{ + switch (matInst.kind) { + case 1: color = vec4(0.2); break; + case 2: color = vec4(0.5); break; + default: color = vec4(0.0); break; + } +} diff --git a/Test/spv.separate.frag b/Test/spv.separate.frag new file mode 100644 index 0000000000000000000000000000000000000000..21e5db33016092fb034c056376319672835591f5 --- /dev/null +++ b/Test/spv.separate.frag @@ -0,0 +1,95 @@ +#version 400 + +uniform sampler s; +uniform samplerShadow sShadow; +uniform sampler sA[4]; +uniform texture2D t2d; +uniform texture3D t3d[4]; +flat in int i; + +out vec4 color; + +void main() +{ + color = texture(sampler2D(t2d, s), vec2(0.5)); + color += texture(sampler3D(t3d[i], sA[2]), vec3(0.5)); + color += texture(sampler2D(t2d, s), vec2(0.5)); +} + +uniform texture2D tex2D; +uniform textureCube texCube; +uniform textureCubeArray texCubeArray; +uniform itextureCubeArray itexCubeArray; +uniform utextureCubeArray utexCubeArray; +uniform itexture1DArray itex1DArray; +uniform utexture1D utex1D; +uniform itexture1D itex1D; +uniform utexture1DArray utex1DArray; +uniform textureBuffer texBuffer; +uniform texture2DArray tex2DArray; +uniform itexture2D itex2D; +uniform itexture3D itex3D; +uniform itextureCube itexCube; +uniform itexture2DArray itex2DArray; +uniform utexture2D utex2D; +uniform utexture3D utex3D; +uniform utextureCube utexCube; +uniform utexture2DArray utex2DArray; +uniform itexture2DRect itex2DRect; +uniform utexture2DRect utex2DRect; +uniform itextureBuffer itexBuffer; +uniform utextureBuffer utexBuffer; +uniform texture2DMS tex2DMS; +uniform itexture2DMS itex2DMS; +uniform utexture2DMS utex2DMS; +uniform texture2DMSArray tex2DMSArray; +uniform itexture2DMSArray itex2DMSArray; +uniform utexture2DMSArray utex2DMSArray; +uniform texture1D tex1D; +uniform texture3D tex3D; +uniform texture2DRect tex2DRect; +uniform texture1DArray tex1DArray; + +void foo() +{ + sampler2D (tex2D, s); + samplerCube (texCube, s); + samplerCubeArray (texCubeArray, s); + samplerCubeArrayShadow (texCubeArray, sShadow); + isamplerCubeArray (itexCubeArray, s); + usamplerCubeArray (utexCubeArray, s); + sampler1DArrayShadow (tex1DArray, sShadow); + isampler1DArray (itex1DArray, s); + usampler1D (utex1D, s); + isampler1D (itex1D, s); + usampler1DArray (utex1DArray, s); + samplerBuffer (texBuffer, s); + samplerCubeShadow (texCube, sShadow); + sampler2DArray (tex2DArray, s); + sampler2DArrayShadow (tex2DArray, sShadow); + isampler2D (itex2D, s); + isampler3D (itex3D, s); + isamplerCube (itexCube, s); + isampler2DArray (itex2DArray, s); + usampler2D (utex2D, s); + usampler3D (utex3D, s); + usamplerCube (utexCube, s); + usampler2DArray (utex2DArray, s); + isampler2DRect (itex2DRect, s); + usampler2DRect (utex2DRect, s); + isamplerBuffer (itexBuffer, s); + usamplerBuffer (utexBuffer, s); + sampler2DMS (tex2DMS, s); + isampler2DMS (itex2DMS, s); + usampler2DMS (utex2DMS, s); + sampler2DMSArray (tex2DMSArray, s); + isampler2DMSArray (itex2DMSArray, s); + usampler2DMSArray (utex2DMSArray, s); + sampler1D (tex1D, s); + sampler1DShadow (tex1D, sShadow); + sampler3D (tex3D, s); + sampler2DShadow (tex2D, sShadow); + sampler2DRect (tex2DRect, s); + sampler2DRectShadow (tex2DRect, sShadow); + sampler1DArray (tex1DArray, s); +} diff --git a/Test/spv.shiftOps.frag b/Test/spv.shiftOps.frag index 498d5bd163ccc1ca4c4b568f6c0cdc34a5fb7a1c..7fb937f43008ad595c3958a129eea37171c16fdc 100644 --- a/Test/spv.shiftOps.frag +++ b/Test/spv.shiftOps.frag @@ -1,10 +1,9 @@ #version 450 -uniform int i1; -uniform uint u1; - -uniform ivec3 i3; -uniform uvec3 u3; +flat in int i1; +flat in uint u1; +flat in ivec3 i3; +flat in uvec3 u3; out ivec3 icolor; out uvec3 ucolor; diff --git a/Test/spv.shortCircuit.frag b/Test/spv.shortCircuit.frag index dc1bf79ac7db5333089f31ca453cb04c95fddc1e..4a626417d97683752cfd9aa1986c3583f9f7d29d 100755 --- a/Test/spv.shortCircuit.frag +++ b/Test/spv.shortCircuit.frag @@ -1,12 +1,12 @@ #version 400 -uniform ivec4 uiv4; -uniform vec4 uv4; -uniform bool ub; -uniform bool uba; -uniform bvec4 ub41, ub42; -uniform float uf; -uniform int ui; +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bool uba; +bvec4 ub41, ub42; +in float uf; +flat in int ui; out float of1; out vec4 of4; diff --git a/Test/spv.simpleFunctionCall.frag b/Test/spv.simpleFunctionCall.frag index a302c334311b98732adb55d22a61daa9bc9c1713..496bb93d7fcd627fd26f667e8d4580e0be0677f5 100644 --- a/Test/spv.simpleFunctionCall.frag +++ b/Test/spv.simpleFunctionCall.frag @@ -1,8 +1,6 @@ #version 150 -uniform vec4 bigColor; in vec4 BaseColor; -uniform float d; vec4 foo() { diff --git a/Test/spv.simpleMat.vert b/Test/spv.simpleMat.vert index afbc0db1fea0811a3bac5a15023820911259a7ff..897a8986c28e29b0b0d3ca57bc1feaf50135852c 100644 --- a/Test/spv.simpleMat.vert +++ b/Test/spv.simpleMat.vert @@ -1,6 +1,6 @@ #version 330 -uniform mat4 mvp; +varying mat4 mvp; in vec4 v; in mat3 am3; diff --git a/Test/spv.sparseTexture.frag b/Test/spv.sparseTexture.frag index 06c89e54e211c9839c0620b26caeebfafbf3bdc1..e4aefc5383de46de42e615c0e9124f095dceec17 100644 --- a/Test/spv.sparseTexture.frag +++ b/Test/spv.sparseTexture.frag @@ -16,11 +16,11 @@ uniform isampler2DArray is2DArray; uniform usamplerCubeArray usCubeArray; uniform usampler2DRect us2DRect; -uniform vec2 c2; -uniform vec3 c3; -uniform vec4 c4; +in vec2 c2; +in vec3 c3; +in vec4 c4; -uniform ivec2 offsets[4]; +in flat ivec2 offsets[4]; out vec4 outColor; diff --git a/Test/spv.sparseTextureClamp.frag b/Test/spv.sparseTextureClamp.frag index 848d3774cff739dcdd11c75e89595c278fdb49d9..97317938a12f1da8f8e98a11a226853f88416230 100644 --- a/Test/spv.sparseTextureClamp.frag +++ b/Test/spv.sparseTextureClamp.frag @@ -15,11 +15,11 @@ uniform isampler2DArray is2DArray; uniform usamplerCubeArray usCubeArray; uniform usampler2DRect us2DRect; -uniform vec2 c2; -uniform vec3 c3; -uniform vec4 c4; +in vec2 c2; +in vec3 c3; +in vec4 c4; -uniform float lodClamp; +in float lodClamp; out vec4 outColor; diff --git a/Test/spv.specConstant.comp b/Test/spv.specConstant.comp new file mode 100644 index 0000000000000000000000000000000000000000..ae8ae19d1d367cc8a3f631c7dee583aca6973464 --- /dev/null +++ b/Test/spv.specConstant.comp @@ -0,0 +1,13 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; + +buffer bn { + uint a; +} bi; + +void main() +{ + bi.a = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z; +} diff --git a/Test/spv.specConstant.vert b/Test/spv.specConstant.vert new file mode 100644 index 0000000000000000000000000000000000000000..0f9764d463ec74316bafa398a1b74065e0e0a962 --- /dev/null +++ b/Test/spv.specConstant.vert @@ -0,0 +1,43 @@ +#version 400 + +layout(constant_id = 16) const int arraySize = 5; +in vec4 ucol[arraySize]; + +layout(constant_id = 17) const bool spBool = true; +layout(constant_id = 18) const float spFloat = 3.14; +layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; +layout(constant_id = 22) const uint scale = 2; + +out vec4 color; +out int size; + +// parameter should be considered same type as ucol +void foo(vec4 p[arraySize]); + +void main() +{ + color = ucol[2]; + size = arraySize; + if (spBool) + color *= scale; + color += float(spDouble / spFloat); + + foo(ucol); +} + +layout(constant_id = 116) const int dupArraySize = 12; +in vec4 dupUcol[dupArraySize]; + +layout(constant_id = 117) const bool spDupBool = true; +layout(constant_id = 118) const float spDupFloat = 3.14; +layout(constant_id = 119) const double spDupDouble = 3.1415926535897932384626433832795; +layout(constant_id = 122) const uint dupScale = 2; + +void foo(vec4 p[arraySize]) +{ + color += dupUcol[2]; + size += dupArraySize; + if (spDupBool) + color *= dupScale; + color += float(spDupDouble / spDupFloat); +} diff --git a/Test/spv.structAssignment.frag b/Test/spv.structAssignment.frag index 0199e9a83ee514c6b304b49c36eba14ccc6faf20..72984f2d452957835b8a20f1ccfaf74340944b8d 100644 --- a/Test/spv.structAssignment.frag +++ b/Test/spv.structAssignment.frag @@ -22,9 +22,9 @@ struct lunarStruct3 { }; -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2; -uniform lunarStruct3 foo3; +lunarStruct1 foo; +lunarStruct2 foo2; +lunarStruct3 foo3; void main() { diff --git a/Test/spv.structDeref.frag b/Test/spv.structDeref.frag index 919361e7fd87328c92253224142d831039753efb..11822cdcb7ae060ab6c45f949bdd377fe91cd84f 100644 --- a/Test/spv.structDeref.frag +++ b/Test/spv.structDeref.frag @@ -31,12 +31,12 @@ struct s3 { }; -uniform s0 foo0; -uniform s1 foo1; -uniform s2 foo2; -uniform s3 foo3; +s0 foo0; +s1 foo1; +s2 foo2; +s3 foo3; -uniform s00 foo00; +s00 foo00; void main() { diff --git a/Test/spv.structure.frag b/Test/spv.structure.frag index 770ad92b7d9cd44d40118939c500acd7981acd3a..b81b9547ac01d88581ece835e479983b218b6e2b 100644 --- a/Test/spv.structure.frag +++ b/Test/spv.structure.frag @@ -14,8 +14,8 @@ struct lunarStruct2 { lunarStruct1 s1_1[7]; }; -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2[5]; +lunarStruct1 foo; +lunarStruct2 foo2[5]; void main() { diff --git a/Test/spv.subpass.frag b/Test/spv.subpass.frag new file mode 100644 index 0000000000000000000000000000000000000000..42411d99cc9dedaaf409b6e1d621b5d8de67a254 --- /dev/null +++ b/Test/spv.subpass.frag @@ -0,0 +1,29 @@ +#version 400 + +layout(input_attachment_index = 1) uniform subpassInput sub; +layout(input_attachment_index = 2) uniform subpassInputMS subMS; +layout(input_attachment_index = 3) uniform isubpassInput isub; +layout(input_attachment_index = 4) uniform isubpassInputMS isubMS; +layout(input_attachment_index = 5) uniform usubpassInput usub; +layout(input_attachment_index = 6) uniform usubpassInputMS usubMS; + +out vec4 color; +out ivec4 icolor; +out uvec4 ucolor; + +void foo(isubpassInputMS sb) +{ + icolor += subpassLoad(sb, 3); +} + +void main() +{ + color = subpassLoad(sub); + color += subpassLoad(subMS, 3); + icolor = subpassLoad(isub); + icolor += subpassLoad(isubMS, 3); + ucolor = subpassLoad(usub); + ucolor += subpassLoad(usubMS, 3); + + foo(isubMS); +} diff --git a/Test/spv.switch.frag b/Test/spv.switch.frag index 828b069fa588bab3bc6a4fd593d9568794e28b7d..1808086a4659080dc875b57d6a95d1e90619d000 100644 --- a/Test/spv.switch.frag +++ b/Test/spv.switch.frag @@ -1,9 +1,9 @@ #version 310 es precision mediump float; -uniform int c, d; +flat in int c, d; in float x; out float color; -uniform vec4 v; +in vec4 v; vec4 foo1(vec4 v1, vec4 v2, int i1) { diff --git a/Test/spv.swizzle.frag b/Test/spv.swizzle.frag index 476136fb6c77f8a34164003abcfe8e964d988027..5a5a203c32a529c13755a204f91a5cf4c89874fa 100644 --- a/Test/spv.swizzle.frag +++ b/Test/spv.swizzle.frag @@ -1,8 +1,8 @@ #version 140 -uniform float blend; -uniform vec4 u; -uniform bool p; +in float blend; +in vec4 u; +bool p; in vec2 t; diff --git a/Test/spv.test.frag b/Test/spv.test.frag index c4fe62d205cc0996a5be060e2f0df5a0582f0ffe..3d4d8f9607931da7c7a2f513b64af2c04aecd431 100644 --- a/Test/spv.test.frag +++ b/Test/spv.test.frag @@ -3,9 +3,9 @@ uniform sampler2D texSampler2D; uniform sampler3D texSampler3D; -uniform float blend; -uniform vec2 scale; -uniform vec4 u; +in float blend; +in vec2 scale; +in vec4 u; in vec2 t; in vec3 coords; diff --git a/Test/spv.test.vert b/Test/spv.test.vert index c1d58aa5426a2851452b51f5ce8465e6a19e6dc7..e2e16aa525dfb5802db8e47839f4c4608443be00 100644 --- a/Test/spv.test.vert +++ b/Test/spv.test.vert @@ -1,6 +1,6 @@ #version 140 -uniform mat4 transform; +in mat4 transform; attribute vec4 position; in vec2 uv_in; diff --git a/Test/spv.texture.frag b/Test/spv.texture.frag index 83de4e3111bee5df1305cf45dba77ceea92c6c13..73884d1c20247f8b70740571a3b9e14ccb53ec22 100644 --- a/Test/spv.texture.frag +++ b/Test/spv.texture.frag @@ -7,9 +7,9 @@ uniform samplerCube texSamplerCube; uniform sampler1DShadow shadowSampler1D; uniform sampler2DShadow shadowSampler2D; -uniform float blend; -uniform vec2 scale; -uniform vec4 u; +varying float blend; +varying vec2 scale; +varying vec4 u; in vec2 t; in vec2 coords2D; diff --git a/Test/spv.types.frag b/Test/spv.types.frag index 038ebd4dd97b5f4a6f16cedf1e650efd0cae8a65..a2ab1d32447016dc8d360ef9655cab95a3736b26 100644 --- a/Test/spv.types.frag +++ b/Test/spv.types.frag @@ -1,24 +1,21 @@ #version 140 -uniform bool u_b; -uniform bvec2 u_b2; -uniform bvec3 u_b3; -uniform bvec4 u_b4; - -uniform int u_i; -uniform ivec2 u_i2; -uniform ivec3 u_i3; -uniform ivec4 u_i4; - -uniform float u_f; -uniform vec2 u_f2; -uniform vec3 u_f3; -uniform vec4 u_f4; - -uniform bool i_b; -uniform bvec2 i_b2; -uniform bvec3 i_b3; -uniform bvec4 i_b4; +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; +flat in int u_i; +flat in ivec2 u_i2; +flat in ivec3 u_i3; +flat in ivec4 u_i4; + in float u_f; + in vec2 u_f2; + in vec3 u_f3; + in vec4 u_f4; +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; flat in int i_i; flat in ivec2 i_i2; diff --git a/Test/spv.uint.frag b/Test/spv.uint.frag index eea01665a7cff74b8ae9727689a908f7bf06c2b9..92a8f9628e84156a37659182332a44f7244e7e71 100644 --- a/Test/spv.uint.frag +++ b/Test/spv.uint.frag @@ -4,9 +4,9 @@ flat in uvec2 t; in float f; in vec2 tc; -uniform uvec4 v; -uniform int i; -uniform bool b; +flat in uvec4 v; +flat in int i; +bool b; out uvec4 c; diff --git a/Test/spv.uniformArray.frag b/Test/spv.uniformArray.frag index 11a353a5d7b2c9eb298d737be9da41cea904702c..b7625afe84965893cdfd9d52001e484040edc918 100644 --- a/Test/spv.uniformArray.frag +++ b/Test/spv.uniformArray.frag @@ -1,8 +1,9 @@ #version 140 + uniform sampler2D texSampler2D; -uniform vec3 inColor; -uniform vec4 color[6]; -uniform float alpha[16]; +in vec3 inColor; +in vec4 color[6]; +in float alpha[16]; void main() { diff --git a/Test/spv.variableArrayIndex.frag b/Test/spv.variableArrayIndex.frag index 2d28c23498418a27b399aa57d7f322981c492f94..cc304b8effed72a320528254327e480667f372c5 100644 --- a/Test/spv.variableArrayIndex.frag +++ b/Test/spv.variableArrayIndex.frag @@ -1,4 +1,5 @@ -#version 140 +#version 400 + uniform sampler2D samp2D; in vec2 coord; @@ -21,10 +22,10 @@ struct lunarStruct3 { }; -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2[5]; -uniform lunarStruct3 foo3; -uniform int Count; +flat in lunarStruct1 foo; +flat in lunarStruct2 foo2[5]; +flat in lunarStruct3 foo3; +flat in int Count; void main() { diff --git a/Test/spv.varyingArrayIndirect.frag b/Test/spv.varyingArrayIndirect.frag index 2ab5e2056668b1740ed8abb9f161cb2c746b6da8..a556c9eb5af2139378f92d5d5df87efede068a13 100644 --- a/Test/spv.varyingArrayIndirect.frag +++ b/Test/spv.varyingArrayIndirect.frag @@ -7,7 +7,7 @@ in vec4 TexCoord[6]; in vec4 userIn[2]; -uniform int a, b; +flat in int a, b; void main() { diff --git a/Test/spv.voidFunction.frag b/Test/spv.voidFunction.frag index 6658ada22b798cdb2936635a28f3aebbb7983b6d..228ea1ffdd76333966268a09edb3661cf121aec7 100644 --- a/Test/spv.voidFunction.frag +++ b/Test/spv.voidFunction.frag @@ -1,8 +1,8 @@ -#version 140 +#version 400 -uniform vec4 bigColor; +in vec4 bigColor; in vec4 BaseColor; -uniform float d; +in float d; float bar = 2.0; diff --git a/Test/spv.whileLoop.frag b/Test/spv.whileLoop.frag index ef5772132b829b819ef6dd417c3845fa48dd702b..f7b7141eae7180a7b3c9a5c184198a6c790e9a8d 100644 --- a/Test/spv.whileLoop.frag +++ b/Test/spv.whileLoop.frag @@ -1,8 +1,8 @@ #version 140 -uniform vec4 bigColor; +in vec4 bigColor; in vec4 BaseColor; -uniform float d; +in float d; void main() { diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 2182cad9643ff3b7afa07e60f03b23cca34769e2..51e2e8f3bf1d448c50cb43b7ffe6981868e7129e 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -91,7 +91,15 @@ spv.varyingArray.frag spv.varyingArrayIndirect.frag spv.voidFunction.frag spv.whileLoop.frag -spv.atomic.comp spv.AofA.frag spv.queryL.frag +spv.separate.frag spv.shortCircuit.frag +spv.pushConstant.vert +spv.subpass.frag +spv.specConstant.vert +spv.specConstant.comp +# GLSL-level semantics +vulkan.frag +vulkan.vert +vulkan.comp diff --git a/Test/testlist b/Test/testlist index 34780403e6ff53b27dc2726ff288f4d2d5b6119d..d60fbca4e76f00fd878a55f29572d6e3041cfbd6 100644 --- a/Test/testlist +++ b/Test/testlist @@ -127,3 +127,5 @@ varyingArray.frag varyingArrayIndirect.frag voidFunction.frag whileLoop.frag +nonVulkan.frag +spv.atomic.comp diff --git a/Test/vulkan.comp b/Test/vulkan.comp new file mode 100644 index 0000000000000000000000000000000000000000..6b6f4cf3b4db2cd3c16da1377aba0069d37477ac --- /dev/null +++ b/Test/vulkan.comp @@ -0,0 +1,12 @@ +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; +layout(local_size_z_id = 14) in; // ERROR, can't change this + +void main() +{ + gl_WorkGroupSize; +} + +layout(local_size_y_id = 19) in; // ERROR, already used: TODO not yet reported diff --git a/Test/vulkan.frag b/Test/vulkan.frag new file mode 100644 index 0000000000000000000000000000000000000000..b96647c7678061559f05c4640e2b84061621432a --- /dev/null +++ b/Test/vulkan.frag @@ -0,0 +1,69 @@ +#version 450 + +uniform sampler s; +uniform sampler sA[4]; +uniform texture2D t2d; +uniform texture3D t3d[4]; +int i; +uniform samplerShadow sShadow; +uniform texture3D t3d5[5]; +writeonly uniform image2D i2d; + +void badConst() +{ + sampler2D(t2d); // ERROR, need 2 args + sampler2D(s, s); // ERROR, wrong type + sampler2D(i, i); // ERROR, wrong type + sampler2D(t2d, i); // ERROR, wrong type + sampler2D(t2d, t2d); // ERROR, wrong type + sampler2D(t2d, sA); // ERROR, wrong type + + sampler3D[4](t3d5, sA[2]); // ERROR, can't make array + sampler2D(i2d, s); // ERROR, image instead of texture + sampler2D(t3d[1], s); // ERROR, 3D not 2D + sampler2D(t2d, sShadow); // ERROR, shadow mismatch + sampler2DShadow(t2d, s); // ERROR, shadow mismatch +} + +sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor +sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor + +out vec4 color; + +void main() +{ + color = texture(s2D, vec2(0.5)); + color += texture(s3d[i], vec3(0.5)); +} + +layout(push_constant) buffer pcb { // ERROR, not on a buffer + int a; +} pcbInst; + +layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block + +layout(push_constant) uniform; // ERROR, needs an object + +layout(push_constant) uniform pcb2 { + int a; +}; // ERROR, no instance name + +layout(input_attachment_index = 2) uniform subpassInput subD; +layout(input_attachment_index = 3) uniform texture2D subDbad1; // ERROR, not a texture +layout(input_attachment_index = 4) writeonly uniform image2D subDbad2; // ERROR, not an image +uniform subpassInput subDbad3; // ERROR, need attachment number +layout(input_attachment_index = 2) uniform subpassInputMS subDMS; + +void foo() +{ + vec4 v = subpassLoad(subD); + v += subpassLoadMS(subD); // ERROR, no such function + v += subpassLoad(subD, 2); // ERROR, no such sig. + v += subpassLoad(subDMS, 2); + v += subpassLoadMS(subDMS, 2); // ERROR, no such function +} + +subroutine int fooS; // ERROR, not in SPV +subroutine int fooSub(); // ERROR, not in SPV + +uniform vec4 dv4; // ERROR, no default uniforms diff --git a/Test/vulkan.vert b/Test/vulkan.vert new file mode 100644 index 0000000000000000000000000000000000000000..a4ee9cd1979f081d42b8a43ef5d849ac9fb6ea38 --- /dev/null +++ b/Test/vulkan.vert @@ -0,0 +1,37 @@ +#version 450 + +layout(input_attachment_index = 2) uniform subpassInput subD1; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInput subD2; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInput subD3; // ERROR, not this stage +layout(input_attachment_index = 2) uniform subpassInputMS subD4; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInputMS subD5; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInputMS subD6; // ERROR, not this stage + +out vec4 color; + +layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13); // ERROR, not a scalar +layout(constant_id = 17) uniform sampler2D s2D; // ERROR, not the right type or qualifier +layout(constant_id = 4000) const int c1 = 12; // ERROR, too big +layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0); // ERROR, not a scalar +layout(constant_id = 4) in; + +void main() +{ + color = subpassLoad(subD1); // ERROR, no such function in this stage +} + +layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan +layout(shared) uniform ub1n { int a; } ub1i; // ERROR, no shared +layout(packed) uniform ub2n { int a; } ub2i; // ERROR, no packed + +layout(constant_id=222) const int arraySize = 4; + +void foo() +{ + int a1[arraySize]; + int a2[arraySize] = a1; // ERROR, can't use in initializer + + a1 = a2; // ERROR, can't assign, even though the same type + if (a1 == a2) // ERROR, can't compare either + ++color; +} \ No newline at end of file diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h index 35d47af23ac5056d1e3571ff883ff00915b09870..ca1fa4c3bbd1a8ec25d3f8da9262320f925393ad 100644 --- a/glslang/Include/BaseTypes.h +++ b/glslang/Include/BaseTypes.h @@ -130,6 +130,8 @@ enum TBuiltInVariable { EbvLocalInvocationIndex, EbvVertexId, EbvInstanceId, + EbvVertexIndex, + EbvInstanceIndex, EbvBaseVertex, EbvBaseInstance, EbvDrawId, @@ -221,6 +223,8 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvLocalInvocationIndex: return "LocalInvocationIndex"; case EbvVertexId: return "VertexId"; case EbvInstanceId: return "InstanceId"; + case EbvVertexIndex: return "VertexIndex"; + case EbvInstanceIndex: return "InstanceIndex"; case EbvBaseVertex: return "BaseVertex"; case EbvBaseInstance: return "BaseInstance"; case EbvDrawId: return "DrawId"; diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index f1695839cb0f730c6733e9fa068cff711cfd2b4f..1d78130ad6a0f5602461a2ed957dc80f97896b9b 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -63,6 +64,7 @@ enum TSamplerDim { EsdCube, EsdRect, EsdBuffer, + EsdSubpass, // goes only with non-sampled image (image is true) EsdNumDims }; @@ -73,8 +75,16 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool shadow : 1; bool ms : 1; bool image : 1; // image, combined should be false + bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler + bool sampler : 1; // true means a pure sampler, other fields should be clear() bool external : 1; // GL_OES_EGL_image_external + bool isImage() const { return image && dim != EsdSubpass; } + bool isSubpass() const { return dim == EsdSubpass; } + bool isCombined() const { return combined; } + bool isPureSampler() const { return sampler; } + bool isTexture() const { return !sampler && !image; } + void clear() { type = EbtVoid; @@ -83,6 +93,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler, shadow = false; ms = false; image = false; + combined = false; + sampler = false; external = false; } @@ -95,6 +107,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, arrayed = a; shadow = s; ms = m; + combined = true; } // make an image @@ -109,6 +122,35 @@ struct TSampler { // misnomer now; includes images, textures without sampler, image = true; } + // make a texture with no sampler + void setTexture(TBasicType t, TSamplerDim d, bool a = false, bool s = false, bool m = false) + { + clear(); + type = t; + dim = d; + arrayed = a; + shadow = s; + ms = m; + } + + // make a subpass input attachment + void setSubpass(TBasicType t, bool m = false) + { + clear(); + type = t; + image = true; + dim = EsdSubpass; + ms = m; + } + + // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword + void setPureSampler(bool s) + { + clear(); + sampler = true; + shadow = s; + } + bool operator==(const TSampler& right) const { return type == right.type && @@ -117,6 +159,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler, shadow == right.shadow && ms == right.ms && image == right.image && + combined == right.combined && + sampler == right.sampler && external == right.external; } @@ -129,6 +173,11 @@ struct TSampler { // misnomer now; includes images, textures without sampler, { TString s; + if (sampler) { + s.append("sampler"); + return s; + } + switch (type) { case EbtFloat: break; case EbtInt: s.append("i"); break; @@ -136,9 +185,14 @@ struct TSampler { // misnomer now; includes images, textures without sampler, default: break; // some compilers want this } if (image) { - s.append("image"); - } else { + if (dim == EsdSubpass) + s.append("subpass"); + else + s.append("image"); + } else if (combined) { s.append("sampler"); + } else { + s.append("texture"); } if (external) { s.append("ExternalOES"); @@ -151,6 +205,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler, case EsdCube: s.append("Cube"); break; case EsdRect: s.append("2DRect"); break; case EsdBuffer: s.append("Buffer"); break; + case EsdSubpass: s.append("Input"); break; default: break; // some compilers want this } if (ms) @@ -352,6 +407,7 @@ public: restrict = false; readonly = false; writeonly = false; + specConstant = false; clearLayout(); } @@ -370,6 +426,7 @@ public: bool restrict : 1; bool readonly : 1; bool writeonly : 1; + bool specConstant : 1; // having a constant_id is not sufficient: expressions have no id, but are still specConstant bool isMemory() const { @@ -505,8 +562,12 @@ public: layoutXfbBuffer = layoutXfbBufferEnd; layoutXfbStride = layoutXfbStrideEnd; layoutXfbOffset = layoutXfbOffsetEnd; + layoutAttachment = layoutAttachmentEnd; + layoutSpecConstantId = layoutSpecConstantIdEnd; layoutFormat = ElfNone; + + layoutPushConstant = false; } bool hasLayout() const { @@ -515,7 +576,8 @@ public: hasBinding() || hasStream() || hasXfb() || - hasFormat(); + hasFormat() || + layoutPushConstant; } TLayoutMatrix layoutMatrix : 3; TLayoutPacking layoutPacking : 4; @@ -549,8 +611,16 @@ public: unsigned int layoutXfbOffset : 10; static const unsigned int layoutXfbOffsetEnd = 0x3FF; + unsigned int layoutAttachment : 8; // for input_attachment_index + static const unsigned int layoutAttachmentEnd = 0XFF; + + unsigned int layoutSpecConstantId : 11; + static const unsigned int layoutSpecConstantIdEnd = 0x7FF; + TLayoutFormat layoutFormat : 8; + bool layoutPushConstant; + bool hasUniformLayout() const { return hasMatrix() || @@ -627,6 +697,38 @@ public: { return layoutXfbOffset != layoutXfbOffsetEnd; } + bool hasAttachment() const + { + return layoutAttachment != layoutAttachmentEnd; + } + bool hasSpecConstantId() const + { + // Not the same thing as being a specialization constant, this + // is just whether or not it was declared with an ID. + return layoutSpecConstantId != layoutSpecConstantIdEnd; + } + bool isSpecConstant() const + { + // True if type is a specialization constant, whether or not it + // had a specialization-constant ID, and false if it is not a + // true front-end constant. + return specConstant; + } + bool isFrontEndConstant() const + { + // True if the front-end knows the final constant value. + // This allows front-end constant folding. + return storage == EvqConst && ! specConstant; + } + bool isConstant() const + { + // True if is either kind of constant; specialization or regular. + return isFrontEndConstant() || isSpecConstant(); + } + void makeSpecConstant() + { + specConstant = true; + } static const char* getLayoutPackingString(TLayoutPacking packing) { switch (packing) { @@ -781,6 +883,7 @@ struct TShaderQualifiers { TVertexOrder order; bool pointMode; int localSize[3]; // compute shader + int localSizeSpecId[3]; // compute shader specialization id for gl_WorkGroupSize bool earlyFragmentTests; // fragment input TLayoutDepth layoutDepth; bool blendEquation; // true if any blend equation was specified @@ -798,6 +901,9 @@ struct TShaderQualifiers { localSize[0] = 1; localSize[1] = 1; localSize[2] = 1; + localSizeSpecId[0] = TQualifier::layoutNotSet; + localSizeSpecId[1] = TQualifier::layoutNotSet; + localSizeSpecId[2] = TQualifier::layoutNotSet; earlyFragmentTests = false; layoutDepth = EldNone; blendEquation = false; @@ -827,6 +933,10 @@ struct TShaderQualifiers { if (src.localSize[i] > 1) localSize[i] = src.localSize[i]; } + for (int i = 0; i < 3; ++i) { + if (src.localSizeSpecId[i] != TQualifier::layoutNotSet) + localSizeSpecId[i] = src.localSizeSpecId[i]; + } if (src.earlyFragmentTests) earlyFragmentTests = true; if (src.layoutDepth) @@ -902,7 +1012,9 @@ public: return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr; } - bool isImage() const { return basicType == EbtSampler && sampler.image; } + // "Image" is a superset of "Subpass" + bool isImage() const { return basicType == EbtSampler && sampler.isImage(); } + bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); } }; // @@ -1112,7 +1224,9 @@ public: virtual bool isRuntimeSizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage == EvqBuffer; } virtual bool isStruct() const { return structure != nullptr; } - virtual bool isImage() const { return basicType == EbtSampler && getSampler().image; } + // "Image" is a superset of "Subpass" + virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } + virtual bool isSubpass() const { return basicType == EbtSampler && getSampler().isSubpass(); } // Recursively checks if the type contains the given basic type virtual bool containsBasicType(TBasicType checkType) const @@ -1181,6 +1295,42 @@ public: return false; } + virtual bool containsNonOpaque() const + { + // list all non-opaque types + switch (basicType) { + case EbtVoid: + case EbtFloat: + case EbtDouble: + case EbtInt: + case EbtUint: + case EbtBool: + return true; + default: + break; + } + if (! structure) + return false; + for (unsigned int i = 0; i < structure->size(); ++i) { + if ((*structure)[i].type->containsNonOpaque()) + return true; + } + return false; + } + + virtual bool containsSpecializationSize() const + { + if (isArray() && arraySizes->containsNode()) + return true; + if (! structure) + return false; + for (unsigned int i = 0; i < structure->size(); ++i) { + if ((*structure)[i].type->containsSpecializationSize()) + return true; + } + return false; + } + // Array editing methods. Array descriptors can be shared across // type instances. This allows all uses of the same array // to be updated at once. E.g., all nodes can be explicitly sized @@ -1218,7 +1368,7 @@ public: arraySizes->addOuterSizes(s); } void changeOuterArraySize(int s) { arraySizes->changeOuterSize(s); } - void setImplicitArraySize (int s) { arraySizes->setImplicitSize(s); } + void setImplicitArraySize(int s) { arraySizes->setImplicitSize(s); } // Recursively make the implicit array size the explicit array size, through the type tree. void adoptImplicitArraySizes() @@ -1296,6 +1446,12 @@ public: p += snprintf(p, end - p, "xfb_offset=%d ", qualifier.layoutXfbOffset); if (qualifier.hasXfbStride()) p += snprintf(p, end - p, "xfb_stride=%d ", qualifier.layoutXfbStride); + if (qualifier.hasAttachment()) + p += snprintf(p, end - p, "input_attachment_index=%d ", qualifier.layoutAttachment); + if (qualifier.hasSpecConstantId()) + p += snprintf(p, end - p, "constant_id=%d ", qualifier.layoutSpecConstantId); + if (qualifier.layoutPushConstant) + p += snprintf(p, end - p, "push_constant "); p += snprintf(p, end - p, ") "); } } @@ -1324,6 +1480,8 @@ public: p += snprintf(p, end - p, "readonly "); if (qualifier.writeonly) p += snprintf(p, end - p, "writeonly "); + if (qualifier.specConstant) + p += snprintf(p, end - p, "specialization-constant "); p += snprintf(p, end - p, "%s ", getStorageQualifierString()); if (arraySizes) { for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) { diff --git a/glslang/Include/arrays.h b/glslang/Include/arrays.h index 1d8ec4353860ab8b46ec5704329a0852518096ae..a50088d2dbe20d457b4b7440a1457e8351a17ca8 100644 --- a/glslang/Include/arrays.h +++ b/glslang/Include/arrays.h @@ -46,6 +46,26 @@ namespace glslang { // This is used to mean there is no size yet (unsized), it is waiting to get a size from somewhere else. const int UnsizedArraySize = 0; +class TIntermTyped; +extern bool SameSpecializationConstants(TIntermTyped*, TIntermTyped*); + +// Specialization constants need both a nominal size and a node that defines +// the specialization constant being used. Array types are the same when their +// size and specialization constant nodes are the same. +struct TArraySize { + unsigned int size; + TIntermTyped* node; // nullptr means no specialization constant node + bool operator==(const TArraySize& rhs) const + { + if (size != rhs.size) + return false; + if (node == nullptr || rhs.node == nullptr) + return node == rhs.node; + + return SameSpecializationConstants(node, rhs.node); + } +}; + // // TSmallArrayVector is used as the container for the set of sizes in TArraySizes. // It has generic-container semantics, while TArraySizes has array-of-array semantics. @@ -83,22 +103,31 @@ struct TSmallArrayVector { return (int)sizes->size(); } - unsigned int front() const + unsigned int frontSize() const { assert(sizes != nullptr && sizes->size() > 0); - return sizes->front(); + return sizes->front().size; + } + + TIntermTyped* frontNode() const + { + assert(sizes != nullptr && sizes->size() > 0); + return sizes->front().node; } void changeFront(unsigned int s) { assert(sizes != nullptr); - sizes->front() = s; + // this should only happen for implicitly sized arrays, not specialization constants + assert(sizes->front().node == nullptr); + sizes->front().size = s; } - void push_back(unsigned int e) + void push_back(unsigned int e, TIntermTyped* n) { alloc(); - sizes->push_back(e); + TArraySize pair = { e, n }; + sizes->push_back(pair); } void push_front(const TSmallArrayVector& newDims) @@ -129,16 +158,23 @@ struct TSmallArrayVector { } } - unsigned int operator[](int i) const + unsigned int getDimSize(int i) const { - assert(sizes != nullptr && (int)sizes->size() > i); - return (*sizes)[i]; + assert(sizes != nullptr && (int)sizes->size() > i); + return (*sizes)[i].size; } - unsigned int& operator[](int i) + void setDimSize(int i, unsigned int size) const { - assert(sizes != nullptr && (int)sizes->size() > i); - return (*sizes)[i]; + assert(sizes != nullptr && (int)sizes->size() > i); + assert((*sizes)[i].node == nullptr); + (*sizes)[i].size = size; + } + + TIntermTyped* getDimNode(int i) const + { + assert(sizes != nullptr && (int)sizes->size() > i); + return (*sizes)[i].node; } bool operator==(const TSmallArrayVector& rhs) const @@ -157,7 +193,7 @@ protected: void alloc() { if (sizes == nullptr) - sizes = new TVector<unsigned int>; + sizes = new TVector<TArraySize>; } void dealloc() { @@ -165,7 +201,7 @@ protected: sizes = nullptr; } - TVector<unsigned int>* sizes; // will either hold such a pointer, or in the future, hold the two array sizes + TVector<TArraySize>* sizes; // will either hold such a pointer, or in the future, hold the two array sizes }; // @@ -197,28 +233,32 @@ struct TArraySizes { // translate from array-of-array semantics to container semantics int getNumDims() const { return sizes.size(); } - int getDimSize(int dim) const { return sizes[dim]; } - void setDimSize(int dim, int size) { sizes[dim] = size; } - int getOuterSize() const { return sizes.front(); } + int getDimSize(int dim) const { return sizes.getDimSize(dim); } + TIntermTyped* getDimNode(int dim) const { return sizes.getDimNode(dim); } + void setDimSize(int dim, int size) { sizes.setDimSize(dim, size); } + int getOuterSize() const { return sizes.frontSize(); } + TIntermTyped* getOuterNode() const { return sizes.frontNode(); } int getCumulativeSize() const { int size = 1; for (int d = 0; d < sizes.size(); ++d) { // this only makes sense in paths that have a known array size - assert(sizes[d] != UnsizedArraySize); - size *= sizes[d]; + assert(sizes.getDimSize(d) != UnsizedArraySize); + size *= sizes.getDimSize(d); } return size; } - void addInnerSize() { sizes.push_back((unsigned)UnsizedArraySize); } - void addInnerSize(int s) { sizes.push_back((unsigned)s); } + void addInnerSize() { addInnerSize((unsigned)UnsizedArraySize); } + void addInnerSize(int s) { addInnerSize((unsigned)s, nullptr); } + void addInnerSize(int s, TIntermTyped* n) { sizes.push_back((unsigned)s, n); } + void addInnerSize(TArraySize pair) { sizes.push_back(pair.size, pair.node); } void changeOuterSize(int s) { sizes.changeFront((unsigned)s); } int getImplicitSize() const { return (int)implicitArraySize; } void setImplicitSize(int s) { implicitArraySize = s; } bool isInnerImplicit() const { for (int d = 1; d < sizes.size(); ++d) { - if (sizes[d] == (unsigned)UnsizedArraySize) + if (sizes.getDimSize(d) == (unsigned)UnsizedArraySize) return true; } @@ -240,13 +280,26 @@ struct TArraySizes { return false; for (int d = 1; d < sizes.size(); ++d) { - if (sizes[d] != rhs.sizes[d]) + if (sizes.getDimSize(d) != rhs.sizes.getDimSize(d) || + sizes.getDimNode(d) != rhs.sizes.getDimNode(d)) return false; } return true; } + // Returns true if any of the dimensions of the array is sized with a node + // instead of a front-end compile-time constant. + bool containsNode() + { + for (int d = 0; d < sizes.size(); ++d) { + if (sizes.getDimNode(d) != nullptr) + return true; + } + + return false; + } + bool operator==(const TArraySizes& rhs) { return sizes == rhs.sizes; } bool operator!=(const TArraySizes& rhs) { return sizes != rhs.sizes; } diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 54bd96e130b3405e4fb3a899dc076d69bd340ec2..ce5fb775c6d91cdd3be41b40f5a8ca9b560fc895 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -324,6 +324,7 @@ enum TOperator { EOpConstructDMat4x3, EOpConstructDMat4x4, EOpConstructStruct, + EOpConstructTextureSampler, EOpConstructGuardEnd, // @@ -371,6 +372,8 @@ enum TOperator { EOpImageAtomicExchange, EOpImageAtomicCompSwap, + EOpSubpassLoad, + EOpSubpassLoadMS, EOpSparseImageLoad, EOpImageGuardEnd, @@ -606,7 +609,7 @@ protected: // class TIntermSymbol : public TIntermTyped { public: - // if symbol is initialized as symbol(sym), the memory comes from the poolallocator of sym. If sym comes from + // if symbol is initialized as symbol(sym), the memory comes from the pool allocator of sym. If sym comes from // per process threadPoolAllocator, then it causes increased memory usage per compile // it is essential to use "symbol = sym" to assign to symbol TIntermSymbol(int i, const TString& n, const TType& t) : @@ -619,9 +622,9 @@ public: void setConstArray(const TConstUnionArray& c) { unionArray = c; } const TConstUnionArray& getConstArray() const { return unionArray; } protected: - int id; - TString name; - TConstUnionArray unionArray; + int id; // the unique id of the symbol this node represents + TString name; // the name of the symbol this node represents + TConstUnionArray unionArray; // if the symbol is a front-end compile-time constant, this is its value }; class TIntermConstantUnion : public TIntermTyped { @@ -651,6 +654,7 @@ struct TCrackedTextureOp { bool offsets; bool gather; bool grad; + bool subpass; bool lodClamp; }; @@ -681,6 +685,7 @@ public: cracked.offsets = false; cracked.gather = false; cracked.grad = false; + cracked.subpass = false; cracked.lodClamp = false; switch (op) { @@ -790,6 +795,10 @@ public: cracked.gather = true; cracked.offsets = true; break; + case EOpSubpassLoad: + case EOpSubpassLoadMS: + cracked.subpass = true; + break; default: break; } @@ -937,7 +946,7 @@ enum TVisit // // Explicitly set postVisit to true if you want post visiting, otherwise, // filled in methods will only be called at pre-visit time (before processing -// the subtree). Similary for inVisit for in-order visiting of nodes with +// the subtree). Similarly for inVisit for in-order visiting of nodes with // multiple children. // // If you only want post-visits, explicitly turn off preVisit (and inVisit) @@ -970,7 +979,7 @@ public: void incrementDepth(TIntermNode *current) { depth++; - maxDepth = std::max(maxDepth, depth); + maxDepth = (std::max)(maxDepth, depth); path.push_back(current); } @@ -1000,6 +1009,14 @@ protected: TVector<TIntermNode *> path; }; +// KHR_vulkan_glsl says "Two arrays sized with specialization constants are the same type only if +// sized with the same symbol, involving no operations" +inline bool SameSpecializationConstants(TIntermTyped* node1, TIntermTyped* node2) +{ + return node1->getAsSymbolNode() && node2->getAsSymbolNode() && + node1->getAsSymbolNode()->getId() == node2->getAsSymbolNode()->getId(); +} + } // end namespace glslang #endif // __INTERMEDIATE_H diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index b14b74ad13271fb1e79a9c908c6fcd1e0f6714a2..e338849d452013c95d9b7550365b77d62526798d 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "SPIRV99.866" -#define GLSLANG_DATE "24-Dec-2015" +#define GLSLANG_REVISION "SPIRV99.947" +#define GLSLANG_DATE "15-Feb-2016" diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 4b0c0153fd5d3b66ef0ab15fd52cd909bae69f06..5f1c3d9f93c311d8ba9f2f684329ee890d8911d5 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -85,6 +86,7 @@ TBuiltIns::TBuiltIns() dimMap[Esd3D] = 3; dimMap[EsdCube] = 3; dimMap[EsdBuffer] = 1; + dimMap[EsdSubpass] = 2; // potientially unused for now } TBuiltIns::~TBuiltIns() @@ -99,7 +101,7 @@ TBuiltIns::~TBuiltIns() // Most built-ins variables can be added as simple text strings. Some need to // be added programmatically, which is done later in IdentifyBuiltIns() below. // -void TBuiltIns::initialize(int version, EProfile profile, int spv) +void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) { //============================================================================ // @@ -1080,17 +1082,19 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "\n"); } - // - // Atomic counter functions. - // - if ((profile != EEsProfile && version >= 300) || - (profile == EEsProfile && version >= 310)) { - commonBuiltins.append( - "uint atomicCounterIncrement(atomic_uint x);" - "uint atomicCounterDecrement(atomic_uint x);" - "uint atomicCounter(atomic_uint x);" + if (vulkan == 0) { + // + // Atomic counter functions. + // + if ((profile != EEsProfile && version >= 300) || + (profile == EEsProfile && version >= 310)) { + commonBuiltins.append( + "uint atomicCounterIncrement(atomic_uint x);" + "uint atomicCounterDecrement(atomic_uint x);" + "uint atomicCounter(atomic_uint x);" - "\n"); + "\n"); + } } // Bitfield @@ -1434,28 +1438,31 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) // // Depth range in window coordinates, p. 33 // - commonBuiltins.append( - "struct gl_DepthRangeParameters {" - ); - if (profile == EEsProfile) { + if (vulkan == 0) { commonBuiltins.append( - "highp float near;" // n - "highp float far;" // f - "highp float diff;" // f - n + "struct gl_DepthRangeParameters {" ); - } else { + if (profile == EEsProfile) { + commonBuiltins.append( + "highp float near;" // n + "highp float far;" // f + "highp float diff;" // f - n + ); + } else { + commonBuiltins.append( + "float near;" // n + "float far;" // f + "float diff;" // f - n + ); + } + commonBuiltins.append( - "float near;" // n - "float far;" // f - "float diff;" // f - n - ); + "};" + "uniform gl_DepthRangeParameters gl_DepthRange;" + "\n"); } - commonBuiltins.append( - "};" - "uniform gl_DepthRangeParameters gl_DepthRange;" - "\n"); - if (IncludeLegacy(version, profile, spv)) { + if (vulkan == 0 && IncludeLegacy(version, profile, spv)) { // // Matrix state. p. 31, 32, 37, 39, 40. // @@ -1693,14 +1700,19 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "};" "\n"); } - if (version >= 130) + if (version >= 130 && vulkan == 0) stageBuiltins[EShLangVertex].append( "int gl_VertexID;" // needs qualifier fixed later ); - if (version >= 140) + if (version >= 140 && vulkan == 0) stageBuiltins[EShLangVertex].append( "int gl_InstanceID;" // needs qualifier fixed later ); + if (spv > 0 && version >= 140) + stageBuiltins[EShLangVertex].append( + "in int gl_VertexIndex;" + "in int gl_InstanceIndex;" + ); if (version >= 440) { stageBuiltins[EShLangVertex].append( "in int gl_BaseVertexARB;" @@ -1716,10 +1728,16 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) "mediump float gl_PointSize;" // needs qualifier fixed later ); } else { - stageBuiltins[EShLangVertex].append( - "highp int gl_VertexID;" // needs qualifier fixed later - "highp int gl_InstanceID;" // needs qualifier fixed later - ); + if (vulkan == 0) + stageBuiltins[EShLangVertex].append( + "in highp int gl_VertexID;" // needs qualifier fixed later + "in highp int gl_InstanceID;" // needs qualifier fixed later + ); + if (spv > 0) + stageBuiltins[EShLangVertex].append( + "in highp int gl_VertexIndex;" + "in highp int gl_InstanceIndex;" + ); if (version < 310) stageBuiltins[EShLangVertex].append( "highp vec4 gl_Position;" // needs qualifier fixed later @@ -2071,7 +2089,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) stageBuiltins[EShLangFragment].append("\n"); if (version >= 130) - add2ndGenerationSamplingImaging(version, profile, spv); + add2ndGenerationSamplingImaging(version, profile, spv, vulkan); //printf("%s\n", commonBuiltins.c_str()); //printf("%s\n", stageBuiltins[EShLangFragment].c_str()); @@ -2081,7 +2099,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv) // Helper function for initialize(), to add the second set of names for texturing, // when adding context-independent built-in functions. // -void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, int spv) +void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, int /*spv*/, int vulkan) { // // In this function proper, enumerate the types, then calls the next set of functions @@ -2108,9 +2126,13 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, 2D, ..., buffer + if (dim == EsdSubpass && vulkan == 0) + continue; + if (dim == EsdSubpass && (image || shadow || arrayed)) + continue; if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) continue; - if (dim != Esd2D && ms) + if (dim != Esd2D && dim != EsdSubpass && ms) continue; if ((dim == Esd3D || dim == EsdRect) && arrayed) continue; @@ -2138,7 +2160,9 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i // TSampler sampler; - if (image) { + if (dim == EsdSubpass) { + sampler.setSubpass(bTypes[bType], ms ? true : false); + } else if (image) { sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, shadow ? true : false, ms ? true : false); @@ -2150,6 +2174,11 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, i TString typeName = sampler.getString(); + if (dim == EsdSubpass) { + addSubpassSampling(sampler, typeName, version, profile); + continue; + } + addQueryFunctions(sampler, typeName, version, profile); if (image) @@ -2342,6 +2371,23 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi } } +// +// Helper function for initialize(), +// when adding context-independent built-in functions. +// +// Add all the subpass access functions for the given type. +// +void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*version*/, EProfile /*profile*/) +{ + stageBuiltins[EShLangFragment].append(prefixes[sampler.type]); + stageBuiltins[EShLangFragment].append("vec4 subpassLoad"); + stageBuiltins[EShLangFragment].append("("); + stageBuiltins[EShLangFragment].append(typeName.c_str()); + if (sampler.ms) + stageBuiltins[EShLangFragment].append(", int"); + stageBuiltins[EShLangFragment].append(");\n"); +} + // // Helper function for add2ndGenerationSamplingImaging(), // when adding context-independent built-in functions. @@ -2682,7 +2728,7 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int vers // add stage-specific entries to the commonBuiltins, and only if that stage // was requested. // -void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, EShLanguage language) +void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, int vulkan, EShLanguage language) { // // Initialize the context-dependent (resource-dependent) built-in strings for parsing. @@ -2845,7 +2891,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformComponents = %d;", resources.maxFragmentUniformComponents); s.append(builtInConstant); - if (IncludeLegacy(version, profile, spv)) { + if (vulkan == 0 && IncludeLegacy(version, profile, spv)) { // // OpenGL'uniform' state. Page numbers are in reference to version // 1.4 of the OpenGL specification. @@ -3189,7 +3235,7 @@ void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable b // 3) Tag extension-related symbols added to their base version with their extensions, so // that if an early version has the extension turned off, there is an error reported on use. // -void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage language, TSymbolTable& symbolTable) +void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable) { // // Tag built-in variables and functions with additional qualifier and extension information @@ -3254,6 +3300,14 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); } + if (vulkan == 0) { + SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); + SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); + } + + BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable); + BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable); + // Fall through case EShLangTessControl: @@ -3269,8 +3323,6 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua SpecialQualifier("gl_Position", EvqPosition, EbvPosition, symbolTable); SpecialQualifier("gl_PointSize", EvqPointSize, EbvPointSize, symbolTable); SpecialQualifier("gl_ClipVertex", EvqClipVertex, EbvClipVertex, symbolTable); - SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); - SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); BuiltInVariable("gl_in", "gl_Position", EbvPosition, symbolTable); BuiltInVariable("gl_in", "gl_PointSize", EbvPointSize, symbolTable); @@ -3674,6 +3726,9 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua symbolTable.relateToOperator("imageAtomicExchange", EOpImageAtomicExchange); symbolTable.relateToOperator("imageAtomicCompSwap", EOpImageAtomicCompSwap); + symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad); + symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS); + symbolTable.relateToOperator("textureSize", EOpTextureQuerySize); symbolTable.relateToOperator("textureQueryLod", EOpTextureQueryLod); symbolTable.relateToOperator("textureQueryLevels", EOpTextureQueryLevels); @@ -3834,7 +3889,7 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage langua // 2) Tag extension-related symbols added to their base version with their extensions, so // that if an early version has the extension turned off, there is an error reported on use. // -void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) +void IdentifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) { if (profile != EEsProfile && version >= 430 && version < 440) { symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts); diff --git a/glslang/MachineIndependent/Initialize.h b/glslang/MachineIndependent/Initialize.h index 156db7d731cd7f67b0aea9c0f047764097b3554b..ab21a2f9f3e388359c1b44ebfdb447a160142eff 100644 --- a/glslang/MachineIndependent/Initialize.h +++ b/glslang/MachineIndependent/Initialize.h @@ -59,13 +59,14 @@ public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) TBuiltIns(); virtual ~TBuiltIns(); - void initialize(int version, EProfile, int spv); - void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, EShLanguage); + void initialize(int version, EProfile, int spv, int vulkan); + void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, int vulkan, EShLanguage); const TString& getCommonString() const { return commonBuiltins; } const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } protected: - void add2ndGenerationSamplingImaging(int version, EProfile profile, int spv); + void add2ndGenerationSamplingImaging(int version, EProfile profile, int spv, int vulkan); + void addSubpassSampling(TSampler, TString& typeName, int version, EProfile profile); void addQueryFunctions(TSampler, TString& typeName, int version, EProfile profile); void addImageFunctions(TSampler, TString& typeName, int version, EProfile profile); void addSamplingFunctions(TSampler, TString& typeName, int version, EProfile profile); @@ -81,8 +82,8 @@ protected: int dimMap[EsdNumDims]; }; -void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage, TSymbolTable&); -void IdentifyBuiltIns(int version, EProfile profile, int spv, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); +void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage, TSymbolTable&); +void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); } // end namespace glslang diff --git a/glslang/MachineIndependent/IntermTraverse.cpp b/glslang/MachineIndependent/IntermTraverse.cpp index b0ac4c76a2e774b62974caf5a066d4f2bc983f16..44743eafca58fb0a3f04395a1cfdf04d479f018c 100644 --- a/glslang/MachineIndependent/IntermTraverse.cpp +++ b/glslang/MachineIndependent/IntermTraverse.cpp @@ -54,7 +54,7 @@ namespace glslang { // // -// Traversal functions for terminals are straighforward.... +// Traversal functions for terminals are straightforward.... // void TIntermMethod::traverse(TIntermTraverser*) { diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index dcd310ea4d1593e47251f47bcf1813b3d771d455..bafcb917aab3708e2de1df13323455f8b77b503c 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -59,6 +60,7 @@ namespace glslang { // // Returns the added node. // + TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, const TSourceLoc& loc) { TIntermSymbol* node = new TIntermSymbol(id, name, type); @@ -67,9 +69,17 @@ TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType return node; } +TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, const TConstUnionArray& constArray, const TSourceLoc& loc) +{ + TIntermSymbol* node = addSymbol(id, name, type, loc); + node->setConstArray(constArray); + + return node; +} + TIntermSymbol* TIntermediate::addSymbol(const TVariable& variable, const TSourceLoc& loc) { - return addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), loc); + return addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), variable.getConstArray(), loc); } // @@ -112,10 +122,9 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn node->updatePrecision(); // - // If they are both constants, they must be folded. + // If they are both (non-specialization) constants, they must be folded. // (Unless it's the sequence (comma) operator, but that's handled in addComma().) // - TIntermConstantUnion *leftTempConstant = left->getAsConstantUnion(); TIntermConstantUnion *rightTempConstant = right->getAsConstantUnion(); if (leftTempConstant && rightTempConstant) { @@ -124,6 +133,13 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn return folded; } + // If either is a specialization constant, while the other is + // a constant (or specialization constant), the result is still + // a specialization constant. + if (( left->getType().getQualifier().isSpecConstant() && right->getType().getQualifier().isConstant()) || + (right->getType().getQualifier().isSpecConstant() && left->getType().getQualifier().isConstant())) + node->getWritableType().getQualifier().makeSpecConstant(); + return node; } @@ -261,9 +277,14 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo node->updatePrecision(); + // If it's a (non-specialization) constant, it must be folded. if (child->getAsConstantUnion()) return child->getAsConstantUnion()->fold(op, node->getType()); + // If it's a specialiation constant, the result is too. + if (child->getType().getQualifier().isSpecConstant()) + node->getWritableType().getQualifier().makeSpecConstant(); + return node; } @@ -379,35 +400,37 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TIntermTyped* node) const { // - // Does the base type allow operation? + // Does the base type even allow the operation? // switch (node->getBasicType()) { case EbtVoid: return 0; case EbtAtomicUint: case EbtSampler: - if (op != EOpFunctionCall) - return 0; - break; + // opaque types can be passed to functions + if (op == EOpFunction) + break; + // samplers can get assigned via a sampler constructor + // (well, not yet, but code in the rest of this function is ready for it) + if (node->getBasicType() == EbtSampler && op == EOpAssign && + node->getAsOperator() != nullptr && node->getAsOperator()->getOp() == EOpConstructTextureSampler) + break; + + // otherwise, opaque types can't even be operated on, let alone converted + return 0; default: break; } - // // Otherwise, if types are identical, no problem - // if (type == node->getType()) return node; - // // If one's a structure, then no conversions. - // if (type.isStruct() || node->isStruct()) return 0; - // // If one's an array, then no conversions. - // if (type.isArray() || node->getType().isArray()) return 0; @@ -1144,13 +1167,19 @@ bool TIntermBinary::promote() setType(left->getType()); type.getQualifier().clear(); - // Finish all array and structure operations. - if (left->isArray() || left->getBasicType() == EbtStruct) { + // Composite and opaque types don't having pending operator changes, e.g., + // array, structure, and samplers. Just establish final type and correctness. + if (left->isArray() || left->getBasicType() == EbtStruct || left->getBasicType() == EbtSampler) { switch (op) { case EOpEqual: case EOpNotEqual: - // Promote to conditional - setType(TType(EbtBool)); + if (left->getBasicType() == EbtSampler) { + // can't compare samplers + return false; + } else { + // Promote to conditional + setType(TType(EbtBool)); + } return true; diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 73684938ac7531e8af19b4729c97d65b70a95d8d..b97c96c23ad66b435505c9754c5bc555395b4388 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2013 LunarG, Inc. +//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -47,10 +48,10 @@ extern int yyparse(glslang::TParseContext*); namespace glslang { -TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, int spv, EShLanguage L, TInfoSink& is, +TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, int spv, int vulkan, EShLanguage L, TInfoSink& is, bool fc, EShMessages m) : intermediate(interm), symbolTable(symt), infoSink(is), language(L), - version(v), profile(p), spv(spv), forwardCompatible(fc), + version(v), profile(p), spv(spv), vulkan(vulkan), forwardCompatible(fc), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), postMainReturn(false), tokensBeforeEOF(false), limits(resources.limits), messages(m), currentScanner(nullptr), @@ -97,11 +98,11 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmColumnMajor; - globalUniformDefaults.layoutPacking = ElpShared; + globalUniformDefaults.layoutPacking = vulkan > 0 ? ElpStd140 : ElpShared; globalBufferDefaults.clear(); globalBufferDefaults.layoutMatrix = ElmColumnMajor; - globalBufferDefaults.layoutPacking = ElpShared; + globalBufferDefaults.layoutPacking = vulkan > 0 ? ElpStd430 : ElpShared; globalInputDefaults.clear(); globalOutputDefaults.clear(); @@ -463,7 +464,7 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb if (! variable) variable = new TVariable(string, TType(EbtVoid)); - if (variable->getType().getQualifier().storage == EvqConst) + if (variable->getType().getQualifier().isFrontEndConstant()) node = intermediate.addConstantUnion(variable->getConstArray(), variable->getType(), loc); else node = intermediate.addSymbol(*variable, loc); @@ -610,6 +611,16 @@ void TParseContext::makeEditable(TSymbol*& symbol) intermediate.addSymbolLinkageNode(linkage, *symbol); } +TVariable* TParseContext::getEditableVariable(const char* name) +{ + bool builtIn; + TSymbol* symbol = symbolTable.find(name, &builtIn); + if (builtIn) + makeEditable(symbol); + + return symbol->getAsVariable(); +} + // Return true if this is a geometry shader input array or tessellation control output array. bool TParseContext::isIoResizeArray(const TType& type) const { @@ -813,7 +824,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm } } - if (base->getType().getQualifier().storage == EvqConst) + if (base->getType().getQualifier().isFrontEndConstant()) result = intermediate.foldSwizzle(base, fields, loc); else { if (fields.num == 1) { @@ -1682,6 +1693,8 @@ TOperator TParseContext::mapTypeToConstructorOp(const TType& type) const op = EOpConstructStruct; break; case EbtSampler: + if (type.getSampler().combined) + op = EOpConstructTextureSampler; break; case EbtFloat: if (type.isMatrix()) { @@ -2154,6 +2167,8 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T bool constructingMatrix = false; switch(op) { + case EOpConstructTextureSampler: + return constructorTextureSamplerError(loc, function); case EOpConstructMat2x2: case EOpConstructMat2x3: case EOpConstructMat2x4: @@ -2309,6 +2324,66 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T return false; } +// Verify all the correct semantics for constructing a combined texture/sampler. +// Return true if the semantics are incorrect. +bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const TFunction& function) +{ + TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change + const char* token = constructorName.c_str(); + + // exactly two arguments needed + if (function.getParamCount() != 2) { + error(loc, "sampler-constructor requires two arguments", token, ""); + return true; + } + + // For now, not allowing arrayed constructors, the rest of this function + // is set up to allow them, if this test is removed: + if (function.getType().isArray()) { + error(loc, "sampler-constructor cannot make an array of samplers", token, ""); + return true; + } + + // first argument + // * the constructor's first argument must be a texture type + // * the dimensionality (1D, 2D, 3D, Cube, Rect, Buffer, MS, and Array) + // of the texture type must match that of the constructed sampler type + // (that is, the suffixes of the type of the first argument and the + // type of the constructor will be spelled the same way) + if (function[0].type->getBasicType() != EbtSampler || + ! function[0].type->getSampler().isTexture() || + function[0].type->isArray()) { + error(loc, "sampler-constructor first argument must be a scalar textureXXX type", token, ""); + return true; + } + // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=() + TSampler texture = function.getType().getSampler(); + texture.combined = false; + texture.shadow = false; + if (texture != function[0].type->getSampler()) { + error(loc, "sampler-constructor first argument must match type and dimensionality of constructor type", token, ""); + return true; + } + + // second argument + // * the constructor's second argument must be a scalar of type + // *sampler* or *samplerShadow* + // * the presence or absence of depth comparison (Shadow) must match + // between the constructed sampler type and the type of the second argument + if ( function[1].type->getBasicType() != EbtSampler || + ! function[1].type->getSampler().isPureSampler() || + function[1].type->isArray()) { + error(loc, "sampler-constructor second argument must be a scalar type 'sampler'", token, ""); + return true; + } + if (function.getType().getSampler().shadow != function[1].type->getSampler().shadow) { + error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow", token, ""); + return true; + } + + return false; +} + // Checks to see if a void variable has been declared and raise an error message for such a case // // returns true in case of an error @@ -2337,7 +2412,7 @@ void TParseContext::boolCheck(const TSourceLoc& loc, const TPublicType& pType) error(loc, "boolean expression expected", "", ""); } -void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const TString& identifier, TIntermTyped* /*initializer*/) { if (type.getQualifier().storage == EvqUniform) return; @@ -2345,6 +2420,9 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtSampler)) error(loc, "non-uniform struct contains a sampler or image:", type.getBasicTypeString().c_str(), identifier.c_str()); else if (type.getBasicType() == EbtSampler && type.getQualifier().storage != EvqUniform) { + // non-uniform sampler + // not yet: okay if it has an initializer + // if (! initializer) error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } } @@ -2360,6 +2438,19 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } +void TParseContext::transparentCheck(const TSourceLoc& loc, const TType& type, const TString& /*identifier*/) +{ + // double standard due to gl_NumSamples + if (parsingBuiltins) + return; + + // Vulkan doesn't allow transparent uniforms outside of blocks + if (vulkan == 0 || type.getQualifier().storage != EvqUniform) + return; + if (type.containsNonOpaque()) + vulkanRemoved(loc, "non-opaque uniforms outside a block"); +} + // // Check/fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. // @@ -2605,6 +2696,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons MERGE_SINGLETON(restrict); MERGE_SINGLETON(readonly); MERGE_SINGLETON(writeonly); + MERGE_SINGLETON(specConstant); if (repeated) error(loc, "replicated qualifiers", "", ""); @@ -2707,22 +2799,35 @@ bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType bas // // Do size checking for an array type's size. // -void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, int& size) +void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair) { + bool isConst = false; + sizePair.size = 1; + sizePair.node = nullptr; + TIntermConstantUnion* constant = expr->getAsConstantUnion(); - if (constant == nullptr || (constant->getBasicType() != EbtInt && constant->getBasicType() != EbtUint)) { - error(loc, "array size must be a constant integer expression", "", ""); - size = 1; + if (constant) { + // handle true (non-specialization) constant + sizePair.size = constant->getConstArray()[0].getIConst(); + isConst = true; + } else { + // see if it's a specialization constant instead + if (expr->getQualifier().isSpecConstant()) { + isConst = true; + sizePair.node = expr; + TIntermSymbol* symbol = expr->getAsSymbolNode(); + if (symbol && symbol->getConstArray().size() > 0) + sizePair.size = symbol->getConstArray()[0].getIConst(); + } + } + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { + error(loc, "array size must be a constant integer expression", "", ""); return; } - size = constant->getConstArray()[0].getIConst(); - - if (size <= 0) { + if (sizePair.size <= 0) { error(loc, "array size must be a positive integer", "", ""); - size = 1; - return; } } @@ -3390,6 +3495,12 @@ void TParseContext::opaqueCheck(const TSourceLoc& loc, const TType& type, const error(loc, "can't use with samplers or structs containing samplers", op, ""); } +void TParseContext::specializationCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.containsSpecializationSize()) + error(loc, "can't use with types containing arrays sized with a specialization constant", op, ""); +} + void TParseContext::structTypeCheck(const TSourceLoc& /*loc*/, TPublicType& publicType) { const TTypeList& typeList = *publicType.userDef->getStruct(); @@ -3605,10 +3716,14 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } if (id == TQualifier::getLayoutPackingString(ElpPacked)) { + if (vulkan > 0) + vulkanRemoved(loc, "packed"); publicType.qualifier.layoutPacking = ElpPacked; return; } if (id == TQualifier::getLayoutPackingString(ElpShared)) { + if (vulkan > 0) + vulkanRemoved(loc, "shared"); publicType.qualifier.layoutPacking = ElpShared; return; } @@ -3636,6 +3751,11 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } } + if (id == "push_constant") { + requireVulkan(loc, "push_constant"); + publicType.qualifier.layoutPushConstant = true; + return; + } if (language == EShLangGeometry || language == EShLangTessEvaluation) { if (id == TQualifier::getGeometryString(ElgTriangles)) { publicType.shaderQualifiers.geometry = ElgTriangles; @@ -3874,6 +3994,27 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } } + if (id == "input_attachment_index") { + requireVulkan(loc, "input_attachment_index"); + if (value >= (int)TQualifier::layoutAttachmentEnd) + error(loc, "attachment index is too large", id.c_str(), ""); + else + publicType.qualifier.layoutAttachment = value; + return; + } + if (id == "constant_id") { + requireSpv(loc, "constant_id"); + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", id.c_str(), ""); + } else { + publicType.qualifier.layoutSpecConstantId = value; + publicType.qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", id.c_str(), ""); + } + return; + } + switch (language) { case EShLangVertex: break; @@ -3924,17 +4065,33 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi break; case EShLangCompute: - if (id == "local_size_x") { - publicType.shaderQualifiers.localSize[0] = value; - return; - } - if (id == "local_size_y") { - publicType.shaderQualifiers.localSize[1] = value; - return; - } - if (id == "local_size_z") { - publicType.shaderQualifiers.localSize[2] = value; - return; + if (id.compare(0, 11, "local_size_") == 0) { + if (id == "local_size_x") { + publicType.shaderQualifiers.localSize[0] = value; + return; + } + if (id == "local_size_y") { + publicType.shaderQualifiers.localSize[1] = value; + return; + } + if (id == "local_size_z") { + publicType.shaderQualifiers.localSize[2] = value; + return; + } + if (spv > 0) { + if (id == "local_size_x_id") { + publicType.shaderQualifiers.localSizeSpecId[0] = value; + return; + } + if (id == "local_size_y_id") { + publicType.shaderQualifiers.localSizeSpecId[1] = value; + return; + } + if (id == "local_size_z_id") { + publicType.shaderQualifiers.localSizeSpecId[2] = value; + return; + } + } } break; @@ -3999,6 +4156,13 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutXfbStride = src.layoutXfbStride; if (src.hasXfbOffset()) dst.layoutXfbOffset = src.layoutXfbOffset; + if (src.hasAttachment()) + dst.layoutAttachment = src.layoutAttachment; + if (src.hasSpecConstantId()) + dst.layoutSpecConstantId = src.layoutSpecConstantId; + + if (src.layoutPushConstant) + dst.layoutPushConstant = true; } } @@ -4041,6 +4205,8 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb // "The align qualifier can only be used on blocks or block members..." if (qualifier.hasAlign()) error(loc, "cannot specify on a variable declaration", "align", ""); + if (qualifier.layoutPushConstant) + error(loc, "can only specify on a uniform block", "push_constant", ""); } break; default: @@ -4055,7 +4221,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) { const TQualifier& qualifier = type.getQualifier(); - // first, intra layout qualifier-only error checking + // first, intra-layout qualifier-only error checking layoutQualifierCheck(loc, qualifier); // now, error checking combining type and qualifier @@ -4087,7 +4253,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqBuffer: break; default: - error(loc, "can only appy to uniform, buffer, in, or out storage qualifiers", "location", ""); + error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); break; } @@ -4181,6 +4347,38 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) } } else if (type.isImage() && ! qualifier.writeonly) error(loc, "image variables not declared 'writeonly' must have a format layout qualifier", "", ""); + + if (qualifier.layoutPushConstant && type.getBasicType() != EbtBlock) + error(loc, "can only be used with a block", "push_constant", ""); + + // input attachment + if (type.isSubpass()) { + if (! qualifier.hasAttachment()) + error(loc, "requires an input_attachment_index layout qualifier", "subpass", ""); + } else { + if (qualifier.hasAttachment()) + error(loc, "can only be used with a subpass", "input_attachment_index", ""); + } + + // specialization-constant id + if (qualifier.hasSpecConstantId()) { + if (type.getQualifier().storage != EvqConst) + error(loc, "can only be applied to 'const'-qualified scalar", "constant_id", ""); + if (! type.isScalar()) + error(loc, "can only be applied to a scalar", "constant_id", ""); + switch (type.getBasicType()) + { + case EbtInt: + case EbtUint: + case EbtBool: + case EbtFloat: + case EbtDouble: + break; + default: + error(loc, "cannot be applied to this type", "constant_id", ""); + break; + } + } } // Do layout error checking that can be done within a layout qualifier proper, not needing to know @@ -4275,6 +4473,10 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "offset/align can only be used on a uniform or buffer", "layout", ""); } } + if (qualifier.layoutPushConstant) { + if (qualifier.storage != EvqUniform) + error(loc, "can only be used with a uniform", "push_constant", ""); + } } // For places that can't have shader-level layout qualifiers @@ -4297,6 +4499,8 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua for (int i = 0; i < 3; ++i) { if (shaderQualifiers.localSize[i] > 1) error(loc, message, "local_size", ""); + if (shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) + error(loc, message, "local_size id", ""); } if (shaderQualifiers.blendEquation) error(loc, message, "blend equation", ""); @@ -4490,8 +4694,9 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden else nonInitConstCheck(loc, identifier, type); - samplerCheck(loc, type, identifier); + samplerCheck(loc, type, identifier, initializer); atomicUintCheck(loc, type, identifier); + transparentCheck(loc, type, identifier); if (identifier != "gl_FragCoord" && (publicType.shaderQualifiers.originUpperLeft || publicType.shaderQualifiers.pixelCenterInteger)) error(loc, "can only apply origin_upper_left and pixel_center_origin to gl_FragCoord", "layout qualifier", ""); @@ -4690,7 +4895,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp } if (qualifier == EvqConst || qualifier == EvqUniform) { - // Compile-time tagging of the variable with it's constant value... + // Compile-time tagging of the variable with its constant value... initializer = intermediate.addConversion(EOpAssign, variable->getType(), initializer); if (! initializer || ! initializer->getAsConstantUnion() || variable->getType() != initializer->getType()) { @@ -4703,6 +4908,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp variable->setConstArray(initializer->getAsConstantUnion()->getConstArray()); } else { // normal assigning of a value to a variable... + specializationCheck(loc, initializer->getType(), "initializer"); TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); TIntermNode* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc); if (! initNode) @@ -4716,7 +4922,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp // // Reprocess any initializer-list { ... } parts of the initializer. -// Need to heirarchically assign correct types and implicit +// Need to hierarchically assign correct types and implicit // conversions. Will do this mimicking the same process used for // creating a constructor-style initializer, ensuring we get the // same form. @@ -4811,6 +5017,11 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* TIntermAggregate* aggrNode = node->getAsAggregate(); + // Combined texture-sampler constructors are completely semantic checked + // in constructorTextureSamplerError() + if (op == EOpConstructTextureSampler) + return intermediate.setAggregateOperator(aggrNode, op, type, loc); + TTypeList::const_iterator memberTypes; if (op == EOpConstructStruct) memberTypes = type.getStruct()->begin(); @@ -4997,7 +5208,7 @@ TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType& void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) { blockStageIoCheck(loc, currentBlockQualifier); - blockQualifierCheck(loc, currentBlockQualifier); + blockQualifierCheck(loc, currentBlockQualifier, instanceName != nullptr); if (arraySizes) { arrayUnsizedCheck(loc, currentBlockQualifier, arraySizes, false, false); arrayDimCheck(loc, arraySizes, 0); @@ -5052,6 +5263,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con default: defaultQualification.clear(); break; } + // Special case for "push_constant uniform", which has a default of std430, + // contrary to normal uniform defaults, and can't have a default tracked for it. + if (currentBlockQualifier.layoutPushConstant && !currentBlockQualifier.hasPacking()) + currentBlockQualifier.layoutPacking = ElpStd430; + // fix and check for member layout qualifiers mergeObjectLayoutQualifiers(defaultQualification, currentBlockQualifier, true); @@ -5197,7 +5413,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q case EvqUniform: profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); profileRequires(loc, ENoProfile, 140, nullptr, "uniform block"); - if (currentBlockQualifier.layoutPacking == ElpStd430) + if (currentBlockQualifier.layoutPacking == ElpStd430 && ! currentBlockQualifier.layoutPushConstant) error(loc, "requires the 'buffer' storage qualifier", "std430", ""); break; case EvqBuffer: @@ -5227,7 +5443,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q } // Do all block-declaration checking regarding its qualifers. -void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier) +void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool instanceName) { // The 4.5 specification says: // @@ -5254,6 +5470,11 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& error(loc, "cannot use sample qualifier on an interface block", "sample", ""); if (qualifier.invariant) error(loc, "cannot use invariant qualifier on an interface block", "invariant", ""); + if (qualifier.layoutPushConstant) { + intermediate.addPushConstantCount(); + if (! instanceName) + error(loc, "requires an instance name", "push_constant", ""); + } } // @@ -5541,16 +5762,22 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); // Fix the existing constant gl_WorkGroupSize with this new information. - bool builtIn; - TSymbol* symbol = symbolTable.find("gl_WorkGroupSize", &builtIn); - if (builtIn) - makeEditable(symbol); - TVariable* workGroupSize = symbol->getAsVariable(); + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); } } else error(loc, "can only apply to 'in'", "local_size", ""); } + if (publicType.shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) { + if (publicType.qualifier.storage == EvqVaryingIn) { + if (! intermediate.setLocalSizeSpecId(i, publicType.shaderQualifiers.localSizeSpecId[i])) + error(loc, "cannot change previously set size", "local_size", ""); + } else + error(loc, "can only apply to 'in'", "local_size id", ""); + // Set the workgroup built-in variable as a specialization constant + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + workGroupSize->getWritableType().getQualifier().specConstant = true; + } } if (publicType.shaderQualifiers.earlyFragmentTests) { if (publicType.qualifier.storage == EvqVaryingIn) @@ -5614,6 +5841,10 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot declare a default, use a full declaration", "location/component/index", ""); if (qualifier.hasXfbOffset()) error(loc, "cannot declare a default, use a full declaration", "xfb_offset", ""); + if (qualifier.layoutPushConstant) + error(loc, "cannot declare a default, can only be used on a block", "push_constant", ""); + if (qualifier.hasSpecConstantId()) + error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", ""); } // diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index 19a8a2407f6fcd45f9c7356cd01dafce7e035c78..ac1932d50b31304d4928e87fc7eb8002f2284084 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -65,7 +65,7 @@ typedef std::set<int> TIdSetType; // class TParseContext { public: - TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, int spv, EShLanguage, TInfoSink&, + TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, int spv, int vulkan, EShLanguage, TInfoSink&, bool forwardCompatible = false, EShMessages messages = EShMsgDefault); virtual ~TParseContext(); @@ -98,6 +98,7 @@ public: void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); void makeEditable(TSymbol*&); + TVariable* getEditableVariable(const char* name); bool isIoResizeArray(const TType&) const; void fixIoArraySize(const TSourceLoc&, TType&); void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier); @@ -132,7 +133,8 @@ public: void integerCheck(const TIntermTyped* node, const char* token); void globalCheck(const TSourceLoc&, const char* token); bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); - void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, int& size); + bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&); + void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); bool arrayQualifierError(const TSourceLoc&, const TQualifier&); bool arrayError(const TSourceLoc&, const TType&); void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); @@ -145,8 +147,9 @@ public: bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); void boolCheck(const TSourceLoc&, const TIntermTyped*); void boolCheck(const TSourceLoc&, const TPublicType&); - void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier); + void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); + void transparentCheck(const TSourceLoc&, const TType&, const TString& identifier); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&); void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&); bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); @@ -165,6 +168,7 @@ public: void nestedStructCheck(const TSourceLoc&); void arrayObjectCheck(const TSourceLoc&, const TType&, const char* op); void opaqueCheck(const TSourceLoc&, const TType&, const char* op); + void specializationCheck(const TSourceLoc&, const TType&, const char* op); void structTypeCheck(const TSourceLoc&, TPublicType&); void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop); void arrayLimitCheck(const TSourceLoc&, const TString&, int size); @@ -193,7 +197,7 @@ public: TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0); void blockStageIoCheck(const TSourceLoc&, const TQualifier&); - void blockQualifierCheck(const TSourceLoc&, const TQualifier&); + void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixBlockXfbOffsets(TQualifier&, TTypeList&); void fixBlockUniformOffsets(TQualifier&, TTypeList&); @@ -244,6 +248,10 @@ public: void updateExtensionBehavior(int line, const char* const extension, const char* behavior); void fullIntegerCheck(const TSourceLoc&, const char* op); void doubleCheck(const TSourceLoc&, const char* op); + void spvRemoved(const TSourceLoc&, const char* op); + void vulkanRemoved(const TSourceLoc&, const char* op); + void requireVulkan(const TSourceLoc&, const char* op); + void requireSpv(const TSourceLoc&, const char* op); void setVersionCallback(const std::function<void(int, int, const char*)>& func) { versionCallback = func; } void setPragmaCallback(const std::function<void(int, const TVector<TString>&)>& func) { pragmaCallback = func; } @@ -281,6 +289,7 @@ public: int version; // version, updated by #version in the shader EProfile profile; // the declared profile in the shader (core by default) int spv; // SPIR-V version; 0 means not SPIR-V + int vulkan; // Vulkan version; 0 means not vulkan bool forwardCompatible; // true if errors are to be given for use of deprecated features // Current state of parsing diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 80a077ce511b656291a8043d10f3336f99401114..f3c98aafec109bffc1cc379697f63baceea776fc 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -494,6 +494,50 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external + (*KeywordMap)["sampler"] = SAMPLER; + (*KeywordMap)["samplerShadow"] = SAMPLERSHADOW; + + (*KeywordMap)["texture2D"] = TEXTURE2D; + (*KeywordMap)["textureCube"] = TEXTURECUBE; + (*KeywordMap)["textureCubeArray"] = TEXTURECUBEARRAY; + (*KeywordMap)["itextureCubeArray"] = ITEXTURECUBEARRAY; + (*KeywordMap)["utextureCubeArray"] = UTEXTURECUBEARRAY; + (*KeywordMap)["itexture1DArray"] = ITEXTURE1DARRAY; + (*KeywordMap)["utexture1D"] = UTEXTURE1D; + (*KeywordMap)["itexture1D"] = ITEXTURE1D; + (*KeywordMap)["utexture1DArray"] = UTEXTURE1DARRAY; + (*KeywordMap)["textureBuffer"] = TEXTUREBUFFER; + (*KeywordMap)["texture2DArray"] = TEXTURE2DARRAY; + (*KeywordMap)["itexture2D"] = ITEXTURE2D; + (*KeywordMap)["itexture3D"] = ITEXTURE3D; + (*KeywordMap)["itextureCube"] = ITEXTURECUBE; + (*KeywordMap)["itexture2DArray"] = ITEXTURE2DARRAY; + (*KeywordMap)["utexture2D"] = UTEXTURE2D; + (*KeywordMap)["utexture3D"] = UTEXTURE3D; + (*KeywordMap)["utextureCube"] = UTEXTURECUBE; + (*KeywordMap)["utexture2DArray"] = UTEXTURE2DARRAY; + (*KeywordMap)["itexture2DRect"] = ITEXTURE2DRECT; + (*KeywordMap)["utexture2DRect"] = UTEXTURE2DRECT; + (*KeywordMap)["itextureBuffer"] = ITEXTUREBUFFER; + (*KeywordMap)["utextureBuffer"] = UTEXTUREBUFFER; + (*KeywordMap)["texture2DMS"] = TEXTURE2DMS; + (*KeywordMap)["itexture2DMS"] = ITEXTURE2DMS; + (*KeywordMap)["utexture2DMS"] = UTEXTURE2DMS; + (*KeywordMap)["texture2DMSArray"] = TEXTURE2DMSARRAY; + (*KeywordMap)["itexture2DMSArray"] = ITEXTURE2DMSARRAY; + (*KeywordMap)["utexture2DMSArray"] = UTEXTURE2DMSARRAY; + (*KeywordMap)["texture1D"] = TEXTURE1D; + (*KeywordMap)["texture3D"] = TEXTURE3D; + (*KeywordMap)["texture2DRect"] = TEXTURE2DRECT; + (*KeywordMap)["texture1DArray"] = TEXTURE1DARRAY; + + (*KeywordMap)["subpassInput"] = SUBPASSINPUT; + (*KeywordMap)["subpassInputMS"] = SUBPASSINPUTMS; + (*KeywordMap)["isubpassInput"] = ISUBPASSINPUT; + (*KeywordMap)["isubpassInputMS"] = ISUBPASSINPUTMS; + (*KeywordMap)["usubpassInput"] = USUBPASSINPUT; + (*KeywordMap)["usubpassInputMS"] = USUBPASSINPUTMS; + (*KeywordMap)["noperspective"] = NOPERSPECTIVE; (*KeywordMap)["smooth"] = SMOOTH; (*KeywordMap)["flat"] = FLAT; @@ -987,6 +1031,57 @@ int TScanContext::tokenizeIdentifier() return keyword; return identifierOrType(); + case TEXTURE2D: + case TEXTURECUBE: + case TEXTURECUBEARRAY: + case ITEXTURECUBEARRAY: + case UTEXTURECUBEARRAY: + case ITEXTURE1DARRAY: + case UTEXTURE1D: + case ITEXTURE1D: + case UTEXTURE1DARRAY: + case TEXTUREBUFFER: + case TEXTURE2DARRAY: + case ITEXTURE2D: + case ITEXTURE3D: + case ITEXTURECUBE: + case ITEXTURE2DARRAY: + case UTEXTURE2D: + case UTEXTURE3D: + case UTEXTURECUBE: + case UTEXTURE2DARRAY: + case ITEXTURE2DRECT: + case UTEXTURE2DRECT: + case ITEXTUREBUFFER: + case UTEXTUREBUFFER: + case TEXTURE2DMS: + case ITEXTURE2DMS: + case UTEXTURE2DMS: + case TEXTURE2DMSARRAY: + case ITEXTURE2DMSARRAY: + case UTEXTURE2DMSARRAY: + case TEXTURE1D: + case TEXTURE3D: + case TEXTURE2DRECT: + case TEXTURE1DARRAY: + case SAMPLER: + case SAMPLERSHADOW: + if (parseContext.spv > 0) + return keyword; + else + return identifierOrType(); + + case SUBPASSINPUT: + case SUBPASSINPUTMS: + case ISUBPASSINPUT: + case ISUBPASSINPUTMS: + case USUBPASSINPUT: + case USUBPASSINPUTMS: + if (parseContext.spv > 0) + return keyword; + else + return identifierOrType(); + case NOPERSPECTIVE: return es30ReservedFromGLSL(130); diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index a2d7181e33283c4aaefc8e45416e7600563fa31f..1f8355390af9234ed129cf82b6904e5a345ec67e 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -1,6 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +//Copyright (C) 2013-2015 LunarG, Inc. +//Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. // @@ -124,12 +125,12 @@ TPoolAllocator* PerProcessGPA = 0; // // Parse and add to the given symbol table the content of the given shader string. // -bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, int spv, EShLanguage language, TInfoSink& infoSink, +bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, TSymbolTable& symbolTable) { TIntermediate intermediate(language, version, profile); - TParseContext parseContext(symbolTable, intermediate, true, version, profile, spv, language, infoSink); + TParseContext parseContext(symbolTable, intermediate, true, version, profile, spv, vulkan, language, infoSink); TPpContext ppContext(parseContext, TShader::ForbidInclude()); TScanContext scanContext(parseContext); parseContext.setScanContext(&scanContext); @@ -168,11 +169,11 @@ int CommonIndex(EProfile profile, EShLanguage language) // // To initialize per-stage shared tables, with the common table already complete. // -void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profile, int spv, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) +void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) { (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]); - InitializeSymbolTable(builtIns.getStageString(language), version, profile, spv, language, infoSink, *symbolTables[language]); - IdentifyBuiltIns(version, profile, spv, language, *symbolTables[language]); + InitializeSymbolTable(builtIns.getStageString(language), version, profile, spv, vulkan, language, infoSink, *symbolTables[language]); + IdentifyBuiltIns(version, profile, spv, vulkan, language, *symbolTables[language]); if (profile == EEsProfile && version >= 300) (*symbolTables[language]).setNoBuiltInRedeclarations(); if (version == 110) @@ -183,49 +184,49 @@ void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profi // Initialize the full set of shareable symbol tables; // The common (cross-stage) and those shareable per-stage. // -bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, int spv) +bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, int spv, int vulkan) { TBuiltIns builtIns; - builtIns.initialize(version, profile, spv); + builtIns.initialize(version, profile, spv, vulkan); // do the common tables - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, EShLangVertex, infoSink, *commonTable[EPcGeneral]); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, EShLangVertex, infoSink, *commonTable[EPcGeneral]); if (profile == EEsProfile) - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, EShLangFragment, infoSink, *commonTable[EPcFragment]); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, EShLangFragment, infoSink, *commonTable[EPcFragment]); // do the per-stage tables // always have vertex and fragment - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangVertex, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangFragment, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangVertex, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangFragment, infoSink, commonTable, symbolTables); // check for tessellation if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) { - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangTessControl, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangTessEvaluation, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangTessControl, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangTessEvaluation, infoSink, commonTable, symbolTables); } // check for geometry if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangGeometry, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangGeometry, infoSink, commonTable, symbolTables); // check for compute if ((profile != EEsProfile && version >= 430) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, spv, EShLangCompute, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangCompute, infoSink, commonTable, symbolTables); return true; } -bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, int spv, EShLanguage language) +bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, int spv, int vulkan, EShLanguage language) { TBuiltIns builtIns; - builtIns.initialize(*resources, version, profile, spv, language); - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, language, infoSink, symbolTable); - IdentifyBuiltIns(version, profile, spv, language, symbolTable, *resources); + builtIns.initialize(*resources, version, profile, spv, vulkan, language); + InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, language, infoSink, symbolTable); + IdentifyBuiltIns(version, profile, spv, vulkan, language, symbolTable, *resources); return true; } @@ -242,7 +243,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // This only gets done the first time any thread needs a particular symbol table // (lazy evaluation). // -void SetupBuiltinSymbolTable(int version, EProfile profile, int spv) +void SetupBuiltinSymbolTable(int version, EProfile profile, int spv, int vulkan) { TInfoSink infoSink; @@ -272,7 +273,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, int spv) stageTables[stage] = new TSymbolTable; // Generate the local symbol tables using the new pool - InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv); + InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv, vulkan); // Switch to the process-global pool SetThreadPoolAllocator(*PerProcessGPA); @@ -471,7 +472,7 @@ bool ProcessDeferred( const char* customPreamble, const EShOptimizationLevel optLevel, const TBuiltInResource* resources, - int defaultVersion, // use 100 for ES environment, 110 for desktop + int defaultVersion, // use 100 for ES environment, 110 for desktop; this is the GLSL version, not SPIR-V or Vulkan EProfile defaultProfile, // set version/profile to defaultVersion/defaultProfile regardless of the #version // directive in the source code @@ -550,7 +551,7 @@ bool ProcessDeferred( profile = defaultProfile; } - int spv = (messages & EShMsgSpvRules) ? 100 : 0; + int spv = (messages & EShMsgSpvRules) ? 100 : 0; // TODO find path to get real version number here, for now non-0 is what matters bool goodVersion = DeduceVersionProfile(compiler->infoSink, compiler->getLanguage(), versionNotFirst, defaultVersion, version, profile, spv); bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst)); bool warnVersionNotFirst = false; @@ -561,10 +562,13 @@ bool ProcessDeferred( versionWillBeError = true; } + int vulkan = (messages & EShMsgVulkanRules) ? 100 : 0; // TODO find path to get real version number here, for now non-0 is what matters intermediate.setVersion(version); intermediate.setProfile(profile); intermediate.setSpv(spv); - SetupBuiltinSymbolTable(version, profile, spv); + if (vulkan) + intermediate.setOriginUpperLeft(); + SetupBuiltinSymbolTable(version, profile, spv, vulkan); TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] [MapProfileToIndex(profile)] @@ -578,13 +582,13 @@ bool ProcessDeferred( // Add built-in symbols that are potentially context dependent; // they get popped again further down. - AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spv, compiler->getLanguage()); + AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spv, vulkan, compiler->getLanguage()); // // Now we can process the full shader under proper symbols and rules. // - TParseContext parseContext(symbolTable, intermediate, false, version, profile, spv, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); + TParseContext parseContext(symbolTable, intermediate, false, version, profile, spv, vulkan, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); glslang::TScanContext scanContext(parseContext); TPpContext ppContext(parseContext, includer); parseContext.setScanContext(&scanContext); diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 092fe205b56c70de166ced266323951e7ff09c2f..001ebe07aab0ea89ae39700de803d7aa467c3768 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -87,6 +87,7 @@ void TType::buildMangledName(TString& mangledName) case EsdCube: mangledName += "C"; break; case EsdRect: mangledName += "R2"; break; case EsdBuffer: mangledName += "B"; break; + case EsdSubpass: mangledName += "P"; break; default: break; // some compilers want this } if (sampler.ms) @@ -115,7 +116,13 @@ void TType::buildMangledName(TString& mangledName) const int maxSize = 11; char buf[maxSize]; for (int i = 0; i < arraySizes->getNumDims(); ++i) { - snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); + if (arraySizes->getDimNode(i)) { + if (arraySizes->getDimNode(i)->getAsSymbolNode()) + snprintf(buf, maxSize, "s%d", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); + else + snprintf(buf, maxSize, "s%x", arraySizes->getDimNode(i)); + } else + snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); mangledName += '['; mangledName += buf; mangledName += ']'; diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index fb11f1bef688b9ece9ed498e52465740fa206516..676f4fd6d87a3c9c5807d28808f490a2b6838049 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -173,6 +173,7 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable; extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable; extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable; + extensionBehavior[E_GL_ARB_gl_spirv] = EBhDisable; extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable; extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable; // extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members @@ -276,6 +277,7 @@ const char* TParseContext::getPreamble() "#define GL_ARB_derivative_control 1\n" "#define GL_ARB_shader_texture_image_samples 1\n" "#define GL_ARB_viewport_array 1\n" + "#define GL_ARB_gl_spirv 1\n" "#define GL_ARB_sparse_texture2 1\n" "#define GL_ARB_sparse_texture_clamp 1\n" @@ -564,6 +566,9 @@ void TParseContext::updateExtensionBehavior(int line, const char* extension, con updateExtensionBehavior(line, "GL_OES_shader_io_blocks", behaviorString); else if (strcmp(extension, "GL_GOOGLE_include_directive") == 0) updateExtensionBehavior(line, "GL_GOOGLE_cpp_style_line_directive", behaviorString); + // SPIR-V + else if (strcmp(extension, "GL_ARB_gl_spirv") == 0) + spv = 100; } void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) @@ -606,18 +611,14 @@ void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBeh } } -// // Call for any operation needing full GLSL integer data-type support. -// void TParseContext::fullIntegerCheck(const TSourceLoc& loc, const char* op) { profileRequires(loc, ENoProfile, 130, nullptr, op); profileRequires(loc, EEsProfile, 300, nullptr, op); } -// // Call for any operation needing GLSL double data-type support. -// void TParseContext::doubleCheck(const TSourceLoc& loc, const char* op) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); @@ -625,4 +626,32 @@ void TParseContext::doubleCheck(const TSourceLoc& loc, const char* op) profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); } +// Call for any operation removed because SPIR-V is in use. +void TParseContext::spvRemoved(const TSourceLoc& loc, const char* op) +{ + if (spv > 0) + error(loc, "not allowed when generating SPIR-V", op, ""); +} + +// Call for any operation removed because Vulkan SPIR-V is being generated. +void TParseContext::vulkanRemoved(const TSourceLoc& loc, const char* op) +{ + if (vulkan > 0) + error(loc, "not allowed when using GLSL for Vulkan", op, ""); +} + +// Call for any operation that requires Vulkan. +void TParseContext::requireVulkan(const TSourceLoc& loc, const char* op) +{ + if (vulkan == 0) + error(loc, "only allowed when using GLSL for Vulkan", op, ""); +} + +// Call for any operation that requires SPIR-V. +void TParseContext::requireSpv(const TSourceLoc& loc, const char* op) +{ + if (spv == 0) + error(loc, "only allowed when generating SPIR-V", op, ""); +} + } // end namespace glslang diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 0d79fab4936aac9ff0deb78d2d2b38dcecf6b1c3..d022d87645421c7cec06e88fd8a71c8df2e10528 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -111,6 +111,7 @@ const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_pa const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_gl_spirv = "GL_ARB_gl_spirv"; const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; //const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 7380594185d45d78890950a59d0842283ed2a418..847bcc9ad55ad678522829d74d6d5bcaaa7b1e7e 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -148,6 +148,24 @@ extern int yylex(YYSTYPE*, TParseContext&); %token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token <lex> SAMPLEREXTERNALOES +// pure sampler +%token <lex> SAMPLER SAMPLERSHADOW + +// texture without sampler +%token <lex> TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE +%token <lex> TEXTURE1DARRAY TEXTURE2DARRAY +%token <lex> ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE +%token <lex> ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D +%token <lex> UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY +%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT +%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER +%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY +%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS +%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY + +// input attachments +%token <lex> SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS + %token <lex> IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D %token <lex> UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D %token <lex> IMAGE2DRECT IIMAGE2DRECT UIMAGE2DRECT @@ -503,6 +521,7 @@ equality_expression | equality_expression EQ_OP relational_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison"); parseContext.opaqueCheck($2.loc, $1->getType(), "=="); + parseContext.specializationCheck($2.loc, $1->getType(), "=="); $$ = parseContext.handleBinaryMath($2.loc, "==", EOpEqual, $1, $3); if ($$ == 0) $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); @@ -510,6 +529,7 @@ equality_expression | equality_expression NE_OP relational_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison"); parseContext.opaqueCheck($2.loc, $1->getType(), "!="); + parseContext.specializationCheck($2.loc, $1->getType(), "!="); $$ = parseContext.handleBinaryMath($2.loc, "!=", EOpNotEqual, $1, $3); if ($$ == 0) $$ = parseContext.intermediate.addConstantUnion(false, $2.loc); @@ -597,6 +617,7 @@ assignment_expression | unary_expression assignment_operator assignment_expression { parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment"); parseContext.opaqueCheck($2.loc, $1->getType(), "="); + parseContext.specializationCheck($2.loc, $1->getType(), "="); parseContext.lValueErrorCheck($2.loc, "assign", $1); parseContext.rValueErrorCheck($2.loc, "assign", $3); $$ = parseContext.intermediate.addAssign($2.op, $1, $3, $2.loc); @@ -1201,11 +1222,13 @@ storage_qualifier $$.qualifier.writeonly = true; } | SUBROUTINE { + parseContext.spvRemoved($1.loc, "subroutine"); parseContext.globalCheck($1.loc, "subroutine"); $$.init($1.loc); $$.qualifier.storage = EvqUniform; } | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN { + parseContext.spvRemoved($1.loc, "subroutine"); parseContext.globalCheck($1.loc, "subroutine"); $$.init($1.loc); $$.qualifier.storage = EvqUniform; @@ -1242,11 +1265,11 @@ array_specifier $$.arraySizes = new TArraySizes; $$.arraySizes->addInnerSize(); } - | LEFT_BRACKET constant_expression RIGHT_BRACKET { + | LEFT_BRACKET conditional_expression RIGHT_BRACKET { $$.loc = $1.loc; $$.arraySizes = new TArraySizes; - int size; + TArraySize size; parseContext.arraySizeCheck($2->getLoc(), $2, size); $$.arraySizes->addInnerSize(size); } @@ -1254,10 +1277,10 @@ array_specifier $$ = $1; $$.arraySizes->addInnerSize(); } - | array_specifier LEFT_BRACKET constant_expression RIGHT_BRACKET { + | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET { $$ = $1; - int size; + TArraySize size; parseContext.arraySizeCheck($3->getLoc(), $3, size); $$.arraySizes->addInnerSize(size); } @@ -1504,6 +1527,7 @@ type_specifier_nonarray $$.setMatrix(4, 4); } | ATOMIC_UINT { + parseContext.vulkanRemoved($1.loc, "atomic counter types"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtAtomicUint; } @@ -1707,6 +1731,181 @@ type_specifier_nonarray $$.basicType = EbtSampler; $$.sampler.set(EbtUint, Esd2D, true, false, true); } + | SAMPLER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(false); + } + | SAMPLERSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(true); + } + | TEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd1D); + } + | TEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D); + } + | TEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd3D); + } + | TEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube); + } + | TEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd1D, true); + } + | TEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true); + } + | TEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube, true); + } + | ITEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd1D); + } + | ITEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D); + } + | ITEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd3D); + } + | ITEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube); + } + | ITEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd1D, true); + } + | ITEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true); + } + | ITEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube, true); + } + | UTEXTURE1D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd1D); + } + | UTEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D); + } + | UTEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd3D); + } + | UTEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube); + } + | UTEXTURE1DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd1D, true); + } + | UTEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true); + } + | UTEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube, true); + } + | TEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdRect); + } + | ITEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdRect); + } + | UTEXTURE2DRECT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdRect); + } + | TEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdBuffer); + } + | ITEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdBuffer); + } + | UTEXTUREBUFFER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdBuffer); + } + | TEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true); + } + | ITEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, false, false, true); + } + | UTEXTURE2DMS { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, false, false, true); + } + | TEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true); + } + | ITEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true, false, true); + } + | UTEXTURE2DMSARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true, false, true); + } | IMAGE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -1878,6 +2077,42 @@ type_specifier_nonarray $$.sampler.set(EbtFloat, Esd2D); $$.sampler.external = true; } + | SUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat); + } + | SUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtFloat, true); + } + | ISUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtInt); + } + | ISUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtInt, true); + } + | USUBPASSINPUT { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtUint); + } + | USUBPASSINPUTMS { + parseContext.requireStage($1.loc, EShLangFragment, "subpass input"); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setSubpass(EbtUint, true); + } | struct_specifier { $$ = $1; $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index dd0769f57f155473606cd17485af7e3060c98e22..409e29a1079b6bd317a70d028b3971fdd5baa7c2 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -385,6 +385,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructDMat4x3: out.debug << "Construct dmat4x3"; break; case EOpConstructDMat4x4: out.debug << "Construct dmat4"; break; case EOpConstructStruct: out.debug << "Construct structure"; break; + case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break; case EOpLessThan: out.debug << "Compare Less Than"; break; case EOpGreaterThan: out.debug << "Compare Greater Than"; break; @@ -755,6 +756,20 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) case EShLangCompute: infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n"; + { + bool dumpSpecIds = false; + for (auto c : localSizeSpecId) { + if (c != TQualifier::layoutNotSet) + dumpSpecIds = true; + } + + if (dumpSpecIds) { + infoSink.debug << "local_size ids = (" << + localSizeSpecId[0] << ", " << + localSizeSpecId[1] << ", " << + localSizeSpecId[2] << ")\n"; + } + } break; default: diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index d0e7b02191d58b23ba6dc5a0e7afde9f605c18ff..6fef4fb77fe823169388fa8c6c06fd1cd8790554 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -71,6 +71,7 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) { numMains += unit.numMains; numErrors += unit.numErrors; + numPushConstants += unit.numPushConstants; callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end()); if ((profile != EEsProfile && unit.profile == EEsProfile) || @@ -129,6 +130,11 @@ void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) localSize[i] = unit.localSize[i]; else if (localSize[i] != unit.localSize[i]) error(infoSink, "Contradictory local size"); + + if (localSizeSpecId[i] != TQualifier::layoutNotSet) + localSizeSpecId[i] = unit.localSizeSpecId[i]; + else if (localSizeSpecId[i] != unit.localSizeSpecId[i]) + error(infoSink, "Contradictory local size specialization ids"); } if (unit.xfbMode) @@ -353,6 +359,9 @@ void TIntermediate::finalCheck(TInfoSink& infoSink) if (numMains < 1) error(infoSink, "Missing entry point: Each stage requires one \"void main()\" entry point"); + if (numPushConstants > 1) + error(infoSink, "Only one push_constant block is allowed per stage"); + // recursion checking checkCallGraphCycles(infoSink); @@ -690,6 +699,19 @@ int TIntermediate::addUsedOffsets(int binding, int offset, int numOffsets) return -1; // no collision } +// Accumulate used constant_id values. +// +// Return false is one was already used. +bool TIntermediate::addUsedConstantId(int id) +{ + if (usedConstantId.find(id) != usedConstantId.end()) + return false; + + usedConstantId.insert(id); + + return true; +} + // Recursively figure out how many locations are used up by an input or output type. // Return the size of type, as measured by "locations". int TIntermediate::computeTypeLocationSize(const TType& type) const diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 043d31fa424b4d076c1eb12c93053f236ccbc49e..00908b0b65bff153b7c182639a2826fb19015101 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -93,7 +93,7 @@ struct TIoRange { int index; }; -// An IO range is a 2-D rectangle; the set of (binding, offset) pairs all lying +// An offset range is a 2-D rectangle; the set of (binding, offset) pairs all lying // within the same binding and offset range. struct TOffsetRange { TOffsetRange(TRange binding, TRange offset) @@ -125,7 +125,7 @@ class TVariable; class TIntermediate { public: explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), spv(0), - numMains(0), numErrors(0), recursive(false), + numMains(0), numErrors(0), numPushConstants(0), recursive(false), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), pointMode(false), earlyFragmentTests(false), depthLayout(EldNone), depthReplacing(false), blendEquations(0), xfbMode(false) @@ -133,6 +133,9 @@ public: localSize[0] = 1; localSize[1] = 1; localSize[2] = 1; + localSizeSpecId[0] = TQualifier::layoutNotSet; + localSizeSpecId[1] = TQualifier::layoutNotSet; + localSizeSpecId[2] = TQualifier::layoutNotSet; xfbBuffers.resize(TQualifier::layoutXfbBufferEnd); } void setLimits(const TBuiltInResource& r) { resources = r; } @@ -156,8 +159,10 @@ public: void addMainCount() { ++numMains; } int getNumMains() const { return numMains; } int getNumErrors() const { return numErrors; } + void addPushConstantCount() { ++numPushConstants; } bool isRecursive() const { return recursive; } + TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, const TSourceLoc&); TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TSourceLoc&); TIntermSymbol* addSymbol(const TVariable&, const TSourceLoc&); TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const; @@ -255,6 +260,15 @@ public: } unsigned int getLocalSize(int dim) const { return localSize[dim]; } + bool setLocalSizeSpecId(int dim, int id) + { + if (localSizeSpecId[dim] != TQualifier::layoutNotSet) + return id == localSizeSpecId[dim]; + localSizeSpecId[dim] = id; + return true; + } + unsigned int getLocalSizeSpecId(int dim) const { return localSizeSpecId[dim]; } + void setXfbMode() { xfbMode = true; } bool getXfbMode() const { return xfbMode; } bool setOutputPrimitive(TLayoutGeometry p) @@ -294,6 +308,7 @@ public: int addUsedLocation(const TQualifier&, const TType&, bool& typeCollision); int addUsedOffsets(int binding, int offset, int numOffsets); + bool addUsedConstantId(int id); int computeTypeLocationSize(const TType&) const; bool setXfbBufferStride(int buffer, unsigned stride) @@ -328,6 +343,7 @@ protected: TBuiltInResource resources; int numMains; int numErrors; + int numPushConstants; bool recursive; int invocations; int vertices; @@ -339,6 +355,7 @@ protected: TVertexOrder vertexOrder; bool pointMode; int localSize[3]; + int localSizeSpecId[3]; bool earlyFragmentTests; TLayoutDepth depthLayout; bool depthReplacing; @@ -352,6 +369,7 @@ protected: std::vector<TIoRange> usedIo[4]; // sets of used locations, one for each of in, out, uniform, and buffers std::vector<TOffsetRange> usedAtomics; // sets of bindings used by atomic counters std::vector<TXfbBuffer> xfbBuffers; // all the data we need to track per xfb buffer + std::unordered_set<int> usedConstantId; // specialization constant ids used private: void operator=(TIntermediate&); // prevent assignments diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index 0c97e39f53fad32aacfc74e7a054b19bd2dc491d..702b66f47a6d5047e6e1e62720459ddc3a3c3274 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -303,7 +303,7 @@ public: // Returns an error message for any #include directive. class ForbidInclude : public Includer { public: - std::pair<std::string, std::string> include(const char* filename) const override + std::pair<std::string, std::string> include(const char* /*filename*/) const override { return std::make_pair<std::string, std::string>("", "unexpected include directive"); }