Updated glslang.

This commit is contained in:
Бранимир Караџић
2019-07-03 07:55:05 -07:00
parent 722868d07c
commit 77b85e5550
34 changed files with 4424 additions and 3812 deletions

View File

@@ -148,6 +148,7 @@ source_set("glslang_sources") {
"-Wno-inconsistent-missing-override",
"-Wno-sign-compare",
"-Wno-unused-variable",
"-Wno-missing-field-initializers",
]
}
if (is_win && !is_clang) {
@@ -186,3 +187,13 @@ executable("glslang_validator") {
":glslang_sources",
]
}
executable("spirv-remap") {
sources = [
"StandAlone/spirv-remap.cpp",
]
defines = [ "ENABLE_OPT=1" ]
deps = [
":glslang_sources",
]
}

View File

@@ -34,5 +34,6 @@ static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shade
static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer";
static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered";
static const char* const E_SPV_EXT_fragment_invocation_density = "SPV_EXT_fragment_invocation_density";
static const char* const E_SPV_EXT_demote_to_helper_invocation = "SPV_EXT_demote_to_helper_invocation";
#endif // #ifndef GLSLextEXT_H

View File

@@ -3111,6 +3111,12 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
builder.clearAccessChain();
break;
case glslang::EOpDemote:
builder.createNoResultOp(spv::OpDemoteToHelperInvocationEXT);
builder.addExtension(spv::E_SPV_EXT_demote_to_helper_invocation);
builder.addCapability(spv::CapabilityDemoteToHelperInvocationEXT);
break;
default:
assert(0);
break;
@@ -7610,6 +7616,13 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createNoResultOp(spv::OpEndInvocationInterlockEXT);
return 0;
case glslang::EOpIsHelperInvocation:
{
std::vector<spv::Id> args; // Dummy arguments
spv::Id id = builder.createOp(spv::OpIsHelperInvocationEXT, typeId, args);
return id;
}
default:
logger->missingFunctionality("unknown operation with no arguments");
return 0;

View File

@@ -195,7 +195,7 @@ private:
// Header access & set methods
spirword_t magic() const { return spv[0]; } // return magic number
spirword_t bound() const { return spv[3]; } // return Id bound from header
spirword_t bound(spirword_t b) { return spv[3] = b; };
spirword_t bound(spirword_t b) { return spv[3] = b; }
spirword_t genmagic() const { return spv[2]; } // generator magic
spirword_t genmagic(spirword_t m) { return spv[2] = m; }
spirword_t schemaNum() const { return spv[4]; } // schema number from header

View File

@@ -958,6 +958,8 @@ const char* CapabilityString(int info)
case CapabilityFragmentShaderPixelInterlockEXT: return "CapabilityFragmentShaderPixelInterlockEXT";
case CapabilityFragmentShaderShadingRateInterlockEXT: return "CapabilityFragmentShaderShadingRateInterlockEXT";
case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT";
default: return "Bad";
}
}
@@ -1367,6 +1369,8 @@ const char* OpcodeString(int op)
case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
case OpCooperativeMatrixMulAddNV: return "OpCooperativeMatrixMulAddNV";
case OpCooperativeMatrixLengthNV: return "OpCooperativeMatrixLengthNV";
case OpDemoteToHelperInvocationEXT: return "OpDemoteToHelperInvocationEXT";
case OpIsHelperInvocationEXT: return "OpIsHelperInvocationEXT";
case OpBeginInvocationInterlockEXT: return "OpBeginInvocationInterlockEXT";
case OpEndInvocationInterlockEXT: return "OpEndInvocationInterlockEXT";
@@ -2784,6 +2788,8 @@ void Parameterize()
InstructionDesc[OpCooperativeMatrixMulAddNV].operands.push(OperandId, "'C'");
InstructionDesc[OpCooperativeMatrixLengthNV].operands.push(OperandId, "'Type'");
InstructionDesc[OpDemoteToHelperInvocationEXT].setResultAndType(false, false);
}
}; // end spv namespace

View File

@@ -455,6 +455,7 @@ enum Decoration {
DecorationHlslCounterBufferGOOGLE = 5634,
DecorationHlslSemanticGOOGLE = 5635,
DecorationUserSemantic = 5635,
DecorationUserTypeGOOGLE = 5636,
DecorationMax = 0x7fffffff,
};
@@ -632,7 +633,7 @@ enum MemorySemanticsShift {
MemorySemanticsOutputMemoryKHRShift = 12,
MemorySemanticsMakeAvailableKHRShift = 13,
MemorySemanticsMakeVisibleKHRShift = 14,
MemorySemanticsVolatileShift = 15,
MemorySemanticsVolatileShift = 15,
MemorySemanticsMax = 0x7fffffff,
};
@@ -650,8 +651,8 @@ enum MemorySemanticsMask {
MemorySemanticsImageMemoryMask = 0x00000800,
MemorySemanticsOutputMemoryKHRMask = 0x00001000,
MemorySemanticsMakeAvailableKHRMask = 0x00002000,
MemorySemanticsMakeVisibleKHRMask = 0x00004000,
MemorySemanticsVolatileMask = 0x00008000,
MemorySemanticsMakeVisibleKHRMask = 0x00004000,
MemorySemanticsVolatileMask = 0x00008000,
};
enum MemoryAccessShift {
@@ -845,6 +846,7 @@ enum Capability {
CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
CapabilityShaderSMBuiltinsNV = 5373,
CapabilityFragmentShaderPixelInterlockEXT = 5378,
CapabilityDemoteToHelperInvocationEXT = 5379,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1233,6 +1235,8 @@ enum Op {
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@@ -1907,6 +1911,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break;
case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */

View File

@@ -436,6 +436,6 @@ __inline void Block::addInstruction(std::unique_ptr<Instruction> inst)
parent.getParent().mapInstruction(raw_instruction);
}
}; // end spv namespace
} // end spv namespace
#endif // spvIR_H

View File

@@ -772,8 +772,17 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
Error("must provide -S when --stdin is given");
// Make sure that -E is not specified alongside linking (which includes SPV generation)
if ((Options & EOptionOutputPreprocessed) && (Options & EOptionLinkProgram))
Error("can't use -E when linking is selected");
// Or things that require linking
if (Options & EOptionOutputPreprocessed) {
if (Options & EOptionLinkProgram)
Error("can't use -E when linking is selected");
if (Options & EOptionDumpReflection)
Error("reflection requires linking, which can't be used when -E when is selected");
}
// reflection requires linking
if ((Options & EOptionDumpReflection) && !(Options & EOptionLinkProgram))
Error("reflection requires -l for linking");
// -o or -x makes no sense if there is no target binary
if (binaryFileName && (Options & EOptionSpv) == 0)
@@ -1512,7 +1521,7 @@ void usage()
" -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"
" -q dump reflection query database\n"
" -q dump reflection query database; requires -l for linking\n"
" -r | --relaxed-errors"
" relaxed GLSL semantic error-checking mode\n"
" -s silence syntax and semantic error reporting\n"

View File

