Move to revision 31 of SPIR-V.

This commit is contained in:
John Kessenich 2015-08-06 22:53:06 -06:00
parent e24a74c320
commit 5e4b1242bf
77 changed files with 6050 additions and 5450 deletions

3
SPIRV/CMakeLists.txt Normal file → Executable file
View File

@ -10,7 +10,8 @@ set(SOURCES
disassemble.cpp) disassemble.cpp)
set(HEADERS set(HEADERS
spirv.h spirv.hpp
GLSL.std.450.h
GlslangToSpv.h GlslangToSpv.h
SpvBuilder.h SpvBuilder.h
SPVRemapper.h SPVRemapper.h

298
SPIRV/GlslangToSpv.cpp Normal file → Executable file
View File

@ -39,14 +39,17 @@
// translate them to SPIR-V. // translate them to SPIR-V.
// //
#include "spirv.h" #include "spirv.hpp"
#include "GlslangToSpv.h" #include "GlslangToSpv.h"
#include "SpvBuilder.h" #include "SpvBuilder.h"
#include "GLSL450Lib.h" namespace spv {
#include "GLSL.std.450.h"
}
// Glslang includes // Glslang includes
#include "../glslang/MachineIndependent/localintermediate.h" #include "../glslang/MachineIndependent/localintermediate.h"
#include "../glslang/MachineIndependent/SymbolTable.h" #include "../glslang/MachineIndependent/SymbolTable.h"
#include "../glslang/Include/Common.h"
#include <string> #include <string>
#include <map> #include <map>
@ -85,6 +88,7 @@ protected:
spv::Id createSpvVariable(const glslang::TIntermSymbol*); spv::Id createSpvVariable(const glslang::TIntermSymbol*);
spv::Id getSampledType(const glslang::TSampler&); spv::Id getSampledType(const glslang::TSampler&);
spv::Id convertGlslangToSpvType(const glslang::TType& type); spv::Id convertGlslangToSpvType(const glslang::TType& type);
void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset);
bool isShaderEntrypoint(const glslang::TIntermAggregate* node); bool isShaderEntrypoint(const glslang::TIntermAggregate* node);
void makeFunctions(const glslang::TIntermSequence&); void makeFunctions(const glslang::TIntermSequence&);
@ -93,6 +97,7 @@ protected:
void handleFunctionEntry(const glslang::TIntermAggregate* node); void handleFunctionEntry(const glslang::TIntermAggregate* node);
void translateArguments(const glslang::TIntermSequence& glslangArguments, std::vector<spv::Id>& arguments); void translateArguments(const glslang::TIntermSequence& glslangArguments, std::vector<spv::Id>& arguments);
spv::Id handleBuiltInFunctionCall(const glslang::TIntermAggregate*); spv::Id handleBuiltInFunctionCall(const glslang::TIntermAggregate*);
spv::Id handleTextureCall(spv::Decoration precision, glslang::TOperator, spv::Id typeId, glslang::TSampler, std::vector<spv::Id>& idArguments);
spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*);
spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true); spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true);
@ -100,7 +105,7 @@ protected:
spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Id destTypeId, spv::Id operand); spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Id destTypeId, spv::Id operand);
spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize);
spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands);
spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands); spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy);
spv::Id createNoArgOperation(glslang::TOperator op); spv::Id createNoArgOperation(glslang::TOperator op);
spv::Id getSymbolId(const glslang::TIntermSymbol* node); spv::Id getSymbolId(const glslang::TIntermSymbol* node);
void addDecoration(spv::Id id, spv::Decoration dec); void addDecoration(spv::Id id, spv::Decoration dec);
@ -208,9 +213,9 @@ spv::Dim TranslateDimensionality(const glslang::TSampler& sampler)
spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type) spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type)
{ {
switch (type.getQualifier().precision) { switch (type.getQualifier().precision) {
case glslang::EpqLow: return spv::DecorationPrecisionLow; case glslang::EpqLow: return spv::DecorationRelaxedPrecision; // TODO: Map instead to 16-bit types?
case glslang::EpqMedium: return spv::DecorationPrecisionMedium; case glslang::EpqMedium: return spv::DecorationRelaxedPrecision;
case glslang::EpqHigh: return spv::DecorationPrecisionHigh; case glslang::EpqHigh: return spv::NoPrecision;
default: default:
return spv::NoPrecision; return spv::NoPrecision;
} }
@ -255,12 +260,9 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type)
case glslang::EvqBuffer: case glslang::EvqBuffer:
switch (type.getQualifier().layoutPacking) { switch (type.getQualifier().layoutPacking) {
case glslang::ElpShared: return spv::DecorationGLSLShared; case glslang::ElpShared: return spv::DecorationGLSLShared;
case glslang::ElpStd140: return spv::DecorationGLSLStd140;
case glslang::ElpStd430: return spv::DecorationGLSLStd430;
case glslang::ElpPacked: return spv::DecorationGLSLPacked; case glslang::ElpPacked: return spv::DecorationGLSLPacked;
default: default:
spv::MissingFunctionality("uniform block layout"); return (spv::Decoration)spv::BadValue;
return spv::DecorationGLSLShared;
} }
case glslang::EvqVaryingIn: case glslang::EvqVaryingIn:
case glslang::EvqVaryingOut: case glslang::EvqVaryingOut:
@ -309,7 +311,6 @@ spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn)
switch (builtIn) { switch (builtIn) {
case glslang::EbvPosition: return spv::BuiltInPosition; case glslang::EbvPosition: return spv::BuiltInPosition;
case glslang::EbvPointSize: return spv::BuiltInPointSize; case glslang::EbvPointSize: return spv::BuiltInPointSize;
case glslang::EbvClipVertex: return spv::BuiltInClipVertex;
case glslang::EbvClipDistance: return spv::BuiltInClipDistance; case glslang::EbvClipDistance: return spv::BuiltInClipDistance;
case glslang::EbvCullDistance: return spv::BuiltInCullDistance; case glslang::EbvCullDistance: return spv::BuiltInCullDistance;
case glslang::EbvVertexId: return spv::BuiltInVertexId; case glslang::EbvVertexId: return spv::BuiltInVertexId;
@ -359,7 +360,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
stdBuiltins = builder.import("GLSL.std.450"); stdBuiltins = builder.import("GLSL.std.450");
builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450);
shaderEntry = builder.makeMain(); shaderEntry = builder.makeMain();
builder.addEntryPoint(executionModel, shaderEntry); builder.addEntryPoint(executionModel, shaderEntry, "main");
// Add the source extensions // Add the source extensions
const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions();
@ -374,13 +375,16 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
unsigned int mode; unsigned int mode;
switch (glslangIntermediate->getStage()) { switch (glslangIntermediate->getStage()) {
case EShLangVertex: case EShLangVertex:
builder.addCapability(spv::CapabilityShader);
break; break;
case EShLangTessControl: case EShLangTessControl:
builder.addCapability(spv::CapabilityTessellation);
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices()); builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices());
break; break;
case EShLangTessEvaluation: case EShLangTessEvaluation:
builder.addCapability(spv::CapabilityTessellation);
switch (glslangIntermediate->getInputPrimitive()) { switch (glslangIntermediate->getInputPrimitive()) {
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break; case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
case glslang::ElgQuads: mode = spv::ExecutionModeInputQuads; break; case glslang::ElgQuads: mode = spv::ExecutionModeInputQuads; break;
@ -397,6 +401,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
break; break;
case EShLangGeometry: case EShLangGeometry:
builder.addCapability(spv::CapabilityGeometry);
switch (glslangIntermediate->getInputPrimitive()) { switch (glslangIntermediate->getInputPrimitive()) {
case glslang::ElgPoints: mode = spv::ExecutionModeInputPoints; break; case glslang::ElgPoints: mode = spv::ExecutionModeInputPoints; break;
case glslang::ElgLines: mode = spv::ExecutionModeInputLines; break; case glslang::ElgLines: mode = spv::ExecutionModeInputLines; break;
@ -421,13 +426,17 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
break; break;
case EShLangFragment: case EShLangFragment:
builder.addCapability(spv::CapabilityShader);
if (glslangIntermediate->getPixelCenterInteger()) if (glslangIntermediate->getPixelCenterInteger())
builder.addExecutionMode(shaderEntry, spv::ExecutionModePixelCenterInteger); builder.addExecutionMode(shaderEntry, spv::ExecutionModePixelCenterInteger);
if (glslangIntermediate->getOriginUpperLeft()) if (glslangIntermediate->getOriginUpperLeft())
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOriginUpperLeft); builder.addExecutionMode(shaderEntry, spv::ExecutionModeOriginUpperLeft);
else
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOriginLowerLeft);
break; break;
case EShLangCompute: case EShLangCompute:
builder.addCapability(spv::CapabilityShader);
break; break;
default: default:
@ -1051,7 +1060,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands.front(), node->getType().getBasicType() == glslang::EbtFloat || node->getType().getBasicType() == glslang::EbtDouble); result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands.front(), node->getType().getBasicType() == glslang::EbtFloat || node->getType().getBasicType() == glslang::EbtDouble);
break; break;
default: default:
result = createMiscOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands); result = createMiscOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands, node->getBasicType());
break; break;
} }
} }
@ -1311,9 +1320,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
case glslang::EbtSampler: case glslang::EbtSampler:
{ {
const glslang::TSampler& sampler = type.getSampler(); const glslang::TSampler& sampler = type.getSampler();
spvType = builder.makeSampler(getSampledType(sampler), TranslateDimensionality(sampler), spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), sampler.shadow, sampler.arrayed, sampler.ms,
sampler.image ? spv::Builder::samplerContentImage : spv::Builder::samplerContentTextureFilter, sampler.image ? 2 : 1, spv::ImageFormatUnknown); // TODO: translate format, needed for GLSL image ops
sampler.arrayed, sampler.shadow, sampler.ms); // OpenGL "textures" need to be combined with a sampler
if (! sampler.image)
spvType = builder.makeSampledImageType(spvType);
} }
break; break;
case glslang::EbtStruct: case glslang::EbtStruct:
@ -1350,6 +1361,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
structMap[glslangStruct] = spvType; structMap[glslangStruct] = spvType;
// Name and decorate the non-hidden members // Name and decorate the non-hidden members
int offset = -1;
for (int i = 0; i < (int)glslangStruct->size(); i++) { for (int i = 0; i < (int)glslangStruct->size(); i++) {
glslang::TType& glslangType = *(*glslangStruct)[i].type; glslang::TType& glslangType = *(*glslangStruct)[i].type;
int member = i; int member = i;
@ -1368,6 +1380,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
builder.addMemberDecoration(spvType, member, spv::DecorationComponent, glslangType.getQualifier().layoutComponent); builder.addMemberDecoration(spvType, member, spv::DecorationComponent, glslangType.getQualifier().layoutComponent);
if (glslangType.getQualifier().hasXfbOffset()) if (glslangType.getQualifier().hasXfbOffset())
builder.addMemberDecoration(spvType, member, spv::DecorationOffset, glslangType.getQualifier().layoutXfbOffset); builder.addMemberDecoration(spvType, member, spv::DecorationOffset, glslangType.getQualifier().layoutXfbOffset);
else {
// figure out what to do with offset, which is accumulating
int nextOffset;
updateMemberOffset(type, glslangType, offset, nextOffset);
if (offset >= 0)
builder.addMemberDecoration(spvType, member, spv::DecorationOffset, glslangType.getQualifier().layoutOffset);
offset = nextOffset;
}
// built-in variable decorations // built-in variable decorations
spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangType.getQualifier().builtIn); spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangType.getQualifier().builtIn);
@ -1383,7 +1403,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream); builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream);
if (glslangIntermediate->getXfbMode()) { if (glslangIntermediate->getXfbMode()) {
if (type.getQualifier().hasXfbStride()) if (type.getQualifier().hasXfbStride())
builder.addDecoration(spvType, spv::DecorationStride, type.getQualifier().layoutXfbStride); builder.addDecoration(spvType, spv::DecorationXfbStride, type.getQualifier().layoutXfbStride);
if (type.getQualifier().hasXfbBuffer()) if (type.getQualifier().hasXfbBuffer())
builder.addDecoration(spvType, spv::DecorationXfbBuffer, type.getQualifier().layoutXfbBuffer); builder.addDecoration(spvType, spv::DecorationXfbBuffer, type.getQualifier().layoutXfbBuffer);
} }
@ -1415,6 +1435,49 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
return spvType; return spvType;
} }
// Given a member type of a struct, realign the current offset for it, and compute
// the next (not yet aligned) offset for the next member, which will get aligned
// on the next call.
// '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)
{
// this will get a positive value when deemed necessary
nextOffset = -1;
bool forceOffset = structType.getQualifier().layoutPacking == glslang::ElpStd140 ||
structType.getQualifier().layoutPacking == glslang::ElpStd430;
// override anything in currentOffset with user-set offset
if (memberType.getQualifier().hasOffset())
currentOffset = memberType.getQualifier().layoutOffset;
// It could be that current linker usage in glslang updated all the layoutOffset,
// in which case the following code does not matter. But, that's not quite right
// once cross-compilation unit GLSL validation is done, as the original user
// settings are needed in layoutOffset, and then the following will come into play.
if (! forceOffset) {
if (! memberType.getQualifier().hasOffset())
currentOffset = -1;
return;
}
// Getting this far means we are forcing offsets
if (currentOffset < 0)
currentOffset = 0;
// Now, currentOffset is valid (either 0, or from a previous nextOffset),
// but possibly not yet correctly aligned.
int memberSize;
int memberAlignment = glslangIntermediate->getBaseAlignment(memberType, memberSize, memberType.getQualifier().layoutPacking == glslang::ElpStd140);
glslang::RoundToPow2(currentOffset, memberAlignment);
nextOffset = currentOffset + memberSize;
}
bool TGlslangToSpvTraverser::isShaderEntrypoint(const glslang::TIntermAggregate* node) bool TGlslangToSpvTraverser::isShaderEntrypoint(const glslang::TIntermAggregate* node)
{ {
return node->getName() == "main("; return node->getName() == "main(";
@ -1519,11 +1582,6 @@ spv::Id TGlslangToSpvTraverser::handleBuiltInFunctionCall(const glslang::TInterm
{ {
std::vector<spv::Id> arguments; std::vector<spv::Id> arguments;
translateArguments(node->getSequence(), arguments); translateArguments(node->getSequence(), arguments);
std::vector<spv::Id> argTypes;
for (int a = 0; a < (int)arguments.size(); ++a)
argTypes.push_back(builder.getTypeId(arguments[a]));
spv::Decoration precision = TranslatePrecisionDecoration(node->getType()); spv::Decoration precision = TranslatePrecisionDecoration(node->getType());
if (node->getName() == "ftransform(") { if (node->getName() == "ftransform(") {
@ -1544,22 +1602,22 @@ spv::Id TGlslangToSpvTraverser::handleBuiltInFunctionCall(const glslang::TInterm
if (node->getName().find("textureSize", 0) != std::string::npos) { if (node->getName().find("textureSize", 0) != std::string::npos) {
if (arguments.size() > 1) { if (arguments.size() > 1) {
params.lod = arguments[1]; params.lod = arguments[1];
return builder.createTextureQueryCall(spv::OpTextureQuerySizeLod, params); return builder.createTextureQueryCall(spv::OpImageQuerySizeLod, params);
} else } else
return builder.createTextureQueryCall(spv::OpTextureQuerySize, params); return builder.createTextureQueryCall(spv::OpImageQuerySize, params);
} }
// special case the number of samples query // special case the number of samples query
if (node->getName().find("textureSamples", 0) != std::string::npos) if (node->getName().find("textureSamples", 0) != std::string::npos)
return builder.createTextureQueryCall(spv::OpTextureQuerySamples, params); return builder.createTextureQueryCall(spv::OpImageQuerySamples, params);
// special case the other queries // special case the other queries
if (node->getName().find("Query", 0) != std::string::npos) { if (node->getName().find("Query", 0) != std::string::npos) {
if (node->getName().find("Levels", 0) != std::string::npos) if (node->getName().find("Levels", 0) != std::string::npos)
return builder.createTextureQueryCall(spv::OpTextureQueryLevels, params); return builder.createTextureQueryCall(spv::OpImageQueryLevels, params);
else if (node->getName().find("Lod", 0) != std::string::npos) { else if (node->getName().find("Lod", 0) != std::string::npos) {
params.coords = arguments[1]; params.coords = arguments[1];
return builder.createTextureQueryCall(spv::OpTextureQueryLod, params); return builder.createTextureQueryCall(spv::OpImageQueryLod, params);
} else } else
spv::MissingFunctionality("glslang texture query"); spv::MissingFunctionality("glslang texture query");
} }
@ -1599,6 +1657,16 @@ spv::Id TGlslangToSpvTraverser::handleBuiltInFunctionCall(const glslang::TInterm
int extraArgs = 0; int extraArgs = 0;
if (cubeCompare) if (cubeCompare)
params.Dref = arguments[2]; params.Dref = arguments[2];
else if (sampler.shadow) {
std::vector<spv::Id> indexes;
int comp;
if (proj)
comp = 3;
else
comp = builder.getNumComponents(params.coords) - 1;
indexes.push_back(comp);
params.Dref = builder.createCompositeExtract(params.coords, builder.getScalarTypeId(builder.getTypeId(params.coords)), indexes);
}
if (lod) { if (lod) {
params.lod = arguments[2]; params.lod = arguments[2];
++extraArgs; ++extraArgs;
@ -1835,7 +1903,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv
break; break;
case glslang::EOpLogicalXor: case glslang::EOpLogicalXor:
needMatchingVectors = false; needMatchingVectors = false;
binOp = spv::OpLogicalXor; binOp = spv::OpLogicalNotEqual;
break; break;
case glslang::EOpLessThan: case glslang::EOpLessThan:
@ -1974,107 +2042,109 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
case glslang::EOpLogicalNot: case glslang::EOpLogicalNot:
case glslang::EOpVectorLogicalNot: case glslang::EOpVectorLogicalNot:
unaryOp = spv::OpLogicalNot;
break;
case glslang::EOpBitwiseNot: case glslang::EOpBitwiseNot:
unaryOp = spv::OpNot; unaryOp = spv::OpNot;
break; break;
case glslang::EOpDeterminant: case glslang::EOpDeterminant:
libCall = GLSL_STD_450::Determinant; libCall = spv::GLSLstd450Determinant;
break; break;
case glslang::EOpMatrixInverse: case glslang::EOpMatrixInverse:
libCall = GLSL_STD_450::MatrixInverse; libCall = spv::GLSLstd450MatrixInverse;
break; break;
case glslang::EOpTranspose: case glslang::EOpTranspose:
unaryOp = spv::OpTranspose; unaryOp = spv::OpTranspose;
break; break;
case glslang::EOpRadians: case glslang::EOpRadians:
libCall = GLSL_STD_450::Radians; libCall = spv::GLSLstd450Radians;
break; break;
case glslang::EOpDegrees: case glslang::EOpDegrees:
libCall = GLSL_STD_450::Degrees; libCall = spv::GLSLstd450Degrees;
break; break;
case glslang::EOpSin: case glslang::EOpSin:
libCall = GLSL_STD_450::Sin; libCall = spv::GLSLstd450Sin;
break; break;
case glslang::EOpCos: case glslang::EOpCos:
libCall = GLSL_STD_450::Cos; libCall = spv::GLSLstd450Cos;
break; break;
case glslang::EOpTan: case glslang::EOpTan:
libCall = GLSL_STD_450::Tan; libCall = spv::GLSLstd450Tan;
break; break;
case glslang::EOpAcos: case glslang::EOpAcos:
libCall = GLSL_STD_450::Acos; libCall = spv::GLSLstd450Acos;
break; break;
case glslang::EOpAsin: case glslang::EOpAsin:
libCall = GLSL_STD_450::Asin; libCall = spv::GLSLstd450Asin;
break; break;
case glslang::EOpAtan: case glslang::EOpAtan:
libCall = GLSL_STD_450::Atan; libCall = spv::GLSLstd450Atan;
break; break;
case glslang::EOpAcosh: case glslang::EOpAcosh:
libCall = GLSL_STD_450::Acosh; libCall = spv::GLSLstd450Acosh;
break; break;
case glslang::EOpAsinh: case glslang::EOpAsinh:
libCall = GLSL_STD_450::Asinh; libCall = spv::GLSLstd450Asinh;
break; break;
case glslang::EOpAtanh: case glslang::EOpAtanh:
libCall = GLSL_STD_450::Atanh; libCall = spv::GLSLstd450Atanh;
break; break;
case glslang::EOpTanh: case glslang::EOpTanh:
libCall = GLSL_STD_450::Tanh; libCall = spv::GLSLstd450Tanh;
break; break;
case glslang::EOpCosh: case glslang::EOpCosh:
libCall = GLSL_STD_450::Cosh; libCall = spv::GLSLstd450Cosh;
break; break;
case glslang::EOpSinh: case glslang::EOpSinh:
libCall = GLSL_STD_450::Sinh; libCall = spv::GLSLstd450Sinh;
break; break;
case glslang::EOpLength: case glslang::EOpLength:
libCall = GLSL_STD_450::Length; libCall = spv::GLSLstd450Length;
break; break;
case glslang::EOpNormalize: case glslang::EOpNormalize:
libCall = GLSL_STD_450::Normalize; libCall = spv::GLSLstd450Normalize;
break; break;
case glslang::EOpExp: case glslang::EOpExp:
libCall = GLSL_STD_450::Exp; libCall = spv::GLSLstd450Exp;
break; break;
case glslang::EOpLog: case glslang::EOpLog:
libCall = GLSL_STD_450::Log; libCall = spv::GLSLstd450Log;
break; break;
case glslang::EOpExp2: case glslang::EOpExp2:
libCall = GLSL_STD_450::Exp2; libCall = spv::GLSLstd450Exp2;
break; break;
case glslang::EOpLog2: case glslang::EOpLog2:
libCall = GLSL_STD_450::Log2; libCall = spv::GLSLstd450Log2;
break; break;
case glslang::EOpSqrt: case glslang::EOpSqrt:
libCall = GLSL_STD_450::Sqrt; libCall = spv::GLSLstd450Sqrt;
break; break;
case glslang::EOpInverseSqrt: case glslang::EOpInverseSqrt:
libCall = GLSL_STD_450::InverseSqrt; libCall = spv::GLSLstd450InverseSqrt;
break; break;
case glslang::EOpFloor: case glslang::EOpFloor:
libCall = GLSL_STD_450::Floor; libCall = spv::GLSLstd450Floor;
break; break;
case glslang::EOpTrunc: case glslang::EOpTrunc:
libCall = GLSL_STD_450::Trunc; libCall = spv::GLSLstd450Trunc;
break; break;
case glslang::EOpRound: case glslang::EOpRound:
libCall = GLSL_STD_450::Round; libCall = spv::GLSLstd450Round;
break; break;
case glslang::EOpRoundEven: case glslang::EOpRoundEven:
libCall = GLSL_STD_450::RoundEven; libCall = spv::GLSLstd450RoundEven;
break; break;
case glslang::EOpCeil: case glslang::EOpCeil:
libCall = GLSL_STD_450::Ceil; libCall = spv::GLSLstd450Ceil;
break; break;
case glslang::EOpFract: case glslang::EOpFract:
libCall = GLSL_STD_450::Fract; libCall = spv::GLSLstd450Fract;
break; break;
case glslang::EOpIsNan: case glslang::EOpIsNan:
@ -2084,35 +2154,23 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
unaryOp = spv::OpIsInf; unaryOp = spv::OpIsInf;
break; break;
case glslang::EOpFloatBitsToInt:
libCall = GLSL_STD_450::FloatBitsToInt;
break;
case glslang::EOpFloatBitsToUint:
libCall = GLSL_STD_450::FloatBitsToUint;
break;
case glslang::EOpIntBitsToFloat:
libCall = GLSL_STD_450::IntBitsToFloat;
break;
case glslang::EOpUintBitsToFloat:
libCall = GLSL_STD_450::UintBitsToFloat;
break;
case glslang::EOpPackSnorm2x16: case glslang::EOpPackSnorm2x16:
libCall = GLSL_STD_450::PackSnorm2x16; libCall = spv::GLSLstd450PackSnorm2x16;
break; break;
case glslang::EOpUnpackSnorm2x16: case glslang::EOpUnpackSnorm2x16:
libCall = GLSL_STD_450::UnpackSnorm2x16; libCall = spv::GLSLstd450UnpackSnorm2x16;
break; break;
case glslang::EOpPackUnorm2x16: case glslang::EOpPackUnorm2x16:
libCall = GLSL_STD_450::PackUnorm2x16; libCall = spv::GLSLstd450PackUnorm2x16;
break; break;
case glslang::EOpUnpackUnorm2x16: case glslang::EOpUnpackUnorm2x16:
libCall = GLSL_STD_450::UnpackUnorm2x16; libCall = spv::GLSLstd450UnpackUnorm2x16;
break; break;
case glslang::EOpPackHalf2x16: case glslang::EOpPackHalf2x16:
libCall = GLSL_STD_450::PackHalf2x16; libCall = spv::GLSLstd450PackHalf2x16;
break; break;
case glslang::EOpUnpackHalf2x16: case glslang::EOpUnpackHalf2x16:
libCall = GLSL_STD_450::UnpackHalf2x16; libCall = spv::GLSLstd450UnpackHalf2x16;
break; break;
case glslang::EOpDPdx: case glslang::EOpDPdx:
@ -2151,10 +2209,16 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
break; break;
case glslang::EOpAbs: case glslang::EOpAbs:
libCall = GLSL_STD_450::Abs; if (isFloat)
libCall = spv::GLSLstd450FAbs;
else
libCall = spv::GLSLstd450SAbs;
break; break;
case glslang::EOpSign: case glslang::EOpSign:
libCall = GLSL_STD_450::Sign; if (isFloat)
libCall = spv::GLSLstd450FSign;
else
libCall = spv::GLSLstd450SSign;
break; break;
default: default:
@ -2291,10 +2355,10 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
opCode = spv::OpAtomicIAdd; opCode = spv::OpAtomicIAdd;
break; break;
case glslang::EOpAtomicMin: case glslang::EOpAtomicMin:
opCode = spv::OpAtomicIMin; opCode = spv::OpAtomicSMin;
break; break;
case glslang::EOpAtomicMax: case glslang::EOpAtomicMax:
opCode = spv::OpAtomicIMax; opCode = spv::OpAtomicSMax;
break; break;
case glslang::EOpAtomicAnd: case glslang::EOpAtomicAnd:
opCode = spv::OpAtomicAnd; opCode = spv::OpAtomicAnd;
@ -2331,8 +2395,8 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
std::vector<spv::Id> spvAtomicOperands; // hold the spv operands std::vector<spv::Id> spvAtomicOperands; // hold the spv operands
auto opIt = operands.begin(); // walk the glslang operands auto opIt = operands.begin(); // walk the glslang operands
spvAtomicOperands.push_back(*(opIt++)); spvAtomicOperands.push_back(*(opIt++));
spvAtomicOperands.push_back(spv::ExecutionScopeDevice); // TBD: what is the correct scope? spvAtomicOperands.push_back(builder.makeUintConstant(spv::ScopeDevice)); // TBD: what is the correct scope?
spvAtomicOperands.push_back( spv::MemorySemanticsMaskNone); // TBD: what are the correct memory semantics? spvAtomicOperands.push_back(builder.makeUintConstant(spv::MemorySemanticsMaskNone)); // TBD: what are the correct memory semantics?
// Add the rest of the operands, skipping the first one, which was dealt with above. // Add the rest of the operands, skipping the first one, which was dealt with above.
// For some ops, there are none, for some 1, for compare-exchange, 2. // For some ops, there are none, for some 1, for compare-exchange, 2.
@ -2342,58 +2406,76 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
return builder.createOp(opCode, typeId, spvAtomicOperands); return builder.createOp(opCode, typeId, spvAtomicOperands);
} }
spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands) spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector<spv::Id>& operands, glslang::TBasicType typeProxy)
{ {
bool isUnsigned = typeProxy == glslang::EbtUint;
bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
spv::Op opCode = spv::OpNop; spv::Op opCode = spv::OpNop;
int libCall = -1; int libCall = -1;
switch (op) { switch (op) {
case glslang::EOpMin: case glslang::EOpMin:
libCall = GLSL_STD_450::Min; if (isFloat)
libCall = spv::GLSLstd450FMin;
else if (isUnsigned)
libCall = spv::GLSLstd450UMin;
else
libCall = spv::GLSLstd450SMin;
break; break;
case glslang::EOpModf: case glslang::EOpModf:
libCall = GLSL_STD_450::Modf; libCall = spv::GLSLstd450Modf;
break; break;
case glslang::EOpMax: case glslang::EOpMax:
libCall = GLSL_STD_450::Max; if (isFloat)
libCall = spv::GLSLstd450FMax;
else if (isUnsigned)
libCall = spv::GLSLstd450UMax;
else
libCall = spv::GLSLstd450SMax;
break; break;
case glslang::EOpPow: case glslang::EOpPow:
libCall = GLSL_STD_450::Pow; libCall = spv::GLSLstd450Pow;
break; break;
case glslang::EOpDot: case glslang::EOpDot:
opCode = spv::OpDot; opCode = spv::OpDot;
break; break;
case glslang::EOpAtan: case glslang::EOpAtan:
libCall = GLSL_STD_450::Atan2; libCall = spv::GLSLstd450Atan2;
break; break;
case glslang::EOpClamp: case glslang::EOpClamp:
libCall = GLSL_STD_450::Clamp; if (isFloat)
libCall = spv::GLSLstd450FClamp;
else if (isUnsigned)
libCall = spv::GLSLstd450UClamp;
else
libCall = spv::GLSLstd450SClamp;
break; break;
case glslang::EOpMix: case glslang::EOpMix:
libCall = GLSL_STD_450::Mix; libCall = spv::GLSLstd450Mix;
break; break;
case glslang::EOpStep: case glslang::EOpStep:
libCall = GLSL_STD_450::Step; libCall = spv::GLSLstd450Step;
break; break;
case glslang::EOpSmoothStep: case glslang::EOpSmoothStep:
libCall = GLSL_STD_450::SmoothStep; libCall = spv::GLSLstd450SmoothStep;
break; break;
case glslang::EOpDistance: case glslang::EOpDistance:
libCall = GLSL_STD_450::Distance; libCall = spv::GLSLstd450Distance;
break; break;
case glslang::EOpCross: case glslang::EOpCross:
libCall = GLSL_STD_450::Cross; libCall = spv::GLSLstd450Cross;
break; break;
case glslang::EOpFaceForward: case glslang::EOpFaceForward:
libCall = GLSL_STD_450::FaceForward; libCall = spv::GLSLstd450FaceForward;
break; break;
case glslang::EOpReflect: case glslang::EOpReflect:
libCall = GLSL_STD_450::Reflect; libCall = spv::GLSLstd450Reflect;
break; break;
case glslang::EOpRefract: case glslang::EOpRefract:
libCall = GLSL_STD_450::Refract; libCall = spv::GLSLstd450Refract;
break; break;
default: default:
@ -2444,26 +2526,26 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op)
builder.createNoResultOp(spv::OpEndPrimitive); builder.createNoResultOp(spv::OpEndPrimitive);
return 0; return 0;
case glslang::EOpBarrier: case glslang::EOpBarrier:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsAllMemory); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory);
builder.createControlBarrier(spv::ExecutionScopeDevice); builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsMaskNone);
return 0; return 0;
case glslang::EOpMemoryBarrier: case glslang::EOpMemoryBarrier:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsAllMemory); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory);
return 0; return 0;
case glslang::EOpMemoryBarrierAtomicCounter: case glslang::EOpMemoryBarrierAtomicCounter:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask);
return 0; return 0;
case glslang::EOpMemoryBarrierBuffer: case glslang::EOpMemoryBarrierBuffer:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsUniformMemoryMask); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask);
return 0; return 0;
case glslang::EOpMemoryBarrierImage: case glslang::EOpMemoryBarrierImage:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsImageMemoryMask); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask);
return 0; return 0;
case glslang::EOpMemoryBarrierShared: case glslang::EOpMemoryBarrierShared:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsWorkgroupLocalMemoryMask); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupLocalMemoryMask);
return 0; return 0;
case glslang::EOpGroupMemoryBarrier: case glslang::EOpGroupMemoryBarrier:
builder.createMemoryBarrier(spv::ExecutionScopeDevice, spv::MemorySemanticsWorkgroupGlobalMemoryMask); builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupGlobalMemoryMask);
return 0; return 0;
default: default:
spv::MissingFunctionality("operation with no arguments"); spv::MissingFunctionality("operation with no arguments");
@ -2495,7 +2577,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent); builder.addDecoration(id, spv::DecorationComponent, symbol->getQualifier().layoutComponent);
if (glslangIntermediate->getXfbMode()) { if (glslangIntermediate->getXfbMode()) {
if (symbol->getQualifier().hasXfbStride()) if (symbol->getQualifier().hasXfbStride())
builder.addDecoration(id, spv::DecorationStride, symbol->getQualifier().layoutXfbStride); builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride);
if (symbol->getQualifier().hasXfbBuffer()) if (symbol->getQualifier().hasXfbBuffer())
builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer);
if (symbol->getQualifier().hasXfbOffset()) if (symbol->getQualifier().hasXfbOffset())
@ -2512,14 +2594,14 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addDecoration(id, spv::DecorationBinding, symbol->getQualifier().layoutBinding); builder.addDecoration(id, spv::DecorationBinding, symbol->getQualifier().layoutBinding);
if (glslangIntermediate->getXfbMode()) { if (glslangIntermediate->getXfbMode()) {
if (symbol->getQualifier().hasXfbStride()) if (symbol->getQualifier().hasXfbStride())
builder.addDecoration(id, spv::DecorationStride, symbol->getQualifier().layoutXfbStride); builder.addDecoration(id, spv::DecorationXfbStride, symbol->getQualifier().layoutXfbStride);
if (symbol->getQualifier().hasXfbBuffer()) if (symbol->getQualifier().hasXfbBuffer())
builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer); builder.addDecoration(id, spv::DecorationXfbBuffer, symbol->getQualifier().layoutXfbBuffer);
} }
// built-in variable decorations // built-in variable decorations
spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn); spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn);
if ((unsigned int)builtIn != spv::BadValue) if (builtIn != spv::BadValue)
builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
if (linkageOnly) if (linkageOnly)

