Updated glslang.

This commit is contained in:
Branimir Karadžić 2017-09-15 20:46:49 -07:00
parent 965f8c91b2
commit 56d7f7b8ca
55 changed files with 3004 additions and 1401 deletions

View File

@ -33,7 +33,7 @@ enum Decoration;
enum Op;
static const int GLSLextAMDVersion = 100;
static const int GLSLextAMDRevision = 5;
static const int GLSLextAMDRevision = 6;
// SPV_AMD_shader_ballot
static const char* const E_SPV_AMD_shader_ballot = "SPV_AMD_shader_ballot";
@ -106,4 +106,12 @@ static const char* const E_SPV_AMD_shader_image_load_store_lod = "SPV_AMD_shader
static const Capability CapabilityImageReadWriteLodAMD = static_cast<Capability>(5015);
// SPV_AMD_shader_fragment_mask
static const char* const E_SPV_AMD_shader_fragment_mask = "SPV_AMD_shader_fragment_mask";
static const Capability CapabilityFragmentMaskAMD = static_cast<Capability>(5010);
static const Op OpFragmentMaskFetchAMD = static_cast<Op>(5011);
static const Op OpFragmentFetchAMD = static_cast<Op>(5012);
#endif // #ifndef GLSLextAMD_H

View File

@ -453,15 +453,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInCullDistance;
case glslang::EbvViewportIndex:
if (!memberDeclaration) {
builder.addCapability(spv::CapabilityMultiViewport);
if (glslangIntermediate->getStage() == EShLangVertex ||
glslangIntermediate->getStage() == EShLangTessControl ||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
builder.addCapability(spv::CapabilityMultiViewport);
if (glslangIntermediate->getStage() == EShLangVertex ||
glslangIntermediate->getStage() == EShLangTessControl ||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
}
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
}
return spv::BuiltInViewportIndex;
@ -478,17 +476,14 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInSampleMask;
case glslang::EbvLayer:
if (!memberDeclaration) {
builder.addCapability(spv::CapabilityGeometry);
if (glslangIntermediate->getStage() == EShLangVertex ||
glslangIntermediate->getStage() == EShLangTessControl ||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
builder.addCapability(spv::CapabilityGeometry);
if (glslangIntermediate->getStage() == EShLangVertex ||
glslangIntermediate->getStage() == EShLangTessControl ||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
}
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
}
return spv::BuiltInLayer;
case glslang::EbvPosition: return spv::BuiltInPosition;
@ -2485,10 +2480,6 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member)
if (member.getFieldName() == "gl_ViewportMaskPerViewNV" &&
extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end())
return true;
if ((member.getFieldName() == "gl_ViewportIndex" || member.getFieldName() == "gl_Layer") &&
extensions.find(glslang::E_GL_ARB_shader_viewport_layer_array) == extensions.end() &&
extensions.find("GL_NV_viewport_array2") == extensions.end())
return true;
return false;
};
@ -2936,8 +2927,6 @@ void TGlslangToSpvTraverser::declareUseOfStructMember(const glslang::TTypeList&
case glslang::EbvCullDistance:
case glslang::EbvPointSize:
#ifdef NV_EXTENSIONS
case glslang::EbvLayer:
case glslang::EbvViewportIndex:
case glslang::EbvViewportMaskNV:
case glslang::EbvSecondaryPositionNV:
case glslang::EbvSecondaryViewportMaskNV:
@ -3204,9 +3193,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
glslang::TCrackedTextureOp cracked;
node->crackTexture(sampler, cracked);
const bool isUnsignedResult =
node->getType().getBasicType() == glslang::EbtUint64 ||
node->getType().getBasicType() == glslang::EbtUint;
const bool isUnsignedResult = node->getType().getBasicType() == glslang::EbtUint;
// Check for queries
if (cracked.query) {
@ -3358,6 +3345,45 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
}
}
#ifdef AMD_EXTENSIONS
// Check for fragment mask functions other than queries
if (cracked.fragMask) {
assert(sampler.ms);
auto opIt = arguments.begin();
std::vector<spv::Id> operands;
// Extract the image if necessary
if (builder.isSampledImage(params.sampler))
params.sampler = builder.createUnaryOp(spv::OpImage, builder.getImageType(params.sampler), params.sampler);
operands.push_back(params.sampler);
++opIt;
if (sampler.isSubpass()) {
// add on the (0,0) coordinate
spv::Id zero = builder.makeIntConstant(0);
std::vector<spv::Id> comps;
comps.push_back(zero);
comps.push_back(zero);
operands.push_back(builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps));
}
for (; opIt != arguments.end(); ++opIt)
operands.push_back(*opIt);
spv::Op fragMaskOp = spv::OpNop;
if (node->getOp() == glslang::EOpFragmentMaskFetch)
fragMaskOp = spv::OpFragmentMaskFetchAMD;
else if (node->getOp() == glslang::EOpFragmentFetch)
fragMaskOp = spv::OpFragmentFetchAMD;
builder.addExtension(spv::E_SPV_AMD_shader_fragment_mask);
builder.addCapability(spv::CapabilityFragmentMaskAMD);
return builder.createOp(fragMaskOp, resultType(), operands);
}
#endif
// Check for texture functions other than queries
bool sparse = node->isSparseTexture();
bool cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow;
@ -3529,7 +3555,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
const glslang::TIntermSequence& glslangArgs = node->getSequence();
const glslang::TQualifierList& qualifiers = node->getQualifierList();
// Encapsulate lvalue logic, used in two places below, for safety.
// Encapsulate lvalue logic, used in several places below, for safety.
const auto isLValue = [](int qualifier, const glslang::TType& paramType) -> bool {
return qualifier != glslang::EvqConstReadOnly || paramType.containsOpaque();
};

View File

@ -215,14 +215,19 @@ namespace spv {
bool spirvbin_t::isConstOp(spv::Op opCode) const
{
switch (opCode) {
case spv::OpConstantNull: error("unimplemented constant type");
case spv::OpConstantSampler: error("unimplemented constant type");
case spv::OpConstantNull:
case spv::OpConstantSampler:
error("unimplemented constant type");
return true;
case spv::OpConstantTrue:
case spv::OpConstantFalse:
case spv::OpConstantComposite:
case spv::OpConstant: return true;
default: return false;
case spv::OpConstant:
return true;
default:
return false;
}
}

View File

@ -847,6 +847,7 @@ const char* CapabilityString(int info)
#ifdef AMD_EXTENSIONS
case 5009: return "ImageGatherBiasLodAMD";
case 5010: return "FragmentMaskAMD";
case 5015: return "ImageReadWriteLodAMD";
#endif
@ -1207,6 +1208,9 @@ const char* OpcodeString(int op)
case 5005: return "OpGroupFMaxNonUniformAMD";
case 5006: return "OpGroupUMaxNonUniformAMD";
case 5007: return "OpGroupSMaxNonUniformAMD";
case 5011: return "OpFragmentMaskFetchAMD";
case 5012: return "OpFragmentFetchAMD";
#endif
case OpcodeCeiling:
@ -2869,6 +2873,15 @@ void Parameterize()
InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandScope, "'Execution'");
InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandGroupOperation, "'Operation'");
InstructionDesc[OpGroupFMaxNonUniformAMD].operands.push(OperandId, "X");
InstructionDesc[OpFragmentMaskFetchAMD].capabilities.push_back(CapabilityFragmentMaskAMD);
InstructionDesc[OpFragmentMaskFetchAMD].operands.push(OperandId, "'Image'");
InstructionDesc[OpFragmentMaskFetchAMD].operands.push(OperandId, "'Coordinate'");
InstructionDesc[OpFragmentFetchAMD].capabilities.push_back(CapabilityFragmentMaskAMD);
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Image'");
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Coordinate'");
InstructionDesc[OpFragmentFetchAMD].operands.push(OperandId, "'Fragment Index'");
#endif
}

View File