@@ -227,7 +227,7 @@ namespace {
}
}
else if (arg == "--version" || arg == "-V") {
std::cout << basename(argv[0]) << " version 0.97 " << __DATE__ << " " << __TIME__ << std::endl;
std::cout << basename(argv[0]) << " version 0.97" << std::endl;
exit(0);
} else if (arg == "--input" || arg == "-i") {
// Collect input files

View File

@@ -9,17 +9,17 @@ local_size = (1, 1, 1)
0:? 'bool_init' ( const bool)
0:? true (const bool)
0:? 'int8_t_init' ( const int8_t)
0:? -1 (const int)
0:? -1 (const int8_t)
0:? 'int16_t_init' ( const int16_t)
0:? -2 (const int)
0:? -2 (const int16_t)
0:? 'int32_t_init' ( const int)
0:? -3 (const int)
0:? 'int64_t_init' ( const int64_t)
0:? -4 (const int64_t)
0:? 'uint8_t_init' ( const uint8_t)
0:? 1 (const int)
0:? 1 (const uint8_t)
0:? 'uint16_t_init' ( const uint16_t)
0:? 2 (const int)
0:? 2 (const uint16_t)
0:? 'uint32_t_init' ( const uint)
0:? 3 (const uint)
0:? 'uint64_t_init' ( const uint64_t)
@@ -33,17 +33,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_bool' ( const bool)
0:? true (const bool)
0:? 'int8_t_to_bool' ( const bool)
0:? -1 (const int)
0:? true (const bool)
0:? 'int16_t_to_bool' ( const bool)
0:? -2 (const int)
0:? true (const bool)
0:? 'int32_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'int64_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'uint8_t_to_bool' ( const bool)
0:? 1 (const int)
0:? true (const bool)
0:? 'uint16_t_to_bool' ( const bool)
0:? 2 (const int)
0:? true (const bool)
0:? 'uint32_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'uint64_t_to_bool' ( const bool)
@@ -55,53 +55,53 @@ local_size = (1, 1, 1)
0:? 'float64_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'bool_to_int8_t' ( const int8_t)
0:? true (const bool)
0:? 1 (const int8_t)
0:? 'int8_t_to_int8_t' ( const int8_t)
0:? -1 (const int)
0:? -1 (const int8_t)
0:? 'int16_t_to_int8_t' ( const int8_t)
0:? -2 (const int)
0:? -2 (const int8_t)
0:? 'int32_t_to_int8_t' ( const int8_t)
0:? -3 (const int)
0:? -3 (const int8_t)
0:? 'int64_t_to_int8_t' ( const int8_t)
0:? -4 (const int64_t)
0:? -4 (const int8_t)
0:? 'uint8_t_to_int8_t' ( const int8_t)
0:? 1 (const int)
0:? 1 (const int8_t)
0:? 'uint16_t_to_int8_t' ( const int8_t)
0:? 2 (const int)
0:? 2 (const int8_t)
0:? 'uint32_t_to_int8_t' ( const int8_t)
0:? 3 (const uint)
0:? 3 (const int8_t)
0:? 'uint64_t_to_int8_t' ( const int8_t)
0:? 4 (const uint64_t)
0:? 4 (const int8_t)
0:? 'float16_t_to_int8_t' ( const int8_t)
0:? 42.000000
0:? 42 (const int8_t)
0:? 'float32_t_to_int8_t' ( const int8_t)
0:? 13.000000
0:? 13 (const int8_t)
0:? 'float64_t_to_int8_t' ( const int8_t)
0:? -4.000000
0:? -4 (const int8_t)
0:? 'bool_to_int16_t' ( const int16_t)
0:? true (const bool)
0:? 1 (const int16_t)
0:? 'int8_t_to_int16_t' ( const int16_t)
0:? -1 (const int)
0:? -1 (const int16_t)
0:? 'int16_t_to_int16_t' ( const int16_t)
0:? -2 (const int)
0:? -2 (const int16_t)
0:? 'int32_t_to_int16_t' ( const int16_t)
0:? -3 (const int)
0:? -3 (const int16_t)
0:? 'int64_t_to_int16_t' ( const int16_t)
0:? -4 (const int64_t)
0:? -4 (const int16_t)
0:? 'uint8_t_to_int16_t' ( const int16_t)
0:? 1 (const int)
0:? 1 (const int16_t)
0:? 'uint16_t_to_int16_t' ( const int16_t)
0:? 2 (const int)
0:? 2 (const int16_t)
0:? 'uint32_t_to_int16_t' ( const int16_t)
0:? 3 (const uint)
0:? 3 (const int16_t)
0:? 'uint64_t_to_int16_t' ( const int16_t)
0:? 4 (const uint64_t)
0:? 4 (const int16_t)
0:? 'float16_t_to_int16_t' ( const int16_t)
0:? 42.000000
0:? 42 (const int16_t)
0:? 'float32_t_to_int16_t' ( const int16_t)
0:? 13.000000
0:? 13 (const int16_t)
0:? 'float64_t_to_int16_t' ( const int16_t)
0:? -4.000000
0:? -4 (const int16_t)
0:? 'bool_to_int32_t' ( const int)
0:? 1 (const int)
0:? 'int8_t_to_int32_t' ( const int)
@@ -129,17 +129,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_int64_t' ( const int64_t)
0:? 1 (const int64_t)
0:? 'int8_t_to_int64_t' ( const int64_t)
0:? -1 (const int)
0:? -1 (const int64_t)
0:? 'int16_t_to_int64_t' ( const int64_t)
0:? -2 (const int)
0:? -2 (const int64_t)
0:? 'int32_t_to_int64_t' ( const int64_t)
0:? -3 (const int64_t)
0:? 'int64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 'uint8_t_to_int64_t' ( const int64_t)
0:? 1 (const int)
0:? 1 (const int64_t)
0:? 'uint16_t_to_int64_t' ( const int64_t)
0:? 2 (const int)
0:? 2 (const int64_t)
0:? 'uint32_t_to_int64_t' ( const int64_t)
0:? 3 (const int64_t)
0:? 'uint64_t_to_int64_t' ( const int64_t)
@@ -151,67 +151,67 @@ local_size = (1, 1, 1)
0:? 'float64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 'bool_to_uint8_t' ( const uint8_t)
0:? true (const bool)
0:? 1 (const uint8_t)
0:? 'int8_t_to_uint8_t' ( const uint8_t)
0:? -1 (const int)
0:? 255 (const uint8_t)
0:? 'int16_t_to_uint8_t' ( const uint8_t)
0:? -2 (const int)
0:? 254 (const uint8_t)
0:? 'int32_t_to_uint8_t' ( const uint8_t)
0:? -3 (const int)
0:? 253 (const uint8_t)
0:? 'int64_t_to_uint8_t' ( const uint8_t)
0:? -4 (const int64_t)
0:? 252 (const uint8_t)
0:? 'uint8_t_to_uint8_t' ( const uint8_t)
0:? 1 (const int)
0:? 1 (const uint8_t)
0:? 'uint16_t_to_uint8_t' ( const uint8_t)
0:? 2 (const int)
0:? 2 (const uint8_t)
0:? 'uint32_t_to_uint8_t' ( const uint8_t)
0:? 3 (const uint)
0:? 3 (const uint8_t)
0:? 'uint64_t_to_uint8_t' ( const uint8_t)
0:? 4 (const uint64_t)
0:? 4 (const uint8_t)
0:? 'float16_t_to_uint8_t' ( const uint8_t)
0:? 42.000000
0:? 42 (const uint8_t)
0:? 'float32_t_to_uint8_t' ( const uint8_t)
0:? 13.000000
0:? 13 (const uint8_t)
0:? 'float64_t_to_uint8_t' ( const uint8_t)
0:? -4.000000
0:? 252 (const uint8_t)
0:? 'bool_to_uint16_t' ( const uint16_t)
0:? true (const bool)
0:? 1 (const uint16_t)
0:? 'int8_t_to_uint16_t' ( const uint16_t)
0:? -1 (const int)
0:? 65535 (const uint16_t)
0:? 'int16_t_to_uint16_t' ( const uint16_t)
0:? -2 (const int)
0:? 65534 (const uint16_t)
0:? 'int32_t_to_uint16_t' ( const uint16_t)
0:? -3 (const int)
0:? 65533 (const uint16_t)
0:? 'int64_t_to_uint16_t' ( const uint16_t)
0:? -4 (const int64_t)
0:? 65532 (const uint16_t)
0:? 'uint8_t_to_uint16_t' ( const uint16_t)
0:? 1 (const int)
0:? 1 (const uint16_t)
0:? 'uint16_t_to_uint16_t' ( const uint16_t)
0:? 2 (const int)
0:? 2 (const uint16_t)
0:? 'uint32_t_to_uint16_t' ( const uint16_t)
0:? 3 (const uint)
0:? 3 (const uint16_t)
0:? 'uint64_t_to_uint16_t' ( const uint16_t)
0:? 4 (const uint64_t)
0:? 4 (const uint16_t)
0:? 'float16_t_to_uint16_t' ( const uint16_t)
0:? 42.000000
0:? 42 (const uint16_t)
0:? 'float32_t_to_uint16_t' ( const uint16_t)
0:? 13.000000
0:? 13 (const uint16_t)
0:? 'float64_t_to_uint16_t' ( const uint16_t)
0:? -4.000000
0:? 65532 (const uint16_t)
0:? 'bool_to_uint32_t' ( const uint)
0:? 1 (const uint)
0:? 'int8_t_to_uint32_t' ( const uint)
0:? -1 (const int)
0:? 4294967295 (const uint)
0:? 'int16_t_to_uint32_t' ( const uint)
0:? -2 (const int)
0:? 4294967294 (const uint)
0:? 'int32_t_to_uint32_t' ( const uint)
0:? 4294967293 (const uint)
0:? 'int64_t_to_uint32_t' ( const uint)
0:? 4294967292 (const uint)
0:? 'uint8_t_to_uint32_t' ( const uint)
0:? 1 (const int)
0:? 1 (const uint)
0:? 'uint16_t_to_uint32_t' ( const uint)
0:? 2 (const int)
0:? 2 (const uint)
0:? 'uint32_t_to_uint32_t' ( const uint)
0:? 3 (const uint)
0:? 'uint64_t_to_uint32_t' ( const uint)
@@ -225,17 +225,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_uint64_t' ( const uint64_t)
0:? 1 (const uint64_t)
0:? 'int8_t_to_uint64_t' ( const uint64_t)
0:? -1 (const int)
0:? 18446744073709551615 (const uint64_t)
0:? 'int16_t_to_uint64_t' ( const uint64_t)
0:? -2 (const int)
0:? 18446744073709551614 (const uint64_t)
0:? 'int32_t_to_uint64_t' ( const uint64_t)
0:? 18446744073709551613 (const uint64_t)
0:? 'int64_t_to_uint64_t' ( const uint64_t)
0:? 18446744073709551612 (const uint64_t)
0:? 'uint8_t_to_uint64_t' ( const uint64_t)
0:? 1 (const int)
0:? 1 (const uint64_t)
0:? 'uint16_t_to_uint64_t' ( const uint64_t)
0:? 2 (const int)
0:? 2 (const uint64_t)
0:? 'uint32_t_to_uint64_t' ( const uint64_t)
0:? 3 (const uint64_t)
0:? 'uint64_t_to_uint64_t' ( const uint64_t)
@@ -249,17 +249,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_float16_t' ( const float16_t)
0:? 1.000000
0:? 'int8_t_to_float16_t' ( const float16_t)
0:? -1 (const int)
0:? -1.000000
0:? 'int16_t_to_float16_t' ( const float16_t)
0:? -2 (const int)
0:? -2.000000
0:? 'int32_t_to_float16_t' ( const float16_t)
0:? -3.000000
0:? 'int64_t_to_float16_t' ( const float16_t)
0:? -4.000000
0:? 'uint8_t_to_float16_t' ( const float16_t)
0:? 1 (const int)
0:? 1.000000
0:? 'uint16_t_to_float16_t' ( const float16_t)
0:? 2 (const int)
0:? 2.000000
0:? 'uint32_t_to_float16_t' ( const float16_t)
0:? 3.000000
0:? 'uint64_t_to_float16_t' ( const float16_t)
@@ -273,17 +273,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_float32_t' ( const float)
0:? 1.000000
0:? 'int8_t_to_float32_t' ( const float)
0:? -1 (const int)
0:? -1.000000
0:? 'int16_t_to_float32_t' ( const float)
0:? -2 (const int)
0:? -2.000000
0:? 'int32_t_to_float32_t' ( const float)
0:? -3.000000
0:? 'int64_t_to_float32_t' ( const float)
0:? -4.000000
0:? 'uint8_t_to_float32_t' ( const float)
0:? 1 (const int)
0:? 1.000000
0:? 'uint16_t_to_float32_t' ( const float)
0:? 2 (const int)
0:? 2.000000
0:? 'uint32_t_to_float32_t' ( const float)
0:? 3.000000
0:? 'uint64_t_to_float32_t' ( const float)
@@ -297,17 +297,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_float64_t' ( const double)
0:? 1.000000
0:? 'int8_t_to_float64_t' ( const double)
0:? -1 (const int)
0:? -1.000000
0:? 'int16_t_to_float64_t' ( const double)
0:? -2 (const int)
0:? -2.000000
0:? 'int32_t_to_float64_t' ( const double)
0:? -3.000000
0:? 'int64_t_to_float64_t' ( const double)
0:? -4.000000
0:? 'uint8_t_to_float64_t' ( const double)
0:? 1 (const int)
0:? 1.000000
0:? 'uint16_t_to_float64_t' ( const double)
0:? 2 (const int)
0:? 2.000000
0:? 'uint32_t_to_float64_t' ( const double)
0:? 3.000000
0:? 'uint64_t_to_float64_t' ( const double)
@@ -333,17 +333,17 @@ local_size = (1, 1, 1)
0:? 'bool_init' ( const bool)
0:? true (const bool)
0:? 'int8_t_init' ( const int8_t)
0:? -1 (const int)
0:? -1 (const int8_t)
0:? 'int16_t_init' ( const int16_t)
0:? -2 (const int)
0:? -2 (const int16_t)
0:? 'int32_t_init' ( const int)
0:? -3 (const int)
0:? 'int64_t_init' ( const int64_t)
0:? -4 (const int64_t)
0:? 'uint8_t_init' ( const uint8_t)
0:? 1 (const int)
0:? 1 (const uint8_t)
0:? 'uint16_t_init' ( const uint16_t)
0:? 2 (const int)
0:? 2 (const uint16_t)
0:? 'uint32_t_init' ( const uint)
0:? 3 (const uint)
0:? 'uint64_t_init' ( const uint64_t)
@@ -357,17 +357,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_bool' ( const bool)
0:? true (const bool)
0:? 'int8_t_to_bool' ( const bool)
0:? -1 (const int)
0:? true (const bool)
0:? 'int16_t_to_bool' ( const bool)
0:? -2 (const int)
0:? true (const bool)
0:? 'int32_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'int64_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'uint8_t_to_bool' ( const bool)
0:? 1 (const int)
0:? true (const bool)
0:? 'uint16_t_to_bool' ( const bool)
0:? 2 (const int)
0:? true (const bool)
0:? 'uint32_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'uint64_t_to_bool' ( const bool)
@@ -379,53 +379,53 @@ local_size = (1, 1, 1)
0:? 'float64_t_to_bool' ( const bool)
0:? true (const bool)
0:? 'bool_to_int8_t' ( const int8_t)
0:? true (const bool)
0:? 1 (const int8_t)
0:? 'int8_t_to_int8_t' ( const int8_t)
0:? -1 (const int)
0:? -1 (const int8_t)
0:? 'int16_t_to_int8_t' ( const int8_t)
0:? -2 (const int)
0:? -2 (const int8_t)
0:? 'int32_t_to_int8_t' ( const int8_t)
0:? -3 (const int)
0:? -3 (const int8_t)
0:? 'int64_t_to_int8_t' ( const int8_t)
0:? -4 (const int64_t)
0:? -4 (const int8_t)
0:? 'uint8_t_to_int8_t' ( const int8_t)
0:? 1 (const int)
0:? 1 (const int8_t)
0:? 'uint16_t_to_int8_t' ( const int8_t)
0:? 2 (const int)
0:? 2 (const int8_t)
0:? 'uint32_t_to_int8_t' ( const int8_t)
0:? 3 (const uint)
0:? 3 (const int8_t)
0:? 'uint64_t_to_int8_t' ( const int8_t)
0:? 4 (const uint64_t)
0:? 4 (const int8_t)
0:? 'float16_t_to_int8_t' ( const int8_t)
0:? 42.000000
0:? 42 (const int8_t)
0:? 'float32_t_to_int8_t' ( const int8_t)
0:? 13.000000
0:? 13 (const int8_t)
0:? 'float64_t_to_int8_t' ( const int8_t)
0:? -4.000000
0:? -4 (const int8_t)
0:? 'bool_to_int16_t' ( const int16_t)
0:? true (const bool)
0:? 1 (const int16_t)
0:? 'int8_t_to_int16_t' ( const int16_t)
0:? -1 (const int)
0:? -1 (const int16_t)
0:? 'int16_t_to_int16_t' ( const int16_t)
0:? -2 (const int)
0:? -2 (const int16_t)
0:? 'int32_t_to_int16_t' ( const int16_t)
0:? -3 (const int)
0:? -3 (const int16_t)
0:? 'int64_t_to_int16_t' ( const int16_t)
0:? -4 (const int64_t)
0:? -4 (const int16_t)
0:? 'uint8_t_to_int16_t' ( const int16_t)
0:? 1 (const int)
0:? 1 (const int16_t)
0:? 'uint16_t_to_int16_t' ( const int16_t)
0:? 2 (const int)
0:? 2 (const int16_t)
0:? 'uint32_t_to_int16_t' ( const int16_t)
0:? 3 (const uint)
0:? 3 (const int16_t)
0:? 'uint64_t_to_int16_t' ( const int16_t)
0:? 4 (const uint64_t)
0:? 4 (const int16_t)
0:? 'float16_t_to_int16_t' ( const int16_t)
0:? 42.000000
0:? 42 (const int16_t)
0:? 'float32_t_to_int16_t' ( const int16_t)
0:? 13.000000
0:? 13 (const int16_t)
0:? 'float64_t_to_int16_t' ( const int16_t)
0:? -4.000000
0:? -4 (const int16_t)
0:? 'bool_to_int32_t' ( const int)
0:? 1 (const int)
0:? 'int8_t_to_int32_t' ( const int)
@@ -453,17 +453,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_int64_t' ( const int64_t)
0:? 1 (const int64_t)
0:? 'int8_t_to_int64_t' ( const int64_t)
0:? -1 (const int)
0:? -1 (const int64_t)
0:? 'int16_t_to_int64_t' ( const int64_t)
0:? -2 (const int)
0:? -2 (const int64_t)
0:? 'int32_t_to_int64_t' ( const int64_t)
0:? -3 (const int64_t)
0:? 'int64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 'uint8_t_to_int64_t' ( const int64_t)
0:? 1 (const int)
0:? 1 (const int64_t)
0:? 'uint16_t_to_int64_t' ( const int64_t)
0:? 2 (const int)
0:? 2 (const int64_t)
0:? 'uint32_t_to_int64_t' ( const int64_t)
0:? 3 (const int64_t)
0:? 'uint64_t_to_int64_t' ( const int64_t)
@@ -475,67 +475,67 @@ local_size = (1, 1, 1)
0:? 'float64_t_to_int64_t' ( const int64_t)
0:? -4 (const int64_t)
0:? 'bool_to_uint8_t' ( const uint8_t)
0:? true (const bool)
0:? 1 (const uint8_t)
0:? 'int8_t_to_uint8_t' ( const uint8_t)
0:? -1 (const int)
0:? 255 (const uint8_t)
0:? 'int16_t_to_uint8_t' ( const uint8_t)
0:? -2 (const int)
0:? 254 (const uint8_t)
0:? 'int32_t_to_uint8_t' ( const uint8_t)
0:? -3 (const int)
0:? 253 (const uint8_t)
0:? 'int64_t_to_uint8_t' ( const uint8_t)
0:? -4 (const int64_t)
0:? 252 (const uint8_t)
0:? 'uint8_t_to_uint8_t' ( const uint8_t)
0:? 1 (const int)
0:? 1 (const uint8_t)
0:? 'uint16_t_to_uint8_t' ( const uint8_t)
0:? 2 (const int)
0:? 2 (const uint8_t)
0:? 'uint32_t_to_uint8_t' ( const uint8_t)
0:? 3 (const uint)
0:? 3 (const uint8_t)
0:? 'uint64_t_to_uint8_t' ( const uint8_t)
0:? 4 (const uint64_t)
0:? 4 (const uint8_t)
0:? 'float16_t_to_uint8_t' ( const uint8_t)
0:? 42.000000
0:? 42 (const uint8_t)
0:? 'float32_t_to_uint8_t' ( const uint8_t)
0:? 13.000000
0:? 13 (const uint8_t)
0:? 'float64_t_to_uint8_t' ( const uint8_t)
0:? -4.000000
0:? 252 (const uint8_t)
0:? 'bool_to_uint16_t' ( const uint16_t)
0:? true (const bool)
0:? 1 (const uint16_t)
0:? 'int8_t_to_uint16_t' ( const uint16_t)
0:? -1 (const int)
0:? 65535 (const uint16_t)
0:? 'int16_t_to_uint16_t' ( const uint16_t)
0:? -2 (const int)
0:? 65534 (const uint16_t)
0:? 'int32_t_to_uint16_t' ( const uint16_t)
0:? -3 (const int)
0:? 65533 (const uint16_t)
0:? 'int64_t_to_uint16_t' ( const uint16_t)
0:? -4 (const int64_t)
0:? 65532 (const uint16_t)
0:? 'uint8_t_to_uint16_t' ( const uint16_t)
0:? 1 (const int)
0:? 1 (const uint16_t)
0:? 'uint16_t_to_uint16_t' ( const uint16_t)
0:? 2 (const int)
0:? 2 (const uint16_t)
0:? 'uint32_t_to_uint16_t' ( const uint16_t)
0:? 3 (const uint)
0:? 3 (const uint16_t)
0:? 'uint64_t_to_uint16_t' ( const uint16_t)
0:? 4 (const uint64_t)
0:? 4 (const uint16_t)
0:? 'float16_t_to_uint16_t' ( const uint16_t)
0:? 42.000000
0:? 42 (const uint16_t)
0:? 'float32_t_to_uint16_t' ( const uint16_t)
0:? 13.000000
0:? 13 (const uint16_t)
0:? 'float64_t_to_uint16_t' ( const uint16_t)
0:? -4.000000
0:? 65532 (const uint16_t)
0:? 'bool_to_uint32_t' ( const uint)
0:? 1 (const uint)
0:? 'int8_t_to_uint32_t' ( const uint)
0:? -1 (const int)
0:? 4294967295 (const uint)
0:? 'int16_t_to_uint32_t' ( const uint)
0:? -2 (const int)
0:? 4294967294 (const uint)
0:? 'int32_t_to_uint32_t' ( const uint)
0:? 4294967293 (const uint)
0:? 'int64_t_to_uint32_t' ( const uint)
0:? 4294967292 (const uint)
0:? 'uint8_t_to_uint32_t' ( const uint)
0:? 1 (const int)
0:? 1 (const uint)
0:? 'uint16_t_to_uint32_t' ( const uint)
0:? 2 (const int)
0:? 2 (const uint)
0:? 'uint32_t_to_uint32_t' ( const uint)
0:? 3 (const uint)
0:? 'uint64_t_to_uint32_t' ( const uint)
@@ -549,17 +549,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_uint64_t' ( const uint64_t)
0:? 1 (const uint64_t)
0:? 'int8_t_to_uint64_t' ( const uint64_t)
0:? -1 (const int)
0:? 18446744073709551615 (const uint64_t)
0:? 'int16_t_to_uint64_t' ( const uint64_t)
0:? -2 (const int)
0:? 18446744073709551614 (const uint64_t)
0:? 'int32_t_to_uint64_t' ( const uint64_t)
0:? 18446744073709551613 (const uint64_t)
0:? 'int64_t_to_uint64_t' ( const uint64_t)
0:? 18446744073709551612 (const uint64_t)
0:? 'uint8_t_to_uint64_t' ( const uint64_t)
0:? 1 (const int)
0:? 1 (const uint64_t)
0:? 'uint16_t_to_uint64_t' ( const uint64_t)
0:? 2 (const int)
0:? 2 (const uint64_t)
0:? 'uint32_t_to_uint64_t' ( const uint64_t)
0:? 3 (const uint64_t)
0:? 'uint64_t_to_uint64_t' ( const uint64_t)
@@ -573,17 +573,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_float16_t' ( const float16_t)
0:? 1.000000
0:? 'int8_t_to_float16_t' ( const float16_t)
0:? -1 (const int)
0:? -1.000000
0:? 'int16_t_to_float16_t' ( const float16_t)
0:? -2 (const int)
0:? -2.000000
0:? 'int32_t_to_float16_t' ( const float16_t)
0:? -3.000000
0:? 'int64_t_to_float16_t' ( const float16_t)
0:? -4.000000
0:? 'uint8_t_to_float16_t' ( const float16_t)
0:? 1 (const int)
0:? 1.000000
0:? 'uint16_t_to_float16_t' ( const float16_t)
0:? 2 (const int)
0:? 2.000000
0:? 'uint32_t_to_float16_t' ( const float16_t)
0:? 3.000000
0:? 'uint64_t_to_float16_t' ( const float16_t)
@@ -597,17 +597,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_float32_t' ( const float)
0:? 1.000000
0:? 'int8_t_to_float32_t' ( const float)
0:? -1 (const int)
0:? -1.000000
0:? 'int16_t_to_float32_t' ( const float)
0:? -2 (const int)
0:? -2.000000
0:? 'int32_t_to_float32_t' ( const float)
0:? -3.000000
0:? 'int64_t_to_float32_t' ( const float)
0:? -4.000000
0:? 'uint8_t_to_float32_t' ( const float)
0:? 1 (const int)
0:? 1.000000
0:? 'uint16_t_to_float32_t' ( const float)
0:? 2 (const int)
0:? 2.000000
0:? 'uint32_t_to_float32_t' ( const float)
0:? 3.000000
0:? 'uint64_t_to_float32_t' ( const float)
@@ -621,17 +621,17 @@ local_size = (1, 1, 1)
0:? 'bool_to_float64_t' ( const double)
0:? 1.000000
0:? 'int8_t_to_float64_t' ( const double)
0:? -1 (const int)
0:? -1.000000
0:? 'int16_t_to_float64_t' ( const double)
0:? -2 (const int)
0:? -2.000000
0:? 'int32_t_to_float64_t' ( const double)
0:? -3.000000
0:? 'int64_t_to_float64_t' ( const double)
0:? -4.000000
0:? 'uint8_t_to_float64_t' ( const double)
0:? 1 (const int)
0:? 1.000000
0:? 'uint16_t_to_float64_t' ( const double)
0:? 2 (const int)
0:? 2.000000
0:? 'uint32_t_to_float64_t' ( const double)
0:? 3.000000
0:? 'uint64_t_to_float64_t' ( const double)

View File

@@ -0,0 +1,230 @@
hlsl.specConstant.frag
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:6 Function Definition: @main( ( temp 4-component vector of float)
0:6 Function Parameters:
0:? Sequence
0:8 Sequence
0:8 move second child to first child ( temp uint)
0:8 'i' ( temp uint)
0:8 Constant:
0:8 0 (const uint)
0:8 Loop with condition tested first
0:8 Loop Condition
0:8 Compare Less Than ( temp bool)
0:8 'i' ( temp uint)
0:8 indirect index ( const uint)
0:8 Constant:
0:8 10 (const uint)
0:8 20 (const uint)
0:8 30 (const uint)
0:8 40 (const uint)
0:8 'index' ( specialization-constant const uint)
0:8 2 (const uint)
0:8 Loop Body
0:9 move second child to first child ( temp 4-component vector of float)
0:9 'r' ( temp 4-component vector of float)
0:9 Construct vec4 ( temp 4-component vector of float)
0:9 Convert uint to float ( temp float)
0:9 'i' ( temp uint)
0:8 Loop Terminal Expression
0:8 Post-Increment ( temp uint)
0:8 'i' ( temp uint)
0:11 add second child into first child ( temp 4-component vector of float)
0:11 'r' ( temp 4-component vector of float)
0:11 Convert uint to float ( temp float)
0:11 add ( specialization-constant const uint)
0:11 'index' ( specialization-constant const uint)
0:11 2 (const uint)
0:11 'index' ( specialization-constant const uint)
0:11 2 (const uint)
0:12 add second child into first child ( temp 4-component vector of float)
0:12 'r' ( temp 4-component vector of float)
0:12 Convert uint to float ( temp float)
0:12 component-wise multiply ( specialization-constant const uint)
0:12 Constant:
0:12 2 (const uint)
0:12 'index' ( specialization-constant const uint)
0:12 2 (const uint)
0:14 Branch: Return with expression
0:14 'r' ( temp 4-component vector of float)
0:6 Function Definition: main( ( temp void)
0:6 Function Parameters:
0:? Sequence
0:6 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:6 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? 'index' ( specialization-constant const uint)
0:? 2 (const uint)
0:? 'array' ( const 4-element array of uint)
0:? 10 (const uint)
0:? 20 (const uint)
0:? 30 (const uint)
0:? 40 (const uint)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
0:? Sequence
0:6 Function Definition: @main( ( temp 4-component vector of float)
0:6 Function Parameters:
0:? Sequence
0:8 Sequence
0:8 move second child to first child ( temp uint)
0:8 'i' ( temp uint)
0:8 Constant:
0:8 0 (const uint)
0:8 Loop with condition tested first
0:8 Loop Condition
0:8 Compare Less Than ( temp bool)
0:8 'i' ( temp uint)
0:8 indirect index ( const uint)
0:8 Constant:
0:8 10 (const uint)
0:8 20 (const uint)
0:8 30 (const uint)
0:8 40 (const uint)
0:8 'index' ( specialization-constant const uint)
0:8 2 (const uint)
0:8 Loop Body
0:9 move second child to first child ( temp 4-component vector of float)
0:9 'r' ( temp 4-component vector of float)
0:9 Construct vec4 ( temp 4-component vector of float)
0:9 Convert uint to float ( temp float)
0:9 'i' ( temp uint)
0:8 Loop Terminal Expression
0:8 Post-Increment ( temp uint)
0:8 'i' ( temp uint)
0:11 add second child into first child ( temp 4-component vector of float)
0:11 'r' ( temp 4-component vector of float)
0:11 Convert uint to float ( temp float)
0:11 add ( specialization-constant const uint)
0:11 'index' ( specialization-constant const uint)
0:11 2 (const uint)
0:11 'index' ( specialization-constant const uint)
0:11 2 (const uint)
0:12 add second child into first child ( temp 4-component vector of float)
0:12 'r' ( temp 4-component vector of float)
0:12 Convert uint to float ( temp float)
0:12 component-wise multiply ( specialization-constant const uint)
0:12 Constant:
0:12 2 (const uint)
0:12 'index' ( specialization-constant const uint)
0:12 2 (const uint)
0:14 Branch: Return with expression
0:14 'r' ( temp 4-component vector of float)
0:6 Function Definition: main( ( temp void)
0:6 Function Parameters:
0:? Sequence
0:6 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:6 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? 'index' ( specialization-constant const uint)
0:? 2 (const uint)
0:? 'array' ( const 4-element array of uint)
0:? 10 (const uint)
0:? 20 (const uint)
0:? 30 (const uint)
0:? 40 (const uint)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 61
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 59
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 9 "@main("
Name 13 "i"
Name 28 "index"
Name 30 "indexable"
Name 36 "r"
Name 59 "@entryPointOutput"
Decorate 28(index) SpecId 0
Decorate 59(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4)
11: TypeInt 32 0
12: TypePointer Function 11(int)
14: 11(int) Constant 0
21: 11(int) Constant 4
22: TypeArray 11(int) 21
23: 11(int) Constant 10
24: 11(int) Constant 20
25: 11(int) Constant 30
26: 11(int) Constant 40
27: 22 ConstantComposite 23 24 25 26
28(index): 11(int) SpecConstant 2
29: TypePointer Function 22
33: TypeBool
35: TypePointer Function 7(fvec4)
41: TypeInt 32 1
42: 41(int) Constant 1
44: 11(int) SpecConstantOp 128 28(index) 28(index)
49: 11(int) Constant 2
50: 11(int) SpecConstantOp 132 49 28(index)
58: TypePointer Output 7(fvec4)
59(@entryPointOutput): 58(ptr) Variable Output
4(main): 2 Function None 3
5: Label
60: 7(fvec4) FunctionCall 9(@main()
Store 59(@entryPointOutput) 60
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
10: Label
13(i): 12(ptr) Variable Function
30(indexable): 29(ptr) Variable Function
36(r): 35(ptr) Variable Function
Store 13(i) 14
Branch 15
15: Label
LoopMerge 17 18 None
Branch 19
19: Label
20: 11(int) Load 13(i)
Store 30(indexable) 27
31: 12(ptr) AccessChain 30(indexable) 28(index)
32: 11(int) Load 31
34: 33(bool) ULessThan 20 32
BranchConditional 34 16 17
16: Label
37: 11(int) Load 13(i)
38: 6(float) ConvertUToF 37
39: 7(fvec4) CompositeConstruct 38 38 38 38
Store 36(r) 39
Branch 18
18: Label
40: 11(int) Load 13(i)
43: 11(int) IAdd 40 42
Store 13(i) 43
Branch 15
17: Label
45: 6(float) ConvertUToF 44
46: 7(fvec4) Load 36(r)
47: 7(fvec4) CompositeConstruct 45 45 45 45
48: 7(fvec4) FAdd 46 47
Store 36(r) 48
51: 6(float) ConvertUToF 50
52: 7(fvec4) Load 36(r)
53: 7(fvec4) CompositeConstruct 51 51 51 51
54: 7(fvec4) FAdd 52 53
Store 36(r) 54
55: 7(fvec4) Load 36(r)
ReturnValue 55
FunctionEnd

View File

@@ -0,0 +1,69 @@
spv.conditionalDemote.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 38
Capability Shader
Capability DemoteToHelperInvocationEXT
Extension "SPV_EXT_demote_to_helper_invocation"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 17 36
ExecutionMode 4 OriginUpperLeft
Source GLSL 460
SourceExtension "GL_EXT_demote_to_helper_invocation"
Name 4 "main"
Name 9 "v"
Name 13 "tex"
Name 17 "coord"
Name 33 "x"
Name 36 "o"
Decorate 13(tex) DescriptorSet 0
Decorate 13(tex) Binding 0
Decorate 17(coord) Location 0
Decorate 36(o) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: TypeImage 6(float) 2D sampled format:Unknown
11: TypeSampledImage 10
12: TypePointer UniformConstant 11
13(tex): 12(ptr) Variable UniformConstant
15: TypeVector 6(float) 2
16: TypePointer Input 15(fvec2)
17(coord): 16(ptr) Variable Input
21: 6(float) Constant 1036831949
22: 6(float) Constant 1045220557
23: 6(float) Constant 1050253722
24: 6(float) Constant 1053609165
25: 7(fvec4) ConstantComposite 21 22 23 24
26: TypeBool
27: TypeVector 26(bool) 4
32: TypePointer Function 26(bool)
35: TypePointer Output 7(fvec4)
36(o): 35(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(v): 8(ptr) Variable Function
33(x): 32(ptr) Variable Function
14: 11 Load 13(tex)
18: 15(fvec2) Load 17(coord)
19: 7(fvec4) ImageSampleImplicitLod 14 18
Store 9(v) 19
20: 7(fvec4) Load 9(v)
28: 27(bvec4) FOrdEqual 20 25
29: 26(bool) All 28
SelectionMerge 31 None
BranchConditional 29 30 31
30: Label
DemoteToHelperInvocationEXT
Branch 31
31: Label
34: 26(bool) IsHelperInvocationEXT
Store 33(x) 34
37: 7(fvec4) Load 9(v)
Store 36(o) 37
Return
FunctionEnd

View File

@@ -0,0 +1,171 @@
spv.constConstruct.vert
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 150
Capability Shader
Capability Float64
Capability Int64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
Source GLSL 450
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float16"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float32"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_float64"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int16"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int32"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int64"
SourceExtension "GL_EXT_shader_explicit_arithmetic_types_int8"
Name 4 "main"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 16
7:6(float16_t) Constant 15360
8:6(float16_t) Constant 16384
9:6(float16_t) Constant 16896
10:6(float16_t) Constant 17408
11:6(float16_t) Constant 17664
12:6(float16_t) Constant 17920
13:6(float16_t) Constant 18176
14:6(float16_t) Constant 18432
15:6(float16_t) Constant 18560
16:6(float16_t) Constant 18688
17:6(float16_t) Constant 18816
18: TypeFloat 32
19: 18(float) Constant 1099431936
20: 18(float) Constant 1099956224
21: 18(float) Constant 1100480512
22: 18(float) Constant 1101004800
23: 18(float) Constant 1101529088
24: 18(float) Constant 1102053376
25: 18(float) Constant 1102577664
26: 18(float) Constant 1103101952
27: 18(float) Constant 1103626240
28: 18(float) Constant 1104150528
29: 18(float) Constant 1104674816
30: 18(float) Constant 1065353216
31: TypeFloat 64
32:31(float64_t) Constant 0 1077968896
33:31(float64_t) Constant 0 1078001664
34:31(float64_t) Constant 0 1078034432
35:31(float64_t) Constant 0 1078067200
36:31(float64_t) Constant 0 1078099968
37:31(float64_t) Constant 0 1078132736
38:31(float64_t) Constant 0 1078165504
39:31(float64_t) Constant 0 1078198272
40:31(float64_t) Constant 0 1078231040
41:31(float64_t) Constant 0 1078263808
42:31(float64_t) Constant 0 1078296576
43:31(float64_t) Constant 0 1072693248
44: TypeInt 8 1
45: 44(int8_t) Constant 49
46: 44(int8_t) Constant 50
47: 44(int8_t) Constant 51
48: 44(int8_t) Constant 52
49: 44(int8_t) Constant 53
50: 44(int8_t) Constant 54
51: 44(int8_t) Constant 55
52: 44(int8_t) Constant 56
53: 44(int8_t) Constant 57
54: 44(int8_t) Constant 58
55: 44(int8_t) Constant 59
56: 44(int8_t) Constant 1
57: TypeInt 16 1
58: 57(int16_t) Constant 65
59: 57(int16_t) Constant 66
60: 57(int16_t) Constant 67
61: 57(int16_t) Constant 68
62: 57(int16_t) Constant 69
63: 57(int16_t) Constant 70
64: 57(int16_t) Constant 71
65: 57(int16_t) Constant 72
66: 57(int16_t) Constant 73
67: 57(int16_t) Constant 74
68: 57(int16_t) Constant 75
69: 57(int16_t) Constant 1
70: TypeInt 32 1
71: 70(int) Constant 81
72: 70(int) Constant 82
73: 70(int) Constant 83
74: 70(int) Constant 84
75: 70(int) Constant 85
76: 70(int) Constant 86
77: 70(int) Constant 87
78: 70(int) Constant 88
79: 70(int) Constant 89
80: 70(int) Constant 90
81: 70(int) Constant 91
82: 70(int) Constant 1
83: TypeInt 64 1
84: 83(int64_t) Constant 97 0
85: 83(int64_t) Constant 98 0
86: 83(int64_t) Constant 99 0
87: 83(int64_t) Constant 100 0
88: 83(int64_t) Constant 101 0
89: 83(int64_t) Constant 102 0
90: 83(int64_t) Constant 103 0
91: 83(int64_t) Constant 104 0
92: 83(int64_t) Constant 105 0
93: 83(int64_t) Constant 106 0
94: 83(int64_t) Constant 107 0
95: 83(int64_t) Constant 1 0
96: TypeInt 8 0
97: 96(int8_t) Constant 113
98: 96(int8_t) Constant 114
99: 96(int8_t) Constant 115
100: 96(int8_t) Constant 116
101: 96(int8_t) Constant 117
102: 96(int8_t) Constant 118
103: 96(int8_t) Constant 119
104: 96(int8_t) Constant 120
105: 96(int8_t) Constant 121
106: 96(int8_t) Constant 122
107: 96(int8_t) Constant 123
108: 96(int8_t) Constant 1
109: TypeInt 16 0
110:109(int16_t) Constant 129
111:109(int16_t) Constant 130
112:109(int16_t) Constant 131
113:109(int16_t) Constant 65412
114:109(int16_t) Constant 133
115:109(int16_t) Constant 134
116:109(int16_t) Constant 135
117:109(int16_t) Constant 136
118:109(int16_t) Constant 137
119:109(int16_t) Constant 138
120:109(int16_t) Constant 139
121:109(int16_t) Constant 1
122: TypeInt 32 0
123: 122(int) Constant 145
124: 122(int) Constant 146
125: 122(int) Constant 147
126: 122(int) Constant 4294967188
127: 122(int) Constant 149
128: 122(int) Constant 150
129: 122(int) Constant 151
130: 122(int) Constant 152
131: 122(int) Constant 153
132: 122(int) Constant 154
133: 122(int) Constant 155
134: 122(int) Constant 1
135: TypeInt 64 0
136:135(int64_t) Constant 161 0
137:135(int64_t) Constant 162 0
138:135(int64_t) Constant 163 0
139:135(int64_t) Constant 4294967204 4294967295
140:135(int64_t) Constant 165 0
141:135(int64_t) Constant 166 0
142:135(int64_t) Constant 167 0
143:135(int64_t) Constant 168 0
144:135(int64_t) Constant 169 0
145:135(int64_t) Constant 170 0
146:135(int64_t) Constant 171 0
147:135(int64_t) Constant 1 0
148: TypeBool
149: 148(bool) ConstantTrue
4(main): 2 Function None 3
5: Label
Return
FunctionEnd

View File

@@ -0,0 +1,6 @@
spv.demoteDisabled.frag
ERROR: 0:9: 'demote' : undeclared identifier
ERROR: 1 compilation errors. No code generated.
SPIR-V is not generated for failed compile or link

15
3rdparty/glslang/Test/hlsl.specConstant.frag vendored Executable file
View File

@@ -0,0 +1,15 @@
[[vk::constant_id(0)]] const uint index = 2;
static const uint array[] = { 10, 20, 30, 40 };
float4 main( ) : SV_TARGET
{
float4 r;
for(uint i = 0; i < array[index]; i++)
r = i;
r += index + index;
r += 2 * index;
return r;
}

View File

@@ -0,0 +1,18 @@
#version 460 core
#extension GL_EXT_demote_to_helper_invocation : enable
layout(set = 0, binding = 0) uniform sampler2D tex;
layout(location = 0) in vec2 coord;
layout(location = 0) out vec4 o;
void main (void)
{
vec4 v = texture(tex, coord);
if (v == vec4(0.1,0.2,0.3,0.4))
demote;
bool x = helperInvocationEXT();
o = v;
}

View File

@@ -0,0 +1,158 @@
#version 450
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_float32 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_float64 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int32 : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable
precision highp float;
void main()
{
float16_t(float16_t(0x1));
float16_t(float32_t(0x2));
float16_t(float64_t(0x3));
float16_t(int8_t (0x4));
float16_t(int16_t (0x5));
float16_t(int32_t (0x6));
float16_t(int64_t (0x7));
float16_t(uint8_t (0x8));
float16_t(uint16_t (0x9));
float16_t(uint32_t (0xA));
float16_t(uint64_t (0xB));
float16_t(bool (0xC));
float32_t(float16_t(0x11));
float32_t(float32_t(0x12));
float32_t(float64_t(0x13));
float32_t(int8_t (0x14));
float32_t(int16_t (0x15));
float32_t(int32_t (0x16));
float32_t(int64_t (0x17));
float32_t(uint8_t (0x18));
float32_t(uint16_t (0x19));
float32_t(uint32_t (0x1A));
float32_t(uint64_t (0x1B));
float32_t(bool (0x1C));
float64_t(float16_t(0x21));
float64_t(float32_t(0x22));
float64_t(float64_t(0x23));
float64_t(int8_t (0x24));
float64_t(int16_t (0x25));
float64_t(int32_t (0x26));
float64_t(int64_t (0x27));
float64_t(uint8_t (0x28));
float64_t(uint16_t (0x29));
float64_t(uint32_t (0x2A));
float64_t(uint64_t (0x2B));
float64_t(bool (0x2C));
int8_t(float16_t(0x31));
int8_t(float32_t(0x32));
int8_t(float64_t(0x33));
int8_t(int8_t (0x34));
int8_t(int16_t (0x35));
int8_t(int32_t (0x36));
int8_t(int64_t (0x37));
int8_t(uint8_t (0x38));
int8_t(uint16_t (0x39));
int8_t(uint32_t (0x3A));
int8_t(uint64_t (0x3B));
int8_t(bool (0x3C));
int16_t(float16_t(0x41));
int16_t(float32_t(0x42));
int16_t(float64_t(0x43));
int16_t(int8_t (0x44));
int16_t(int16_t (0x45));
int16_t(int32_t (0x46));
int16_t(int64_t (0x47));
int16_t(uint8_t (0x48));
int16_t(uint16_t (0x49));
int16_t(uint32_t (0x4A));
int16_t(uint64_t (0x4B));
int16_t(bool (0x4C));
int32_t(float16_t(0x51));
int32_t(float32_t(0x52));
int32_t(float64_t(0x53));
int32_t(int8_t (0x54));
int32_t(int16_t (0x55));
int32_t(int32_t (0x56));
int32_t(int64_t (0x57));
int32_t(uint8_t (0x58));
int32_t(uint16_t (0x59));
int32_t(uint32_t (0x5A));
int32_t(uint64_t (0x5B));
int32_t(bool (0x5C));
int64_t(float16_t(0x61));
int64_t(float32_t(0x62));
int64_t(float64_t(0x63));
int64_t(int8_t (0x64));
int64_t(int16_t (0x65));
int64_t(int32_t (0x66));
int64_t(int64_t (0x67));
int64_t(uint8_t (0x68));
int64_t(uint16_t (0x69));
int64_t(uint32_t (0x6A));
int64_t(uint64_t (0x6B));
int64_t(bool (0x6C));
uint8_t(float16_t(0x71));
uint8_t(float32_t(0x72));
uint8_t(float64_t(0x73));
uint8_t(int8_t (0x74));
uint8_t(int16_t (0x75));
uint8_t(int32_t (0x76));
uint8_t(int64_t (0x77));
uint8_t(uint8_t (0x78));
uint8_t(uint16_t (0x79));
uint8_t(uint32_t (0x7A));
uint8_t(uint64_t (0x7B));
uint8_t(bool (0x7C));
uint16_t(float16_t(0x81));
uint16_t(float32_t(0x82));
uint16_t(float64_t(0x83));
uint16_t(int8_t (0x84));
uint16_t(int16_t (0x85));
uint16_t(int32_t (0x86));
uint16_t(int64_t (0x87));
uint16_t(uint8_t (0x88));
uint16_t(uint16_t (0x89));
uint16_t(uint32_t (0x8A));
uint16_t(uint64_t (0x8B));
uint16_t(bool (0x8C));
uint32_t(float16_t(0x91));
uint32_t(float32_t(0x92));
uint32_t(float64_t(0x93));
uint32_t(int8_t (0x94));
uint32_t(int16_t (0x95));
uint32_t(int32_t (0x96));
uint32_t(int64_t (0x97));
uint32_t(uint8_t (0x98));
uint32_t(uint16_t (0x99));
uint32_t(uint32_t (0x9A));
uint32_t(uint64_t (0x9B));
uint32_t(bool (0x9C));
uint64_t(float16_t(0xA1));
uint64_t(float32_t(0xA2));
uint64_t(float64_t(0xA3));
uint64_t(int8_t (0xA4));
uint64_t(int16_t (0xA5));
uint64_t(int32_t (0xA6));
uint64_t(int64_t (0xA7));
uint64_t(uint8_t (0xA8));
uint64_t(uint16_t (0xA9));
uint64_t(uint32_t (0xAA));
uint64_t(uint64_t (0xAB));
uint64_t(bool (0xAC));
bool(float16_t(0xB1));
bool(float32_t(0xB2));
bool(float64_t(0xB3));
bool(int8_t (0xB4));
bool(int16_t (0xB5));
bool(int32_t (0xB6));
bool(int64_t (0xB7));
bool(uint8_t (0xB8));
bool(uint16_t (0xB9));
bool(uint32_t (0xBA));
bool(uint64_t (0xBB));
bool(bool (0xBC));
}

View File

@@ -0,0 +1,10 @@
#version 460 core
void main (void)
{
{
int demote = 0;
demote;
}
demote;
}

View File

@@ -624,6 +624,8 @@ enum TOperator {
EOpBeginInvocationInterlock, // Fragment only
EOpEndInvocationInterlock, // Fragment only
EOpIsHelperInvocation,
//
// Branch
//
@@ -634,6 +636,7 @@ enum TOperator {
EOpContinue,
EOpCase,
EOpDefault,
EOpDemote, // Fragment only
//
// Constructors

View File

@@ -5034,6 +5034,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void beginInvocationInterlockARB(void);"
"void endInvocationInterlockARB(void);");
stageBuiltins[EShLangFragment].append(
"bool helperInvocationEXT();"
"\n");
#ifdef AMD_EXTENSIONS
// GL_AMD_shader_explicit_vertex_parameter
if (profile != EEsProfile && version >= 450) {
@@ -8641,6 +8645,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_StorageSemanticsImage", 1, &E_GL_KHR_memory_scope_semantics);
symbolTable.setVariableExtensions("gl_StorageSemanticsOutput", 1, &E_GL_KHR_memory_scope_semantics);
}
symbolTable.setFunctionExtensions("helperInvocationEXT", 1, &E_GL_EXT_demote_to_helper_invocation);
break;
case EShLangCompute:
@@ -9295,6 +9301,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("findLSB", EOpFindLSB);
symbolTable.relateToOperator("findMSB", EOpFindMSB);
symbolTable.relateToOperator("helperInvocationEXT", EOpIsHelperInvocation);
if (PureOperatorBuiltins) {
symbolTable.relateToOperator("imageSize", EOpImageQuerySize);
symbolTable.relateToOperator("imageSamples", EOpImageQuerySamples);

View File

@@ -3788,217 +3788,41 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
TConstUnionArray leftUnionArray(size);
for (int i=0; i < size; i++) {
switch (promoteTo) {
case EbtFloat:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getIConst()));
break;
case EbtUint:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
break;
case EbtInt64:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getI64Const()));
break;
case EbtUint64:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getU64Const()));
break;
case EbtBool:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i] = rightUnionArray[i];
break;
default:
return node;
}
break;
case EbtDouble:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getIConst()));
break;
case EbtUint:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
break;
case EbtInt64:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getI64Const()));
break;
case EbtUint64:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getU64Const()));
break;
case EbtBool:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i] = rightUnionArray[i];
break;
default:
return node;
}
break;
case EbtFloat16:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getIConst()));
break;
case EbtUint:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getUConst()));
break;
case EbtInt64:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getI64Const()));
break;
case EbtUint64:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getU64Const()));
break;
case EbtBool:
leftUnionArray[i].setDConst(static_cast<double>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i] = rightUnionArray[i];
break;
default:
return node;
}
break;
case EbtInt:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i] = rightUnionArray[i];
break;
case EbtUint:
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getUConst()));
break;
case EbtInt64:
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getI64Const()));
break;
case EbtUint64:
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getU64Const()));
break;
case EbtBool:
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getDConst()));
break;
default:
return node;
}
break;
case EbtUint:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getIConst()));
break;
case EbtUint:
leftUnionArray[i] = rightUnionArray[i];
break;
case EbtInt64:
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getI64Const()));
break;
case EbtUint64:
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getU64Const()));
break;
case EbtBool:
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i].setUConst(static_cast<unsigned int>(rightUnionArray[i].getDConst()));
break;
default:
return node;
}
break;
case EbtBool:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setBConst(rightUnionArray[i].getIConst() != 0);
break;
case EbtUint:
leftUnionArray[i].setBConst(rightUnionArray[i].getUConst() != 0);
break;
case EbtInt64:
leftUnionArray[i].setBConst(rightUnionArray[i].getI64Const() != 0);
break;
case EbtUint64:
leftUnionArray[i].setBConst(rightUnionArray[i].getU64Const() != 0);
break;
case EbtBool:
leftUnionArray[i] = rightUnionArray[i];
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i].setBConst(rightUnionArray[i].getDConst() != 0.0);
break;
default:
return node;
}
break;
case EbtInt64:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getIConst()));
break;
case EbtUint:
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getUConst()));
break;
case EbtInt64:
leftUnionArray[i] = rightUnionArray[i];
break;
case EbtUint64:
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getU64Const()));
break;
case EbtBool:
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i].setI64Const(static_cast<long long>(rightUnionArray[i].getDConst()));
break;
default:
return node;
}
break;
case EbtUint64:
switch (node->getType().getBasicType()) {
case EbtInt:
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getIConst()));
break;
case EbtUint:
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getUConst()));
break;
case EbtInt64:
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getI64Const()));
break;
case EbtUint64:
leftUnionArray[i] = rightUnionArray[i];
break;
case EbtBool:
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getBConst()));
break;
case EbtFloat:
case EbtDouble:
case EbtFloat16:
leftUnionArray[i].setU64Const(static_cast<unsigned long long>(rightUnionArray[i].getDConst()));
break;
default:
return node;
}
break;
default:
return node;
#define PROMOTE(Set, CType, Get) leftUnionArray[i].Set(static_cast<CType>(rightUnionArray[i].Get()))
#define PROMOTE_TO_BOOL(Get) leftUnionArray[i].setBConst(rightUnionArray[i].Get() != 0)
#define TO_ALL(Get) \
switch (promoteTo) { \
case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
case EbtFloat: PROMOTE(setDConst, double, Get); break; \
case EbtDouble: PROMOTE(setDConst, double, Get); break; \
case EbtInt8: PROMOTE(setI8Const, char, Get); break; \
case EbtInt16: PROMOTE(setI16Const, short, Get); break; \
case EbtInt: PROMOTE(setIConst, int, Get); break; \
case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \
case EbtUint8: PROMOTE(setU8Const, unsigned char, Get); break; \
case EbtUint16: PROMOTE(setU16Const, unsigned short, Get); break; \
case EbtUint: PROMOTE(setUConst, unsigned int, Get); break; \
case EbtUint64: PROMOTE(setU64Const, unsigned long long, Get); break; \
case EbtBool: PROMOTE_TO_BOOL(Get); break; \
default: return node; \
}
switch (node->getType().getBasicType()) {
case EbtFloat16: TO_ALL(getDConst); break;
case EbtFloat: TO_ALL(getDConst); break;
case EbtDouble: TO_ALL(getDConst); break;
case EbtInt8: TO_ALL(getI8Const); break;
case EbtInt16: TO_ALL(getI16Const); break;
case EbtInt: TO_ALL(getIConst); break;
case EbtInt64: TO_ALL(getI64Const); break;
case EbtUint8: TO_ALL(getU8Const); break;
case EbtUint16: TO_ALL(getU16Const); break;
case EbtUint: TO_ALL(getUConst); break;
case EbtUint64: TO_ALL(getU64Const); break;
case EbtBool: TO_ALL(getBConst); break;
default: return node;
}
}