50
SPIRV/SPVRemapper.cpp Normal file → Executable file
View File

@ -82,6 +82,8 @@ namespace spv {
case spv::OpTypeFloat: // fall through... case spv::OpTypeFloat: // fall through...
case spv::OpTypePointer: return range_t(2, 3); case spv::OpTypePointer: return range_t(2, 3);
case spv::OpTypeInt: return range_t(2, 4); case spv::OpTypeInt: return range_t(2, 4);
// TODO: case spv::OpTypeImage:
// TODO: case spv::OpTypeSampledImage:
case spv::OpTypeSampler: return range_t(3, 8); case spv::OpTypeSampler: return range_t(3, 8);
case spv::OpTypeVector: // fall through case spv::OpTypeVector: // fall through
case spv::OpTypeMatrix: // ... case spv::OpTypeMatrix: // ...
@ -164,8 +166,8 @@ namespace spv {
case spv::OpTypeFloat: case spv::OpTypeFloat:
case spv::OpTypeVector: case spv::OpTypeVector:
case spv::OpTypeMatrix: case spv::OpTypeMatrix:
case spv::OpTypeImage:
case spv::OpTypeSampler: case spv::OpTypeSampler:
case spv::OpTypeFilter:
case spv::OpTypeArray: case spv::OpTypeArray:
case spv::OpTypeRuntimeArray: case spv::OpTypeRuntimeArray:
case spv::OpTypeStruct: case spv::OpTypeStruct:
@ -184,12 +186,11 @@ namespace spv {
bool spirvbin_t::isConstOp(spv::Op opCode) const bool spirvbin_t::isConstOp(spv::Op opCode) const
{ {
switch (opCode) { switch (opCode) {
case spv::OpConstantNullObject: error("unimplemented constant type"); case spv::OpConstantNull: error("unimplemented constant type");
case spv::OpConstantSampler: error("unimplemented constant type"); case spv::OpConstantSampler: error("unimplemented constant type");
case spv::OpConstantTrue: case spv::OpConstantTrue:
case spv::OpConstantFalse: case spv::OpConstantFalse:
case spv::OpConstantNullPointer:
case spv::OpConstantComposite: case spv::OpConstantComposite:
case spv::OpConstant: return true; case spv::OpConstant: return true;
default: return false; default: return false;
@ -486,7 +487,7 @@ namespace spv {
case spv::OperandFunction: case spv::OperandFunction:
case spv::OperandMemorySemantics: case spv::OperandMemorySemantics:
case spv::OperandMemoryAccess: case spv::OperandMemoryAccess:
case spv::OperandExecutionScope: case spv::OperandScope:
case spv::OperandGroupOperation: case spv::OperandGroupOperation:
case spv::OperandKernelEnqueueFlags: case spv::OperandKernelEnqueueFlags:
case spv::OperandKernelProfilingInfo: case spv::OperandKernelProfilingInfo:
@ -610,19 +611,14 @@ namespace spv {
fnId = asId(start + 2); fnId = asId(start + 2);
break; break;
case spv::OpTextureSample: case spv::OpImageSampleImplicitLod:
case spv::OpTextureSampleDref: case spv::OpImageSampleExplicitLod:
case spv::OpTextureSampleLod: case spv::OpImageSampleDrefImplicitLod:
case spv::OpTextureSampleProj: case spv::OpImageSampleDrefExplicitLod:
case spv::OpTextureSampleGrad: case spv::OpImageSampleProjImplicitLod:
case spv::OpTextureSampleOffset: case spv::OpImageSampleProjExplicitLod:
case spv::OpTextureSampleProjLod: case spv::OpImageSampleProjDrefImplicitLod:
case spv::OpTextureSampleProjGrad: case spv::OpImageSampleProjDrefExplicitLod:
case spv::OpTextureSampleLodOffset:
case spv::OpTextureSampleProjOffset:
case spv::OpTextureSampleGradOffset:
case spv::OpTextureSampleProjLodOffset:
case spv::OpTextureSampleProjGradOffset:
case spv::OpDot: case spv::OpDot:
case spv::OpCompositeExtract: case spv::OpCompositeExtract:
case spv::OpCompositeInsert: case spv::OpCompositeInsert:
@ -668,7 +664,7 @@ namespace spv {
process( process(
[&](spv::Op opCode, unsigned start) { [&](spv::Op opCode, unsigned start) {
// Add inputs and uniforms to the map // Add inputs and uniforms to the map
if (((opCode == spv::OpVariable && asWordCount(start) == 4) || (opCode == spv::OpVariableArray)) && if ((opCode == spv::OpVariable && asWordCount(start) == 4) &&
(spv[start+3] == spv::StorageClassUniform || (spv[start+3] == spv::StorageClassUniform ||
spv[start+3] == spv::StorageClassUniformConstant || spv[start+3] == spv::StorageClassUniformConstant ||
spv[start+3] == spv::StorageClassInput)) spv[start+3] == spv::StorageClassInput))
@ -695,7 +691,7 @@ namespace spv {
process( process(
[&](spv::Op opCode, unsigned start) { [&](spv::Op opCode, unsigned start) {
// Add inputs and uniforms to the map // Add inputs and uniforms to the map
if (((opCode == spv::OpVariable && asWordCount(start) == 4) || (opCode == spv::OpVariableArray)) && if ((opCode == spv::OpVariable && asWordCount(start) == 4) &&
(spv[start+3] == spv::StorageClassOutput)) (spv[start+3] == spv::StorageClassOutput))
fnLocalVars.insert(asId(start+2)); fnLocalVars.insert(asId(start+2));
@ -729,8 +725,7 @@ namespace spv {
const int wordCount = asWordCount(start); const int wordCount = asWordCount(start);
// Add local variables to the map // Add local variables to the map
if ((opCode == spv::OpVariable && spv[start+3] == spv::StorageClassFunction && asWordCount(start) == 4) || if ((opCode == spv::OpVariable && spv[start+3] == spv::StorageClassFunction && asWordCount(start) == 4))
(opCode == spv::OpVariableArray && spv[start+3] == spv::StorageClassFunction))
fnLocalVars.insert(asId(start+2)); fnLocalVars.insert(asId(start+2));
// Ignore process vars referenced via access chain // Ignore process vars referenced via access chain
@ -1008,14 +1003,14 @@ namespace spv {
return 6 + hashType(typePos(spv[typeStart+2])) * (spv[typeStart+3] - 1); return 6 + hashType(typePos(spv[typeStart+2])) * (spv[typeStart+3] - 1);
case spv::OpTypeMatrix: case spv::OpTypeMatrix:
return 30 + hashType(typePos(spv[typeStart+2])) * (spv[typeStart+3] - 1); return 30 + hashType(typePos(spv[typeStart+2])) * (spv[typeStart+3] - 1);
case spv::OpTypeSampler: case spv::OpTypeImage:
return 120 + hashType(typePos(spv[typeStart+2])) + return 120 + hashType(typePos(spv[typeStart+2])) +
spv[typeStart+3] + // dimensionality spv[typeStart+3] + // dimensionality
spv[typeStart+4] * 8 * 16 + // content spv[typeStart+4] * 8 * 16 + // depth
spv[typeStart+5] * 4 * 16 + // arrayed spv[typeStart+5] * 4 * 16 + // arrayed
spv[typeStart+6] * 2 * 16 + // compare spv[typeStart+6] * 2 * 16 + // multisampled
spv[typeStart+7] * 1 * 16; // multisampled spv[typeStart+7] * 1 * 16; // format
case spv::OpTypeFilter: case spv::OpTypeSampler:
return 500; return 500;
case spv::OpTypeArray: case spv::OpTypeArray:
return 501 + hashType(typePos(spv[typeStart+2])) * spv[typeStart+3]; return 501 + hashType(typePos(spv[typeStart+2])) * spv[typeStart+3];
@ -1045,12 +1040,11 @@ namespace spv {
case spv::OpTypeQueue: return 300003; case spv::OpTypeQueue: return 300003;
case spv::OpTypePipe: return 300004; case spv::OpTypePipe: return 300004;
case spv::OpConstantNullObject: return 300005; case spv::OpConstantNull: return 300005;
case spv::OpConstantSampler: return 300006; case spv::OpConstantSampler: return 300006;
case spv::OpConstantTrue: return 300007; case spv::OpConstantTrue: return 300007;
case spv::OpConstantFalse: return 300008; case spv::OpConstantFalse: return 300008;
case spv::OpConstantNullPointer: return 300009;
case spv::OpConstantComposite: case spv::OpConstantComposite:
{ {
std::uint32_t hash = 300011 + hashType(typePos(spv[typeStart+1])); std::uint32_t hash = 300011 + hashType(typePos(spv[typeStart+1]));

2
SPIRV/SPVRemapper.h Normal file → Executable file
View File

@ -101,7 +101,7 @@ public:
#include <set> #include <set>
#include <cassert> #include <cassert>
#include "spirv.h" #include "spirv.hpp"
#include "spvIR.h" #include "spvIR.h"
namespace spv { namespace spv {

198
SPIRV/SpvBuilder.cpp Normal file → Executable file
View File

@ -295,31 +295,54 @@ Id Builder::makeFunctionType(Id returnType, std::vector<Id>& paramTypes)
return type->getResultId(); return type->getResultId();
} }
Id Builder::makeSampler(Id sampledType, Dim dim, samplerContent content, bool arrayed, bool shadow, bool ms) Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format)
{ {
// try to find it // try to find it
Instruction* type; Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeSampler].size(); ++t) { for (int t = 0; t < (int)groupedTypes[OpTypeImage].size(); ++t) {
type = groupedTypes[OpTypeSampler][t]; type = groupedTypes[OpTypeImage][t];
if (type->getIdOperand(0) == sampledType && if (type->getIdOperand(0) == sampledType &&
type->getImmediateOperand(1) == (unsigned int)dim && type->getImmediateOperand(1) == (unsigned int)dim &&
type->getImmediateOperand(2) == (unsigned int)content && type->getImmediateOperand(2) == ( depth ? 1u : 0u) &&
type->getImmediateOperand(3) == (arrayed ? 1u : 0u) && type->getImmediateOperand(3) == (arrayed ? 1u : 0u) &&
type->getImmediateOperand(4) == ( shadow ? 1u : 0u) && type->getImmediateOperand(4) == ( ms ? 1u : 0u) &&
type->getImmediateOperand(5) == ( ms ? 1u : 0u)) type->getImmediateOperand(5) == sampled &&
type->getImmediateOperand(6) == (unsigned int)format)
return type->getResultId(); return type->getResultId();
} }
// not found, make it // not found, make it
type = new Instruction(getUniqueId(), NoType, OpTypeSampler); type = new Instruction(getUniqueId(), NoType, OpTypeImage);
type->addIdOperand(sampledType); type->addIdOperand(sampledType);
type->addImmediateOperand( dim); type->addImmediateOperand( dim);
type->addImmediateOperand(content); type->addImmediateOperand( depth ? 1 : 0);
type->addImmediateOperand(arrayed ? 1 : 0); type->addImmediateOperand(arrayed ? 1 : 0);
type->addImmediateOperand( shadow ? 1 : 0);
type->addImmediateOperand( ms ? 1 : 0); type->addImmediateOperand( ms ? 1 : 0);
type->addImmediateOperand(sampled);
type->addImmediateOperand((unsigned int)format);
groupedTypes[OpTypeSampler].push_back(type); groupedTypes[OpTypeImage].push_back(type);
constantsTypesGlobals.push_back(type);
module.mapInstruction(type);
return type->getResultId();
}
Id Builder::makeSampledImageType(Id imageType)
{
// try to find it
Instruction* type;
for (int t = 0; t < (int)groupedTypes[OpTypeSampledImage].size(); ++t) {
type = groupedTypes[OpTypeSampledImage][t];
if (type->getIdOperand(0) == imageType)
return type->getResultId();
}
// not found, make it
type = new Instruction(getUniqueId(), NoType, OpTypeSampledImage);
type->addIdOperand(imageType);
groupedTypes[OpTypeSampledImage].push_back(type);
constantsTypesGlobals.push_back(type); constantsTypesGlobals.push_back(type);
module.mapInstruction(type); module.mapInstruction(type);
@ -606,11 +629,12 @@ Id Builder::makeCompositeConstant(Id typeId, std::vector<Id>& members)
return c->getResultId(); return c->getResultId();
} }
void Builder::addEntryPoint(ExecutionModel model, Function* function) void Builder::addEntryPoint(ExecutionModel model, Function* function, const char* name)
{ {
Instruction* entryPoint = new Instruction(OpEntryPoint); Instruction* entryPoint = new Instruction(OpEntryPoint);
entryPoint->addImmediateOperand(model); entryPoint->addImmediateOperand(model);
entryPoint->addIdOperand(function->getId()); entryPoint->addIdOperand(function->getId());
entryPoint->addStringOperand(name);
entryPoints.push_back(entryPoint); entryPoints.push_back(entryPoint);
} }
@ -945,18 +969,20 @@ void Builder::createNoResultOp(Op opCode, Id operand)
buildPoint->addInstruction(op); buildPoint->addInstruction(op);
} }
void Builder::createControlBarrier(unsigned executionScope) void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask semantics)
{ {
Instruction* op = new Instruction(OpControlBarrier); Instruction* op = new Instruction(OpControlBarrier);
op->addImmediateOperand(executionScope); op->addImmediateOperand(makeUintConstant(execution));
op->addImmediateOperand(makeUintConstant(memory));
op->addImmediateOperand(makeUintConstant(semantics));
buildPoint->addInstruction(op); buildPoint->addInstruction(op);
} }
void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemantics) void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemantics)
{ {
Instruction* op = new Instruction(OpMemoryBarrier); Instruction* op = new Instruction(OpMemoryBarrier);
op->addImmediateOperand(executionScope); op->addImmediateOperand(makeUintConstant(executionScope));
op->addImmediateOperand(memorySemantics); op->addImmediateOperand(makeUintConstant(memorySemantics));
buildPoint->addInstruction(op); buildPoint->addInstruction(op);
} }
@ -991,7 +1017,7 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3)
return op->getResultId(); return op->getResultId();
} }
Id Builder::createOp(Op opCode, Id typeId, std::vector<Id>& operands) Id Builder::createOp(Op opCode, Id typeId, const std::vector<Id>& operands)
{ {
Instruction* op = new Instruction(getUniqueId(), typeId, opCode); Instruction* op = new Instruction(getUniqueId(), typeId, opCode);
for (auto operand : operands) for (auto operand : operands)
@ -1107,64 +1133,95 @@ Id Builder::createBuiltinCall(Decoration /*precision*/, Id resultType, Id builti
// Create the correct instruction based on the inputs, and make the call. // Create the correct instruction based on the inputs, and make the call.
Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, const TextureParameters& parameters) Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, const TextureParameters& parameters)
{ {
static const int maxTextureArgs = 5; static const int maxTextureArgs = 10;
Id texArgs[maxTextureArgs] = {}; Id texArgs[maxTextureArgs] = {};
// //
// Set up the arguments // Set up the fixed arguments
// //
int numArgs = 0; int numArgs = 0;
bool xplicit = false;
texArgs[numArgs++] = parameters.sampler; texArgs[numArgs++] = parameters.sampler;
texArgs[numArgs++] = parameters.coords; texArgs[numArgs++] = parameters.coords;
if (parameters.gradX) {
texArgs[numArgs++] = parameters.gradX;
texArgs[numArgs++] = parameters.gradY;
}
if (parameters.lod)
texArgs[numArgs++] = parameters.lod;
if (parameters.offset)
texArgs[numArgs++] = parameters.offset;
if (parameters.bias)
texArgs[numArgs++] = parameters.bias;
if (parameters.Dref) if (parameters.Dref)
texArgs[numArgs++] = parameters.Dref; texArgs[numArgs++] = parameters.Dref;
//
// Set up the optional arguments
//
int optArgNum = numArgs; // track which operand, if it exists, is the mask of optional arguments
++numArgs; // speculatively make room for the mask operand
ImageOperandsMask mask = ImageOperandsMaskNone; // the mask operand
if (parameters.bias) {
mask = (ImageOperandsMask)(mask | ImageOperandsBiasMask);
texArgs[numArgs++] = parameters.bias;
}
if (parameters.lod) {
mask = (ImageOperandsMask)(mask | ImageOperandsLodMask);
texArgs[numArgs++] = parameters.lod;
xplicit = true;
}
if (parameters.gradX) {
mask = (ImageOperandsMask)(mask | ImageOperandsGradMask);
texArgs[numArgs++] = parameters.gradX;
texArgs[numArgs++] = parameters.gradY;
xplicit = true;
}
if (parameters.offset) {
mask = (ImageOperandsMask)(mask | ImageOperandsOffsetMask);
texArgs[numArgs++] = parameters.offset;
}
// TBD: if Offset is constant, use ImageOperandsConstOffsetMask
if (parameters.offsets) {
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
texArgs[numArgs++] = parameters.offsets;
}
if (parameters.sample) {
mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
texArgs[numArgs++] = parameters.sample;
}
if (mask == ImageOperandsMaskNone)
--numArgs; // undo speculative reservation for the mask argument
else
texArgs[optArgNum] = mask;
// //
// Set up the instruction // Set up the instruction
// //
Op opCode; Op opCode;
if (proj && parameters.gradX && parameters.offset) opCode = OpImageSampleImplicitLod;
opCode = OpTextureSampleProjGradOffset; if (xplicit) {
else if (proj && parameters.lod && parameters.offset) if (parameters.Dref) {
opCode = OpTextureSampleProjLodOffset; if (proj)
else if (parameters.gradX && parameters.offset) opCode = OpImageSampleProjDrefExplicitLod;
opCode = OpTextureSampleGradOffset; else
else if (proj && parameters.offset) opCode = OpImageSampleDrefExplicitLod;
opCode = OpTextureSampleProjOffset; } else {
else if (parameters.lod && parameters.offset) if (proj)
opCode = OpTextureSampleLodOffset; opCode = OpImageSampleProjExplicitLod;
else if (proj && parameters.gradX) else
opCode = OpTextureSampleProjGrad; opCode = OpImageSampleExplicitLod;
else if (proj && parameters.lod) }
opCode = OpTextureSampleProjLod; } else {
else if (parameters.offset) if (parameters.Dref) {
opCode = OpTextureSampleOffset; if (proj)
else if (parameters.gradX) opCode = OpImageSampleProjDrefImplicitLod;
opCode = OpTextureSampleGrad; else
else if (proj) opCode = OpImageSampleDrefImplicitLod;
opCode = OpTextureSampleProj; } else {
else if (parameters.lod) if (proj)
opCode = OpTextureSampleLod; opCode = OpImageSampleProjImplicitLod;
else if (parameters.Dref) else
opCode = OpTextureSampleDref; opCode = OpImageSampleImplicitLod;
else }
opCode = OpTextureSample; }
Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode); Instruction* textureInst = new Instruction(getUniqueId(), resultType, opCode);
for (int op = 0; op < numArgs; ++op) for (int op = 0; op < optArgNum; ++op)
textureInst->addIdOperand(texArgs[op]);
if (optArgNum < numArgs)
textureInst->addImmediateOperand(texArgs[optArgNum]);
for (int op = optArgNum + 1; op < numArgs; ++op)
textureInst->addIdOperand(texArgs[op]); textureInst->addIdOperand(texArgs[op]);
setPrecision(textureInst->getResultId(), precision); setPrecision(textureInst->getResultId(), precision);
buildPoint->addInstruction(textureInst); buildPoint->addInstruction(textureInst);
@ -1176,13 +1233,13 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool proj, co
Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters) Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters)
{ {
// Figure out the result type // Figure out the result type
Id resultType = NoType; Id resultType = 0;
switch (opCode) { switch (opCode) {
case OpTextureQuerySize: case OpImageQuerySize:
case OpTextureQuerySizeLod: case OpImageQuerySizeLod:
{ {
int numComponents; int numComponents;
switch (getDimensionality(parameters.sampler)) { switch (getTypeDimensionality(getImageType(parameters.sampler))) {
case Dim1D: case Dim1D:
case DimBuffer: case DimBuffer:
numComponents = 1; numComponents = 1;
@ -1199,7 +1256,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
MissingFunctionality("texture query dimensionality"); MissingFunctionality("texture query dimensionality");
break; break;
} }
if (isArrayedSampler(parameters.sampler)) if (isArrayedImageType(getImageType(parameters.sampler)))
++numComponents; ++numComponents;
if (numComponents == 1) if (numComponents == 1)
resultType = makeIntType(32); resultType = makeIntType(32);
@ -1208,11 +1265,11 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
break; break;
} }
case OpTextureQueryLod: case OpImageQueryLod:
resultType = makeVectorType(makeFloatType(32), 2); resultType = makeVectorType(makeFloatType(32), 2);
break; break;
case OpTextureQueryLevels: case OpImageQueryLevels:
case OpTextureQuerySamples: case OpImageQuerySamples:
resultType = makeIntType(32); resultType = makeIntType(32);
break; break;
default: default:
@ -2040,7 +2097,16 @@ void Builder::dump(std::vector<unsigned int>& out) const
extInst.addStringOperand(extensions[e]); extInst.addStringOperand(extensions[e]);
extInst.dump(out); extInst.dump(out);
} }
// TBD: OpExtension ... // TBD: OpExtension ...
// Capabilities
for (auto cap : capabilities) {
Instruction capInst(0, 0, OpCapability);
capInst.addImmediateOperand(cap);
capInst.dump(out);
}
dumpInstructions(out, imports); dumpInstructions(out, imports);
Instruction memInst(0, 0, OpMemoryModel); Instruction memInst(0, 0, OpMemoryModel);
memInst.addImmediateOperand(addressModel); memInst.addImmediateOperand(addressModel);

40
SPIRV/SpvBuilder.h Normal file → Executable file
View File

@ -48,7 +48,7 @@
#ifndef SpvBuilder_H #ifndef SpvBuilder_H
#define SpvBuilder_H #define SpvBuilder_H
#include "spirv.h" #include "spirv.hpp"
#include "spvIR.h" #include "spvIR.h"
#include <algorithm> #include <algorithm>
@ -77,6 +77,8 @@ public:
memoryModel = mem; memoryModel = mem;
} }
void addCapability(spv::Capability cap) { capabilities.push_back(cap); }
// To get a new <id> for anything needing a new one. // To get a new <id> for anything needing a new one.
Id getUniqueId() { return ++uniqueId; } Id getUniqueId() { return ++uniqueId; }
@ -101,12 +103,8 @@ public:
Id makeMatrixType(Id component, int cols, int rows); Id makeMatrixType(Id component, int cols, int rows);
Id makeArrayType(Id element, unsigned size); Id makeArrayType(Id element, unsigned size);
Id makeFunctionType(Id returnType, std::vector<Id>& paramTypes); Id makeFunctionType(Id returnType, std::vector<Id>& paramTypes);
enum samplerContent { Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
samplerContentTexture, Id makeSampledImageType(Id imageType);
samplerContentImage,
samplerContentTextureFilter
};
Id makeSampler(Id sampledType, Dim, samplerContent, bool arrayed, bool shadow, bool ms);
// For querying about types. // For querying about types.
Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
@ -133,7 +131,9 @@ public:
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; } bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; } bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId); } bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId); }
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; } bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; }
bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; }
bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; } bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; }
unsigned int getConstantScalar(Id resultId) const { return module.getInstruction(resultId)->getImmediateOperand(0); } unsigned int getConstantScalar(Id resultId) const { return module.getInstruction(resultId)->getImmediateOperand(0); }
@ -151,15 +151,20 @@ public:
} }
int getNumRows(Id resultId) const { return getTypeNumRows(getTypeId(resultId)); } int getNumRows(Id resultId) const { return getTypeNumRows(getTypeId(resultId)); }
Dim getDimensionality(Id resultId) const Dim getTypeDimensionality(Id typeId) const
{ {
assert(isSamplerType(getTypeId(resultId))); assert(isImageType(typeId));
return (Dim)module.getInstruction(getTypeId(resultId))->getImmediateOperand(1); return (Dim)module.getInstruction(typeId)->getImmediateOperand(1);
} }
bool isArrayedSampler(Id resultId) const Id getImageType(Id resultId) const
{ {
assert(isSamplerType(getTypeId(resultId))); assert(isSampledImageType(getTypeId(resultId)));
return module.getInstruction(getTypeId(resultId))->getImmediateOperand(3) != 0; return module.getInstruction(getTypeId(resultId))->getIdOperand(0);
}
bool isArrayedImageType(Id typeId) const
{
assert(isImageType(typeId));
return module.getInstruction(typeId)->getImmediateOperand(3) != 0;
} }
// For making new constants (will return old constant if the requested one was already made). // For making new constants (will return old constant if the requested one was already made).
@ -174,7 +179,7 @@ public:
Id makeCompositeConstant(Id type, std::vector<Id>& comps); Id makeCompositeConstant(Id type, std::vector<Id>& comps);
// Methods for adding information outside the CFG. // Methods for adding information outside the CFG.
void addEntryPoint(ExecutionModel, Function*); void addEntryPoint(ExecutionModel, Function*, const char* name);
void addExecutionMode(Function*, ExecutionMode mode, int value = -1); void addExecutionMode(Function*, ExecutionMode mode, int value = -1);
void addName(Id, const char* name); void addName(Id, const char* name);
void addMemberName(Id, int member, const char* name); void addMemberName(Id, int member, const char* name);
@ -233,12 +238,12 @@ public:
void createNoResultOp(Op); void createNoResultOp(Op);
void createNoResultOp(Op, Id operand); void createNoResultOp(Op, Id operand);
void createControlBarrier(unsigned executionScope); void createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask);
void createMemoryBarrier(unsigned executionScope, unsigned memorySemantics); void createMemoryBarrier(unsigned executionScope, unsigned memorySemantics);
Id createUnaryOp(Op, Id typeId, Id operand); Id createUnaryOp(Op, Id typeId, Id operand);
Id createBinOp(Op, Id typeId, Id operand1, Id operand2); Id createBinOp(Op, Id typeId, Id operand1, Id operand2);
Id createTriOp(Op, Id typeId, Id operand1, Id operand2, Id operand3); Id createTriOp(Op, Id typeId, Id operand1, Id operand2, Id operand3);
Id createOp(Op, Id typeId, std::vector<Id>& operands); Id createOp(Op, Id typeId, const std::vector<Id>& operands);
Id createFunctionCall(spv::Function*, std::vector<spv::Id>&); Id createFunctionCall(spv::Function*, std::vector<spv::Id>&);
// Take an rvalue (source) and a set of channels to extract from it to // Take an rvalue (source) and a set of channels to extract from it to
@ -283,8 +288,10 @@ public:
Id lod; Id lod;
Id Dref; Id Dref;
Id offset; Id offset;
Id offsets;
Id gradX; Id gradX;
Id gradY; Id gradY;
Id sample;
}; };
// Select the correct texture operation based on all inputs, and emit the correct instruction // Select the correct texture operation based on all inputs, and emit the correct instruction
@ -497,6 +504,7 @@ protected:
std::vector<const char*> extensions; std::vector<const char*> extensions;
AddressingModel addressModel; AddressingModel addressModel;
MemoryModel memoryModel; MemoryModel memoryModel;
std::vector<spv::Capability> capabilities;
int builderNumber; int builderNumber;
Module module; Module module;
Block* buildPoint; Block* buildPoint;

209
SPIRV/disassemble.cpp Normal file → Executable file
View File