@ -54,7 +54,7 @@ public:
const char* includerName,
size_t inclusionDepth) override
{
return readLocalPath(headerName, includerName, inclusionDepth);
return readLocalPath(headerName, includerName, (int)inclusionDepth);
}
virtual IncludeResult* includeSystem(const char* headerName,
@ -73,7 +73,7 @@ public:
virtual void pushExternalLocalDirectory(const std::string& dir)
{
directoryStack.push_back(dir);
externalLocalDirectoryCount = directoryStack.size();
externalLocalDirectoryCount = (int)directoryStack.size();
}
virtual void releaseInclude(IncludeResult* result) override

View File

@ -553,7 +553,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
// This is okay for one compilation unit with one entry point.
entryPointName = argv[1];
if (argc <= 1)
Error("no <entry-point> provided for -e");
Error("no <name> provided for -e");
bumpArg();
break;
case 'g':
@ -1214,13 +1214,13 @@ void usage()
" creates the default configuration file (redirect to a .conf file)\n"
" -d default to desktop (#version 110) when there is no shader #version\n"
" (default is ES version 100)\n"
" -e specify entry-point name\n"
" -e <name> specify <name> as the entry-point name\n"
" -g generate debug information\n"
" -h print this usage message\n"
" -i intermediate tree (glslang AST) is printed out\n"
" -l link all input files together to form a single module\n"
" -m memory leak mode\n"
" -o <file> save binary to <file>, requires a binary option (e.g., -V)\n"
" -o <file> save binary to <file>, requires a binary option (e.g., -V)\n"
" -q dump reflection query database\n"
" -r synonym for --relaxed-errors\n"
" -s silent mode\n"
@ -1264,8 +1264,8 @@ void usage()
" --shift-UBO-binding [stage] num base binding number for UBOs\n"
" --shift-cbuffer-binding [stage] num synonym for --shift-UBO-binding\n"
" --sub [stage] num synonym for --shift-UBO-binding\n"
" --source-entrypoint name the given shader source function is\n"
" renamed to be the entry point given in -e\n"
" --source-entrypoint <name> the given shader source function is\n"
" renamed to be the <name> given in -e\n"
" --sep synonym for --source-entrypoint\n"
" --stdin Read from stdin instead of from a file.\n"
" You'll have to provide the shader stage\n"

View File

@ -754,7 +754,7 @@ ERROR: 0:29: 'constructor' : cannot convert parameter 2 from ' const 2X2 matrix
ERROR: 0:29: ' const 2-element array of 4-component vector of float' : cannot construct with these arguments
ERROR: 0:29: '=' : cannot convert from ' const float' to ' global 2-element array of 4-component vector of float'
ERROR: 0:30: 'initializer list' : wrong number of matrix columns: temp 4X2 matrix of float
ERROR: 0:40: 'constructor' : cannot convert parameter 1 from ' temp float' to ' temp structure{ global float s, global float t}'
ERROR: 0:40: 'constructor' : cannot convert parameter 1 from ' const structure{ global 4-component vector of float a, global 4-component vector of float b}' to ' temp structure{ global float s, global float t}'
ERROR: 0:70: 'initializer list' : wrong number of structure members
ERROR: 13 compilation errors. No code generated.

View File

@ -10,7 +10,7 @@ ERROR: 0:29: 'constructor' : cannot convert parameter 2 from ' const 2X2 matrix
ERROR: 0:29: ' const 2-element array of 4-component vector of float' : cannot construct with these arguments
ERROR: 0:29: '=' : cannot convert from ' const float' to ' global 2-element array of 4-component vector of float'
ERROR: 0:30: 'initializer list' : wrong number of matrix columns: temp 4X2 matrix of float
ERROR: 0:40: 'constructor' : cannot convert parameter 1 from ' temp float' to ' temp structure{ global float s, global float t}'
ERROR: 0:40: 'constructor' : cannot convert parameter 1 from ' const structure{ global 4-component vector of float a, global 4-component vector of float b}' to ' temp structure{ global float s, global float t}'
ERROR: 0:70: 'initializer list' : wrong number of structure members
ERROR: 13 compilation errors. No code generated.

View File

@ -0,0 +1,45 @@
glsl.entryPointRename.vert
ERROR: Source entry point must be "main"
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 20
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "foo" 13
Source GLSL 460
Name 4 "foo"
Name 11 "gl_PerVertex"
MemberName 11(gl_PerVertex) 0 "gl_Position"
MemberName 11(gl_PerVertex) 1 "gl_PointSize"
MemberName 11(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 11(gl_PerVertex) 3 "gl_CullDistance"
Name 13 ""
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 11(gl_PerVertex) Block
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeInt 32 0
9: 8(int) Constant 1
10: TypeArray 6(float) 9
11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10
12: TypePointer Output 11(gl_PerVertex)
13: 12(ptr) Variable Output
14: TypeInt 32 1
15: 14(int) Constant 0
16: 6(float) Constant 1065353216
17: 7(fvec4) ConstantComposite 16 16 16 16
18: TypePointer Output 7(fvec4)
4(foo): 2 Function None 3
5: Label
19: 18(ptr) AccessChain 13 15
Store 19 17
Return
FunctionEnd

View File

@ -0,0 +1,43 @@
glsl.entryPointRename.vert
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 20
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "foo" 13
Source GLSL 460
Name 4 "foo"
Name 11 "gl_PerVertex"
MemberName 11(gl_PerVertex) 0 "gl_Position"
MemberName 11(gl_PerVertex) 1 "gl_PointSize"
MemberName 11(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 11(gl_PerVertex) 3 "gl_CullDistance"
Name 13 ""
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 11(gl_PerVertex) Block
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeInt 32 0
9: 8(int) Constant 1
10: TypeArray 6(float) 9
11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10
12: TypePointer Output 11(gl_PerVertex)
13: 12(ptr) Variable Output
14: TypeInt 32 1
15: 14(int) Constant 0
16: 6(float) Constant 1065353216
17: 7(fvec4) ConstantComposite 16 16 16 16
18: TypePointer Output 7(fvec4)
4(foo): 2 Function None 3
5: Label
19: 18(ptr) AccessChain 13 15
Store 19 17
Return
FunctionEnd

View File

@ -0,0 +1,4 @@
glsl.entryPointRename2.vert
ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
SPIR-V is not generated for failed compile or link

View File

@ -2,72 +2,142 @@ hlsl.array.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:8 Function Parameters:
0:8 'i' ( in int)
0:8 'input' ( in 3-element array of 4-component vector of float)
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'C' ( global 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:11 Sequence
0:11 move second child to first child ( temp 2-element array of 4-component vector of float)
0:11 'c2' ( global 2-element array of 4-component vector of float)
0:11 Construct vec4 ( temp 2-element array of 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:14 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:14 Function Parameters:
0:14 'i' ( in int)
0:14 'input' ( in 3-element array of 4-component vector of float)
0:? Sequence
0:10 Branch: Return with expression
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 direct index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 Constant:
0:10 5 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 indirect index ( temp 4-component vector of float)
0:10 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:10 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:10 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 1 (const uint)
0:10 'i' ( in int)
0:10 Constant:
0:10 0 (const int)
0:10 'i' ( in int)
0:8 Function Definition: PixelShaderFunction( ( temp void)
0:8 Function Parameters:
0:15 Sequence
0:15 move second child to first child ( temp 10-element array of 4-component vector of float)
0:15 'b' ( temp 10-element array of 4-component vector of float)
0:15 Construct vec4 ( temp 10-element array of 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:16 Sequence
0:16 move second child to first child ( temp 4-component vector of float)
0:16 'tmp' ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 'C' ( global 4-component vector of float)
0:16 direct index ( temp 4-component vector of float)
0:16 a1: direct index for structure ( uniform 1-element array of 4-component vector of float)
0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:16 Constant:
0:16 2 (const uint)
0:16 Constant:
0:16 0 (const int)
0:16 Constant:
0:16 1.000000
0:16 2.000000
0:16 3.000000
0:16 4.000000
0:16 indirect index ( temp 4-component vector of float)
0:16 a2: direct index for structure ( uniform 2-element array of 4-component vector of float)
0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:16 Constant:
0:16 3 (const uint)
0:16 'i' ( in int)
0:16 indirect index ( temp 4-component vector of float)
0:16 'c2' ( global 2-element array of 4-component vector of float)
0:16 'i' ( in int)
0:17 Branch: Return with expression
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 direct index ( temp 4-component vector of float)
0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:17 Constant:
0:17 0 (const uint)
0:17 Constant:
0:17 1 (const int)
0:17 indirect index ( temp 4-component vector of float)
0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:17 Constant:
0:17 0 (const uint)
0:17 'i' ( in int)
0:17 direct index ( temp 4-component vector of float)
0:17 'input' ( in 3-element array of 4-component vector of float)
0:17 Constant:
0:17 2 (const int)
0:17 indirect index ( temp 4-component vector of float)
0:17 'input' ( in 3-element array of 4-component vector of float)
0:17 'i' ( in int)
0:17 direct index ( temp 4-component vector of float)
0:17 'b' ( temp 10-element array of 4-component vector of float)
0:17 Constant:
0:17 5 (const int)
0:17 indirect index ( temp 4-component vector of float)
0:17 'b' ( temp 10-element array of 4-component vector of float)
0:17 'i' ( in int)
0:17 indirect index ( temp 4-component vector of float)
0:17 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:17 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:17 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:17 Constant:
0:17 1 (const uint)
0:17 'i' ( in int)
0:17 Constant:
0:17 0 (const int)
0:17 'i' ( in int)
0:17 'tmp' ( temp 4-component vector of float)
0:14 Function Definition: PixelShaderFunction( ( temp void)
0:14 Function Parameters:
0:? Sequence
0:8 move second child to first child ( temp int)
0:14 move second child to first child ( temp int)
0:? 'i' ( temp int)
0:? 'i' (layout( location=0) flat in int)
0:8 move second child to first child ( temp 3-element array of 4-component vector of float)
0:14 move second child to first child ( temp 3-element array of 4-component vector of float)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
0:8 move second child to first child ( temp 4-component vector of float)
0:14 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:8 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:14 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:? 'i' ( temp int)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:? 'C' ( global 4-component vector of float)
0:? 'c1' ( const 1-element array of 4-component vector of float)
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 'c2' ( global 2-element array of 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) flat in int)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
@ -79,116 +149,195 @@ Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:8 Function Parameters:
0:8 'i' ( in int)
0:8 'input' ( in 3-element array of 4-component vector of float)
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'C' ( global 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:11 Sequence
0:11 move second child to first child ( temp 2-element array of 4-component vector of float)
0:11 'c2' ( global 2-element array of 4-component vector of float)
0:11 Construct vec4 ( temp 2-element array of 4-component vector of float)
0:11 'C' ( global 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:14 Function Definition: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:14 Function Parameters:
0:14 'i' ( in int)
0:14 'input' ( in 3-element array of 4-component vector of float)
0:? Sequence
0:10 Branch: Return with expression
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 add ( temp 4-component vector of float)
0:10 direct index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 Constant:
0:10 1 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 0 (const uint)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 Constant:
0:10 2 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'input' ( in 3-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 direct index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 Constant:
0:10 5 (const int)
0:10 indirect index ( temp 4-component vector of float)
0:10 'b' ( temp 10-element array of 4-component vector of float)
0:10 'i' ( in int)
0:10 indirect index ( temp 4-component vector of float)
0:10 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:10 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:10 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:10 Constant:
0:10 1 (const uint)
0:10 'i' ( in int)
0:10 Constant:
0:10 0 (const int)
0:10 'i' ( in int)
0:8 Function Definition: PixelShaderFunction( ( temp void)
0:8 Function Parameters:
0:15 Sequence
0:15 move second child to first child ( temp 10-element array of 4-component vector of float)
0:15 'b' ( temp 10-element array of 4-component vector of float)
0:15 Construct vec4 ( temp 10-element array of 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:15 'C' ( global 4-component vector of float)
0:16 Sequence
0:16 move second child to first child ( temp 4-component vector of float)
0:16 'tmp' ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 add ( temp 4-component vector of float)
0:16 'C' ( global 4-component vector of float)
0:16 direct index ( temp 4-component vector of float)
0:16 a1: direct index for structure ( uniform 1-element array of 4-component vector of float)
0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:16 Constant:
0:16 2 (const uint)
0:16 Constant:
0:16 0 (const int)
0:16 Constant:
0:16 1.000000
0:16 2.000000
0:16 3.000000
0:16 4.000000
0:16 indirect index ( temp 4-component vector of float)
0:16 a2: direct index for structure ( uniform 2-element array of 4-component vector of float)
0:16 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:16 Constant:
0:16 3 (const uint)
0:16 'i' ( in int)
0:16 indirect index ( temp 4-component vector of float)
0:16 'c2' ( global 2-element array of 4-component vector of float)
0:16 'i' ( in int)
0:17 Branch: Return with expression
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 add ( temp 4-component vector of float)
0:17 direct index ( temp 4-component vector of float)
0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:17 Constant:
0:17 0 (const uint)
0:17 Constant:
0:17 1 (const int)
0:17 indirect index ( temp 4-component vector of float)
0:17 a: direct index for structure ( uniform 4-element array of 4-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:17 Constant:
0:17 0 (const uint)
0:17 'i' ( in int)
0:17 direct index ( temp 4-component vector of float)
0:17 'input' ( in 3-element array of 4-component vector of float)
0:17 Constant:
0:17 2 (const int)
0:17 indirect index ( temp 4-component vector of float)
0:17 'input' ( in 3-element array of 4-component vector of float)
0:17 'i' ( in int)
0:17 direct index ( temp 4-component vector of float)
0:17 'b' ( temp 10-element array of 4-component vector of float)
0:17 Constant:
0:17 5 (const int)
0:17 indirect index ( temp 4-component vector of float)
0:17 'b' ( temp 10-element array of 4-component vector of float)
0:17 'i' ( in int)
0:17 indirect index ( temp 4-component vector of float)
0:17 m: direct index for structure ( temp 7-element array of 4-component vector of float)
0:17 indirect index ( temp structure{ temp 7-element array of 4-component vector of float m})
0:17 s: direct index for structure ( uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m})
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:17 Constant:
0:17 1 (const uint)
0:17 'i' ( in int)
0:17 Constant:
0:17 0 (const int)
0:17 'i' ( in int)
0:17 'tmp' ( temp 4-component vector of float)
0:14 Function Definition: PixelShaderFunction( ( temp void)
0:14 Function Parameters:
0:? Sequence
0:8 move second child to first child ( temp int)
0:14 move second child to first child ( temp int)
0:? 'i' ( temp int)
0:? 'i' (layout( location=0) flat in int)
0:8 move second child to first child ( temp 3-element array of 4-component vector of float)
0:14 move second child to first child ( temp 3-element array of 4-component vector of float)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
0:8 move second child to first child ( temp 4-component vector of float)
0:14 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:8 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:14 Function Call: @PixelShaderFunction(i1;vf4[3]; ( temp 4-component vector of float)
0:? 'i' ( temp int)
0:? 'input' ( temp 3-element array of 4-component vector of float)
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s})
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-element array of 4-component vector of float a, uniform 11-element array of structure{ temp 7-element array of 4-component vector of float m} s, uniform 1-element array of 4-component vector of float a1, uniform 2-element array of 4-component vector of float a2})
0:? 'C' ( global 4-component vector of float)
0:? 'c1' ( const 1-element array of 4-component vector of float)
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:? 'c2' ( global 2-element array of 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'i' (layout( location=0) flat in int)
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 81
// Id's are bound by 126
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 68 72 75
EntryPoint Fragment 4 "PixelShaderFunction" 112 116 119
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "PixelShaderFunction"
Name 17 "@PixelShaderFunction(i1;vf4[3];"
Name 15 "i"
Name 16 "input"
Name 23 ""
MemberName 23 0 "m"
Name 26 "$Global"
MemberName 26($Global) 0 "a"
MemberName 26($Global) 1 "s"
Name 28 ""
Name 50 "b"
Name 66 "i"
Name 68 "i"
Name 70 "input"
Name 72 "input"
Name 75 "@entryPointOutput"
Name 76 "param"
Name 78 "param"
Decorate 20 ArrayStride 16
Decorate 22 ArrayStride 16
MemberDecorate 23 0 Offset 0
Decorate 25 ArrayStride 112
MemberDecorate 26($Global) 0 Offset 0
MemberDecorate 26($Global) 1 Offset 64
Decorate 26($Global) Block
Decorate 28 DescriptorSet 0
Decorate 68(i) Flat
Decorate 68(i) Location 0
Decorate 72(input) Location 1
Decorate 75(@entryPointOutput) Location 0
Name 20 "C"
Name 29 "c2"
Name 35 "b"
Name 48 "tmp"
Name 54 ""
MemberName 54 0 "m"
Name 60 "$Global"
MemberName 60($Global) 0 "a"
MemberName 60($Global) 1 "s"
MemberName 60($Global) 2 "a1"
MemberName 60($Global) 3 "a2"
Name 62 ""
Name 110 "i"
Name 112 "i"
Name 114 "input"
Name 116 "input"
Name 119 "@entryPointOutput"
Name 120 "param"
Name 122 "param"
Decorate 51 ArrayStride 16
Decorate 53 ArrayStride 16
MemberDecorate 54 0 Offset 0
Decorate 56 ArrayStride 112
Decorate 58 ArrayStride 16
Decorate 59 ArrayStride 16
MemberDecorate 60($Global) 0 Offset 0
MemberDecorate 60($Global) 1 Offset 64
MemberDecorate 60($Global) 2 Offset 1296
MemberDecorate 60($Global) 3 Offset 1312
Decorate 60($Global) Block
Decorate 62 DescriptorSet 0
Decorate 112(i) Flat
Decorate 112(i) Location 0
Decorate 116(input) Location 1
Decorate 119(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -200,78 +349,127 @@ gl_FragCoord origin is upper left
12: TypeArray 9(fvec4) 11
13: TypePointer Function 12
14: TypeFunction 9(fvec4) 7(ptr) 13(ptr)
19: 10(int) Constant 4
20: TypeArray 9(fvec4) 19
21: 10(int) Constant 7
22: TypeArray 9(fvec4) 21
23: TypeStruct 22
24: 10(int) Constant 11
25: TypeArray 23(struct) 24
26($Global): TypeStruct 20 25
27: TypePointer Uniform 26($Global)
28: 27(ptr) Variable Uniform
29: 6(int) Constant 0
30: 6(int) Constant 1
31: TypePointer Uniform 9(fvec4)
38: 6(int) Constant 2
39: TypePointer Function 9(fvec4)
47: 10(int) Constant 10
48: TypeArray 9(fvec4) 47
49: TypePointer Function 48
51: 6(int) Constant 5
67: TypePointer Input 6(int)
68(i): 67(ptr) Variable Input
71: TypePointer Input 12
72(input): 71(ptr) Variable Input
74: TypePointer Output 9(fvec4)
75(@entryPointOutput): 74(ptr) Variable Output
19: TypePointer Private 9(fvec4)
20(C): 19(ptr) Variable Private
21: 8(float) Constant 1065353216
22: 8(float) Constant 1073741824
23: 8(float) Constant 1077936128
24: 8(float) Constant 1082130432
25: 9(fvec4) ConstantComposite 21 22 23 24
26: 10(int) Constant 2
27: TypeArray 9(fvec4) 26
28: TypePointer Private 27
29(c2): 28(ptr) Variable Private
32: 10(int) Constant 10
33: TypeArray 9(fvec4) 32
34: TypePointer Function 33
47: TypePointer Function 9(fvec4)
50: 10(int) Constant 4
51: TypeArray 9(fvec4) 50
52: 10(int) Constant 7
53: TypeArray 9(fvec4) 52
54: TypeStruct 53
55: 10(int) Constant 11
56: TypeArray 54(struct) 55
57: 10(int) Constant 1
58: TypeArray 9(fvec4) 57
59: TypeArray 9(fvec4) 26
60($Global): TypeStruct 51 56 58 59
61: TypePointer Uniform 60($Global)
62: 61(ptr) Variable Uniform
63: 6(int) Constant 2
64: 6(int) Constant 0
65: TypePointer Uniform 9(fvec4)
70: 6(int) Constant 3
79: 6(int) Constant 1
93: 6(int) Constant 5
111: TypePointer Input 6(int)
112(i): 111(ptr) Variable Input
115: TypePointer Input 12
116(input): 115(ptr) Variable Input
118: TypePointer Output 9(fvec4)
119(@entryPointOutput): 118(ptr) Variable Output
125: 58 ConstantComposite 25
4(PixelShaderFunction): 2 Function None 3
5: Label
66(i): 7(ptr) Variable Function
70(input): 13(ptr) Variable Function
76(param): 7(ptr) Variable Function
78(param): 13(ptr) Variable Function
69: 6(int) Load 68(i)
Store 66(i) 69
73: 12 Load 72(input)
Store 70(input) 73
77: 6(int) Load 66(i)
Store 76(param) 77
79: 12 Load 70(input)
Store 78(param) 79
80: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 76(param) 78(param)
Store 75(@entryPointOutput) 80
110(i): 7(ptr) Variable Function
114(input): 13(ptr) Variable Function
120(param): 7(ptr) Variable Function
122(param): 13(ptr) Variable Function
Store 20(C) 25
30: 9(fvec4) Load 20(C)
31: 27 CompositeConstruct 30 25
Store 29(c2) 31
113: 6(int) Load 112(i)
Store 110(i) 113
117: 12 Load 116(input)
Store 114(input) 117
121: 6(int) Load 110(i)
Store 120(param) 121
123: 12 Load 114(input)
Store 122(param) 123
124: 9(fvec4) FunctionCall 17(@PixelShaderFunction(i1;vf4[3];) 120(param) 122(param)
Store 119(@entryPointOutput) 124
Return
FunctionEnd
17(@PixelShaderFunction(i1;vf4[3];): 9(fvec4) Function None 14
15(i): 7(ptr) FunctionParameter
16(input): 13(ptr) FunctionParameter
18: Label
50(b): 49(ptr) Variable Function
32: 31(ptr) AccessChain 28 29 30
33: 9(fvec4) Load 32
34: 6(int) Load 15(i)
35: 31(ptr) AccessChain 28 29 34
36: 9(fvec4) Load 35
37: 9(fvec4) FAdd 33 36
40: 39(ptr) AccessChain 16(input) 38
41: 9(fvec4) Load 40
42: 9(fvec4) FAdd 37 41
43: 6(int) Load 15(i)
44: 39(ptr) AccessChain 16(input) 43
45: 9(fvec4) Load 44
46: 9(fvec4) FAdd 42 45
52: 39(ptr) AccessChain 50(b) 51
53: 9(fvec4) Load 52
54: 9(fvec4) FAdd 46 53
55: 6(int) Load 15(i)
56: 39(ptr) AccessChain 50(b) 55
57: 9(fvec4) Load 56
58: 9(fvec4) FAdd 54 57
59: 6(int) Load 15(i)
60: 6(int) Load 15(i)
61: 31(ptr) AccessChain 28 30 59 29 60
62: 9(fvec4) Load 61
63: 9(fvec4) FAdd 58 62
ReturnValue 63
35(b): 34(ptr) Variable Function
48(tmp): 47(ptr) Variable Function
36: 9(fvec4) Load 20(C)
37: 9(fvec4) Load 20(C)
38: 9(fvec4) Load 20(C)
39: 9(fvec4) Load 20(C)
40: 9(fvec4) Load 20(C)
41: 9(fvec4) Load 20(C)
42: 9(fvec4) Load 20(C)
43: 9(fvec4) Load 20(C)
44: 9(fvec4) Load 20(C)
45: 9(fvec4) Load 20(C)
46: 33 CompositeConstruct 36 37 38 39 40 41 42 43 44 45
Store 35(b) 46
49: 9(fvec4) Load 20(C)
66: 65(ptr) AccessChain 62 63 64
67: 9(fvec4) Load 66
68: 9(fvec4) FAdd 49 67
69: 9(fvec4) FAdd 68 25
71: 6(int) Load 15(i)
72: 65(ptr) AccessChain 62 70 71
73: 9(fvec4) Load 72
74: 9(fvec4) FAdd 69 73
75: 6(int) Load 15(i)
76: 19(ptr) AccessChain 29(c2) 75
77: 9(fvec4) Load 76
78: 9(fvec4) FAdd 74 77
Store 48(tmp) 78
80: 65(ptr) AccessChain 62 64 79
81: 9(fvec4) Load 80
82: 6(int) Load 15(i)
83: 65(ptr) AccessChain 62 64 82
84: 9(fvec4) Load 83
85: 9(fvec4) FAdd 81 84
86: 47(ptr) AccessChain 16(input) 63
87: 9(fvec4) Load 86
88: 9(fvec4) FAdd 85 87
89: 6(int) Load 15(i)
90: 47(ptr) AccessChain 16(input) 89
91: 9(fvec4) Load 90
92: 9(fvec4) FAdd 88 91
94: 47(ptr) AccessChain 35(b) 93
95: 9(fvec4) Load 94
96: 9(fvec4) FAdd 92 95
97: 6(int) Load 15(i)
98: 47(ptr) AccessChain 35(b) 97
99: 9(fvec4) Load 98
100: 9(fvec4) FAdd 96 99
101: 6(int) Load 15(i)
102: 6(int) Load 15(i)
103: 65(ptr) AccessChain 62 79 101 64 102
104: 9(fvec4) Load 103
105: 9(fvec4) FAdd 100 104
106: 9(fvec4) Load 48(tmp)
107: 9(fvec4) FAdd 105 106
ReturnValue 107
FunctionEnd

View File

@ -45,7 +45,7 @@ gl_FragCoord origin is upper left
0:24 direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
0:24 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
0:24 Constant:
0:24 2 (const int)
0:24 1 (const int)
0:24 Constant:
0:24 3 (const int)
0:24 Constant:
@ -113,7 +113,7 @@ gl_FragCoord origin is upper left
0:24 direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
0:24 'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
0:24 Constant:
0:24 2 (const int)
0:24 1 (const int)
0:24 Constant:
0:24 3 (const int)
0:24 Constant:
@ -231,7 +231,7 @@ gl_FragCoord origin is upper left
54: 7(fvec4) FAdd 45 53
ReturnValue 54
56: Label
58: 41(ptr) AccessChain 18(cb3) 21 57 20
58: 41(ptr) AccessChain 18(cb3) 20 57 20
59: 6(float) Load 58
60: 7(fvec4) CompositeConstruct 59 59 59 59
ReturnValue 60

View File

@ -32,7 +32,7 @@ vertex spacing = equal_spacing
0:? 'm_cpid' ( temp uint)
0:? 'm_cpid' ( in uint InvocationID)
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'm_cpid' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint})
@ -146,7 +146,7 @@ vertex spacing = equal_spacing
0:? 'm_cpid' ( temp uint)
0:? 'm_cpid' ( in uint InvocationID)
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'm_cpid' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4];u1; ( temp structure{ temp 3-component vector of float cpoint})

View File

@ -28,7 +28,7 @@ vertex spacing = equal_spacing
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
@ -140,7 +140,7 @@ vertex spacing = equal_spacing
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})

View File

@ -28,7 +28,7 @@ vertex spacing = equal_spacing
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})
@ -140,7 +140,7 @@ vertex spacing = equal_spacing
0:? 'ip' ( temp 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 4-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[4]; ( temp structure{ temp 3-component vector of float cpoint})

View File

@ -0,0 +1,681 @@
hlsl.hull.4.tesc
Shader version: 500
vertices = 3
vertex spacing = fractional_odd_spacing
triangle order = cw
0:? Sequence
0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:25 Function Parameters:
0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? Sequence
0:26 Sequence
0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 Constant:
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:28 move second child to first child ( temp float)
0:28 fInsideTessFactor: direct index for structure ( temp float)
0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:28 Constant:
0:28 1 (const int)
0:28 add ( temp float)
0:28 direct index ( temp float)
0:28 m_Position: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 3 (const int)
0:28 direct index ( temp float)
0:28 m_Normal: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:28 Constant:
0:28 3 (const int)
0:30 Branch: Return with expression
0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:39 Function Definition: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Parameters:
0:39 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 'cpid' ( in uint)
0:? Sequence
0:40 Sequence
0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position})
0:40 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:40 Constant:
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:41 move second child to first child ( temp 4-component vector of float)
0:41 m_Position: direct index for structure ( temp 4-component vector of float)
0:41 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:41 Constant:
0:41 0 (const int)
0:41 Constant:
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:42 Branch: Return with expression
0:42 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Definition: main( ( temp void)
0:39 Function Parameters:
0:? Sequence
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( in 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( in 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 1 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( in 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 2 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'cpid' ( temp uint)
0:39 Constant:
0:39 0 (const int)
0:? Barrier ( temp void)
0:? Test condition and select ( temp void)
0:? Condition
0:? Compare Equal ( temp bool)
0:? 'cpid' ( in uint InvocationID)
0:? Constant:
0:? 0 (const int)
0:? true case
0:? Sequence
0:? move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Function Call: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? Sequence
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? Constant:
0:? 0 (const int)
0:? direct index ( temp float)
0:? fTessFactor: direct index for structure ( temp 3-element array of float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 0 (const int)
0:? Constant:
0:? 0 (const int)
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? Constant:
0:? 1 (const int)
0:? direct index ( temp float)
0:? fTessFactor: direct index for structure ( temp 3-element array of float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 0 (const int)
0:? Constant:
0:? 1 (const int)
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? Constant:
0:? 2 (const int)
0:? direct index ( temp float)
0:? fTessFactor: direct index for structure ( temp 3-element array of float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 0 (const int)
0:? Constant:
0:? 2 (const int)
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelInner)
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
0:? Constant:
0:? 0 (const int)
0:? fInsideTessFactor: direct index for structure ( temp float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:? 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:? 'cpid' ( in uint InvocationID)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
Linked tessellation control stage:
Shader version: 500
vertices = 3
vertex spacing = fractional_odd_spacing
triangle order = cw
0:? Sequence
0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:25 Function Parameters:
0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? Sequence
0:26 Sequence
0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 Constant:
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:28 move second child to first child ( temp float)
0:28 fInsideTessFactor: direct index for structure ( temp float)
0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:28 Constant:
0:28 1 (const int)
0:28 add ( temp float)
0:28 direct index ( temp float)
0:28 m_Position: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 3 (const int)
0:28 direct index ( temp float)
0:28 m_Normal: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:28 Constant:
0:28 3 (const int)
0:30 Branch: Return with expression
0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:39 Function Definition: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Parameters:
0:39 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 'cpid' ( in uint)
0:? Sequence
0:40 Sequence
0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position})
0:40 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:40 Constant:
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:41 move second child to first child ( temp 4-component vector of float)
0:41 m_Position: direct index for structure ( temp 4-component vector of float)
0:41 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:41 Constant:
0:41 0 (const int)
0:41 Constant:
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:42 Branch: Return with expression
0:42 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Definition: main( ( temp void)
0:39 Function Parameters:
0:? Sequence
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( in 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 0 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( in 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 1 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 1 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( in 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 2 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 Constant:
0:39 1 (const int)
0:39 m_Normal: direct index for structure ( temp 4-component vector of float)
0:39 direct index (layout( location=0) in structure{ temp 4-component vector of float m_Normal})
0:39 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:39 Constant:
0:39 2 (const int)
0:39 Constant:
0:39 0 (const int)
0:39 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(struct-HS_Input-vf4-vf41[3];u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? 'cpid' ( temp uint)
0:39 Constant:
0:39 0 (const int)
0:? Barrier ( temp void)
0:? Test condition and select ( temp void)
0:? Condition
0:? Compare Equal ( temp bool)
0:? 'cpid' ( in uint InvocationID)
0:? Constant:
0:? 0 (const int)
0:? true case
0:? Sequence
0:? move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Function Call: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? 'I' ( temp 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? Sequence
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? Constant:
0:? 0 (const int)
0:? direct index ( temp float)
0:? fTessFactor: direct index for structure ( temp 3-element array of float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 0 (const int)
0:? Constant:
0:? 0 (const int)
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? Constant:
0:? 1 (const int)
0:? direct index ( temp float)
0:? fTessFactor: direct index for structure ( temp 3-element array of float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 0 (const int)
0:? Constant:
0:? 1 (const int)
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? Constant:
0:? 2 (const int)
0:? direct index ( temp float)
0:? fTessFactor: direct index for structure ( temp 3-element array of float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 0 (const int)
0:? Constant:
0:? 2 (const int)
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelInner)
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
0:? Constant:
0:? 0 (const int)
0:? fInsideTessFactor: direct index for structure ( temp float)
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:? Constant:
0:? 1 (const int)
0:? Linker Objects
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? 'I.m_Position' ( in 3-element array of 4-component vector of float Position)
0:? 'I' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float m_Normal})
0:? 'cpid' ( in uint InvocationID)
0:? '@patchConstantOutput.fTessFactor' ( patch out 4-element array of float TessLevelOuter)
0:? '@patchConstantOutput.fInsideTessFactor' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 127
Capability Tessellation
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 56 64 83 86 110 123
ExecutionMode 4 OutputVertices 3
ExecutionMode 4 Triangles
ExecutionMode 4 SpacingFractionalOdd
ExecutionMode 4 VertexOrderCw
Source HLSL 500
Name 4 "main"
Name 8 "HS_Input"
MemberName 8(HS_Input) 0 "m_Position"
MemberName 8(HS_Input) 1 "m_Normal"
Name 14 "HS_Output"
MemberName 14(HS_Output) 0 "fTessFactor"
MemberName 14(HS_Output) 1 "fInsideTessFactor"
Name 17 "HS_ConstFunc(struct-HS_Input-vf4-vf41[3];"
Name 16 "I"
Name 20 "HS_Main_Output"
MemberName 20(HS_Main_Output) 0 "m_Position"
Name 24 "@main(struct-HS_Input-vf4-vf41[3];u1;"
Name 22 "I"
Name 23 "cpid"
Name 27 "O"
Name 45 "output"
Name 53 "I"
Name 56 "I.m_Position"
Name 61 "HS_Input"
MemberName 61(HS_Input) 0 "m_Normal"
Name 64 "I"
Name 81 "cpid"
Name 83 "cpid"
Name 86 "@entryPointOutput.m_Position"
Name 87 "param"
Name 89 "param"
Name 103 "@patchConstantResult"
Name 104 "param"
Name 110 "@patchConstantOutput.fTessFactor"
Name 123 "@patchConstantOutput.fInsideTessFactor"
Decorate 56(I.m_Position) BuiltIn Position
Decorate 64(I) Location 0
Decorate 83(cpid) BuiltIn InvocationId
Decorate 86(@entryPointOutput.m_Position) BuiltIn Position
Decorate 110(@patchConstantOutput.fTessFactor) Patch
Decorate 110(@patchConstantOutput.fTessFactor) BuiltIn TessLevelOuter
Decorate 123(@patchConstantOutput.fInsideTessFactor) Patch
Decorate 123(@patchConstantOutput.fInsideTessFactor) BuiltIn TessLevelInner
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8(HS_Input): TypeStruct 7(fvec4) 7(fvec4)
9: TypeInt 32 0
10: 9(int) Constant 3
11: TypeArray 8(HS_Input) 10
12: TypePointer Function 11
13: TypeArray 6(float) 10
14(HS_Output): TypeStruct 13 6(float)
15: TypeFunction 14(HS_Output) 12(ptr)
19: TypePointer Function 9(int)
20(HS_Main_Output): TypeStruct 7(fvec4)
21: TypeFunction 20(HS_Main_Output) 12(ptr) 19(ptr)
26: TypePointer Function 14(HS_Output)
28: 6(float) Constant 0
29: 13 ConstantComposite 28 28 28
30:14(HS_Output) ConstantComposite 29 28
31: TypeInt 32 1
32: 31(int) Constant 1
33: 31(int) Constant 0
34: TypePointer Function 6(float)
44: TypePointer Function 20(HS_Main_Output)
46: 7(fvec4) ConstantComposite 28 28 28 28
47:20(HS_Main_Output) ConstantComposite 46
48: TypePointer Function 7(fvec4)
54: TypeArray 7(fvec4) 10
55: TypePointer Input 54
56(I.m_Position): 55(ptr) Variable Input
57: TypePointer Input 7(fvec4)
61(HS_Input): TypeStruct 7(fvec4)
62: TypeArray 61(HS_Input) 10
63: TypePointer Input 62
64(I): 63(ptr) Variable Input
74: 31(int) Constant 2
82: TypePointer Input 9(int)
83(cpid): 82(ptr) Variable Input
85: TypePointer Output 54
86(@entryPointOutput.m_Position): 85(ptr) Variable Output
93: TypePointer Output 7(fvec4)
95: 9(int) Constant 2
96: 9(int) Constant 1
97: 9(int) Constant 0
99: TypeBool
107: 9(int) Constant 4
108: TypeArray 6(float) 107
109: TypePointer Output 108
110(@patchConstantOutput.fTessFactor): 109(ptr) Variable Output
113: TypePointer Output 6(float)
121: TypeArray 6(float) 95
122: TypePointer Output 121
123(@patchConstantOutput.fInsideTessFactor): 122(ptr) Variable Output
4(main): 2 Function None 3
5: Label
53(I): 12(ptr) Variable Function
81(cpid): 19(ptr) Variable Function
87(param): 12(ptr) Variable Function
89(param): 19(ptr) Variable Function
103(@patchConstantResult): 26(ptr) Variable Function
104(param): 12(ptr) Variable Function
58: 57(ptr) AccessChain 56(I.m_Position) 33
59: 7(fvec4) Load 58
60: 48(ptr) AccessChain 53(I) 33 33
Store 60 59
65: 57(ptr) AccessChain 64(I) 33 33
66: 7(fvec4) Load 65
67: 48(ptr) AccessChain 53(I) 33 32
Store 67 66
68: 57(ptr) AccessChain 56(I.m_Position) 32
69: 7(fvec4) Load 68
70: 48(ptr) AccessChain 53(I) 32 33
Store 70 69
71: 57(ptr) AccessChain 64(I) 32 33
72: 7(fvec4) Load 71
73: 48(ptr) AccessChain 53(I) 32 32
Store 73 72
75: 57(ptr) AccessChain 56(I.m_Position) 74
76: 7(fvec4) Load 75
77: 48(ptr) AccessChain 53(I) 74 33
Store 77 76
78: 57(ptr) AccessChain 64(I) 74 33
79: 7(fvec4) Load 78
80: 48(ptr) AccessChain 53(I) 74 32
Store 80 79
84: 9(int) Load 83(cpid)
Store 81(cpid) 84
88: 11 Load 53(I)
Store 87(param) 88
90: 9(int) Load 81(cpid)
Store 89(param) 90
91:20(HS_Main_Output) FunctionCall 24(@main(struct-HS_Input-vf4-vf41[3];u1;) 87(param) 89(param)
92: 7(fvec4) CompositeExtract 91 0
94: 93(ptr) AccessChain 86(@entryPointOutput.m_Position) 33
Store 94 92
ControlBarrier 95 96 97
98: 9(int) Load 83(cpid)
100: 99(bool) IEqual 98 33
SelectionMerge 102 None
BranchConditional 100 101 102
101: Label
105: 11 Load 53(I)
Store 104(param) 105
106:14(HS_Output) FunctionCall 17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];) 104(param)
Store 103(@patchConstantResult) 106
111: 34(ptr) AccessChain 103(@patchConstantResult) 33 33
112: 6(float) Load 111
114: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 33
Store 114 112
115: 34(ptr) AccessChain 103(@patchConstantResult) 33 32
116: 6(float) Load 115
117: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 32
Store 117 116
118: 34(ptr) AccessChain 103(@patchConstantResult) 33 74
119: 6(float) Load 118
120: 113(ptr) AccessChain 110(@patchConstantOutput.fTessFactor) 74
Store 120 119
124: 34(ptr) AccessChain 103(@patchConstantResult) 32
125: 6(float) Load 124
126: 113(ptr) AccessChain 123(@patchConstantOutput.fInsideTessFactor) 33
Store 126 125
Branch 102
102: Label
Return
FunctionEnd
17(HS_ConstFunc(struct-HS_Input-vf4-vf41[3];):14(HS_Output) Function None 15
16(I): 12(ptr) FunctionParameter
18: Label
27(O): 26(ptr) Variable Function
Store 27(O) 30
35: 34(ptr) AccessChain 16(I) 33 33 10
36: 6(float) Load 35
37: 34(ptr) AccessChain 16(I) 33 32 10
38: 6(float) Load 37
39: 6(float) FAdd 36 38
40: 34(ptr) AccessChain 27(O) 32
Store 40 39
41:14(HS_Output) Load 27(O)
ReturnValue 41
FunctionEnd
24(@main(struct-HS_Input-vf4-vf41[3];u1;):20(HS_Main_Output) Function None 21
22(I): 12(ptr) FunctionParameter
23(cpid): 19(ptr) FunctionParameter
25: Label
45(output): 44(ptr) Variable Function
Store 45(output) 47
49: 48(ptr) AccessChain 45(output) 33
Store 49 46
50:20(HS_Main_Output) Load 45(output)
ReturnValue 50
FunctionEnd

View File

@ -0,0 +1,190 @@
hlsl.hull.5.tesc
ERROR: 0:0: '' : unimplemented: PCF input patch without entry point input patch parameter
ERROR: 1 compilation errors. No code generated.
Shader version: 500
vertices = 3
vertex spacing = fractional_odd_spacing
triangle order = cw
ERROR: node is still EOpNull!
0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:25 Function Parameters:
0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? Sequence
0:26 Sequence
0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 Constant:
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:28 move second child to first child ( temp float)
0:28 fInsideTessFactor: direct index for structure ( temp float)
0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:28 Constant:
0:28 1 (const int)
0:28 add ( temp float)
0:28 direct index ( temp float)
0:28 m_Position: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 3 (const int)
0:28 direct index ( temp float)
0:28 m_Normal: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:28 Constant:
0:28 3 (const int)
0:30 Branch: Return with expression
0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:39 Function Definition: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Parameters:
0:39 'cpid' ( in uint)
0:? Sequence
0:40 Sequence
0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position})
0:40 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:40 Constant:
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:41 move second child to first child ( temp 4-component vector of float)
0:41 m_Position: direct index for structure ( temp 4-component vector of float)
0:41 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:41 Constant:
0:41 0 (const int)
0:41 Constant:
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:42 Branch: Return with expression
0:42 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Definition: main( ( temp void)
0:39 Function Parameters:
0:? Sequence
0:39 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'cpid' ( temp uint)
0:39 Constant:
0:39 0 (const int)
0:? Linker Objects
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? 'cpid' ( in uint InvocationID)
Linked tessellation control stage:
Shader version: 500
vertices = 3
vertex spacing = fractional_odd_spacing
triangle order = cw
ERROR: node is still EOpNull!
0:25 Function Definition: HS_ConstFunc(struct-HS_Input-vf4-vf41[3]; ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:25 Function Parameters:
0:25 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:? Sequence
0:26 Sequence
0:26 move second child to first child ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:26 Constant:
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:26 0.000000
0:28 move second child to first child ( temp float)
0:28 fInsideTessFactor: direct index for structure ( temp float)
0:28 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:28 Constant:
0:28 1 (const int)
0:28 add ( temp float)
0:28 direct index ( temp float)
0:28 m_Position: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 3 (const int)
0:28 direct index ( temp float)
0:28 m_Normal: direct index for structure ( temp 4-component vector of float)
0:28 direct index ( temp structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 'I' ( in 3-element array of structure{ temp 4-component vector of float m_Position, temp 4-component vector of float m_Normal})
0:28 Constant:
0:28 0 (const int)
0:28 Constant:
0:28 1 (const int)
0:28 Constant:
0:28 3 (const int)
0:30 Branch: Return with expression
0:30 'O' ( temp structure{ temp 3-element array of float fTessFactor, temp float fInsideTessFactor})
0:39 Function Definition: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Parameters:
0:39 'cpid' ( in uint)
0:? Sequence
0:40 Sequence
0:40 move second child to first child ( temp structure{ temp 4-component vector of float m_Position})
0:40 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:40 Constant:
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:40 0.000000
0:41 move second child to first child ( temp 4-component vector of float)
0:41 m_Position: direct index for structure ( temp 4-component vector of float)
0:41 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:41 Constant:
0:41 0 (const int)
0:41 Constant:
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:41 0.000000
0:42 Branch: Return with expression
0:42 'output' ( temp structure{ temp 4-component vector of float m_Position})
0:39 Function Definition: main( ( temp void)
0:39 Function Parameters:
0:? Sequence
0:39 move second child to first child ( temp uint)
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:39 Sequence
0:39 move second child to first child ( temp 4-component vector of float)
0:39 direct index ( out 4-component vector of float Position)
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:39 Constant:
0:39 0 (const int)
0:39 m_Position: direct index for structure ( temp 4-component vector of float)
0:39 Function Call: @main(u1; ( temp structure{ temp 4-component vector of float m_Position})
0:? 'cpid' ( temp uint)
0:39 Constant:
0:39 0 (const int)
0:? Linker Objects
0:? '@entryPointOutput.m_Position' ( out 3-element array of 4-component vector of float Position)
0:? 'cpid' ( in uint InvocationID)
SPIR-V is not generated for failed compile or link

View File

@ -29,7 +29,7 @@ triangle order = cw
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:27 move second child to first child ( temp structure{ temp 3-component vector of float val})
0:27 indirect index ( temp structure{ temp 3-component vector of float val})
0:27 indirect index (layout( location=0) out structure{ temp 3-component vector of float val})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( in uint InvocationID)
0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
@ -229,7 +229,7 @@ triangle order = cw
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:27 move second child to first child ( temp structure{ temp 3-component vector of float val})
0:27 indirect index ( temp structure{ temp 3-component vector of float val})
0:27 indirect index (layout( location=0) out structure{ temp 3-component vector of float val})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( in uint InvocationID)
0:27 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})

View File

@ -36,7 +36,7 @@ triangle order = cw
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:28 move second child to first child ( temp structure{ temp 3-component vector of float val})
0:28 indirect index ( temp structure{ temp 3-component vector of float val})
0:28 indirect index (layout( location=0) out structure{ temp 3-component vector of float val})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( in uint InvocationID)
0:28 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
@ -82,7 +82,7 @@ triangle order = cw
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor})
0:? Function Call: PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor})
0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? Sequence
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
@ -245,7 +245,7 @@ triangle order = cw
0:? 'cpid' ( temp uint)
0:? 'cpid' ( in uint InvocationID)
0:28 move second child to first child ( temp structure{ temp 3-component vector of float val})
0:28 indirect index ( temp structure{ temp 3-component vector of float val})
0:28 indirect index (layout( location=0) out structure{ temp 3-component vector of float val})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
0:? 'cpid' ( in uint InvocationID)
0:28 Function Call: @main(struct-hs_in_t-vf31[3];u1; ( temp structure{ temp 3-component vector of float val})
@ -291,7 +291,7 @@ triangle order = cw
0:? '@patchConstantResult' ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor})
0:? Function Call: PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3]; ( temp structure{ temp 3-element array of float tfactor, temp float flInFactor})
0:? 'pcf_out' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
0:? 'i' ( temp 3-element array of structure{ temp 3-component vector of float val})
0:? Sequence
0:? move second child to first child ( temp float)
0:? direct index ( patch out float TessLevelOuter)
@ -568,7 +568,7 @@ triangle order = cw
87: 30(ptr) AccessChain 67(pcf_out) 81
Store 87 86
90: 20 Load 67(pcf_out)
91: 11 Load 42(i)
91: 11 Load 40(i)
92:22(hs_pcf_t) FunctionCall 26(PCF(struct-hs_out_t-vf31[3];struct-hs_in_t-vf31[3];) 90 91
Store 89(@patchConstantResult) 92
98: 97(ptr) AccessChain 89(@patchConstantResult) 29 29

View File

@ -29,7 +29,7 @@ triangle order = ccw
0:? 'ip' ( temp 3-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint})
@ -85,7 +85,7 @@ triangle order = ccw
0:? 'ip' ( temp 3-element array of structure{ temp 3-component vector of float cpoint})
0:? 'ip' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float cpoint})
0:26 move second child to first child ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index ( temp structure{ temp 3-component vector of float cpoint})
0:26 indirect index (layout( location=0) out structure{ temp 3-component vector of float cpoint})
0:? '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float cpoint})
0:? 'InvocationId' ( in uint InvocationID)
0:26 Function Call: @main(struct-VS_OUT-vf31[3]; ( temp structure{ temp 3-component vector of float cpoint})

View File

@ -0,0 +1,123 @@
spv.shaderFragMaskAMD.frag
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 80
Capability Shader
Capability StorageImageMultisample
Capability InputAttachment
Capability FragmentMaskAMD
Extension "SPV_AMD_shader_fragment_mask"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 78
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_AMD_shader_fragment_mask"
Name 4 "main"
Name 9 "f4"
Name 14 "fragMask"
Name 18 "s2DMS"
Name 27 "fragIndex"
Name 42 "is2DMSArray"
Name 62 "usubpassMS"
Name 78 "fragColor"
Decorate 18(s2DMS) DescriptorSet 0
Decorate 18(s2DMS) Binding 0
Decorate 42(is2DMSArray) DescriptorSet 0
Decorate 42(is2DMSArray) Binding 1
Decorate 62(usubpassMS) DescriptorSet 0
Decorate 62(usubpassMS) Binding 2
Decorate 62(usubpassMS) InputAttachmentIndex 0
Decorate 78(fragColor) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: 6(float) Constant 0
11: 7(fvec4) ConstantComposite 10 10 10 10
12: TypeInt 32 0
13: TypePointer Function 12(int)
15: TypeImage 6(float) 2D multi-sampled sampled format:Unknown
16: TypeSampledImage 15
17: TypePointer UniformConstant 16
18(s2DMS): 17(ptr) Variable UniformConstant
20: TypeInt 32 1
21: TypeVector 20(int) 2
22: 20(int) Constant 2
23: 20(int) Constant 3
24: 21(ivec2) ConstantComposite 22 23
29: 12(int) Constant 240
31: 20(int) Constant 4
34: 12(int) Constant 1
39: TypeImage 20(int) 2D array multi-sampled sampled format:Unknown
40: TypeSampledImage 39
41: TypePointer UniformConstant 40
42(is2DMSArray): 41(ptr) Variable UniformConstant
44: TypeVector 20(int) 3
45: 20(int) Constant 1
46: 44(ivec3) ConstantComposite 22 23 45
55: TypeVector 20(int) 4
60: TypeImage 12(int) SubpassData multi-sampled nonsampled format:Unknown
61: TypePointer UniformConstant 60
62(usubpassMS): 61(ptr) Variable UniformConstant
64: 20(int) Constant 0
65: 21(ivec2) ConstantComposite 64 64
72: TypeVector 12(int) 4
77: TypePointer Output 7(fvec4)
78(fragColor): 77(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(f4): 8(ptr) Variable Function
14(fragMask): 13(ptr) Variable Function
27(fragIndex): 13(ptr) Variable Function
Store 9(f4) 11
19: 16 Load 18(s2DMS)
25: 15 Image 19
26: 12(int) FragmentMaskFetchAMD 25 24
Store 14(fragMask) 26
28: 12(int) Load 14(fragMask)
30: 12(int) BitwiseAnd 28 29
32: 12(int) ShiftRightLogical 30 31
Store 27(fragIndex) 32
33: 16 Load 18(s2DMS)
35: 15 Image 33
36: 7(fvec4) FragmentFetchAMD 35 24 34
37: 7(fvec4) Load 9(f4)
38: 7(fvec4) FAdd 37 36
Store 9(f4) 38
43: 40 Load 42(is2DMSArray)
47: 39 Image 43
48: 12(int) FragmentMaskFetchAMD 47 46
Store 14(fragMask) 48
49: 12(int) Load 14(fragMask)
50: 12(int) BitwiseAnd 49 29
51: 12(int) ShiftRightLogical 50 31
Store 27(fragIndex) 51
52: 40 Load 42(is2DMSArray)
53: 12(int) Load 27(fragIndex)
54: 39 Image 52
56: 55(ivec4) FragmentFetchAMD 54 46 53
57: 7(fvec4) ConvertSToF 56
58: 7(fvec4) Load 9(f4)
59: 7(fvec4) FAdd 58 57
Store 9(f4) 59
63: 60 Load 62(usubpassMS)
66: 12(int) FragmentMaskFetchAMD 63 65
Store 14(fragMask) 66
67: 12(int) Load 14(fragMask)
68: 12(int) BitwiseAnd 67 29
69: 12(int) ShiftRightLogical 68 31
Store 27(fragIndex) 69
70: 60 Load 62(usubpassMS)
71: 12(int) Load 27(fragIndex)
73: 72(ivec4) FragmentFetchAMD 70 65 71
74: 7(fvec4) ConvertUToF 73
75: 7(fvec4) Load 9(f4)
76: 7(fvec4) FAdd 75 74
Store 9(f4) 76
79: 7(fvec4) Load 9(f4)
Store 78(fragColor) 79
Return
FunctionEnd

View File

@ -3,81 +3,84 @@ spv.stereoViewRendering.tesc
// Generated by (magic number): 80001
// Id's are bound by 38
Capability Geometry
Capability Tessellation
Capability ShaderViewportIndexLayerNV
Capability ShaderViewportMaskNV
Capability ShaderStereoViewNV
Extension "SPV_EXT_shader_viewport_index_layer"
Extension "SPV_NV_stereo_view_rendering"
Extension "SPV_NV_viewport_array2"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 16 18 32
EntryPoint TessellationControl 4 "main" 16 18 31 37
ExecutionMode 4 OutputVertices 4
Source GLSL 450
SourceExtension "GL_NV_stereo_view_rendering"
SourceExtension "GL_NV_viewport_array2"
Name 4 "main"
Name 12 "gl_PerVertex"
MemberName 12(gl_PerVertex) 0 "gl_Layer"
MemberName 12(gl_PerVertex) 1 "gl_SecondaryPositionNV"
MemberName 12(gl_PerVertex) 2 "gl_SecondaryViewportMaskNV"
MemberName 12(gl_PerVertex) 0 "gl_SecondaryPositionNV"
MemberName 12(gl_PerVertex) 1 "gl_SecondaryViewportMaskNV"
Name 16 "gl_out"
Name 18 "gl_InvocationID"
Name 28 "gl_PerVertex"
MemberName 28(gl_PerVertex) 0 "gl_Position"
MemberName 28(gl_PerVertex) 1 "gl_PointSize"
MemberName 28(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 28(gl_PerVertex) 3 "gl_CullDistance"
MemberName 28(gl_PerVertex) 4 "gl_SecondaryPositionNV"
Name 32 "gl_in"
MemberDecorate 12(gl_PerVertex) 0 BuiltIn Layer
MemberDecorate 12(gl_PerVertex) 0 ViewportRelativeNV
MemberDecorate 12(gl_PerVertex) 0 SecondaryViewportRelativeNV 1
MemberDecorate 12(gl_PerVertex) 1 BuiltIn SecondaryPositionNV
MemberDecorate 12(gl_PerVertex) 2 BuiltIn SecondaryViewportMaskNV
Name 27 "gl_PerVertex"
MemberName 27(gl_PerVertex) 0 "gl_Position"
MemberName 27(gl_PerVertex) 1 "gl_PointSize"
MemberName 27(gl_PerVertex) 2 "gl_ClipDistance"
MemberName 27(gl_PerVertex) 3 "gl_CullDistance"
MemberName 27(gl_PerVertex) 4 "gl_SecondaryPositionNV"
Name 31 "gl_in"
Name 37 "gl_Layer"
MemberDecorate 12(gl_PerVertex) 0 BuiltIn SecondaryPositionNV
MemberDecorate 12(gl_PerVertex) 1 BuiltIn SecondaryViewportMaskNV
Decorate 12(gl_PerVertex) Block
Decorate 18(gl_InvocationID) BuiltIn InvocationId
MemberDecorate 28(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 28(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 28(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 28(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 28(gl_PerVertex) Block
MemberDecorate 27(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 27(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 27(gl_PerVertex) 2 BuiltIn ClipDistance
MemberDecorate 27(gl_PerVertex) 3 BuiltIn CullDistance
Decorate 27(gl_PerVertex) Block
Decorate 37(gl_Layer) BuiltIn Layer
Decorate 37(gl_Layer) ViewportRelativeNV
Decorate 37(gl_Layer) SecondaryViewportRelativeNV 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeFloat 32
8: TypeVector 7(float) 4
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeInt 32 1
9: TypeInt 32 0
10: 9(int) Constant 2
11: TypeArray 6(int) 10
12(gl_PerVertex): TypeStruct 6(int) 8(fvec4) 11
11: TypeArray 8(int) 10
12(gl_PerVertex): TypeStruct 7(fvec4) 11
13: 9(int) Constant 4
14: TypeArray 12(gl_PerVertex) 13
15: TypePointer Output 14
16(gl_out): 15(ptr) Variable Output
17: TypePointer Input 6(int)
17: TypePointer Input 8(int)
18(gl_InvocationID): 17(ptr) Variable Input
20: 6(int) Constant 2
21: 6(int) Constant 0
22: 6(int) Constant 1
23: TypePointer Output 6(int)
26: 9(int) Constant 1
27: TypeArray 7(float) 26
28(gl_PerVertex): TypeStruct 8(fvec4) 7(float) 27 27 8(fvec4)
29: 9(int) Constant 32
30: TypeArray 28(gl_PerVertex) 29
31: TypePointer Input 30
32(gl_in): 31(ptr) Variable Input
33: TypePointer Input 8(fvec4)
36: TypePointer Output 8(fvec4)
20: 8(int) Constant 1
21: 8(int) Constant 0
22: TypePointer Output 8(int)
25: 9(int) Constant 1
26: TypeArray 6(float) 25
27(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 26 26 7(fvec4)
28: 9(int) Constant 32
29: TypeArray 27(gl_PerVertex) 28
30: TypePointer Input 29
31(gl_in): 30(ptr) Variable Input
32: TypePointer Input 7(fvec4)
35: TypePointer Output 7(fvec4)
37(gl_Layer): 22(ptr) Variable Output
4(main): 2 Function None 3
5: Label
19: 6(int) Load 18(gl_InvocationID)
24: 23(ptr) AccessChain 16(gl_out) 19 20 21
Store 24 22
25: 6(int) Load 18(gl_InvocationID)
34: 33(ptr) AccessChain 32(gl_in) 22 21
35: 8(fvec4) Load 34
37: 36(ptr) AccessChain 16(gl_out) 25 22
Store 37 35
19: 8(int) Load 18(gl_InvocationID)
23: 22(ptr) AccessChain 16(gl_out) 19 20 21
Store 23 20
24: 8(int) Load 18(gl_InvocationID)
33: 32(ptr) AccessChain 31(gl_in) 20 21
34: 7(fvec4) Load 33
36: 35(ptr) AccessChain 16(gl_out) 24 21
Store 36 34
Return
FunctionEnd

View File

@ -3,6 +3,7 @@ spv.viewportArray2.tesc
// Generated by (magic number): 80001
// Id's are bound by 25
Capability Geometry
Capability Tessellation
Capability MultiViewport
Capability ShaderViewportIndexLayerNV
@ -11,47 +12,47 @@ spv.viewportArray2.tesc
Extension "SPV_NV_viewport_array2"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationControl 4 "main" 14 16
EntryPoint TessellationControl 4 "main" 14 16 22 24
ExecutionMode 4 OutputVertices 4
Source GLSL 450
SourceExtension "GL_NV_viewport_array2"
Name 4 "main"
Name 10 "gl_PerVertex"
MemberName 10(gl_PerVertex) 0 "gl_ViewportIndex"
MemberName 10(gl_PerVertex) 1 "gl_Layer"
MemberName 10(gl_PerVertex) 2 "gl_ViewportMask"
MemberName 10(gl_PerVertex) 0 "gl_ViewportMask"
Name 14 "gl_out"
Name 16 "gl_InvocationID"
MemberDecorate 10(gl_PerVertex) 0 BuiltIn ViewportIndex
MemberDecorate 10(gl_PerVertex) 1 BuiltIn Layer
MemberDecorate 10(gl_PerVertex) 1 ViewportRelativeNV
MemberDecorate 10(gl_PerVertex) 2 BuiltIn ViewportMaskNV
Name 22 "gl_ViewportIndex"
Name 24 "gl_Layer"
MemberDecorate 10(gl_PerVertex) 0 BuiltIn ViewportMaskNV
Decorate 10(gl_PerVertex) Block
Decorate 16(gl_InvocationID) BuiltIn InvocationId
Decorate 22(gl_ViewportIndex) BuiltIn ViewportIndex
Decorate 24(gl_Layer) BuiltIn Layer
Decorate 24(gl_Layer) ViewportRelativeNV
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypeInt 32 0
8: 7(int) Constant 2
9: TypeArray 6(int) 8
10(gl_PerVertex): TypeStruct 6(int) 6(int) 9
10(gl_PerVertex): TypeStruct 9
11: 7(int) Constant 4
12: TypeArray 10(gl_PerVertex) 11
13: TypePointer Output 12
14(gl_out): 13(ptr) Variable Output
15: TypePointer Input 6(int)
16(gl_InvocationID): 15(ptr) Variable Input
18: 6(int) Constant 2
19: 6(int) Constant 0
20: 6(int) Constant 1
21: TypePointer Output 6(int)
18: 6(int) Constant 0
19: 6(int) Constant 1
20: TypePointer Output 6(int)
22(gl_ViewportIndex): 20(ptr) Variable Output
23: 6(int) Constant 2
24(gl_Layer): 20(ptr) Variable Output
4(main): 2 Function None 3
5: Label
17: 6(int) Load 16(gl_InvocationID)
22: 21(ptr) AccessChain 14(gl_out) 17 18 19
Store 22 20
23: 6(int) Load 16(gl_InvocationID)
24: 21(ptr) AccessChain 14(gl_out) 23 19
Store 24 18
21: 20(ptr) AccessChain 14(gl_out) 17 18 18
Store 21 19
Store 22(gl_ViewportIndex) 23
Return
FunctionEnd

View File

@ -0,0 +1,11 @@
#version 460
void bar()
{
gl_Position = vec4(1);
}
void main()
{
gl_Position = vec4(1);
}

View File

@ -0,0 +1,6 @@
#version 460
void bar()
{
gl_Position = vec4(1);
}

View File

@ -4,8 +4,15 @@ struct {
float4 m[7];
} s[11];
float4 PixelShaderFunction(int i, float4 input[3]) : COLOR0
static float4 C = float4(1,2,3,4);
float4 a1[1] = { float4(1,2,3,4) };
float4 a2[2] = { float4(1,2,3,4), float4(5,2,3,4), };
const float4 c1[1] = { float4(1,2,3,4) };
static const float4 c2[2] = { C, float4(1,2,3,4), };
float4 PixelShaderFunction(int i : sem1, float4 input[3] : sem2) : SV_TARGET0
{
float4 b[10];
return a[1] + a[i] + input[2] + input[i] + b[5] + b[i] + s[i].m[i];
}
float4 b[10] = { C, C, C, C, C, C, C, C, C, C };
float4 tmp = C + a1[0] + c1[0] + a2[i] + c2[i];
return a[1] + a[i] + input[2] + input[i] + b[5] + b[i] + s[i].m[i] + tmp;
}

View File

@ -21,6 +21,6 @@ float4 main() : SV_Target0
if (cb3[1][2].x)
return cb1.x + cb2[1].y + c1;
else
return cb3[2][3].y;
return cb3[1][3].y;
}

43
3rdparty/glslang/Test/hlsl.hull.4.tesc vendored Normal file
View File

@ -0,0 +1,43 @@
// Test mixed InputPatch structure: user and builtin members. Hull shaders involve extra
// logic in this case due to patch constant function call synthesis.
// This example tests the main EP and the PCF EP both having an input patch.
struct HS_Main_Output
{
float4 m_Position : SV_POSITION ;
};
struct HS_Output
{
float fTessFactor [ 3 ] : SV_TessFactor ;
float fInsideTessFactor : SV_InsideTessFactor ;
};
struct HS_Input
{
float4 m_Position : SV_POSITION;
float4 m_Normal : TEXCOORD2;
};
HS_Output HS_ConstFunc ( InputPatch < HS_Input , 3 > I )
{
HS_Output O = (HS_Output)0;
O.fInsideTessFactor = I [ 0 ].m_Position.w + I [ 0 ].m_Normal.w;
return O;
}
[ domain ( "tri" ) ]
[ partitioning ( "fractional_odd" ) ]
[ outputtopology ( "triangle_cw" ) ]
[ patchconstantfunc ( "HS_ConstFunc" ) ]
[ outputcontrolpoints ( 3 ) ]
HS_Main_Output main( InputPatch < HS_Input , 3 > I , uint cpid : SV_OutputControlPointID )
{
HS_Main_Output output = ( HS_Main_Output ) 0 ;
output.m_Position = 0;
return output ;
}

43
3rdparty/glslang/Test/hlsl.hull.5.tesc vendored Normal file
View File

@ -0,0 +1,43 @@
// Test mixed InputPatch structure: user and builtin members. Hull shaders involve extra
// logic in this case due to patch constant function call synthesis.
// This example tests the PCF EP having an InputPatch, but the main EP does not.
struct HS_Main_Output
{
float4 m_Position : SV_POSITION ;
};
struct HS_Output
{
float fTessFactor [ 3 ] : SV_TessFactor ;
float fInsideTessFactor : SV_InsideTessFactor ;
};
struct HS_Input
{
float4 m_Position : SV_POSITION;
float4 m_Normal : TEXCOORD2;
};
HS_Output HS_ConstFunc ( InputPatch < HS_Input , 3 > I )
{
HS_Output O = (HS_Output)0;
O.fInsideTessFactor = I [ 0 ].m_Position.w + I [ 0 ].m_Normal.w;
return O;
}
[ domain ( "tri" ) ]
[ partitioning ( "fractional_odd" ) ]
[ outputtopology ( "triangle_cw" ) ]
[ patchconstantfunc ( "HS_ConstFunc" ) ]
[ outputcontrolpoints ( 3 ) ]
HS_Main_Output main( uint cpid : SV_OutputControlPointID )
{
HS_Main_Output output = ( HS_Main_Output ) 0 ;
output.m_Position = 0;
return output ;
}

View File

@ -156,6 +156,16 @@ $EXE --target-env opengl spv.targetOpenGL.vert || HASERROR=1
$EXE -V100 spv.targetVulkan.vert || HASERROR=1
$EXE -G100 spv.targetOpenGL.vert || HASERROR=1
#
# Testing GLSL entry point rename
#
$EXE -H -e foo --source-entrypoint main glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.out
diff -b $BASEDIR/glsl.entryPointRename.vert.out $TARGETDIR/glsl.entryPointRename.vert.out || HASERROR=1
$EXE -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > $TARGETDIR/glsl.entryPointRename.vert.bad.out
diff -b $BASEDIR/glsl.entryPointRename.vert.bad.out $TARGETDIR/glsl.entryPointRename.vert.bad.out || HASERROR=1
$EXE -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > $TARGETDIR/glsl.entryPointRename2.vert.out
diff -b $BASEDIR/glsl.entryPointRename2.vert.out $TARGETDIR/glsl.entryPointRename2.vert.out || HASERROR=1
#
# Final checking
#

View File

@ -0,0 +1,29 @@
#version 450 core
#extension GL_AMD_shader_fragment_mask: enable
layout(binding = 0) uniform sampler2DMS s2DMS;
layout(binding = 1) uniform isampler2DMSArray is2DMSArray;
layout(binding = 2, input_attachment_index = 0) uniform usubpassInputMS usubpassMS;
layout(location = 0) out vec4 fragColor;
void main()
{
vec4 f4 = vec4(0.0);
uint fragMask = fragmentMaskFetchAMD(s2DMS, ivec2(2, 3));
uint fragIndex = (fragMask & 0xF0) >> 4;
f4 += fragmentFetchAMD(s2DMS, ivec2(2, 3), 1);
fragMask = fragmentMaskFetchAMD(is2DMSArray, ivec3(2, 3, 1));
fragIndex = (fragMask & 0xF0) >> 4;
f4 += fragmentFetchAMD(is2DMSArray, ivec3(2, 3, 1), fragIndex);
fragMask = fragmentMaskFetchAMD(usubpassMS);
fragIndex = (fragMask & 0xF0) >> 4;
f4 += fragmentFetchAMD(usubpassMS, fragIndex);
fragColor = f4;
}

View File

@ -8,9 +8,10 @@ layout(vertices = 4) out;
out gl_PerVertex {
int gl_SecondaryViewportMaskNV[2];
vec4 gl_SecondaryPositionNV;
layout (viewport_relative, secondary_view_offset = 1) out highp int gl_Layer;
} gl_out[4];
layout (viewport_relative, secondary_view_offset = 1) out highp int gl_Layer;
void main()
{
gl_out[gl_InvocationID].gl_SecondaryViewportMaskNV[0] = 1;

View File

@ -5,12 +5,12 @@ layout(vertices = 4) out;
out gl_PerVertex {
int gl_ViewportMask[2];
int gl_ViewportIndex;
layout (viewport_relative) out highp int gl_Layer;
} gl_out[4];
layout (viewport_relative) out highp int gl_Layer;
void main()
{
gl_out[gl_InvocationID].gl_ViewportMask[0] = 1;
gl_out[gl_InvocationID].gl_ViewportIndex = 2;
gl_out[gl_InvocationID].gl_ViewportMask[0] = 1;
gl_ViewportIndex = 2;
}

View File

@ -198,6 +198,7 @@ enum TBuiltInVariable {
EbvSamplePosition,
EbvSampleMask,
EbvHelperInvocation,
#ifdef AMD_EXTENSIONS
EbvBaryCoordNoPersp,
EbvBaryCoordNoPerspCentroid,
@ -334,6 +335,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvSamplePosition: return "SamplePosition";
case EbvSampleMask: return "SampleMaskIn";
case EbvHelperInvocation: return "HelperInvocation";
#ifdef AMD_EXTENSIONS
case EbvBaryCoordNoPersp: return "BaryCoordNoPersp";
case EbvBaryCoordNoPerspCentroid: return "BaryCoordNoPerspCentroid";

View File

@ -78,6 +78,10 @@ inline long long int atoll (const char* str)
}
#endif
#if defined(_MSC_VER)
#define strdup _strdup
#endif
/* windows only pragma */
#ifdef _MSC_VER
#pragma warning(disable : 4786) // Don't warn about too long identifiers
@ -222,6 +226,7 @@ inline const TString String(const int i, const int /*base*/ = 10)
struct TSourceLoc {
void init() { name = nullptr; string = 0; line = 0; column = 0; }
void init(int stringNum) { init(); string = stringNum; }
// Returns the name if it exists. Otherwise, returns the string number.
std::string getStringNameOrNum(bool quoteStringName = true) const
{

View File

@ -653,6 +653,8 @@ enum TOperator {
EOpTextureGatherLod,
EOpTextureGatherLodOffset,
EOpTextureGatherLodOffsets,
EOpFragmentMaskFetch,
EOpFragmentFetch,
#endif
EOpSparseTextureGuardBegin,
@ -1032,6 +1034,9 @@ struct TCrackedTextureOp {
bool grad;
bool subpass;
bool lodClamp;
#ifdef AMD_EXTENSIONS
bool fragMask;
#endif
};
//
@ -1079,6 +1084,9 @@ public:
cracked.grad = false;
cracked.subpass = false;
cracked.lodClamp = false;
#ifdef AMD_EXTENSIONS
cracked.fragMask = false;
#endif
switch (op) {
case EOpImageQuerySize:
@ -1210,6 +1218,14 @@ public:
case EOpSparseImageLoadLod:
cracked.lod = true;
break;
case EOpFragmentMaskFetch:
cracked.subpass = sampler.dim == EsdSubpass;
cracked.fragMask = true;
break;
case EOpFragmentFetch:
cracked.subpass = sampler.dim == EsdSubpass;
cracked.fragMask = true;
break;
#endif
case EOpSubpassLoad:
case EOpSubpassLoadMS:

View File

@ -2283,7 +2283,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
if (profile != EEsProfile && version >= 450) {
commonBuiltins.append(
"float cubeFaceIndexAMD(vec3);"
"vec2 cubeFaceCoordAMD(vec3);"
"vec2 cubeFaceCoordAMD(vec3);"
"uint64_t timeAMD();"
"\n");
@ -2787,6 +2787,29 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
// GL_AMD_shader_fragment_mask
if (profile != EEsProfile && version >= 450) {
commonBuiltins.append(
"uint fragmentMaskFetchAMD(sampler2DMS, ivec2);"
"uint fragmentMaskFetchAMD(isampler2DMS, ivec2);"
"uint fragmentMaskFetchAMD(usampler2DMS, ivec2);"
"uint fragmentMaskFetchAMD(sampler2DMSArray, ivec3);"
"uint fragmentMaskFetchAMD(isampler2DMSArray, ivec3);"
"uint fragmentMaskFetchAMD(usampler2DMSArray, ivec3);"
"vec4 fragmentFetchAMD(sampler2DMS, ivec2, uint);"
"ivec4 fragmentFetchAMD(isampler2DMS, ivec2, uint);"
"uvec4 fragmentFetchAMD(usampler2DMS, ivec2, uint);"
"vec4 fragmentFetchAMD(sampler2DMSArray, ivec3, uint);"
"ivec4 fragmentFetchAMD(isampler2DMSArray, ivec3, uint);"
"uvec4 fragmentFetchAMD(usampler2DMSArray, ivec3, uint);"
"\n");
}
#endif
//============================================================================
@ -3126,6 +3149,20 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
// GL_AMD_shader_fragment_mask
if (profile != EEsProfile && version >= 450 && spvVersion.vulkan >= 100) {
stageBuiltins[EShLangFragment].append(
"uint fragmentMaskFetchAMD(subpassInputMS);"
"uint fragmentMaskFetchAMD(isubpassInputMS);"
"uint fragmentMaskFetchAMD(usubpassInputMS);"
"vec4 fragmentFetchAMD(subpassInputMS, uint);"
"ivec4 fragmentFetchAMD(isubpassInputMS, uint);"
"uvec4 fragmentFetchAMD(usubpassInputMS, uint);"
"\n");
}
#endif
//============================================================================
@ -3425,7 +3462,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in int gl_DrawIDARB;"
);
}
if (version >= 450) {
if (version >= 410) {
stageBuiltins[EShLangVertex].append(
"out int gl_ViewportIndex;"
"out int gl_Layer;"
@ -3558,6 +3595,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"out int gl_PrimitiveID;"
"out int gl_Layer;");
if (version >= 150)
stageBuiltins[EShLangGeometry].append(
"out int gl_ViewportIndex;"
);
if (profile == ECompatibilityProfile && version < 400)
stageBuiltins[EShLangGeometry].append(
"out vec4 gl_ClipVertex;"
@ -3567,11 +3609,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangGeometry].append(
"in int gl_InvocationID;"
);
// GL_ARB_viewport_array
if (version >= 150)
stageBuiltins[EShLangGeometry].append(
"out int gl_ViewportIndex;"
);
#ifdef NV_EXTENSIONS
if (version >= 450)
@ -3648,8 +3685,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangTessControl].append(
"float gl_CullDistance[];"
#ifdef NV_EXTENSIONS
"int gl_ViewportIndex;"
"int gl_Layer;"
"int gl_ViewportMask[];" // GL_NV_viewport_array2
"vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
"int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
@ -3663,6 +3698,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"patch out float gl_TessLevelOuter[4];"
"patch out float gl_TessLevelInner[2];"
"\n");
if (version >= 410)
stageBuiltins[EShLangTessControl].append(
"out int gl_ViewportIndex;"
"out int gl_Layer;"
"\n");
} else {
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
// as it depends on the resource sizing of gl_MaxPatchVertices.
@ -3734,11 +3776,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"};"
"\n");
if (version >= 450)
if (version >= 410)
stageBuiltins[EShLangTessEvaluation].append(
"out int gl_ViewportIndex;"
"out int gl_Layer;"
);
"\n");
#ifdef NV_EXTENSIONS
if (version >= 450)
@ -5372,6 +5414,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("cubeFaceCoordAMD", 1, &E_GL_AMD_gcn_shader);
symbolTable.setFunctionExtensions("timeAMD", 1, &E_GL_AMD_gcn_shader);
}
if (profile != EEsProfile) {
symbolTable.setFunctionExtensions("fragmentMaskFetchAMD", 1, &E_GL_AMD_shader_fragment_mask);
symbolTable.setFunctionExtensions("fragmentFetchAMD", 1, &E_GL_AMD_shader_fragment_mask);
}
#endif
// Compatibility variables, vertex only
@ -5476,7 +5523,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_ViewportIndex", Num_viewportEXTs, viewportEXTs);
}
#else
if (language == EShLangVertex || language == EShLangTessEvaluation) {
if (language != EShLangGeometry && version >= 410) {
symbolTable.setVariableExtensions("gl_Layer", 1, &E_GL_ARB_shader_viewport_layer_array);
symbolTable.setVariableExtensions("gl_ViewportIndex", 1, &E_GL_ARB_shader_viewport_layer_array);
}
@ -5499,8 +5546,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable);
BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable);
}
BuiltInVariable("gl_out", "gl_Layer", EbvLayer, symbolTable);
BuiltInVariable("gl_out", "gl_ViewportIndex", EbvViewportIndex, symbolTable);
BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable);
BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable);
BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable);
@ -6210,6 +6255,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("imageLoadLodAMD", EOpImageLoadLod);
symbolTable.relateToOperator("imageStoreLodAMD", EOpImageStoreLod);
symbolTable.relateToOperator("sparseImageLoadLodAMD", EOpSparseImageLoadLod);
symbolTable.relateToOperator("fragmentMaskFetchAMD", EOpFragmentMaskFetch);
symbolTable.relateToOperator("fragmentFetchAMD", EOpFragmentFetch);
#endif
}
if (profile == EEsProfile) {

View File

@ -234,6 +234,31 @@ void TParseContextBase::trackLinkage(TSymbol& symbol)
linkageSymbols.push_back(&symbol);
}
// Ensure index is in bounds, correct if necessary.
// Give an error if not.
void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int& index)
{
if (index < 0) {
error(loc, "", "[", "index out of range '%d'", index);
index = 0;
} else if (type.isArray()) {
if (type.isExplicitlySizedArray() && index >= type.getOuterArraySize()) {
error(loc, "", "[", "array index out of range '%d'", index);
index = type.getOuterArraySize() - 1;
}
} else if (type.isVector()) {
if (index >= type.getVectorSize()) {
error(loc, "", "[", "vector index out of range '%d'", index);
index = type.getVectorSize() - 1;
}
} else if (type.isMatrix()) {
if (index >= type.getMatrixCols()) {
error(loc, "", "[", "matrix index out of range '%d'", index);
index = type.getMatrixCols() - 1;
}
}
}
// Make a shared symbol have a non-shared version that can be edited by the current
// compile, such that editing its type will not change the shared version and will
// effect all nodes already sharing it (non-shallow type),

View File

@ -49,9 +49,10 @@ namespace glslang {
TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins,
int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) :
TInfoSink& infoSink, bool forwardCompatible, EShMessages messages,
const TString* entryPoint) :
TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language,
infoSink, forwardCompatible, messages),
infoSink, forwardCompatible, messages, entryPoint),
inMain(false),
blockName(nullptr),
limits(resources.limits),
@ -88,6 +89,9 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b
if (language == EShLangGeometry)
globalOutputDefaults.layoutStream = 0;
if (entryPoint != nullptr && entryPoint->size() > 0 && *entryPoint != "main")
infoSink.info.message(EPrefixError, "Source entry point must be \"main\"");
}
TParseContext::~TParseContext()
@ -425,29 +429,6 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
return result;
}
void TParseContext::checkIndex(const TSourceLoc& loc, const TType& type, int& index)
{
if (index < 0) {
error(loc, "", "[", "index out of range '%d'", index);
index = 0;
} else if (type.isArray()) {
if (type.isExplicitlySizedArray() && index >= type.getOuterArraySize()) {
error(loc, "", "[", "array index out of range '%d'", index);
index = type.getOuterArraySize() - 1;
}
} else if (type.isVector()) {
if (index >= type.getVectorSize()) {
error(loc, "", "[", "vector index out of range '%d'", index);
index = type.getVectorSize() - 1;
}
} else if (type.isMatrix()) {
if (index >= type.getMatrixCols()) {
error(loc, "", "[", "matrix index out of range '%d'", index);
index = type.getMatrixCols() - 1;
}
}
}
// for ES 2.0 (version 100) limitations for almost all index operations except vertex-shader uniforms
void TParseContext::handleIndexLimits(const TSourceLoc& /*loc*/, TIntermTyped* base, TIntermTyped* index)
{
@ -3528,14 +3509,6 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
oldType.getQualifier().flat = newType.getQualifier().flat;
oldType.getQualifier().nopersp = newType.getQualifier().nopersp;
#ifdef NV_EXTENSIONS
if (member->type->getFieldName() == "gl_Layer") {
if (!newType.getQualifier().layoutViewportRelative && newType.getQualifier().layoutSecondaryViewportRelativeOffset == -2048)
error(loc, "redeclaration only allowed for viewport_relative or secondary_view_offset layout", "redeclaration", member->type->getFieldName().c_str());
oldType.getQualifier().layoutViewportRelative = newType.getQualifier().layoutViewportRelative;
oldType.getQualifier().layoutSecondaryViewportRelativeOffset = newType.getQualifier().layoutSecondaryViewportRelativeOffset;
}
#endif
if (oldType.isImplicitlySizedArray() && newType.isExplicitlySizedArray())
oldType.changeOuterArraySize(newType.getOuterArraySize());
@ -5501,7 +5474,7 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode*
bool singleArg;
if (aggrNode) {
if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1)
if (aggrNode->getOp() != EOpNull)
singleArg = true;
else
singleArg = false;

View File

@ -74,7 +74,8 @@ class TParseContextBase : public TParseVersions {
public:
TParseContextBase(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, int version,
EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
TInfoSink& infoSink, bool forwardCompatible, EShMessages messages)
TInfoSink& infoSink, bool forwardCompatible, EShMessages messages,
const TString* entryPoint = nullptr)
: TParseVersions(interm, version, profile, spvVersion, language, infoSink, forwardCompatible, messages),
scopeMangler("::"),
symbolTable(symbolTable),
@ -84,7 +85,10 @@ public:
parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr),
limits(resources.limits),
globalUniformBlock(nullptr)
{ }
{
if (entryPoint != nullptr)
sourceEntryPointName = *entryPoint;
}
virtual ~TParseContextBase() { }
virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
@ -98,6 +102,8 @@ public:
virtual void setLimits(const TBuiltInResource&) = 0;
void checkIndex(const TSourceLoc&, const TType&, int& index);
EShLanguage getLanguage() const { return language; }
void setScanContext(TScanContext* c) { scanContext = c; }
TScanContext* getScanContext() const { return scanContext; }
@ -141,6 +147,15 @@ public:
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr);
// Potentially rename shader entry point function
void renameShaderFunction(TString*& name) const
{
// Replace the entry point name given in the shader with the real entry point name,
// if there is a substitution.
if (name != nullptr && *name == sourceEntryPointName)
name = NewPoolTString(intermediate.getEntryPointName().c_str());
}
virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
@ -173,6 +188,7 @@ protected:
TPpContext* ppContext;
TBuiltInResource resources;
TLimits& limits;
TString sourceEntryPointName;
// These, if set, will be called when a line, pragma ... is preprocessed.
// They will be called with any parameters to the original directive.
@ -249,7 +265,8 @@ protected:
class TParseContext : public TParseContextBase {
public:
TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, const SpvVersion& spvVersion, EShLanguage, TInfoSink&,
bool forwardCompatible = false, EShMessages messages = EShMsgDefault);
bool forwardCompatible = false, EShMessages messages = EShMsgDefault,
const TString* entryPoint = nullptr);
virtual ~TParseContext();
bool obeyPrecisionQualifiers() const { return precisionManager.respectingPrecisionQualifiers(); };
@ -268,7 +285,6 @@ public:
void handlePragma(const TSourceLoc&, const TVector<TString>&) override;
TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string);
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
void checkIndex(const TSourceLoc&, const TType&, int& index);
void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
void makeEditable(TSymbol*&) override;

View File

@ -51,25 +51,24 @@ const int EndOfInput = -1;
//
class TInputScanner {
public:
TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr, int b = 0, int f = 0, bool single = false) :
TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr,
int b = 0, int f = 0, bool single = false) :
numSources(n),
sources(reinterpret_cast<const unsigned char* const *>(s)), // up to this point, common usage is "char*", but now we need positive 8-bit characters
lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single), endOfFileReached(false)
// up to this point, common usage is "char*", but now we need positive 8-bit characters
sources(reinterpret_cast<const unsigned char* const *>(s)),
lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single),
endOfFileReached(false)
{
loc = new TSourceLoc[numSources];
for (int i = 0; i < numSources; ++i) {
loc[i].init();
loc[i].init(i - stringBias);
}
if (names != nullptr) {
for (int i = 0; i < numSources; ++i)
loc[i].name = names[i];
}
loc[currentSource].string = -stringBias;
loc[currentSource].line = 1;
loc[currentSource].column = 0;
logicalSourceLoc.string = 0;
logicalSourceLoc.line = 1;
logicalSourceLoc.column = 0;
logicalSourceLoc.init(1);
logicalSourceLoc.name = loc[0].name;
}

View File

@ -91,18 +91,16 @@ TParseContextBase* CreateParseContext(TSymbolTable& symbolTable, TIntermediate&
int version, EProfile profile, EShSource source,
EShLanguage language, TInfoSink& infoSink,
SpvVersion spvVersion, bool forwardCompatible, EShMessages messages,
bool parsingBuiltIns, const std::string sourceEntryPointName = "")
bool parsingBuiltIns, std::string sourceEntryPointName = "")
{
#ifndef ENABLE_HLSL
(void)sourceEntryPointName; // Unused argument.
#endif
switch (source) {
case EShSourceGlsl:
intermediate.setEntryPointName("main");
case EShSourceGlsl: {
if (sourceEntryPointName.size() == 0)
intermediate.setEntryPointName("main");
TString entryPoint = sourceEntryPointName.c_str();
return new TParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion,
language, infoSink, forwardCompatible, messages);
language, infoSink, forwardCompatible, messages, &entryPoint);
}
#ifdef ENABLE_HLSL
case EShSourceHlsl:
return new HlslParseContext(symbolTable, intermediate, parsingBuiltIns, version, profile, spvVersion,

View File

@ -201,6 +201,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_AMD_texture_gather_bias_lod] = EBhDisable;
extensionBehavior[E_GL_AMD_gpu_shader_int16] = EBhDisable;
extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable;
extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable;
#endif
#ifdef NV_EXTENSIONS
@ -333,6 +334,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_AMD_texture_gather_bias_lod 1\n"
"#define GL_AMD_gpu_shader_int16 1\n"
"#define GL_AMD_shader_image_load_store_lod 1\n"
"#define GL_AMD_shader_fragment_mask 1\n"
#endif
#ifdef NV_EXTENSIONS

View File

@ -171,6 +171,7 @@ const char* const E_GL_AMD_gpu_shader_half_float = "GL_AMD_gpu_sh
const char* const E_GL_AMD_texture_gather_bias_lod = "GL_AMD_texture_gather_bias_lod";
const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_shader_int16";
const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod";
const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask";
#endif
#ifdef NV_EXTENSIONS

View File

@ -860,6 +860,11 @@ function_header
// Add the function as a prototype after parsing it (we do not support recursion)
TFunction *function;
TType type($1);
// Potentially rename shader entry point function. No-op most of the time.
parseContext.renameShaderFunction($2.string);
// Make the function
function = new TFunction($2.string, type);
$$ = function;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
/* A Bison parser, made by GNU Bison 3.0. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -345,7 +345,7 @@ extern int yydebug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
#line 68 "MachineIndependent/glslang.y" /* yacc.c:1909 */
@ -384,8 +384,6 @@ union YYSTYPE
#line 386 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif

View File

@ -431,10 +431,13 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpMaxInvocationsExclusiveScanNonUniform: out.debug << "maxInvocationsExclusiveScanNonUniform"; break;
case EOpAddInvocationsExclusiveScanNonUniform: out.debug << "addInvocationsExclusiveScanNonUniform"; break;
case EOpMbcnt: out.debug << "mbcnt"; break;
case EOpMbcnt: out.debug << "mbcnt"; break;
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
case EOpCubeFaceIndex: out.debug << "cubeFaceIndex"; break;
case EOpCubeFaceCoord: out.debug << "cubeFaceCoord"; break;
case EOpFragmentMaskFetch: out.debug << "fragmentMaskFetchAMD"; break;
case EOpFragmentFetch: out.debug << "fragmentFetchAMD"; break;
case EOpConvBoolToFloat16: out.debug << "Convert bool to float16"; break;
case EOpConvIntToFloat16: out.debug << "Convert int to float16"; break;

View File

@ -164,6 +164,8 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.hull.1.tesc", "main"},
{"hlsl.hull.2.tesc", "main"},
{"hlsl.hull.3.tesc", "main"},
{"hlsl.hull.4.tesc", "main"},
{"hlsl.hull.5.tesc", "main"},
{"hlsl.hull.void.tesc", "main"},
{"hlsl.hull.ctrlpt-1.tesc", "main"},
{"hlsl.hull.ctrlpt-2.tesc", "main"},

View File

@ -409,6 +409,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.imageLoadStoreLod.frag",
"spv.int16.frag",
"spv.shaderBallotAMD.comp",
"spv.shaderFragMaskAMD.frag",
"spv.textureGatherBiasLod.frag"
})),
FileNameAsCustomTestSuffix