View File

@@ -356,6 +356,7 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["default"] = DEFAULT;
(*KeywordMap)["if"] = IF;
(*KeywordMap)["else"] = ELSE;
(*KeywordMap)["demote"] = DEMOTE;
(*KeywordMap)["discard"] = DISCARD;
(*KeywordMap)["return"] = RETURN;
(*KeywordMap)["void"] = VOID;
@@ -1621,6 +1622,12 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
case DEMOTE:
if (parseContext.extensionTurnedOn(E_GL_EXT_demote_to_helper_invocation))
return keyword;
else
return identifierOrType();
default:
parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc);
return 0;

View File

@@ -1984,7 +1984,7 @@ const char* TProgram::getInfoDebugLog()
bool TProgram::buildReflection(int opts)
{
if (! linked || reflection)
if (! linked || reflection != nullptr)
return false;
int firstStage = EShLangVertex, lastStage = EShLangFragment;
@@ -2014,9 +2014,8 @@ bool TProgram::buildReflection(int opts)
return true;
}
unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); }
int TProgram::getReflectionIndex(const char* name) const { return reflection->getIndex(name); }
unsigned TProgram::getLocalSize(int dim) const { return reflection->getLocalSize(dim); }
int TProgram::getReflectionIndex(const char* name) const { return reflection->getIndex(name); }
int TProgram::getNumUniformVariables() const { return reflection->getNumUniforms(); }
const TObjectReflection& TProgram::getUniform(int index) const { return reflection->getUniform(index); }
int TProgram::getNumUniformBlocks() const { return reflection->getNumUniformBlocks(); }
@@ -2031,8 +2030,7 @@ int TProgram::getNumBufferBlocks() const { return r
const TObjectReflection& TProgram::getBufferBlock(int index) const { return reflection->getStorageBufferBlock(index); }
int TProgram::getNumAtomicCounters() const { return reflection->getNumAtomicCounters(); }
const TObjectReflection& TProgram::getAtomicCounter(int index) const { return reflection->getAtomicCounter(index); }
void TProgram::dumpReflection() { reflection->dump(); }
void TProgram::dumpReflection() { if (reflection != nullptr) reflection->dump(); }
//
// I/O mapping implementation.

View File

@@ -211,6 +211,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_fragment_invocation_density] = EBhDisable;
extensionBehavior[E_GL_EXT_buffer_reference] = EBhDisable;
extensionBehavior[E_GL_EXT_buffer_reference2] = EBhDisable;
extensionBehavior[E_GL_EXT_demote_to_helper_invocation] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable;
@@ -394,6 +395,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_fragment_invocation_density 1\n"
"#define GL_EXT_buffer_reference 1\n"
"#define GL_EXT_buffer_reference2 1\n"
"#define GL_EXT_demote_to_helper_invocation 1\n"
// GL_KHR_shader_subgroup
"#define GL_KHR_shader_subgroup_basic 1\n"

