mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Updated glslang.
This commit is contained in:
46
3rdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
46
3rdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
@@ -251,10 +251,10 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type)
|
||||
return spv::StorageClassInput;
|
||||
else if (type.getQualifier().isPipeOutput())
|
||||
return spv::StorageClassOutput;
|
||||
else if (type.getBasicType() == glslang::EbtSampler)
|
||||
return spv::StorageClassUniformConstant;
|
||||
else if (type.getBasicType() == glslang::EbtAtomicUint)
|
||||
return spv::StorageClassAtomicCounter;
|
||||
else if (type.containsOpaque())
|
||||
return spv::StorageClassUniformConstant;
|
||||
else if (type.getQualifier().isUniformOrBuffer()) {
|
||||
if (type.getQualifier().layoutPushConstant)
|
||||
return spv::StorageClassPushConstant;
|
||||
@@ -262,7 +262,6 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type)
|
||||
return spv::StorageClassUniform;
|
||||
else
|
||||
return spv::StorageClassUniformConstant;
|
||||
// TODO: how are we distinguishing between default and non-default non-writable uniforms? Do default uniforms even exist?
|
||||
} else {
|
||||
switch (type.getQualifier().storage) {
|
||||
case glslang::EvqShared: return spv::StorageClassWorkgroup; break;
|
||||
@@ -472,12 +471,12 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
//
|
||||
case glslang::EbvClipDistance:
|
||||
if (!memberDeclaration)
|
||||
builder.addCapability(spv::CapabilityClipDistance);
|
||||
builder.addCapability(spv::CapabilityClipDistance);
|
||||
return spv::BuiltInClipDistance;
|
||||
|
||||
case glslang::EbvCullDistance:
|
||||
if (!memberDeclaration)
|
||||
builder.addCapability(spv::CapabilityCullDistance);
|
||||
builder.addCapability(spv::CapabilityCullDistance);
|
||||
return spv::BuiltInCullDistance;
|
||||
|
||||
case glslang::EbvViewportIndex:
|
||||
@@ -635,23 +634,32 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
||||
builder.addCapability(spv::CapabilityShaderViewportMaskNV);
|
||||
return spv::BuiltInViewportMaskNV;
|
||||
case glslang::EbvSecondaryPositionNV:
|
||||
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
|
||||
builder.addCapability(spv::CapabilityShaderStereoViewNV);
|
||||
if (!memberDeclaration) {
|
||||
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
|
||||
builder.addCapability(spv::CapabilityShaderStereoViewNV);
|
||||
}
|
||||
return spv::BuiltInSecondaryPositionNV;
|
||||
case glslang::EbvSecondaryViewportMaskNV:
|
||||
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
|
||||
builder.addCapability(spv::CapabilityShaderStereoViewNV);
|
||||
if (!memberDeclaration) {
|
||||
builder.addExtension(spv::E_SPV_NV_stereo_view_rendering);
|
||||
builder.addCapability(spv::CapabilityShaderStereoViewNV);
|
||||
}
|
||||
return spv::BuiltInSecondaryViewportMaskNV;
|
||||
case glslang::EbvPositionPerViewNV:
|
||||
builder.addExtension(spv::E_SPV_NVX_multiview_per_view_attributes);
|
||||
builder.addCapability(spv::CapabilityPerViewAttributesNV);
|
||||
if (!memberDeclaration) {
|
||||
builder.addExtension(spv::E_SPV_NVX_multiview_per_view_attributes);
|
||||
builder.addCapability(spv::CapabilityPerViewAttributesNV);
|
||||
}
|
||||
return spv::BuiltInPositionPerViewNV;
|
||||
case glslang::EbvViewportMaskPerViewNV:
|
||||
builder.addExtension(spv::E_SPV_NVX_multiview_per_view_attributes);
|
||||
builder.addCapability(spv::CapabilityPerViewAttributesNV);
|
||||
if (!memberDeclaration) {
|
||||
builder.addExtension(spv::E_SPV_NVX_multiview_per_view_attributes);
|
||||
builder.addCapability(spv::CapabilityPerViewAttributesNV);
|
||||
}
|
||||
return spv::BuiltInViewportMaskPerViewNV;
|
||||
#endif
|
||||
default: return spv::BuiltInMax;
|
||||
default:
|
||||
return spv::BuiltInMax;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2722,7 +2730,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
|
||||
for (int p = 0; p < (int)parameters.size(); ++p) {
|
||||
const glslang::TType& paramType = parameters[p]->getAsTyped()->getType();
|
||||
spv::Id typeId = convertGlslangToSpvType(paramType);
|
||||
if (paramType.isOpaque())
|
||||
if (paramType.containsOpaque())
|
||||
typeId = builder.makePointer(TranslateStorageClass(paramType), typeId);
|
||||
else if (paramType.getQualifier().storage != glslang::EvqConstReadOnly)
|
||||
typeId = builder.makePointer(spv::StorageClassFunction, typeId);
|
||||
@@ -3183,7 +3191,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
|
||||
glslangArgs[a]->traverse(this);
|
||||
argTypes.push_back(¶mType);
|
||||
// keep outputs and opaque objects as l-values, evaluate input-only as r-values
|
||||
if (qualifiers[a] != glslang::EvqConstReadOnly || paramType.isOpaque()) {
|
||||
if (qualifiers[a] != glslang::EvqConstReadOnly || paramType.containsOpaque()) {
|
||||
// save l-value
|
||||
lValues.push_back(builder.getAccessChain());
|
||||
} else {
|
||||
@@ -3202,7 +3210,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
|
||||
for (int a = 0; a < (int)glslangArgs.size(); ++a) {
|
||||
const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType();
|
||||
spv::Id arg;
|
||||
if (paramType.isOpaque()) {
|
||||
if (paramType.containsOpaque()) {
|
||||
builder.setAccessChain(lValues[lValueCount]);
|
||||
arg = builder.accessChainGetLValue();
|
||||
++lValueCount;
|
||||
@@ -5319,6 +5327,8 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName)
|
||||
{
|
||||
std::ofstream out;
|
||||
out.open(baseName, std::ios::binary | std::ios::out);
|
||||
if (out.fail())
|
||||
printf("ERROR: Failed to open file: %s\n", baseName);
|
||||
for (int i = 0; i < (int)spirv.size(); ++i) {
|
||||
unsigned int word = spirv[i];
|
||||
out.write((const char*)&word, 4);
|
||||
@@ -5331,6 +5341,8 @@ void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName,
|
||||
{
|
||||
std::ofstream out;
|
||||
out.open(baseName, std::ios::binary | std::ios::out);
|
||||
if (out.fail())
|
||||
printf("ERROR: Failed to open file: %s\n", baseName);
|
||||
out << "\t// " GLSLANG_REVISION " " GLSLANG_DATE << std::endl;
|
||||
if (varName != nullptr) {
|
||||
out << "\t #pragma once" << std::endl;
|
||||
|
||||
3
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
3
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
@@ -1125,7 +1125,8 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec
|
||||
|
||||
Id Builder::createArrayLength(Id base, unsigned int member)
|
||||
{
|
||||
Instruction* length = new Instruction(getUniqueId(), makeIntType(32), OpArrayLength);
|
||||
spv::Id intType = makeIntType(32);
|
||||
Instruction* length = new Instruction(getUniqueId(), intType, OpArrayLength);
|
||||
length->addIdOperand(base);
|
||||
length->addImmediateOperand(member);
|
||||
buildPoint->addInstruction(std::unique_ptr<Instruction>(length));
|
||||
|
||||
1
3rdparty/glslang/SPIRV/doc.cpp
vendored
1
3rdparty/glslang/SPIRV/doc.cpp
vendored
@@ -835,6 +835,7 @@ const char* CapabilityString(int info)
|
||||
case 5254: return "ShaderViewportIndexLayerNV";
|
||||
case 5255: return "ShaderViewportMaskNV";
|
||||
case 5259: return "ShaderStereoViewNV";
|
||||
case 5262: return "PerViewAttributesNV";
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
16
3rdparty/glslang/StandAlone/StandAlone.cpp
vendored
16
3rdparty/glslang/StandAlone/StandAlone.cpp
vendored
@@ -169,6 +169,7 @@ std::array<unsigned int, EShLangCount> baseSamplerBinding;
|
||||
std::array<unsigned int, EShLangCount> baseTextureBinding;
|
||||
std::array<unsigned int, EShLangCount> baseImageBinding;
|
||||
std::array<unsigned int, EShLangCount> baseUboBinding;
|
||||
std::array<unsigned int, EShLangCount> baseSsboBinding;
|
||||
|
||||
//
|
||||
// Create the default name for saving a binary if -o is not provided.
|
||||
@@ -258,6 +259,7 @@ void ProcessArguments(int argc, char* argv[])
|
||||
baseTextureBinding.fill(0);
|
||||
baseImageBinding.fill(0);
|
||||
baseUboBinding.fill(0);
|
||||
baseSsboBinding.fill(0);
|
||||
|
||||
ExecutableName = argv[0];
|
||||
NumWorkItems = argc; // will include some empties where the '-' options were, but it doesn't matter, they'll be 0
|
||||
@@ -292,6 +294,10 @@ void ProcessArguments(int argc, char* argv[])
|
||||
lowerword == "shift-ubo-binding" ||
|
||||
lowerword == "sub") {
|
||||
ProcessBindingBase(argc, argv, baseUboBinding);
|
||||
} else if (lowerword == "shift-ssbo-bindings" || // synonyms
|
||||
lowerword == "shift-ssbo-binding" ||
|
||||
lowerword == "sbb") {
|
||||
ProcessBindingBase(argc, argv, baseSsboBinding);
|
||||
} else if (lowerword == "auto-map-bindings" || // synonyms
|
||||
lowerword == "auto-map-binding" ||
|
||||
lowerword == "amb") {
|
||||
@@ -582,6 +588,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
shader->setShiftTextureBinding(baseTextureBinding[compUnit.stage]);
|
||||
shader->setShiftImageBinding(baseImageBinding[compUnit.stage]);
|
||||
shader->setShiftUboBinding(baseUboBinding[compUnit.stage]);
|
||||
shader->setShiftSsboBinding(baseSsboBinding[compUnit.stage]);
|
||||
shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0);
|
||||
shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0);
|
||||
|
||||
@@ -662,7 +669,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
if (! (Options & EOptionMemoryLeakMode)) {
|
||||
printf("%s", logger.getAllMessages().c_str());
|
||||
if (Options & EOptionOutputHexadecimal) {
|
||||
glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
|
||||
glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
|
||||
} else {
|
||||
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
|
||||
}
|
||||
@@ -984,6 +991,9 @@ void usage()
|
||||
" --shift-UBO-binding [stage] num set base binding number for UBOs\n"
|
||||
" --sub [stage] num synonym for --shift-UBO-binding\n"
|
||||
"\n"
|
||||
" --shift-ssbo-binding [stage] num set base binding number for SSBOs\n"
|
||||
" --sbb [stage] num synonym for --shift-ssbo-binding\n"
|
||||
"\n"
|
||||
" --auto-map-bindings automatically bind uniform variables without\n"
|
||||
" explicit bindings.\n"
|
||||
" --amb synonym for --auto-map-bindings\n"
|
||||
@@ -999,8 +1009,8 @@ void usage()
|
||||
"\n"
|
||||
" --keep-uncalled don't eliminate uncalled functions when linking\n"
|
||||
" --ku synonym for --keep-uncalled\n"
|
||||
" --variable-name <name> Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.\n"
|
||||
" --vn <name> synonym for --variable-name <name>.\n"
|
||||
" --variable-name <name> Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.\n"
|
||||
" --vn <name> synonym for --variable-name <name>.\n"
|
||||
);
|
||||
|
||||
exit(EFailUsage);
|
||||
|
||||
599
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out
vendored
Normal file
599
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.atomics.frag.out
vendored
Normal file
@@ -0,0 +1,599 @@
|
||||
hlsl.structbuffer.atomics.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:5 Function Parameters:
|
||||
0:5 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:8 AtomicAdd (temp void)
|
||||
0:8 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:8 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:8 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:8 Constant:
|
||||
0:8 0 (const uint)
|
||||
0:8 right-shift (temp int)
|
||||
0:8 Constant:
|
||||
0:8 8 (const int)
|
||||
0:8 Constant:
|
||||
0:8 2 (const int)
|
||||
0:8 Constant:
|
||||
0:8 1 (const int)
|
||||
0:9 move second child to first child (temp uint)
|
||||
0:9 'u' (temp uint)
|
||||
0:9 AtomicAdd (temp uint)
|
||||
0:9 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:9 Constant:
|
||||
0:9 0 (const uint)
|
||||
0:9 right-shift (temp int)
|
||||
0:9 Constant:
|
||||
0:9 8 (const int)
|
||||
0:9 Constant:
|
||||
0:9 2 (const int)
|
||||
0:9 Constant:
|
||||
0:9 1 (const int)
|
||||
0:10 AtomicAnd (temp void)
|
||||
0:10 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:10 Constant:
|
||||
0:10 0 (const uint)
|
||||
0:10 right-shift (temp int)
|
||||
0:10 Constant:
|
||||
0:10 8 (const int)
|
||||
0:10 Constant:
|
||||
0:10 2 (const int)
|
||||
0:10 Constant:
|
||||
0:10 1 (const int)
|
||||
0:11 move second child to first child (temp uint)
|
||||
0:11 'u' (temp uint)
|
||||
0:11 AtomicAnd (temp uint)
|
||||
0:11 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 right-shift (temp int)
|
||||
0:11 Constant:
|
||||
0:11 8 (const int)
|
||||
0:11 Constant:
|
||||
0:11 2 (const int)
|
||||
0:11 Constant:
|
||||
0:11 1 (const int)
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:12 'u' (temp uint)
|
||||
0:12 Convert int to uint (temp uint)
|
||||
0:12 AtomicCompSwap (temp int)
|
||||
0:12 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 right-shift (temp int)
|
||||
0:12 Constant:
|
||||
0:12 8 (const int)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:12 Constant:
|
||||
0:12 1 (const int)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:14 move second child to first child (temp uint)
|
||||
0:14 'u' (temp uint)
|
||||
0:14 AtomicExchange (temp uint)
|
||||
0:14 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:14 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:14 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:14 Constant:
|
||||
0:14 0 (const uint)
|
||||
0:14 right-shift (temp int)
|
||||
0:14 Constant:
|
||||
0:14 8 (const int)
|
||||
0:14 Constant:
|
||||
0:14 2 (const int)
|
||||
0:14 Constant:
|
||||
0:14 1 (const int)
|
||||
0:15 AtomicMax (temp void)
|
||||
0:15 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:15 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:15 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:15 Constant:
|
||||
0:15 0 (const uint)
|
||||
0:15 right-shift (temp int)
|
||||
0:15 Constant:
|
||||
0:15 8 (const int)
|
||||
0:15 Constant:
|
||||
0:15 2 (const int)
|
||||
0:15 Constant:
|
||||
0:15 1 (const int)
|
||||
0:16 move second child to first child (temp uint)
|
||||
0:16 'u' (temp uint)
|
||||
0:16 AtomicMax (temp uint)
|
||||
0:16 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:16 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:16 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:16 Constant:
|
||||
0:16 0 (const uint)
|
||||
0:16 right-shift (temp int)
|
||||
0:16 Constant:
|
||||
0:16 8 (const int)
|
||||
0:16 Constant:
|
||||
0:16 2 (const int)
|
||||
0:16 Constant:
|
||||
0:16 1 (const int)
|
||||
0:17 AtomicMin (temp void)
|
||||
0:17 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 right-shift (temp int)
|
||||
0:17 Constant:
|
||||
0:17 8 (const int)
|
||||
0:17 Constant:
|
||||
0:17 2 (const int)
|
||||
0:17 Constant:
|
||||
0:17 1 (const int)
|
||||
0:18 move second child to first child (temp uint)
|
||||
0:18 'u' (temp uint)
|
||||
0:18 AtomicMin (temp uint)
|
||||
0:18 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:18 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:18 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:18 Constant:
|
||||
0:18 0 (const uint)
|
||||
0:18 right-shift (temp int)
|
||||
0:18 Constant:
|
||||
0:18 8 (const int)
|
||||
0:18 Constant:
|
||||
0:18 2 (const int)
|
||||
0:18 Constant:
|
||||
0:18 1 (const int)
|
||||
0:19 AtomicOr (temp void)
|
||||
0:19 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 right-shift (temp int)
|
||||
0:19 Constant:
|
||||
0:19 8 (const int)
|
||||
0:19 Constant:
|
||||
0:19 2 (const int)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:20 move second child to first child (temp uint)
|
||||
0:20 'u' (temp uint)
|
||||
0:20 AtomicOr (temp uint)
|
||||
0:20 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 right-shift (temp int)
|
||||
0:20 Constant:
|
||||
0:20 8 (const int)
|
||||
0:20 Constant:
|
||||
0:20 2 (const int)
|
||||
0:20 Constant:
|
||||
0:20 1 (const int)
|
||||
0:21 AtomicXor (temp void)
|
||||
0:21 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:21 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:21 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 right-shift (temp int)
|
||||
0:21 Constant:
|
||||
0:21 8 (const int)
|
||||
0:21 Constant:
|
||||
0:21 2 (const int)
|
||||
0:21 Constant:
|
||||
0:21 1 (const int)
|
||||
0:22 move second child to first child (temp uint)
|
||||
0:22 'u' (temp uint)
|
||||
0:22 AtomicXor (temp uint)
|
||||
0:22 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:22 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:22 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:22 Constant:
|
||||
0:22 0 (const uint)
|
||||
0:22 right-shift (temp int)
|
||||
0:22 Constant:
|
||||
0:22 8 (const int)
|
||||
0:22 Constant:
|
||||
0:22 2 (const int)
|
||||
0:22 Constant:
|
||||
0:22 1 (const int)
|
||||
0:24 Branch: Return with expression
|
||||
0:24 Construct vec4 (temp 4-component vector of float)
|
||||
0:24 Convert uint to float (temp float)
|
||||
0:24 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:24 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:24 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:24 Constant:
|
||||
0:24 0 (const uint)
|
||||
0:24 right-shift (temp int)
|
||||
0:24 'pos' (in uint)
|
||||
0:24 Constant:
|
||||
0:24 2 (const int)
|
||||
0:5 Function Definition: main( (temp void)
|
||||
0:5 Function Parameters:
|
||||
0:? Sequence
|
||||
0:5 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:5 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:5 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:5 Function Parameters:
|
||||
0:5 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:8 AtomicAdd (temp void)
|
||||
0:8 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:8 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:8 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:8 Constant:
|
||||
0:8 0 (const uint)
|
||||
0:8 right-shift (temp int)
|
||||
0:8 Constant:
|
||||
0:8 8 (const int)
|
||||
0:8 Constant:
|
||||
0:8 2 (const int)
|
||||
0:8 Constant:
|
||||
0:8 1 (const int)
|
||||
0:9 move second child to first child (temp uint)
|
||||
0:9 'u' (temp uint)
|
||||
0:9 AtomicAdd (temp uint)
|
||||
0:9 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:9 Constant:
|
||||
0:9 0 (const uint)
|
||||
0:9 right-shift (temp int)
|
||||
0:9 Constant:
|
||||
0:9 8 (const int)
|
||||
0:9 Constant:
|
||||
0:9 2 (const int)
|
||||
0:9 Constant:
|
||||
0:9 1 (const int)
|
||||
0:10 AtomicAnd (temp void)
|
||||
0:10 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:10 Constant:
|
||||
0:10 0 (const uint)
|
||||
0:10 right-shift (temp int)
|
||||
0:10 Constant:
|
||||
0:10 8 (const int)
|
||||
0:10 Constant:
|
||||
0:10 2 (const int)
|
||||
0:10 Constant:
|
||||
0:10 1 (const int)
|
||||
0:11 move second child to first child (temp uint)
|
||||
0:11 'u' (temp uint)
|
||||
0:11 AtomicAnd (temp uint)
|
||||
0:11 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 right-shift (temp int)
|
||||
0:11 Constant:
|
||||
0:11 8 (const int)
|
||||
0:11 Constant:
|
||||
0:11 2 (const int)
|
||||
0:11 Constant:
|
||||
0:11 1 (const int)
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:12 'u' (temp uint)
|
||||
0:12 Convert int to uint (temp uint)
|
||||
0:12 AtomicCompSwap (temp int)
|
||||
0:12 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 right-shift (temp int)
|
||||
0:12 Constant:
|
||||
0:12 8 (const int)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:12 Constant:
|
||||
0:12 1 (const int)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:14 move second child to first child (temp uint)
|
||||
0:14 'u' (temp uint)
|
||||
0:14 AtomicExchange (temp uint)
|
||||
0:14 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:14 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:14 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:14 Constant:
|
||||
0:14 0 (const uint)
|
||||
0:14 right-shift (temp int)
|
||||
0:14 Constant:
|
||||
0:14 8 (const int)
|
||||
0:14 Constant:
|
||||
0:14 2 (const int)
|
||||
0:14 Constant:
|
||||
0:14 1 (const int)
|
||||
0:15 AtomicMax (temp void)
|
||||
0:15 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:15 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:15 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:15 Constant:
|
||||
0:15 0 (const uint)
|
||||
0:15 right-shift (temp int)
|
||||
0:15 Constant:
|
||||
0:15 8 (const int)
|
||||
0:15 Constant:
|
||||
0:15 2 (const int)
|
||||
0:15 Constant:
|
||||
0:15 1 (const int)
|
||||
0:16 move second child to first child (temp uint)
|
||||
0:16 'u' (temp uint)
|
||||
0:16 AtomicMax (temp uint)
|
||||
0:16 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:16 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:16 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:16 Constant:
|
||||
0:16 0 (const uint)
|
||||
0:16 right-shift (temp int)
|
||||
0:16 Constant:
|
||||
0:16 8 (const int)
|
||||
0:16 Constant:
|
||||
0:16 2 (const int)
|
||||
0:16 Constant:
|
||||
0:16 1 (const int)
|
||||
0:17 AtomicMin (temp void)
|
||||
0:17 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 right-shift (temp int)
|
||||
0:17 Constant:
|
||||
0:17 8 (const int)
|
||||
0:17 Constant:
|
||||
0:17 2 (const int)
|
||||
0:17 Constant:
|
||||
0:17 1 (const int)
|
||||
0:18 move second child to first child (temp uint)
|
||||
0:18 'u' (temp uint)
|
||||
0:18 AtomicMin (temp uint)
|
||||
0:18 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:18 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:18 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:18 Constant:
|
||||
0:18 0 (const uint)
|
||||
0:18 right-shift (temp int)
|
||||
0:18 Constant:
|
||||
0:18 8 (const int)
|
||||
0:18 Constant:
|
||||
0:18 2 (const int)
|
||||
0:18 Constant:
|
||||
0:18 1 (const int)
|
||||
0:19 AtomicOr (temp void)
|
||||
0:19 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 right-shift (temp int)
|
||||
0:19 Constant:
|
||||
0:19 8 (const int)
|
||||
0:19 Constant:
|
||||
0:19 2 (const int)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:20 move second child to first child (temp uint)
|
||||
0:20 'u' (temp uint)
|
||||
0:20 AtomicOr (temp uint)
|
||||
0:20 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 right-shift (temp int)
|
||||
0:20 Constant:
|
||||
0:20 8 (const int)
|
||||
0:20 Constant:
|
||||
0:20 2 (const int)
|
||||
0:20 Constant:
|
||||
0:20 1 (const int)
|
||||
0:21 AtomicXor (temp void)
|
||||
0:21 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:21 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:21 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 right-shift (temp int)
|
||||
0:21 Constant:
|
||||
0:21 8 (const int)
|
||||
0:21 Constant:
|
||||
0:21 2 (const int)
|
||||
0:21 Constant:
|
||||
0:21 1 (const int)
|
||||
0:22 move second child to first child (temp uint)
|
||||
0:22 'u' (temp uint)
|
||||
0:22 AtomicXor (temp uint)
|
||||
0:22 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:22 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:22 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:22 Constant:
|
||||
0:22 0 (const uint)
|
||||
0:22 right-shift (temp int)
|
||||
0:22 Constant:
|
||||
0:22 8 (const int)
|
||||
0:22 Constant:
|
||||
0:22 2 (const int)
|
||||
0:22 Constant:
|
||||
0:22 1 (const int)
|
||||
0:24 Branch: Return with expression
|
||||
0:24 Construct vec4 (temp 4-component vector of float)
|
||||
0:24 Convert uint to float (temp float)
|
||||
0:24 indirect index (layout(row_major std430 ) buffer uint)
|
||||
0:24 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint)
|
||||
0:24 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:24 Constant:
|
||||
0:24 0 (const uint)
|
||||
0:24 right-shift (temp int)
|
||||
0:24 'pos' (in uint)
|
||||
0:24 Constant:
|
||||
0:24 2 (const int)
|
||||
0:5 Function Definition: main( (temp void)
|
||||
0:5 Function Parameters:
|
||||
0:? Sequence
|
||||
0:5 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:5 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:5 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 87
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 80 83
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 12 "@main(u1;"
|
||||
Name 11 "pos"
|
||||
Name 15 "sbuf"
|
||||
MemberName 15(sbuf) 0 "sbuf"
|
||||
Name 17 ""
|
||||
Name 29 "u"
|
||||
Name 78 "pos"
|
||||
Name 80 "pos"
|
||||
Name 83 "@entryPointOutput"
|
||||
Name 84 "param"
|
||||
Decorate 14 ArrayStride 4
|
||||
MemberDecorate 15(sbuf) 0 Offset 0
|
||||
Decorate 15(sbuf) BufferBlock
|
||||
Decorate 17 DescriptorSet 0
|
||||
Decorate 80(pos) Location 0
|
||||
Decorate 83(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
8: TypeFloat 32
|
||||
9: TypeVector 8(float) 4
|
||||
10: TypeFunction 9(fvec4) 7(ptr)
|
||||
14: TypeRuntimeArray 6(int)
|
||||
15(sbuf): TypeStruct 14
|
||||
16: TypePointer Uniform 15(sbuf)
|
||||
17: 16(ptr) Variable Uniform
|
||||
18: TypeInt 32 1
|
||||
19: 18(int) Constant 0
|
||||
20: 18(int) Constant 8
|
||||
21: 18(int) Constant 2
|
||||
23: TypePointer Uniform 6(int)
|
||||
25: 18(int) Constant 1
|
||||
26: 6(int) Constant 1
|
||||
27: 6(int) Constant 0
|
||||
79: TypePointer Input 6(int)
|
||||
80(pos): 79(ptr) Variable Input
|
||||
82: TypePointer Output 9(fvec4)
|
||||
83(@entryPointOutput): 82(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
78(pos): 7(ptr) Variable Function
|
||||
84(param): 7(ptr) Variable Function
|
||||
81: 6(int) Load 80(pos)
|
||||
Store 78(pos) 81
|
||||
85: 6(int) Load 78(pos)
|
||||
Store 84(param) 85
|
||||
86: 9(fvec4) FunctionCall 12(@main(u1;) 84(param)
|
||||
Store 83(@entryPointOutput) 86
|
||||
Return
|
||||
FunctionEnd
|
||||
12(@main(u1;): 9(fvec4) Function None 10
|
||||
11(pos): 7(ptr) FunctionParameter
|
||||
13: Label
|
||||
29(u): 7(ptr) Variable Function
|
||||
22: 18(int) ShiftRightArithmetic 20 21
|
||||
24: 23(ptr) AccessChain 17 19 22
|
||||
28: 2 AtomicIAdd 24 26 27 25
|
||||
30: 18(int) ShiftRightArithmetic 20 21
|
||||
31: 23(ptr) AccessChain 17 19 30
|
||||
32: 6(int) AtomicIAdd 31 26 27 25
|
||||
Store 29(u) 32
|
||||
33: 18(int) ShiftRightArithmetic 20 21
|
||||
34: 23(ptr) AccessChain 17 19 33
|
||||
35: 2 AtomicAnd 34 26 27 25
|
||||
36: 18(int) ShiftRightArithmetic 20 21
|
||||
37: 23(ptr) AccessChain 17 19 36
|
||||
38: 6(int) AtomicAnd 37 26 27 25
|
||||
Store 29(u) 38
|
||||
39: 18(int) ShiftRightArithmetic 20 21
|
||||
40: 23(ptr) AccessChain 17 19 39
|
||||
41: 18(int) AtomicCompareExchange 40 26 27 27 21 25
|
||||
42: 6(int) Bitcast 41
|
||||
Store 29(u) 42
|
||||
43: 18(int) ShiftRightArithmetic 20 21
|
||||
44: 23(ptr) AccessChain 17 19 43
|
||||
45: 6(int) AtomicExchange 44 26 27 25
|
||||
Store 29(u) 45
|
||||
46: 18(int) ShiftRightArithmetic 20 21
|
||||
47: 23(ptr) AccessChain 17 19 46
|
||||
48: 2 AtomicSMax 47 26 27 25
|
||||
49: 18(int) ShiftRightArithmetic 20 21
|
||||
50: 23(ptr) AccessChain 17 19 49
|
||||
51: 6(int) AtomicUMax 50 26 27 25
|
||||
Store 29(u) 51
|
||||
52: 18(int) ShiftRightArithmetic 20 21
|
||||
53: 23(ptr) AccessChain 17 19 52
|
||||
54: 2 AtomicSMin 53 26 27 25
|
||||
55: 18(int) ShiftRightArithmetic 20 21
|
||||
56: 23(ptr) AccessChain 17 19 55
|
||||
57: 6(int) AtomicUMin 56 26 27 25
|
||||
Store 29(u) 57
|
||||
58: 18(int) ShiftRightArithmetic 20 21
|
||||
59: 23(ptr) AccessChain 17 19 58
|
||||
60: 2 AtomicOr 59 26 27 25
|
||||
61: 18(int) ShiftRightArithmetic 20 21
|
||||
62: 23(ptr) AccessChain 17 19 61
|
||||
63: 6(int) AtomicOr 62 26 27 25
|
||||
Store 29(u) 63
|
||||
64: 18(int) ShiftRightArithmetic 20 21
|
||||
65: 23(ptr) AccessChain 17 19 64
|
||||
66: 2 AtomicXor 65 26 27 25
|
||||
67: 18(int) ShiftRightArithmetic 20 21
|
||||
68: 23(ptr) AccessChain 17 19 67
|
||||
69: 6(int) AtomicXor 68 26 27 25
|
||||
Store 29(u) 69
|
||||
70: 6(int) Load 11(pos)
|
||||
71: 18(int) ShiftRightLogical 70 21
|
||||
72: 23(ptr) AccessChain 17 19 71
|
||||
73: 6(int) Load 72
|
||||
74: 8(float) ConvertUToF 73
|
||||
75: 9(fvec4) CompositeConstruct 74 74 74 74
|
||||
ReturnValue 75
|
||||
FunctionEnd
|
||||
476
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out
vendored
Normal file
476
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.byte.frag.out
vendored
Normal file
@@ -0,0 +1,476 @@
|
||||
hlsl.structbuffer.byte.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:5 Function Parameters:
|
||||
0:5 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:7 Sequence
|
||||
0:7 move second child to first child (temp uint)
|
||||
0:7 'size' (temp uint)
|
||||
0:7 array length (temp uint)
|
||||
0:7 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:7 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:7 Constant:
|
||||
0:7 0 (const uint)
|
||||
0:12 Branch: Return with expression
|
||||
0:11 add (temp 4-component vector of float)
|
||||
0:10 add (temp 4-component vector of float)
|
||||
0:9 add (temp 4-component vector of float)
|
||||
0:9 Convert uint to float (temp float)
|
||||
0:9 indirect index (layout(row_major std430 ) readonly buffer uint)
|
||||
0:9 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:9 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:9 Constant:
|
||||
0:9 0 (const uint)
|
||||
0:9 right-shift (temp int)
|
||||
0:9 'pos' (in uint)
|
||||
0:9 Constant:
|
||||
0:9 2 (const int)
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:? Convert uint to float (temp 2-component vector of float)
|
||||
0:? Sequence
|
||||
0:10 move second child to first child (temp int)
|
||||
0:10 'byteAddrTemp' (temp int)
|
||||
0:10 right-shift (temp int)
|
||||
0:10 add (temp uint)
|
||||
0:10 'pos' (in uint)
|
||||
0:10 Constant:
|
||||
0:10 4 (const uint)
|
||||
0:10 Constant:
|
||||
0:10 2 (const int)
|
||||
0:? Construct vec2 (temp 2-component vector of uint)
|
||||
0:10 indirect index (temp float)
|
||||
0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:10 Constant:
|
||||
0:10 0 (const uint)
|
||||
0:10 'byteAddrTemp' (temp int)
|
||||
0:10 indirect index (temp float)
|
||||
0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:10 Constant:
|
||||
0:10 0 (const uint)
|
||||
0:10 add (temp int)
|
||||
0:10 'byteAddrTemp' (temp int)
|
||||
0:10 Constant:
|
||||
0:10 1 (const int)
|
||||
0:10 Constant:
|
||||
0:10 0.000000
|
||||
0:10 Constant:
|
||||
0:10 0.000000
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:? Convert uint to float (temp 3-component vector of float)
|
||||
0:? Sequence
|
||||
0:11 move second child to first child (temp int)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 right-shift (temp int)
|
||||
0:11 add (temp uint)
|
||||
0:11 'pos' (in uint)
|
||||
0:11 Constant:
|
||||
0:11 8 (const uint)
|
||||
0:11 Constant:
|
||||
0:11 2 (const int)
|
||||
0:? Construct vec3 (temp 3-component vector of uint)
|
||||
0:11 indirect index (temp float)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 indirect index (temp float)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 add (temp int)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 Constant:
|
||||
0:11 1 (const int)
|
||||
0:11 indirect index (temp float)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 add (temp int)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 Constant:
|
||||
0:11 2 (const int)
|
||||
0:11 Constant:
|
||||
0:11 0.000000
|
||||
0:? Convert uint to float (temp 4-component vector of float)
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 right-shift (temp int)
|
||||
0:12 add (temp uint)
|
||||
0:12 'pos' (in uint)
|
||||
0:12 Constant:
|
||||
0:12 12 (const uint)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:? Construct vec4 (temp 4-component vector of uint)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 add (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 Constant:
|
||||
0:12 1 (const int)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 add (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 add (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 Constant:
|
||||
0:12 3 (const int)
|
||||
0:5 Function Definition: main( (temp void)
|
||||
0:5 Function Parameters:
|
||||
0:? Sequence
|
||||
0:5 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:5 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:5 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:5 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:5 Function Parameters:
|
||||
0:5 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:7 Sequence
|
||||
0:7 move second child to first child (temp uint)
|
||||
0:7 'size' (temp uint)
|
||||
0:7 array length (temp uint)
|
||||
0:7 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:7 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:7 Constant:
|
||||
0:7 0 (const uint)
|
||||
0:12 Branch: Return with expression
|
||||
0:11 add (temp 4-component vector of float)
|
||||
0:10 add (temp 4-component vector of float)
|
||||
0:9 add (temp 4-component vector of float)
|
||||
0:9 Convert uint to float (temp float)
|
||||
0:9 indirect index (layout(row_major std430 ) readonly buffer uint)
|
||||
0:9 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:9 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:9 Constant:
|
||||
0:9 0 (const uint)
|
||||
0:9 right-shift (temp int)
|
||||
0:9 'pos' (in uint)
|
||||
0:9 Constant:
|
||||
0:9 2 (const int)
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:? Convert uint to float (temp 2-component vector of float)
|
||||
0:? Sequence
|
||||
0:10 move second child to first child (temp int)
|
||||
0:10 'byteAddrTemp' (temp int)
|
||||
0:10 right-shift (temp int)
|
||||
0:10 add (temp uint)
|
||||
0:10 'pos' (in uint)
|
||||
0:10 Constant:
|
||||
0:10 4 (const uint)
|
||||
0:10 Constant:
|
||||
0:10 2 (const int)
|
||||
0:? Construct vec2 (temp 2-component vector of uint)
|
||||
0:10 indirect index (temp float)
|
||||
0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:10 Constant:
|
||||
0:10 0 (const uint)
|
||||
0:10 'byteAddrTemp' (temp int)
|
||||
0:10 indirect index (temp float)
|
||||
0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:10 Constant:
|
||||
0:10 0 (const uint)
|
||||
0:10 add (temp int)
|
||||
0:10 'byteAddrTemp' (temp int)
|
||||
0:10 Constant:
|
||||
0:10 1 (const int)
|
||||
0:10 Constant:
|
||||
0:10 0.000000
|
||||
0:10 Constant:
|
||||
0:10 0.000000
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:? Convert uint to float (temp 3-component vector of float)
|
||||
0:? Sequence
|
||||
0:11 move second child to first child (temp int)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 right-shift (temp int)
|
||||
0:11 add (temp uint)
|
||||
0:11 'pos' (in uint)
|
||||
0:11 Constant:
|
||||
0:11 8 (const uint)
|
||||
0:11 Constant:
|
||||
0:11 2 (const int)
|
||||
0:? Construct vec3 (temp 3-component vector of uint)
|
||||
0:11 indirect index (temp float)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 indirect index (temp float)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 add (temp int)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 Constant:
|
||||
0:11 1 (const int)
|
||||
0:11 indirect index (temp float)
|
||||
0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:11 Constant:
|
||||
0:11 0 (const uint)
|
||||
0:11 add (temp int)
|
||||
0:11 'byteAddrTemp' (temp int)
|
||||
0:11 Constant:
|
||||
0:11 2 (const int)
|
||||
0:11 Constant:
|
||||
0:11 0.000000
|
||||
0:? Convert uint to float (temp 4-component vector of float)
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 right-shift (temp int)
|
||||
0:12 add (temp uint)
|
||||
0:12 'pos' (in uint)
|
||||
0:12 Constant:
|
||||
0:12 12 (const uint)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:? Construct vec4 (temp 4-component vector of uint)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 add (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 Constant:
|
||||
0:12 1 (const int)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 add (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 Constant:
|
||||
0:12 2 (const int)
|
||||
0:12 indirect index (temp float)
|
||||
0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint)
|
||||
0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:12 Constant:
|
||||
0:12 0 (const uint)
|
||||
0:12 add (temp int)
|
||||
0:12 'byteAddrTemp' (temp int)
|
||||
0:12 Constant:
|
||||
0:12 3 (const int)
|
||||
0:5 Function Definition: main( (temp void)
|
||||
0:5 Function Parameters:
|
||||
0:? Sequence
|
||||
0:5 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:5 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:5 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 114
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 107 110
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 12 "@main(u1;"
|
||||
Name 11 "pos"
|
||||
Name 14 "size"
|
||||
Name 16 "sbuf"
|
||||
MemberName 16(sbuf) 0 "sbuf"
|
||||
Name 18 ""
|
||||
Name 30 "byteAddrTemp"
|
||||
Name 53 "byteAddrTemp"
|
||||
Name 78 "byteAddrTemp"
|
||||
Name 105 "pos"
|
||||
Name 107 "pos"
|
||||
Name 110 "@entryPointOutput"
|
||||
Name 111 "param"
|
||||
Decorate 15 ArrayStride 4
|
||||
MemberDecorate 16(sbuf) 0 NonWritable
|
||||
MemberDecorate 16(sbuf) 0 Offset 0
|
||||
Decorate 16(sbuf) BufferBlock
|
||||
Decorate 18 DescriptorSet 0
|
||||
Decorate 107(pos) Location 0
|
||||
Decorate 110(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
8: TypeFloat 32
|
||||
9: TypeVector 8(float) 4
|
||||
10: TypeFunction 9(fvec4) 7(ptr)
|
||||
15: TypeRuntimeArray 6(int)
|
||||
16(sbuf): TypeStruct 15
|
||||
17: TypePointer Uniform 16(sbuf)
|
||||
18: 17(ptr) Variable Uniform
|
||||
19: TypeInt 32 1
|
||||
21: 19(int) Constant 0
|
||||
23: 19(int) Constant 2
|
||||
25: TypePointer Uniform 6(int)
|
||||
29: TypePointer Function 19(int)
|
||||
32: 6(int) Constant 4
|
||||
39: 19(int) Constant 1
|
||||
43: TypeVector 6(int) 2
|
||||
45: TypeVector 8(float) 2
|
||||
47: 8(float) Constant 0
|
||||
55: 6(int) Constant 8
|
||||
69: TypeVector 6(int) 3
|
||||
71: TypeVector 8(float) 3
|
||||
80: 6(int) Constant 12
|
||||
95: 19(int) Constant 3
|
||||
99: TypeVector 6(int) 4
|
||||
106: TypePointer Input 6(int)
|
||||
107(pos): 106(ptr) Variable Input
|
||||
109: TypePointer Output 9(fvec4)
|
||||
110(@entryPointOutput): 109(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
105(pos): 7(ptr) Variable Function
|
||||
111(param): 7(ptr) Variable Function
|
||||
108: 6(int) Load 107(pos)
|
||||
Store 105(pos) 108
|
||||
112: 6(int) Load 105(pos)
|
||||
Store 111(param) 112
|
||||
113: 9(fvec4) FunctionCall 12(@main(u1;) 111(param)
|
||||
Store 110(@entryPointOutput) 113
|
||||
Return
|
||||
FunctionEnd
|
||||
12(@main(u1;): 9(fvec4) Function None 10
|
||||
11(pos): 7(ptr) FunctionParameter
|
||||
13: Label
|
||||
14(size): 7(ptr) Variable Function
|
||||
30(byteAddrTemp): 29(ptr) Variable Function
|
||||
53(byteAddrTemp): 29(ptr) Variable Function
|
||||
78(byteAddrTemp): 29(ptr) Variable Function
|
||||
20: 19(int) ArrayLength 18 0
|
||||
Store 14(size) 20
|
||||
22: 6(int) Load 11(pos)
|
||||
24: 19(int) ShiftRightLogical 22 23
|
||||
26: 25(ptr) AccessChain 18 21 24
|
||||
27: 6(int) Load 26
|
||||
28: 8(float) ConvertUToF 27
|
||||
31: 6(int) Load 11(pos)
|
||||
33: 6(int) IAdd 31 32
|
||||
34: 19(int) ShiftRightLogical 33 23
|
||||
Store 30(byteAddrTemp) 34
|
||||
35: 19(int) Load 30(byteAddrTemp)
|
||||
36: 25(ptr) AccessChain 18 21 35
|
||||
37: 6(int) Load 36
|
||||
38: 19(int) Load 30(byteAddrTemp)
|
||||
40: 19(int) IAdd 38 39
|
||||
41: 25(ptr) AccessChain 18 21 40
|
||||
42: 6(int) Load 41
|
||||
44: 43(ivec2) CompositeConstruct 37 42
|
||||
46: 45(fvec2) ConvertUToF 44
|
||||
48: 8(float) CompositeExtract 46 0
|
||||
49: 8(float) CompositeExtract 46 1
|
||||
50: 9(fvec4) CompositeConstruct 48 49 47 47
|
||||
51: 9(fvec4) CompositeConstruct 28 28 28 28
|
||||
52: 9(fvec4) FAdd 51 50
|
||||
54: 6(int) Load 11(pos)
|
||||
56: 6(int) IAdd 54 55
|
||||
57: 19(int) ShiftRightLogical 56 23
|
||||
Store 53(byteAddrTemp) 57
|
||||
58: 19(int) Load 53(byteAddrTemp)
|
||||
59: 25(ptr) AccessChain 18 21 58
|
||||
60: 6(int) Load 59
|
||||
61: 19(int) Load 53(byteAddrTemp)
|
||||
62: 19(int) IAdd 61 39
|
||||
63: 25(ptr) AccessChain 18 21 62
|
||||
64: 6(int) Load 63
|
||||
65: 19(int) Load 53(byteAddrTemp)
|
||||
66: 19(int) IAdd 65 23
|
||||
67: 25(ptr) AccessChain 18 21 66
|
||||
68: 6(int) Load 67
|
||||
70: 69(ivec3) CompositeConstruct 60 64 68
|
||||
72: 71(fvec3) ConvertUToF 70
|
||||
73: 8(float) CompositeExtract 72 0
|
||||
74: 8(float) CompositeExtract 72 1
|
||||
75: 8(float) CompositeExtract 72 2
|
||||
76: 9(fvec4) CompositeConstruct 73 74 75 47
|
||||
77: 9(fvec4) FAdd 52 76
|
||||
79: 6(int) Load 11(pos)
|
||||
81: 6(int) IAdd 79 80
|
||||
82: 19(int) ShiftRightLogical 81 23
|
||||
Store 78(byteAddrTemp) 82
|
||||
83: 19(int) Load 78(byteAddrTemp)
|
||||
84: 25(ptr) AccessChain 18 21 83
|
||||
85: 6(int) Load 84
|
||||
86: 19(int) Load 78(byteAddrTemp)
|
||||
87: 19(int) IAdd 86 39
|
||||
88: 25(ptr) AccessChain 18 21 87
|
||||
89: 6(int) Load 88
|
||||
90: 19(int) Load 78(byteAddrTemp)
|
||||
91: 19(int) IAdd 90 23
|
||||
92: 25(ptr) AccessChain 18 21 91
|
||||
93: 6(int) Load 92
|
||||
94: 19(int) Load 78(byteAddrTemp)
|
||||
96: 19(int) IAdd 94 95
|
||||
97: 25(ptr) AccessChain 18 21 96
|
||||
98: 6(int) Load 97
|
||||
100: 99(ivec4) CompositeConstruct 85 89 93 98
|
||||
101: 9(fvec4) ConvertUToF 100
|
||||
102: 9(fvec4) FAdd 77 101
|
||||
ReturnValue 102
|
||||
FunctionEnd
|
||||
308
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out
vendored
Normal file
308
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.coherent.frag.out
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
hlsl.structbuffer.coherent.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:12 Function Parameters:
|
||||
0:12 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:13 move second child to first child (temp float)
|
||||
0:13 indirect index (layout(row_major std430 ) coherent temp float)
|
||||
0:13 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float)
|
||||
0:13 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2})
|
||||
0:13 Constant:
|
||||
0:13 0 (const uint)
|
||||
0:13 add (temp uint)
|
||||
0:13 'pos' (in uint)
|
||||
0:13 Constant:
|
||||
0:13 1 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 42.000000
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'size' (temp uint)
|
||||
0:17 array length (temp uint)
|
||||
0:17 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:17 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'stride' (temp uint)
|
||||
0:17 Constant:
|
||||
0:17 16 (const uint)
|
||||
0:19 Test condition and select (temp void)
|
||||
0:19 Condition
|
||||
0:19 test: direct index for structure (temp bool)
|
||||
0:19 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 'pos' (in uint)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:19 true case
|
||||
0:20 Branch: Return with expression
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:20 add (temp 3-component vector of float)
|
||||
0:20 color: direct index for structure (temp 3-component vector of float)
|
||||
0:20 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0 (const int)
|
||||
0:20 indirect index (layout(row_major std430 ) coherent temp float)
|
||||
0:20 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float)
|
||||
0:20 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0.000000
|
||||
0:19 false case
|
||||
0:22 Branch: Return with expression
|
||||
0:22 Construct vec4 (temp 4-component vector of float)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 add (temp uint)
|
||||
0:22 'size' (temp uint)
|
||||
0:22 'stride' (temp uint)
|
||||
0:12 Function Definition: main( (temp void)
|
||||
0:12 Function Parameters:
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:12 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:12 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:? 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:12 Function Parameters:
|
||||
0:12 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:13 move second child to first child (temp float)
|
||||
0:13 indirect index (layout(row_major std430 ) coherent temp float)
|
||||
0:13 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float)
|
||||
0:13 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2})
|
||||
0:13 Constant:
|
||||
0:13 0 (const uint)
|
||||
0:13 add (temp uint)
|
||||
0:13 'pos' (in uint)
|
||||
0:13 Constant:
|
||||
0:13 1 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 42.000000
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'size' (temp uint)
|
||||
0:17 array length (temp uint)
|
||||
0:17 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:17 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'stride' (temp uint)
|
||||
0:17 Constant:
|
||||
0:17 16 (const uint)
|
||||
0:19 Test condition and select (temp void)
|
||||
0:19 Condition
|
||||
0:19 test: direct index for structure (temp bool)
|
||||
0:19 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 'pos' (in uint)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:19 true case
|
||||
0:20 Branch: Return with expression
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:20 add (temp 3-component vector of float)
|
||||
0:20 color: direct index for structure (temp 3-component vector of float)
|
||||
0:20 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0 (const int)
|
||||
0:20 indirect index (layout(row_major std430 ) coherent temp float)
|
||||
0:20 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float)
|
||||
0:20 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0.000000
|
||||
0:19 false case
|
||||
0:22 Branch: Return with expression
|
||||
0:22 Construct vec4 (temp 4-component vector of float)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 add (temp uint)
|
||||
0:22 'size' (temp uint)
|
||||
0:22 'stride' (temp uint)
|
||||
0:12 Function Definition: main( (temp void)
|
||||
0:12 Function Parameters:
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:12 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:12 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:? 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 78
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 71 74
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 12 "@main(u1;"
|
||||
Name 11 "pos"
|
||||
Name 15 "sbuf2"
|
||||
MemberName 15(sbuf2) 0 "sbuf2"
|
||||
Name 17 ""
|
||||
Name 26 "size"
|
||||
Name 28 "sb_t"
|
||||
MemberName 28(sb_t) 0 "color"
|
||||
MemberName 28(sb_t) 1 "test"
|
||||
Name 30 "sbuf"
|
||||
MemberName 30(sbuf) 0 "sbuf"
|
||||
Name 32 ""
|
||||
Name 34 "stride"
|
||||
Name 69 "pos"
|
||||
Name 71 "pos"
|
||||
Name 74 "@entryPointOutput"
|
||||
Name 75 "param"
|
||||
Decorate 14 ArrayStride 4
|
||||
MemberDecorate 15(sbuf2) 0 Coherent
|
||||
MemberDecorate 15(sbuf2) 0 Offset 0
|
||||
Decorate 15(sbuf2) BufferBlock
|
||||
Decorate 17 DescriptorSet 0
|
||||
MemberDecorate 28(sb_t) 0 Coherent
|
||||
MemberDecorate 28(sb_t) 0 Offset 0
|
||||
MemberDecorate 28(sb_t) 1 Coherent
|
||||
MemberDecorate 28(sb_t) 1 Offset 12
|
||||
Decorate 29 ArrayStride 16
|
||||
MemberDecorate 30(sbuf) 0 Coherent
|
||||
MemberDecorate 30(sbuf) 0 Offset 0
|
||||
Decorate 30(sbuf) BufferBlock
|
||||
Decorate 32 DescriptorSet 0
|
||||
Decorate 71(pos) Location 0
|
||||
Decorate 74(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
8: TypeFloat 32
|
||||
9: TypeVector 8(float) 4
|
||||
10: TypeFunction 9(fvec4) 7(ptr)
|
||||
14: TypeRuntimeArray 8(float)
|
||||
15(sbuf2): TypeStruct 14
|
||||
16: TypePointer Uniform 15(sbuf2)
|
||||
17: 16(ptr) Variable Uniform
|
||||
18: TypeInt 32 1
|
||||
19: 18(int) Constant 0
|
||||
21: 6(int) Constant 1
|
||||
23: 8(float) Constant 1109917696
|
||||
24: TypePointer Uniform 8(float)
|
||||
27: TypeVector 8(float) 3
|
||||
28(sb_t): TypeStruct 27(fvec3) 6(int)
|
||||
29: TypeRuntimeArray 28(sb_t)
|
||||
30(sbuf): TypeStruct 29
|
||||
31: TypePointer Uniform 30(sbuf)
|
||||
32: 31(ptr) Variable Uniform
|
||||
35: 6(int) Constant 16
|
||||
37: 18(int) Constant 1
|
||||
38: TypePointer Uniform 6(int)
|
||||
41: TypeBool
|
||||
42: 6(int) Constant 0
|
||||
47: TypePointer Uniform 27(fvec3)
|
||||
55: 8(float) Constant 0
|
||||
70: TypePointer Input 6(int)
|
||||
71(pos): 70(ptr) Variable Input
|
||||
73: TypePointer Output 9(fvec4)
|
||||
74(@entryPointOutput): 73(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
69(pos): 7(ptr) Variable Function
|
||||
75(param): 7(ptr) Variable Function
|
||||
72: 6(int) Load 71(pos)
|
||||
Store 69(pos) 72
|
||||
76: 6(int) Load 69(pos)
|
||||
Store 75(param) 76
|
||||
77: 9(fvec4) FunctionCall 12(@main(u1;) 75(param)
|
||||
Store 74(@entryPointOutput) 77
|
||||
Return
|
||||
FunctionEnd
|
||||
12(@main(u1;): 9(fvec4) Function None 10
|
||||
11(pos): 7(ptr) FunctionParameter
|
||||
13: Label
|
||||
26(size): 7(ptr) Variable Function
|
||||
34(stride): 7(ptr) Variable Function
|
||||
20: 6(int) Load 11(pos)
|
||||
22: 6(int) IAdd 20 21
|
||||
25: 24(ptr) AccessChain 17 19 22
|
||||
Store 25 23
|
||||
33: 18(int) ArrayLength 32 0
|
||||
Store 26(size) 33
|
||||
Store 34(stride) 35
|
||||
36: 6(int) Load 11(pos)
|
||||
39: 38(ptr) AccessChain 32 19 36 37
|
||||
40: 6(int) Load 39
|
||||
43: 41(bool) INotEqual 40 42
|
||||
SelectionMerge 45 None
|
||||
BranchConditional 43 44 61
|
||||
44: Label
|
||||
46: 6(int) Load 11(pos)
|
||||
48: 47(ptr) AccessChain 32 19 46 19
|
||||
49: 27(fvec3) Load 48
|
||||
50: 6(int) Load 11(pos)
|
||||
51: 24(ptr) AccessChain 17 19 50
|
||||
52: 8(float) Load 51
|
||||
53: 27(fvec3) CompositeConstruct 52 52 52
|
||||
54: 27(fvec3) FAdd 49 53
|
||||
56: 8(float) CompositeExtract 54 0
|
||||
57: 8(float) CompositeExtract 54 1
|
||||
58: 8(float) CompositeExtract 54 2
|
||||
59: 9(fvec4) CompositeConstruct 56 57 58 55
|
||||
ReturnValue 59
|
||||
61: Label
|
||||
62: 6(int) Load 26(size)
|
||||
63: 6(int) Load 34(stride)
|
||||
64: 6(int) IAdd 62 63
|
||||
65: 8(float) ConvertUToF 64
|
||||
66: 9(fvec4) CompositeConstruct 65 65 65 65
|
||||
ReturnValue 66
|
||||
45: Label
|
||||
68: 9(fvec4) Undef
|
||||
ReturnValue 68
|
||||
FunctionEnd
|
||||
347
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out
vendored
Normal file
347
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.frag.out
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
hlsl.structbuffer.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:12 Function Parameters:
|
||||
0:12 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 indirect index (layout(binding=10 row_major std430 ) readonly buffer structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:13 Constant:
|
||||
0:13 0 (const uint)
|
||||
0:13 'pos' (in uint)
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'size' (temp uint)
|
||||
0:17 array length (temp uint)
|
||||
0:17 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:17 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'stride' (temp uint)
|
||||
0:17 Constant:
|
||||
0:17 32 (const uint)
|
||||
0:19 Test condition and select (temp void)
|
||||
0:19 Condition
|
||||
0:19 test: direct index for structure (temp bool)
|
||||
0:19 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:19 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:19 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 'pos' (in uint)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:19 true case
|
||||
0:20 Branch: Return with expression
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:20 add (temp 3-component vector of float)
|
||||
0:20 color: direct index for structure (temp 3-component vector of float)
|
||||
0:20 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:20 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:20 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0 (const int)
|
||||
0:20 indirect index (layout(row_major std430 ) readonly temp float)
|
||||
0:20 sbuf2: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of float)
|
||||
0:20 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0.000000
|
||||
0:19 false case
|
||||
0:22 Branch: Return with expression
|
||||
0:22 Construct vec4 (temp 4-component vector of float)
|
||||
0:22 add (temp float)
|
||||
0:22 add (temp float)
|
||||
0:22 direct index (temp float)
|
||||
0:22 color: direct index for structure (temp 3-component vector of float)
|
||||
0:22 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:22 Constant:
|
||||
0:22 0 (const int)
|
||||
0:22 Constant:
|
||||
0:22 0 (const int)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 'size' (temp uint)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 'stride' (temp uint)
|
||||
0:12 Function Definition: main( (temp void)
|
||||
0:12 Function Parameters:
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:12 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:12 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:? 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:12 Function Parameters:
|
||||
0:12 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:13 Sequence
|
||||
0:13 move second child to first child (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 indirect index (layout(binding=10 row_major std430 ) readonly buffer structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:13 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:13 Constant:
|
||||
0:13 0 (const uint)
|
||||
0:13 'pos' (in uint)
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'size' (temp uint)
|
||||
0:17 array length (temp uint)
|
||||
0:17 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:17 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'stride' (temp uint)
|
||||
0:17 Constant:
|
||||
0:17 32 (const uint)
|
||||
0:19 Test condition and select (temp void)
|
||||
0:19 Condition
|
||||
0:19 test: direct index for structure (temp bool)
|
||||
0:19 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:19 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:19 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 'pos' (in uint)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:19 true case
|
||||
0:20 Branch: Return with expression
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:20 add (temp 3-component vector of float)
|
||||
0:20 color: direct index for structure (temp 3-component vector of float)
|
||||
0:20 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:20 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:20 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0 (const int)
|
||||
0:20 indirect index (layout(row_major std430 ) readonly temp float)
|
||||
0:20 sbuf2: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of float)
|
||||
0:20 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0.000000
|
||||
0:19 false case
|
||||
0:22 Branch: Return with expression
|
||||
0:22 Construct vec4 (temp 4-component vector of float)
|
||||
0:22 add (temp float)
|
||||
0:22 add (temp float)
|
||||
0:22 direct index (temp float)
|
||||
0:22 color: direct index for structure (temp 3-component vector of float)
|
||||
0:22 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2})
|
||||
0:22 Constant:
|
||||
0:22 0 (const int)
|
||||
0:22 Constant:
|
||||
0:22 0 (const int)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 'size' (temp uint)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 'stride' (temp uint)
|
||||
0:12 Function Definition: main( (temp void)
|
||||
0:12 Function Parameters:
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:12 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:12 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf})
|
||||
0:? 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 94
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 87 90
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 12 "@main(u1;"
|
||||
Name 11 "pos"
|
||||
Name 16 "sb_t"
|
||||
MemberName 16(sb_t) 0 "color"
|
||||
MemberName 16(sb_t) 1 "test"
|
||||
MemberName 16(sb_t) 2 "test2"
|
||||
Name 18 "mydata"
|
||||
Name 19 "sb_t"
|
||||
MemberName 19(sb_t) 0 "color"
|
||||
MemberName 19(sb_t) 1 "test"
|
||||
MemberName 19(sb_t) 2 "test2"
|
||||
Name 21 "sbuf"
|
||||
MemberName 21(sbuf) 0 "sbuf"
|
||||
Name 23 ""
|
||||
Name 40 "size"
|
||||
Name 42 "stride"
|
||||
Name 57 "sbuf2"
|
||||
MemberName 57(sbuf2) 0 "sbuf2"
|
||||
Name 59 ""
|
||||
Name 85 "pos"
|
||||
Name 87 "pos"
|
||||
Name 90 "@entryPointOutput"
|
||||
Name 91 "param"
|
||||
MemberDecorate 19(sb_t) 0 NonWritable
|
||||
MemberDecorate 19(sb_t) 0 Offset 0
|
||||
MemberDecorate 19(sb_t) 1 NonWritable
|
||||
MemberDecorate 19(sb_t) 1 Offset 12
|
||||
MemberDecorate 19(sb_t) 2 NonWritable
|
||||
MemberDecorate 19(sb_t) 2 Offset 16
|
||||
Decorate 20 ArrayStride 32
|
||||
MemberDecorate 21(sbuf) 0 NonWritable
|
||||
MemberDecorate 21(sbuf) 0 Offset 0
|
||||
Decorate 21(sbuf) BufferBlock
|
||||
Decorate 23 DescriptorSet 0
|
||||
Decorate 23 Binding 10
|
||||
Decorate 56 ArrayStride 4
|
||||
MemberDecorate 57(sbuf2) 0 NonWritable
|
||||
MemberDecorate 57(sbuf2) 0 Offset 0
|
||||
Decorate 57(sbuf2) BufferBlock
|
||||
Decorate 59 DescriptorSet 0
|
||||
Decorate 87(pos) Location 0
|
||||
Decorate 90(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
8: TypeFloat 32
|
||||
9: TypeVector 8(float) 4
|
||||
10: TypeFunction 9(fvec4) 7(ptr)
|
||||
14: TypeVector 8(float) 3
|
||||
15: TypeBool
|
||||
16(sb_t): TypeStruct 14(fvec3) 15(bool) 15(bool)
|
||||
17: TypePointer Function 16(sb_t)
|
||||
19(sb_t): TypeStruct 14(fvec3) 6(int) 6(int)
|
||||
20: TypeRuntimeArray 19(sb_t)
|
||||
21(sbuf): TypeStruct 20
|
||||
22: TypePointer Uniform 21(sbuf)
|
||||
23: 22(ptr) Variable Uniform
|
||||
24: TypeInt 32 1
|
||||
25: 24(int) Constant 0
|
||||
27: TypePointer Uniform 19(sb_t)
|
||||
31: TypePointer Function 14(fvec3)
|
||||
34: 24(int) Constant 1
|
||||
35: TypePointer Function 15(bool)
|
||||
38: 24(int) Constant 2
|
||||
43: 6(int) Constant 32
|
||||
45: TypePointer Uniform 6(int)
|
||||
48: 6(int) Constant 0
|
||||
53: TypePointer Uniform 14(fvec3)
|
||||
56: TypeRuntimeArray 8(float)
|
||||
57(sbuf2): TypeStruct 56
|
||||
58: TypePointer Uniform 57(sbuf2)
|
||||
59: 58(ptr) Variable Uniform
|
||||
61: TypePointer Uniform 8(float)
|
||||
66: 8(float) Constant 0
|
||||
73: TypePointer Function 8(float)
|
||||
86: TypePointer Input 6(int)
|
||||
87(pos): 86(ptr) Variable Input
|
||||
89: TypePointer Output 9(fvec4)
|
||||
90(@entryPointOutput): 89(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
85(pos): 7(ptr) Variable Function
|
||||
91(param): 7(ptr) Variable Function
|
||||
88: 6(int) Load 87(pos)
|
||||
Store 85(pos) 88
|
||||
92: 6(int) Load 85(pos)
|
||||
Store 91(param) 92
|
||||
93: 9(fvec4) FunctionCall 12(@main(u1;) 91(param)
|
||||
Store 90(@entryPointOutput) 93
|
||||
Return
|
||||
FunctionEnd
|
||||
12(@main(u1;): 9(fvec4) Function None 10
|
||||
11(pos): 7(ptr) FunctionParameter
|
||||
13: Label
|
||||
18(mydata): 17(ptr) Variable Function
|
||||
40(size): 7(ptr) Variable Function
|
||||
42(stride): 7(ptr) Variable Function
|
||||
26: 6(int) Load 11(pos)
|
||||
28: 27(ptr) AccessChain 23 25 26
|
||||
29: 19(sb_t) Load 28
|
||||
30: 14(fvec3) CompositeExtract 29 0
|
||||
32: 31(ptr) AccessChain 18(mydata) 25
|
||||
Store 32 30
|
||||
33: 6(int) CompositeExtract 29 1
|
||||
36: 35(ptr) AccessChain 18(mydata) 34
|
||||
Store 36 33
|
||||
37: 6(int) CompositeExtract 29 2
|
||||
39: 35(ptr) AccessChain 18(mydata) 38
|
||||
Store 39 37
|
||||
41: 24(int) ArrayLength 23 0
|
||||
Store 40(size) 41
|
||||
Store 42(stride) 43
|
||||
44: 6(int) Load 11(pos)
|
||||
46: 45(ptr) AccessChain 23 25 44 34
|
||||
47: 6(int) Load 46
|
||||
49: 15(bool) INotEqual 47 48
|
||||
SelectionMerge 51 None
|
||||
BranchConditional 49 50 72
|
||||
50: Label
|
||||
52: 6(int) Load 11(pos)
|
||||
54: 53(ptr) AccessChain 23 25 52 25
|
||||
55: 14(fvec3) Load 54
|
||||
60: 6(int) Load 11(pos)
|
||||
62: 61(ptr) AccessChain 59 25 60
|
||||
63: 8(float) Load 62
|
||||
64: 14(fvec3) CompositeConstruct 63 63 63
|
||||
65: 14(fvec3) FAdd 55 64
|
||||
67: 8(float) CompositeExtract 65 0
|
||||
68: 8(float) CompositeExtract 65 1
|
||||
69: 8(float) CompositeExtract 65 2
|
||||
70: 9(fvec4) CompositeConstruct 67 68 69 66
|
||||
ReturnValue 70
|
||||
72: Label
|
||||
74: 73(ptr) AccessChain 18(mydata) 25 48
|
||||
75: 8(float) Load 74
|
||||
76: 6(int) Load 40(size)
|
||||
77: 8(float) ConvertUToF 76
|
||||
78: 8(float) FAdd 75 77
|
||||
79: 6(int) Load 42(stride)
|
||||
80: 8(float) ConvertUToF 79
|
||||
81: 8(float) FAdd 78 80
|
||||
82: 9(fvec4) CompositeConstruct 81 81 81 81
|
||||
ReturnValue 82
|
||||
51: Label
|
||||
84: 9(fvec4) Undef
|
||||
ReturnValue 84
|
||||
FunctionEnd
|
||||
304
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out
vendored
Normal file
304
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rw.frag.out
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
hlsl.structbuffer.rw.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:12 Function Parameters:
|
||||
0:12 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:13 move second child to first child (temp float)
|
||||
0:13 indirect index (layout(row_major std430 ) temp float)
|
||||
0:13 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float)
|
||||
0:13 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2})
|
||||
0:13 Constant:
|
||||
0:13 0 (const uint)
|
||||
0:13 add (temp uint)
|
||||
0:13 'pos' (in uint)
|
||||
0:13 Constant:
|
||||
0:13 1 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 42.000000
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'size' (temp uint)
|
||||
0:17 array length (temp uint)
|
||||
0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'stride' (temp uint)
|
||||
0:17 Constant:
|
||||
0:17 16 (const uint)
|
||||
0:19 Test condition and select (temp void)
|
||||
0:19 Condition
|
||||
0:19 test: direct index for structure (temp bool)
|
||||
0:19 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 'pos' (in uint)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:19 true case
|
||||
0:20 Branch: Return with expression
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:20 add (temp 3-component vector of float)
|
||||
0:20 color: direct index for structure (temp 3-component vector of float)
|
||||
0:20 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0 (const int)
|
||||
0:20 indirect index (layout(row_major std430 ) temp float)
|
||||
0:20 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float)
|
||||
0:20 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0.000000
|
||||
0:19 false case
|
||||
0:22 Branch: Return with expression
|
||||
0:22 Construct vec4 (temp 4-component vector of float)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 add (temp uint)
|
||||
0:22 'size' (temp uint)
|
||||
0:22 'stride' (temp uint)
|
||||
0:12 Function Definition: main( (temp void)
|
||||
0:12 Function Parameters:
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:12 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:12 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:? 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:12 Function Definition: @main(u1; (temp 4-component vector of float)
|
||||
0:12 Function Parameters:
|
||||
0:12 'pos' (in uint)
|
||||
0:? Sequence
|
||||
0:13 move second child to first child (temp float)
|
||||
0:13 indirect index (layout(row_major std430 ) temp float)
|
||||
0:13 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float)
|
||||
0:13 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2})
|
||||
0:13 Constant:
|
||||
0:13 0 (const uint)
|
||||
0:13 add (temp uint)
|
||||
0:13 'pos' (in uint)
|
||||
0:13 Constant:
|
||||
0:13 1 (const uint)
|
||||
0:13 Constant:
|
||||
0:13 42.000000
|
||||
0:17 Sequence
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'size' (temp uint)
|
||||
0:17 array length (temp uint)
|
||||
0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:17 Constant:
|
||||
0:17 0 (const uint)
|
||||
0:17 move second child to first child (temp uint)
|
||||
0:17 'stride' (temp uint)
|
||||
0:17 Constant:
|
||||
0:17 16 (const uint)
|
||||
0:19 Test condition and select (temp void)
|
||||
0:19 Condition
|
||||
0:19 test: direct index for structure (temp bool)
|
||||
0:19 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:19 Constant:
|
||||
0:19 0 (const uint)
|
||||
0:19 'pos' (in uint)
|
||||
0:19 Constant:
|
||||
0:19 1 (const int)
|
||||
0:19 true case
|
||||
0:20 Branch: Return with expression
|
||||
0:? Construct vec4 (temp 4-component vector of float)
|
||||
0:20 add (temp 3-component vector of float)
|
||||
0:20 color: direct index for structure (temp 3-component vector of float)
|
||||
0:20 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test})
|
||||
0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0 (const int)
|
||||
0:20 indirect index (layout(row_major std430 ) temp float)
|
||||
0:20 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float)
|
||||
0:20 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2})
|
||||
0:20 Constant:
|
||||
0:20 0 (const uint)
|
||||
0:20 'pos' (in uint)
|
||||
0:20 Constant:
|
||||
0:20 0.000000
|
||||
0:19 false case
|
||||
0:22 Branch: Return with expression
|
||||
0:22 Construct vec4 (temp 4-component vector of float)
|
||||
0:22 Convert uint to float (temp float)
|
||||
0:22 add (temp uint)
|
||||
0:22 'size' (temp uint)
|
||||
0:22 'stride' (temp uint)
|
||||
0:12 Function Definition: main( (temp void)
|
||||
0:12 Function Parameters:
|
||||
0:? Sequence
|
||||
0:12 move second child to first child (temp uint)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
0:12 move second child to first child (temp 4-component vector of float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:12 Function Call: @main(u1; (temp 4-component vector of float)
|
||||
0:? 'pos' (temp uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf})
|
||||
0:? 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2})
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
|
||||
0:? 'pos' (layout(location=0 ) in uint)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 78
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 71 74
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 12 "@main(u1;"
|
||||
Name 11 "pos"
|
||||
Name 15 "sbuf2"
|
||||
MemberName 15(sbuf2) 0 "sbuf2"
|
||||
Name 17 ""
|
||||
Name 26 "size"
|
||||
Name 28 "sb_t"
|
||||
MemberName 28(sb_t) 0 "color"
|
||||
MemberName 28(sb_t) 1 "test"
|
||||
Name 30 "sbuf"
|
||||
MemberName 30(sbuf) 0 "sbuf"
|
||||
Name 32 ""
|
||||
Name 34 "stride"
|
||||
Name 69 "pos"
|
||||
Name 71 "pos"
|
||||
Name 74 "@entryPointOutput"
|
||||
Name 75 "param"
|
||||
Decorate 14 ArrayStride 4
|
||||
MemberDecorate 15(sbuf2) 0 Offset 0
|
||||
Decorate 15(sbuf2) BufferBlock
|
||||
Decorate 17 DescriptorSet 0
|
||||
MemberDecorate 28(sb_t) 0 Offset 0
|
||||
MemberDecorate 28(sb_t) 1 Offset 12
|
||||
Decorate 29 ArrayStride 16
|
||||
MemberDecorate 30(sbuf) 0 Offset 0
|
||||
Decorate 30(sbuf) BufferBlock
|
||||
Decorate 32 DescriptorSet 0
|
||||
Decorate 71(pos) Location 0
|
||||
Decorate 74(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypePointer Function 6(int)
|
||||
8: TypeFloat 32
|
||||
9: TypeVector 8(float) 4
|
||||
10: TypeFunction 9(fvec4) 7(ptr)
|
||||
14: TypeRuntimeArray 8(float)
|
||||
15(sbuf2): TypeStruct 14
|
||||
16: TypePointer Uniform 15(sbuf2)
|
||||
17: 16(ptr) Variable Uniform
|
||||
18: TypeInt 32 1
|
||||
19: 18(int) Constant 0
|
||||
21: 6(int) Constant 1
|
||||
23: 8(float) Constant 1109917696
|
||||
24: TypePointer Uniform 8(float)
|
||||
27: TypeVector 8(float) 3
|
||||
28(sb_t): TypeStruct 27(fvec3) 6(int)
|
||||
29: TypeRuntimeArray 28(sb_t)
|
||||
30(sbuf): TypeStruct 29
|
||||
31: TypePointer Uniform 30(sbuf)
|
||||
32: 31(ptr) Variable Uniform
|
||||
35: 6(int) Constant 16
|
||||
37: 18(int) Constant 1
|
||||
38: TypePointer Uniform 6(int)
|
||||
41: TypeBool
|
||||
42: 6(int) Constant 0
|
||||
47: TypePointer Uniform 27(fvec3)
|
||||
55: 8(float) Constant 0
|
||||
70: TypePointer Input 6(int)
|
||||
71(pos): 70(ptr) Variable Input
|
||||
73: TypePointer Output 9(fvec4)
|
||||
74(@entryPointOutput): 73(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
69(pos): 7(ptr) Variable Function
|
||||
75(param): 7(ptr) Variable Function
|
||||
72: 6(int) Load 71(pos)
|
||||
Store 69(pos) 72
|
||||
76: 6(int) Load 69(pos)
|
||||
Store 75(param) 76
|
||||
77: 9(fvec4) FunctionCall 12(@main(u1;) 75(param)
|
||||
Store 74(@entryPointOutput) 77
|
||||
Return
|
||||
FunctionEnd
|
||||
12(@main(u1;): 9(fvec4) Function None 10
|
||||
11(pos): 7(ptr) FunctionParameter
|
||||
13: Label
|
||||
26(size): 7(ptr) Variable Function
|
||||
34(stride): 7(ptr) Variable Function
|
||||
20: 6(int) Load 11(pos)
|
||||
22: 6(int) IAdd 20 21
|
||||
25: 24(ptr) AccessChain 17 19 22
|
||||
Store 25 23
|
||||
33: 18(int) ArrayLength 32 0
|
||||
Store 26(size) 33
|
||||
Store 34(stride) 35
|
||||
36: 6(int) Load 11(pos)
|
||||
39: 38(ptr) AccessChain 32 19 36 37
|
||||
40: 6(int) Load 39
|
||||
43: 41(bool) INotEqual 40 42
|
||||
SelectionMerge 45 None
|
||||
BranchConditional 43 44 61
|
||||
44: Label
|
||||
46: 6(int) Load 11(pos)
|
||||
48: 47(ptr) AccessChain 32 19 46 19
|
||||
49: 27(fvec3) Load 48
|
||||
50: 6(int) Load 11(pos)
|
||||
51: 24(ptr) AccessChain 17 19 50
|
||||
52: 8(float) Load 51
|
||||
53: 27(fvec3) CompositeConstruct 52 52 52
|
||||
54: 27(fvec3) FAdd 49 53
|
||||
56: 8(float) CompositeExtract 54 0
|
||||
57: 8(float) CompositeExtract 54 1
|
||||
58: 8(float) CompositeExtract 54 2
|
||||
59: 9(fvec4) CompositeConstruct 56 57 58 55
|
||||
ReturnValue 59
|
||||
61: Label
|
||||
62: 6(int) Load 26(size)
|
||||
63: 6(int) Load 34(stride)
|
||||
64: 6(int) IAdd 62 63
|
||||
65: 8(float) ConvertUToF 64
|
||||
66: 9(fvec4) CompositeConstruct 65 65 65 65
|
||||
ReturnValue 66
|
||||
45: Label
|
||||
68: 9(fvec4) Undef
|
||||
ReturnValue 68
|
||||
FunctionEnd
|
||||
1307
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
vendored
Normal file
1307
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out
vendored
Normal file
File diff suppressed because it is too large
Load Diff
67
3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out
vendored
Normal file
67
3rdparty/glslang/Test/baseResults/spv.functionNestedOpaque.vert.out
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
spv.functionNestedOpaque.vert
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 39
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main"
|
||||
Source GLSL 450
|
||||
Name 4 "main"
|
||||
Name 12 "foo(s21;"
|
||||
Name 11 "t"
|
||||
Name 14 "S"
|
||||
MemberName 14(S) 0 "s"
|
||||
Name 18 "barc(struct-S-s211;"
|
||||
Name 17 "p"
|
||||
Name 21 "bar(struct-S-s211;"
|
||||
Name 20 "p"
|
||||
Name 36 "si"
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeImage 6(float) 2D sampled format:Unknown
|
||||
8: TypeSampledImage 7
|
||||
9: TypePointer UniformConstant 8
|
||||
10: TypeFunction 2 9(ptr)
|
||||
14(S): TypeStruct 8
|
||||
15: TypePointer UniformConstant 14(S)
|
||||
16: TypeFunction 2 15(ptr)
|
||||
24: TypeVector 6(float) 2
|
||||
25: 6(float) Constant 1056964608
|
||||
26: 24(fvec2) ConstantComposite 25 25
|
||||
27: TypeVector 6(float) 4
|
||||
28: 6(float) Constant 0
|
||||
30: TypeInt 32 1
|
||||
31: 30(int) Constant 0
|
||||
36(si): 15(ptr) Variable UniformConstant
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
37: 2 FunctionCall 18(barc(struct-S-s211;) 36(si)
|
||||
38: 2 FunctionCall 21(bar(struct-S-s211;) 36(si)
|
||||
Return
|
||||
FunctionEnd
|
||||
12(foo(s21;): 2 Function None 10
|
||||
11(t): 9(ptr) FunctionParameter
|
||||
13: Label
|
||||
23: 8 Load 11(t)
|
||||
29: 27(fvec4) ImageSampleExplicitLod 23 26 Lod 28
|
||||
Return
|
||||
FunctionEnd
|
||||
18(barc(struct-S-s211;): 2 Function None 16
|
||||
17(p): 15(ptr) FunctionParameter
|
||||
19: Label
|
||||
32: 9(ptr) AccessChain 17(p) 31
|
||||
33: 2 FunctionCall 12(foo(s21;) 32
|
||||
Return
|
||||
FunctionEnd
|
||||
21(bar(struct-S-s211;): 2 Function None 16
|
||||
20(p): 15(ptr) FunctionParameter
|
||||
22: Label
|
||||
34: 9(ptr) AccessChain 20(p) 31
|
||||
35: 2 FunctionCall 12(foo(s21;) 34
|
||||
Return
|
||||
FunctionEnd
|
||||
@@ -6,7 +6,7 @@ Warning, version 450 is not yet complete; most version-specific features are pre
|
||||
// Id's are bound by 37
|
||||
|
||||
Capability Tessellation
|
||||
Capability Bad
|
||||
Capability PerViewAttributesNV
|
||||
Extension "SPV_NVX_multiview_per_view_attributes"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
|
||||
@@ -6,7 +6,7 @@ Warning, version 450 is not yet complete; most version-specific features are pre
|
||||
// Id's are bound by 29
|
||||
|
||||
Capability Shader
|
||||
Capability Bad
|
||||
Capability PerViewAttributesNV
|
||||
Extension "SPV_NVX_multiview_per_view_attributes"
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
|
||||
153
3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out
vendored
Normal file
153
3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
spv.ssbo.autoassign.frag
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 95
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 88 91
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Name 4 "main"
|
||||
Name 11 "@main(vf4;"
|
||||
Name 10 "pos"
|
||||
Name 13 "vTmp"
|
||||
Name 14 "BufType"
|
||||
MemberName 14(BufType) 0 "va"
|
||||
MemberName 14(BufType) 1 "vb"
|
||||
Name 16 "SB0"
|
||||
MemberName 16(SB0) 0 "SB0"
|
||||
Name 18 ""
|
||||
Name 26 "TestCB"
|
||||
MemberName 26(TestCB) 0 "W"
|
||||
MemberName 26(TestCB) 1 "H"
|
||||
Name 28 ""
|
||||
Name 55 "SB1"
|
||||
MemberName 55(SB1) 0 "SB1"
|
||||
Name 57 ""
|
||||
Name 86 "pos"
|
||||
Name 88 "pos"
|
||||
Name 91 "@entryPointOutput"
|
||||
Name 92 "param"
|
||||
MemberDecorate 14(BufType) 0 NonWritable
|
||||
MemberDecorate 14(BufType) 0 Offset 0
|
||||
MemberDecorate 14(BufType) 1 NonWritable
|
||||
MemberDecorate 14(BufType) 1 Offset 16
|
||||
Decorate 15 ArrayStride 32
|
||||
MemberDecorate 16(SB0) 0 NonWritable
|
||||
MemberDecorate 16(SB0) 0 Offset 0
|
||||
Decorate 16(SB0) BufferBlock
|
||||
Decorate 18 DescriptorSet 0
|
||||
Decorate 18 Binding 30
|
||||
MemberDecorate 26(TestCB) 0 Offset 0
|
||||
MemberDecorate 26(TestCB) 1 Offset 4
|
||||
Decorate 26(TestCB) Block
|
||||
Decorate 28 DescriptorSet 0
|
||||
Decorate 28 Binding 15
|
||||
Decorate 54 ArrayStride 32
|
||||
MemberDecorate 55(SB1) 0 Offset 0
|
||||
Decorate 55(SB1) BufferBlock
|
||||
Decorate 57 DescriptorSet 0
|
||||
Decorate 57 Binding 31
|
||||
Decorate 88(pos) Location 0
|
||||
Decorate 91(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Function 7(fvec4)
|
||||
9: TypeFunction 7(fvec4) 8(ptr)
|
||||
14(BufType): TypeStruct 7(fvec4) 7(fvec4)
|
||||
15: TypeRuntimeArray 14(BufType)
|
||||
16(SB0): TypeStruct 15
|
||||
17: TypePointer Uniform 16(SB0)
|
||||
18: 17(ptr) Variable Uniform
|
||||
19: TypeInt 32 1
|
||||
20: 19(int) Constant 0
|
||||
21: TypeInt 32 0
|
||||
22: 21(int) Constant 1
|
||||
23: TypePointer Function 6(float)
|
||||
26(TestCB): TypeStruct 21(int) 21(int)
|
||||
27: TypePointer Uniform 26(TestCB)
|
||||
28: 27(ptr) Variable Uniform
|
||||
29: TypePointer Uniform 21(int)
|
||||
34: 21(int) Constant 0
|
||||
38: TypePointer Uniform 7(fvec4)
|
||||
50: 19(int) Constant 1
|
||||
54: TypeRuntimeArray 14(BufType)
|
||||
55(SB1): TypeStruct 54
|
||||
56: TypePointer Uniform 55(SB1)
|
||||
57: 56(ptr) Variable Uniform
|
||||
87: TypePointer Input 7(fvec4)
|
||||
88(pos): 87(ptr) Variable Input
|
||||
90: TypePointer Output 7(fvec4)
|
||||
91(@entryPointOutput): 90(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
86(pos): 8(ptr) Variable Function
|
||||
92(param): 8(ptr) Variable Function
|
||||
89: 7(fvec4) Load 88(pos)
|
||||
Store 86(pos) 89
|
||||
93: 7(fvec4) Load 86(pos)
|
||||
Store 92(param) 93
|
||||
94: 7(fvec4) FunctionCall 11(@main(vf4;) 92(param)
|
||||
Store 91(@entryPointOutput) 94
|
||||
Return
|
||||
FunctionEnd
|
||||
11(@main(vf4;): 7(fvec4) Function None 9
|
||||
10(pos): 8(ptr) FunctionParameter
|
||||
12: Label
|
||||
13(vTmp): 8(ptr) Variable Function
|
||||
24: 23(ptr) AccessChain 10(pos) 22
|
||||
25: 6(float) Load 24
|
||||
30: 29(ptr) AccessChain 28 20
|
||||
31: 21(int) Load 30
|
||||
32: 6(float) ConvertUToF 31
|
||||
33: 6(float) FMul 25 32
|
||||
35: 23(ptr) AccessChain 10(pos) 34
|
||||
36: 6(float) Load 35
|
||||
37: 6(float) FAdd 33 36
|
||||
39: 38(ptr) AccessChain 18 20 37 20
|
||||
40: 7(fvec4) Load 39
|
||||
41: 23(ptr) AccessChain 10(pos) 22
|
||||
42: 6(float) Load 41
|
||||
43: 29(ptr) AccessChain 28 20
|
||||
44: 21(int) Load 43
|
||||
45: 6(float) ConvertUToF 44
|
||||
46: 6(float) FMul 42 45
|
||||
47: 23(ptr) AccessChain 10(pos) 34
|
||||
48: 6(float) Load 47
|
||||
49: 6(float) FAdd 46 48
|
||||
51: 38(ptr) AccessChain 18 20 49 50
|
||||
52: 7(fvec4) Load 51
|
||||
53: 7(fvec4) FAdd 40 52
|
||||
Store 13(vTmp) 53
|
||||
58: 23(ptr) AccessChain 10(pos) 22
|
||||
59: 6(float) Load 58
|
||||
60: 29(ptr) AccessChain 28 20
|
||||
61: 21(int) Load 60
|
||||
62: 6(float) ConvertUToF 61
|
||||
63: 6(float) FMul 59 62
|
||||
64: 23(ptr) AccessChain 10(pos) 34
|
||||
65: 6(float) Load 64
|
||||
66: 6(float) FAdd 63 65
|
||||
67: 38(ptr) AccessChain 57 20 66 20
|
||||
68: 7(fvec4) Load 67
|
||||
69: 23(ptr) AccessChain 10(pos) 22
|
||||
70: 6(float) Load 69
|
||||
71: 29(ptr) AccessChain 28 20
|
||||
72: 21(int) Load 71
|
||||
73: 6(float) ConvertUToF 72
|
||||
74: 6(float) FMul 70 73
|
||||
75: 23(ptr) AccessChain 10(pos) 34
|
||||
76: 6(float) Load 75
|
||||
77: 6(float) FAdd 74 76
|
||||
78: 38(ptr) AccessChain 57 20 77 50
|
||||
79: 7(fvec4) Load 78
|
||||
80: 7(fvec4) FAdd 68 79
|
||||
81: 7(fvec4) Load 13(vTmp)
|
||||
82: 7(fvec4) FAdd 81 80
|
||||
Store 13(vTmp) 82
|
||||
83: 7(fvec4) Load 13(vTmp)
|
||||
ReturnValue 83
|
||||
FunctionEnd
|
||||
25
3rdparty/glslang/Test/hlsl.structbuffer.atomics.frag
vendored
Normal file
25
3rdparty/glslang/Test/hlsl.structbuffer.atomics.frag
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
RWByteAddressBuffer sbuf;
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
uint u;
|
||||
|
||||
sbuf.InterlockedAdd(8, 1);
|
||||
sbuf.InterlockedAdd(8, 1, u);
|
||||
sbuf.InterlockedAnd(8, 1);
|
||||
sbuf.InterlockedAnd(8, 1, u);
|
||||
sbuf.InterlockedCompareExchange(8, 1, 2, u);
|
||||
// sbuf.InterlockedCompareStore(8, 1, 2); // TODO: ...
|
||||
sbuf.InterlockedExchange(8, 1, u);
|
||||
sbuf.InterlockedMax(8, 1);
|
||||
sbuf.InterlockedMax(8, 1, u);
|
||||
sbuf.InterlockedMin(8, 1);
|
||||
sbuf.InterlockedMin(8, 1, u);
|
||||
sbuf.InterlockedOr(8, 1);
|
||||
sbuf.InterlockedOr(8, 1, u);
|
||||
sbuf.InterlockedXor(8, 1);
|
||||
sbuf.InterlockedXor(8, 1, u);
|
||||
|
||||
return sbuf.Load(pos);
|
||||
}
|
||||
13
3rdparty/glslang/Test/hlsl.structbuffer.byte.frag
vendored
Normal file
13
3rdparty/glslang/Test/hlsl.structbuffer.byte.frag
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
ByteAddressBuffer sbuf;
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
uint size;
|
||||
sbuf.GetDimensions(size);
|
||||
|
||||
return sbuf.Load(pos) +
|
||||
float4(sbuf.Load2(pos+4), 0, 0) +
|
||||
float4(sbuf.Load3(pos+8), 0) +
|
||||
sbuf.Load4(pos+12);
|
||||
}
|
||||
23
3rdparty/glslang/Test/hlsl.structbuffer.coherent.frag
vendored
Normal file
23
3rdparty/glslang/Test/hlsl.structbuffer.coherent.frag
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
struct sb_t
|
||||
{
|
||||
float3 color;
|
||||
bool test;
|
||||
};
|
||||
|
||||
|
||||
globallycoherent RWStructuredBuffer<sb_t> sbuf;
|
||||
globallycoherent RWStructuredBuffer<float> sbuf2;
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
sbuf2[pos+1] = 42;
|
||||
|
||||
uint size;
|
||||
uint stride;
|
||||
sbuf.GetDimensions(size, stride);
|
||||
|
||||
if (sbuf[pos].test)
|
||||
return float4(sbuf[pos].color + sbuf2[pos], 0);
|
||||
else
|
||||
return size + stride;
|
||||
}
|
||||
23
3rdparty/glslang/Test/hlsl.structbuffer.frag
vendored
Normal file
23
3rdparty/glslang/Test/hlsl.structbuffer.frag
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
struct sb_t
|
||||
{
|
||||
float3 color;
|
||||
bool test;
|
||||
bool test2;
|
||||
}; // stride = 20
|
||||
|
||||
StructuredBuffer<sb_t> sbuf : register(c10);
|
||||
StructuredBuffer<float> sbuf2;
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
sb_t mydata = sbuf.Load(pos);
|
||||
|
||||
uint size;
|
||||
uint stride;
|
||||
sbuf.GetDimensions(size, stride);
|
||||
|
||||
if (sbuf[pos].test)
|
||||
return float4(sbuf[pos].color + sbuf2[pos], 0);
|
||||
else
|
||||
return mydata.color.x + size + stride;
|
||||
}
|
||||
23
3rdparty/glslang/Test/hlsl.structbuffer.rw.frag
vendored
Normal file
23
3rdparty/glslang/Test/hlsl.structbuffer.rw.frag
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
struct sb_t
|
||||
{
|
||||
float3 color;
|
||||
bool test;
|
||||
};
|
||||
|
||||
|
||||
RWStructuredBuffer<sb_t> sbuf;
|
||||
RWStructuredBuffer<float> sbuf2;
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
sbuf2[pos+1] = 42;
|
||||
|
||||
uint size;
|
||||
uint stride;
|
||||
sbuf.GetDimensions(size, stride);
|
||||
|
||||
if (sbuf[pos].test)
|
||||
return float4(sbuf[pos].color + sbuf2[pos], 0);
|
||||
else
|
||||
return size + stride;
|
||||
}
|
||||
15
3rdparty/glslang/Test/hlsl.structbuffer.rwbyte.frag
vendored
Normal file
15
3rdparty/glslang/Test/hlsl.structbuffer.rwbyte.frag
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
RWByteAddressBuffer sbuf;
|
||||
|
||||
float4 main(uint pos : FOO) : SV_Target0
|
||||
{
|
||||
uint size;
|
||||
sbuf.GetDimensions(size);
|
||||
|
||||
sbuf.Store(pos, sbuf.Load(pos));
|
||||
sbuf.Store2(pos, sbuf.Load2(pos));
|
||||
sbuf.Store3(pos, sbuf.Load3(pos));
|
||||
sbuf.Store4(pos, sbuf.Load4(pos));
|
||||
|
||||
return sbuf.Load(pos);
|
||||
}
|
||||
26
3rdparty/glslang/Test/spv.functionNestedOpaque.vert
vendored
Executable file
26
3rdparty/glslang/Test/spv.functionNestedOpaque.vert
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
#version 450
|
||||
|
||||
uniform struct S {
|
||||
sampler2D s;
|
||||
} si;
|
||||
|
||||
void foo(sampler2D t)
|
||||
{
|
||||
texture(t, vec2(0.5));
|
||||
}
|
||||
|
||||
void barc(const S p)
|
||||
{
|
||||
foo(p.s);
|
||||
}
|
||||
|
||||
void bar(S p)
|
||||
{
|
||||
foo(p.s);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
barc(si);
|
||||
bar(si);
|
||||
}
|
||||
24
3rdparty/glslang/Test/spv.ssbo.autoassign.frag
vendored
Normal file
24
3rdparty/glslang/Test/spv.ssbo.autoassign.frag
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
cbuffer TestCB
|
||||
{
|
||||
uint W;
|
||||
uint H;
|
||||
};
|
||||
|
||||
struct BufType
|
||||
{
|
||||
float4 va;
|
||||
float4 vb;
|
||||
};
|
||||
|
||||
StructuredBuffer < BufType > SB0;
|
||||
RWStructuredBuffer < BufType > SB1;
|
||||
|
||||
float4 main(float4 pos : POS) : SV_Target0
|
||||
{
|
||||
float4 vTmp = SB0[pos.y * W + pos.x].va + SB0[pos.y * W + pos.x].vb;
|
||||
|
||||
vTmp += SB1[pos.y * W + pos.x].va + SB1[pos.y * W + pos.x].vb;
|
||||
|
||||
return vTmp;
|
||||
}
|
||||
@@ -624,6 +624,15 @@ enum TOperator {
|
||||
EOpMethodCalculateLevelOfDetail, // ...
|
||||
EOpMethodCalculateLevelOfDetailUnclamped, // ...
|
||||
|
||||
// Load already defined above for textures
|
||||
EOpMethodLoad2, // Structure buffer object methods. These are translated to existing
|
||||
EOpMethodLoad3, // AST methods, and exist to represent HLSL semantics until that
|
||||
EOpMethodLoad4, // translation is performed. See HlslParseContext::decomposeSampleMethods().
|
||||
EOpMethodStore, // ...
|
||||
EOpMethodStore2, // ...
|
||||
EOpMethodStore3, // ...
|
||||
EOpMethodStore4, // ...
|
||||
|
||||
// SM5 texture methods
|
||||
EOpMethodGatherRed, // These are covered under the above EOpMethodSample comment about
|
||||
EOpMethodGatherGreen, // translation to existing AST opcodes. They exist temporarily
|
||||
|
||||
4
3rdparty/glslang/glslang/Include/revision.h
vendored
4
3rdparty/glslang/glslang/Include/revision.h
vendored
@@ -2,5 +2,5 @@
|
||||
// For the version, it uses the latest git tag followed by the number of commits.
|
||||
// For the date, it uses the current date (when then script is run).
|
||||
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1842"
|
||||
#define GLSLANG_DATE "17-Feb-2017"
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1845"
|
||||
#define GLSLANG_DATE "24-Feb-2017"
|
||||
|
||||
@@ -1557,6 +1557,7 @@ void TShader::setShiftSamplerBinding(unsigned int base) { intermediate->setShift
|
||||
void TShader::setShiftTextureBinding(unsigned int base) { intermediate->setShiftTextureBinding(base); }
|
||||
void TShader::setShiftImageBinding(unsigned int base) { intermediate->setShiftImageBinding(base); }
|
||||
void TShader::setShiftUboBinding(unsigned int base) { intermediate->setShiftUboBinding(base); }
|
||||
void TShader::setShiftSsboBinding(unsigned int base) { intermediate->setShiftSsboBinding(base); }
|
||||
void TShader::setAutoMapBindings(bool map) { intermediate->setAutoMapBindings(map); }
|
||||
void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); }
|
||||
void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
|
||||
@@ -1784,6 +1785,7 @@ int TProgram::getAttributeType(int index) const { return reflection
|
||||
const TType* TProgram::getAttributeTType(int index) const { return reflection->getAttribute(index).getType(); }
|
||||
const TType* TProgram::getUniformTType(int index) const { return reflection->getUniform(index).getType(); }
|
||||
const TType* TProgram::getUniformBlockTType(int index) const { return reflection->getUniformBlock(index).getType(); }
|
||||
unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); }
|
||||
|
||||
void TProgram::dumpReflection() { reflection->dump(); }
|
||||
|
||||
|
||||
@@ -229,11 +229,11 @@ public:
|
||||
returnType.shallowCopy(retType);
|
||||
declaredBuiltIn = retType.getQualifier().builtIn;
|
||||
}
|
||||
virtual TFunction* clone() const;
|
||||
virtual TFunction* clone() const override;
|
||||
virtual ~TFunction();
|
||||
|
||||
virtual TFunction* getAsFunction() { return this; }
|
||||
virtual const TFunction* getAsFunction() const { return this; }
|
||||
virtual TFunction* getAsFunction() override { return this; }
|
||||
virtual const TFunction* getAsFunction() const override { return this; }
|
||||
|
||||
virtual void addParameter(TParameter& p)
|
||||
{
|
||||
@@ -251,10 +251,10 @@ public:
|
||||
mangledName.insert(0, prefix);
|
||||
}
|
||||
|
||||
virtual const TString& getMangledName() const { return mangledName; }
|
||||
virtual const TType& getType() const { return returnType; }
|
||||
virtual const TString& getMangledName() const override { return mangledName; }
|
||||
virtual const TType& getType() const override { return returnType; }
|
||||
virtual TBuiltInVariable getDeclaredBuiltInType() const { return declaredBuiltIn; }
|
||||
virtual TType& getWritableType() { return returnType; }
|
||||
virtual TType& getWritableType() override { return returnType; }
|
||||
virtual void relateToOperator(TOperator o) { assert(writable); op = o; }
|
||||
virtual TOperator getBuiltInOp() const { return op; }
|
||||
virtual void setDefined() { assert(writable); defined = true; }
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
|
||||
virtual const TParameter& operator[](int i) const { return parameters[i]; }
|
||||
|
||||
virtual void dump(TInfoSink &infoSink) const;
|
||||
virtual void dump(TInfoSink &infoSink) const override;
|
||||
|
||||
protected:
|
||||
explicit TFunction(const TFunction&);
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
|
||||
virtual void visitSymbol(TIntermSymbol* base)
|
||||
{
|
||||
if (base->getQualifier().storage == EvqUniform) {
|
||||
if (base->getType().getQualifier().isUniformOrBuffer()) {
|
||||
TVarEntryInfo ent = { base->getId(), base, !traverseAll };
|
||||
TVarLiveMap::iterator at = std::lower_bound(varLiveList.begin(), varLiveList.end(), ent, TVarEntryInfo::TOrderById());
|
||||
if (at != varLiveList.end() && at->id == ent.id)
|
||||
@@ -227,6 +227,7 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver
|
||||
int baseTextureBinding;
|
||||
int baseImageBinding;
|
||||
int baseUboBinding;
|
||||
int baseSsboBinding;
|
||||
bool doAutoMapping;
|
||||
typedef std::vector<int> TSlotSet;
|
||||
typedef std::unordered_map<int, TSlotSet> TSlotSetMap;
|
||||
@@ -281,8 +282,11 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver
|
||||
return checkEmpty(set, baseTextureBinding + type.getQualifier().layoutBinding);
|
||||
}
|
||||
|
||||
if (type.getQualifier().isUniformOrBuffer())
|
||||
if (type.getQualifier().storage == EvqUniform)
|
||||
return checkEmpty(set, baseUboBinding + type.getQualifier().layoutBinding);
|
||||
|
||||
if (type.getQualifier().storage == EvqBuffer)
|
||||
return checkEmpty(set, baseSsboBinding + type.getQualifier().layoutBinding);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -308,8 +312,11 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver
|
||||
return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding);
|
||||
}
|
||||
|
||||
if (type.getQualifier().isUniformOrBuffer())
|
||||
if (type.getQualifier().storage == EvqUniform)
|
||||
return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding);
|
||||
|
||||
if (type.getQualifier().storage == EvqBuffer)
|
||||
return reserveSlot(set, baseSsboBinding + type.getQualifier().layoutBinding);
|
||||
} else if (is_live && doAutoMapping) {
|
||||
// find free slot, the caller did make sure it passes all vars with binding
|
||||
// first and now all are passed that do not have a binding and needs one
|
||||
@@ -325,8 +332,11 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver
|
||||
return getFreeSlot(set, baseTextureBinding);
|
||||
}
|
||||
|
||||
if (type.getQualifier().isUniformOrBuffer())
|
||||
if (type.getQualifier().storage == EvqUniform)
|
||||
return getFreeSlot(set, baseUboBinding);
|
||||
|
||||
if (type.getQualifier().storage == EvqBuffer)
|
||||
return getFreeSlot(set, baseSsboBinding);
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -351,6 +361,7 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi
|
||||
intermediate.getShiftTextureBinding() == 0 &&
|
||||
intermediate.getShiftImageBinding() == 0 &&
|
||||
intermediate.getShiftUboBinding() == 0 &&
|
||||
intermediate.getShiftSsboBinding() == 0 &&
|
||||
intermediate.getAutoMapBindings() == false &&
|
||||
resolver == nullptr)
|
||||
return true;
|
||||
@@ -369,6 +380,7 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi
|
||||
defaultResolver.baseTextureBinding = intermediate.getShiftTextureBinding();
|
||||
defaultResolver.baseImageBinding = intermediate.getShiftImageBinding();
|
||||
defaultResolver.baseUboBinding = intermediate.getShiftUboBinding();
|
||||
defaultResolver.baseSsboBinding = intermediate.getShiftSsboBinding();
|
||||
defaultResolver.doAutoMapping = intermediate.getAutoMapBindings();
|
||||
|
||||
resolver = &defaultResolver;
|
||||
|
||||
@@ -174,6 +174,7 @@ public:
|
||||
shiftTextureBinding(0),
|
||||
shiftImageBinding(0),
|
||||
shiftUboBinding(0),
|
||||
shiftSsboBinding(0),
|
||||
autoMapBindings(false),
|
||||
flattenUniformArrays(false),
|
||||
useUnknownFormat(false)
|
||||
@@ -207,6 +208,8 @@ public:
|
||||
unsigned int getShiftImageBinding() const { return shiftImageBinding; }
|
||||
void setShiftUboBinding(unsigned int shift) { shiftUboBinding = shift; }
|
||||
unsigned int getShiftUboBinding() const { return shiftUboBinding; }
|
||||
void setShiftSsboBinding(unsigned int shift) { shiftSsboBinding = shift; }
|
||||
unsigned int getShiftSsboBinding() const { return shiftSsboBinding; }
|
||||
void setAutoMapBindings(bool map) { autoMapBindings = map; }
|
||||
bool getAutoMapBindings() const { return autoMapBindings; }
|
||||
void setFlattenUniformArrays(bool flatten) { flattenUniformArrays = flatten; }
|
||||
@@ -485,6 +488,7 @@ protected:
|
||||
unsigned int shiftTextureBinding;
|
||||
unsigned int shiftImageBinding;
|
||||
unsigned int shiftUboBinding;
|
||||
unsigned int shiftSsboBinding;
|
||||
bool autoMapBindings;
|
||||
bool flattenUniformArrays;
|
||||
bool useUnknownFormat;
|
||||
|
||||
@@ -696,14 +696,27 @@ void TReflectionTraverser::visitSymbol(TIntermSymbol* base)
|
||||
// Implement TReflection methods.
|
||||
//
|
||||
|
||||
// Track any required attribute reflection, such as compute shader numthreads.
|
||||
//
|
||||
void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediate& intermediate)
|
||||
{
|
||||
if (stage == EShLangCompute) {
|
||||
// Remember thread dimensions
|
||||
for (int dim=0; dim<3; ++dim)
|
||||
localSize[dim] = intermediate.getLocalSize(dim);
|
||||
}
|
||||
}
|
||||
|
||||
// Merge live symbols from 'intermediate' into the existing reflection database.
|
||||
//
|
||||
// Returns false if the input is too malformed to do this.
|
||||
bool TReflection::addStage(EShLanguage, const TIntermediate& intermediate)
|
||||
bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate)
|
||||
{
|
||||
if (intermediate.getNumEntryPoints() != 1 || intermediate.isRecursive())
|
||||
return false;
|
||||
|
||||
buildAttributeReflection(stage, intermediate);
|
||||
|
||||
TReflectionTraverser it(intermediate, *this);
|
||||
|
||||
// put the entry point on the list of functions to process
|
||||
@@ -736,6 +749,16 @@ void TReflection::dump()
|
||||
indexToAttribute[i].dump();
|
||||
printf("\n");
|
||||
|
||||
if (getLocalSize(0) > 1) {
|
||||
static const char* axis[] = { "X", "Y", "Z" };
|
||||
|
||||
for (int dim=0; dim<3; ++dim)
|
||||
if (getLocalSize(dim) > 1)
|
||||
printf("Local size %s: %d\n", axis[dim], getLocalSize(dim));
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// printf("Live names\n");
|
||||
// for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it)
|
||||
// printf("%s: %d\n", it->first.c_str(), it->second);
|
||||
|
||||
@@ -89,7 +89,12 @@ protected:
|
||||
// The full reflection database
|
||||
class TReflection {
|
||||
public:
|
||||
TReflection() : badReflection(TObjectReflection::badReflection()) { }
|
||||
TReflection() : badReflection(TObjectReflection::badReflection())
|
||||
{
|
||||
for (int dim=0; dim<3; ++dim)
|
||||
localSize[dim] = 0;
|
||||
}
|
||||
|
||||
virtual ~TReflection() {}
|
||||
|
||||
// grow the reflection stage by stage
|
||||
@@ -135,11 +140,16 @@ public:
|
||||
return it->second;
|
||||
}
|
||||
|
||||
// Thread local size
|
||||
unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
|
||||
|
||||
void dump();
|
||||
|
||||
protected:
|
||||
friend class glslang::TReflectionTraverser;
|
||||
|
||||
void buildAttributeReflection(EShLanguage, const TIntermediate&);
|
||||
|
||||
// Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;
|
||||
typedef std::map<TString, int> TNameToIndex;
|
||||
typedef std::vector<TObjectReflection> TMapIndexToReflection;
|
||||
@@ -149,6 +159,8 @@ protected:
|
||||
TMapIndexToReflection indexToUniform;
|
||||
TMapIndexToReflection indexToUniformBlock;
|
||||
TMapIndexToReflection indexToAttribute;
|
||||
|
||||
unsigned int localSize[3];
|
||||
};
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
2
3rdparty/glslang/glslang/Public/ShaderLang.h
vendored
2
3rdparty/glslang/glslang/Public/ShaderLang.h
vendored
@@ -310,6 +310,7 @@ public:
|
||||
void setShiftTextureBinding(unsigned int base);
|
||||
void setShiftImageBinding(unsigned int base);
|
||||
void setShiftUboBinding(unsigned int base);
|
||||
void setShiftSsboBinding(unsigned int base);
|
||||
void setAutoMapBindings(bool map);
|
||||
void setFlattenUniformArrays(bool flatten);
|
||||
void setNoStorageFormat(bool useUnknownFormat);
|
||||
@@ -514,6 +515,7 @@ public:
|
||||
int getUniformBufferOffset(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET)
|
||||
int getUniformArraySize(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE)
|
||||
int getNumLiveAttributes() const; // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES)
|
||||
unsigned getLocalSize(int dim) const; // return dim'th local size
|
||||
const char *getAttributeName(int index) const; // can be used for glGetActiveAttrib()
|
||||
int getAttributeType(int index) const; // can be used for glGetActiveAttrib()
|
||||
const TType* getUniformTType(int index) const; // returns a TType*
|
||||
|
||||
6
3rdparty/glslang/gtests/Hlsl.FromFile.cpp
vendored
6
3rdparty/glslang/gtests/Hlsl.FromFile.cpp
vendored
@@ -221,6 +221,12 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"hlsl.struct.split.trivial.vert", "main"},
|
||||
{"hlsl.structarray.flatten.frag", "main"},
|
||||
{"hlsl.structarray.flatten.geom", "main"},
|
||||
{"hlsl.structbuffer.frag", "main"},
|
||||
{"hlsl.structbuffer.atomics.frag", "main"},
|
||||
{"hlsl.structbuffer.byte.frag", "main"},
|
||||
{"hlsl.structbuffer.coherent.frag", "main"},
|
||||
{"hlsl.structbuffer.rw.frag", "main"},
|
||||
{"hlsl.structbuffer.rwbyte.frag", "main"},
|
||||
{"hlsl.structin.vert", "main"},
|
||||
{"hlsl.structIoFourWay.frag", "main"},
|
||||
{"hlsl.intrinsics.vert", "VertexShaderFunction"},
|
||||
|
||||
21
3rdparty/glslang/gtests/Spv.FromFile.cpp
vendored
21
3rdparty/glslang/gtests/Spv.FromFile.cpp
vendored
@@ -48,6 +48,7 @@ struct IoMapData {
|
||||
int baseTextureBinding;
|
||||
int baseImageBinding;
|
||||
int baseUboBinding;
|
||||
int baseSsboBinding;
|
||||
bool autoMapBindings;
|
||||
bool flattenUniforms;
|
||||
};
|
||||
@@ -129,6 +130,7 @@ TEST_P(HlslIoMap, FromFile)
|
||||
GetParam().baseTextureBinding,
|
||||
GetParam().baseImageBinding,
|
||||
GetParam().baseUboBinding,
|
||||
GetParam().baseSsboBinding,
|
||||
GetParam().autoMapBindings,
|
||||
GetParam().flattenUniforms);
|
||||
}
|
||||
@@ -143,6 +145,7 @@ TEST_P(GlslIoMap, FromFile)
|
||||
GetParam().baseTextureBinding,
|
||||
GetParam().baseImageBinding,
|
||||
GetParam().baseUboBinding,
|
||||
GetParam().baseSsboBinding,
|
||||
GetParam().autoMapBindings,
|
||||
GetParam().flattenUniforms);
|
||||
}
|
||||
@@ -229,6 +232,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
"spv.forLoop.frag",
|
||||
"spv.forwardFun.frag",
|
||||
"spv.functionCall.frag",
|
||||
"spv.functionNestedOpaque.vert",
|
||||
"spv.functionSemantics.frag",
|
||||
"spv.interpOps.frag",
|
||||
"spv.int64.frag",
|
||||
@@ -301,15 +305,16 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Hlsl, HlslIoMap,
|
||||
::testing::ValuesIn(std::vector<IoMapData>{
|
||||
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, true, false },
|
||||
{ "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, false, false },
|
||||
{ "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, true, true },
|
||||
{ "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, true, true },
|
||||
{ "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, true, true },
|
||||
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, 30, true, false },
|
||||
{ "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, 30, false, false },
|
||||
{ "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, 30, true, true },
|
||||
{ "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
|
||||
{ "spv.ssbo.autoassign.frag", "main", 5, 10, 0, 15, 30, true, true },
|
||||
{ "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, 30, true, true },
|
||||
{ "spv.register.autoassign.rangetest.frag", "main",
|
||||
glslang::TQualifier::layoutBindingEnd-2,
|
||||
glslang::TQualifier::layoutBindingEnd+5,
|
||||
20, true, false },
|
||||
20, 30, true, false },
|
||||
}),
|
||||
FileNameAsCustomTestSuffixIoMap
|
||||
);
|
||||
@@ -318,8 +323,8 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Hlsl, GlslIoMap,
|
||||
::testing::ValuesIn(std::vector<IoMapData>{
|
||||
{ "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, true, false },
|
||||
{ "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, false, false },
|
||||
{ "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, 30, true, false },
|
||||
{ "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, 30, false, false },
|
||||
}),
|
||||
FileNameAsCustomTestSuffixIoMap
|
||||
);
|
||||
|
||||
6
3rdparty/glslang/gtests/TestFixture.h
vendored
6
3rdparty/glslang/gtests/TestFixture.h
vendored
@@ -241,6 +241,7 @@ public:
|
||||
int baseTextureBinding,
|
||||
int baseImageBinding,
|
||||
int baseUboBinding,
|
||||
int baseSsboBinding,
|
||||
bool autoMapBindings,
|
||||
bool flattenUniformArrays)
|
||||
{
|
||||
@@ -251,6 +252,7 @@ public:
|
||||
shader.setShiftTextureBinding(baseTextureBinding);
|
||||
shader.setShiftImageBinding(baseImageBinding);
|
||||
shader.setShiftUboBinding(baseUboBinding);
|
||||
shader.setShiftSsboBinding(baseSsboBinding);
|
||||
shader.setAutoMapBindings(autoMapBindings);
|
||||
shader.setFlattenUniformArrays(flattenUniformArrays);
|
||||
|
||||
@@ -430,6 +432,7 @@ public:
|
||||
int baseTextureBinding,
|
||||
int baseImageBinding,
|
||||
int baseUboBinding,
|
||||
int baseSsboBinding,
|
||||
bool autoMapBindings,
|
||||
bool flattenUniformArrays)
|
||||
{
|
||||
@@ -443,7 +446,8 @@ public:
|
||||
|
||||
const EShMessages controls = DeriveOptions(source, semantics, target);
|
||||
GlslangResult result = compileLinkIoMap(testName, input, entryPointName, controls,
|
||||
baseSamplerBinding, baseTextureBinding, baseImageBinding, baseUboBinding,
|
||||
baseSamplerBinding, baseTextureBinding, baseImageBinding,
|
||||
baseUboBinding, baseSsboBinding,
|
||||
autoMapBindings,
|
||||
flattenUniformArrays);
|
||||
|
||||
|
||||
128
3rdparty/glslang/hlsl/hlslGrammar.cpp
vendored
128
3rdparty/glslang/hlsl/hlslGrammar.cpp
vendored
@@ -406,6 +406,27 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2)
|
||||
}
|
||||
}
|
||||
|
||||
TString* blockName = idToken.string;
|
||||
|
||||
// For structbuffers, we couldn't create the block type while accepting the
|
||||
// template type, because we need the identifier name. Now that we have that,
|
||||
// we can create the buffer type.
|
||||
// TODO: how to determine this without looking for implicit array sizes?
|
||||
if (variableType.getBasicType() == EbtBlock) {
|
||||
const int memberCount = variableType.getStruct()->size();
|
||||
assert(memberCount > 0);
|
||||
|
||||
TType* contentType = (*variableType.getStruct())[memberCount-1].type;
|
||||
|
||||
// Set the field name and qualifier from the declaration, now that we know it.
|
||||
if (contentType->isRuntimeSizedArray()) {
|
||||
contentType->getQualifier() = variableType.getQualifier();
|
||||
blockName = nullptr; // this will be an anonymous block...
|
||||
contentType->setFieldName(*idToken.string); // field name is declaration name
|
||||
variableType.setTypeName(*idToken.string);
|
||||
}
|
||||
}
|
||||
|
||||
// Hand off the actual declaration
|
||||
|
||||
// TODO: things scoped within an annotation need their own name space;
|
||||
@@ -414,7 +435,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2)
|
||||
if (typedefDecl)
|
||||
parseContext.declareTypedef(idToken.loc, *idToken.string, variableType);
|
||||
else if (variableType.getBasicType() == EbtBlock)
|
||||
parseContext.declareBlock(idToken.loc, variableType, idToken.string);
|
||||
parseContext.declareBlock(idToken.loc, variableType, blockName);
|
||||
else {
|
||||
if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) {
|
||||
// this isn't really an individual variable, but a member of the $Global buffer
|
||||
@@ -533,8 +554,11 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type)
|
||||
qualifier.layoutFormat = type.getQualifier().layoutFormat;
|
||||
qualifier.precision = type.getQualifier().precision;
|
||||
|
||||
if (type.getQualifier().storage == EvqVaryingOut)
|
||||
if (type.getQualifier().storage == EvqVaryingOut ||
|
||||
type.getQualifier().storage == EvqBuffer) {
|
||||
qualifier.storage = type.getQualifier().storage;
|
||||
qualifier.readonly = type.getQualifier().readonly;
|
||||
}
|
||||
|
||||
type.getQualifier() = qualifier;
|
||||
}
|
||||
@@ -609,6 +633,9 @@ bool HlslGrammar::acceptQualifier(TQualifier& qualifier)
|
||||
if (! acceptLayoutQualifierList(qualifier))
|
||||
return false;
|
||||
continue;
|
||||
case EHTokGloballyCoherent:
|
||||
qualifier.coherent = true;
|
||||
break;
|
||||
|
||||
// GS geometries: these are specified on stage input variables, and are an error (not verified here)
|
||||
// for output variables.
|
||||
@@ -1246,11 +1273,19 @@ bool HlslGrammar::acceptType(TType& type)
|
||||
return acceptTextureType(type);
|
||||
break;
|
||||
|
||||
case EHTokAppendStructuredBuffer:
|
||||
case EHTokByteAddressBuffer:
|
||||
case EHTokConsumeStructuredBuffer:
|
||||
case EHTokRWByteAddressBuffer:
|
||||
case EHTokRWStructuredBuffer:
|
||||
case EHTokStructuredBuffer:
|
||||
return acceptStructBufferType(type);
|
||||
break;
|
||||
|
||||
case EHTokStruct:
|
||||
case EHTokCBuffer:
|
||||
case EHTokTBuffer:
|
||||
return acceptStruct(type);
|
||||
break;
|
||||
|
||||
case EHTokIdentifier:
|
||||
// An identifier could be for a user-defined type.
|
||||
@@ -1783,6 +1818,93 @@ bool HlslGrammar::acceptStruct(TType& type)
|
||||
return true;
|
||||
}
|
||||
|
||||
// struct_buffer
|
||||
// : APPENDSTRUCTUREDBUFFER
|
||||
// | BYTEADDRESSBUFFER
|
||||
// | CONSUMESTRUCTUREDBUFFER
|
||||
// | RWBYTEADDRESSBUFFER
|
||||
// | RWSTRUCTUREDBUFFER
|
||||
// | STRUCTUREDBUFFER
|
||||
bool HlslGrammar::acceptStructBufferType(TType& type)
|
||||
{
|
||||
const EHlslTokenClass structBuffType = peek();
|
||||
|
||||
// TODO: globallycoherent
|
||||
bool hasTemplateType = true;
|
||||
bool readonly = false;
|
||||
|
||||
TStorageQualifier storage = EvqBuffer;
|
||||
|
||||
switch (structBuffType) {
|
||||
case EHTokAppendStructuredBuffer:
|
||||
unimplemented("AppendStructuredBuffer");
|
||||
return false;
|
||||
case EHTokByteAddressBuffer:
|
||||
hasTemplateType = false;
|
||||
readonly = true;
|
||||
break;
|
||||
case EHTokConsumeStructuredBuffer:
|
||||
unimplemented("ConsumeStructuredBuffer");
|
||||
return false;
|
||||
case EHTokRWByteAddressBuffer:
|
||||
hasTemplateType = false;
|
||||
break;
|
||||
case EHTokRWStructuredBuffer:
|
||||
break;
|
||||
case EHTokStructuredBuffer:
|
||||
readonly = true;
|
||||
break;
|
||||
default:
|
||||
return false; // not a structure buffer type
|
||||
}
|
||||
|
||||
advanceToken(); // consume the structure keyword
|
||||
|
||||
// type on which this StructedBuffer is templatized. E.g, StructedBuffer<MyStruct> ==> MyStruct
|
||||
TType* templateType = new TType;
|
||||
|
||||
if (hasTemplateType) {
|
||||
if (! acceptTokenClass(EHTokLeftAngle)) {
|
||||
expected("left angle bracket");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! acceptType(*templateType)) {
|
||||
expected("type");
|
||||
return false;
|
||||
}
|
||||
if (! acceptTokenClass(EHTokRightAngle)) {
|
||||
expected("right angle bracket");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// byte address buffers have no explicit type.
|
||||
TType uintType(EbtUint, storage);
|
||||
templateType->shallowCopy(uintType);
|
||||
}
|
||||
|
||||
// Create an unsized array out of that type.
|
||||
// TODO: does this work if it's already an array type?
|
||||
TArraySizes unsizedArray;
|
||||
unsizedArray.addInnerSize(UnsizedArraySize);
|
||||
templateType->newArraySizes(unsizedArray);
|
||||
templateType->getQualifier().storage = storage;
|
||||
templateType->getQualifier().readonly = readonly;
|
||||
|
||||
// Create block type. TODO: hidden internal uint member when needed
|
||||
TTypeList* blockStruct = new TTypeList;
|
||||
TTypeLoc member = { templateType, token.loc };
|
||||
blockStruct->push_back(member);
|
||||
|
||||
TType blockType(blockStruct, "", templateType->getQualifier());
|
||||
|
||||
// It's not until we see the name during declaration that we can set the
|
||||
// field name. That happens in HlslGrammar::acceptDeclaration.
|
||||
type.shallowCopy(blockType);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// struct_declaration_list
|
||||
// : struct_declaration SEMI_COLON struct_declaration SEMI_COLON ...
|
||||
//
|
||||
|
||||
1
3rdparty/glslang/hlsl/hlslGrammar.h
vendored
1
3rdparty/glslang/hlsl/hlslGrammar.h
vendored
@@ -83,6 +83,7 @@ namespace glslang {
|
||||
bool acceptAnnotations(TQualifier&);
|
||||
bool acceptSamplerType(TType&);
|
||||
bool acceptTextureType(TType&);
|
||||
bool acceptStructBufferType(TType&);
|
||||
bool acceptStruct(TType&);
|
||||
bool acceptStructDeclarationList(TTypeList*&);
|
||||
bool acceptFunctionParameters(TFunction&);
|
||||
|
||||
362
3rdparty/glslang/hlsl/hlslParseHelper.cpp
vendored
362
3rdparty/glslang/hlsl/hlslParseHelper.cpp
vendored
@@ -790,6 +790,61 @@ TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const cha
|
||||
return childNode;
|
||||
}
|
||||
|
||||
//
|
||||
// Return true if the name is a sampler method
|
||||
//
|
||||
bool HlslParseContext::isSamplerMethod(const TString& name) const
|
||||
{
|
||||
return
|
||||
name == "CalculateLevelOfDetail" ||
|
||||
name == "CalculateLevelOfDetailUnclamped" ||
|
||||
name == "Gather" ||
|
||||
name == "GatherRed" ||
|
||||
name == "GatherGreen" ||
|
||||
name == "GatherBlue" ||
|
||||
name == "GatherAlpha" ||
|
||||
name == "GatherCmp" ||
|
||||
name == "GatherCmpRed" ||
|
||||
name == "GatherCmpGreen" ||
|
||||
name == "GatherCmpBlue" ||
|
||||
name == "GatherCmpAlpha" ||
|
||||
name == "GetDimensions" ||
|
||||
name == "GetSamplePosition" ||
|
||||
name == "Load" ||
|
||||
name == "Sample" ||
|
||||
name == "SampleBias" ||
|
||||
name == "SampleCmp" ||
|
||||
name == "SampleCmpLevelZero" ||
|
||||
name == "SampleGrad" ||
|
||||
name == "SampleLevel";
|
||||
}
|
||||
|
||||
//
|
||||
// Return true if the name is a struct buffer method
|
||||
//
|
||||
bool HlslParseContext::isStructBufferMethod(const TString& name) const
|
||||
{
|
||||
return
|
||||
name == "GetDimensions" ||
|
||||
name == "Load" ||
|
||||
name == "Load2" ||
|
||||
name == "Load3" ||
|
||||
name == "Load4" ||
|
||||
name == "Store" ||
|
||||
name == "Store2" ||
|
||||
name == "Store3" ||
|
||||
name == "Store4" ||
|
||||
name == "InterlockedAdd" ||
|
||||
name == "InterlockedAnd" ||
|
||||
name == "InterlockedCompareExchange" ||
|
||||
name == "InterlockedCompareStore" ||
|
||||
name == "InterlockedExchange" ||
|
||||
name == "InterlockedMax" ||
|
||||
name == "InterlockedMin" ||
|
||||
name == "InterlockedOr" ||
|
||||
name == "InterlockedXor";
|
||||
}
|
||||
|
||||
//
|
||||
// Handle seeing a base.field dereference in the grammar.
|
||||
//
|
||||
@@ -804,35 +859,18 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
|
||||
//
|
||||
if (field == "length") {
|
||||
return intermediate.addMethod(base, TType(EbtInt), &field, loc);
|
||||
} else if (field == "CalculateLevelOfDetail" ||
|
||||
field == "CalculateLevelOfDetailUnclamped" ||
|
||||
field == "Gather" ||
|
||||
field == "GatherRed" ||
|
||||
field == "GatherGreen" ||
|
||||
field == "GatherBlue" ||
|
||||
field == "GatherAlpha" ||
|
||||
field == "GatherCmp" ||
|
||||
field == "GatherCmpRed" ||
|
||||
field == "GatherCmpGreen" ||
|
||||
field == "GatherCmpBlue" ||
|
||||
field == "GatherCmpAlpha" ||
|
||||
field == "GetDimensions" ||
|
||||
field == "GetSamplePosition" ||
|
||||
field == "Load" ||
|
||||
field == "Sample" ||
|
||||
field == "SampleBias" ||
|
||||
field == "SampleCmp" ||
|
||||
field == "SampleCmpLevelZero" ||
|
||||
field == "SampleGrad" ||
|
||||
field == "SampleLevel") {
|
||||
// If it's not a method on a sampler object, we fall through in case it is a struct member.
|
||||
if (base->getType().getBasicType() == EbtSampler) {
|
||||
const TSampler& sampler = base->getType().getSampler();
|
||||
if (! sampler.isPureSampler()) {
|
||||
const int vecSize = sampler.isShadow() ? 1 : 4; // TODO: handle arbitrary sample return sizes
|
||||
return intermediate.addMethod(base, TType(sampler.type, EvqTemporary, vecSize), &field, loc);
|
||||
}
|
||||
} else if (isSamplerMethod(field) && base->getType().getBasicType() == EbtSampler) {
|
||||
// If it's not a method on a sampler object, we fall through to let other objects have a go.
|
||||
const TSampler& sampler = base->getType().getSampler();
|
||||
if (! sampler.isPureSampler()) {
|
||||
const int vecSize = sampler.isShadow() ? 1 : 4; // TODO: handle arbitrary sample return sizes
|
||||
return intermediate.addMethod(base, TType(sampler.type, EvqTemporary, vecSize), &field, loc);
|
||||
}
|
||||
} else if (isStructBufferMethod(field) &&
|
||||
base->getType().isRuntimeSizedArray() &&
|
||||
(base->getQualifier().storage == EvqUniform || base->getQualifier().storage == EvqBuffer)) {
|
||||
TType retType(base->getType(), 0);
|
||||
return intermediate.addMethod(base, retType, &field, loc);
|
||||
} else if (field == "Append" ||
|
||||
field == "RestartStrip") {
|
||||
// We cannot check the type here: it may be sanitized if we're not compiling a geometry shader, but
|
||||
@@ -2236,6 +2274,236 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc
|
||||
return txcombine;
|
||||
}
|
||||
|
||||
//
|
||||
// Decompose structure buffer methods into AST
|
||||
//
|
||||
void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
|
||||
{
|
||||
if (!node || !node->getAsOperator())
|
||||
return;
|
||||
|
||||
const TOperator op = node->getAsOperator()->getOp();
|
||||
TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr;
|
||||
|
||||
TIntermTyped* argArray = argAggregate ? argAggregate->getSequence()[0]->getAsTyped() : nullptr; // array
|
||||
|
||||
// Bail out if not a block method
|
||||
if (argArray == nullptr || !argArray->getType().isRuntimeSizedArray())
|
||||
return;
|
||||
|
||||
switch (op) {
|
||||
case EOpMethodLoad:
|
||||
{
|
||||
TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped(); // index
|
||||
|
||||
// Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address
|
||||
// buffer then, but that's what it calls itself.
|
||||
const bool isByteAddressBuffer = (argArray->getBasicType() == EbtUint);
|
||||
if (isByteAddressBuffer)
|
||||
argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true),
|
||||
loc, TType(EbtInt));
|
||||
|
||||
// Index into the array to find the item being loaded.
|
||||
const TOperator idxOp = (argIndex->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
|
||||
|
||||
node = intermediate.addIndex(idxOp, argArray, argIndex, loc);
|
||||
|
||||
const TType derefType(argArray->getType(), 0);
|
||||
node->setType(derefType);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EOpMethodLoad2:
|
||||
case EOpMethodLoad3:
|
||||
case EOpMethodLoad4:
|
||||
{
|
||||
TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped(); // index
|
||||
|
||||
TOperator constructOp = EOpNull;
|
||||
int size = 0;
|
||||
|
||||
switch (op) {
|
||||
case EOpMethodLoad2: size = 2; constructOp = EOpConstructVec2; break;
|
||||
case EOpMethodLoad3: size = 3; constructOp = EOpConstructVec3; break;
|
||||
case EOpMethodLoad4: size = 4; constructOp = EOpConstructVec4; break;
|
||||
default: assert(0);
|
||||
}
|
||||
|
||||
TIntermTyped* body = nullptr;
|
||||
|
||||
// First, we'll store the address in a variable to avoid multiple shifts
|
||||
// (we must convert the byte address to an item address)
|
||||
TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex,
|
||||
intermediate.addConstantUnion(2, loc, true), loc, TType(EbtInt));
|
||||
|
||||
TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary));
|
||||
TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc);
|
||||
|
||||
body = intermediate.growAggregate(body, intermediate.addAssign(EOpAssign, byteAddrIdxVar, byteAddrIdx, loc));
|
||||
|
||||
TIntermTyped* vec = nullptr;
|
||||
|
||||
// These are only valid on (rw)byteaddressbuffers, so we can always perform the >>2
|
||||
// address conversion.
|
||||
for (int idx=0; idx<size; ++idx) {
|
||||
TIntermTyped* offsetIdx = byteAddrIdxVar;
|
||||
|
||||
// add index offset
|
||||
if (idx != 0)
|
||||
offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx, intermediate.addConstantUnion(idx, loc, true),
|
||||
loc, TType(EbtInt));
|
||||
|
||||
const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
|
||||
|
||||
vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc));
|
||||
}
|
||||
|
||||
vec->setType(TType(argArray->getBasicType(), EvqTemporary, size));
|
||||
vec->getAsAggregate()->setOperator(constructOp);
|
||||
|
||||
body = intermediate.growAggregate(body, vec);
|
||||
body->setType(vec->getType());
|
||||
body->getAsAggregate()->setOperator(EOpSequence);
|
||||
|
||||
node = body;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EOpMethodStore:
|
||||
case EOpMethodStore2:
|
||||
case EOpMethodStore3:
|
||||
case EOpMethodStore4:
|
||||
{
|
||||
TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped(); // address
|
||||
TIntermTyped* argValue = argAggregate->getSequence()[2]->getAsTyped(); // value
|
||||
|
||||
// Index into the array to find the item being loaded.
|
||||
// Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address
|
||||
// buffer then, but that's what it calls itself.
|
||||
|
||||
int size = 0;
|
||||
|
||||
switch (op) {
|
||||
case EOpMethodStore: size = 1; break;
|
||||
case EOpMethodStore2: size = 2; break;
|
||||
case EOpMethodStore3: size = 3; break;
|
||||
case EOpMethodStore4: size = 4; break;
|
||||
default: assert(0);
|
||||
}
|
||||
|
||||
TIntermAggregate* body = nullptr;
|
||||
|
||||
// First, we'll store the address in a variable to avoid multiple shifts
|
||||
// (we must convert the byte address to an item address)
|
||||
TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex,
|
||||
intermediate.addConstantUnion(2, loc, true), loc, TType(EbtInt));
|
||||
|
||||
TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary));
|
||||
TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc);
|
||||
|
||||
body = intermediate.growAggregate(body, intermediate.addAssign(EOpAssign, byteAddrIdxVar, byteAddrIdx, loc));
|
||||
|
||||
for (int idx=0; idx<size; ++idx) {
|
||||
TIntermTyped* offsetIdx = byteAddrIdxVar;
|
||||
TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true);
|
||||
|
||||
// add index offset
|
||||
if (idx != 0)
|
||||
offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx, idxConst, loc, TType(EbtInt));
|
||||
|
||||
const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
|
||||
|
||||
TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc);
|
||||
TIntermTyped* rValue = (size == 1) ? argValue :
|
||||
intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc);
|
||||
|
||||
TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc);
|
||||
|
||||
body = intermediate.growAggregate(body, assign);
|
||||
}
|
||||
|
||||
body->setOperator(EOpSequence);
|
||||
node = body;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EOpMethodGetDimensions:
|
||||
{
|
||||
const int numArgs = argAggregate->getSequence().size();
|
||||
TIntermTyped* argNumItems = argAggregate->getSequence()[1]->getAsTyped(); // out num items
|
||||
TIntermTyped* argStride = numArgs > 2 ? argAggregate->getSequence()[2]->getAsTyped() : nullptr; // out stride
|
||||
|
||||
TIntermAggregate* body = nullptr;
|
||||
|
||||
// Length output:
|
||||
if (argArray->getType().isRuntimeSizedArray()) {
|
||||
TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray,
|
||||
argNumItems->getType());
|
||||
TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc);
|
||||
body = intermediate.growAggregate(body, assign, loc);
|
||||
} else {
|
||||
const int length = argArray->getType().getOuterArraySize();
|
||||
TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, intermediate.addConstantUnion(length, loc, true), loc);
|
||||
body = intermediate.growAggregate(body, assign, loc);
|
||||
}
|
||||
|
||||
// Stride output:
|
||||
if (argStride != nullptr) {
|
||||
int size;
|
||||
int stride;
|
||||
intermediate.getBaseAlignment(argArray->getType(), size, stride, false,
|
||||
argArray->getType().getQualifier().layoutMatrix == ElmRowMajor);
|
||||
|
||||
TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride, intermediate.addConstantUnion(stride, loc, true), loc);
|
||||
|
||||
body = intermediate.growAggregate(body, assign);
|
||||
}
|
||||
|
||||
body->setOperator(EOpSequence);
|
||||
node = body;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EOpInterlockedAdd:
|
||||
case EOpInterlockedAnd:
|
||||
case EOpInterlockedExchange:
|
||||
case EOpInterlockedMax:
|
||||
case EOpInterlockedMin:
|
||||
case EOpInterlockedOr:
|
||||
case EOpInterlockedXor:
|
||||
case EOpInterlockedCompareExchange:
|
||||
case EOpInterlockedCompareStore:
|
||||
{
|
||||
// We'll replace the first argument with the block dereference, and let
|
||||
// downstream decomposition handle the rest.
|
||||
|
||||
TIntermSequence& sequence = argAggregate->getSequence();
|
||||
|
||||
TIntermTyped* argIndex = sequence[1]->getAsTyped(); // index
|
||||
argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true),
|
||||
loc, TType(EbtInt));
|
||||
|
||||
const TOperator idxOp = (argIndex->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
|
||||
TIntermTyped* element = intermediate.addIndex(idxOp, argArray, argIndex, loc);
|
||||
|
||||
const TType derefType(argArray->getType(), 0);
|
||||
element->setType(derefType);
|
||||
|
||||
// Replace the numeric byte offset parameter with array reference.
|
||||
sequence[1] = element;
|
||||
sequence.erase(sequence.begin(), sequence.begin()+1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break; // most pass through unchanged
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Decompose DX9 and DX10 sample intrinsics & object methods into AST
|
||||
//
|
||||
@@ -2264,6 +2532,15 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
|
||||
const TOperator op = node->getAsOperator()->getOp();
|
||||
const TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr;
|
||||
|
||||
// Bail out if not a sampler method
|
||||
if (arguments != nullptr) {
|
||||
if ((argAggregate != nullptr && argAggregate->getSequence()[0]->getAsTyped()->getBasicType() != EbtSampler))
|
||||
return;
|
||||
|
||||
if (argAggregate == nullptr && arguments->getAsTyped()->getBasicType() != EbtSampler)
|
||||
return;
|
||||
}
|
||||
|
||||
switch (op) {
|
||||
// **** DX9 intrinsics: ****
|
||||
case EOpTexture:
|
||||
@@ -3359,9 +3636,27 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
|
||||
//
|
||||
// Find it in the symbol table.
|
||||
//
|
||||
const TFunction* fnCandidate;
|
||||
const TFunction* fnCandidate = nullptr;
|
||||
bool builtIn;
|
||||
fnCandidate = findFunction(loc, *function, builtIn, arguments);
|
||||
|
||||
// TODO: this needs improvement: there's no way at present to look up a signature in
|
||||
// the symbol table for an arbitrary type. This is a temporary hack until that ability exists.
|
||||
// It will have false positives, since it doesn't check arg counts or types.
|
||||
if (arguments && arguments->getAsAggregate()) {
|
||||
if (arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().isRuntimeSizedArray()) {
|
||||
if (isStructBufferMethod(function->getName())) {
|
||||
const TString mangle = function->getName() + "(";
|
||||
TSymbol* symbol = symbolTable.find(mangle, &builtIn);
|
||||
|
||||
if (symbol)
|
||||
fnCandidate = symbol->getAsFunction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fnCandidate == nullptr)
|
||||
fnCandidate = findFunction(loc, *function, builtIn, arguments);
|
||||
|
||||
if (fnCandidate) {
|
||||
// This is a declared function that might map to
|
||||
// - a built-in operator,
|
||||
@@ -3407,9 +3702,10 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
|
||||
// output conversions.
|
||||
const TIntermTyped* fnNode = result;
|
||||
|
||||
decomposeIntrinsic(loc, result, arguments); // HLSL->AST intrinsic decompositions
|
||||
decomposeSampleMethods(loc, result, arguments); // HLSL->AST sample method decompositions
|
||||
decomposeGeometryMethods(loc, result, arguments); // HLSL->AST geometry method decompositions
|
||||
decomposeStructBufferMethods(loc, result, arguments); // HLSL->AST struct buffer method decompositions
|
||||
decomposeIntrinsic(loc, result, arguments); // HLSL->AST intrinsic decompositions
|
||||
decomposeSampleMethods(loc, result, arguments); // HLSL->AST sample method decompositions
|
||||
decomposeGeometryMethods(loc, result, arguments); // HLSL->AST geometry method decompositions
|
||||
|
||||
// Convert 'out' arguments. If it was a constant folded built-in, it won't be an aggregate anymore.
|
||||
// Built-ins with a single argument aren't called with an aggregate, but they also don't have an output.
|
||||
|
||||
5
3rdparty/glslang/hlsl/hlslParseHelper.h
vendored
5
3rdparty/glslang/hlsl/hlslParseHelper.h
vendored
@@ -84,6 +84,7 @@ public:
|
||||
TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*);
|
||||
void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
|
||||
void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
|
||||
void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
|
||||
void decomposeGeometryMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
|
||||
TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*);
|
||||
void addInputArgumentConversions(const TFunction&, TIntermTyped*&);
|
||||
@@ -243,6 +244,10 @@ protected:
|
||||
void correctUniform(TQualifier& qualifier);
|
||||
void clearUniformInputOutput(TQualifier& qualifier);
|
||||
|
||||
// Test method names
|
||||
bool isSamplerMethod(const TString& name) const;
|
||||
bool isStructBufferMethod(const TString& name) const;
|
||||
|
||||
// Pass through to base class after remembering builtin mappings.
|
||||
using TParseContextBase::trackLinkage;
|
||||
void trackLinkage(TSymbol& variable) override;
|
||||
|
||||
29
3rdparty/glslang/hlsl/hlslParseables.cpp
vendored
29
3rdparty/glslang/hlsl/hlslParseables.cpp
vendored
@@ -850,6 +850,26 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
|
||||
{ "Append", "-", "-", "-", "-", EShLangGS },
|
||||
{ "RestartStrip", "-", "-", "-", "-", EShLangGS },
|
||||
|
||||
// Methods for structurebuffers. TODO: wildcard type matching.
|
||||
{ "Load", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Load2", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Load3", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Load4", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Store", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Store2", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Store3", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "Store4", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "GetDimensions", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedAdd", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedAnd", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedCompareExchange", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedCompareStore", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedExchange", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedMax", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedMin", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedOr", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
{ "InterlockedXor", nullptr, nullptr, "-", "-", EShLangAll },
|
||||
|
||||
// Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet.
|
||||
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 },
|
||||
};
|
||||
@@ -1144,6 +1164,15 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
|
||||
symbolTable.relateToOperator("CalculateLevelOfDetail", EOpMethodCalculateLevelOfDetail);
|
||||
symbolTable.relateToOperator("CalculateLevelOfDetailUnclamped", EOpMethodCalculateLevelOfDetailUnclamped);
|
||||
|
||||
// Structure buffer methods (excluding associations already made above for texture methods w/ same name)
|
||||
symbolTable.relateToOperator("Load2", EOpMethodLoad2);
|
||||
symbolTable.relateToOperator("Load3", EOpMethodLoad3);
|
||||
symbolTable.relateToOperator("Load4", EOpMethodLoad4);
|
||||
symbolTable.relateToOperator("Store", EOpMethodStore);
|
||||
symbolTable.relateToOperator("Store2", EOpMethodStore2);
|
||||
symbolTable.relateToOperator("Store3", EOpMethodStore3);
|
||||
symbolTable.relateToOperator("Store4", EOpMethodStore4);
|
||||
|
||||
// SM5 Texture methods
|
||||
symbolTable.relateToOperator("GatherRed", EOpMethodGatherRed);
|
||||
symbolTable.relateToOperator("GatherGreen", EOpMethodGatherGreen);
|
||||
|
||||
15
3rdparty/glslang/hlsl/hlslScanContext.cpp
vendored
15
3rdparty/glslang/hlsl/hlslScanContext.cpp
vendored
@@ -118,6 +118,7 @@ void HlslScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["out"] = EHTokOut;
|
||||
(*KeywordMap)["inout"] = EHTokInOut;
|
||||
(*KeywordMap)["layout"] = EHTokLayout;
|
||||
(*KeywordMap)["globallycoherent"] = EHTokGloballyCoherent;
|
||||
|
||||
(*KeywordMap)["point"] = EHTokPoint;
|
||||
(*KeywordMap)["line"] = EHTokLine;
|
||||
@@ -319,6 +320,13 @@ void HlslScanContext::fillInKeywordMap()
|
||||
(*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d;
|
||||
(*KeywordMap)["RWBuffer"] = EHTokRWBuffer;
|
||||
|
||||
(*KeywordMap)["AppendStructuredBuffer"] = EHTokAppendStructuredBuffer;
|
||||
(*KeywordMap)["ByteAddressBuffer"] = EHTokByteAddressBuffer;
|
||||
(*KeywordMap)["ConsumeStructuredBuffer"] = EHTokConsumeStructuredBuffer;
|
||||
(*KeywordMap)["RWByteAddressBuffer"] = EHTokRWByteAddressBuffer;
|
||||
(*KeywordMap)["RWStructuredBuffer"] = EHTokRWStructuredBuffer;
|
||||
(*KeywordMap)["StructuredBuffer"] = EHTokStructuredBuffer;
|
||||
|
||||
(*KeywordMap)["struct"] = EHTokStruct;
|
||||
(*KeywordMap)["cbuffer"] = EHTokCBuffer;
|
||||
(*KeywordMap)["tbuffer"] = EHTokTBuffer;
|
||||
@@ -527,6 +535,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
|
||||
case EHTokInOut:
|
||||
case EHTokPrecise:
|
||||
case EHTokLayout:
|
||||
case EHTokGloballyCoherent:
|
||||
return keyword;
|
||||
|
||||
// primitive types
|
||||
@@ -722,6 +731,12 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
|
||||
case EHTokRWTexture2darray:
|
||||
case EHTokRWTexture3d:
|
||||
case EHTokRWBuffer:
|
||||
case EHTokAppendStructuredBuffer:
|
||||
case EHTokByteAddressBuffer:
|
||||
case EHTokConsumeStructuredBuffer:
|
||||
case EHTokRWByteAddressBuffer:
|
||||
case EHTokRWStructuredBuffer:
|
||||
case EHTokStructuredBuffer:
|
||||
return keyword;
|
||||
|
||||
// variable, user type, ...
|
||||
|
||||
9
3rdparty/glslang/hlsl/hlslTokens.h
vendored
9
3rdparty/glslang/hlsl/hlslTokens.h
vendored
@@ -65,6 +65,7 @@ enum EHlslTokenClass {
|
||||
EHTokOut,
|
||||
EHTokInOut,
|
||||
EHTokLayout,
|
||||
EHTokGloballyCoherent,
|
||||
|
||||
// primitive types
|
||||
EHTokPoint,
|
||||
@@ -256,6 +257,14 @@ enum EHlslTokenClass {
|
||||
EHTokRWTexture3d,
|
||||
EHTokRWBuffer,
|
||||
|
||||
// Structure buffer variants
|
||||
EHTokAppendStructuredBuffer,
|
||||
EHTokByteAddressBuffer,
|
||||
EHTokConsumeStructuredBuffer,
|
||||
EHTokRWByteAddressBuffer,
|
||||
EHTokRWStructuredBuffer,
|
||||
EHTokStructuredBuffer,
|
||||
|
||||
// variable, user type, ...
|
||||
EHTokIdentifier,
|
||||
EHTokTypeName,
|
||||
|
||||
Reference in New Issue
Block a user