View File

@ -387,7 +387,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
HlslToken idToken;
TIntermAggregate* initializers = nullptr;
while (acceptIdentifier(idToken)) {
const TString *fullName = idToken.string;
TString *fullName = idToken.string;
if (parseContext.symbolTable.atGlobalLevel())
parseContext.getFullNamespaceName(fullName);
if (peekTokenClass(EHTokLeftParen)) {
@ -2263,12 +2263,12 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList, TIntermNode*
//
// Expects type to have EvqGlobal for a static member and
// EvqTemporary for non-static member.
bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType& type, const TString& memberName,
bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType& type, TString& memberName,
TFunctionDeclarator& declarator)
{
bool accepted = false;
const TString* functionName = &memberName;
TString* functionName = &memberName;
parseContext.getFullNamespaceName(functionName);
declarator.function = new TFunction(functionName, type);
if (type.getQualifier().storage == EvqTemporary)

View File

@ -91,7 +91,7 @@ namespace glslang {
bool acceptConstantBufferType(TType&);
bool acceptStruct(TType&, TIntermNode*& nodeList);
bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, TVector<TFunctionDeclarator>&);
bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType&, const TString& memberName,
bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType&, TString& memberName,
TFunctionDeclarator&);
bool acceptFunctionParameters(TFunction&);
bool acceptParameterDeclaration(TFunction&);

View File

@ -58,11 +58,10 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
const TString sourceEntryPointName,
bool forwardCompatible, EShMessages messages) :
TParseContextBase(symbolTable, interm, parsingBuiltins, version, profile, spvVersion, language, infoSink,
forwardCompatible, messages),
forwardCompatible, messages, &sourceEntryPointName),
annotationNestingLevel(0),
inputPatch(nullptr),
nextInLocation(0), nextOutLocation(0),
sourceEntryPointName(sourceEntryPointName),
entryPointFunction(nullptr),
entryPointFunctionBody(nullptr),
gsStreamOutput(nullptr),
@ -860,10 +859,8 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc,
bool flattened = false;
int indexValue = 0;
if (index->getQualifier().storage == EvqConst) {
if (index->getQualifier().isFrontEndConstant())
indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst();
checkIndex(loc, base->getType(), indexValue);
}
variableCheck(base);
if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) {
@ -872,9 +869,11 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc,
base->getAsSymbolNode()->getName().c_str(), "");
else
error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", "");
} else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst)
} else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst) {
// both base and index are front-end constants
checkIndex(loc, base->getType(), indexValue);
return intermediate.foldDereference(base, indexValue, loc);
else {
} else {
// at least one of base and index is variable...
if (base->getAsSymbolNode() && wasFlattened(base)) {
@ -884,9 +883,11 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc,
result = flattenAccess(base, indexValue);
flattened = (result != base);
} else {
if (index->getQualifier().storage == EvqConst) {
if (index->getQualifier().isFrontEndConstant()) {
if (base->getType().isImplicitlySizedArray())
updateImplicitArraySize(loc, base, indexValue);
else
checkIndex(loc, base->getType(), indexValue);
result = intermediate.addIndex(EOpIndexDirect, base, index, loc);
} else {
result = intermediate.addIndex(EOpIndexIndirect, base, index, loc);
@ -915,11 +916,6 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc,
return result;
}
void HlslParseContext::checkIndex(const TSourceLoc& /*loc*/, const TType& /*type*/, int& /*index*/)
{
// HLSL todo: any rules for index fixups?
}
// Handle seeing a binary node with a math operation.
TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op,
TIntermTyped* left, TIntermTyped* right)
@ -2000,6 +1996,11 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
TParameter& param = userFunction[i];
argVars.push_back(makeInternalVariable(*param.name, *param.type));
argVars.back()->getWritableType().getQualifier().makeTemporary();
// Track the input patch, which is the only non-builtin supported by hull shader PCF.
if (param.getDeclaredBuiltIn() == EbvInputPatch)
inputPatch = argVars.back();
TIntermSymbol* arg = intermediate.addSymbol(*argVars.back());
handleFunctionArgument(&callee, callingArgs, arg);
if (param.type->getQualifier().isParamInput()) {
@ -2040,7 +2041,10 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
TIntermTyped* element = intermediate.addIndex(EOpIndexIndirect, intermediate.addSymbol(*entryPointOutput),
invocationIdSym, loc);
element->setType(callReturn->getType());
// Set the type of the array element being dereferenced
const TType derefElementType(entryPointOutput->getType(), 0);
element->setType(derefElementType);
returnAssign = handleAssign(loc, EOpAssign, element, callReturn);
} else {
@ -2216,9 +2220,6 @@ void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& return
synthesizeEditedInput(paramType);
TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingIn);
inputs.push_back(argAsGlobal);
if (function[i].getDeclaredBuiltIn() == EbvInputPatch)
inputPatch = argAsGlobal;
}
if (paramType.getQualifier().isParamOutput()) {
TVariable* argAsGlobal = makeIoVariable(function[i].name->c_str(), paramType, EvqVaryingOut);
@ -2562,14 +2563,25 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
if (left->getAsOperator() && left->getAsOperator()->getOp() == EOpMatrixSwizzle)
return handleAssignToMatrixSwizzle(loc, op, left, right);
const bool isSplitLeft = wasSplit(left);
const bool isSplitRight = wasSplit(right);
// Return true if the given node is an index operation into a split variable.
const auto indexesSplit = [this](const TIntermTyped* node) -> bool {
const TIntermBinary* binaryNode = node->getAsBinaryNode();
if (binaryNode == nullptr)
return false;
return (binaryNode->getOp() == EOpIndexDirect || binaryNode->getOp() == EOpIndexIndirect) &&
wasSplit(binaryNode->getLeft());
};
const bool isSplitLeft = wasSplit(left) || indexesSplit(left);
const bool isSplitRight = wasSplit(right) || indexesSplit(right);
const bool isFlattenLeft = wasFlattened(left);
const bool isFlattenRight = wasFlattened(right);
// OK to do a single assign if both are split, or both are unsplit. But if one is and the other
// isn't, we fall back to a member-wise copy.
// OK to do a single assign if neither side is split or flattened. Otherwise,
// fall through to a member-wise copy.
if (!isFlattenLeft && !isFlattenRight && !isSplitLeft && !isSplitRight) {
// Clip and cull distance requires more processing. See comment above assignClipCullDistance.
if (isClipOrCullDistance(left->getType()) || isClipOrCullDistance(right->getType())) {
@ -2804,8 +2816,25 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
// If either left or right was a split structure, we must read or write it, but still have to
// parallel-recurse through the unsplit structure to identify the built-in IO vars.
if (isSplitLeft)
splitLeft = intermediate.addSymbol(*getSplitNonIoVar(left->getAsSymbolNode()->getId()), loc);
// The left can be either a symbol, or an index into a symbol (e.g, array reference)
if (isSplitLeft) {
if (indexesSplit(left)) {
// Index case: Refer to the indexed symbol, if the left is an index operator.
const TIntermSymbol* symNode = left->getAsBinaryNode()->getLeft()->getAsSymbolNode();
TIntermTyped* splitLeftNonIo = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc);
splitLeft = intermediate.addIndex(left->getAsBinaryNode()->getOp(), splitLeftNonIo,
left->getAsBinaryNode()->getRight(), loc);
const TType derefType(splitLeftNonIo->getType(), 0);
splitLeft->setType(derefType);
} else {
// Symbol case: otherwise, if not indexed, we have the symbol directly.
const TIntermSymbol* symNode = left->getAsSymbolNode();
splitLeft = intermediate.addSymbol(*getSplitNonIoVar(symNode->getId()), loc);
}
}
if (isSplitRight)
splitRight = intermediate.addSymbol(*getSplitNonIoVar(right->getAsSymbolNode()->getId()), loc);
@ -7778,12 +7807,13 @@ TIntermTyped* HlslParseContext::handleConstructor(const TSourceLoc& loc, TInterm
//
TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyped* node, const TType& type)
{
TIntermAggregate* aggrNode = node->getAsAggregate();
TOperator op = intermediate.mapTypeToConstructorOp(type);
// Combined texture-sampler constructors are completely semantic checked
// in constructorTextureSamplerError()
if (op == EOpConstructTextureSampler)
return intermediate.setAggregateOperator(node->getAsAggregate(), op, type, loc);
return intermediate.setAggregateOperator(aggrNode, op, type, loc);
TTypeList::const_iterator memberTypes;
if (op == EOpConstructStruct)
@ -7797,9 +7827,8 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
elementType.shallowCopy(type);
bool singleArg;
TIntermAggregate* aggrNode = node->getAsAggregate();
if (aggrNode != nullptr) {
if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1)
if (aggrNode->getOp() != EOpNull)
singleArg = true;
else
singleArg = false;
@ -7815,7 +7844,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
newNode = convertArray(node, type);
// If structure constructor or array constructor is being called
// for only one parameter inside the structure, we need to call constructAggregate function once.
// for only one parameter inside the aggregate, we need to call constructAggregate function once.
else if (type.isArray())
newNode = constructAggregate(node, elementType, 1, node->getLoc());
else if (op == EOpConstructStruct)
@ -7839,7 +7868,7 @@ TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermTyp
//
// Handle list of arguments.
//
TIntermSequence &sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor
TIntermSequence& sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor
// if the structure constructor contains more than one parameter, then construct
// each parameter
@ -8710,7 +8739,7 @@ void HlslParseContext::popNamespace()
// Use the class/struct nesting string to create a global name for
// a member of a class/struct.
void HlslParseContext::getFullNamespaceName(const TString*& name) const
void HlslParseContext::getFullNamespaceName(TString*& name) const
{
if (currentTypePrefix.size() == 0)
return;
@ -8726,15 +8755,6 @@ void HlslParseContext::addScopeMangler(TString& name)
name.append(scopeMangler);
}
// Potentially rename shader entry point function
void HlslParseContext::renameShaderFunction(const TString*& name) const
{
// Replace the entry point name given in the shader with the real entry point name,
// if there is a substitution.
if (name != nullptr && *name == sourceEntryPointName)
name = NewPoolTString(intermediate.getEntryPointName().c_str());
}
// Return true if this has uniform-interface like decorations.
bool HlslParseContext::hasUniform(const TQualifier& qualifier) const
{
@ -9045,19 +9065,12 @@ TIntermSymbol* HlslParseContext::findTessLinkageSymbol(TBuiltInVariable biType)
return intermediate.addSymbol(*it->second->getAsVariable());
}
// Finalization step: Add patch constant function invocation
void HlslParseContext::addPatchConstantInvocation()
// Find the patch constant function (issues error, returns nullptr if not found)
const TFunction* HlslParseContext::findPatchConstantFunction(const TSourceLoc& loc)
{
TSourceLoc loc;
loc.init();
// If there's no patch constant function, or we're not a HS, do nothing.
if (patchConstantFunctionName.empty() || language != EShLangTessControl)
return;
if (symbolTable.isFunctionNameVariable(patchConstantFunctionName)) {
error(loc, "can't use variable in patch constant function", patchConstantFunctionName.c_str(), "");
return;
return nullptr;
}
const TString mangledName = patchConstantFunctionName + "(";
@ -9071,7 +9084,7 @@ void HlslParseContext::addPatchConstantInvocation()
// allow any disambiguation of overloads.
if (candidateList.empty()) {
error(loc, "patch constant function not found", patchConstantFunctionName.c_str(), "");
return;
return nullptr;
}
// Based on directed experiments, it appears that if there are overloaded patchconstantfunctions,
@ -9079,9 +9092,22 @@ void HlslParseContext::addPatchConstantInvocation()
// out if there is more than one candidate.
if (candidateList.size() > 1) {
error(loc, "ambiguous patch constant function", patchConstantFunctionName.c_str(), "");
return;
return nullptr;
}
return candidateList[0];
}
// Finalization step: Add patch constant function invocation
void HlslParseContext::addPatchConstantInvocation()
{
TSourceLoc loc;
loc.init();
// If there's no patch constant function, or we're not a HS, do nothing.
if (patchConstantFunctionName.empty() || language != EShLangTessControl)
return;
// Look for built-in variables in a function's parameter list.
const auto findBuiltIns = [&](const TFunction& function, std::set<tInterstageIoData>& builtIns) {
for (int p=0; p<function.getParamCount(); ++p) {
@ -9118,7 +9144,7 @@ void HlslParseContext::addPatchConstantInvocation()
}
};
const auto isOutputPatch = [this](TFunction& patchConstantFunction, int param) {
const auto isOutputPatch = [](TFunction& patchConstantFunction, int param) {
const TType& type = *patchConstantFunction[param].type;
const TBuiltInVariable biType = patchConstantFunction[param].getDeclaredBuiltIn();
@ -9146,7 +9172,13 @@ void HlslParseContext::addPatchConstantInvocation()
//
// 5/5B. Call the PCF inside an if test for (invocation id == 0).
TFunction& patchConstantFunction = const_cast<TFunction&>(*candidateList[0]);
TFunction* patchConstantFunctionPtr = const_cast<TFunction*>(findPatchConstantFunction(loc));
if (patchConstantFunctionPtr == nullptr)
return;
TFunction& patchConstantFunction = *patchConstantFunctionPtr;
const int pcfParamCount = patchConstantFunction.getParamCount();
TIntermSymbol* invocationIdSym = findTessLinkageSymbol(EbvInvocationId);
TIntermSequence& epBodySeq = entryPointFunctionBody->getAsAggregate()->getSequence();
@ -9227,10 +9259,9 @@ void HlslParseContext::addPatchConstantInvocation()
// ================ Step 1B: Argument synthesis ================
// Create pcfArguments for synthesis of patchconstantfunction invocation
// TODO: handle struct or array inputs
{
for (int p=0; p<pcfParamCount; ++p) {
TIntermSymbol* inputArg = nullptr;
TIntermTyped* inputArg = nullptr;
if (p == outPatchParam) {
if (perCtrlPtVar == nullptr) {
@ -9244,6 +9275,11 @@ void HlslParseContext::addPatchConstantInvocation()
// find which built-in it is
const TBuiltInVariable biType = patchConstantFunction[p].getDeclaredBuiltIn();
if (biType == EbvInputPatch && inputPatch == nullptr) {
error(loc, "unimplemented: PCF input patch without entry point input patch parameter", "", "");
return;
}
inputArg = findTessLinkageSymbol(biType);
if (inputArg == nullptr) {

View File

@ -73,7 +73,6 @@ public:
TIntermTyped* handleVariable(const TSourceLoc&, const TString* string);
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
void checkIndex(const TSourceLoc&, const TType&, int& index);
TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode);
@ -182,7 +181,7 @@ public:
void pushNamespace(const TString& name);
void popNamespace();
void getFullNamespaceName(const TString*&) const;
void getFullNamespaceName(TString*&) const;
void addScopeMangler(TString&);
void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); }
@ -207,9 +206,6 @@ public:
// Determine loop control from attributes
TLoopControl handleLoopControl(const TAttributeMap& attributes) const;
// Potentially rename shader entry point function
void renameShaderFunction(const TString*& name) const;
// Share struct buffer deep types
void shareStructBufferType(TType&);
@ -319,6 +315,9 @@ protected:
static bool isClipOrCullDistance(const TQualifier& qual) { return isClipOrCullDistance(qual.builtIn); }
static bool isClipOrCullDistance(const TType& type) { return isClipOrCullDistance(type.getQualifier()); }
// Find the patch constant function (issues error, returns nullptr if not found)
const TFunction* findPatchConstantFunction(const TSourceLoc& loc);
// Pass through to base class after remembering built-in mappings.
using TParseContextBase::trackLinkage;
void trackLinkage(TSymbol& variable) override;
@ -418,12 +417,12 @@ protected:
};
TMap<tInterstageIoData, TVariable*> splitBuiltIns; // split built-ins, indexed by built-in type.
TVariable* inputPatch;
TVariable* inputPatch; // input patch is special for PCF: it's the only non-builtin PCF input,
// and is handled as a pseudo-builtin.
unsigned int nextInLocation;
unsigned int nextOutLocation;
TString sourceEntryPointName;
TFunction* entryPointFunction;
TIntermNode* entryPointFunctionBody;