View File

@@ -173,6 +173,7 @@ const char* const E_GL_EXT_scalar_block_layout = "GL_EXT_scalar_blo
const char* const E_GL_EXT_fragment_invocation_density = "GL_EXT_fragment_invocation_density";
const char* const E_GL_EXT_buffer_reference = "GL_EXT_buffer_reference";
const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_reference2";
const char* const E_GL_EXT_demote_to_helper_invocation = "GL_EXT_demote_to_helper_invocation";
// Arrays of extensions for the above viewportEXTs duplications

View File

@@ -128,7 +128,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> ATTRIBUTE VARYING
%token <lex> FLOAT16_T FLOAT FLOAT32_T DOUBLE FLOAT64_T
%token <lex> CONST BOOL INT UINT INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE
%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE DEMOTE
%token <lex> BVEC2 BVEC3 BVEC4
%token <lex> IVEC2 IVEC3 IVEC4
%token <lex> UVEC2 UVEC3 UVEC4
@@ -265,7 +265,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%type <interm.intermNode> declaration external_declaration
%type <interm.intermNode> for_init_statement compound_statement_no_new_scope
%type <interm.nodePair> selection_rest_statement for_rest_statement
%type <interm.intermNode> iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped
%type <interm.intermNode> iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped demote_statement
%type <interm> single_declaration init_declarator_list
%type <interm> parameter_declaration parameter_declarator parameter_type_specifier
@@ -3416,6 +3416,15 @@ simple_statement
| case_label { $$ = $1; }
| iteration_statement { $$ = $1; }
| jump_statement { $$ = $1; }
| demote_statement { $$ = $1; }
;
demote_statement
: DEMOTE SEMICOLON {
parseContext.requireStage($1.loc, EShLangFragment, "demote");
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote");
$$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc);
}
;
compound_statement