@ -1,5 +1,5 @@
// //
//Copyright (C) 2014 LunarG, Inc. //Copyright (C) 2014-2015 LunarG, Inc.
// //
//All rights reserved. //All rights reserved.
// //
@ -21,16 +21,16 @@
// //
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT //"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTAstreamITY AND FITNESS //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE //FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, //COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, //INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; //BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
//CAUSED AND ON ANY THEORY OF LIAstreamITY, WHETHER IN CONTRACT, STRICT //CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
//LIAstreamITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//POSSIstreamITY OF SUCH DAMAGE. //POSSIBILITY OF SUCH DAMAGE.
// //
// Author: John Kessenich, LunarG // Author: John Kessenich, LunarG
@ -41,25 +41,34 @@
// //
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include <iomanip> #include <iomanip>
#include <stack> #include <stack>
#include <sstream> #include <sstream>
#include <cstring>
#include "GLSL450Lib.h"
extern const char* GlslStd450DebugNames[GLSL_STD_450::Count];
#include "disassemble.h" #include "disassemble.h"
#include "doc.h" #include "doc.h"
namespace spv { namespace spv {
#include "GLSL.std.450.h"
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
void Kill(std::ostream& out, const char* message) void Kill(std::ostream& out, const char* message)
{ {
out << std::endl << "Disassembly failed: " << message << std::endl; out << std::endl << "Disassembly failed: " << message << std::endl;
exit(1); exit(1);
} }
// used to identify the extended instruction library imported when printing
enum ExtInstSet {
GLSL450Inst,
OpenCLExtInst,
};
// Container class for a single instance of a SPIR-V stream, with methods for disassembly. // Container class for a single instance of a SPIR-V stream, with methods for disassembly.
class SpirvStream { class SpirvStream {
public: public:
@ -70,9 +79,8 @@ public:
void processInstructions(); void processInstructions();
protected: protected:
SpirvStream(SpirvStream&); SpirvStream(const SpirvStream&);
SpirvStream& operator=(SpirvStream&); SpirvStream& operator=(const SpirvStream&);
Op getOpCode(int id) const { return idInstruction[id] ? (Op)(stream[idInstruction[id]] & OpCodeMask) : OpNop; } Op getOpCode(int id) const { return idInstruction[id] ? (Op)(stream[idInstruction[id]] & OpCodeMask) : OpNop; }
// Output methods // Output methods
@ -81,6 +89,7 @@ protected:
void outputResultId(Id id); void outputResultId(Id id);
void outputTypeId(Id id); void outputTypeId(Id id);
void outputId(Id id); void outputId(Id id);
void outputMask(OperandClass operandClass, unsigned mask);
void disassembleImmediates(int numOperands); void disassembleImmediates(int numOperands);
void disassembleIds(int numOperands); void disassembleIds(int numOperands);
void disassembleString(); void disassembleString();
@ -241,6 +250,18 @@ void SpirvStream::outputId(Id id)
out << "(" << idDescriptor[id] << ")"; out << "(" << idDescriptor[id] << ")";
} }
void SpirvStream::outputMask(OperandClass operandClass, unsigned mask)
{
if (mask == 0)
out << "None";
else {
for (int m = 0; m < OperandClassParams[operandClass].ceiling; ++m) {
if (mask & (1 << m))
out << OperandClassParams[operandClass].getName(m) << " ";
}
}
}
void SpirvStream::disassembleImmediates(int numOperands) void SpirvStream::disassembleImmediates(int numOperands)
{ {
for (int i = 0; i < numOperands; ++i) { for (int i = 0; i < numOperands; ++i) {
@ -294,8 +315,9 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
nestedControl.push(nextNestedControl); nestedControl.push(nextNestedControl);
nextNestedControl = 0; nextNestedControl = 0;
} }
} else if (opCode == OpExtInstImport) } else if (opCode == OpExtInstImport) {
idDescriptor[resultId] = (char*)(&stream[word]); idDescriptor[resultId] = (char*)(&stream[word]);
}
else { else {
if (idDescriptor[resultId].size() == 0) { if (idDescriptor[resultId].size() == 0) {
switch (opCode) { switch (opCode) {
@ -337,27 +359,35 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
// Process the operands. Note, a new context-dependent set could be // Process the operands. Note, a new context-dependent set could be
// swapped in mid-traversal. // swapped in mid-traversal.
// Handle textures specially, so can put out helpful strings. // Handle images specially, so can put out helpful strings.
if (opCode == OpTypeSampler) { if (opCode == OpTypeImage) {
out << " ";
disassembleIds(1); disassembleIds(1);
out << " " << DimensionString((Dim)stream[word++]); out << " " << DimensionString((Dim)stream[word++]);
switch (stream[word++]) {
case 0: out << " texture"; break;
case 1: out << " image"; break;
case 2: out << " filter+texture"; break;
}
out << (stream[word++] != 0 ? " array" : "");
out << (stream[word++] != 0 ? " depth" : ""); out << (stream[word++] != 0 ? " depth" : "");
out << (stream[word++] != 0 ? " array" : "");
out << (stream[word++] != 0 ? " multi-sampled" : ""); out << (stream[word++] != 0 ? " multi-sampled" : "");
switch (stream[word++]) {
case 0: out << " runtime"; break;
case 1: out << " sampled"; break;
case 2: out << " nonsampled"; break;
}
out << " format:" << ImageFormatString((ImageFormat)stream[word++]);
if (numOperands == 8) {
out << " " << AccessQualifierString(stream[word++]);
}
return; return;
} }
// Handle all the parameterized operands // Handle all the parameterized operands
for (int op = 0; op < InstructionDesc[opCode].operands.getNum(); ++op) { for (int op = 0; op < InstructionDesc[opCode].operands.getNum() && numOperands > 0; ++op) {
out << " "; out << " ";
OperandClass operandClass = InstructionDesc[opCode].operands.getClass(op); OperandClass operandClass = InstructionDesc[opCode].operands.getClass(op);
switch (operandClass) { switch (operandClass) {
case OperandId: case OperandId:
case OperandScope:
case OperandMemorySemantics:
disassembleIds(1); disassembleIds(1);
// Get names for printing "(XXX)" for readability, *after* this id // Get names for printing "(XXX)" for readability, *after* this id
if (opCode == OpName) if (opCode == OpName)
@ -367,15 +397,34 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
case OperandVariableIds: case OperandVariableIds:
disassembleIds(numOperands); disassembleIds(numOperands);
return; return;
case OperandOptionalImage:
outputMask(operandClass, stream[word++]);
--numOperands;
disassembleIds(numOperands);
return;
case OperandOptionalLiteral:
case OperandVariableLiterals: case OperandVariableLiterals:
if ((opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn) || if (opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn ||
(opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn)) { opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn) {
out << BuiltInString(stream[word++]); out << BuiltInString(stream[word++]);
--numOperands; --numOperands;
++op; ++op;
} }
disassembleImmediates(numOperands); disassembleImmediates(numOperands);
return; return;
case OperandVariableIdLiteral:
while (numOperands > 0) {
out << std::endl;
outputResultId(0);
outputTypeId(0);
outputIndent();
out << " Type ";
disassembleIds(1);
out << ", member ";
disassembleImmediates(1);
numOperands -= 2;
}
return;
case OperandVariableLiteralId: case OperandVariableLiteralId:
while (numOperands > 0) { while (numOperands > 0) {
out << std::endl; out << std::endl;
@ -392,9 +441,16 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
case OperandLiteralNumber: case OperandLiteralNumber:
disassembleImmediates(1); disassembleImmediates(1);
if (opCode == OpExtInst) { if (opCode == OpExtInst) {
ExtInstSet extInstSet = GLSL450Inst;
if (0 == memcmp("OpenCL", (char*)(idDescriptor[stream[word-2]].c_str()), 6)) {
extInstSet = OpenCLExtInst;
}
unsigned entrypoint = stream[word - 1]; unsigned entrypoint = stream[word - 1];
if (entrypoint < GLSL_STD_450::Count) if (extInstSet == GLSL450Inst) {
out << "(" << GlslStd450DebugNames[entrypoint] << ")"; if (entrypoint < spv::GLSLstd450Count) {
out << "(" << GlslStd450DebugNames[entrypoint] << ")";
}
}
} }
break; break;
case OperandLiteralString: case OperandLiteralString:
@ -403,18 +459,9 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
default: default:
assert(operandClass >= OperandSource && operandClass < OperandOpcode); assert(operandClass >= OperandSource && operandClass < OperandOpcode);
if (OperandClassParams[operandClass].bitmask) { if (OperandClassParams[operandClass].bitmask)
unsigned int mask = stream[word++]; outputMask(operandClass, stream[word++]);
if (mask == 0) else
out << "None";
else {
for (int m = 0; m < OperandClassParams[operandClass].ceiling; ++m) {
if (mask & (1 << m))
out << OperandClassParams[operandClass].getName(m) << " ";
}
}
break;
} else
out << OperandClassParams[operandClass].getName(stream[word++]); out << OperandClassParams[operandClass].getName(stream[word++]);
break; break;
@ -425,9 +472,97 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
return; return;
} }
void GLSLstd450GetDebugNames(const char** names)
{
for (int i = 0; i < GLSLstd450Count; ++i)
names[i] = "Unknown";
names[GLSLstd450Round] = "Round";
names[GLSLstd450RoundEven] = "RoundEven";
names[GLSLstd450Trunc] = "Trunc";
names[GLSLstd450FAbs] = "FAbs";
names[GLSLstd450SAbs] = "SAbs";
names[GLSLstd450FSign] = "FSign";
names[GLSLstd450SSign] = "SSign";
names[GLSLstd450Floor] = "Floor";
names[GLSLstd450Ceil] = "Ceil";
names[GLSLstd450Fract] = "Fract";
names[GLSLstd450Radians] = "Radians";
names[GLSLstd450Degrees] = "Degrees";
names[GLSLstd450Sin] = "Sin";
names[GLSLstd450Cos] = "Cos";
names[GLSLstd450Tan] = "Tan";
names[GLSLstd450Asin] = "Asin";
names[GLSLstd450Acos] = "Acos";
names[GLSLstd450Atan] = "Atan";
names[GLSLstd450Sinh] = "Sinh";
names[GLSLstd450Cosh] = "Cosh";
names[GLSLstd450Tanh] = "Tanh";
names[GLSLstd450Asinh] = "Asinh";
names[GLSLstd450Acosh] = "Acosh";
names[GLSLstd450Atanh] = "Atanh";
names[GLSLstd450Atan2] = "Atan2";
names[GLSLstd450Pow] = "Pow";
names[GLSLstd450Exp] = "Exp";
names[GLSLstd450Log] = "Log";
names[GLSLstd450Exp2] = "Exp2";
names[GLSLstd450Log2] = "Log2";
names[GLSLstd450Sqrt] = "Sqrt";
names[GLSLstd450InverseSqrt] = "Inversesqrt";
names[GLSLstd450Determinant] = "Determinant";
names[GLSLstd450MatrixInverse] = "Inverse";
names[GLSLstd450Modf] = "Modf";
names[GLSLstd450ModfStruct] = "ModfStruct";
names[GLSLstd450FMin] = "FMin";
names[GLSLstd450SMin] = "SMin";
names[GLSLstd450UMin] = "UMin";
names[GLSLstd450FMax] = "FMax";
names[GLSLstd450SMax] = "SMax";
names[GLSLstd450UMax] = "UMax";
names[GLSLstd450FClamp] = "FClamp";
names[GLSLstd450SClamp] = "SClamp";
names[GLSLstd450UClamp] = "UClamp";
names[GLSLstd450Mix] = "Mix";
names[GLSLstd450Step] = "Step";
names[GLSLstd450SmoothStep] = "Smoothstep";
names[GLSLstd450Fma] = "Fma";
names[GLSLstd450Frexp] = "Frexp";
names[GLSLstd450FrexpStruct] = "FrexpStruct";
names[GLSLstd450Ldexp] = "Ldexp";
names[GLSLstd450PackSnorm4x8] = "PackSnorm4x8";
names[GLSLstd450PackUnorm4x8] = "PackUnorm4x8";
names[GLSLstd450PackSnorm2x16] = "PackSnorm2x16";
names[GLSLstd450PackUnorm2x16] = "PackUnorm2x16";
names[GLSLstd450PackHalf2x16] = "PackHalf2x16";
names[GLSLstd450PackDouble2x32] = "PackDouble2x32";
names[GLSLstd450UnpackSnorm2x16] = "UnpackSnorm2x16";
names[GLSLstd450UnpackUnorm2x16] = "UnpackUnorm2x16";
names[GLSLstd450UnpackHalf2x16] = "UnpackHalf2x16";
names[GLSLstd450UnpackSnorm4x8] = "UnpackSnorm4x8";
names[GLSLstd450UnpackUnorm4x8] = "UnpackUnorm4x8";
names[GLSLstd450UnpackDouble2x32] = "UnpackDouble2x32";
names[GLSLstd450Length] = "Length";
names[GLSLstd450Distance] = "Distance";
names[GLSLstd450Cross] = "Cross";
names[GLSLstd450Normalize] = "Normalize";
names[GLSLstd450FaceForward] = "Faceforward";
names[GLSLstd450Reflect] = "Reflect";
names[GLSLstd450Refract] = "Refract";
names[GLSLstd450AddCarry] = "UaddCarry";
names[GLSLstd450SubBorrow] = "UsubBorrow";
names[GLSLstd450MulExtended] = "UmulExtended";
names[GLSLstd450FindILSB] = "FindILsb";
names[GLSLstd450FindSMSB] = "FindSMsb";
names[GLSLstd450FindUMSB] = "FindUMsb";
names[GLSLstd450InterpolateAtCentroid] = "InterpolateAtCentroid";
names[GLSLstd450InterpolateAtSample] = "InterpolateAtSample";
names[GLSLstd450InterpolateAtOffset] = "InterpolateAtOffset";
}
void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream) void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
{ {
SpirvStream SpirvStream(out, stream); SpirvStream SpirvStream(out, stream);
GLSLstd450GetDebugNames(GlslStd450DebugNames);
SpirvStream.validate(); SpirvStream.validate();
SpirvStream.processInstructions(); SpirvStream.processInstructions();
} }

2
SPIRV/disassemble.h Normal file → Executable file
View File

@ -1,5 +1,5 @@
// //
//Copyright (C) 2014 LunarG, Inc. //Copyright (C) 2014-2015 LunarG, Inc.
// //
//All rights reserved. //All rights reserved.
// //

1977
SPIRV/doc.cpp Normal file → Executable file

File diff suppressed because it is too large Load Diff

46
SPIRV/doc.h Normal file → Executable file
View File

@ -1,5 +1,5 @@
// //
//Copyright (C) 2014 LunarG, Inc. //Copyright (C) 2014-2015 LunarG, Inc.
// //
//All rights reserved. //All rights reserved.
// //
@ -40,7 +40,7 @@
// Parameterize the SPIR-V enumerants. // Parameterize the SPIR-V enumerants.
// //
#include "spirv.h" #include "spirv.hpp"
#include <vector> #include <vector>
@ -64,6 +64,10 @@ const char* LoopControlString(int);
const char* FunctionControlString(int); const char* FunctionControlString(int);
const char* SamplerAddressingModeString(int); const char* SamplerAddressingModeString(int);
const char* SamplerFilterModeString(int); const char* SamplerFilterModeString(int);
const char* ImageFormatString(int);
const char* ImageChannelOrderString(int);
const char* ImageChannelTypeString(int);
const char* ImageOperands(int);
const char* FPFastMathString(int); const char* FPFastMathString(int);
const char* FPRoundingModeString(int); const char* FPRoundingModeString(int);
const char* LinkageTypeString(int); const char* LinkageTypeString(int);
@ -75,11 +79,12 @@ const char* ExecutionScopeString(int);
const char* GroupOperationString(int); const char* GroupOperationString(int);
const char* KernelEnqueueFlagsString(int); const char* KernelEnqueueFlagsString(int);
const char* KernelProfilingInfoString(int); const char* KernelProfilingInfoString(int);
const char* CapabilityString(int);
const char* OpcodeString(int); const char* OpcodeString(int);
// For grouping opcodes into subsections // For grouping opcodes into subsections
enum OpcodeClass { enum OpcodeClass {
OpClassMisc, // default, until opcode is classified OpClassMisc,
OpClassDebug, OpClassDebug,
OpClassAnnotate, OpClassAnnotate,
OpClassExtension, OpClassExtension,
@ -88,10 +93,11 @@ enum OpcodeClass {
OpClassConstant, OpClassConstant,
OpClassMemory, OpClassMemory,
OpClassFunction, OpClassFunction,
OpClassTexture, OpClassImage,
OpClassConvert, OpClassConvert,
OpClassComposite, OpClassComposite,
OpClassArithmetic, OpClassArithmetic,
OpClassBit,
OpClassRelationalLogical, OpClassRelationalLogical,
OpClassDerivative, OpClassDerivative,
OpClassFlowControl, OpClassFlowControl,
@ -102,7 +108,8 @@ enum OpcodeClass {
OpClassDeviceSideEnqueue, OpClassDeviceSideEnqueue,
OpClassPipe, OpClassPipe,
OpClassCount OpClassCount,
OpClassMissing // all instructions start out as missing
}; };
// For parameterizing operands. // For parameterizing operands.
@ -110,8 +117,11 @@ enum OperandClass {
OperandNone, OperandNone,
OperandId, OperandId,
OperandOptionalId, OperandOptionalId,
OperandOptionalImage,
OperandVariableIds, OperandVariableIds,
OperandOptionalLiteral,
OperandVariableLiterals, OperandVariableLiterals,
OperandVariableIdLiteral,
OperandVariableLiteralId, OperandVariableLiteralId,
OperandLiteralNumber, OperandLiteralNumber,
OperandLiteralString, OperandLiteralString,
@ -124,6 +134,10 @@ enum OperandClass {
OperandDimensionality, OperandDimensionality,
OperandSamplerAddressingMode, OperandSamplerAddressingMode,
OperandSamplerFilterMode, OperandSamplerFilterMode,
OperandSamplerImageFormat,
OperandImageChannelOrder,
OperandImageChannelDataType,
OperandImageOperands,
OperandFPFastMath, OperandFPFastMath,
OperandFPRoundingMode, OperandFPRoundingMode,
OperandLinkageType, OperandLinkageType,
@ -136,29 +150,17 @@ enum OperandClass {
OperandFunction, OperandFunction,
OperandMemorySemantics, OperandMemorySemantics,
OperandMemoryAccess, OperandMemoryAccess,
OperandExecutionScope, OperandScope,
OperandGroupOperation, OperandGroupOperation,
OperandKernelEnqueueFlags, OperandKernelEnqueueFlags,
OperandKernelProfilingInfo, OperandKernelProfilingInfo,
OperandCapability,
OperandOpcode, OperandOpcode,
OperandCount OperandCount
}; };
// Set of capabilities. Generally, something is assumed to be in core,
// if nothing else is said. So, these are used to identify when something
// requires a specific capability to be declared.
enum Capability {
CapMatrix,
CapShader,
CapGeom,
CapTess,
CapAddr,
CapLink,
CapKernel
};
// Any specific enum can have a set of capabilities that allow it: // Any specific enum can have a set of capabilities that allow it:
typedef std::vector<Capability> EnumCaps; typedef std::vector<Capability> EnumCaps;
@ -213,8 +215,8 @@ public:
class InstructionParameters { class InstructionParameters {
public: public:
InstructionParameters() : InstructionParameters() :
opDesc(0), opDesc("TBD"),
opClass(OpClassMisc), opClass(OpClassMissing),
typePresent(true), // most normal, only exceptions have to be spelled out typePresent(true), // most normal, only exceptions have to be spelled out
resultPresent(true) // most normal, only exceptions have to be spelled out resultPresent(true) // most normal, only exceptions have to be spelled out
{ } { }
@ -238,7 +240,7 @@ protected:
int resultPresent : 1; int resultPresent : 1;
}; };
const int OpcodeCeiling = 267; const int OpcodeCeiling = 305;
// The set of objects that hold all the instruction/operand // The set of objects that hold all the instruction/operand
// parameterization information. // parameterization information.

2
SPIRV/spvIR.h Normal file → Executable file
View File

@ -50,7 +50,7 @@
#ifndef spvIR_H #ifndef spvIR_H
#define spvIR_H #define spvIR_H
#include "spirv.h" #include "spirv.hpp"
#include <vector> #include <vector>
#include <iostream> #include <iostream>

7
StandAlone/StandAlone.cpp Normal file → Executable file
View File

@ -42,7 +42,7 @@
#include "./../glslang/Include/revision.h" #include "./../glslang/Include/revision.h"
#include "./../glslang/Public/ShaderLang.h" #include "./../glslang/Public/ShaderLang.h"
#include "../SPIRV/GlslangToSpv.h" #include "../SPIRV/GlslangToSpv.h"
#include "../SPIRV/GLSL450Lib.h" #include "../SPIRV/GLSL.std.450.h"
#include "../SPIRV/doc.h" #include "../SPIRV/doc.h"
#include "../SPIRV/disassemble.h" #include "../SPIRV/disassemble.h"
#include <string.h> #include <string.h>
@ -644,8 +644,6 @@ CompileShaders(void*)
return 0; return 0;
} }
const char* GlslStd450DebugNames[GLSL_STD_450::Count];
// Outputs the given string, but only if it is non-null and non-empty. // Outputs the given string, but only if it is non-null and non-empty.
// This prevents erroneous newlines from appearing. // This prevents erroneous newlines from appearing.
void PutsIfNonEmpty(const char* str) void PutsIfNonEmpty(const char* str)
@ -754,7 +752,6 @@ void CompileAndLinkShaders()
glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage)); glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage));
if (Options & EOptionHumanReadableSpv) { if (Options & EOptionHumanReadableSpv) {
spv::Parameterize(); spv::Parameterize();
GLSL_STD_450::GetDebugNames(GlslStd450DebugNames);
spv::Disassemble(std::cout, spirv); spv::Disassemble(std::cout, spirv);
} }
} }
@ -790,7 +787,7 @@ int C_DECL main(int argc, char* argv[])
std::string spirvVersion; std::string spirvVersion;
glslang::GetSpirvVersion(spirvVersion); glslang::GetSpirvVersion(spirvVersion);
printf("SPIR-V Version %s\n", spirvVersion.c_str()); printf("SPIR-V Version %s\n", spirvVersion.c_str());
printf("GLSL.std.450 Version %d, Revision %d\n", GLSL_STD_450::Version, GLSL_STD_450::Revision); printf("GLSL.std.450 Version %d, Revision %d\n", GLSLstd450Version, GLSLstd450Revision);
if (Worklist.empty()) if (Worklist.empty())
return ESuccess; return ESuccess;
} }

16
Test/baseResults/spv.100ops.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 48 // Id's are bound by 48
Source ESSL 100 Source ESSL 100
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "foo(" Name 9 "foo("
Name 12 "face1" Name 12 "face1"
@ -19,12 +21,12 @@ Linked fragment stage:
Name 22 "low" Name 22 "low"
Name 27 "high" Name 27 "high"
Name 37 "gl_FragColor" Name 37 "gl_FragColor"
Decorate 12(face1) PrecisionLow Decorate 12(face1) RelaxedPrecision
Decorate 14(face2) PrecisionLow Decorate 14(face2) RelaxedPrecision
Decorate 18(z) PrecisionMedium Decorate 18(z) RelaxedPrecision
Decorate 22(low) PrecisionMedium Decorate 22(low) RelaxedPrecision
Decorate 27(high) PrecisionMedium Decorate 27(high) RelaxedPrecision
Decorate 37(gl_FragColor) PrecisionMedium Decorate 37(gl_FragColor) RelaxedPrecision
Decorate 37(gl_FragColor) BuiltIn FragColor Decorate 37(gl_FragColor) BuiltIn FragColor
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

131
Test/baseResults/spv.140.frag.out Normal file → Executable file
View File

@ -5,12 +5,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 90 // Id's are bound by 93
Source GLSL 140 Source GLSL 140
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "foo(" Name 9 "foo("
Name 12 "i1" Name 12 "i1"
@ -19,29 +21,33 @@ Linked fragment stage:
Name 29 "o" Name 29 "o"
Name 34 "gl_ClipDistance" Name 34 "gl_ClipDistance"
Name 43 "k" Name 43 "k"
Name 54 "sampR" Name 55 "sampR"
Name 60 "sampB" Name 62 "sampB"
Name 83 "samp2Da" Name 86 "samp2Da"
Name 87 "bn" Name 90 "bn"
MemberName 87(bn) 0 "matra" MemberName 90(bn) 0 "matra"
MemberName 87(bn) 1 "matca" MemberName 90(bn) 1 "matca"
MemberName 87(bn) 2 "matr" MemberName 90(bn) 2 "matr"
MemberName 87(bn) 3 "matc" MemberName 90(bn) 3 "matc"
MemberName 87(bn) 4 "matrdef" MemberName 90(bn) 4 "matrdef"
Name 89 "" Name 92 ""
Decorate 17(gl_FrontFacing) BuiltIn FrontFacing Decorate 17(gl_FrontFacing) BuiltIn FrontFacing
Decorate 34(gl_ClipDistance) Smooth Decorate 34(gl_ClipDistance) Smooth
Decorate 34(gl_ClipDistance) BuiltIn ClipDistance Decorate 34(gl_ClipDistance) BuiltIn ClipDistance
Decorate 43(k) Smooth Decorate 43(k) Smooth
Decorate 83(samp2Da) NoStaticUse Decorate 86(samp2Da) NoStaticUse
MemberDecorate 87(bn) 0 RowMajor MemberDecorate 90(bn) 0 RowMajor
MemberDecorate 87(bn) 1 ColMajor MemberDecorate 90(bn) 0 Offset 0
MemberDecorate 87(bn) 2 RowMajor MemberDecorate 90(bn) 1 ColMajor
MemberDecorate 87(bn) 3 ColMajor MemberDecorate 90(bn) 1 Offset 256
MemberDecorate 87(bn) 4 RowMajor MemberDecorate 90(bn) 2 RowMajor
Decorate 87(bn) GLSLStd140 MemberDecorate 90(bn) 2 Offset 512
Decorate 87(bn) Block MemberDecorate 90(bn) 3 ColMajor
Decorate 89 NoStaticUse MemberDecorate 90(bn) 3 Offset 576
MemberDecorate 90(bn) 4 RowMajor
MemberDecorate 90(bn) 4 Offset 640
Decorate 90(bn) Block
Decorate 92 NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -70,26 +76,29 @@ Linked fragment stage:
42: TypePointer Input 27(fvec4) 42: TypePointer Input 27(fvec4)
43(k): 42(ptr) Variable Input 43(k): 42(ptr) Variable Input
45: TypeVector 35(int) 4 45: TypeVector 35(int) 4
52: TypeSampler7(float) Rect filter+texture 52: TypeImage 7(float) Rect sampled format:Unknown
53: TypePointer UniformConstant 52 53: TypeSampledImage 52
54(sampR): 53(ptr) Variable UniformConstant 54: TypePointer UniformConstant 53
56: TypeVector 35(int) 2 55(sampR): 54(ptr) Variable UniformConstant
58: TypeSampler35(int) Buffer filter+texture 57: TypeVector 35(int) 2
59: TypePointer UniformConstant 58 59: TypeImage 35(int) Buffer sampled format:Unknown
60(sampB): 59(ptr) Variable UniformConstant 60: TypeSampledImage 59
65: TypeVector 7(float) 2 61: TypePointer UniformConstant 60
68: 7(float) Constant 1120403456 62(sampB): 61(ptr) Variable UniformConstant
79: TypeSampler7(float) 2D filter+texture 67: TypeVector 7(float) 2
80: 30(int) Constant 3 70: 7(float) Constant 1120403456
81: TypeArray 79 80 81: TypeImage 7(float) 2D sampled format:Unknown
82: TypePointer UniformConstant 81 82: TypeSampledImage 81
83(samp2Da): 82(ptr) Variable UniformConstant 83: 30(int) Constant 3
84: TypeMatrix 27(fvec4) 4 84: TypeArray 82 83
85: 30(int) Constant 4 85: TypePointer UniformConstant 84
86: TypeArray 84 85 86(samp2Da): 85(ptr) Variable UniformConstant
87(bn): TypeStruct 86 86 84 84 84 87: TypeMatrix 27(fvec4) 4
88: TypePointer Uniform 87(bn) 88: 30(int) Constant 4
89: 88(ptr) Variable Uniform 89: TypeArray 87 88
90(bn): TypeStruct 89 89 87 87 87
91: TypePointer Uniform 90(bn)
92: 91(ptr) Variable Uniform
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
14: 13(ptr) Variable Function 14: 13(ptr) Variable Function
@ -119,30 +128,30 @@ Linked fragment stage:
50: 27(fvec4) Load 29(o) 50: 27(fvec4) Load 29(o)
51: 27(fvec4) CompositeInsert 49 50 2 51: 27(fvec4) CompositeInsert 49 50 2
Store 29(o) 51 Store 29(o) 51
55: 52 Load 54(sampR) 56: 53 Load 55(sampR)
57: 56(ivec2) TextureQuerySize 55 58: 57(ivec2) ImageQuerySize 56
61: 58 Load 60(sampB) 63: 60 Load 62(sampB)
62: 35(int) TextureQuerySize 61 64: 35(int) ImageQuerySize 63
63: 56(ivec2) CompositeConstruct 62 62 65: 57(ivec2) CompositeConstruct 64 64
64: 56(ivec2) IAdd 57 63 66: 57(ivec2) IAdd 58 65
66: 65(fvec2) ConvertSToF 64 68: 67(fvec2) ConvertSToF 66
67: 7(float) CompositeExtract 66 0 69: 7(float) CompositeExtract 68 0
69: 7(float) FDiv 67 68 71: 7(float) FDiv 69 70
70: 27(fvec4) Load 29(o) 72: 27(fvec4) Load 29(o)
71: 27(fvec4) CompositeInsert 69 70 3 73: 27(fvec4) CompositeInsert 71 72 3
Store 29(o) 71 Store 29(o) 73
72: 7(float) FunctionCall 9(foo() 74: 7(float) FunctionCall 9(foo()
73: 27(fvec4) Load 29(o) 75: 27(fvec4) Load 29(o)
74: 27(fvec4) CompositeInsert 72 73 2 76: 27(fvec4) CompositeInsert 74 75 2
Store 29(o) 74 Store 29(o) 76
Branch 6 Branch 6
6: Label 6: Label
Return Return
FunctionEnd FunctionEnd
9(foo(): 7(float) Function None 8 9(foo(): 7(float) Function None 8
10: Label 10: Label
75: 7(float) Load 12(i1) 77: 7(float) Load 12(i1)
76: 7(float) Load 25(i2) 78: 7(float) Load 25(i2)
77: 7(float) FAdd 75 76 79: 7(float) FAdd 77 78
ReturnValue 77 ReturnValue 79
FunctionEnd FunctionEnd

3
Test/baseResults/spv.150.geom.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked geometry stage:
// Id's are bound by 72 // Id's are bound by 72
Source GLSL 150 Source GLSL 150
Capability Geometry
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Geometry 4 EntryPoint Geometry 4 "main"
ExecutionMode 4 InputTrianglesAdjacency ExecutionMode 4 InputTrianglesAdjacency
ExecutionMode 4 Invocations 0 ExecutionMode 4 Invocations 0
ExecutionMode 4 OutputTriangleStrip ExecutionMode 4 OutputTriangleStrip

4
Test/baseResults/spv.150.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 53 // Id's are bound by 53
Source GLSL 150 Source GLSL 150
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 14 "gl_PerVertex" Name 14 "gl_PerVertex"
MemberName 14(gl_PerVertex) 0 "gl_Position" MemberName 14(gl_PerVertex) 0 "gl_Position"
@ -42,7 +43,6 @@ Linked vertex stage:
MemberDecorate 14(gl_PerVertex) 0 BuiltIn Position MemberDecorate 14(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 14(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 14(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 14(gl_PerVertex) 2 BuiltIn ClipDistance MemberDecorate 14(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 14(gl_PerVertex) 3 BuiltIn ClipVertex
Decorate 14(gl_PerVertex) Block Decorate 14(gl_PerVertex) Block
Decorate 49(ui) NoStaticUse Decorate 49(ui) NoStaticUse
Decorate 51(gl_VertexID) BuiltIn VertexId Decorate 51(gl_VertexID) BuiltIn VertexId

13
Test/baseResults/spv.300BuiltIns.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 41 // Id's are bound by 41
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 12 "gl_VertexID" Name 12 "gl_VertexID"
@ -19,17 +20,13 @@ Linked vertex stage:
Name 26 "ps" Name 26 "ps"
Name 34 "gl_PointSize" Name 34 "gl_PointSize"
Name 40 "gl_InstanceID" Name 40 "gl_InstanceID"
Decorate 9(i) PrecisionMedium Decorate 9(i) RelaxedPrecision
Decorate 12(gl_VertexID) PrecisionHigh
Decorate 12(gl_VertexID) BuiltIn VertexId Decorate 12(gl_VertexID) BuiltIn VertexId
Decorate 17(j) PrecisionMedium Decorate 17(j) RelaxedPrecision
Decorate 24(gl_Position) PrecisionHigh
Decorate 24(gl_Position) Invariant Decorate 24(gl_Position) Invariant
Decorate 24(gl_Position) BuiltIn Position Decorate 24(gl_Position) BuiltIn Position
Decorate 26(ps) PrecisionMedium Decorate 26(ps) RelaxedPrecision
Decorate 34(gl_PointSize) PrecisionHigh
Decorate 34(gl_PointSize) BuiltIn PointSize Decorate 34(gl_PointSize) BuiltIn PointSize
Decorate 40(gl_InstanceID) PrecisionHigh
Decorate 40(gl_InstanceID) BuiltIn InstanceId Decorate 40(gl_InstanceID) BuiltIn InstanceId
Decorate 40(gl_InstanceID) NoStaticUse Decorate 40(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

16
Test/baseResults/spv.300layout.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 38 // Id's are bound by 38
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "c" Name 10 "c"
Name 12 "color" Name 12 "color"
@ -20,15 +22,15 @@ Linked fragment stage:
Name 16 "s" Name 16 "s"
Name 27 "p" Name 27 "p"
Name 30 "pos" Name 30 "pos"
Decorate 10(c) PrecisionMedium Decorate 10(c) RelaxedPrecision
Decorate 10(c) Location 7 Decorate 10(c) Location 7
Decorate 12(color) PrecisionMedium Decorate 12(color) RelaxedPrecision
Decorate 12(color) Smooth Decorate 12(color) Smooth
MemberDecorate 14(S) 0 PrecisionMedium MemberDecorate 14(S) 0 RelaxedPrecision
MemberDecorate 14(S) 1 PrecisionMedium MemberDecorate 14(S) 1 RelaxedPrecision
Decorate 27(p) PrecisionMedium Decorate 27(p) RelaxedPrecision
Decorate 27(p) Location 3 Decorate 27(p) Location 3
Decorate 30(pos) PrecisionMedium Decorate 30(pos) RelaxedPrecision
Decorate 30(pos) Smooth Decorate 30(pos) Smooth
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

28
Test/baseResults/spv.300layoutp.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 112 // Id's are bound by 112
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 10 "pos" Name 10 "pos"
Name 12 "p" Name 12 "p"
@ -41,47 +42,30 @@ Linked vertex stage:
Name 80 "s" Name 80 "s"
Name 110 "gl_VertexID" Name 110 "gl_VertexID"
Name 111 "gl_InstanceID" Name 111 "gl_InstanceID"
Decorate 10(pos) PrecisionHigh
Decorate 10(pos) Smooth Decorate 10(pos) Smooth
Decorate 12(p) PrecisionHigh
Decorate 12(p) Location 3 Decorate 12(p) Location 3
MemberDecorate 18(Transform) 0 RowMajor MemberDecorate 18(Transform) 0 RowMajor
MemberDecorate 18(Transform) 0 PrecisionHigh MemberDecorate 18(Transform) 0 Offset 0
MemberDecorate 18(Transform) 1 ColMajor MemberDecorate 18(Transform) 1 ColMajor
MemberDecorate 18(Transform) 1 PrecisionHigh MemberDecorate 18(Transform) 1 Offset 64
MemberDecorate 18(Transform) 2 RowMajor MemberDecorate 18(Transform) 2 RowMajor
MemberDecorate 18(Transform) 2 PrecisionHigh MemberDecorate 18(Transform) 2 Offset 128
MemberDecorate 18(Transform) 3 PrecisionHigh MemberDecorate 18(Transform) 3 Offset 176
Decorate 18(Transform) GLSLStd140
Decorate 18(Transform) Block Decorate 18(Transform) Block
MemberDecorate 34(T3) 0 ColMajor MemberDecorate 34(T3) 0 ColMajor
MemberDecorate 34(T3) 0 PrecisionHigh
MemberDecorate 34(T3) 1 RowMajor MemberDecorate 34(T3) 1 RowMajor
MemberDecorate 34(T3) 1 PrecisionHigh
MemberDecorate 34(T3) 2 ColMajor MemberDecorate 34(T3) 2 ColMajor
MemberDecorate 34(T3) 2 PrecisionHigh
MemberDecorate 34(T3) 3 PrecisionHigh
Decorate 34(T3) GLSLShared Decorate 34(T3) GLSLShared
Decorate 34(T3) Block Decorate 34(T3) Block
MemberDecorate 44(T2) 1 RowMajor MemberDecorate 44(T2) 1 RowMajor
MemberDecorate 44(T2) 1 PrecisionHigh
Decorate 44(T2) GLSLShared Decorate 44(T2) GLSLShared
Decorate 44(T2) Block Decorate 44(T2) Block
Decorate 52(color) PrecisionHigh
Decorate 52(color) Smooth Decorate 52(color) Smooth
Decorate 54(c) PrecisionHigh
Decorate 54(c) Location 7 Decorate 54(c) Location 7
Decorate 62(iout) PrecisionHigh
Decorate 62(iout) Flat Decorate 62(iout) Flat
Decorate 68(uiuin) PrecisionHigh
Decorate 74(aiv2) PrecisionHigh
Decorate 74(aiv2) Location 9 Decorate 74(aiv2) Location 9
MemberDecorate 78(S) 0 PrecisionHigh
MemberDecorate 78(S) 1 PrecisionHigh
Decorate 110(gl_VertexID) PrecisionHigh
Decorate 110(gl_VertexID) BuiltIn VertexId Decorate 110(gl_VertexID) BuiltIn VertexId
Decorate 110(gl_VertexID) NoStaticUse Decorate 110(gl_VertexID) NoStaticUse
Decorate 111(gl_InstanceID) PrecisionHigh
Decorate 111(gl_InstanceID) BuiltIn InstanceId Decorate 111(gl_InstanceID) BuiltIn InstanceId
Decorate 111(gl_InstanceID) NoStaticUse Decorate 111(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

3
Test/baseResults/spv.330.geom.out Normal file → Executable file
View File

@ -9,9 +9,10 @@ Linked geometry stage:
Source GLSL 330 Source GLSL 330
SourceExtension "GL_ARB_separate_shader_objects" SourceExtension "GL_ARB_separate_shader_objects"
Capability Geometry
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Geometry 4 EntryPoint Geometry 4 "main"
ExecutionMode 4 InputTriangles ExecutionMode 4 InputTriangles
ExecutionMode 4 Invocations 0 ExecutionMode 4 Invocations 0
ExecutionMode 4 OutputTriangleStrip ExecutionMode 4 OutputTriangleStrip

309
Test/baseResults/spv.400.tesc.out Normal file → Executable file
View File

@ -7,170 +7,173 @@ Linked tessellation control stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 89 // Id's are bound by 91
Source GLSL 400 Source GLSL 400
SourceExtension "GL_ARB_separate_shader_objects" SourceExtension "GL_ARB_separate_shader_objects"
Capability Tessellation
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 EntryPoint TessellationControl 4 "main"
ExecutionMode 4 OutputVertices 4 ExecutionMode 4 OutputVertices 4
Name 4 "main" Name 4 "main"
Name 9 "a" Name 13 "a"
Name 14 "p" Name 18 "p"
Name 18 "gl_PerVertex" Name 20 "gl_PerVertex"
MemberName 18(gl_PerVertex) 0 "gl_Position" MemberName 20(gl_PerVertex) 0 "gl_Position"
MemberName 18(gl_PerVertex) 1 "gl_PointSize" MemberName 20(gl_PerVertex) 1 "gl_PointSize"
MemberName 18(gl_PerVertex) 2 "gl_ClipDistance" MemberName 20(gl_PerVertex) 2 "gl_ClipDistance"
Name 22 "gl_in" Name 24 "gl_in"
Name 29 "ps" Name 31 "ps"
Name 33 "cd" Name 35 "cd"
Name 37 "pvi" Name 39 "pvi"
Name 39 "gl_PatchVerticesIn" Name 41 "gl_PatchVerticesIn"
Name 41 "pid" Name 43 "pid"
Name 42 "gl_PrimitiveID" Name 44 "gl_PrimitiveID"
Name 44 "iid" Name 46 "iid"
Name 45 "gl_InvocationID" Name 47 "gl_InvocationID"
Name 47 "gl_PerVertex" Name 49 "gl_PerVertex"
MemberName 47(gl_PerVertex) 0 "gl_Position" MemberName 49(gl_PerVertex) 0 "gl_Position"
MemberName 47(gl_PerVertex) 1 "gl_PointSize" MemberName 49(gl_PerVertex) 1 "gl_PointSize"
MemberName 47(gl_PerVertex) 2 "gl_ClipDistance" MemberName 49(gl_PerVertex) 2 "gl_ClipDistance"
Name 51 "gl_out" Name 53 "gl_out"
Name 62 "gl_TessLevelOuter" Name 64 "gl_TessLevelOuter"
Name 69 "gl_TessLevelInner" Name 71 "gl_TessLevelInner"
Name 74 "outa" Name 76 "outa"
Name 75 "patchOut" Name 77 "patchOut"
Name 79 "inb" Name 81 "inb"
Name 80 "ind" Name 82 "ind"
Name 83 "ivla" Name 85 "ivla"
Name 84 "ivlb" Name 86 "ivlb"
Name 87 "ovla" Name 89 "ovla"
Name 88 "ovlb" Name 90 "ovlb"
Decorate 18(gl_PerVertex) Block Decorate 20(gl_PerVertex) Block
Decorate 39(gl_PatchVerticesIn) BuiltIn PatchVertices Decorate 41(gl_PatchVerticesIn) BuiltIn PatchVertices
Decorate 42(gl_PrimitiveID) BuiltIn PrimitiveId Decorate 44(gl_PrimitiveID) BuiltIn PrimitiveId
Decorate 45(gl_InvocationID) BuiltIn InvocationId Decorate 47(gl_InvocationID) BuiltIn InvocationId
MemberDecorate 47(gl_PerVertex) 0 BuiltIn Position MemberDecorate 49(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 47(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 49(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 47(gl_PerVertex) 2 BuiltIn ClipDistance MemberDecorate 49(gl_PerVertex) 2 BuiltIn ClipDistance
Decorate 47(gl_PerVertex) Block Decorate 49(gl_PerVertex) Block
Decorate 62(gl_TessLevelOuter) Patch Decorate 64(gl_TessLevelOuter) Patch
Decorate 62(gl_TessLevelOuter) BuiltIn TessLevelOuter Decorate 64(gl_TessLevelOuter) BuiltIn TessLevelOuter
Decorate 69(gl_TessLevelInner) Patch Decorate 71(gl_TessLevelInner) Patch
Decorate 69(gl_TessLevelInner) BuiltIn TessLevelInner Decorate 71(gl_TessLevelInner) BuiltIn TessLevelInner
Decorate 74(outa) NoStaticUse Decorate 76(outa) NoStaticUse
Decorate 75(patchOut) Patch Decorate 77(patchOut) Patch
Decorate 75(patchOut) NoStaticUse Decorate 77(patchOut) NoStaticUse
Decorate 79(inb) NoStaticUse Decorate 81(inb) NoStaticUse
Decorate 80(ind) NoStaticUse Decorate 82(ind) NoStaticUse
Decorate 83(ivla) Location 3 Decorate 85(ivla) Location 3
Decorate 83(ivla) NoStaticUse Decorate 85(ivla) NoStaticUse
Decorate 84(ivlb) Location 4 Decorate 86(ivlb) Location 4
Decorate 84(ivlb) NoStaticUse Decorate 86(ivlb) NoStaticUse
Decorate 87(ovla) Location 3 Decorate 89(ovla) Location 3
Decorate 87(ovla) NoStaticUse Decorate 89(ovla) NoStaticUse
Decorate 88(ovlb) Location 4 Decorate 90(ovlb) Location 4
Decorate 88(ovlb) NoStaticUse Decorate 90(ovlb) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 1 7: TypeInt 32 0
8: TypePointer Function 7(int) 8: 7(int) Constant 1
10: 7(int) Constant 5392 9: 7(int) Constant 1023
11: TypeFloat 32 10: 7(int) Constant 0
12: TypeVector 11(float) 4 11: TypeInt 32 1
13: TypePointer Function 12(fvec4) 12: TypePointer Function 11(int)
15: TypeInt 32 0 14: 11(int) Constant 5392
16: 15(int) Constant 1 15: TypeFloat 32
17: TypeArray 11(float) 16 16: TypeVector 15(float) 4
18(gl_PerVertex): TypeStruct 12(fvec4) 11(float) 17 17: TypePointer Function 16(fvec4)
19: 15(int) Constant 32 19: TypeArray 15(float) 8
20: TypeArray 18(gl_PerVertex) 19 20(gl_PerVertex): TypeStruct 16(fvec4) 15(float) 19
21: TypePointer Input 20 21: 7(int) Constant 32
22(gl_in): 21(ptr) Variable Input 22: TypeArray 20(gl_PerVertex) 21
23: 7(int) Constant 1 23: TypePointer Input 22
24: 7(int) Constant 0 24(gl_in): 23(ptr) Variable Input
25: TypePointer Input 12(fvec4) 25: 11(int) Constant 1
28: TypePointer Function 11(float) 26: 11(int) Constant 0
30: TypePointer Input 11(float) 27: TypePointer Input 16(fvec4)
34: 7(int) Constant 2 30: TypePointer Function 15(float)
38: TypePointer Input 7(int) 32: TypePointer Input 15(float)
39(gl_PatchVerticesIn): 38(ptr) Variable Input 36: 11(int) Constant 2
42(gl_PrimitiveID): 38(ptr) Variable Input 40: TypePointer Input 11(int)
45(gl_InvocationID): 38(ptr) Variable Input 41(gl_PatchVerticesIn): 40(ptr) Variable Input
47(gl_PerVertex): TypeStruct 12(fvec4) 11(float) 17 44(gl_PrimitiveID): 40(ptr) Variable Input
48: 15(int) Constant 4 47(gl_InvocationID): 40(ptr) Variable Input
49: TypeArray 47(gl_PerVertex) 48 49(gl_PerVertex): TypeStruct 16(fvec4) 15(float) 19
50: TypePointer Output 49 50: 7(int) Constant 4
51(gl_out): 50(ptr) Variable Output 51: TypeArray 49(gl_PerVertex) 50
53: TypePointer Output 12(fvec4) 52: TypePointer Output 51
56: TypePointer Output 11(float) 53(gl_out): 52(ptr) Variable Output
60: TypeArray 11(float) 48 55: TypePointer Output 16(fvec4)
61: TypePointer Output 60 58: TypePointer Output 15(float)
62(gl_TessLevelOuter): 61(ptr) Variable Output 62: TypeArray 15(float) 50
63: 7(int) Constant 3 63: TypePointer Output 62
64: 11(float) Constant 1078774989 64(gl_TessLevelOuter): 63(ptr) Variable Output
66: 15(int) Constant 2 65: 11(int) Constant 3
67: TypeArray 11(float) 66 66: 15(float) Constant 1078774989
68: TypePointer Output 67 68: 7(int) Constant 2
69(gl_TessLevelInner): 68(ptr) Variable Output 69: TypeArray 15(float) 68
70: 11(float) Constant 1067869798 70: TypePointer Output 69
72: TypeArray 7(int) 48 71(gl_TessLevelInner): 70(ptr) Variable Output
73: TypePointer PrivateGlobal 72 72: 15(float) Constant 1067869798
74(outa): 73(ptr) Variable PrivateGlobal 74: TypeArray 11(int) 50
75(patchOut): 53(ptr) Variable Output 75: TypePointer PrivateGlobal 74
76: TypeVector 11(float) 2 76(outa): 75(ptr) Variable PrivateGlobal
77: TypeArray 76(fvec2) 19 77(patchOut): 55(ptr) Variable Output
78: TypePointer Input 77 78: TypeVector 15(float) 2
79(inb): 78(ptr) Variable Input 79: TypeArray 78(fvec2) 21
80(ind): 78(ptr) Variable Input 80: TypePointer Input 79
81: TypeArray 12(fvec4) 19 81(inb): 80(ptr) Variable Input
82: TypePointer Input 81 82(ind): 80(ptr) Variable Input
83(ivla): 82(ptr) Variable Input 83: TypeArray 16(fvec4) 21
84(ivlb): 82(ptr) Variable Input 84: TypePointer Input 83
85: TypeArray 12(fvec4) 48 85(ivla): 84(ptr) Variable Input
86: TypePointer Output 85 86(ivlb): 84(ptr) Variable Input
87(ovla): 86(ptr) Variable Output 87: TypeArray 16(fvec4) 50
88(ovlb): 86(ptr) Variable Output 88: TypePointer Output 87
89(ovla): 88(ptr) Variable Output
90(ovlb): 88(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(a): 8(ptr) Variable Function 13(a): 12(ptr) Variable Function
14(p): 13(ptr) Variable Function 18(p): 17(ptr) Variable Function
29(ps): 28(ptr) Variable Function 31(ps): 30(ptr) Variable Function
33(cd): 28(ptr) Variable Function 35(cd): 30(ptr) Variable Function
37(pvi): 8(ptr) Variable Function 39(pvi): 12(ptr) Variable Function
41(pid): 8(ptr) Variable Function 43(pid): 12(ptr) Variable Function
44(iid): 8(ptr) Variable Function 46(iid): 12(ptr) Variable Function
MemoryBarrier Device Relaxed SequentiallyConsistent Acquire Release UniformMemory SubgroupMemory WorkgroupLocalMemory WorkgroupGlobalMemory AtomicCounterMemory ImageMemory MemoryBarrier 8 9
ControlBarrier Device ControlBarrier 8 8 10
Store 9(a) 10 Store 13(a) 14
26: 25(ptr) AccessChain 22(gl_in) 23 24 28: 27(ptr) AccessChain 24(gl_in) 25 26
27: 12(fvec4) Load 26 29: 16(fvec4) Load 28
Store 14(p) 27 Store 18(p) 29
31: 30(ptr) AccessChain 22(gl_in) 23 23 33: 32(ptr) AccessChain 24(gl_in) 25 25
32: 11(float) Load 31 34: 15(float) Load 33
Store 29(ps) 32 Store 31(ps) 34
35: 30(ptr) AccessChain 22(gl_in) 23 34 34 37: 32(ptr) AccessChain 24(gl_in) 25 36 36
36: 11(float) Load 35 38: 15(float) Load 37
Store 33(cd) 36 Store 35(cd) 38
40: 7(int) Load 39(gl_PatchVerticesIn) 42: 11(int) Load 41(gl_PatchVerticesIn)
Store 37(pvi) 40 Store 39(pvi) 42
43: 7(int) Load 42(gl_PrimitiveID) 45: 11(int) Load 44(gl_PrimitiveID)
Store 41(pid) 43 Store 43(pid) 45
46: 7(int) Load 45(gl_InvocationID) 48: 11(int) Load 47(gl_InvocationID)
Store 44(iid) 46 Store 46(iid) 48
52: 12(fvec4) Load 14(p) 54: 16(fvec4) Load 18(p)
54: 53(ptr) AccessChain 51(gl_out) 23 24 56: 55(ptr) AccessChain 53(gl_out) 25 26
Store 54 52 Store 56 54
55: 11(float) Load 29(ps) 57: 15(float) Load 31(ps)
57: 56(ptr) AccessChain 51(gl_out) 23 23 59: 58(ptr) AccessChain 53(gl_out) 25 25
Store 57 55 Store 59 57
58: 11(float) Load 33(cd) 60: 15(float) Load 35(cd)
59: 56(ptr) AccessChain 51(gl_out) 23 34 23 61: 58(ptr) AccessChain 53(gl_out) 25 36 25
Store 59 58 Store 61 60
65: 56(ptr) AccessChain 62(gl_TessLevelOuter) 63 67: 58(ptr) AccessChain 64(gl_TessLevelOuter) 65
Store 65 64 Store 67 66
71: 56(ptr) AccessChain 69(gl_TessLevelInner) 23 73: 58(ptr) AccessChain 71(gl_TessLevelInner) 25
Store 71 70 Store 73 72
Branch 6 Branch 6
6: Label 6: Label
Return Return

3
Test/baseResults/spv.400.tese.out Normal file → Executable file
View File

@ -11,9 +11,10 @@ Linked tessellation evaluation stage:
Source GLSL 400 Source GLSL 400
SourceExtension "GL_ARB_separate_shader_objects" SourceExtension "GL_ARB_separate_shader_objects"
Capability Tessellation
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint TessellationEvaluation 4 EntryPoint TessellationEvaluation 4 "main"
ExecutionMode 4 InputTriangles ExecutionMode 4 InputTriangles
Name 4 "main" Name 4 "main"
Name 9 "a" Name 9 "a"

56
Test/baseResults/spv.430.vert.out Normal file → Executable file
View File

@ -7,12 +7,13 @@ Linked vertex stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 62 // Id's are bound by 63
Source GLSL 430 Source GLSL 430
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 11 "gl_PerVertex" Name 11 "gl_PerVertex"
MemberName 11(gl_PerVertex) 0 "gl_ClipDistance" MemberName 11(gl_PerVertex) 0 "gl_ClipDistance"
@ -29,11 +30,11 @@ Linked vertex stage:
Name 49 "anonblock" Name 49 "anonblock"
MemberName 49(anonblock) 0 "aoeu" MemberName 49(anonblock) 0 "aoeu"
Name 51 "" Name 51 ""
Name 54 "sampb1" Name 55 "sampb1"
Name 57 "sampb2" Name 58 "sampb2"
Name 58 "sampb4" Name 59 "sampb4"
Name 60 "gl_VertexID" Name 61 "gl_VertexID"
Name 61 "gl_InstanceID" Name 62 "gl_InstanceID"
MemberDecorate 11(gl_PerVertex) 0 BuiltIn ClipDistance MemberDecorate 11(gl_PerVertex) 0 BuiltIn ClipDistance
Decorate 11(gl_PerVertex) Block Decorate 11(gl_PerVertex) Block
Decorate 35(badorder3) Flat Decorate 35(badorder3) Flat
@ -53,16 +54,16 @@ Linked vertex stage:
Decorate 49(anonblock) Block Decorate 49(anonblock) Block
Decorate 51 Binding 7 Decorate 51 Binding 7
Decorate 51 NoStaticUse Decorate 51 NoStaticUse
Decorate 54(sampb1) Binding 4 Decorate 55(sampb1) Binding 4
Decorate 54(sampb1) NoStaticUse Decorate 55(sampb1) NoStaticUse
Decorate 57(sampb2) Binding 5 Decorate 58(sampb2) Binding 5
Decorate 57(sampb2) NoStaticUse Decorate 58(sampb2) NoStaticUse
Decorate 58(sampb4) Binding 31 Decorate 59(sampb4) Binding 31
Decorate 58(sampb4) NoStaticUse Decorate 59(sampb4) NoStaticUse
Decorate 60(gl_VertexID) BuiltIn VertexId Decorate 61(gl_VertexID) BuiltIn VertexId
Decorate 60(gl_VertexID) NoStaticUse Decorate 61(gl_VertexID) NoStaticUse
Decorate 61(gl_InstanceID) BuiltIn InstanceId Decorate 62(gl_InstanceID) BuiltIn InstanceId
Decorate 61(gl_InstanceID) NoStaticUse Decorate 62(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -99,16 +100,17 @@ Linked vertex stage:
49(anonblock): TypeStruct 14(int) 49(anonblock): TypeStruct 14(int)
50: TypePointer Uniform 49(anonblock) 50: TypePointer Uniform 49(anonblock)
51: 50(ptr) Variable Uniform 51: 50(ptr) Variable Uniform
52: TypeSampler7(float) 2D filter+texture 52: TypeImage 7(float) 2D sampled format:Unknown
53: TypePointer UniformConstant 52 53: TypeSampledImage 52
54(sampb1): 53(ptr) Variable UniformConstant 54: TypePointer UniformConstant 53
55: TypeArray 52 21 55(sampb1): 54(ptr) Variable UniformConstant
56: TypePointer UniformConstant 55 56: TypeArray 53 21
57(sampb2): 56(ptr) Variable UniformConstant 57: TypePointer UniformConstant 56
58(sampb4): 53(ptr) Variable UniformConstant 58(sampb2): 57(ptr) Variable UniformConstant
59: TypePointer Input 14(int) 59(sampb4): 54(ptr) Variable UniformConstant
60(gl_VertexID): 59(ptr) Variable Input 60: TypePointer Input 14(int)
61(gl_InstanceID): 59(ptr) Variable Input 61(gl_VertexID): 60(ptr) Variable Input
62(gl_InstanceID): 60(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
19: 18(ptr) AccessChain 13 15 16 19: 18(ptr) AccessChain 13 15 16

92
Test/baseResults/spv.Operations.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 399 // Id's are bound by 399
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "v" Name 10 "v"
Name 12 "uv4" Name 12 "uv4"
@ -69,10 +71,10 @@ Linked fragment stage:
302(f): 301(ptr) Variable Function 302(f): 301(ptr) Variable Function
379: 9(ptr) Variable Function 379: 9(ptr) Variable Function
13: 8(fvec4) Load 12(uv4) 13: 8(fvec4) Load 12(uv4)
14: 8(fvec4) ExtInst 1(GLSL.std.450) 8(radians) 13 14: 8(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 13
Store 10(v) 14 Store 10(v) 14
15: 8(fvec4) Load 10(v) 15: 8(fvec4) Load 10(v)
16: 8(fvec4) ExtInst 1(GLSL.std.450) 9(degrees) 15 16: 8(fvec4) ExtInst 1(GLSL.std.450) 12(Degrees) 15
17: 8(fvec4) Load 10(v) 17: 8(fvec4) Load 10(v)
18: 8(fvec4) FAdd 17 16 18: 8(fvec4) FAdd 17 16
Store 10(v) 18 Store 10(v) 18
@ -81,123 +83,123 @@ Linked fragment stage:
26: 19(int) IMul 24 25 26: 19(int) IMul 24 25
Store 21(i) 26 Store 21(i) 26
27: 8(fvec4) Load 10(v) 27: 8(fvec4) Load 10(v)
28: 8(fvec4) ExtInst 1(GLSL.std.450) 10(sin) 27 28: 8(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 27
29: 8(fvec4) Load 10(v) 29: 8(fvec4) Load 10(v)
30: 8(fvec4) FAdd 29 28 30: 8(fvec4) FAdd 29 28
Store 10(v) 30 Store 10(v) 30
31: 8(fvec4) Load 10(v) 31: 8(fvec4) Load 10(v)
32: 8(fvec4) ExtInst 1(GLSL.std.450) 11(cos) 31 32: 8(fvec4) ExtInst 1(GLSL.std.450) 14(Cos) 31
33: 8(fvec4) Load 10(v) 33: 8(fvec4) Load 10(v)
34: 8(fvec4) FAdd 33 32 34: 8(fvec4) FAdd 33 32
Store 10(v) 34 Store 10(v) 34
35: 8(fvec4) Load 10(v) 35: 8(fvec4) Load 10(v)
36: 8(fvec4) ExtInst 1(GLSL.std.450) 12(tan) 35 36: 8(fvec4) ExtInst 1(GLSL.std.450) 15(Tan) 35
37: 8(fvec4) Load 10(v) 37: 8(fvec4) Load 10(v)
38: 8(fvec4) FAdd 37 36 38: 8(fvec4) FAdd 37 36
Store 10(v) 38 Store 10(v) 38
39: 8(fvec4) Load 10(v) 39: 8(fvec4) Load 10(v)
40: 8(fvec4) ExtInst 1(GLSL.std.450) 13(asin) 39 40: 8(fvec4) ExtInst 1(GLSL.std.450) 16(Asin) 39
41: 8(fvec4) Load 10(v) 41: 8(fvec4) Load 10(v)
42: 8(fvec4) FAdd 41 40 42: 8(fvec4) FAdd 41 40
Store 10(v) 42 Store 10(v) 42
43: 8(fvec4) Load 10(v) 43: 8(fvec4) Load 10(v)
44: 8(fvec4) ExtInst 1(GLSL.std.450) 14(acos) 43 44: 8(fvec4) ExtInst 1(GLSL.std.450) 17(Acos) 43
45: 8(fvec4) Load 10(v) 45: 8(fvec4) Load 10(v)
46: 8(fvec4) FAdd 45 44 46: 8(fvec4) FAdd 45 44
Store 10(v) 46 Store 10(v) 46
47: 8(fvec4) Load 10(v) 47: 8(fvec4) Load 10(v)
48: 8(fvec4) ExtInst 1(GLSL.std.450) 15(atan) 47 48: 8(fvec4) ExtInst 1(GLSL.std.450) 18(Atan) 47
49: 8(fvec4) Load 10(v) 49: 8(fvec4) Load 10(v)
50: 8(fvec4) FAdd 49 48 50: 8(fvec4) FAdd 49 48
Store 10(v) 50 Store 10(v) 50
51: 8(fvec4) Load 10(v) 51: 8(fvec4) Load 10(v)
52: 8(fvec4) ExtInst 1(GLSL.std.450) 16(sinh) 51 52: 8(fvec4) ExtInst 1(GLSL.std.450) 19(Sinh) 51
53: 8(fvec4) Load 10(v) 53: 8(fvec4) Load 10(v)
54: 8(fvec4) FAdd 53 52 54: 8(fvec4) FAdd 53 52
Store 10(v) 54 Store 10(v) 54
55: 8(fvec4) Load 10(v) 55: 8(fvec4) Load 10(v)
56: 8(fvec4) ExtInst 1(GLSL.std.450) 17(cosh) 55 56: 8(fvec4) ExtInst 1(GLSL.std.450) 20(Cosh) 55
57: 8(fvec4) Load 10(v) 57: 8(fvec4) Load 10(v)
58: 8(fvec4) FAdd 57 56 58: 8(fvec4) FAdd 57 56
Store 10(v) 58 Store 10(v) 58
59: 8(fvec4) Load 10(v) 59: 8(fvec4) Load 10(v)
60: 8(fvec4) ExtInst 1(GLSL.std.450) 18(tanh) 59 60: 8(fvec4) ExtInst 1(GLSL.std.450) 21(Tanh) 59
61: 8(fvec4) Load 10(v) 61: 8(fvec4) Load 10(v)
62: 8(fvec4) FAdd 61 60 62: 8(fvec4) FAdd 61 60
Store 10(v) 62 Store 10(v) 62
63: 8(fvec4) Load 10(v) 63: 8(fvec4) Load 10(v)
64: 8(fvec4) ExtInst 1(GLSL.std.450) 19(asinh) 63 64: 8(fvec4) ExtInst 1(GLSL.std.450) 22(Asinh) 63
65: 8(fvec4) Load 10(v) 65: 8(fvec4) Load 10(v)
66: 8(fvec4) FAdd 65 64 66: 8(fvec4) FAdd 65 64
Store 10(v) 66 Store 10(v) 66
67: 8(fvec4) Load 10(v) 67: 8(fvec4) Load 10(v)
68: 8(fvec4) ExtInst 1(GLSL.std.450) 20(acosh) 67 68: 8(fvec4) ExtInst 1(GLSL.std.450) 23(Acosh) 67
69: 8(fvec4) Load 10(v) 69: 8(fvec4) Load 10(v)
70: 8(fvec4) FAdd 69 68 70: 8(fvec4) FAdd 69 68
Store 10(v) 70 Store 10(v) 70
71: 8(fvec4) Load 10(v) 71: 8(fvec4) Load 10(v)
72: 8(fvec4) ExtInst 1(GLSL.std.450) 21(atanh) 71 72: 8(fvec4) ExtInst 1(GLSL.std.450) 24(Atanh) 71
73: 8(fvec4) Load 10(v) 73: 8(fvec4) Load 10(v)
74: 8(fvec4) FAdd 73 72 74: 8(fvec4) FAdd 73 72
Store 10(v) 74 Store 10(v) 74
75: 8(fvec4) Load 10(v) 75: 8(fvec4) Load 10(v)
76: 8(fvec4) Load 10(v) 76: 8(fvec4) Load 10(v)
77: 8(fvec4) ExtInst 1(GLSL.std.450) 23(pow) 75 76 77: 8(fvec4) ExtInst 1(GLSL.std.450) 26(Pow) 75 76
78: 8(fvec4) Load 10(v) 78: 8(fvec4) Load 10(v)
79: 8(fvec4) FAdd 78 77 79: 8(fvec4) FAdd 78 77
Store 10(v) 79 Store 10(v) 79
80: 8(fvec4) Load 10(v) 80: 8(fvec4) Load 10(v)
81: 8(fvec4) ExtInst 1(GLSL.std.450) 24(exp) 80 81: 8(fvec4) ExtInst 1(GLSL.std.450) 27(Exp) 80
82: 8(fvec4) Load 10(v) 82: 8(fvec4) Load 10(v)
83: 8(fvec4) FAdd 82 81 83: 8(fvec4) FAdd 82 81
Store 10(v) 83 Store 10(v) 83
84: 8(fvec4) Load 10(v) 84: 8(fvec4) Load 10(v)
85: 8(fvec4) ExtInst 1(GLSL.std.450) 25(log) 84 85: 8(fvec4) ExtInst 1(GLSL.std.450) 28(Log) 84
86: 8(fvec4) Load 10(v) 86: 8(fvec4) Load 10(v)
87: 8(fvec4) FAdd 86 85 87: 8(fvec4) FAdd 86 85
Store 10(v) 87 Store 10(v) 87
88: 8(fvec4) Load 10(v) 88: 8(fvec4) Load 10(v)
89: 8(fvec4) ExtInst 1(GLSL.std.450) 26(exp2) 88 89: 8(fvec4) ExtInst 1(GLSL.std.450) 29(Exp2) 88
90: 8(fvec4) Load 10(v) 90: 8(fvec4) Load 10(v)
91: 8(fvec4) FAdd 90 89 91: 8(fvec4) FAdd 90 89
Store 10(v) 91 Store 10(v) 91
92: 8(fvec4) Load 10(v) 92: 8(fvec4) Load 10(v)
93: 8(fvec4) ExtInst 1(GLSL.std.450) 27(log2) 92 93: 8(fvec4) ExtInst 1(GLSL.std.450) 30(Log2) 92
94: 8(fvec4) Load 10(v) 94: 8(fvec4) Load 10(v)
95: 8(fvec4) FAdd 94 93 95: 8(fvec4) FAdd 94 93
Store 10(v) 95 Store 10(v) 95
96: 8(fvec4) Load 10(v) 96: 8(fvec4) Load 10(v)
97: 8(fvec4) ExtInst 1(GLSL.std.450) 28(sqrt) 96 97: 8(fvec4) ExtInst 1(GLSL.std.450) 31(Sqrt) 96
98: 8(fvec4) Load 10(v) 98: 8(fvec4) Load 10(v)
99: 8(fvec4) FAdd 98 97 99: 8(fvec4) FAdd 98 97
Store 10(v) 99 Store 10(v) 99
100: 8(fvec4) Load 10(v) 100: 8(fvec4) Load 10(v)
101: 8(fvec4) ExtInst 1(GLSL.std.450) 29(inverseSqrt) 100 101: 8(fvec4) ExtInst 1(GLSL.std.450) 32(Inversesqrt) 100
102: 8(fvec4) Load 10(v) 102: 8(fvec4) Load 10(v)
103: 8(fvec4) FAdd 102 101 103: 8(fvec4) FAdd 102 101
Store 10(v) 103 Store 10(v) 103
104: 8(fvec4) Load 10(v) 104: 8(fvec4) Load 10(v)
105: 8(fvec4) ExtInst 1(GLSL.std.450) 3(abs) 104 105: 8(fvec4) ExtInst 1(GLSL.std.450) 4(FAbs) 104
106: 8(fvec4) Load 10(v) 106: 8(fvec4) Load 10(v)
107: 8(fvec4) FAdd 106 105 107: 8(fvec4) FAdd 106 105
Store 10(v) 107 Store 10(v) 107
108: 8(fvec4) Load 10(v) 108: 8(fvec4) Load 10(v)
109: 8(fvec4) ExtInst 1(GLSL.std.450) 4(sign) 108 109: 8(fvec4) ExtInst 1(GLSL.std.450) 6(FSign) 108
110: 8(fvec4) Load 10(v) 110: 8(fvec4) Load 10(v)
111: 8(fvec4) FAdd 110 109 111: 8(fvec4) FAdd 110 109
Store 10(v) 111 Store 10(v) 111
112: 8(fvec4) Load 10(v) 112: 8(fvec4) Load 10(v)
113: 8(fvec4) ExtInst 1(GLSL.std.450) 5(floor) 112 113: 8(fvec4) ExtInst 1(GLSL.std.450) 8(Floor) 112
114: 8(fvec4) Load 10(v) 114: 8(fvec4) Load 10(v)
115: 8(fvec4) FAdd 114 113 115: 8(fvec4) FAdd 114 113
Store 10(v) 115 Store 10(v) 115
116: 8(fvec4) Load 10(v) 116: 8(fvec4) Load 10(v)
117: 8(fvec4) ExtInst 1(GLSL.std.450) 6(ceil) 116 117: 8(fvec4) ExtInst 1(GLSL.std.450) 9(Ceil) 116
118: 8(fvec4) Load 10(v) 118: 8(fvec4) Load 10(v)
119: 8(fvec4) FAdd 118 117 119: 8(fvec4) FAdd 118 117
Store 10(v) 119 Store 10(v) 119
120: 8(fvec4) Load 10(v) 120: 8(fvec4) Load 10(v)
121: 8(fvec4) ExtInst 1(GLSL.std.450) 7(fract) 120 121: 8(fvec4) ExtInst 1(GLSL.std.450) 10(Fract) 120
122: 8(fvec4) Load 10(v) 122: 8(fvec4) Load 10(v)
123: 8(fvec4) FAdd 122 121 123: 8(fvec4) FAdd 122 121
Store 10(v) 123 Store 10(v) 123
@ -217,78 +219,78 @@ Linked fragment stage:
Store 10(v) 135 Store 10(v) 135
136: 8(fvec4) Load 10(v) 136: 8(fvec4) Load 10(v)
137: 8(fvec4) Load 12(uv4) 137: 8(fvec4) Load 12(uv4)
138: 8(fvec4) ExtInst 1(GLSL.std.450) 33(min) 136 137 138: 8(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 136 137
139: 8(fvec4) Load 10(v) 139: 8(fvec4) Load 10(v)
140: 8(fvec4) FAdd 139 138 140: 8(fvec4) FAdd 139 138
Store 10(v) 140 Store 10(v) 140
141: 8(fvec4) Load 10(v) 141: 8(fvec4) Load 10(v)
142: 8(fvec4) Load 12(uv4) 142: 8(fvec4) Load 12(uv4)
143: 8(fvec4) ExtInst 1(GLSL.std.450) 34(max) 141 142 143: 8(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 141 142
144: 8(fvec4) Load 10(v) 144: 8(fvec4) Load 10(v)
145: 8(fvec4) FAdd 144 143 145: 8(fvec4) FAdd 144 143
Store 10(v) 145 Store 10(v) 145
146: 8(fvec4) Load 10(v) 146: 8(fvec4) Load 10(v)
147: 8(fvec4) Load 12(uv4) 147: 8(fvec4) Load 12(uv4)
148: 8(fvec4) Load 12(uv4) 148: 8(fvec4) Load 12(uv4)
149: 8(fvec4) ExtInst 1(GLSL.std.450) 35(clamp) 146 147 148 149: 8(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 146 147 148
150: 8(fvec4) Load 10(v) 150: 8(fvec4) Load 10(v)
151: 8(fvec4) FAdd 150 149 151: 8(fvec4) FAdd 150 149
Store 10(v) 151 Store 10(v) 151
152: 8(fvec4) Load 10(v) 152: 8(fvec4) Load 10(v)
153: 8(fvec4) Load 10(v) 153: 8(fvec4) Load 10(v)
154: 8(fvec4) Load 10(v) 154: 8(fvec4) Load 10(v)
155: 8(fvec4) ExtInst 1(GLSL.std.450) 36(mix) 152 153 154 155: 8(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 152 153 154
156: 8(fvec4) Load 10(v) 156: 8(fvec4) Load 10(v)
157: 8(fvec4) FAdd 156 155 157: 8(fvec4) FAdd 156 155
Store 10(v) 157 Store 10(v) 157
158: 8(fvec4) Load 10(v) 158: 8(fvec4) Load 10(v)
159: 8(fvec4) Load 10(v) 159: 8(fvec4) Load 10(v)
160: 8(fvec4) ExtInst 1(GLSL.std.450) 37(step) 158 159 160: 8(fvec4) ExtInst 1(GLSL.std.450) 47(Step) 158 159
161: 8(fvec4) Load 10(v) 161: 8(fvec4) Load 10(v)
162: 8(fvec4) FAdd 161 160 162: 8(fvec4) FAdd 161 160
Store 10(v) 162 Store 10(v) 162
163: 8(fvec4) Load 10(v) 163: 8(fvec4) Load 10(v)
164: 8(fvec4) Load 10(v) 164: 8(fvec4) Load 10(v)
165: 8(fvec4) Load 10(v) 165: 8(fvec4) Load 10(v)
166: 8(fvec4) ExtInst 1(GLSL.std.450) 38(smoothStep) 163 164 165 166: 8(fvec4) ExtInst 1(GLSL.std.450) 48(Smoothstep) 163 164 165
167: 8(fvec4) Load 10(v) 167: 8(fvec4) Load 10(v)
168: 8(fvec4) FAdd 167 166 168: 8(fvec4) FAdd 167 166
Store 10(v) 168 Store 10(v) 168
171: 7(float) Load 170(uf) 171: 7(float) Load 170(uf)
172: 8(fvec4) Load 10(v) 172: 8(fvec4) Load 10(v)
173: 8(fvec4) ExtInst 1(GLSL.std.450) 37(step) 171 172 173: 8(fvec4) ExtInst 1(GLSL.std.450) 47(Step) 171 172
174: 8(fvec4) Load 10(v) 174: 8(fvec4) Load 10(v)
175: 8(fvec4) FAdd 174 173 175: 8(fvec4) FAdd 174 173
Store 10(v) 175 Store 10(v) 175
176: 7(float) Load 170(uf) 176: 7(float) Load 170(uf)
177: 7(float) Load 170(uf) 177: 7(float) Load 170(uf)
178: 8(fvec4) Load 10(v) 178: 8(fvec4) Load 10(v)
179: 8(fvec4) ExtInst 1(GLSL.std.450) 38(smoothStep) 176 177 178 179: 8(fvec4) ExtInst 1(GLSL.std.450) 48(Smoothstep) 176 177 178
180: 8(fvec4) Load 10(v) 180: 8(fvec4) Load 10(v)
181: 8(fvec4) FAdd 180 179 181: 8(fvec4) FAdd 180 179
Store 10(v) 181 Store 10(v) 181
182: 8(fvec4) Load 10(v) 182: 8(fvec4) Load 10(v)
183: 8(fvec4) ExtInst 1(GLSL.std.450) 61(normalize) 182 183: 8(fvec4) ExtInst 1(GLSL.std.450) 68(Normalize) 182
184: 8(fvec4) Load 10(v) 184: 8(fvec4) Load 10(v)
185: 8(fvec4) FAdd 184 183 185: 8(fvec4) FAdd 184 183
Store 10(v) 185 Store 10(v) 185
186: 8(fvec4) Load 10(v) 186: 8(fvec4) Load 10(v)
187: 8(fvec4) Load 10(v) 187: 8(fvec4) Load 10(v)
188: 8(fvec4) Load 10(v) 188: 8(fvec4) Load 10(v)
189: 8(fvec4) ExtInst 1(GLSL.std.450) 63(faceForward) 186 187 188 189: 8(fvec4) ExtInst 1(GLSL.std.450) 69(Faceforward) 186 187 188
190: 8(fvec4) Load 10(v) 190: 8(fvec4) Load 10(v)
191: 8(fvec4) FAdd 190 189 191: 8(fvec4) FAdd 190 189
Store 10(v) 191 Store 10(v) 191
192: 8(fvec4) Load 10(v) 192: 8(fvec4) Load 10(v)
193: 8(fvec4) Load 10(v) 193: 8(fvec4) Load 10(v)
194: 8(fvec4) ExtInst 1(GLSL.std.450) 64(reflect) 192 193 194: 8(fvec4) ExtInst 1(GLSL.std.450) 70(Reflect) 192 193
195: 8(fvec4) Load 10(v) 195: 8(fvec4) Load 10(v)
196: 8(fvec4) FAdd 195 194 196: 8(fvec4) FAdd 195 194
Store 10(v) 196 Store 10(v) 196
197: 8(fvec4) Load 10(v) 197: 8(fvec4) Load 10(v)
198: 8(fvec4) Load 10(v) 198: 8(fvec4) Load 10(v)
199: 7(float) Load 170(uf) 199: 7(float) Load 170(uf)
200: 8(fvec4) ExtInst 1(GLSL.std.450) 65(refract) 197 198 199 200: 8(fvec4) ExtInst 1(GLSL.std.450) 71(Refract) 197 198 199
201: 8(fvec4) Load 10(v) 201: 8(fvec4) Load 10(v)
202: 8(fvec4) FAdd 201 200 202: 8(fvec4) FAdd 201 200
Store 10(v) 202 Store 10(v) 202
@ -359,7 +361,7 @@ Linked fragment stage:
Store 217(b) 263 Store 217(b) 263
264: 215(bool) Load 217(b) 264: 215(bool) Load 217(b)
265: 220(bvec4) Load 243(ub41) 265: 220(bvec4) Load 243(ub41)
266: 220(bvec4) Not 265 266: 220(bvec4) LogicalNot 265
267: 215(bool) Any 266 267: 215(bool) Any 266
268: 215(bool) LogicalAnd 264 267 268: 215(bool) LogicalAnd 264 267
Store 217(b) 268 Store 217(b) 268
@ -389,7 +391,7 @@ Linked fragment stage:
290: 215(bool) LogicalAnd 286 289 290: 215(bool) LogicalAnd 286 289
291: 19(int) Load 21(i) 291: 19(int) Load 21(i)
293: 215(bool) INotEqual 291 292 293: 215(bool) INotEqual 291 292
294: 215(bool) LogicalXor 290 293 294: 215(bool) LogicalNotEqual 290 293
295: 215(bool) LogicalOr 283 294 295: 215(bool) LogicalOr 283 294
SelectionMerge 297 None SelectionMerge 297 None
BranchConditional 295 296 297 BranchConditional 295 296 297
@ -410,13 +412,13 @@ Linked fragment stage:
311: 7(float) FDiv 309 310 311: 7(float) FDiv 309 310
Store 302(f) 311 Store 302(f) 311
312: 8(fvec4) Load 10(v) 312: 8(fvec4) Load 10(v)
313: 7(float) ExtInst 1(GLSL.std.450) 58(length) 312 313: 7(float) ExtInst 1(GLSL.std.450) 65(Length) 312
314: 7(float) Load 302(f) 314: 7(float) Load 302(f)
315: 7(float) FAdd 314 313 315: 7(float) FAdd 314 313
Store 302(f) 315 Store 302(f) 315
316: 8(fvec4) Load 10(v) 316: 8(fvec4) Load 10(v)
317: 8(fvec4) Load 10(v) 317: 8(fvec4) Load 10(v)
318: 7(float) ExtInst 1(GLSL.std.450) 59(distance) 316 317 318: 7(float) ExtInst 1(GLSL.std.450) 66(Distance) 316 317
319: 7(float) Load 302(f) 319: 7(float) Load 302(f)
320: 7(float) FAdd 319 318 320: 7(float) FAdd 319 318
Store 302(f) 320 Store 302(f) 320
@ -436,7 +438,7 @@ Linked fragment stage:
333: 332(fvec3) VectorShuffle 331 331 0 1 2 333: 332(fvec3) VectorShuffle 331 331 0 1 2
334: 8(fvec4) Load 10(v) 334: 8(fvec4) Load 10(v)
335: 332(fvec3) VectorShuffle 334 334 0 1 2 335: 332(fvec3) VectorShuffle 334 334 0 1 2
336: 332(fvec3) ExtInst 1(GLSL.std.450) 60(cross) 333 335 336: 332(fvec3) ExtInst 1(GLSL.std.450) 67(Cross) 333 335
337: 7(float) CompositeExtract 336 0 337: 7(float) CompositeExtract 336 0
338: 7(float) Load 302(f) 338: 7(float) Load 302(f)
339: 7(float) FAdd 338 337 339: 7(float) FAdd 338 337
@ -484,7 +486,7 @@ Linked fragment stage:
374: 19(int) Not 373 374: 19(int) Not 373
Store 21(i) 374 Store 21(i) 374
375: 215(bool) Load 217(b) 375: 215(bool) Load 217(b)
376: 215(bool) Not 375 376: 215(bool) LogicalNot 375
Store 217(b) 376 Store 217(b) 376
380: 215(bool) Load 217(b) 380: 215(bool) Load 217(b)
SelectionMerge 382 None SelectionMerge 382 None

4
Test/baseResults/spv.accessChain.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 198 // Id's are bound by 198
Source GLSL 420 Source GLSL 420
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "S" Name 9 "S"
MemberName 9(S) 0 "color" MemberName 9(S) 0 "color"

10
Test/baseResults/spv.always-discard.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 81 // Id's are bound by 81
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "white" Name 10 "white"
Name 13 "black" Name 13 "black"
@ -72,7 +74,7 @@ Linked fragment stage:
38: 7(float) Load 28(y) 38: 7(float) Load 28(y)
39: 7(float) FMul 37 38 39: 7(float) FMul 37 38
40: 7(float) FAdd 36 39 40: 7(float) FAdd 36 39
41: 7(float) ExtInst 1(GLSL.std.450) 28(sqrt) 40 41: 7(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 40
Store 33(radius) 41 Store 33(radius) 41
42: 7(float) Load 33(radius) 42: 7(float) Load 33(radius)
44: 43(bool) FOrdGreaterThan 42 11 44: 43(bool) FOrdGreaterThan 42 11
@ -113,9 +115,9 @@ Linked fragment stage:
BranchConditional 69 70 71 BranchConditional 69 70 71
70: Label 70: Label
72: 7(float) Load 33(radius) 72: 7(float) Load 33(radius)
74: 7(float) ExtInst 1(GLSL.std.450) 23(pow) 72 73 74: 7(float) ExtInst 1(GLSL.std.450) 26(Pow) 72 73
75: 7(float) FDiv 74 25 75: 7(float) FDiv 74 25
76: 7(float) ExtInst 1(GLSL.std.450) 3(abs) 75 76: 7(float) ExtInst 1(GLSL.std.450) 4(FAbs) 75
77: 8(fvec4) Load 16(color) 77: 8(fvec4) Load 16(color)
78: 8(fvec4) CompositeConstruct 76 76 76 76 78: 8(fvec4) CompositeConstruct 76 76 76 76
79: 8(fvec4) FSub 77 78 79: 8(fvec4) FSub 77 78

4
Test/baseResults/spv.always-discard2.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 37 // Id's are bound by 37
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "white" Name 10 "white"
Name 13 "black" Name 13 "black"

192
Test/baseResults/spv.atomic.comp.out Normal file → Executable file
View File

@ -8,88 +8,80 @@ Linked compute stage:
TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class? TBD functionality: Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class?
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 75 // Id's are bound by 77
Source ESSL 310 Source ESSL 310
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint GLCompute 4 EntryPoint GLCompute 4 "main"
Name 4 "main" Name 4 "main"
Name 11 "func(au1;" Name 11 "func(au1;"
Name 10 "c" Name 10 "c"
Name 13 "atoms(" Name 13 "atoms("
Name 20 "counter" Name 23 "counter"
Name 21 "param" Name 24 "param"
Name 24 "val" Name 27 "val"
Name 28 "countArr" Name 31 "countArr"
Name 38 "origi" Name 41 "origi"
Name 40 "atomi" Name 43 "atomi"
Name 44 "origu" Name 47 "origu"
Name 46 "atomu" Name 49 "atomu"
Name 48 "value" Name 51 "value"
Name 72 "arrX" Name 74 "arrX"
Name 73 "arrY" Name 75 "arrY"
Name 74 "arrZ" Name 76 "arrZ"
Decorate 20(counter) PrecisionHigh Decorate 23(counter) Binding 0
Decorate 20(counter) Binding 0 Decorate 31(countArr) Binding 0
Decorate 24(val) PrecisionHigh Decorate 74(arrX) NoStaticUse
Decorate 28(countArr) PrecisionHigh Decorate 75(arrY) NoStaticUse
Decorate 28(countArr) Binding 0 Decorate 76(arrZ) NoStaticUse
Decorate 38(origi) PrecisionHigh
Decorate 40(atomi) PrecisionHigh
Decorate 44(origu) PrecisionHigh
Decorate 46(atomu) PrecisionHigh
Decorate 48(value) PrecisionHigh
Decorate 72(arrX) PrecisionHigh
Decorate 72(arrX) NoStaticUse
Decorate 73(arrY) PrecisionHigh
Decorate 73(arrY) NoStaticUse
Decorate 74(arrZ) PrecisionHigh
Decorate 74(arrZ) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 0 7: TypeInt 32 0
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
9: TypeFunction 7(int) 8(ptr) 9: TypeFunction 7(int) 8(ptr)
19: TypePointer UniformConstant 7(int) 16: 7(int) Constant 1
20(counter): 19(ptr) Variable UniformConstant 17: 7(int) Constant 0
25: 7(int) Constant 4 21: 7(int) Constant 256
26: TypeArray 7(int) 25 22: TypePointer UniformConstant 7(int)
27: TypePointer UniformConstant 26 23(counter): 22(ptr) Variable UniformConstant
28(countArr): 27(ptr) Variable UniformConstant 28: 7(int) Constant 4
29: TypeInt 32 1 29: TypeArray 7(int) 28
30: 29(int) Constant 2 30: TypePointer UniformConstant 29
37: TypePointer Function 29(int) 31(countArr): 30(ptr) Variable UniformConstant
39: TypePointer WorkgroupLocal 29(int) 32: TypeInt 32 1
40(atomi): 39(ptr) Variable WorkgroupLocal 33: 32(int) Constant 2
42: 29(int) Constant 3 40: TypePointer Function 32(int)
45: TypePointer WorkgroupLocal 7(int) 42: TypePointer WorkgroupLocal 32(int)
46(atomu): 45(ptr) Variable WorkgroupLocal 43(atomi): 42(ptr) Variable WorkgroupLocal
48(value): 19(ptr) Variable UniformConstant 45: 32(int) Constant 3
52: 7(int) Constant 7 48: TypePointer WorkgroupLocal 7(int)
60: 29(int) Constant 7 49(atomu): 48(ptr) Variable WorkgroupLocal
66: 7(int) Constant 10 51(value): 22(ptr) Variable UniformConstant
69: 7(int) Constant 1 55: 7(int) Constant 7
70: TypeArray 29(int) 69 63: 32(int) Constant 7
71: TypePointer PrivateGlobal 70 69: 7(int) Constant 10
72(arrX): 71(ptr) Variable PrivateGlobal 72: TypeArray 32(int) 16
73(arrY): 71(ptr) Variable PrivateGlobal 73: TypePointer PrivateGlobal 72
74(arrZ): 71(ptr) Variable PrivateGlobal 74(arrX): 73(ptr) Variable PrivateGlobal
75(arrY): 73(ptr) Variable PrivateGlobal
76(arrZ): 73(ptr) Variable PrivateGlobal
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
21(param): 8(ptr) Variable Function 24(param): 8(ptr) Variable Function
24(val): 8(ptr) Variable Function 27(val): 8(ptr) Variable Function
MemoryBarrier Device AtomicCounterMemory MemoryBarrier 16 21
22: 7(int) Load 20(counter) 25: 7(int) Load 23(counter)
Store 21(param) 22 Store 24(param) 25
23: 7(int) FunctionCall 11(func(au1;) 21(param) 26: 7(int) FunctionCall 11(func(au1;) 24(param)
31: 19(ptr) AccessChain 28(countArr) 30 34: 22(ptr) AccessChain 31(countArr) 33
32: 7(int) Load 31 35: 7(int) Load 34
33: 7(int) AtomicLoad 32 Device None 36: 7(int) AtomicLoad 35 16 17
34: 7(int) Load 31 37: 7(int) Load 34
Store 24(val) 34 Store 27(val) 37
35: 7(int) Load 20(counter) 38: 7(int) Load 23(counter)
36: 7(int) AtomicIDecrement 35 Device None 39: 7(int) AtomicIDecrement 38 16 17
Branch 6 Branch 6
6: Label 6: Label
Return Return
@ -98,41 +90,41 @@ TBD functionality: Is atomic_uint an opaque handle in the uniform storage class,
10(c): 8(ptr) FunctionParameter 10(c): 8(ptr) FunctionParameter
12: Label 12: Label
15: 7(int) Load 10(c) 15: 7(int) Load 10(c)
16: 7(int) AtomicIIncrement 15 Device None 18: 7(int) AtomicIIncrement 15 16 17
17: 7(int) Load 10(c) 19: 7(int) Load 10(c)
ReturnValue 17 ReturnValue 19
FunctionEnd FunctionEnd
13(atoms(): 2 Function None 3 13(atoms(): 2 Function None 3
14: Label 14: Label
38(origi): 37(ptr) Variable Function 41(origi): 40(ptr) Variable Function
44(origu): 8(ptr) Variable Function 47(origu): 8(ptr) Variable Function
41: 29(int) Load 40(atomi) 44: 32(int) Load 43(atomi)
43: 29(int) AtomicIAdd 41 Device None 42 46: 32(int) AtomicIAdd 44 16 17 45
Store 38(origi) 43 Store 41(origi) 46
47: 7(int) Load 46(atomu) 50: 7(int) Load 49(atomu)
49: 7(int) Load 48(value) 52: 7(int) Load 51(value)
50: 7(int) AtomicAnd 47 Device None 49 53: 7(int) AtomicAnd 50 16 17 52
Store 44(origu) 50 Store 47(origu) 53
51: 7(int) Load 46(atomu) 54: 7(int) Load 49(atomu)
53: 7(int) AtomicOr 51 Device None 52 56: 7(int) AtomicOr 54 16 17 55
Store 44(origu) 53 Store 47(origu) 56
54: 7(int) Load 46(atomu) 57: 7(int) Load 49(atomu)
55: 7(int) AtomicXor 54 Device None 52 58: 7(int) AtomicXor 57 16 17 55
Store 44(origu) 55 Store 47(origu) 58
56: 7(int) Load 46(atomu) 59: 7(int) Load 49(atomu)
57: 7(int) Load 48(value) 60: 7(int) Load 51(value)
58: 7(int) AtomicIMin 56 Device None 57 61: 7(int) AtomicSMin 59 16 17 60
Store 44(origu) 58 Store 47(origu) 61
59: 29(int) Load 40(atomi) 62: 32(int) Load 43(atomi)
61: 29(int) AtomicIMax 59 Device None 60 64: 32(int) AtomicSMax 62 16 17 63
Store 38(origi) 61 Store 41(origi) 64
62: 29(int) Load 40(atomi) 65: 32(int) Load 43(atomi)
63: 29(int) Load 38(origi) 66: 32(int) Load 41(origi)
64: 29(int) AtomicExchange 62 Device None 63 67: 32(int) AtomicExchange 65 16 17 66
Store 38(origi) 64 Store 41(origi) 67
65: 7(int) Load 46(atomu) 68: 7(int) Load 49(atomu)
67: 7(int) Load 48(value) 70: 7(int) Load 51(value)
68: 7(int) AtomicCompareExchange 65 Device None 66 67 71: 7(int) AtomicCompareExchange 68 16 17 69 70
Store 44(origu) 68 Store 47(origu) 71
Return Return
FunctionEnd FunctionEnd

73
Test/baseResults/spv.conditionalDiscard.frag.out Normal file → Executable file
View File

@ -5,56 +5,59 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 36 // Id's are bound by 37
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "v" Name 10 "v"
Name 13 "tex" Name 14 "tex"
Name 17 "coord" Name 18 "coord"
Name 34 "gl_FragColor" Name 35 "gl_FragColor"
Decorate 17(coord) Smooth Decorate 18(coord) Smooth
Decorate 34(gl_FragColor) BuiltIn FragColor Decorate 35(gl_FragColor) BuiltIn FragColor
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
8: TypeVector 7(float) 4 8: TypeVector 7(float) 4
9: TypePointer Function 8(fvec4) 9: TypePointer Function 8(fvec4)
11: TypeSampler7(float) 2D filter+texture 11: TypeImage 7(float) 2D sampled format:Unknown
12: TypePointer UniformConstant 11 12: TypeSampledImage 11
13(tex): 12(ptr) Variable UniformConstant 13: TypePointer UniformConstant 12
15: TypeVector 7(float) 2 14(tex): 13(ptr) Variable UniformConstant
16: TypePointer Input 15(fvec2) 16: TypeVector 7(float) 2
17(coord): 16(ptr) Variable Input 17: TypePointer Input 16(fvec2)
21: 7(float) Constant 1036831949 18(coord): 17(ptr) Variable Input
22: 7(float) Constant 1045220557 22: 7(float) Constant 1036831949
23: 7(float) Constant 1050253722 23: 7(float) Constant 1045220557
24: 7(float) Constant 1053609165 24: 7(float) Constant 1050253722
25: 8(fvec4) ConstantComposite 21 22 23 24 25: 7(float) Constant 1053609165
26: TypeBool 26: 8(fvec4) ConstantComposite 22 23 24 25
27: TypeVector 26(bool) 4 27: TypeBool
33: TypePointer Output 8(fvec4) 28: TypeVector 27(bool) 4
34(gl_FragColor): 33(ptr) Variable Output 34: TypePointer Output 8(fvec4)
35(gl_FragColor): 34(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
10(v): 9(ptr) Variable Function 10(v): 9(ptr) Variable Function
14: 11 Load 13(tex) 15: 12 Load 14(tex)
18: 15(fvec2) Load 17(coord) 19: 16(fvec2) Load 18(coord)
19: 8(fvec4) TextureSample 14 18 20: 8(fvec4) ImageSampleImplicitLod 15 19
Store 10(v) 19 Store 10(v) 20
20: 8(fvec4) Load 10(v) 21: 8(fvec4) Load 10(v)
28: 27(bvec4) FOrdEqual 20 25 29: 28(bvec4) FOrdEqual 21 26
29: 26(bool) All 28 30: 27(bool) All 29
SelectionMerge 31 None SelectionMerge 32 None
BranchConditional 29 30 31 BranchConditional 30 31 32
30: Label 31: Label
Kill Kill
31: Label 32: Label
35: 8(fvec4) Load 10(v) 36: 8(fvec4) Load 10(v)
Store 34(gl_FragColor) 35 Store 35(gl_FragColor) 36
Branch 6 Branch 6
6: Label 6: Label
Return Return

6
Test/baseResults/spv.conversion.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 444 // Id's are bound by 444
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "b" Name 9 "b"
Name 12 "u_i" Name 12 "u_i"
@ -191,7 +193,7 @@ Linked fragment stage:
16: 7(bool) INotEqual 13 15 16: 7(bool) INotEqual 13 15
20: 17(float) Load 19(u_f) 20: 17(float) Load 19(u_f)
22: 7(bool) FOrdNotEqual 20 21 22: 7(bool) FOrdNotEqual 20 21
23: 7(bool) LogicalXor 16 22 23: 7(bool) LogicalNotEqual 16 22
Store 9(b) 23 Store 9(b) 23
27: 10(int) Load 12(u_i) 27: 10(int) Load 12(u_i)
28: 7(bool) INotEqual 27 15 28: 7(bool) INotEqual 27 15

4
Test/baseResults/spv.dataOut.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 21 // Id's are bound by 21
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 13 "gl_FragData" Name 13 "gl_FragData"
Name 17 "Color" Name 17 "Color"

4
Test/baseResults/spv.dataOutIndirect.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 23 // Id's are bound by 23
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 13 "gl_FragData" Name 13 "gl_FragData"
Name 16 "i" Name 16 "i"

3
Test/baseResults/spv.dataOutIndirect.vert.out Normal file → Executable file
View File

@ -11,9 +11,10 @@ Linked vertex stage:
// Id's are bound by 39 // Id's are bound by 39
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 24 "colorOut" Name 24 "colorOut"

4
Test/baseResults/spv.depthOut.frag.out Normal file → Executable file
View File

@ -11,9 +11,11 @@ Linked fragment stage:
// Id's are bound by 19 // Id's are bound by 19
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "gl_FragDepth" Name 9 "gl_FragDepth"
Name 11 "Depth" Name 11 "Depth"

10
Test/baseResults/spv.discard-dce.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 81 // Id's are bound by 81
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "white" Name 10 "white"
Name 13 "black" Name 13 "black"
@ -72,7 +74,7 @@ Linked fragment stage:
38: 7(float) Load 28(y) 38: 7(float) Load 28(y)
39: 7(float) FMul 37 38 39: 7(float) FMul 37 38
40: 7(float) FAdd 36 39 40: 7(float) FAdd 36 39
41: 7(float) ExtInst 1(GLSL.std.450) 28(sqrt) 40 41: 7(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 40
Store 33(radius) 41 Store 33(radius) 41
42: 7(float) Load 33(radius) 42: 7(float) Load 33(radius)
44: 43(bool) FOrdGreaterThan 42 11 44: 43(bool) FOrdGreaterThan 42 11
@ -111,9 +113,9 @@ Linked fragment stage:
BranchConditional 69 70 71 BranchConditional 69 70 71
70: Label 70: Label
72: 7(float) Load 33(radius) 72: 7(float) Load 33(radius)
74: 7(float) ExtInst 1(GLSL.std.450) 23(pow) 72 73 74: 7(float) ExtInst 1(GLSL.std.450) 26(Pow) 72 73
75: 7(float) FDiv 74 25 75: 7(float) FDiv 74 25
76: 7(float) ExtInst 1(GLSL.std.450) 3(abs) 75 76: 7(float) ExtInst 1(GLSL.std.450) 4(FAbs) 75
77: 8(fvec4) Load 16(color) 77: 8(fvec4) Load 16(color)
78: 8(fvec4) CompositeConstruct 76 76 76 76 78: 8(fvec4) CompositeConstruct 76 76 76 76
79: 8(fvec4) FSub 77 78 79: 8(fvec4) FSub 77 78

6
Test/baseResults/spv.do-simple.vert.out Normal file → Executable file
View File

@ -8,18 +8,16 @@ Linked vertex stage:
// Id's are bound by 30 // Id's are bound by 30
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 28 "gl_VertexID" Name 28 "gl_VertexID"
Name 29 "gl_InstanceID" Name 29 "gl_InstanceID"
Decorate 9(i) PrecisionHigh
Decorate 28(gl_VertexID) PrecisionHigh
Decorate 28(gl_VertexID) BuiltIn VertexId Decorate 28(gl_VertexID) BuiltIn VertexId
Decorate 28(gl_VertexID) NoStaticUse Decorate 28(gl_VertexID) NoStaticUse
Decorate 29(gl_InstanceID) PrecisionHigh
Decorate 29(gl_InstanceID) BuiltIn InstanceId Decorate 29(gl_InstanceID) BuiltIn InstanceId
Decorate 29(gl_InstanceID) NoStaticUse Decorate 29(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

13
Test/baseResults/spv.do-while-continue-break.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 52 // Id's are bound by 52
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 25 "A" Name 25 "A"
@ -22,18 +23,8 @@ Linked vertex stage:
Name 47 "G" Name 47 "G"
Name 50 "gl_VertexID" Name 50 "gl_VertexID"
Name 51 "gl_InstanceID" Name 51 "gl_InstanceID"
Decorate 9(i) PrecisionHigh
Decorate 25(A) PrecisionHigh
Decorate 31(B) PrecisionHigh
Decorate 34(C) PrecisionHigh
Decorate 40(D) PrecisionHigh
Decorate 43(E) PrecisionHigh
Decorate 45(F) PrecisionHigh
Decorate 47(G) PrecisionHigh
Decorate 50(gl_VertexID) PrecisionHigh
Decorate 50(gl_VertexID) BuiltIn VertexId Decorate 50(gl_VertexID) BuiltIn VertexId
Decorate 50(gl_VertexID) NoStaticUse Decorate 50(gl_VertexID) NoStaticUse
Decorate 51(gl_InstanceID) PrecisionHigh
Decorate 51(gl_InstanceID) BuiltIn InstanceId Decorate 51(gl_InstanceID) BuiltIn InstanceId
Decorate 51(gl_InstanceID) NoStaticUse Decorate 51(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

4
Test/baseResults/spv.doWhileLoop.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 38 // Id's are bound by 38
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

7
Test/baseResults/spv.double.comp.out Normal file → Executable file
View File

@ -10,9 +10,10 @@ Linked compute stage:
// Id's are bound by 63 // Id's are bound by 63
Source GLSL 430 Source GLSL 430
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint GLCompute 4 EntryPoint GLCompute 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "bufName" Name 9 "bufName"
MemberName 9(bufName) 0 "f" MemberName 9(bufName) 0 "f"
@ -72,7 +73,7 @@ Linked compute stage:
57: 8(float) Constant 3229815407 1074340298 57: 8(float) Constant 3229815407 1074340298
58: TypePointer UniformConstant 8(float) 58: TypePointer UniformConstant 8(float)
59(roll): 58(ptr) Variable UniformConstant 59(roll): 58(ptr) Variable UniformConstant
60: TypeSampler7(float) 2D image 60: TypeImage 7(float) 2D nonsampled format:Unknown
61: TypePointer UniformConstant 60 61: TypePointer UniformConstant 60
62(destTex): 61(ptr) Variable UniformConstant 62(destTex): 61(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
@ -97,7 +98,7 @@ Linked compute stage:
42: 41(fvec2) ConvertSToF 40 42: 41(fvec2) ConvertSToF 40
44: 41(fvec2) CompositeConstruct 43 43 44: 41(fvec2) CompositeConstruct 43 43
45: 41(fvec2) FDiv 42 44 45: 41(fvec2) FDiv 42 44
46: 7(float) ExtInst 1(GLSL.std.450) 58(length) 45 46: 7(float) ExtInst 1(GLSL.std.450) 65(Length) 45
47: 8(float) FConvert 46 47: 8(float) FConvert 46
Store 33(localCoef) 47 Store 33(localCoef) 47
Store 50(aa) 54 Store 50(aa) 54

4
Test/baseResults/spv.earlyReturnDiscard.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 112 // Id's are bound by 112
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

4
Test/baseResults/spv.flowControl.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 42 // Id's are bound by 42
Source GLSL 120 Source GLSL 120
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

13
Test/baseResults/spv.for-continue-break.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 49 // Id's are bound by 49
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 18 "A" Name 18 "A"
@ -22,18 +23,8 @@ Linked vertex stage:
Name 44 "G" Name 44 "G"
Name 47 "gl_VertexID" Name 47 "gl_VertexID"
Name 48 "gl_InstanceID" Name 48 "gl_InstanceID"
Decorate 9(i) PrecisionHigh
Decorate 18(A) PrecisionHigh
Decorate 26(B) PrecisionHigh
Decorate 30(C) PrecisionHigh
Decorate 37(D) PrecisionHigh
Decorate 39(E) PrecisionHigh
Decorate 40(F) PrecisionHigh
Decorate 44(G) PrecisionHigh
Decorate 47(gl_VertexID) PrecisionHigh
Decorate 47(gl_VertexID) BuiltIn VertexId Decorate 47(gl_VertexID) BuiltIn VertexId
Decorate 47(gl_VertexID) NoStaticUse Decorate 47(gl_VertexID) NoStaticUse
Decorate 48(gl_InstanceID) PrecisionHigh
Decorate 48(gl_InstanceID) BuiltIn InstanceId Decorate 48(gl_InstanceID) BuiltIn InstanceId
Decorate 48(gl_InstanceID) NoStaticUse Decorate 48(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

7
Test/baseResults/spv.for-simple.vert.out Normal file → Executable file
View File

@ -8,20 +8,17 @@ Linked vertex stage:
// Id's are bound by 26 // Id's are bound by 26
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 18 "j" Name 18 "j"
Name 24 "gl_VertexID" Name 24 "gl_VertexID"
Name 25 "gl_InstanceID" Name 25 "gl_InstanceID"
Decorate 9(i) PrecisionHigh
Decorate 18(j) PrecisionHigh
Decorate 24(gl_VertexID) PrecisionHigh
Decorate 24(gl_VertexID) BuiltIn VertexId Decorate 24(gl_VertexID) BuiltIn VertexId
Decorate 24(gl_VertexID) NoStaticUse Decorate 24(gl_VertexID) NoStaticUse
Decorate 25(gl_InstanceID) PrecisionHigh
Decorate 25(gl_InstanceID) BuiltIn InstanceId Decorate 25(gl_InstanceID) BuiltIn InstanceId
Decorate 25(gl_InstanceID) NoStaticUse Decorate 25(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

4
Test/baseResults/spv.forLoop.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 123 // Id's are bound by 123
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

16
Test/baseResults/spv.forwardFun.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 59 // Id's are bound by 59
Source ESSL 100 Source ESSL 100
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 7 "bar(" Name 7 "bar("
Name 11 "unreachableReturn(" Name 11 "unreachableReturn("
@ -24,14 +26,14 @@ Linked fragment stage:
Name 37 "d" Name 37 "d"
Name 49 "dummyReturn" Name 49 "dummyReturn"
Name 58 "bigColor" Name 58 "bigColor"
Decorate 19(color) PrecisionMedium Decorate 19(color) RelaxedPrecision
Decorate 21(BaseColor) PrecisionMedium Decorate 21(BaseColor) RelaxedPrecision
Decorate 21(BaseColor) Smooth Decorate 21(BaseColor) Smooth
Decorate 28(f) PrecisionMedium Decorate 28(f) RelaxedPrecision
Decorate 31(gl_FragColor) PrecisionMedium Decorate 31(gl_FragColor) RelaxedPrecision
Decorate 31(gl_FragColor) BuiltIn FragColor Decorate 31(gl_FragColor) BuiltIn FragColor
Decorate 37(d) PrecisionMedium Decorate 37(d) RelaxedPrecision
Decorate 58(bigColor) PrecisionMedium Decorate 58(bigColor) RelaxedPrecision
Decorate 58(bigColor) NoStaticUse Decorate 58(bigColor) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2

4
Test/baseResults/spv.functionCall.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 76 // Id's are bound by 76
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 12 "foo(vf4;" Name 12 "foo(vf4;"
Name 11 "bar" Name 11 "bar"

4
Test/baseResults/spv.functionSemantics.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 159 // Id's are bound by 159
Source GLSL 400 Source GLSL 400
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 16 "foo(i1;i1;i1;i1;i1;i1;" Name 16 "foo(i1;i1;i1;i1;i1;i1;"
Name 10 "a" Name 10 "a"

4
Test/baseResults/spv.length.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 34 // Id's are bound by 34
Source GLSL 120 Source GLSL 120
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "t" Name 10 "t"
Name 15 "v" Name 15 "v"

47
Test/baseResults/spv.localAggregates.frag.out Normal file → Executable file
View File

@ -8,12 +8,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 134 // Id's are bound by 135
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "s1" Name 9 "s1"
MemberName 9(s1) 0 "i" MemberName 9(s1) 0 "i"
@ -40,16 +42,16 @@ Linked fragment stage:
Name 87 "condition" Name 87 "condition"
Name 95 "color" Name 95 "color"
Name 105 "gl_FragColor" Name 105 "gl_FragColor"
Name 124 "sampler" Name 125 "sampler"
Name 130 "foo" Name 131 "foo"
Name 131 "foo2" Name 132 "foo2"
Name 133 "uFloatArray" Name 134 "uFloatArray"
Decorate 41(coord) Smooth Decorate 41(coord) Smooth
Decorate 95(color) Smooth Decorate 95(color) Smooth
Decorate 105(gl_FragColor) BuiltIn FragColor Decorate 105(gl_FragColor) BuiltIn FragColor
Decorate 130(foo) NoStaticUse Decorate 131(foo) NoStaticUse
Decorate 131(foo2) NoStaticUse Decorate 132(foo2) NoStaticUse
Decorate 133(uFloatArray) NoStaticUse Decorate 134(uFloatArray) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 1 7: TypeInt 32 1
@ -91,14 +93,15 @@ Linked fragment stage:
97: TypePointer Function 10(fvec4) 97: TypePointer Function 10(fvec4)
104: TypePointer Output 10(fvec4) 104: TypePointer Output 10(fvec4)
105(gl_FragColor): 104(ptr) Variable Output 105(gl_FragColor): 104(ptr) Variable Output
122: TypeSampler8(float) 2D filter+texture 122: TypeImage 8(float) 2D sampled format:Unknown
123: TypePointer UniformConstant 122 123: TypeSampledImage 122
124(sampler): 123(ptr) Variable UniformConstant 124: TypePointer UniformConstant 123
129: TypePointer UniformConstant 9(s1) 125(sampler): 124(ptr) Variable UniformConstant
130(foo): 129(ptr) Variable UniformConstant 130: TypePointer UniformConstant 9(s1)
131(foo2): 18(ptr) Variable UniformConstant 131(foo): 130(ptr) Variable UniformConstant
132: TypePointer UniformConstant 35 132(foo2): 18(ptr) Variable UniformConstant
133(uFloatArray): 132(ptr) Variable UniformConstant 133: TypePointer UniformConstant 35
134(uFloatArray): 133(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
13(locals2): 12(ptr) Variable Function 13(locals2): 12(ptr) Variable Function
@ -207,11 +210,11 @@ Linked fragment stage:
119: 8(float) Load 118 119: 8(float) Load 118
120: 8(float) FAdd 116 119 120: 8(float) FAdd 116 119
121: 10(fvec4) VectorTimesScalar 107 120 121: 10(fvec4) VectorTimesScalar 107 120
125: 122 Load 124(sampler) 126: 123 Load 125(sampler)
126: 39(fvec2) Load 41(coord) 127: 39(fvec2) Load 41(coord)
127: 10(fvec4) TextureSample 125 126 128: 10(fvec4) ImageSampleImplicitLod 126 127
128: 10(fvec4) FMul 121 127 129: 10(fvec4) FMul 121 128
Store 105(gl_FragColor) 128 Store 105(gl_FragColor) 129
Branch 6 Branch 6
6: Label 6: Label
Return Return

4
Test/baseResults/spv.loops.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 750 // Id's are bound by 750
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

4
Test/baseResults/spv.loopsArtificial.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 196 // Id's are bound by 196
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

3
Test/baseResults/spv.matFun.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 94 // Id's are bound by 94
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 15 "xf(mf33;vf3;" Name 15 "xf(mf33;vf3;"
Name 13 "m" Name 13 "m"

3
Test/baseResults/spv.nonSquare.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 91 // Id's are bound by 91
Source GLSL 120 Source GLSL 120
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 10 "a" Name 10 "a"
Name 13 "v3" Name 13 "v3"

32
Test/baseResults/spv.precision.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 111 // Id's are bound by 111
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 13 "foo(vf3;" Name 13 "foo(vf3;"
Name 12 "mv3" Name 12 "mv3"
@ -31,22 +33,18 @@ Linked fragment stage:
Name 72 "mediumfout" Name 72 "mediumfout"
Name 101 "ub2" Name 101 "ub2"
Name 102 "param" Name 102 "param"
Decorate 24(highfin) PrecisionHigh
Decorate 24(highfin) Smooth Decorate 24(highfin) Smooth
Decorate 37(sum) PrecisionLow Decorate 37(sum) RelaxedPrecision
Decorate 39(uniform_medium) PrecisionMedium Decorate 39(uniform_medium) RelaxedPrecision
Decorate 41(uniform_high) PrecisionHigh Decorate 47(uniform_low) RelaxedPrecision
Decorate 47(uniform_low) PrecisionLow Decorate 52(arg1) RelaxedPrecision
Decorate 52(arg1) PrecisionLow Decorate 54(arg2) RelaxedPrecision
Decorate 54(arg2) PrecisionMedium Decorate 56(d) RelaxedPrecision
Decorate 56(d) PrecisionLow Decorate 58(lowfin) RelaxedPrecision
Decorate 58(lowfin) PrecisionLow
Decorate 58(lowfin) Smooth Decorate 58(lowfin) Smooth
Decorate 60(mediumfin) PrecisionMedium Decorate 60(mediumfin) RelaxedPrecision
Decorate 60(mediumfin) Smooth Decorate 60(mediumfin) Smooth
Decorate 64(global_highp) PrecisionHigh Decorate 72(mediumfout) RelaxedPrecision
Decorate 68(local_highp) PrecisionHigh
Decorate 72(mediumfout) PrecisionMedium
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -110,16 +108,16 @@ Linked fragment stage:
Store 54(arg2) 55 Store 54(arg2) 55
59: 7(float) Load 58(lowfin) 59: 7(float) Load 58(lowfin)
61: 7(float) Load 60(mediumfin) 61: 7(float) Load 60(mediumfin)
62: 7(float) ExtInst 1(GLSL.std.450) 59(distance) 59 61 62: 7(float) ExtInst 1(GLSL.std.450) 66(Distance) 59 61
Store 56(d) 62 Store 56(d) 62
65: 22(fvec4) Load 24(highfin) 65: 22(fvec4) Load 24(highfin)
66: 7(float) ExtInst 1(GLSL.std.450) 58(length) 65 66: 7(float) ExtInst 1(GLSL.std.450) 65(Length) 65
Store 64(global_highp) 66 Store 64(global_highp) 66
69: 7(float) Load 64(global_highp) 69: 7(float) Load 64(global_highp)
70: 22(fvec4) CompositeConstruct 69 69 69 69 70: 22(fvec4) CompositeConstruct 69 69 69 69
Store 68(local_highp) 70 Store 68(local_highp) 70
73: 7(float) Load 56(d) 73: 7(float) Load 56(d)
74: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 73 74: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 73
75: 22(fvec4) CompositeConstruct 74 74 74 74 75: 22(fvec4) CompositeConstruct 74 74 74 74
76: 7(float) Load 54(arg2) 76: 7(float) Load 54(arg2)
77: 22(fvec4) CompositeConstruct 76 76 76 76 77: 22(fvec4) CompositeConstruct 76 76 76 76

4
Test/baseResults/spv.prepost.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 97 // Id's are bound by 97
Source GLSL 140 Source GLSL 140
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "index" Name 9 "index"
Name 15 "s" Name 15 "s"

3
Test/baseResults/spv.qualifiers.vert.out Normal file → Executable file
View File

@ -10,9 +10,10 @@ Linked vertex stage:
// Id's are bound by 26 // Id's are bound by 26
Source GLSL 430 Source GLSL 430
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 10 "outVc" Name 10 "outVc"
Name 12 "inV" Name 12 "inV"

38
Test/baseResults/spv.set.vert.out Normal file → Executable file
View File

@ -7,32 +7,33 @@ Linked vertex stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 25 // Id's are bound by 26
Source GLSL 450 Source GLSL 450
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 11 "setBuf" Name 11 "setBuf"
MemberName 11(setBuf) 0 "color" MemberName 11(setBuf) 0 "color"
Name 13 "setBufInst" Name 13 "setBufInst"
Name 21 "sampler" Name 22 "sampler"
Name 23 "gl_VertexID" Name 24 "gl_VertexID"
Name 24 "gl_InstanceID" Name 25 "gl_InstanceID"
Decorate 10(color) Smooth Decorate 10(color) Smooth
Decorate 11(setBuf) GLSLShared Decorate 11(setBuf) GLSLShared
Decorate 11(setBuf) BufferBlock Decorate 11(setBuf) BufferBlock
Decorate 13(setBufInst) DescriptorSet 0 Decorate 13(setBufInst) DescriptorSet 0
Decorate 13(setBufInst) Binding 8 Decorate 13(setBufInst) Binding 8
Decorate 21(sampler) DescriptorSet 4 Decorate 22(sampler) DescriptorSet 4
Decorate 21(sampler) Binding 7 Decorate 22(sampler) Binding 7
Decorate 21(sampler) NoStaticUse Decorate 22(sampler) NoStaticUse
Decorate 23(gl_VertexID) BuiltIn VertexId Decorate 24(gl_VertexID) BuiltIn VertexId
Decorate 23(gl_VertexID) NoStaticUse Decorate 24(gl_VertexID) NoStaticUse
Decorate 24(gl_InstanceID) BuiltIn InstanceId Decorate 25(gl_InstanceID) BuiltIn InstanceId
Decorate 24(gl_InstanceID) NoStaticUse Decorate 25(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -45,12 +46,13 @@ Linked vertex stage:
14: TypeInt 32 1 14: TypeInt 32 1
15: 14(int) Constant 0 15: 14(int) Constant 0
16: TypePointer Uniform 8(fvec4) 16: TypePointer Uniform 8(fvec4)
19: TypeSampler7(float) 2D filter+texture 19: TypeImage 7(float) 2D sampled format:Unknown
20: TypePointer UniformConstant 19 20: TypeSampledImage 19
21(sampler): 20(ptr) Variable UniformConstant 21: TypePointer UniformConstant 20
22: TypePointer Input 14(int) 22(sampler): 21(ptr) Variable UniformConstant
23(gl_VertexID): 22(ptr) Variable Input 23: TypePointer Input 14(int)
24(gl_InstanceID): 22(ptr) Variable Input 24(gl_VertexID): 23(ptr) Variable Input
25(gl_InstanceID): 23(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
17: 16(ptr) AccessChain 13(setBufInst) 15 17: 16(ptr) AccessChain 13(setBufInst) 15

4
Test/baseResults/spv.simpleFunctionCall.frag.out Normal file → Executable file
View File

@ -10,9 +10,11 @@ Linked fragment stage:
// Id's are bound by 23 // Id's are bound by 23
Source GLSL 150 Source GLSL 150
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "foo(" Name 10 "foo("
Name 13 "BaseColor" Name 13 "BaseColor"

3
Test/baseResults/spv.simpleMat.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 44 // Id's are bound by 44
Source GLSL 330 Source GLSL 330
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 10 "glPos" Name 10 "glPos"
Name 13 "mvp" Name 13 "mvp"

43
Test/baseResults/spv.structAssignment.frag.out Normal file → Executable file
View File

@ -7,12 +7,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 50 // Id's are bound by 51
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "lunarStruct1" Name 9 "lunarStruct1"
MemberName 9(lunarStruct1) 0 "i" MemberName 9(lunarStruct1) 0 "i"
@ -30,12 +32,12 @@ Linked fragment stage:
Name 23 "locals2" Name 23 "locals2"
Name 28 "foo2" Name 28 "foo2"
Name 32 "gl_FragColor" Name 32 "gl_FragColor"
Name 40 "sampler" Name 41 "sampler"
Name 44 "coord" Name 45 "coord"
Name 49 "foo" Name 50 "foo"
Decorate 32(gl_FragColor) BuiltIn FragColor Decorate 32(gl_FragColor) BuiltIn FragColor
Decorate 44(coord) Smooth Decorate 45(coord) Smooth
Decorate 49(foo) NoStaticUse Decorate 50(foo) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 1 7: TypeInt 32 1
@ -57,14 +59,15 @@ Linked fragment stage:
33: 7(int) Constant 2 33: 7(int) Constant 2
34: 7(int) Constant 1 34: 7(int) Constant 1
35: TypePointer Function 8(float) 35: TypePointer Function 8(float)
38: TypeSampler8(float) 2D filter+texture 38: TypeImage 8(float) 2D sampled format:Unknown
39: TypePointer UniformConstant 38 39: TypeSampledImage 38
40(sampler): 39(ptr) Variable UniformConstant 40: TypePointer UniformConstant 39
42: TypeVector 8(float) 2 41(sampler): 40(ptr) Variable UniformConstant
43: TypePointer Input 42(fvec2) 43: TypeVector 8(float) 2
44(coord): 43(ptr) Variable Input 44: TypePointer Input 43(fvec2)
48: TypePointer UniformConstant 9(lunarStruct1) 45(coord): 44(ptr) Variable Input
49(foo): 48(ptr) Variable UniformConstant 49: TypePointer UniformConstant 9(lunarStruct1)
50(foo): 49(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
23(locals2): 22(ptr) Variable Function 23(locals2): 22(ptr) Variable Function
@ -85,11 +88,11 @@ Linked fragment stage:
21: Label 21: Label
36: 35(ptr) AccessChain 23(locals2) 33 34 36: 35(ptr) AccessChain 23(locals2) 33 34
37: 8(float) Load 36 37: 8(float) Load 36
41: 38 Load 40(sampler) 42: 39 Load 41(sampler)
45: 42(fvec2) Load 44(coord) 46: 43(fvec2) Load 45(coord)
46: 30(fvec4) TextureSample 41 45 47: 30(fvec4) ImageSampleImplicitLod 42 46
47: 30(fvec4) VectorTimesScalar 46 37 48: 30(fvec4) VectorTimesScalar 47 37
Store 32(gl_FragColor) 47 Store 32(gl_FragColor) 48
Branch 6 Branch 6
6: Label 6: Label
Return Return

33
Test/baseResults/spv.structDeref.frag.out Normal file → Executable file
View File

@ -7,12 +7,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 120 // Id's are bound by 121
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "s0" Name 9 "s0"
MemberName 9(s0) 0 "i" MemberName 9(s0) 0 "i"
@ -42,11 +44,11 @@ Linked fragment stage:
Name 69 "foo0" Name 69 "foo0"
Name 84 "foo00" Name 84 "foo00"
Name 97 "gl_FragColor" Name 97 "gl_FragColor"
Name 113 "sampler" Name 114 "sampler"
Name 119 "foo2" Name 120 "foo2"
Decorate 62(coord) Smooth Decorate 62(coord) Smooth
Decorate 97(gl_FragColor) BuiltIn FragColor Decorate 97(gl_FragColor) BuiltIn FragColor
Decorate 119(foo2) NoStaticUse Decorate 120(foo2) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 1 7: TypeInt 32 1
@ -105,11 +107,12 @@ Linked fragment stage:
96: TypePointer Output 95(fvec4) 96: TypePointer Output 95(fvec4)
97(gl_FragColor): 96(ptr) Variable Output 97(gl_FragColor): 96(ptr) Variable Output
104: 7(int) Constant 3 104: 7(int) Constant 3
111: TypeSampler8(float) 2D filter+texture 111: TypeImage 8(float) 2D sampled format:Unknown
112: TypePointer UniformConstant 111 112: TypeSampledImage 111
113(sampler): 112(ptr) Variable UniformConstant 113: TypePointer UniformConstant 112
118: TypePointer UniformConstant 11(s2) 114(sampler): 113(ptr) Variable UniformConstant
119(foo2): 118(ptr) Variable UniformConstant 119: TypePointer UniformConstant 11(s2)
120(foo2): 119(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
28(locals2): 27(ptr) Variable Function 28(locals2): 27(ptr) Variable Function
@ -180,11 +183,11 @@ Linked fragment stage:
108: 31(ptr) AccessChain 28(locals2) 33 29 108: 31(ptr) AccessChain 28(locals2) 33 29
109: 8(float) Load 108 109: 8(float) Load 108
110: 8(float) FAdd 107 109 110: 8(float) FAdd 107 109
114: 111 Load 113(sampler) 115: 112 Load 114(sampler)
115: 60(fvec2) Load 62(coord) 116: 60(fvec2) Load 62(coord)
116: 95(fvec4) TextureSample 114 115 117: 95(fvec4) ImageSampleImplicitLod 115 116
117: 95(fvec4) VectorTimesScalar 116 110 118: 95(fvec4) VectorTimesScalar 117 110
Store 97(gl_FragColor) 117 Store 97(gl_FragColor) 118
Branch 6 Branch 6
6: Label 6: Label
Return Return

43
Test/baseResults/spv.structure.frag.out Normal file → Executable file
View File

@ -7,12 +7,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 61 // Id's are bound by 62
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "scale" Name 9 "scale"
Name 19 "lunarStruct1" Name 19 "lunarStruct1"
@ -25,12 +27,12 @@ Linked fragment stage:
MemberName 22(lunarStruct2) 2 "s1_1" MemberName 22(lunarStruct2) 2 "s1_1"
Name 25 "foo2" Name 25 "foo2"
Name 47 "gl_FragColor" Name 47 "gl_FragColor"
Name 51 "sampler" Name 52 "sampler"
Name 55 "coord" Name 56 "coord"
Name 60 "foo" Name 61 "foo"
Decorate 47(gl_FragColor) BuiltIn FragColor Decorate 47(gl_FragColor) BuiltIn FragColor
Decorate 55(coord) Smooth Decorate 56(coord) Smooth
Decorate 60(foo) NoStaticUse Decorate 61(foo) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -62,14 +64,15 @@ Linked fragment stage:
43: TypePointer UniformConstant 7(float) 43: TypePointer UniformConstant 7(float)
46: TypePointer Output 17(fvec4) 46: TypePointer Output 17(fvec4)
47(gl_FragColor): 46(ptr) Variable Output 47(gl_FragColor): 46(ptr) Variable Output
49: TypeSampler7(float) 2D filter+texture 49: TypeImage 7(float) 2D sampled format:Unknown
50: TypePointer UniformConstant 49 50: TypeSampledImage 49
51(sampler): 50(ptr) Variable UniformConstant 51: TypePointer UniformConstant 50
53: TypeVector 7(float) 2 52(sampler): 51(ptr) Variable UniformConstant
54: TypePointer Input 53(fvec2) 54: TypeVector 7(float) 2
55(coord): 54(ptr) Variable Input 55: TypePointer Input 54(fvec2)
59: TypePointer UniformConstant 19(lunarStruct1) 56(coord): 55(ptr) Variable Input
60(foo): 59(ptr) Variable UniformConstant 60: TypePointer UniformConstant 19(lunarStruct1)
61(foo): 60(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(scale): 8(ptr) Variable Function 9(scale): 8(ptr) Variable Function
@ -92,11 +95,11 @@ Linked fragment stage:
Branch 35 Branch 35
35: Label 35: Label
48: 7(float) Load 9(scale) 48: 7(float) Load 9(scale)
52: 49 Load 51(sampler) 53: 50 Load 52(sampler)
56: 53(fvec2) Load 55(coord) 57: 54(fvec2) Load 56(coord)
57: 17(fvec4) TextureSample 52 56 58: 17(fvec4) ImageSampleImplicitLod 53 57
58: 17(fvec4) VectorTimesScalar 57 48 59: 17(fvec4) VectorTimesScalar 58 48
Store 47(gl_FragColor) 58 Store 47(gl_FragColor) 59
Branch 6 Branch 6
6: Label 6: Label
Return Return

50
Test/baseResults/spv.switch.frag.out Normal file → Executable file
View File

@ -13,9 +13,11 @@ Linked fragment stage:
// Id's are bound by 261 // Id's are bound by 261
Source ESSL 310 Source ESSL 310
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 16 "foo1(vf4;vf4;i1;" Name 16 "foo1(vf4;vf4;i1;"
Name 13 "v1" Name 13 "v1"
@ -40,16 +42,16 @@ Linked fragment stage:
Name 239 "param" Name 239 "param"
Name 241 "param" Name 241 "param"
Name 243 "param" Name 243 "param"
Decorate 59(local) PrecisionMedium Decorate 59(local) RelaxedPrecision
Decorate 61(c) PrecisionMedium Decorate 61(c) RelaxedPrecision
Decorate 72(f) PrecisionMedium Decorate 72(f) RelaxedPrecision
Decorate 74(x) PrecisionMedium Decorate 74(x) RelaxedPrecision
Decorate 74(x) Smooth Decorate 74(x) Smooth
Decorate 128(d) PrecisionMedium Decorate 128(d) RelaxedPrecision
Decorate 154(i) PrecisionMedium Decorate 154(i) RelaxedPrecision
Decorate 172(j) PrecisionMedium Decorate 172(j) RelaxedPrecision
Decorate 222(color) PrecisionMedium Decorate 222(color) RelaxedPrecision
Decorate 228(v) PrecisionMedium Decorate 228(v) RelaxedPrecision
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -104,17 +106,17 @@ Linked fragment stage:
case 2: 68 case 2: 68
67: Label 67: Label
75: 7(float) Load 74(x) 75: 7(float) Load 74(x)
76: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 75 76: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 75
Store 72(f) 76 Store 72(f) 76
Branch 70 Branch 70
68: Label 68: Label
78: 7(float) Load 74(x) 78: 7(float) Load 74(x)
79: 7(float) ExtInst 1(GLSL.std.450) 11(cos) 78 79: 7(float) ExtInst 1(GLSL.std.450) 14(Cos) 78
Store 72(f) 79 Store 72(f) 79
Branch 70 Branch 70
69: Label 69: Label
81: 7(float) Load 74(x) 81: 7(float) Load 74(x)
82: 7(float) ExtInst 1(GLSL.std.450) 12(tan) 81 82: 7(float) ExtInst 1(GLSL.std.450) 15(Tan) 81
Store 72(f) 82 Store 72(f) 82
Branch 70 Branch 70
70: Label 70: Label
@ -125,21 +127,21 @@ Linked fragment stage:
case 2: 86 case 2: 86
85: Label 85: Label
89: 7(float) Load 74(x) 89: 7(float) Load 74(x)
90: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 89 90: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 89
91: 7(float) Load 72(f) 91: 7(float) Load 72(f)
92: 7(float) FAdd 91 90 92: 7(float) FAdd 91 90
Store 72(f) 92 Store 72(f) 92
Branch 86 Branch 86
86: Label 86: Label
93: 7(float) Load 74(x) 93: 7(float) Load 74(x)
94: 7(float) ExtInst 1(GLSL.std.450) 11(cos) 93 94: 7(float) ExtInst 1(GLSL.std.450) 14(Cos) 93
95: 7(float) Load 72(f) 95: 7(float) Load 72(f)
96: 7(float) FAdd 95 94 96: 7(float) FAdd 95 94
Store 72(f) 96 Store 72(f) 96
Branch 88 Branch 88
87: Label 87: Label
98: 7(float) Load 74(x) 98: 7(float) Load 74(x)
99: 7(float) ExtInst 1(GLSL.std.450) 12(tan) 98 99: 7(float) ExtInst 1(GLSL.std.450) 15(Tan) 98
100: 7(float) Load 72(f) 100: 7(float) Load 72(f)
101: 7(float) FAdd 100 99 101: 7(float) FAdd 100 99
Store 72(f) 101 Store 72(f) 101
@ -152,14 +154,14 @@ Linked fragment stage:
case 2: 105 case 2: 105
104: Label 104: Label
107: 7(float) Load 74(x) 107: 7(float) Load 74(x)
108: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 107 108: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 107
109: 7(float) Load 72(f) 109: 7(float) Load 72(f)
110: 7(float) FAdd 109 108 110: 7(float) FAdd 109 108
Store 72(f) 110 Store 72(f) 110
Branch 106 Branch 106
105: Label 105: Label
112: 7(float) Load 74(x) 112: 7(float) Load 74(x)
113: 7(float) ExtInst 1(GLSL.std.450) 11(cos) 112 113: 7(float) ExtInst 1(GLSL.std.450) 14(Cos) 112
114: 7(float) Load 72(f) 114: 7(float) Load 72(f)
115: 7(float) FAdd 114 113 115: 7(float) FAdd 114 113
Store 72(f) 115 Store 72(f) 115
@ -172,7 +174,7 @@ Linked fragment stage:
case 2: 120 case 2: 120
119: Label 119: Label
123: 7(float) Load 74(x) 123: 7(float) Load 74(x)
124: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 123 124: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 123
125: 7(float) Load 72(f) 125: 7(float) Load 72(f)
126: 7(float) FAdd 125 124 126: 7(float) FAdd 125 124
Store 72(f) 126 Store 72(f) 126
@ -205,7 +207,7 @@ Linked fragment stage:
Branch 122 Branch 122
121: Label 121: Label
149: 7(float) Load 74(x) 149: 7(float) Load 74(x)
150: 7(float) ExtInst 1(GLSL.std.450) 12(tan) 149 150: 7(float) ExtInst 1(GLSL.std.450) 15(Tan) 149
151: 7(float) Load 72(f) 151: 7(float) Load 72(f)
152: 7(float) FAdd 151 150 152: 7(float) FAdd 151 150
Store 72(f) 152 Store 72(f) 152
@ -226,7 +228,7 @@ Linked fragment stage:
case 2: 165 case 2: 165
164: Label 164: Label
168: 7(float) Load 74(x) 168: 7(float) Load 74(x)
169: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 168 169: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 168
170: 7(float) Load 72(f) 170: 7(float) Load 72(f)
171: 7(float) FAdd 170 169 171: 7(float) FAdd 170 169
Store 72(f) 171 Store 72(f) 171
@ -256,14 +258,14 @@ Linked fragment stage:
Branch 167 Branch 167
165: Label 165: Label
191: 7(float) Load 74(x) 191: 7(float) Load 74(x)
192: 7(float) ExtInst 1(GLSL.std.450) 11(cos) 191 192: 7(float) ExtInst 1(GLSL.std.450) 14(Cos) 191
193: 7(float) Load 72(f) 193: 7(float) Load 72(f)
194: 7(float) FAdd 193 192 194: 7(float) FAdd 193 192
Store 72(f) 194 Store 72(f) 194
Branch 167 Branch 167
166: Label 166: Label
197: 7(float) Load 74(x) 197: 7(float) Load 74(x)
198: 7(float) ExtInst 1(GLSL.std.450) 12(tan) 197 198: 7(float) ExtInst 1(GLSL.std.450) 15(Tan) 197
199: 7(float) Load 72(f) 199: 7(float) Load 72(f)
200: 7(float) FAdd 199 198 200: 7(float) FAdd 199 198
Store 72(f) 200 Store 72(f) 200
@ -288,7 +290,7 @@ Linked fragment stage:
case 2: 212 case 2: 212
211: Label 211: Label
214: 7(float) Load 74(x) 214: 7(float) Load 74(x)
215: 7(float) ExtInst 1(GLSL.std.450) 10(sin) 214 215: 7(float) ExtInst 1(GLSL.std.450) 13(Sin) 214
216: 7(float) Load 72(f) 216: 7(float) Load 72(f)
217: 7(float) FAdd 216 215 217: 7(float) FAdd 216 215
Store 72(f) 217 Store 72(f) 217

6
Test/baseResults/spv.swizzle.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 112 // Id's are bound by 112
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "blendscale" Name 9 "blendscale"
Name 13 "w" Name 13 "w"
@ -136,7 +138,7 @@ Linked fragment stage:
77: 11(fvec4) FMul 75 76 77: 11(fvec4) FMul 75 76
78: 11(fvec4) Load 23(w_flow) 78: 11(fvec4) Load 23(w_flow)
79: 11(fvec4) FMul 77 78 79: 11(fvec4) FMul 77 78
80: 11(fvec4) ExtInst 1(GLSL.std.450) 36(mix) 71 72 79 80: 11(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 71 72 79
Store 70(gl_FragColor) 80 Store 70(gl_FragColor) 80
83: 28(fvec2) Load 30(t) 83: 28(fvec2) Load 30(t)
Store 82(c) 83 Store 82(c) 83

118
Test/baseResults/spv.test.frag.out Normal file → Executable file
View File

@ -5,27 +5,29 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 54 // Id's are bound by 56
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "blendscale" Name 9 "blendscale"
Name 13 "v" Name 13 "v"
Name 16 "texSampler2D" Name 17 "texSampler2D"
Name 20 "t" Name 21 "t"
Name 23 "scale" Name 24 "scale"
Name 30 "w" Name 31 "w"
Name 33 "texSampler3D" Name 35 "texSampler3D"
Name 37 "coords" Name 39 "coords"
Name 43 "gl_FragColor" Name 45 "gl_FragColor"
Name 46 "u" Name 48 "u"
Name 49 "blend" Name 51 "blend"
Decorate 20(t) Smooth Decorate 21(t) Smooth
Decorate 37(coords) Smooth Decorate 39(coords) Smooth
Decorate 43(gl_FragColor) BuiltIn FragColor Decorate 45(gl_FragColor) BuiltIn FragColor
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -33,54 +35,56 @@ Linked fragment stage:
10: 7(float) Constant 1071971828 10: 7(float) Constant 1071971828
11: TypeVector 7(float) 4 11: TypeVector 7(float) 4
12: TypePointer Function 11(fvec4) 12: TypePointer Function 11(fvec4)
14: TypeSampler7(float) 2D filter+texture 14: TypeImage 7(float) 2D sampled format:Unknown
15: TypePointer UniformConstant 14 15: TypeSampledImage 14
16(texSampler2D): 15(ptr) Variable UniformConstant 16: TypePointer UniformConstant 15
18: TypeVector 7(float) 2 17(texSampler2D): 16(ptr) Variable UniformConstant
19: TypePointer Input 18(fvec2) 19: TypeVector 7(float) 2
20(t): 19(ptr) Variable Input 20: TypePointer Input 19(fvec2)
22: TypePointer UniformConstant 18(fvec2) 21(t): 20(ptr) Variable Input
23(scale): 22(ptr) Variable UniformConstant 23: TypePointer UniformConstant 19(fvec2)
31: TypeSampler7(float) 3D filter+texture 24(scale): 23(ptr) Variable UniformConstant
32: TypePointer UniformConstant 31 32: TypeImage 7(float) 3D sampled format:Unknown
33(texSampler3D): 32(ptr) Variable UniformConstant 33: TypeSampledImage 32
35: TypeVector 7(float) 3 34: TypePointer UniformConstant 33
36: TypePointer Input 35(fvec3) 35(texSampler3D): 34(ptr) Variable UniformConstant
37(coords): 36(ptr) Variable Input 37: TypeVector 7(float) 3
42: TypePointer Output 11(fvec4) 38: TypePointer Input 37(fvec3)
43(gl_FragColor): 42(ptr) Variable Output 39(coords): 38(ptr) Variable Input
45: TypePointer UniformConstant 11(fvec4) 44: TypePointer Output 11(fvec4)
46(u): 45(ptr) Variable UniformConstant 45(gl_FragColor): 44(ptr) Variable Output
48: TypePointer UniformConstant 7(float) 47: TypePointer UniformConstant 11(fvec4)
49(blend): 48(ptr) Variable UniformConstant 48(u): 47(ptr) Variable UniformConstant
50: TypePointer UniformConstant 7(float)
51(blend): 50(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(blendscale): 8(ptr) Variable Function 9(blendscale): 8(ptr) Variable Function
13(v): 12(ptr) Variable Function 13(v): 12(ptr) Variable Function
30(w): 12(ptr) Variable Function 31(w): 12(ptr) Variable Function
Store 9(blendscale) 10 Store 9(blendscale) 10
17: 14 Load 16(texSampler2D) 18: 15 Load 17(texSampler2D)
21: 18(fvec2) Load 20(t) 22: 19(fvec2) Load 21(t)
24: 18(fvec2) Load 23(scale) 25: 19(fvec2) Load 24(scale)
25: 18(fvec2) FAdd 21 24 26: 19(fvec2) FAdd 22 25
26: 18(fvec2) Load 23(scale) 27: 19(fvec2) Load 24(scale)
27: 18(fvec2) FDiv 25 26 28: 19(fvec2) FDiv 26 27
28: 11(fvec4) TextureSample 17 27 29: 11(fvec4) ImageSampleImplicitLod 18 28
29: 11(fvec4) VectorShuffle 28 28 3 2 1 0 30: 11(fvec4) VectorShuffle 29 29 3 2 1 0
Store 13(v) 29 Store 13(v) 30
34: 31 Load 33(texSampler3D) 36: 33 Load 35(texSampler3D)
38: 35(fvec3) Load 37(coords) 40: 37(fvec3) Load 39(coords)
39: 11(fvec4) TextureSample 34 38 41: 11(fvec4) ImageSampleImplicitLod 36 40
40: 11(fvec4) Load 13(v) 42: 11(fvec4) Load 13(v)
41: 11(fvec4) FAdd 39 40 43: 11(fvec4) FAdd 41 42
Store 30(w) 41 Store 31(w) 43
44: 11(fvec4) Load 30(w) 46: 11(fvec4) Load 31(w)
47: 11(fvec4) Load 46(u) 49: 11(fvec4) Load 48(u)
50: 7(float) Load 49(blend) 52: 7(float) Load 51(blend)
51: 7(float) Load 9(blendscale) 53: 7(float) Load 9(blendscale)
52: 7(float) FMul 50 51 54: 7(float) FMul 52 53
53: 11(fvec4) ExtInst 1(GLSL.std.450) 36(mix) 44 47 52 55: 11(fvec4) ExtInst 1(GLSL.std.450) 46(Mix) 46 49 54
Store 43(gl_FragColor) 53 Store 45(gl_FragColor) 55
Branch 6 Branch 6
6: Label 6: Label
Return Return

277
Test/baseResults/spv.texture.vert.out Normal file → Executable file
View File

@ -5,30 +5,31 @@ Linked vertex stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 132 // Id's are bound by 142
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "lod" Name 9 "lod"
Name 11 "coords1D" Name 11 "coords1D"
Name 15 "coords3D" Name 15 "coords3D"
Name 21 "coords4D" Name 21 "coords4D"
Name 24 "color" Name 24 "color"
Name 29 "texSampler1D" Name 30 "texSampler1D"
Name 39 "coords2D" Name 40 "coords2D"
Name 53 "texSampler2D" Name 55 "texSampler2D"
Name 74 "texSampler3D" Name 77 "texSampler3D"
Name 89 "texSamplerCube" Name 93 "texSamplerCube"
Name 98 "shadowSampler1D" Name 103 "shadowSampler1D"
Name 107 "shadowSampler2D" Name 114 "shadowSampler2D"
Name 127 "gl_Position" Name 137 "gl_Position"
Name 131 "gl_VertexID" Name 141 "gl_VertexID"
Decorate 127(gl_Position) BuiltIn Position Decorate 137(gl_Position) BuiltIn Position
Decorate 131(gl_VertexID) BuiltIn VertexId Decorate 141(gl_VertexID) BuiltIn VertexId
Decorate 131(gl_VertexID) NoStaticUse Decorate 141(gl_VertexID) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -46,32 +47,38 @@ Linked vertex stage:
23: 19(fvec4) ConstantComposite 12 16 17 22 23: 19(fvec4) ConstantComposite 12 16 17 22
25: 7(float) Constant 0 25: 7(float) Constant 0
26: 19(fvec4) ConstantComposite 25 25 25 25 26: 19(fvec4) ConstantComposite 25 25 25 25
27: TypeSampler7(float) 1D filter+texture 27: TypeImage 7(float) 1D sampled format:Unknown
28: TypePointer UniformConstant 27 28: TypeSampledImage 27
29(texSampler1D): 28(ptr) Variable UniformConstant 29: TypePointer UniformConstant 28
37: TypeVector 7(float) 2 30(texSampler1D): 29(ptr) Variable UniformConstant
38: TypePointer Input 37(fvec2) 38: TypeVector 7(float) 2
39(coords2D): 38(ptr) Variable Input 39: TypePointer Input 38(fvec2)
51: TypeSampler7(float) 2D filter+texture 40(coords2D): 39(ptr) Variable Input
52: TypePointer UniformConstant 51 52: TypeImage 7(float) 2D sampled format:Unknown
53(texSampler2D): 52(ptr) Variable UniformConstant 53: TypeSampledImage 52
72: TypeSampler7(float) 3D filter+texture 54: TypePointer UniformConstant 53
73: TypePointer UniformConstant 72 55(texSampler2D): 54(ptr) Variable UniformConstant
74(texSampler3D): 73(ptr) Variable UniformConstant 74: TypeImage 7(float) 3D sampled format:Unknown
87: TypeSampler7(float) Cube filter+texture 75: TypeSampledImage 74
88: TypePointer UniformConstant 87 76: TypePointer UniformConstant 75
89(texSamplerCube): 88(ptr) Variable UniformConstant 77(texSampler3D): 76(ptr) Variable UniformConstant
96: TypeSampler7(float) 1D filter+texture depth 90: TypeImage 7(float) Cube sampled format:Unknown
97: TypePointer UniformConstant 96 91: TypeSampledImage 90
98(shadowSampler1D): 97(ptr) Variable UniformConstant 92: TypePointer UniformConstant 91
105: TypeSampler7(float) 2D filter+texture depth 93(texSamplerCube): 92(ptr) Variable UniformConstant
106: TypePointer UniformConstant 105 100: TypeImage 7(float) 1D depth sampled format:Unknown
107(shadowSampler2D): 106(ptr) Variable UniformConstant 101: TypeSampledImage 100
126: TypePointer Output 19(fvec4) 102: TypePointer UniformConstant 101
127(gl_Position): 126(ptr) Variable Output 103(shadowSampler1D): 102(ptr) Variable UniformConstant
129: TypeInt 32 1 111: TypeImage 7(float) 2D depth sampled format:Unknown
130: TypePointer Input 129(int) 112: TypeSampledImage 111
131(gl_VertexID): 130(ptr) Variable Input 113: TypePointer UniformConstant 112
114(shadowSampler2D): 113(ptr) Variable UniformConstant
136: TypePointer Output 19(fvec4)
137(gl_Position): 136(ptr) Variable Output
139: TypeInt 32 1
140: TypePointer Input 139(int)
141(gl_VertexID): 140(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(lod): 8(ptr) Variable Function 9(lod): 8(ptr) Variable Function
@ -84,99 +91,103 @@ Linked vertex stage:
Store 15(coords3D) 18 Store 15(coords3D) 18
Store 21(coords4D) 23 Store 21(coords4D) 23
Store 24(color) 26 Store 24(color) 26
30: 27 Load 29(texSampler1D) 31: 28 Load 30(texSampler1D)
31: 7(float) Load 11(coords1D) 32: 7(float) Load 11(coords1D)
32: 7(float) Load 9(lod) 33: 7(float) Load 9(lod)
33: 19(fvec4) TextureSampleLod 30 31 32 34: 19(fvec4) ImageSampleExplicitLod 31 32 33
34: 19(fvec4) Load 24(color) 35: 19(fvec4) Load 24(color)
35: 19(fvec4) FAdd 34 33 36: 19(fvec4) FAdd 35 34
Store 24(color) 35 Store 24(color) 36
36: 27 Load 29(texSampler1D) 37: 28 Load 30(texSampler1D)
40: 37(fvec2) Load 39(coords2D) 41: 38(fvec2) Load 40(coords2D)
41: 7(float) Load 9(lod) 42: 7(float) Load 9(lod)
42: 19(fvec4) TextureSampleProjLod 36 40 41 43: 19(fvec4) ImageSampleProjExplicitLod 37 41 42
43: 19(fvec4) Load 24(color) 44: 19(fvec4) Load 24(color)
44: 19(fvec4) FAdd 43 42 45: 19(fvec4) FAdd 44 43
Store 24(color) 44 Store 24(color) 45
45: 27 Load 29(texSampler1D) 46: 28 Load 30(texSampler1D)
46: 19(fvec4) Load 21(coords4D) 47: 19(fvec4) Load 21(coords4D)
47: 7(float) Load 9(lod) 48: 7(float) Load 9(lod)
48: 19(fvec4) TextureSampleProjLod 45 46 47 49: 19(fvec4) ImageSampleProjExplicitLod 46 47 48
49: 19(fvec4) Load 24(color) 50: 19(fvec4) Load 24(color)
50: 19(fvec4) FAdd 49 48 51: 19(fvec4) FAdd 50 49
Store 24(color) 50 Store 24(color) 51
54: 51 Load 53(texSampler2D) 56: 53 Load 55(texSampler2D)
55: 37(fvec2) Load 39(coords2D) 57: 38(fvec2) Load 40(coords2D)
56: 7(float) Load 9(lod) 58: 7(float) Load 9(lod)
57: 19(fvec4) TextureSampleLod 54 55 56 59: 19(fvec4) ImageSampleExplicitLod 56 57 58
58: 19(fvec4) Load 24(color) 60: 19(fvec4) Load 24(color)
59: 19(fvec4) FAdd 58 57 61: 19(fvec4) FAdd 60 59
Store 24(color) 59 Store 24(color) 61
60: 51 Load 53(texSampler2D) 62: 53 Load 55(texSampler2D)
61: 13(fvec3) Load 15(coords3D) 63: 13(fvec3) Load 15(coords3D)
62: 7(float) Load 9(lod) 64: 7(float) Load 9(lod)
63: 19(fvec4) TextureSampleProjLod 60 61 62 65: 19(fvec4) ImageSampleProjExplicitLod 62 63 64
64: 19(fvec4) Load 24(color) 66: 19(fvec4) Load 24(color)
65: 19(fvec4) FAdd 64 63 67: 19(fvec4) FAdd 66 65
Store 24(color) 65 Store 24(color) 67
66: 51 Load 53(texSampler2D) 68: 53 Load 55(texSampler2D)
67: 19(fvec4) Load 21(coords4D) 69: 19(fvec4) Load 21(coords4D)
68: 7(float) Load 9(lod) 70: 7(float) Load 9(lod)
69: 19(fvec4) TextureSampleProjLod 66 67 68 71: 19(fvec4) ImageSampleProjExplicitLod 68 69 70
70: 19(fvec4) Load 24(color) 72: 19(fvec4) Load 24(color)
71: 19(fvec4) FAdd 70 69 73: 19(fvec4) FAdd 72 71
Store 24(color) 71 Store 24(color) 73
75: 72 Load 74(texSampler3D) 78: 75 Load 77(texSampler3D)
76: 13(fvec3) Load 15(coords3D) 79: 13(fvec3) Load 15(coords3D)
77: 7(float) Load 9(lod) 80: 7(float) Load 9(lod)
78: 19(fvec4) TextureSampleLod 75 76 77 81: 19(fvec4) ImageSampleExplicitLod 78 79 80
79: 19(fvec4) Load 24(color) 82: 19(fvec4) Load 24(color)
80: 19(fvec4) FAdd 79 78 83: 19(fvec4) FAdd 82 81
Store 24(color) 80 Store 24(color) 83
81: 72 Load 74(texSampler3D) 84: 75 Load 77(texSampler3D)
82: 19(fvec4) Load 21(coords4D) 85: 19(fvec4) Load 21(coords4D)
83: 7(float) Load 9(lod) 86: 7(float) Load 9(lod)
84: 19(fvec4) TextureSampleProjLod 81 82 83 87: 19(fvec4) ImageSampleProjExplicitLod 84 85 86
85: 19(fvec4) Load 24(color) 88: 19(fvec4) Load 24(color)
86: 19(fvec4) FAdd 85 84 89: 19(fvec4) FAdd 88 87
Store 24(color) 86 Store 24(color) 89
90: 87 Load 89(texSamplerCube) 94: 91 Load 93(texSamplerCube)
91: 13(fvec3) Load 15(coords3D) 95: 13(fvec3) Load 15(coords3D)
92: 7(float) Load 9(lod) 96: 7(float) Load 9(lod)
93: 19(fvec4) TextureSampleLod 90 91 92 97: 19(fvec4) ImageSampleExplicitLod 94 95 96
94: 19(fvec4) Load 24(color) 98: 19(fvec4) Load 24(color)
95: 19(fvec4) FAdd 94 93 99: 19(fvec4) FAdd 98 97
Store 24(color) 95 Store 24(color) 99
99: 96 Load 98(shadowSampler1D) 104: 101 Load 103(shadowSampler1D)
100: 13(fvec3) Load 15(coords3D) 105: 13(fvec3) Load 15(coords3D)
101: 7(float) Load 9(lod) 106: 7(float) Load 9(lod)
102: 19(fvec4) TextureSampleLod 99 100 101 107: 7(float) CompositeExtract 105 2
103: 19(fvec4) Load 24(color) 108: 19(fvec4) ImageSampleDrefExplicitLod 104 105 107 106
104: 19(fvec4) FAdd 103 102 109: 19(fvec4) Load 24(color)
Store 24(color) 104 110: 19(fvec4) FAdd 109 108
108: 105 Load 107(shadowSampler2D) Store 24(color) 110
109: 13(fvec3) Load 15(coords3D) 115: 112 Load 114(shadowSampler2D)
110: 7(float) Load 9(lod) 116: 13(fvec3) Load 15(coords3D)
111: 19(fvec4) TextureSampleLod 108 109 110 117: 7(float) Load 9(lod)
112: 19(fvec4) Load 24(color) 118: 7(float) CompositeExtract 116 2
113: 19(fvec4) FAdd 112 111 119: 19(fvec4) ImageSampleDrefExplicitLod 115 116 118 117
Store 24(color) 113 120: 19(fvec4) Load 24(color)
114: 96 Load 98(shadowSampler1D) 121: 19(fvec4) FAdd 120 119
115: 19(fvec4) Load 21(coords4D) Store 24(color) 121
116: 7(float) Load 9(lod) 122: 101 Load 103(shadowSampler1D)
117: 19(fvec4) TextureSampleProjLod 114 115 116 123: 19(fvec4) Load 21(coords4D)
118: 19(fvec4) Load 24(color) 124: 7(float) Load 9(lod)
119: 19(fvec4) FAdd 118 117 125: 7(float) CompositeExtract 123 3
Store 24(color) 119 126: 19(fvec4) ImageSampleProjDrefExplicitLod 122 123 125 124
120: 105 Load 107(shadowSampler2D) 127: 19(fvec4) Load 24(color)
121: 19(fvec4) Load 21(coords4D) 128: 19(fvec4) FAdd 127 126
122: 7(float) Load 9(lod) Store 24(color) 128
123: 19(fvec4) TextureSampleProjLod 120 121 122 129: 112 Load 114(shadowSampler2D)
124: 19(fvec4) Load 24(color) 130: 19(fvec4) Load 21(coords4D)
125: 19(fvec4) FAdd 124 123 131: 7(float) Load 9(lod)
Store 24(color) 125 132: 7(float) CompositeExtract 130 3
128: 19(fvec4) Load 24(color) 133: 19(fvec4) ImageSampleProjDrefExplicitLod 129 130 132 131
Store 127(gl_Position) 128 134: 19(fvec4) Load 24(color)
135: 19(fvec4) FAdd 134 133
Store 24(color) 135
138: 19(fvec4) Load 24(color)
Store 137(gl_Position) 138
Branch 6 Branch 6
6: Label 6: Label
Return Return

4
Test/baseResults/spv.types.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 264 // Id's are bound by 264
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "b" Name 9 "b"
Name 11 "u_b" Name 11 "u_b"

465
Test/baseResults/spv.uint.frag.out Normal file → Executable file
View File

@ -5,12 +5,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 206 // Id's are bound by 207
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "count" Name 9 "count"
Name 13 "u" Name 13 "u"
@ -20,45 +22,45 @@ Linked fragment stage:
Name 58 "shiftediu" Name 58 "shiftediu"
Name 59 "shifteduu" Name 59 "shifteduu"
Name 67 "c" Name 67 "c"
Name 70 "usampler" Name 71 "usampler"
Name 75 "tc" Name 76 "tc"
Name 108 "af" Name 109 "af"
Name 112 "ab" Name 113 "ab"
Name 116 "ai" Name 117 "ai"
Name 151 "mask1" Name 152 "mask1"
Name 153 "mask2" Name 154 "mask2"
Name 155 "mask3" Name 156 "mask3"
Name 159 "mask4" Name 160 "mask4"
Name 199 "f" Name 200 "f"
Name 201 "v" Name 202 "v"
Name 203 "i" Name 204 "i"
Name 205 "b" Name 206 "b"
Decorate 9(count) PrecisionMedium Decorate 9(count) RelaxedPrecision
Decorate 13(u) PrecisionMedium Decorate 13(u) RelaxedPrecision
Decorate 16(t) PrecisionMedium Decorate 16(t) RelaxedPrecision
Decorate 16(t) Flat Decorate 16(t) Flat
Decorate 54(shiftedii) PrecisionMedium Decorate 54(shiftedii) RelaxedPrecision
Decorate 56(shiftedui) PrecisionMedium Decorate 56(shiftedui) RelaxedPrecision
Decorate 58(shiftediu) PrecisionMedium Decorate 58(shiftediu) RelaxedPrecision
Decorate 59(shifteduu) PrecisionMedium Decorate 59(shifteduu) RelaxedPrecision
Decorate 67(c) PrecisionMedium Decorate 67(c) RelaxedPrecision
Decorate 70(usampler) PrecisionMedium Decorate 71(usampler) RelaxedPrecision
Decorate 75(tc) PrecisionMedium Decorate 76(tc) RelaxedPrecision
Decorate 75(tc) Smooth Decorate 76(tc) Smooth
Decorate 108(af) PrecisionMedium Decorate 109(af) RelaxedPrecision
Decorate 116(ai) PrecisionMedium Decorate 117(ai) RelaxedPrecision
Decorate 151(mask1) PrecisionMedium Decorate 152(mask1) RelaxedPrecision
Decorate 153(mask2) PrecisionMedium Decorate 154(mask2) RelaxedPrecision
Decorate 155(mask3) PrecisionMedium Decorate 156(mask3) RelaxedPrecision
Decorate 159(mask4) PrecisionMedium Decorate 160(mask4) RelaxedPrecision
Decorate 199(f) PrecisionMedium Decorate 200(f) RelaxedPrecision
Decorate 199(f) Smooth Decorate 200(f) Smooth
Decorate 199(f) NoStaticUse Decorate 200(f) NoStaticUse
Decorate 201(v) PrecisionMedium Decorate 202(v) RelaxedPrecision
Decorate 201(v) NoStaticUse Decorate 202(v) NoStaticUse
Decorate 203(i) PrecisionMedium Decorate 204(i) RelaxedPrecision
Decorate 203(i) NoStaticUse Decorate 204(i) NoStaticUse
Decorate 205(b) NoStaticUse Decorate 206(b) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 1 7: TypeInt 32 1
@ -84,37 +86,38 @@ Linked fragment stage:
65: TypeVector 11(int) 4 65: TypeVector 11(int) 4
66: TypePointer Output 65(ivec4) 66: TypePointer Output 65(ivec4)
67(c): 66(ptr) Variable Output 67(c): 66(ptr) Variable Output
68: TypeSampler11(int) 2D filter+texture 68: TypeImage 11(int) 2D sampled format:Unknown
69: TypePointer UniformConstant 68 69: TypeSampledImage 68
70(usampler): 69(ptr) Variable UniformConstant 70: TypePointer UniformConstant 69
72: TypeFloat 32 71(usampler): 70(ptr) Variable UniformConstant
73: TypeVector 72(float) 2 73: TypeFloat 32
74: TypePointer Input 73(fvec2) 74: TypeVector 73(float) 2
75(tc): 74(ptr) Variable Input 75: TypePointer Input 74(fvec2)
85: 72(float) Constant 1065353216 76(tc): 75(ptr) Variable Input
97: 72(float) Constant 1073741824 86: 73(float) Constant 1065353216
98: 73(fvec2) ConstantComposite 97 97 98: 73(float) Constant 1073741824
103: 11(int) Constant 4 99: 74(fvec2) ConstantComposite 98 98
107: TypePointer Function 72(float) 104: 11(int) Constant 4
111: TypePointer Function 21(bool) 108: TypePointer Function 73(float)
114: 11(int) Constant 0 112: TypePointer Function 21(bool)
122: 11(int) Constant 1 115: 11(int) Constant 0
133: 7(int) Constant 17 123: 11(int) Constant 1
138: 7(int) Constant 19 134: 7(int) Constant 17
143: 7(int) Constant 23 139: 7(int) Constant 19
148: 7(int) Constant 27 144: 7(int) Constant 23
152: 11(int) Constant 161 149: 7(int) Constant 27
154: 11(int) Constant 2576 153: 11(int) Constant 161
157: 7(int) Constant 4 155: 11(int) Constant 2576
160: 11(int) Constant 2737 158: 7(int) Constant 4
198: TypePointer Input 72(float) 161: 11(int) Constant 2737
199(f): 198(ptr) Variable Input 199: TypePointer Input 73(float)
200: TypePointer UniformConstant 65(ivec4) 200(f): 199(ptr) Variable Input
201(v): 200(ptr) Variable UniformConstant 201: TypePointer UniformConstant 65(ivec4)
202: TypePointer UniformConstant 7(int) 202(v): 201(ptr) Variable UniformConstant
203(i): 202(ptr) Variable UniformConstant 203: TypePointer UniformConstant 7(int)
204: TypePointer UniformConstant 21(bool) 204(i): 203(ptr) Variable UniformConstant
205(b): 204(ptr) Variable UniformConstant 205: TypePointer UniformConstant 21(bool)
206(b): 205(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(count): 8(ptr) Variable Function 9(count): 8(ptr) Variable Function
@ -123,13 +126,13 @@ Linked fragment stage:
56(shiftedui): 12(ptr) Variable Function 56(shiftedui): 12(ptr) Variable Function
58(shiftediu): 8(ptr) Variable Function 58(shiftediu): 8(ptr) Variable Function
59(shifteduu): 12(ptr) Variable Function 59(shifteduu): 12(ptr) Variable Function
108(af): 107(ptr) Variable Function 109(af): 108(ptr) Variable Function
112(ab): 111(ptr) Variable Function 113(ab): 112(ptr) Variable Function
116(ai): 8(ptr) Variable Function 117(ai): 8(ptr) Variable Function
151(mask1): 12(ptr) Variable Function 152(mask1): 12(ptr) Variable Function
153(mask2): 12(ptr) Variable Function 154(mask2): 12(ptr) Variable Function
155(mask3): 12(ptr) Variable Function 156(mask3): 12(ptr) Variable Function
159(mask4): 12(ptr) Variable Function 160(mask4): 12(ptr) Variable Function
Store 9(count) 10 Store 9(count) 10
17: 14(ivec2) Load 16(t) 17: 14(ivec2) Load 16(t)
18: 11(int) CompositeExtract 17 1 18: 11(int) CompositeExtract 17 1
@ -193,161 +196,161 @@ Linked fragment stage:
SelectionMerge 64 None SelectionMerge 64 None
BranchConditional 62 63 64 BranchConditional 62 63 64
63: Label 63: Label
71: 68 Load 70(usampler) 72: 69 Load 71(usampler)
76: 73(fvec2) Load 75(tc) 77: 74(fvec2) Load 76(tc)
77: 65(ivec4) TextureSample 71 76 78: 65(ivec4) ImageSampleImplicitLod 72 77
Store 67(c) 77 Store 67(c) 78
Branch 64 Branch 64
64: Label 64: Label
78: 11(int) Load 56(shiftedui) 79: 11(int) Load 56(shiftedui)
79: 11(int) Load 59(shifteduu) 80: 11(int) Load 59(shifteduu)
80: 21(bool) IEqual 78 79 81: 21(bool) IEqual 79 80
SelectionMerge 82 None SelectionMerge 83 None
BranchConditional 80 81 82 BranchConditional 81 82 83
81: Label 82: Label
83: 68 Load 70(usampler) 84: 69 Load 71(usampler)
84: 73(fvec2) Load 75(tc) 85: 74(fvec2) Load 76(tc)
86: 73(fvec2) CompositeConstruct 85 85 87: 74(fvec2) CompositeConstruct 86 86
87: 73(fvec2) FAdd 84 86 88: 74(fvec2) FAdd 85 87
88: 65(ivec4) TextureSample 83 87 89: 65(ivec4) ImageSampleImplicitLod 84 88
Store 67(c) 88 Store 67(c) 89
Branch 82 Branch 83
82: Label 83: Label
89: 7(int) Load 54(shiftedii) 90: 7(int) Load 54(shiftedii)
90: 11(int) Load 56(shiftedui) 91: 11(int) Load 56(shiftedui)
91: 7(int) Bitcast 90 92: 7(int) Bitcast 91
92: 21(bool) IEqual 89 91 93: 21(bool) IEqual 90 92
SelectionMerge 94 None SelectionMerge 95 None
BranchConditional 92 93 94 BranchConditional 93 94 95
93: Label 94: Label
95: 68 Load 70(usampler) 96: 69 Load 71(usampler)
96: 73(fvec2) Load 75(tc) 97: 74(fvec2) Load 76(tc)
99: 73(fvec2) FSub 96 98 100: 74(fvec2) FSub 97 99
100: 65(ivec4) TextureSample 95 99 101: 65(ivec4) ImageSampleImplicitLod 96 100
Store 67(c) 100 Store 67(c) 101
Branch 94 Branch 95
94: Label 95: Label
101: 14(ivec2) Load 16(t) 102: 14(ivec2) Load 16(t)
102: 11(int) CompositeExtract 101 0 103: 11(int) CompositeExtract 102 0
104: 21(bool) UGreaterThan 102 103 105: 21(bool) UGreaterThan 103 104
SelectionMerge 106 None SelectionMerge 107 None
BranchConditional 104 105 106 BranchConditional 105 106 107
105: Label 106: Label
109: 11(int) Load 13(u) 110: 11(int) Load 13(u)
110: 72(float) ConvertUToF 109 111: 73(float) ConvertUToF 110
Store 108(af) 110 Store 109(af) 111
113: 11(int) Load 13(u) 114: 11(int) Load 13(u)
115: 21(bool) INotEqual 113 114 116: 21(bool) INotEqual 114 115
Store 112(ab) 115 Store 113(ab) 116
117: 11(int) Load 13(u) 118: 11(int) Load 13(u)
118: 7(int) Bitcast 117 119: 7(int) Bitcast 118
Store 116(ai) 118 Store 117(ai) 119
119: 72(float) Load 108(af) 120: 73(float) Load 109(af)
120: 11(int) ConvertFToU 119 121: 11(int) ConvertFToU 120
121: 21(bool) Load 112(ab) 122: 21(bool) Load 113(ab)
123: 11(int) Select 121 122 114 124: 11(int) Select 122 123 115
124: 7(int) Load 116(ai) 125: 7(int) Load 117(ai)
125: 11(int) Bitcast 124 126: 11(int) Bitcast 125
126: 7(int) Load 9(count) 127: 7(int) Load 9(count)
127: 11(int) Bitcast 126 128: 11(int) Bitcast 127
128: 65(ivec4) CompositeConstruct 120 123 125 127 129: 65(ivec4) CompositeConstruct 121 124 126 128
129: 65(ivec4) Load 67(c) 130: 65(ivec4) Load 67(c)
130: 65(ivec4) IAdd 129 128 131: 65(ivec4) IAdd 130 129
Store 67(c) 130 Store 67(c) 131
Branch 106 Branch 107
106: Label 107: Label
SelectionMerge 132 None SelectionMerge 133 None
BranchConditional 22 131 132 BranchConditional 22 132 133
131: Label 132: Label
134: 7(int) Load 9(count) 135: 7(int) Load 9(count)
135: 7(int) IMul 134 133 136: 7(int) IMul 135 134
Store 9(count) 135 Store 9(count) 136
Branch 132 Branch 133
132: Label 133: Label
SelectionMerge 137 None SelectionMerge 138 None
BranchConditional 33 136 137 BranchConditional 33 137 138
136: Label 137: Label
139: 7(int) Load 9(count) 140: 7(int) Load 9(count)
140: 7(int) IMul 139 138 141: 7(int) IMul 140 139
Store 9(count) 140 Store 9(count) 141
Branch 137 Branch 138
137: Label 138: Label
SelectionMerge 142 None SelectionMerge 143 None
BranchConditional 22 141 142 BranchConditional 22 142 143
141: Label 142: Label
144: 7(int) Load 9(count) 145: 7(int) Load 9(count)
145: 7(int) IMul 144 143 146: 7(int) IMul 145 144
Store 9(count) 145 Store 9(count) 146
Branch 142 Branch 143
142: Label 143: Label
SelectionMerge 147 None SelectionMerge 148 None
BranchConditional 22 146 147 BranchConditional 22 147 148
146: Label 147: Label
149: 7(int) Load 9(count) 150: 7(int) Load 9(count)
150: 7(int) IMul 149 148 151: 7(int) IMul 150 149
Store 9(count) 150 Store 9(count) 151
Branch 147 Branch 148
147: Label 148: Label
Store 151(mask1) 152 Store 152(mask1) 153
Store 153(mask2) 154 Store 154(mask2) 155
156: 11(int) Load 151(mask1) 157: 11(int) Load 152(mask1)
158: 11(int) ShiftLeftLogical 156 157 159: 11(int) ShiftLeftLogical 157 158
Store 155(mask3) 158 Store 156(mask3) 159
Store 159(mask4) 160 Store 160(mask4) 161
161: 11(int) Load 155(mask3) 162: 11(int) Load 156(mask3)
162: 11(int) Load 153(mask2) 163: 11(int) Load 154(mask2)
163: 21(bool) IEqual 161 162 164: 21(bool) IEqual 162 163
SelectionMerge 165 None SelectionMerge 166 None
BranchConditional 163 164 165 BranchConditional 164 165 166
164: Label 165: Label
166: 7(int) Load 9(count) 167: 7(int) Load 9(count)
167: 7(int) IMul 166 25 168: 7(int) IMul 167 25
Store 9(count) 167 Store 9(count) 168
Branch 165 Branch 166
165: Label 166: Label
168: 11(int) Load 155(mask3) 169: 11(int) Load 156(mask3)
169: 11(int) Load 151(mask1) 170: 11(int) Load 152(mask1)
170: 11(int) BitwiseAnd 168 169 171: 11(int) BitwiseAnd 169 170
171: 21(bool) INotEqual 170 114 172: 21(bool) INotEqual 171 115
SelectionMerge 173 None SelectionMerge 174 None
BranchConditional 171 172 173 BranchConditional 172 173 174
172: Label 173: Label
174: 7(int) Load 9(count) 175: 7(int) Load 9(count)
175: 7(int) IMul 174 30 176: 7(int) IMul 175 30
Store 9(count) 175 Store 9(count) 176
Branch 173 Branch 174
173: Label 174: Label
176: 11(int) Load 151(mask1) 177: 11(int) Load 152(mask1)
177: 11(int) Load 155(mask3) 178: 11(int) Load 156(mask3)
178: 11(int) BitwiseOr 176 177 179: 11(int) BitwiseOr 177 178
179: 11(int) Load 159(mask4) 180: 11(int) Load 160(mask4)
180: 21(bool) IEqual 178 179 181: 21(bool) IEqual 179 180
SelectionMerge 182 None SelectionMerge 183 None
BranchConditional 180 181 182 BranchConditional 181 182 183
181: Label 182: Label
183: 7(int) Load 9(count) 184: 7(int) Load 9(count)
184: 7(int) IMul 183 36 185: 7(int) IMul 184 36
Store 9(count) 184 Store 9(count) 185
Branch 182 Branch 183
182: Label 183: Label
185: 11(int) Load 151(mask1) 186: 11(int) Load 152(mask1)
186: 11(int) Load 159(mask4) 187: 11(int) Load 160(mask4)
187: 11(int) BitwiseXor 185 186 188: 11(int) BitwiseXor 186 187
188: 21(bool) IEqual 187 154 189: 21(bool) IEqual 188 155
SelectionMerge 190 None SelectionMerge 191 None
BranchConditional 188 189 190 BranchConditional 189 190 191
189: Label 190: Label
191: 7(int) Load 9(count) 192: 7(int) Load 9(count)
192: 7(int) IMul 191 41 193: 7(int) IMul 192 41
Store 9(count) 192 Store 9(count) 193
Branch 190 Branch 191
190: Label 191: Label
193: 7(int) Load 9(count) 194: 7(int) Load 9(count)
194: 11(int) Bitcast 193 195: 11(int) Bitcast 194
195: 65(ivec4) CompositeConstruct 194 194 194 194 196: 65(ivec4) CompositeConstruct 195 195 195 195
196: 65(ivec4) Load 67(c) 197: 65(ivec4) Load 67(c)
197: 65(ivec4) IAdd 196 195 198: 65(ivec4) IAdd 197 196
Store 67(c) 197 Store 67(c) 198
Branch 6 Branch 6
6: Label 6: Label
Return Return

17
Test/baseResults/spv.uniformArray.frag.out Normal file → Executable file
View File

@ -5,21 +5,23 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 52 // Id's are bound by 53
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "texColor" Name 10 "texColor"
Name 15 "color" Name 15 "color"
Name 26 "inColor" Name 26 "inColor"
Name 36 "alpha" Name 36 "alpha"
Name 47 "gl_FragColor" Name 47 "gl_FragColor"
Name 51 "texSampler2D" Name 52 "texSampler2D"
Decorate 47(gl_FragColor) BuiltIn FragColor Decorate 47(gl_FragColor) BuiltIn FragColor
Decorate 51(texSampler2D) NoStaticUse Decorate 52(texSampler2D) NoStaticUse
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
@ -44,9 +46,10 @@ Linked fragment stage:
38: TypePointer UniformConstant 7(float) 38: TypePointer UniformConstant 7(float)
46: TypePointer Output 8(fvec4) 46: TypePointer Output 8(fvec4)
47(gl_FragColor): 46(ptr) Variable Output 47(gl_FragColor): 46(ptr) Variable Output
49: TypeSampler7(float) 2D filter+texture 49: TypeImage 7(float) 2D sampled format:Unknown
50: TypePointer UniformConstant 49 50: TypeSampledImage 49
51(texSampler2D): 50(ptr) Variable UniformConstant 51: TypePointer UniformConstant 50
52(texSampler2D): 51(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
10(texColor): 9(ptr) Variable Function 10(texColor): 9(ptr) Variable Function

93
Test/baseResults/spv.variableArrayIndex.frag.out Normal file → Executable file
View File

@ -7,12 +7,14 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 93 // Id's are bound by 94
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 9 "iLocal" Name 9 "iLocal"
Name 11 "Count" Name 11 "Count"
@ -33,11 +35,11 @@ Linked fragment stage:
Name 35 "foo2" Name 35 "foo2"
Name 37 "foo" Name 37 "foo"
Name 55 "gl_FragColor" Name 55 "gl_FragColor"
Name 59 "sampler" Name 60 "sampler"
Name 63 "coord" Name 64 "coord"
Name 69 "constructed" Name 70 "constructed"
Decorate 55(gl_FragColor) BuiltIn FragColor Decorate 55(gl_FragColor) BuiltIn FragColor
Decorate 63(coord) Smooth Decorate 64(coord) Smooth
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeInt 32 1 7: TypeInt 32 1
@ -68,23 +70,24 @@ Linked fragment stage:
53: TypeVector 13(float) 4 53: TypeVector 13(float) 4
54: TypePointer Output 53(fvec4) 54: TypePointer Output 53(fvec4)
55(gl_FragColor): 54(ptr) Variable Output 55(gl_FragColor): 54(ptr) Variable Output
57: TypeSampler13(float) 2D filter+texture 57: TypeImage 13(float) 2D sampled format:Unknown
58: TypePointer UniformConstant 57 58: TypeSampledImage 57
59(sampler): 58(ptr) Variable UniformConstant 59: TypePointer UniformConstant 58
61: TypeVector 13(float) 2 60(sampler): 59(ptr) Variable UniformConstant
62: TypePointer Input 61(fvec2) 62: TypeVector 13(float) 2
63(coord): 62(ptr) Variable Input 63: TypePointer Input 62(fvec2)
67: TypeArray 61(fvec2) 17 64(coord): 63(ptr) Variable Input
68: TypePointer Function 67 68: TypeArray 62(fvec2) 17
73: 13(float) Constant 1065353216 69: TypePointer Function 68
74: 13(float) Constant 1073741824 74: 13(float) Constant 1065353216
75: 61(fvec2) ConstantComposite 73 74 75: 13(float) Constant 1073741824
79: TypePointer Function 61(fvec2) 76: 62(fvec2) ConstantComposite 74 75
80: TypePointer Function 62(fvec2)
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(iLocal): 8(ptr) Variable Function 9(iLocal): 8(ptr) Variable Function
31(scale): 30(ptr) Variable Function 31(scale): 30(ptr) Variable Function
69(constructed): 68(ptr) Variable Function 70(constructed): 69(ptr) Variable Function
12: 7(int) Load 11(Count) 12: 7(int) Load 11(Count)
Store 9(iLocal) 12 Store 9(iLocal) 12
24: 10(ptr) AccessChain 21(foo3) 22 23 22 24: 10(ptr) AccessChain 21(foo3) 22 23 22
@ -113,32 +116,32 @@ Linked fragment stage:
Branch 29 Branch 29
29: Label 29: Label
56: 13(float) Load 31(scale) 56: 13(float) Load 31(scale)
60: 57 Load 59(sampler) 61: 58 Load 60(sampler)
64: 61(fvec2) Load 63(coord) 65: 62(fvec2) Load 64(coord)
65: 53(fvec4) TextureSample 60 64 66: 53(fvec4) ImageSampleImplicitLod 61 65
66: 53(fvec4) VectorTimesScalar 65 56 67: 53(fvec4) VectorTimesScalar 66 56
Store 55(gl_FragColor) 66 Store 55(gl_FragColor) 67
70: 61(fvec2) Load 63(coord) 71: 62(fvec2) Load 64(coord)
71: 13(float) Load 31(scale) 72: 13(float) Load 31(scale)
72: 61(fvec2) CompositeConstruct 71 71 73: 62(fvec2) CompositeConstruct 72 72
76: 67 CompositeConstruct 70 72 75 77: 68 CompositeConstruct 71 73 76
Store 69(constructed) 76 Store 70(constructed) 77
77: 10(ptr) AccessChain 37(foo) 22 78: 10(ptr) AccessChain 37(foo) 22
78: 7(int) Load 77 79: 7(int) Load 78
80: 79(ptr) AccessChain 69(constructed) 78 81: 80(ptr) AccessChain 70(constructed) 79
81: 61(fvec2) Load 80 82: 62(fvec2) Load 81
82: 10(ptr) AccessChain 37(foo) 22 83: 10(ptr) AccessChain 37(foo) 22
83: 7(int) Load 82 84: 7(int) Load 83
84: 79(ptr) AccessChain 69(constructed) 83 85: 80(ptr) AccessChain 70(constructed) 84
85: 61(fvec2) Load 84 86: 62(fvec2) Load 85
86: 13(float) CompositeExtract 81 0 87: 13(float) CompositeExtract 82 0
87: 13(float) CompositeExtract 81 1 88: 13(float) CompositeExtract 82 1
88: 13(float) CompositeExtract 85 0 89: 13(float) CompositeExtract 86 0
89: 13(float) CompositeExtract 85 1 90: 13(float) CompositeExtract 86 1
90: 53(fvec4) CompositeConstruct 86 87 88 89 91: 53(fvec4) CompositeConstruct 87 88 89 90
91: 53(fvec4) Load 55(gl_FragColor) 92: 53(fvec4) Load 55(gl_FragColor)
92: 53(fvec4) FAdd 91 90 93: 53(fvec4) FAdd 92 91
Store 55(gl_FragColor) 92 Store 55(gl_FragColor) 93
Branch 6 Branch 6
6: Label 6: Label
Return Return

137
Test/baseResults/spv.varyingArray.frag.out Normal file → Executable file
View File

@ -10,87 +10,90 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 61 // Id's are bound by 62
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "texColor" Name 10 "texColor"
Name 13 "texSampler2D" Name 14 "texSampler2D"
Name 19 "gl_TexCoord" Name 20 "gl_TexCoord"
Name 34 "color" Name 35 "color"
Name 39 "alpha" Name 40 "alpha"
Name 44 "gl_FragColor" Name 45 "gl_FragColor"
Name 48 "foo" Name 49 "foo"
Decorate 19(gl_TexCoord) Smooth Decorate 20(gl_TexCoord) Smooth
Decorate 34(color) Smooth Decorate 35(color) Smooth
Decorate 39(alpha) Smooth Decorate 40(alpha) Smooth
Decorate 44(gl_FragColor) BuiltIn FragColor Decorate 45(gl_FragColor) BuiltIn FragColor
Decorate 48(foo) Smooth Decorate 49(foo) Smooth
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
8: TypeVector 7(float) 4 8: TypeVector 7(float) 4
9: TypePointer Function 8(fvec4) 9: TypePointer Function 8(fvec4)
11: TypeSampler7(float) 2D filter+texture 11: TypeImage 7(float) 2D sampled format:Unknown
12: TypePointer UniformConstant 11 12: TypeSampledImage 11
13(texSampler2D): 12(ptr) Variable UniformConstant 13: TypePointer UniformConstant 12
15: TypeInt 32 0 14(texSampler2D): 13(ptr) Variable UniformConstant
16: 15(int) Constant 6 16: TypeInt 32 0
17: TypeArray 8(fvec4) 16 17: 16(int) Constant 6
18: TypePointer Input 17 18: TypeArray 8(fvec4) 17
19(gl_TexCoord): 18(ptr) Variable Input 19: TypePointer Input 18
20: TypeInt 32 1 20(gl_TexCoord): 19(ptr) Variable Input
21: 20(int) Constant 4 21: TypeInt 32 1
22: TypePointer Input 8(fvec4) 22: 21(int) Constant 4
25: 20(int) Constant 5 23: TypePointer Input 8(fvec4)
29: TypeVector 7(float) 2 26: 21(int) Constant 5
34(color): 22(ptr) Variable Input 30: TypeVector 7(float) 2
38: TypePointer Input 7(float) 35(color): 23(ptr) Variable Input
39(alpha): 38(ptr) Variable Input 39: TypePointer Input 7(float)
43: TypePointer Output 8(fvec4) 40(alpha): 39(ptr) Variable Input
44(gl_FragColor): 43(ptr) Variable Output 44: TypePointer Output 8(fvec4)
45: 15(int) Constant 3 45(gl_FragColor): 44(ptr) Variable Output
46: TypeArray 8(fvec4) 45 46: 16(int) Constant 3
47: TypePointer Input 46 47: TypeArray 8(fvec4) 46
48(foo): 47(ptr) Variable Input 48: TypePointer Input 47
49: 20(int) Constant 1 49(foo): 48(ptr) Variable Input
52: 20(int) Constant 0 50: 21(int) Constant 1
53: 21(int) Constant 0
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
10(texColor): 9(ptr) Variable Function 10(texColor): 9(ptr) Variable Function
14: 11 Load 13(texSampler2D) 15: 12 Load 14(texSampler2D)
23: 22(ptr) AccessChain 19(gl_TexCoord) 21 24: 23(ptr) AccessChain 20(gl_TexCoord) 22
24: 8(fvec4) Load 23 25: 8(fvec4) Load 24
26: 22(ptr) AccessChain 19(gl_TexCoord) 25 27: 23(ptr) AccessChain 20(gl_TexCoord) 26
27: 8(fvec4) Load 26 28: 8(fvec4) Load 27
28: 8(fvec4) FAdd 24 27 29: 8(fvec4) FAdd 25 28
30: 7(float) CompositeExtract 28 0 31: 7(float) CompositeExtract 29 0
31: 7(float) CompositeExtract 28 1 32: 7(float) CompositeExtract 29 1
32: 29(fvec2) CompositeConstruct 30 31 33: 30(fvec2) CompositeConstruct 31 32
33: 8(fvec4) TextureSample 14 32 34: 8(fvec4) ImageSampleImplicitLod 15 33
Store 10(texColor) 33 Store 10(texColor) 34
35: 8(fvec4) Load 34(color) 36: 8(fvec4) Load 35(color)
36: 8(fvec4) Load 10(texColor) 37: 8(fvec4) Load 10(texColor)
37: 8(fvec4) FAdd 36 35 38: 8(fvec4) FAdd 37 36
Store 10(texColor) 37 Store 10(texColor) 38
40: 7(float) Load 39(alpha) 41: 7(float) Load 40(alpha)
41: 8(fvec4) Load 10(texColor) 42: 8(fvec4) Load 10(texColor)
42: 8(fvec4) CompositeInsert 40 41 3 43: 8(fvec4) CompositeInsert 41 42 3
Store 10(texColor) 42 Store 10(texColor) 43
50: 22(ptr) AccessChain 48(foo) 49 51: 23(ptr) AccessChain 49(foo) 50
51: 8(fvec4) Load 50 52: 8(fvec4) Load 51
53: 22(ptr) AccessChain 19(gl_TexCoord) 52 54: 23(ptr) AccessChain 20(gl_TexCoord) 53
54: 8(fvec4) Load 53 55: 8(fvec4) Load 54
55: 8(fvec4) FAdd 51 54 56: 8(fvec4) FAdd 52 55
56: 22(ptr) AccessChain 19(gl_TexCoord) 21 57: 23(ptr) AccessChain 20(gl_TexCoord) 22
57: 8(fvec4) Load 56 58: 8(fvec4) Load 57
58: 8(fvec4) FAdd 55 57 59: 8(fvec4) FAdd 56 58
59: 8(fvec4) Load 10(texColor) 60: 8(fvec4) Load 10(texColor)
60: 8(fvec4) FAdd 58 59 61: 8(fvec4) FAdd 59 60
Store 44(gl_FragColor) 60 Store 45(gl_FragColor) 61
Branch 6 Branch 6
6: Label 6: Label
Return Return

157
Test/baseResults/spv.varyingArrayIndirect.frag.out Normal file → Executable file
View File

@ -10,97 +10,100 @@ Linked fragment stage:
// Module Version 99 // Module Version 99
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 69 // Id's are bound by 70
Source GLSL 130 Source GLSL 130
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "texColor" Name 10 "texColor"
Name 13 "texSampler2D" Name 14 "texSampler2D"
Name 19 "userIn" Name 20 "userIn"
Name 22 "b" Name 23 "b"
Name 30 "gl_TexCoord" Name 31 "gl_TexCoord"
Name 31 "a" Name 32 "a"
Name 45 "color" Name 46 "color"
Name 50 "alpha" Name 51 "alpha"
Name 55 "gl_FragColor" Name 56 "gl_FragColor"
Decorate 19(userIn) Smooth Decorate 20(userIn) Smooth
Decorate 30(gl_TexCoord) Smooth Decorate 31(gl_TexCoord) Smooth
Decorate 45(color) Smooth Decorate 46(color) Smooth
Decorate 50(alpha) Smooth Decorate 51(alpha) Smooth
Decorate 55(gl_FragColor) BuiltIn FragColor Decorate 56(gl_FragColor) BuiltIn FragColor
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
7: TypeFloat 32 7: TypeFloat 32
8: TypeVector 7(float) 4 8: TypeVector 7(float) 4
9: TypePointer Function 8(fvec4) 9: TypePointer Function 8(fvec4)
11: TypeSampler7(float) 2D filter+texture 11: TypeImage 7(float) 2D sampled format:Unknown
12: TypePointer UniformConstant 11 12: TypeSampledImage 11
13(texSampler2D): 12(ptr) Variable UniformConstant 13: TypePointer UniformConstant 12
15: TypeInt 32 0 14(texSampler2D): 13(ptr) Variable UniformConstant
16: 15(int) Constant 2 16: TypeInt 32 0
17: TypeArray 8(fvec4) 16 17: 16(int) Constant 2
18: TypePointer Input 17 18: TypeArray 8(fvec4) 17
19(userIn): 18(ptr) Variable Input 19: TypePointer Input 18
20: TypeInt 32 1 20(userIn): 19(ptr) Variable Input
21: TypePointer UniformConstant 20(int) 21: TypeInt 32 1
22(b): 21(ptr) Variable UniformConstant 22: TypePointer UniformConstant 21(int)
24: TypePointer Input 8(fvec4) 23(b): 22(ptr) Variable UniformConstant
27: 15(int) Constant 6 25: TypePointer Input 8(fvec4)
28: TypeArray 8(fvec4) 27 28: 16(int) Constant 6
29: TypePointer Input 28 29: TypeArray 8(fvec4) 28
30(gl_TexCoord): 29(ptr) Variable Input 30: TypePointer Input 29
31(a): 21(ptr) Variable UniformConstant 31(gl_TexCoord): 30(ptr) Variable Input
36: 20(int) Constant 5 32(a): 22(ptr) Variable UniformConstant
40: TypeVector 7(float) 2 37: 21(int) Constant 5
45(color): 24(ptr) Variable Input 41: TypeVector 7(float) 2
49: TypePointer Input 7(float) 46(color): 25(ptr) Variable Input
50(alpha): 49(ptr) Variable Input 50: TypePointer Input 7(float)
54: TypePointer Output 8(fvec4) 51(alpha): 50(ptr) Variable Input
55(gl_FragColor): 54(ptr) Variable Output 55: TypePointer Output 8(fvec4)
56: 20(int) Constant 0 56(gl_FragColor): 55(ptr) Variable Output
57: 21(int) Constant 0
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
10(texColor): 9(ptr) Variable Function 10(texColor): 9(ptr) Variable Function
14: 11 Load 13(texSampler2D) 15: 12 Load 14(texSampler2D)
23: 20(int) Load 22(b) 24: 21(int) Load 23(b)
25: 24(ptr) AccessChain 19(userIn) 23 26: 25(ptr) AccessChain 20(userIn) 24
26: 8(fvec4) Load 25 27: 8(fvec4) Load 26
32: 20(int) Load 31(a) 33: 21(int) Load 32(a)
33: 24(ptr) AccessChain 30(gl_TexCoord) 32 34: 25(ptr) AccessChain 31(gl_TexCoord) 33
34: 8(fvec4) Load 33 35: 8(fvec4) Load 34
35: 8(fvec4) FAdd 26 34 36: 8(fvec4) FAdd 27 35
37: 24(ptr) AccessChain 30(gl_TexCoord) 36 38: 25(ptr) AccessChain 31(gl_TexCoord) 37
38: 8(fvec4) Load 37 39: 8(fvec4) Load 38
39: 8(fvec4) FAdd 35 38 40: 8(fvec4) FAdd 36 39
41: 7(float) CompositeExtract 39 0 42: 7(float) CompositeExtract 40 0
42: 7(float) CompositeExtract 39 1 43: 7(float) CompositeExtract 40 1
43: 40(fvec2) CompositeConstruct 41 42 44: 41(fvec2) CompositeConstruct 42 43
44: 8(fvec4) TextureSample 14 43 45: 8(fvec4) ImageSampleImplicitLod 15 44
Store 10(texColor) 44 Store 10(texColor) 45
46: 8(fvec4) Load 45(color) 47: 8(fvec4) Load 46(color)
47: 8(fvec4) Load 10(texColor) 48: 8(fvec4) Load 10(texColor)
48: 8(fvec4) FAdd 47 46 49: 8(fvec4) FAdd 48 47
Store 10(texColor) 48 Store 10(texColor) 49
51: 7(float) Load 50(alpha) 52: 7(float) Load 51(alpha)
52: 8(fvec4) Load 10(texColor) 53: 8(fvec4) Load 10(texColor)
53: 8(fvec4) CompositeInsert 51 52 3 54: 8(fvec4) CompositeInsert 52 53 3
Store 10(texColor) 53 Store 10(texColor) 54
57: 24(ptr) AccessChain 30(gl_TexCoord) 56 58: 25(ptr) AccessChain 31(gl_TexCoord) 57
58: 8(fvec4) Load 57 59: 8(fvec4) Load 58
59: 20(int) Load 22(b) 60: 21(int) Load 23(b)
60: 24(ptr) AccessChain 30(gl_TexCoord) 59 61: 25(ptr) AccessChain 31(gl_TexCoord) 60
61: 8(fvec4) Load 60 62: 8(fvec4) Load 61
62: 8(fvec4) FAdd 58 61 63: 8(fvec4) FAdd 59 62
63: 8(fvec4) Load 10(texColor) 64: 8(fvec4) Load 10(texColor)
64: 8(fvec4) FAdd 62 63 65: 8(fvec4) FAdd 63 64
65: 20(int) Load 31(a) 66: 21(int) Load 32(a)
66: 24(ptr) AccessChain 19(userIn) 65 67: 25(ptr) AccessChain 20(userIn) 66
67: 8(fvec4) Load 66 68: 8(fvec4) Load 67
68: 8(fvec4) FAdd 64 67 69: 8(fvec4) FAdd 65 68
Store 55(gl_FragColor) 68 Store 56(gl_FragColor) 69
Branch 6 Branch 6
6: Label 6: Label
Return Return

4
Test/baseResults/spv.voidFunction.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 43 // Id's are bound by 43
Source GLSL 120 Source GLSL 120
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 7 "foo(" Name 7 "foo("
Name 9 "foo2(" Name 9 "foo2("

10
Test/baseResults/spv.while-continue-break.vert.out Normal file → Executable file
View File

@ -8,9 +8,10 @@ Linked vertex stage:
// Id's are bound by 43 // Id's are bound by 43
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 18 "A" Name 18 "A"
@ -19,15 +20,8 @@ Linked vertex stage:
Name 38 "D" Name 38 "D"
Name 41 "gl_VertexID" Name 41 "gl_VertexID"
Name 42 "gl_InstanceID" Name 42 "gl_InstanceID"
Decorate 9(i) PrecisionHigh
Decorate 18(A) PrecisionHigh
Decorate 26(B) PrecisionHigh
Decorate 28(C) PrecisionHigh
Decorate 38(D) PrecisionHigh
Decorate 41(gl_VertexID) PrecisionHigh
Decorate 41(gl_VertexID) BuiltIn VertexId Decorate 41(gl_VertexID) BuiltIn VertexId
Decorate 41(gl_VertexID) NoStaticUse Decorate 41(gl_VertexID) NoStaticUse
Decorate 42(gl_InstanceID) PrecisionHigh
Decorate 42(gl_InstanceID) BuiltIn InstanceId Decorate 42(gl_InstanceID) BuiltIn InstanceId
Decorate 42(gl_InstanceID) NoStaticUse Decorate 42(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

6
Test/baseResults/spv.while-simple.vert.out Normal file → Executable file
View File

@ -8,18 +8,16 @@ Linked vertex stage:
// Id's are bound by 24 // Id's are bound by 24
Source ESSL 300 Source ESSL 300
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4 "main"
Name 4 "main" Name 4 "main"
Name 9 "i" Name 9 "i"
Name 22 "gl_VertexID" Name 22 "gl_VertexID"
Name 23 "gl_InstanceID" Name 23 "gl_InstanceID"
Decorate 9(i) PrecisionHigh
Decorate 22(gl_VertexID) PrecisionHigh
Decorate 22(gl_VertexID) BuiltIn VertexId Decorate 22(gl_VertexID) BuiltIn VertexId
Decorate 22(gl_VertexID) NoStaticUse Decorate 22(gl_VertexID) NoStaticUse
Decorate 23(gl_InstanceID) PrecisionHigh
Decorate 23(gl_InstanceID) BuiltIn InstanceId Decorate 23(gl_InstanceID) BuiltIn InstanceId
Decorate 23(gl_InstanceID) NoStaticUse Decorate 23(gl_InstanceID) NoStaticUse
2: TypeVoid 2: TypeVoid

4
Test/baseResults/spv.whileLoop.frag.out Normal file → Executable file
View File

@ -8,9 +8,11 @@ Linked fragment stage:
// Id's are bound by 32 // Id's are bound by 32
Source GLSL 110 Source GLSL 110
Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"

View File

@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits. // 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). // For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "2.3.703" #define GLSLANG_REVISION "2.3.704"
#define GLSLANG_DATE "06-Aug-2015" #define GLSLANG_DATE "06-Aug-2015"