File diff suppressed because it is too large Load Diff

View File

@@ -76,380 +76,381 @@ extern int yydebug;
CASE = 286,
DEFAULT = 287,
SUBROUTINE = 288,
BVEC2 = 289,
BVEC3 = 290,
BVEC4 = 291,
IVEC2 = 292,
IVEC3 = 293,
IVEC4 = 294,
UVEC2 = 295,
UVEC3 = 296,
UVEC4 = 297,
I64VEC2 = 298,
I64VEC3 = 299,
I64VEC4 = 300,
U64VEC2 = 301,
U64VEC3 = 302,
U64VEC4 = 303,
I32VEC2 = 304,
I32VEC3 = 305,
I32VEC4 = 306,
U32VEC2 = 307,
U32VEC3 = 308,
U32VEC4 = 309,
I16VEC2 = 310,
I16VEC3 = 311,
I16VEC4 = 312,
U16VEC2 = 313,
U16VEC3 = 314,
U16VEC4 = 315,
I8VEC2 = 316,
I8VEC3 = 317,
I8VEC4 = 318,
U8VEC2 = 319,
U8VEC3 = 320,
U8VEC4 = 321,
VEC2 = 322,
VEC3 = 323,
VEC4 = 324,
MAT2 = 325,
MAT3 = 326,
MAT4 = 327,
CENTROID = 328,
IN = 329,
OUT = 330,
INOUT = 331,
UNIFORM = 332,
PATCH = 333,
SAMPLE = 334,
BUFFER = 335,
SHARED = 336,
NONUNIFORM = 337,
PAYLOADNV = 338,
PAYLOADINNV = 339,
HITATTRNV = 340,
CALLDATANV = 341,
CALLDATAINNV = 342,
COHERENT = 343,
VOLATILE = 344,
RESTRICT = 345,
READONLY = 346,
WRITEONLY = 347,
DEVICECOHERENT = 348,
QUEUEFAMILYCOHERENT = 349,
WORKGROUPCOHERENT = 350,
SUBGROUPCOHERENT = 351,
NONPRIVATE = 352,
DVEC2 = 353,
DVEC3 = 354,
DVEC4 = 355,
DMAT2 = 356,
DMAT3 = 357,
DMAT4 = 358,
F16VEC2 = 359,
F16VEC3 = 360,
F16VEC4 = 361,
F16MAT2 = 362,
F16MAT3 = 363,
F16MAT4 = 364,
F32VEC2 = 365,
F32VEC3 = 366,
F32VEC4 = 367,
F32MAT2 = 368,
F32MAT3 = 369,
F32MAT4 = 370,
F64VEC2 = 371,
F64VEC3 = 372,
F64VEC4 = 373,
F64MAT2 = 374,
F64MAT3 = 375,
F64MAT4 = 376,
NOPERSPECTIVE = 377,
FLAT = 378,
SMOOTH = 379,
LAYOUT = 380,
EXPLICITINTERPAMD = 381,
PERVERTEXNV = 382,
PERPRIMITIVENV = 383,
PERVIEWNV = 384,
PERTASKNV = 385,
MAT2X2 = 386,
MAT2X3 = 387,
MAT2X4 = 388,
MAT3X2 = 389,
MAT3X3 = 390,
MAT3X4 = 391,
MAT4X2 = 392,
MAT4X3 = 393,
MAT4X4 = 394,
DMAT2X2 = 395,
DMAT2X3 = 396,
DMAT2X4 = 397,
DMAT3X2 = 398,
DMAT3X3 = 399,
DMAT3X4 = 400,
DMAT4X2 = 401,
DMAT4X3 = 402,
DMAT4X4 = 403,
F16MAT2X2 = 404,
F16MAT2X3 = 405,
F16MAT2X4 = 406,
F16MAT3X2 = 407,
F16MAT3X3 = 408,
F16MAT3X4 = 409,
F16MAT4X2 = 410,
F16MAT4X3 = 411,
F16MAT4X4 = 412,
F32MAT2X2 = 413,
F32MAT2X3 = 414,
F32MAT2X4 = 415,
F32MAT3X2 = 416,
F32MAT3X3 = 417,
F32MAT3X4 = 418,
F32MAT4X2 = 419,
F32MAT4X3 = 420,
F32MAT4X4 = 421,
F64MAT2X2 = 422,
F64MAT2X3 = 423,
F64MAT2X4 = 424,
F64MAT3X2 = 425,
F64MAT3X3 = 426,
F64MAT3X4 = 427,
F64MAT4X2 = 428,
F64MAT4X3 = 429,
F64MAT4X4 = 430,
ATOMIC_UINT = 431,
ACCSTRUCTNV = 432,
FCOOPMATNV = 433,
SAMPLER1D = 434,
SAMPLER2D = 435,
SAMPLER3D = 436,
SAMPLERCUBE = 437,
SAMPLER1DSHADOW = 438,
SAMPLER2DSHADOW = 439,
SAMPLERCUBESHADOW = 440,
SAMPLER1DARRAY = 441,
SAMPLER2DARRAY = 442,
SAMPLER1DARRAYSHADOW = 443,
SAMPLER2DARRAYSHADOW = 444,
ISAMPLER1D = 445,
ISAMPLER2D = 446,
ISAMPLER3D = 447,
ISAMPLERCUBE = 448,
ISAMPLER1DARRAY = 449,
ISAMPLER2DARRAY = 450,
USAMPLER1D = 451,
USAMPLER2D = 452,
USAMPLER3D = 453,
USAMPLERCUBE = 454,
USAMPLER1DARRAY = 455,
USAMPLER2DARRAY = 456,
SAMPLER2DRECT = 457,
SAMPLER2DRECTSHADOW = 458,
ISAMPLER2DRECT = 459,
USAMPLER2DRECT = 460,
SAMPLERBUFFER = 461,
ISAMPLERBUFFER = 462,
USAMPLERBUFFER = 463,
SAMPLERCUBEARRAY = 464,
SAMPLERCUBEARRAYSHADOW = 465,
ISAMPLERCUBEARRAY = 466,
USAMPLERCUBEARRAY = 467,
SAMPLER2DMS = 468,
ISAMPLER2DMS = 469,
USAMPLER2DMS = 470,
SAMPLER2DMSARRAY = 471,
ISAMPLER2DMSARRAY = 472,
USAMPLER2DMSARRAY = 473,
SAMPLEREXTERNALOES = 474,
SAMPLEREXTERNAL2DY2YEXT = 475,
F16SAMPLER1D = 476,
F16SAMPLER2D = 477,
F16SAMPLER3D = 478,
F16SAMPLER2DRECT = 479,
F16SAMPLERCUBE = 480,
F16SAMPLER1DARRAY = 481,
F16SAMPLER2DARRAY = 482,
F16SAMPLERCUBEARRAY = 483,
F16SAMPLERBUFFER = 484,
F16SAMPLER2DMS = 485,
F16SAMPLER2DMSARRAY = 486,
F16SAMPLER1DSHADOW = 487,
F16SAMPLER2DSHADOW = 488,
F16SAMPLER1DARRAYSHADOW = 489,
F16SAMPLER2DARRAYSHADOW = 490,
F16SAMPLER2DRECTSHADOW = 491,
F16SAMPLERCUBESHADOW = 492,
F16SAMPLERCUBEARRAYSHADOW = 493,
SAMPLER = 494,
SAMPLERSHADOW = 495,
TEXTURE1D = 496,
TEXTURE2D = 497,
TEXTURE3D = 498,
TEXTURECUBE = 499,
TEXTURE1DARRAY = 500,
TEXTURE2DARRAY = 501,
ITEXTURE1D = 502,
ITEXTURE2D = 503,
ITEXTURE3D = 504,
ITEXTURECUBE = 505,
ITEXTURE1DARRAY = 506,
ITEXTURE2DARRAY = 507,
UTEXTURE1D = 508,
UTEXTURE2D = 509,
UTEXTURE3D = 510,
UTEXTURECUBE = 511,
UTEXTURE1DARRAY = 512,
UTEXTURE2DARRAY = 513,
TEXTURE2DRECT = 514,
ITEXTURE2DRECT = 515,
UTEXTURE2DRECT = 516,
TEXTUREBUFFER = 517,
ITEXTUREBUFFER = 518,
UTEXTUREBUFFER = 519,
TEXTURECUBEARRAY = 520,
ITEXTURECUBEARRAY = 521,
UTEXTURECUBEARRAY = 522,
TEXTURE2DMS = 523,
ITEXTURE2DMS = 524,
UTEXTURE2DMS = 525,
TEXTURE2DMSARRAY = 526,
ITEXTURE2DMSARRAY = 527,
UTEXTURE2DMSARRAY = 528,
F16TEXTURE1D = 529,
F16TEXTURE2D = 530,
F16TEXTURE3D = 531,
F16TEXTURE2DRECT = 532,
F16TEXTURECUBE = 533,
F16TEXTURE1DARRAY = 534,
F16TEXTURE2DARRAY = 535,
F16TEXTURECUBEARRAY = 536,
F16TEXTUREBUFFER = 537,
F16TEXTURE2DMS = 538,
F16TEXTURE2DMSARRAY = 539,
SUBPASSINPUT = 540,
SUBPASSINPUTMS = 541,
ISUBPASSINPUT = 542,
ISUBPASSINPUTMS = 543,
USUBPASSINPUT = 544,
USUBPASSINPUTMS = 545,
F16SUBPASSINPUT = 546,
F16SUBPASSINPUTMS = 547,
IMAGE1D = 548,
IIMAGE1D = 549,
UIMAGE1D = 550,
IMAGE2D = 551,
IIMAGE2D = 552,
UIMAGE2D = 553,
IMAGE3D = 554,
IIMAGE3D = 555,
UIMAGE3D = 556,
IMAGE2DRECT = 557,
IIMAGE2DRECT = 558,
UIMAGE2DRECT = 559,
IMAGECUBE = 560,
IIMAGECUBE = 561,
UIMAGECUBE = 562,
IMAGEBUFFER = 563,
IIMAGEBUFFER = 564,
UIMAGEBUFFER = 565,
IMAGE1DARRAY = 566,
IIMAGE1DARRAY = 567,
UIMAGE1DARRAY = 568,
IMAGE2DARRAY = 569,
IIMAGE2DARRAY = 570,
UIMAGE2DARRAY = 571,
IMAGECUBEARRAY = 572,
IIMAGECUBEARRAY = 573,
UIMAGECUBEARRAY = 574,
IMAGE2DMS = 575,
IIMAGE2DMS = 576,
UIMAGE2DMS = 577,
IMAGE2DMSARRAY = 578,
IIMAGE2DMSARRAY = 579,
UIMAGE2DMSARRAY = 580,
F16IMAGE1D = 581,
F16IMAGE2D = 582,
F16IMAGE3D = 583,
F16IMAGE2DRECT = 584,
F16IMAGECUBE = 585,
F16IMAGE1DARRAY = 586,
F16IMAGE2DARRAY = 587,
F16IMAGECUBEARRAY = 588,
F16IMAGEBUFFER = 589,
F16IMAGE2DMS = 590,
F16IMAGE2DMSARRAY = 591,
STRUCT = 592,
VOID = 593,
WHILE = 594,
IDENTIFIER = 595,
TYPE_NAME = 596,
FLOATCONSTANT = 597,
DOUBLECONSTANT = 598,
INT16CONSTANT = 599,
UINT16CONSTANT = 600,
INT32CONSTANT = 601,
UINT32CONSTANT = 602,
INTCONSTANT = 603,
UINTCONSTANT = 604,
INT64CONSTANT = 605,
UINT64CONSTANT = 606,
BOOLCONSTANT = 607,
FLOAT16CONSTANT = 608,
LEFT_OP = 609,
RIGHT_OP = 610,
INC_OP = 611,
DEC_OP = 612,
LE_OP = 613,
GE_OP = 614,
EQ_OP = 615,
NE_OP = 616,
AND_OP = 617,
OR_OP = 618,
XOR_OP = 619,
MUL_ASSIGN = 620,
DIV_ASSIGN = 621,
ADD_ASSIGN = 622,
MOD_ASSIGN = 623,
LEFT_ASSIGN = 624,
RIGHT_ASSIGN = 625,
AND_ASSIGN = 626,
XOR_ASSIGN = 627,
OR_ASSIGN = 628,
SUB_ASSIGN = 629,
LEFT_PAREN = 630,
RIGHT_PAREN = 631,
LEFT_BRACKET = 632,
RIGHT_BRACKET = 633,
LEFT_BRACE = 634,
RIGHT_BRACE = 635,
DOT = 636,
COMMA = 637,
COLON = 638,
EQUAL = 639,
SEMICOLON = 640,
BANG = 641,
DASH = 642,
TILDE = 643,
PLUS = 644,
STAR = 645,
SLASH = 646,
PERCENT = 647,
LEFT_ANGLE = 648,
RIGHT_ANGLE = 649,
VERTICAL_BAR = 650,
CARET = 651,
AMPERSAND = 652,
QUESTION = 653,
INVARIANT = 654,
PRECISE = 655,
HIGH_PRECISION = 656,
MEDIUM_PRECISION = 657,
LOW_PRECISION = 658,
PRECISION = 659,
PACKED = 660,
RESOURCE = 661,
SUPERP = 662
DEMOTE = 289,
BVEC2 = 290,
BVEC3 = 291,
BVEC4 = 292,
IVEC2 = 293,
IVEC3 = 294,
IVEC4 = 295,
UVEC2 = 296,
UVEC3 = 297,
UVEC4 = 298,
I64VEC2 = 299,
I64VEC3 = 300,
I64VEC4 = 301,
U64VEC2 = 302,
U64VEC3 = 303,
U64VEC4 = 304,
I32VEC2 = 305,
I32VEC3 = 306,
I32VEC4 = 307,
U32VEC2 = 308,
U32VEC3 = 309,
U32VEC4 = 310,
I16VEC2 = 311,
I16VEC3 = 312,
I16VEC4 = 313,
U16VEC2 = 314,
U16VEC3 = 315,
U16VEC4 = 316,
I8VEC2 = 317,
I8VEC3 = 318,
I8VEC4 = 319,
U8VEC2 = 320,
U8VEC3 = 321,
U8VEC4 = 322,
VEC2 = 323,
VEC3 = 324,
VEC4 = 325,
MAT2 = 326,
MAT3 = 327,
MAT4 = 328,
CENTROID = 329,
IN = 330,
OUT = 331,
INOUT = 332,
UNIFORM = 333,
PATCH = 334,
SAMPLE = 335,
BUFFER = 336,
SHARED = 337,
NONUNIFORM = 338,
PAYLOADNV = 339,
PAYLOADINNV = 340,
HITATTRNV = 341,
CALLDATANV = 342,
CALLDATAINNV = 343,
COHERENT = 344,
VOLATILE = 345,
RESTRICT = 346,
READONLY = 347,
WRITEONLY = 348,
DEVICECOHERENT = 349,
QUEUEFAMILYCOHERENT = 350,
WORKGROUPCOHERENT = 351,
SUBGROUPCOHERENT = 352,
NONPRIVATE = 353,
DVEC2 = 354,
DVEC3 = 355,
DVEC4 = 356,
DMAT2 = 357,
DMAT3 = 358,
DMAT4 = 359,
F16VEC2 = 360,
F16VEC3 = 361,
F16VEC4 = 362,
F16MAT2 = 363,
F16MAT3 = 364,
F16MAT4 = 365,
F32VEC2 = 366,
F32VEC3 = 367,
F32VEC4 = 368,
F32MAT2 = 369,
F32MAT3 = 370,
F32MAT4 = 371,
F64VEC2 = 372,
F64VEC3 = 373,
F64VEC4 = 374,
F64MAT2 = 375,
F64MAT3 = 376,
F64MAT4 = 377,
NOPERSPECTIVE = 378,
FLAT = 379,
SMOOTH = 380,
LAYOUT = 381,
EXPLICITINTERPAMD = 382,
PERVERTEXNV = 383,
PERPRIMITIVENV = 384,
PERVIEWNV = 385,
PERTASKNV = 386,
MAT2X2 = 387,
MAT2X3 = 388,
MAT2X4 = 389,
MAT3X2 = 390,
MAT3X3 = 391,
MAT3X4 = 392,
MAT4X2 = 393,
MAT4X3 = 394,
MAT4X4 = 395,
DMAT2X2 = 396,
DMAT2X3 = 397,
DMAT2X4 = 398,
DMAT3X2 = 399,
DMAT3X3 = 400,
DMAT3X4 = 401,
DMAT4X2 = 402,
DMAT4X3 = 403,
DMAT4X4 = 404,
F16MAT2X2 = 405,
F16MAT2X3 = 406,
F16MAT2X4 = 407,
F16MAT3X2 = 408,
F16MAT3X3 = 409,
F16MAT3X4 = 410,
F16MAT4X2 = 411,
F16MAT4X3 = 412,
F16MAT4X4 = 413,
F32MAT2X2 = 414,
F32MAT2X3 = 415,
F32MAT2X4 = 416,
F32MAT3X2 = 417,
F32MAT3X3 = 418,
F32MAT3X4 = 419,
F32MAT4X2 = 420,
F32MAT4X3 = 421,
F32MAT4X4 = 422,
F64MAT2X2 = 423,
F64MAT2X3 = 424,
F64MAT2X4 = 425,
F64MAT3X2 = 426,
F64MAT3X3 = 427,
F64MAT3X4 = 428,
F64MAT4X2 = 429,
F64MAT4X3 = 430,
F64MAT4X4 = 431,
ATOMIC_UINT = 432,
ACCSTRUCTNV = 433,
FCOOPMATNV = 434,
SAMPLER1D = 435,
SAMPLER2D = 436,
SAMPLER3D = 437,
SAMPLERCUBE = 438,
SAMPLER1DSHADOW = 439,
SAMPLER2DSHADOW = 440,
SAMPLERCUBESHADOW = 441,
SAMPLER1DARRAY = 442,
SAMPLER2DARRAY = 443,
SAMPLER1DARRAYSHADOW = 444,
SAMPLER2DARRAYSHADOW = 445,
ISAMPLER1D = 446,
ISAMPLER2D = 447,
ISAMPLER3D = 448,
ISAMPLERCUBE = 449,
ISAMPLER1DARRAY = 450,
ISAMPLER2DARRAY = 451,
USAMPLER1D = 452,
USAMPLER2D = 453,
USAMPLER3D = 454,
USAMPLERCUBE = 455,
USAMPLER1DARRAY = 456,
USAMPLER2DARRAY = 457,
SAMPLER2DRECT = 458,
SAMPLER2DRECTSHADOW = 459,
ISAMPLER2DRECT = 460,
USAMPLER2DRECT = 461,
SAMPLERBUFFER = 462,
ISAMPLERBUFFER = 463,
USAMPLERBUFFER = 464,
SAMPLERCUBEARRAY = 465,
SAMPLERCUBEARRAYSHADOW = 466,
ISAMPLERCUBEARRAY = 467,
USAMPLERCUBEARRAY = 468,
SAMPLER2DMS = 469,
ISAMPLER2DMS = 470,
USAMPLER2DMS = 471,
SAMPLER2DMSARRAY = 472,
ISAMPLER2DMSARRAY = 473,
USAMPLER2DMSARRAY = 474,
SAMPLEREXTERNALOES = 475,
SAMPLEREXTERNAL2DY2YEXT = 476,
F16SAMPLER1D = 477,
F16SAMPLER2D = 478,
F16SAMPLER3D = 479,
F16SAMPLER2DRECT = 480,
F16SAMPLERCUBE = 481,
F16SAMPLER1DARRAY = 482,
F16SAMPLER2DARRAY = 483,
F16SAMPLERCUBEARRAY = 484,
F16SAMPLERBUFFER = 485,
F16SAMPLER2DMS = 486,
F16SAMPLER2DMSARRAY = 487,
F16SAMPLER1DSHADOW = 488,
F16SAMPLER2DSHADOW = 489,
F16SAMPLER1DARRAYSHADOW = 490,
F16SAMPLER2DARRAYSHADOW = 491,
F16SAMPLER2DRECTSHADOW = 492,
F16SAMPLERCUBESHADOW = 493,
F16SAMPLERCUBEARRAYSHADOW = 494,
SAMPLER = 495,
SAMPLERSHADOW = 496,
TEXTURE1D = 497,
TEXTURE2D = 498,
TEXTURE3D = 499,
TEXTURECUBE = 500,
TEXTURE1DARRAY = 501,
TEXTURE2DARRAY = 502,
ITEXTURE1D = 503,
ITEXTURE2D = 504,
ITEXTURE3D = 505,
ITEXTURECUBE = 506,
ITEXTURE1DARRAY = 507,
ITEXTURE2DARRAY = 508,
UTEXTURE1D = 509,
UTEXTURE2D = 510,
UTEXTURE3D = 511,
UTEXTURECUBE = 512,
UTEXTURE1DARRAY = 513,
UTEXTURE2DARRAY = 514,
TEXTURE2DRECT = 515,
ITEXTURE2DRECT = 516,
UTEXTURE2DRECT = 517,
TEXTUREBUFFER = 518,
ITEXTUREBUFFER = 519,
UTEXTUREBUFFER = 520,
TEXTURECUBEARRAY = 521,
ITEXTURECUBEARRAY = 522,
UTEXTURECUBEARRAY = 523,
TEXTURE2DMS = 524,
ITEXTURE2DMS = 525,
UTEXTURE2DMS = 526,
TEXTURE2DMSARRAY = 527,
ITEXTURE2DMSARRAY = 528,
UTEXTURE2DMSARRAY = 529,
F16TEXTURE1D = 530,
F16TEXTURE2D = 531,
F16TEXTURE3D = 532,
F16TEXTURE2DRECT = 533,
F16TEXTURECUBE = 534,
F16TEXTURE1DARRAY = 535,
F16TEXTURE2DARRAY = 536,
F16TEXTURECUBEARRAY = 537,
F16TEXTUREBUFFER = 538,
F16TEXTURE2DMS = 539,
F16TEXTURE2DMSARRAY = 540,
SUBPASSINPUT = 541,
SUBPASSINPUTMS = 542,
ISUBPASSINPUT = 543,
ISUBPASSINPUTMS = 544,
USUBPASSINPUT = 545,
USUBPASSINPUTMS = 546,
F16SUBPASSINPUT = 547,
F16SUBPASSINPUTMS = 548,
IMAGE1D = 549,
IIMAGE1D = 550,
UIMAGE1D = 551,
IMAGE2D = 552,
IIMAGE2D = 553,
UIMAGE2D = 554,
IMAGE3D = 555,
IIMAGE3D = 556,
UIMAGE3D = 557,
IMAGE2DRECT = 558,
IIMAGE2DRECT = 559,
UIMAGE2DRECT = 560,
IMAGECUBE = 561,
IIMAGECUBE = 562,
UIMAGECUBE = 563,
IMAGEBUFFER = 564,
IIMAGEBUFFER = 565,
UIMAGEBUFFER = 566,
IMAGE1DARRAY = 567,
IIMAGE1DARRAY = 568,
UIMAGE1DARRAY = 569,
IMAGE2DARRAY = 570,
IIMAGE2DARRAY = 571,
UIMAGE2DARRAY = 572,
IMAGECUBEARRAY = 573,
IIMAGECUBEARRAY = 574,
UIMAGECUBEARRAY = 575,
IMAGE2DMS = 576,
IIMAGE2DMS = 577,
UIMAGE2DMS = 578,
IMAGE2DMSARRAY = 579,
IIMAGE2DMSARRAY = 580,
UIMAGE2DMSARRAY = 581,
F16IMAGE1D = 582,
F16IMAGE2D = 583,
F16IMAGE3D = 584,
F16IMAGE2DRECT = 585,
F16IMAGECUBE = 586,
F16IMAGE1DARRAY = 587,
F16IMAGE2DARRAY = 588,
F16IMAGECUBEARRAY = 589,
F16IMAGEBUFFER = 590,
F16IMAGE2DMS = 591,
F16IMAGE2DMSARRAY = 592,
STRUCT = 593,
VOID = 594,
WHILE = 595,
IDENTIFIER = 596,
TYPE_NAME = 597,
FLOATCONSTANT = 598,
DOUBLECONSTANT = 599,
INT16CONSTANT = 600,
UINT16CONSTANT = 601,
INT32CONSTANT = 602,
UINT32CONSTANT = 603,
INTCONSTANT = 604,
UINTCONSTANT = 605,
INT64CONSTANT = 606,
UINT64CONSTANT = 607,
BOOLCONSTANT = 608,
FLOAT16CONSTANT = 609,
LEFT_OP = 610,
RIGHT_OP = 611,
INC_OP = 612,
DEC_OP = 613,
LE_OP = 614,
GE_OP = 615,
EQ_OP = 616,
NE_OP = 617,
AND_OP = 618,
OR_OP = 619,
XOR_OP = 620,
MUL_ASSIGN = 621,
DIV_ASSIGN = 622,
ADD_ASSIGN = 623,
MOD_ASSIGN = 624,
LEFT_ASSIGN = 625,
RIGHT_ASSIGN = 626,
AND_ASSIGN = 627,
XOR_ASSIGN = 628,
OR_ASSIGN = 629,
SUB_ASSIGN = 630,
LEFT_PAREN = 631,
RIGHT_PAREN = 632,
LEFT_BRACKET = 633,
RIGHT_BRACKET = 634,
LEFT_BRACE = 635,
RIGHT_BRACE = 636,
DOT = 637,
COMMA = 638,
COLON = 639,
EQUAL = 640,
SEMICOLON = 641,
BANG = 642,
DASH = 643,
TILDE = 644,
PLUS = 645,
STAR = 646,
SLASH = 647,
PERCENT = 648,
LEFT_ANGLE = 649,
RIGHT_ANGLE = 650,
VERTICAL_BAR = 651,
CARET = 652,
AMPERSAND = 653,
QUESTION = 654,
INVARIANT = 655,
PRECISE = 656,
HIGH_PRECISION = 657,
MEDIUM_PRECISION = 658,
LOW_PRECISION = 659,
PRECISION = 660,
PACKED = 661,
RESOURCE = 662,
SUPERP = 663
};
#endif
@@ -494,7 +495,7 @@ union YYSTYPE
glslang::TArraySizes* typeParameters;
} interm;
#line 498 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
#line 499 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;

View File

@@ -1098,6 +1098,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break;
case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break;
case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
default: out.debug.message(EPrefixError, "Bad aggregation op");
}
@@ -1392,6 +1394,7 @@ bool TOutputTraverser::visitBranch(TVisit /* visit*/, TIntermBranch* node)
case EOpContinue: out.debug << "Branch: Continue"; break;
case EOpReturn: out.debug << "Branch: Return"; break;
case EOpCase: out.debug << "case: "; break;
case EOpDemote: out.debug << "Demote"; break;
case EOpDefault: out.debug << "default: "; break;
default: out.debug << "Branch: Unknown Branch"; break;
}

View File

@@ -737,7 +737,7 @@ public:
// Reflection Interface
// call first, to do liveness analysis, index mapping, etc.; returns false on failure
bool buildReflection(int opts = EShReflectionDefault);
bool buildReflection(int opts = EShReflectionDefault);
unsigned getLocalSize(int dim) const; // return dim'th local size
int getReflectionIndex(const char *name) const;

View File

@@ -351,6 +351,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.shapeConvRet.frag", "main"},
{"hlsl.self_cast.frag", "main"},
{"hlsl.snorm.uav.comp", "main"},
{"hlsl.specConstant.frag", "main"},
{"hlsl.staticMemberFunction.frag", "main"},
{"hlsl.staticFuncInit.frag", "main"},
{"hlsl.store.rwbyteaddressbuffer.type.comp", "main"},

View File

@@ -294,8 +294,10 @@ INSTANTIATE_TEST_CASE_P(
"spv.bufferhandle9.frag",
"spv.bufferhandle_Error.frag",
"spv.builtInXFB.vert",
"spv.conditionalDemote.frag",
"spv.conditionalDiscard.frag",
"spv.constStruct.vert",
"spv.constConstruct.vert",
"spv.controlFlowAttributes.frag",
"spv.conversion.frag",
"spv.coopmat.comp",
@@ -303,6 +305,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.dataOut.frag",
"spv.dataOutIndirect.frag",
"spv.dataOutIndirect.vert",
"spv.demoteDisabled.frag",
"spv.deepRvalue.frag",
"spv.depthOut.frag",
"spv.discard-dce.frag",

View File

@@ -816,7 +816,8 @@ 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().isFrontEndConstant() &&
index->getQualifier().isFrontEndConstant()) {
// both base and index are front-end constants
checkIndex(loc, base->getType(), indexValue);
return intermediate.foldDereference(base, indexValue, loc);

View File

@@ -12,7 +12,7 @@
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Headers",
"subdir" : "External/spirv-tools/external/spirv-headers",
"commit" : "8b911bd2ba37677037b38c9bd286c7c05701bcda"
"commit" : "123dc278f204f8e833e1a88d31c46d0edf81d4b2"
}
]
}