mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-25 18:25:29 +00:00
Updated glslang.
This commit is contained in:
committed by
Branimir Karadžić
parent
bc976f168f
commit
37b6ea512b
+3
@@ -45,5 +45,8 @@ static const char* const E_SPV_EXT_float8 = "SPV_EXT_float8";
|
||||
static const char* const E_SPV_EXT_shader_64bit_indexing = "SPV_EXT_shader_64bit_indexing";
|
||||
static const char* const E_SPV_EXT_shader_invocation_reorder = "SPV_EXT_shader_invocation_reorder";
|
||||
static const char* const E_SPV_EXT_long_vector = "SPV_EXT_long_vector";
|
||||
static const char* const E_SPV_EXT_cooperative_matrix_maintenance1 = "SPV_EXT_cooperative_matrix_maintenance1";
|
||||
static const char* const E_SPV_EXT_ocp_microscaling_types = "SPV_EXT_ocp_microscaling_types";
|
||||
static const char* const E_SPV_EXT_split_barrier = "SPV_EXT_split_barrier";
|
||||
|
||||
#endif // #ifndef GLSLextEXT_H
|
||||
|
||||
+1
@@ -60,6 +60,7 @@ static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_A
|
||||
static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch";
|
||||
static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix";
|
||||
static const char* const E_SPV_KHR_maximal_reconvergence = "SPV_KHR_maximal_reconvergence";
|
||||
static const char* const E_SPV_KHR_opacity_micromap = "SPV_KHR_opacity_micromap";
|
||||
static const char* const E_SPV_KHR_subgroup_rotate = "SPV_KHR_subgroup_rotate";
|
||||
static const char* const E_SPV_KHR_expect_assume = "SPV_KHR_expect_assume";
|
||||
static const char* const E_SPV_EXT_replicated_composites = "SPV_EXT_replicated_composites";
|
||||
|
||||
+2
@@ -39,6 +39,8 @@ static const int GLSLextQCOMRevision = 1;
|
||||
const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing";
|
||||
//SPV_QCOM_image_processing2
|
||||
const char* const E_SPV_QCOM_image_processing2 = "SPV_QCOM_image_processing2";
|
||||
//SPV_QCOM_image_processing3
|
||||
const char* const E_SPV_QCOM_image_processing3 = "SPV_QCOM_image_processing3";
|
||||
//SPV_QCOM_cooperative_matrix_conversion
|
||||
const char* const E_SPV_QCOM_cooperative_matrix_conversion = "SPV_QCOM_cooperative_matrix_conversion";
|
||||
|
||||
|
||||
+1058
-278
File diff suppressed because it is too large
Load Diff
+1
@@ -49,6 +49,7 @@ struct SpvOptions {
|
||||
bool stripDebugInfo {false};
|
||||
bool disableOptimizer {true};
|
||||
bool optimizeSize {false};
|
||||
bool optimizePerformance {false};
|
||||
bool disassemble {false};
|
||||
bool validate {false};
|
||||
bool emitNonSemanticShaderDebugInfo {false};
|
||||
|
||||
+281
-190
@@ -66,6 +66,7 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg
|
||||
uniqueId(0),
|
||||
entryPointFunction(nullptr),
|
||||
generatingOpCodeForSpecConst(false),
|
||||
descHeapByteArrayType(NoResult),
|
||||
logger(buildLogger)
|
||||
{
|
||||
clearAccessChain();
|
||||
@@ -424,6 +425,65 @@ Id Builder::makeFloatE4M3Type()
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::makeFloatOcpMicroscalingType(uint32_t width, FPEncoding encoding, Capability cap)
|
||||
{
|
||||
// try to find it
|
||||
Instruction* type;
|
||||
for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeFloat)].size(); ++t) {
|
||||
type = groupedTypes[enumCast(Op::OpTypeFloat)][t];
|
||||
if (type->getNumOperands() != 2) {
|
||||
continue;
|
||||
}
|
||||
if (type->getImmediateOperand(0) == (unsigned)width &&
|
||||
type->getImmediateOperand(1) == encoding)
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
// not found, make it
|
||||
type = new Instruction(getUniqueId(), NoType, Op::OpTypeFloat);
|
||||
type->addImmediateOperand(width);
|
||||
type->addImmediateOperand(encoding);
|
||||
groupedTypes[enumCast(Op::OpTypeFloat)].push_back(type);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
|
||||
addExtension(spv::E_SPV_EXT_ocp_microscaling_types);
|
||||
addCapability(cap);
|
||||
|
||||
if (emitNonSemanticShaderDebugInfo)
|
||||
{
|
||||
auto const debugResultId = makeFloatDebugType(width, makeUintConstant((unsigned)encoding));
|
||||
debugTypeIdLookup[type->getResultId()] = debugResultId;
|
||||
}
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE2M1Type()
|
||||
{
|
||||
return makeFloatOcpMicroscalingType(4, FPEncoding::Float4E2M1EXT, Capability::Float4EXT);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE3M2Type()
|
||||
{
|
||||
return makeFloatOcpMicroscalingType(6, FPEncoding::Float6E3M2EXT, Capability::Float6EXT);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE2M3Type()
|
||||
{
|
||||
return makeFloatOcpMicroscalingType(6, FPEncoding::Float6E2M3EXT, Capability::Float6EXT);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatUE8M0Type()
|
||||
{
|
||||
return makeFloatOcpMicroscalingType(8, FPEncoding::Float8UnsignedE8M0EXT, Capability::Float8UnsignedE8M0EXT);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatMXINT8Type()
|
||||
{
|
||||
return makeFloatOcpMicroscalingType(8, FPEncoding::MXInt8EXT, Capability::MXInt8EXT);
|
||||
}
|
||||
|
||||
// Make a struct without checking for duplication.
|
||||
// See makeStructResultType() for non-decorated structs
|
||||
// needed as the result of some instructions, which does
|
||||
@@ -1041,6 +1101,16 @@ Id Builder::makeFloatDebugType(int const width, Id const fpEncoding)
|
||||
typeName = "floate4m3_t";
|
||||
else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float8E5M2EXT))
|
||||
typeName = "floate5m2_t";
|
||||
else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float4E2M1EXT))
|
||||
typeName = "floate2m1_t";
|
||||
else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float6E3M2EXT))
|
||||
typeName = "floate3m2_t";
|
||||
else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float6E2M3EXT))
|
||||
typeName = "floate2m3_t";
|
||||
else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float8UnsignedE8M0EXT))
|
||||
typeName = "floatue8m0_t";
|
||||
else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::MXInt8EXT))
|
||||
typeName = "floatmxint8_t";
|
||||
else
|
||||
typeName = "float";
|
||||
} else {
|
||||
@@ -2108,16 +2178,16 @@ Id Builder::makeBFloat16Constant(float bf16, bool specConstant)
|
||||
return resultId;
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE5M2Constant(float fe5m2, bool specConstant)
|
||||
template <typename SpvUtilsType>
|
||||
Id Builder::makeFloatConstantHelper(float f, Id typeId, bool specConstant)
|
||||
{
|
||||
Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant;
|
||||
Id typeId = makeFloatE5M2Type();
|
||||
|
||||
spvutils::HexFloat<spvutils::FloatProxy<float>> fVal(fe5m2);
|
||||
spvutils::HexFloat<spvutils::FloatProxy<spvutils::FloatE5M2>> fe5m2Val(0);
|
||||
fVal.castTo(fe5m2Val, spvutils::kRoundToZero);
|
||||
spvutils::HexFloat<spvutils::FloatProxy<float>> fVal(f);
|
||||
spvutils::HexFloat<spvutils::FloatProxy<SpvUtilsType>> smallFloatVal(0);
|
||||
fVal.castTo(smallFloatVal, spvutils::kRoundToZero);
|
||||
|
||||
unsigned value = fe5m2Val.value().getAsFloat().get_value();
|
||||
unsigned value = smallFloatVal.value().getAsFloat().get_value();
|
||||
|
||||
// See if we already made it. Applies only to regular constants, because specialization constants
|
||||
// must remain distinct for the purpose of applying a SpecId decoration.
|
||||
@@ -2140,16 +2210,44 @@ Id Builder::makeFloatE5M2Constant(float fe5m2, bool specConstant)
|
||||
return resultId;
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE5M2Constant(float fe5m2, bool specConstant)
|
||||
{
|
||||
return makeFloatConstantHelper<spvutils::FloatE5M2>(fe5m2, makeFloatE5M2Type(), specConstant);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE4M3Constant(float fe4m3, bool specConstant)
|
||||
{
|
||||
return makeFloatConstantHelper<spvutils::FloatE4M3>(fe4m3, makeFloatE4M3Type(), specConstant);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE2M1Constant(float fe2m1, bool specConstant)
|
||||
{
|
||||
return makeFloatConstantHelper<spvutils::FloatE2M1>(fe2m1, makeFloatE2M1Type(), specConstant);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE3M2Constant(float fe3m2, bool specConstant)
|
||||
{
|
||||
return makeFloatConstantHelper<spvutils::FloatE3M2>(fe3m2, makeFloatE3M2Type(), specConstant);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatE2M3Constant(float fe2m3, bool specConstant)
|
||||
{
|
||||
return makeFloatConstantHelper<spvutils::FloatE2M3>(fe2m3, makeFloatE2M3Type(), specConstant);
|
||||
}
|
||||
|
||||
Id Builder::makeFloatUE8M0Constant(float fue8m0, bool specConstant)
|
||||
{
|
||||
Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant;
|
||||
Id typeId = makeFloatE4M3Type();
|
||||
Id typeId = makeFloatUE8M0Type();
|
||||
|
||||
spvutils::HexFloat<spvutils::FloatProxy<float>> fVal(fe4m3);
|
||||
spvutils::HexFloat<spvutils::FloatProxy<spvutils::FloatE4M3>> fe4m3Val(0);
|
||||
fVal.castTo(fe4m3Val, spvutils::kRoundToZero);
|
||||
|
||||
unsigned value = fe4m3Val.value().getAsFloat().get_value();
|
||||
fue8m0 = std::max(fue8m0, 0.f);
|
||||
union {
|
||||
float f;
|
||||
uint32_t u;
|
||||
} un;
|
||||
un.f = fue8m0;
|
||||
// extract the exponent, this effectively rounds to zero.
|
||||
uint32_t value = un.u >> 23;
|
||||
|
||||
// See if we already made it. Applies only to regular constants, because specialization constants
|
||||
// must remain distinct for the purpose of applying a SpecId decoration.
|
||||
@@ -2166,7 +2264,40 @@ Id Builder::makeFloatE4M3Constant(float fe4m3, bool specConstant)
|
||||
|
||||
Id resultId = c->getResultId();
|
||||
if (!specConstant) {
|
||||
ScalarConstantKey key{enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0};
|
||||
ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 };
|
||||
groupedScalarConstantResultIDs[key] = resultId;
|
||||
}
|
||||
return resultId;
|
||||
}
|
||||
|
||||
Id Builder::makeFloatMXINT8Constant(float mxint8, bool specConstant)
|
||||
{
|
||||
Op opcode = specConstant ? Op::OpSpecConstant : Op::OpConstant;
|
||||
Id typeId = makeFloatMXINT8Type();
|
||||
|
||||
// clamp and convert to fixed point.
|
||||
mxint8 = std::min(mxint8, 127.f/64.f);
|
||||
mxint8 = std::max(mxint8, -127.f/64.f);
|
||||
mxint8 *= 64;
|
||||
mxint8 = roundf(mxint8);
|
||||
uint32_t value = ((int32_t)mxint8) & 0xFF;
|
||||
|
||||
// See if we already made it. Applies only to regular constants, because specialization constants
|
||||
// must remain distinct for the purpose of applying a SpecId decoration.
|
||||
if (!specConstant) {
|
||||
Id existing = findScalarConstant(Op::OpTypeFloat, opcode, typeId, value);
|
||||
if (existing)
|
||||
return existing;
|
||||
}
|
||||
|
||||
Instruction* c = new Instruction(getUniqueId(), typeId, opcode);
|
||||
c->addImmediateOperand(value);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(c));
|
||||
module.mapInstruction(c);
|
||||
|
||||
Id resultId = c->getResultId();
|
||||
if (!specConstant) {
|
||||
ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 };
|
||||
groupedScalarConstantResultIDs[key] = resultId;
|
||||
}
|
||||
return resultId;
|
||||
@@ -2231,60 +2362,23 @@ void Builder::requireNonSemanticShaderDebugInfoVersion(unsigned version)
|
||||
|
||||
Id Builder::findCompositeConstant(Op typeClass, Op opcode, Id typeId, const std::vector<Id>& comps, size_t numMembers)
|
||||
{
|
||||
Instruction* constant = nullptr;
|
||||
bool found = false;
|
||||
for (int i = 0; i < (int)groupedCompositeConstants[enumCast(typeClass)].size(); ++i) {
|
||||
constant = groupedCompositeConstants[enumCast(typeClass)][i];
|
||||
|
||||
if (constant->getTypeId() != typeId)
|
||||
continue;
|
||||
|
||||
if (constant->getOpCode() != opcode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (constant->getNumOperands() != (int)numMembers)
|
||||
continue;
|
||||
|
||||
// same contents?
|
||||
bool mismatch = false;
|
||||
for (int op = 0; op < constant->getNumOperands(); ++op) {
|
||||
if (constant->getIdOperand(op) != comps[op]) {
|
||||
mismatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (! mismatch) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
auto it = groupedCompositeConstants.find(
|
||||
CompositeConstantKey(typeClass, opcode, typeId, comps, numMembers));
|
||||
if (it != groupedCompositeConstants.end()) {
|
||||
const Instruction* constant = (*it).getInstruction();
|
||||
return constant->getResultId();
|
||||
}
|
||||
|
||||
return found ? constant->getResultId() : NoResult;
|
||||
return NoResult;
|
||||
}
|
||||
|
||||
Id Builder::findStructConstant(Id typeId, const std::vector<Id>& comps)
|
||||
Id Builder::findStructConstant(Id typeId, const std::vector<Id>& comps, size_t numMembers)
|
||||
{
|
||||
Instruction* constant = nullptr;
|
||||
bool found = false;
|
||||
for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) {
|
||||
constant = groupedStructConstants[typeId][i];
|
||||
|
||||
// same contents?
|
||||
bool mismatch = false;
|
||||
for (int op = 0; op < constant->getNumOperands(); ++op) {
|
||||
if (constant->getIdOperand(op) != comps[op]) {
|
||||
mismatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (! mismatch) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
auto it = groupedStructConstants.find(StructConstantKey(typeId, comps, numMembers));
|
||||
if (it != groupedStructConstants.end()) {
|
||||
const Instruction* constant = (*it).getInstruction();
|
||||
return constant->getResultId();
|
||||
}
|
||||
|
||||
return found ? constant->getResultId() : NoResult;
|
||||
return NoResult;
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
@@ -2326,7 +2420,7 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector<Id>& members, boo
|
||||
break;
|
||||
case Op::OpTypeStruct:
|
||||
if (! specConstant) {
|
||||
Id existing = findStructConstant(typeId, members);
|
||||
Id existing = findStructConstant(typeId, members, numMembers);
|
||||
if (existing)
|
||||
return existing;
|
||||
}
|
||||
@@ -2342,9 +2436,9 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector<Id>& members, boo
|
||||
c->addIdOperand(members[op]);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(c));
|
||||
if (typeClass == Op::OpTypeStruct)
|
||||
groupedStructConstants[typeId].push_back(c);
|
||||
groupedStructConstants.insert(StructConstantKey(c));
|
||||
else
|
||||
groupedCompositeConstants[enumCast(typeClass)].push_back(c);
|
||||
groupedCompositeConstants.insert(CompositeConstantKey(typeClass, c));
|
||||
module.mapInstruction(c);
|
||||
|
||||
return c->getResultId();
|
||||
@@ -3136,7 +3230,7 @@ Instruction* Builder::createDescHeapLoadStoreBaseRemap(Id baseId, Op op)
|
||||
// base type (from run time array)
|
||||
spv::Id resultTy = getIdOperand(baseId, 0);
|
||||
// Descriptor heap using run time array.
|
||||
if (accessChain.descHeapInfo.descHeapStorageClass != StorageClass::Max)
|
||||
if (accessChain.descHeapInfo.descStorageClass != StorageClass::Max)
|
||||
resultTy = getIdOperand(resultTy, 0);
|
||||
if (instOp != Op::OpUntypedAccessChainKHR) {
|
||||
assert(false && "Not a untyped load type");
|
||||
@@ -3153,110 +3247,64 @@ Instruction* Builder::createDescHeapLoadStoreBaseRemap(Id baseId, Op op)
|
||||
return inst;
|
||||
}
|
||||
|
||||
uint32_t Builder::isStructureHeapMember(Id id, std::vector<Id> indexChain,
|
||||
unsigned int idx, spv::BuiltIn* bt, uint32_t* firstArrIndex)
|
||||
spv::Id Builder::getOrCreateDescHeapByteArrayType()
|
||||
{
|
||||
unsigned currentIdx = idx;
|
||||
// Process types, only array types could contain no constant id operands.
|
||||
Id baseId = id;
|
||||
if (baseId == NoType)
|
||||
return 0;
|
||||
if (isPointerType(baseId))
|
||||
baseId = getContainedTypeId(baseId);
|
||||
auto baseInst = module.getInstruction(baseId);
|
||||
if (baseInst->getOpCode() == spv::Op::OpTypeArray ||
|
||||
baseInst->getOpCode() == spv::Op::OpTypeRuntimeArray) {
|
||||
if (firstArrIndex)
|
||||
*firstArrIndex = currentIdx;
|
||||
baseId = getContainedTypeId(baseId);
|
||||
baseInst = module.getInstruction(baseId);
|
||||
currentIdx++;
|
||||
}
|
||||
if (currentIdx >= indexChain.size())
|
||||
return 0;
|
||||
// Process index op.
|
||||
auto indexInst = module.getInstruction(indexChain[currentIdx]);
|
||||
if (indexInst->getOpCode() != spv::Op::OpConstant)
|
||||
return 0;
|
||||
auto index = indexInst->getImmediateOperand(0);
|
||||
for (auto dec = decorations.begin(); dec != decorations.end(); dec++) {
|
||||
if (dec->get()->getOpCode() == spv::Op::OpMemberDecorate && dec->get()->getIdOperand(0) == baseId &&
|
||||
dec->get()->getImmediateOperand(1) == index &&
|
||||
dec->get()->getImmediateOperand(2) == spv::Decoration::BuiltIn &&
|
||||
(dec->get()->getImmediateOperand(3) == (unsigned)spv::BuiltIn::ResourceHeapEXT ||
|
||||
dec->get()->getImmediateOperand(3) == (unsigned)spv::BuiltIn::SamplerHeapEXT)) {
|
||||
if (bt)
|
||||
*bt = (spv::BuiltIn)dec->get()->getImmediateOperand(3);
|
||||
return currentIdx;
|
||||
}
|
||||
}
|
||||
// New base.
|
||||
if (baseInst->getOpCode() == spv::Op::OpTypeStruct) {
|
||||
if (!baseInst->isIdOperand(index) || idx == indexChain.size() - 1)
|
||||
return 0;
|
||||
return isStructureHeapMember(baseInst->getIdOperand(index), indexChain, currentIdx + 1, bt, firstArrIndex);
|
||||
}
|
||||
if (descHeapByteArrayType != NoResult)
|
||||
return descHeapByteArrayType;
|
||||
|
||||
return 0;
|
||||
addCapability(Capability::Int8);
|
||||
descHeapByteArrayType = makeRuntimeArray(makeUintType(8));
|
||||
addDecoration(descHeapByteArrayType, Decoration::ArrayStride, 1);
|
||||
return descHeapByteArrayType;
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
Id Builder::createDescHeapAccessChain()
|
||||
{
|
||||
uint32_t rsrcOffsetIdx = accessChain.descHeapInfo.structRsrcTyOffsetCount;
|
||||
if (rsrcOffsetIdx != 0)
|
||||
accessChain.base = accessChain.descHeapInfo.structRemappedBase;
|
||||
Id base = accessChain.base;
|
||||
Id baseTy = accessChain.descHeapInfo.descHeapBaseTy;
|
||||
uint32_t explicitArrayStride = accessChain.descHeapInfo.descHeapBaseArrayStride;
|
||||
std::vector<Id>& offsets = accessChain.indexChain;
|
||||
uint32_t firstArrIndex = accessChain.descHeapInfo.structRsrcTyFirstArrIndex;
|
||||
// both typeBufferEXT and UntypedPointer only contains storage class info.
|
||||
StorageClass storageClass = (StorageClass)accessChain.descHeapInfo.descHeapStorageClass;
|
||||
// Make the untyped access chain instruction
|
||||
Instruction* chain = new Instruction(getUniqueId(), makeUntypedPointer(getStorageClass(base)), Op::OpUntypedAccessChainKHR);
|
||||
std::vector<Id>& heapOffsets = accessChain.descHeapInfo.descHeapIndexChain;
|
||||
assert(heapOffsets.size() != 0);
|
||||
|
||||
Id heapBase = accessChain.base;
|
||||
Id heapBaseTy = accessChain.descHeapInfo.descHeapBaseTy;
|
||||
Id heapBaseOffset = accessChain.descHeapInfo.descHeapBaseOffset;
|
||||
StorageClass storageClass = (StorageClass)accessChain.descHeapInfo.descStorageClass;
|
||||
|
||||
if (heapBaseOffset != NoResult) {
|
||||
const std::pair<Id, Id> cacheKey(heapBase, heapBaseOffset);
|
||||
auto cachedShiftedBase = descHeapShiftedBaseCache.find(cacheKey);
|
||||
if (cachedShiftedBase != descHeapShiftedBaseCache.end()) {
|
||||
heapBase = cachedShiftedBase->second;
|
||||
} else {
|
||||
Id shiftedBaseId = getUniqueId();
|
||||
const std::vector<Id> shiftedBaseOffsets(1, heapBaseOffset);
|
||||
heapBase = createUntypedAccessChain(getOrCreateDescHeapByteArrayType(), heapBase,
|
||||
shiftedBaseOffsets, shiftedBaseId);
|
||||
descHeapShiftedBaseCache.insert(std::make_pair(cacheKey, heapBase));
|
||||
}
|
||||
}
|
||||
|
||||
// First descriptor heap access chain
|
||||
Id chain = createUntypedAccessChain(heapBaseTy, heapBase, heapOffsets);
|
||||
|
||||
// Create OpBufferPointer for loading target buffer descriptor
|
||||
if (storageClass == spv::StorageClass::Uniform || storageClass == spv::StorageClass::StorageBuffer) {
|
||||
// For buffer and uniform heap, split first index as heap array index
|
||||
// Insert BufferPointer op and construct another access chain with following indexes.
|
||||
Id bufferTy = makeUntypedPointer(storageClass, true);
|
||||
Id strideId = NoResult;
|
||||
if (explicitArrayStride == 0) {
|
||||
strideId = createConstantSizeOfEXT(bufferTy);
|
||||
} else {
|
||||
strideId = makeUintConstant(explicitArrayStride);
|
||||
}
|
||||
Id runtimeArrTy = makeRuntimeArray(bufferTy);
|
||||
addDecorationId(runtimeArrTy, spv::Decoration::ArrayStrideIdEXT, strideId);
|
||||
chain->addIdOperand(runtimeArrTy);
|
||||
chain->addIdOperand(base);
|
||||
// We would only re-target current member resource directly to resource/sampler heap base.
|
||||
// So the previous access chain index towards final resource type is not needed?
|
||||
// In current draft, only keep the first 'array index' into last access chain index.
|
||||
// As those resource can't be declared as an array, in current first draft, array index will
|
||||
// be the second index. This will be refined later.
|
||||
chain->addIdOperand(offsets[firstArrIndex]);
|
||||
if (rsrcOffsetIdx != 0) {
|
||||
for (uint32_t i = 0; i < rsrcOffsetIdx + 1; i++) {
|
||||
if (rsrcOffsetIdx + i + 1 < offsets.size())
|
||||
offsets[i] = offsets[i + rsrcOffsetIdx + 1];
|
||||
}
|
||||
} else {
|
||||
for (uint32_t i = 0; i < offsets.size() - 1; i++) {
|
||||
offsets[i] = offsets[i + 1];
|
||||
}
|
||||
}
|
||||
for (uint32_t i = 0; i < rsrcOffsetIdx + 1; i++)
|
||||
offsets.pop_back();
|
||||
addInstruction(std::unique_ptr<Instruction>(chain));
|
||||
// Create OpBufferPointer for loading target buffer descriptor.
|
||||
Id bufferPtrTy = makePointer(storageClass, baseTy);
|
||||
// Create OpBufferPointer for the descriptor, then use a typed access chain for buffer data.
|
||||
Id descriptorTy = accessChain.descHeapInfo.descTy;
|
||||
Id bufferPtrTy = makePointer(storageClass, descriptorTy);
|
||||
Instruction* bufferDataPtr = new Instruction(getUniqueId(), bufferPtrTy, Op::OpBufferPointerEXT);
|
||||
bufferDataPtr->addIdOperand(chain->getResultId());
|
||||
bufferDataPtr->addIdOperand(chain);
|
||||
addInstruction(std::unique_ptr<Instruction>(bufferDataPtr));
|
||||
if (accessChain.descHeapInfo.descWriteonly)
|
||||
addDecoration(bufferDataPtr->getResultId(), Decoration::NonReadable);
|
||||
if (accessChain.descHeapInfo.descReadonly && storageClass == StorageClass::StorageBuffer)
|
||||
addDecoration(bufferDataPtr->getResultId(), Decoration::NonWritable);
|
||||
|
||||
std::vector<Id>& offsets = accessChain.indexChain;
|
||||
if (offsets.empty())
|
||||
return bufferDataPtr->getResultId();
|
||||
|
||||
// Form a second, typed access chain for accessing buffer data.
|
||||
Id resultTy = baseTy;
|
||||
Id resultTy = descriptorTy;
|
||||
for (int i = 0; i < (int)offsets.size(); ++i) {
|
||||
if (isStructType(resultTy)) {
|
||||
assert(isConstantScalar(offsets[i]));
|
||||
@@ -3273,23 +3321,9 @@ Id Builder::createDescHeapAccessChain()
|
||||
bufferChain->addIdOperand(offsets[i]);
|
||||
addInstruction(std::unique_ptr<Instruction>(bufferChain));
|
||||
return bufferChain->getResultId();
|
||||
} else {
|
||||
// image/sampler heap
|
||||
Id strideId = NoResult;
|
||||
if (explicitArrayStride == 0) {
|
||||
strideId = createConstantSizeOfEXT(baseTy);
|
||||
} else {
|
||||
strideId = makeUintConstant(explicitArrayStride);
|
||||
}
|
||||
Id runtimeArrTy = makeRuntimeArray(baseTy);
|
||||
addDecorationId(runtimeArrTy, spv::Decoration::ArrayStrideIdEXT, strideId);
|
||||
chain->addIdOperand(runtimeArrTy);
|
||||
chain->addIdOperand(base);
|
||||
for (int i = 0; i < (int)offsets.size(); ++i)
|
||||
chain->addIdOperand(offsets[i]);
|
||||
addInstruction(std::unique_ptr<Instruction>(chain));
|
||||
return chain->getResultId();
|
||||
}
|
||||
|
||||
return chain;
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
@@ -3310,6 +3344,24 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec
|
||||
return chain->getResultId();
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
Id Builder::createUntypedAccessChain(Id resultType, Id base, const std::vector<Id>& offsets, Id resultId)
|
||||
{
|
||||
if (resultId == NoResult)
|
||||
resultId = getUniqueId();
|
||||
|
||||
Instruction* chain = new Instruction(resultId, makeUntypedPointer(getStorageClass(base)),
|
||||
Op::OpUntypedAccessChainKHR);
|
||||
chain->reserveOperands(offsets.size() + 2);
|
||||
chain->addIdOperand(resultType);
|
||||
chain->addIdOperand(base);
|
||||
for (int i = 0; i < (int)offsets.size(); ++i)
|
||||
chain->addIdOperand(offsets[i]);
|
||||
addInstruction(std::unique_ptr<Instruction>(chain));
|
||||
|
||||
return chain->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::createArrayLength(Id base, unsigned int member, unsigned int bits)
|
||||
{
|
||||
spv::Id intType = makeUintType(bits);
|
||||
@@ -3488,6 +3540,16 @@ void Builder::createControlBarrier(Scope execution, Scope memory, MemorySemantic
|
||||
addInstruction(std::unique_ptr<Instruction>(op));
|
||||
}
|
||||
|
||||
void Builder::createSplitControlBarrier(Op opcode, Scope execution, Scope memory, MemorySemanticsMask semantics)
|
||||
{
|
||||
Instruction* op = new Instruction(opcode);
|
||||
op->reserveOperands(3);
|
||||
op->addIdOperand(makeUintConstant(execution));
|
||||
op->addIdOperand(makeUintConstant(memory));
|
||||
op->addIdOperand(makeUintConstant(semantics));
|
||||
addInstruction(std::unique_ptr<Instruction>(op));
|
||||
}
|
||||
|
||||
void Builder::createMemoryBarrier(Scope executionScope, MemorySemanticsMask memorySemantics)
|
||||
{
|
||||
Instruction* op = new Instruction(Op::OpMemoryBarrier);
|
||||
@@ -3614,6 +3676,20 @@ Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector<Id>& op
|
||||
return op->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::createSpecConstantAlignTo(Id value, Id alignment)
|
||||
{
|
||||
Id valueModAlignment = createSpecConstantOp(Op::OpUMod, makeUintType(32), {value, alignment}, {});
|
||||
Id paddingToAlignment = createSpecConstantOp(Op::OpISub, makeUintType(32), {alignment, valueModAlignment}, {});
|
||||
Id padding = createSpecConstantOp(Op::OpUMod, makeUintType(32), {paddingToAlignment, alignment}, {});
|
||||
return createSpecConstantOp(Op::OpIAdd, makeUintType(32), {value, padding}, {});
|
||||
}
|
||||
|
||||
Id Builder::createSpecConstantSelectMax(Id lhs, Id rhs)
|
||||
{
|
||||
Id lhsGreater = createSpecConstantOp(Op::OpUGreaterThan, makeBoolType(), {lhs, rhs}, {});
|
||||
return createSpecConstantOp(Op::OpSelect, makeUintType(32), {lhsGreater, lhs, rhs}, {});
|
||||
}
|
||||
|
||||
Id Builder::createFunctionCall(spv::Function* function, const std::vector<spv::Id>& args)
|
||||
{
|
||||
Instruction* op = new Instruction(getUniqueId(), function->getReturnType(), Op::OpFunctionCall);
|
||||
@@ -3782,6 +3858,8 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
texArgs.push_back(parameters.Dref);
|
||||
if (parameters.component != NoResult)
|
||||
texArgs.push_back(parameters.component);
|
||||
if (gather && parameters.gatherMode != NoResult)
|
||||
texArgs.push_back(parameters.gatherMode);
|
||||
|
||||
if (parameters.granularity != NoResult)
|
||||
texArgs.push_back(parameters.granularity);
|
||||
@@ -3856,6 +3934,8 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
if (mask != ImageOperandsMask::MaskNone)
|
||||
texArgs.insert(texArgs.begin() + optArgNum, (Id)mask);
|
||||
|
||||
bool isTextureGatherExtended = (gather && parameters.gatherMode != NoResult);
|
||||
|
||||
//
|
||||
// Set up the instruction
|
||||
//
|
||||
@@ -3876,6 +3956,8 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
|
||||
else
|
||||
if (sparse)
|
||||
opCode = Op::OpImageSparseGather;
|
||||
else if (isTextureGatherExtended)
|
||||
opCode = Op::OpImageGatherQCOM;
|
||||
else
|
||||
opCode = Op::OpImageGather;
|
||||
} else if (explicitLod) {
|
||||
@@ -4611,12 +4693,13 @@ void Builder::clearAccessChain()
|
||||
accessChain.coherentFlags.clear();
|
||||
accessChain.alignment = 0;
|
||||
accessChain.descHeapInfo.descHeapBaseTy = NoResult;
|
||||
accessChain.descHeapInfo.descHeapStorageClass = StorageClass::Max;
|
||||
accessChain.descHeapInfo.descHeapBaseOffset = NoResult;
|
||||
accessChain.descHeapInfo.descHeapIndexChain.clear();
|
||||
accessChain.descHeapInfo.descTy = NoResult;
|
||||
accessChain.descHeapInfo.descStorageClass = StorageClass::Max;
|
||||
accessChain.descHeapInfo.descReadonly = false;
|
||||
accessChain.descHeapInfo.descWriteonly = false;
|
||||
accessChain.descHeapInfo.descHeapInstId.clear();
|
||||
accessChain.descHeapInfo.descHeapBaseArrayStride = NoResult;
|
||||
accessChain.descHeapInfo.structRemappedBase = NoResult;
|
||||
accessChain.descHeapInfo.structRsrcTyOffsetCount = 0;
|
||||
accessChain.descHeapInfo.structRsrcTyFirstArrIndex = 0;
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
@@ -4693,19 +4776,22 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce
|
||||
// dynamic component should be gone
|
||||
assert(accessChain.component == NoResult);
|
||||
|
||||
// If swizzle still exists, it may be out-of-order, we must load the target vector,
|
||||
// extract and insert elements to perform writeMask and/or swizzle.
|
||||
if (accessChain.swizzle.size() > 0) {
|
||||
Id tempBaseId = createLoad(base, spv::NoPrecision);
|
||||
source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle);
|
||||
}
|
||||
|
||||
// take LSB of alignment
|
||||
alignment = alignment & ~(alignment & (alignment-1));
|
||||
if (getStorageClass(base) == StorageClass::PhysicalStorageBufferEXT) {
|
||||
memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessMask::Aligned);
|
||||
}
|
||||
|
||||
// If swizzle still exists, it may be out-of-order, we must load the target vector,
|
||||
// extract and insert elements to perform writeMask and/or swizzle.
|
||||
if (accessChain.swizzle.size() > 0) {
|
||||
// The read-modify-write load hits the same pointer as the store, so it needs the
|
||||
// same memory operands. In particular a PhysicalStorageBuffer access must carry
|
||||
// Aligned, and postProcess() expects the operand to be present to fix up.
|
||||
Id tempBaseId = createLoad(base, spv::NoPrecision, memoryAccess, scope, alignment);
|
||||
source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle);
|
||||
}
|
||||
|
||||
createStore(source, base, memoryAccess, scope, alignment);
|
||||
}
|
||||
}
|
||||
@@ -4831,7 +4917,7 @@ Id Builder::accessChainGetInferredType()
|
||||
// for descriptor heap, its base data type will be determined later,
|
||||
// according to load/store results' types.
|
||||
if (accessChain.base == NoResult || isUntypedPointer(accessChain.base) ||
|
||||
isStructureHeapMember(getTypeId(accessChain.base), accessChain.indexChain, 0) != 0)
|
||||
!accessChain.descHeapInfo.descHeapIndexChain.empty())
|
||||
return NoType;
|
||||
Id type = getTypeId(accessChain.base);
|
||||
// do initial dereference
|
||||
@@ -4946,14 +5032,13 @@ Id Builder::collapseAccessChain()
|
||||
// note that non-trivial swizzling is left pending
|
||||
|
||||
// do we have an access chain?
|
||||
if (accessChain.indexChain.size() == 0)
|
||||
if (accessChain.indexChain.size() == 0 && accessChain.descHeapInfo.descHeapIndexChain.empty())
|
||||
return accessChain.base;
|
||||
|
||||
// emit the access chain
|
||||
StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base));
|
||||
// when descHeap info is set, use another access chain process.
|
||||
if ((isUntypedPointer(accessChain.base) || accessChain.descHeapInfo.structRsrcTyOffsetCount!= 0) &&
|
||||
accessChain.descHeapInfo.descHeapStorageClass != StorageClass::Max) {
|
||||
if (isUntypedPointer(accessChain.base) || !accessChain.descHeapInfo.descHeapIndexChain.empty()) {
|
||||
accessChain.instr = createDescHeapAccessChain();
|
||||
} else {
|
||||
accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain);
|
||||
@@ -5069,10 +5154,16 @@ void Builder::createBranch(bool implicit, Block* block)
|
||||
// Create OpConstantSizeOfEXT
|
||||
Id Builder::createConstantSizeOfEXT(Id typeId)
|
||||
{
|
||||
Instruction* inst = new Instruction(getUniqueId(), makeIntType(32), Op::OpConstantSizeOfEXT);
|
||||
auto constantSize = constantSizeOfEXTIds.find(typeId);
|
||||
if (constantSize != constantSizeOfEXTIds.end())
|
||||
return constantSize->second;
|
||||
|
||||
Id resultType = makeUintType(32);
|
||||
Instruction* inst = new Instruction(getUniqueId(), resultType, Op::OpConstantSizeOfEXT);
|
||||
inst->addIdOperand(typeId);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
|
||||
module.mapInstruction(inst);
|
||||
constantSizeOfEXTIds[typeId] = inst->getResultId();
|
||||
return inst->getResultId();
|
||||
}
|
||||
|
||||
|
||||
Vendored
+294
-29
@@ -91,6 +91,230 @@ struct StructMemberDebugInfo {
|
||||
};
|
||||
|
||||
class Builder {
|
||||
class CompositeConstantKey {
|
||||
public:
|
||||
enum Kind {
|
||||
Key_Instruction,
|
||||
Key_CompositeConstant,
|
||||
};
|
||||
|
||||
CompositeConstantKey(
|
||||
Op typeClass, Instruction* instruction)
|
||||
: kind(Key_Instruction)
|
||||
, instruction(instruction)
|
||||
, typeClass(typeClass)
|
||||
, opcode(Op::OpNop)
|
||||
, typeId(NoType)
|
||||
, numMembers(0)
|
||||
, comps()
|
||||
{}
|
||||
|
||||
CompositeConstantKey(
|
||||
Op typeClass, Op opcode, Id typeId, const std::vector<Id>& comps, size_t numMembers)
|
||||
: kind(Key_CompositeConstant)
|
||||
, instruction(nullptr)
|
||||
, typeClass(typeClass)
|
||||
, opcode(opcode)
|
||||
, typeId(typeId)
|
||||
, numMembers(numMembers)
|
||||
, comps(comps)
|
||||
{}
|
||||
|
||||
Instruction* getInstruction() const {
|
||||
return instruction;
|
||||
}
|
||||
|
||||
// Functor to hash an instruction key.
|
||||
struct Hash {
|
||||
size_t operator()(CompositeConstantKey const &key) const {
|
||||
switch (key.kind) {
|
||||
case Key_Instruction:
|
||||
{
|
||||
Instruction* constant = key.instruction;
|
||||
size_t num_operands = constant->getNumOperands();
|
||||
size_t hash = std::hash<Op>()(key.typeClass) * 7 ^
|
||||
std::hash<Op>()(constant->getOpCode()) * 11 ^
|
||||
std::hash<Id>()(constant->getTypeId()) * 13 ^
|
||||
std::hash<size_t>()(num_operands) * 17;
|
||||
for (size_t i = 0; i < num_operands; ++i) {
|
||||
hash = hash * 19 ^ std::hash<Id>()(constant->getIdOperand(i));
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
case Key_CompositeConstant:
|
||||
{
|
||||
size_t hash = std::hash<Op>()(key.typeClass) * 7 ^
|
||||
std::hash<Op>()(key.opcode) * 11 ^
|
||||
std::hash<Id>()(key.typeId) * 13 ^
|
||||
std::hash<size_t>()(key.numMembers) * 17;
|
||||
for (size_t i = 0; i < key.numMembers; ++i) {
|
||||
hash = hash * 19 ^ std::hash<Id>()(key.comps[i]);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// Functor to compare two instruction keys.
|
||||
struct Equal {
|
||||
bool operator() (CompositeConstantKey const &a, CompositeConstantKey const &b) const
|
||||
{
|
||||
if (a.typeClass != b.typeClass)
|
||||
return false;
|
||||
|
||||
if (a.kind == b.kind) {
|
||||
// we need only the Instruction case, as the other keys only used for searching
|
||||
return
|
||||
a.kind == Key_Instruction &&
|
||||
a.instruction == b.instruction;
|
||||
}
|
||||
const CompositeConstantKey* s = &a;
|
||||
const CompositeConstantKey* o = &b;
|
||||
|
||||
if (s->kind == Key_CompositeConstant && o->kind == Key_Instruction) {
|
||||
s = o;
|
||||
o = &a;
|
||||
}
|
||||
|
||||
// compare a composite constant with an instruction
|
||||
if (s->kind == Key_Instruction && o->kind == Key_CompositeConstant) {
|
||||
Instruction* constant = s->instruction;
|
||||
if (constant->getTypeId() != o->typeId)
|
||||
return false;
|
||||
|
||||
if (constant->getOpCode() != o->opcode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (constant->getNumOperands() != (int)o->numMembers)
|
||||
return false;
|
||||
|
||||
// same contents?
|
||||
for (int op = 0; op < constant->getNumOperands(); ++op) {
|
||||
if (constant->getIdOperand(op) != o->comps[op]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
Kind kind;
|
||||
Instruction* instruction;
|
||||
Op typeClass;
|
||||
Op opcode;
|
||||
Id typeId;
|
||||
size_t numMembers;
|
||||
std::vector<Id> comps;
|
||||
};
|
||||
|
||||
class StructConstantKey {
|
||||
public:
|
||||
enum Kind {
|
||||
Key_Instruction,
|
||||
Key_StructConstant,
|
||||
};
|
||||
|
||||
StructConstantKey(
|
||||
Instruction* instruction)
|
||||
: kind(Key_Instruction)
|
||||
, instruction(instruction)
|
||||
, typeId(NoType)
|
||||
, numMembers(0)
|
||||
, comps()
|
||||
{}
|
||||
|
||||
StructConstantKey(
|
||||
Id typeId, const std::vector<Id>& comps, size_t numMembers)
|
||||
: kind(Key_StructConstant)
|
||||
, instruction(nullptr)
|
||||
, typeId(typeId)
|
||||
, numMembers(numMembers)
|
||||
, comps(comps)
|
||||
{}
|
||||
|
||||
Instruction* getInstruction() const {
|
||||
return instruction;
|
||||
}
|
||||
|
||||
// Functor to hash an instruction key.
|
||||
struct Hash {
|
||||
size_t operator()(StructConstantKey const &key) const {
|
||||
switch (key.kind) {
|
||||
case Key_Instruction:
|
||||
{
|
||||
Instruction* constant = key.instruction;
|
||||
size_t hash = std::hash<Id>()(constant->getTypeId()) * 13;
|
||||
for (size_t i = 0, n = constant->getNumOperands(); i < n; ++i) {
|
||||
hash = hash * 19 ^ std::hash<Id>()(constant->getIdOperand(i));
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
case Key_StructConstant:
|
||||
{
|
||||
size_t hash = std::hash<Id>()(key.typeId) * 13;
|
||||
for (size_t i = 0; i < key.numMembers; ++i) {
|
||||
hash = hash * 19 ^ std::hash<Id>()(key.comps[i]);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// Functor to compare two instruction keys.
|
||||
struct Equal {
|
||||
bool operator() (StructConstantKey const &a, StructConstantKey const &b) const
|
||||
{
|
||||
if (a.kind == b.kind) {
|
||||
// we need only the Instruction case, as the other keys only used for searching
|
||||
return
|
||||
a.kind == Key_Instruction &&
|
||||
a.instruction == b.instruction;
|
||||
}
|
||||
const StructConstantKey* s = &a;
|
||||
const StructConstantKey* o = &b;
|
||||
|
||||
if (s->kind == Key_StructConstant && o->kind == Key_Instruction) {
|
||||
s = o;
|
||||
o = &a;
|
||||
}
|
||||
|
||||
// compare a composite constant with an instruction
|
||||
if (s->kind == Key_Instruction && o->kind == Key_StructConstant) {
|
||||
Instruction* constant = s->instruction;
|
||||
if (constant->getTypeId() != o->typeId)
|
||||
return false;
|
||||
|
||||
if (constant->getNumOperands() != (int)o->numMembers)
|
||||
return false;
|
||||
|
||||
// same contents?
|
||||
for (int op = 0; op < constant->getNumOperands(); ++op) {
|
||||
if (constant->getIdOperand(op) != o->comps[op]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
Kind kind;
|
||||
Instruction* instruction;
|
||||
Id typeId;
|
||||
size_t numMembers;
|
||||
std::vector<Id> comps;
|
||||
};
|
||||
|
||||
public:
|
||||
Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger);
|
||||
virtual ~Builder();
|
||||
@@ -238,6 +462,12 @@ public:
|
||||
Id makeBFloat16Type();
|
||||
Id makeFloatE5M2Type();
|
||||
Id makeFloatE4M3Type();
|
||||
Id makeFloatE2M1Type();
|
||||
Id makeFloatE3M2Type();
|
||||
Id makeFloatE2M3Type();
|
||||
Id makeFloatUE8M0Type();
|
||||
Id makeFloatMXINT8Type();
|
||||
Id makeFloatOcpMicroscalingType(uint32_t width, FPEncoding encoding, Capability cap);
|
||||
Id makeStructType(const std::vector<Id>& members, const std::vector<spv::StructMemberDebugInfo>& memberDebugInfo,
|
||||
const char* name, bool const compilerGenerated = true);
|
||||
Id makeStructResultType(Id type0, Id type1);
|
||||
@@ -456,6 +686,11 @@ public:
|
||||
Id makeBFloat16Constant(float bf16, bool specConstant = false);
|
||||
Id makeFloatE5M2Constant(float fe5m2, bool specConstant = false);
|
||||
Id makeFloatE4M3Constant(float fe4m3, bool specConstant = false);
|
||||
Id makeFloatE2M1Constant(float fe2m1, bool specConstant = false);
|
||||
Id makeFloatE3M2Constant(float fe3m2, bool specConstant = false);
|
||||
Id makeFloatE2M3Constant(float fe2m3, bool specConstant = false);
|
||||
Id makeFloatUE8M0Constant(float fue8m0, bool specConstant = false);
|
||||
Id makeFloatMXINT8Constant(float mxint8, bool specConstant = false);
|
||||
Id makeFpConstant(Id type, double d, bool specConstant = false);
|
||||
|
||||
Id importNonSemanticShaderDebugInfoInstructions();
|
||||
@@ -492,6 +727,7 @@ public:
|
||||
// Also reset current last DebugScope and current source line to unknown
|
||||
void setBuildPoint(Block* bp) {
|
||||
buildPoint = bp;
|
||||
descHeapShiftedBaseCache.clear();
|
||||
dirtyLineTracker = true;
|
||||
dirtyScopeTracker = true;
|
||||
}
|
||||
@@ -571,6 +807,9 @@ public:
|
||||
// Create an OpAccessChain instruction
|
||||
Id createAccessChain(StorageClass, Id base, const std::vector<Id>& offsets);
|
||||
|
||||
// Create an OpUntypedAccessChainKHR instruction
|
||||
Id createUntypedAccessChain(Id resultType, Id base, const std::vector<Id>& offsets, Id resultId = NoResult);
|
||||
|
||||
// Create an OpArrayLength instruction
|
||||
Id createArrayLength(Id base, unsigned int member, unsigned int bits);
|
||||
|
||||
@@ -593,6 +832,7 @@ public:
|
||||
void createNoResultOp(Op, const std::vector<Id>& operands);
|
||||
void createNoResultOp(Op, const std::vector<IdImmediate>& operands);
|
||||
void createControlBarrier(Scope execution, Scope memory, MemorySemanticsMask);
|
||||
void createSplitControlBarrier(Op op, Scope execution, Scope memory, MemorySemanticsMask memorySem);
|
||||
void createMemoryBarrier(Scope executionScope, MemorySemanticsMask memorySemantics);
|
||||
Id createUnaryOp(Op, Id typeId, Id operand);
|
||||
Id createBinOp(Op, Id typeId, Id operand1, Id operand2);
|
||||
@@ -602,6 +842,8 @@ public:
|
||||
Id createConstData(Op opCode, Id typeId, const std::vector<const char*> operands);
|
||||
Id createFunctionCall(spv::Function*, const std::vector<spv::Id>&);
|
||||
Id createSpecConstantOp(Op, Id typeId, const std::vector<spv::Id>& operands, const std::vector<unsigned>& literals);
|
||||
Id createSpecConstantAlignTo(Id value, Id alignment);
|
||||
Id createSpecConstantSelectMax(Id lhs, Id rhs);
|
||||
|
||||
// Take an rvalue (source) and a set of channels to extract from it to
|
||||
// make a new rvalue, which is returned.
|
||||
@@ -663,6 +905,7 @@ public:
|
||||
Id lodClamp;
|
||||
Id granularity;
|
||||
Id coarse;
|
||||
Id gatherMode;
|
||||
bool nonprivate;
|
||||
bool volatil;
|
||||
bool nontemporal;
|
||||
@@ -818,13 +1061,14 @@ public:
|
||||
|
||||
struct DescHeapInfo {
|
||||
Id descHeapBaseTy; // for descriptor heap, record its base data type.
|
||||
StorageClass descHeapStorageClass; // for descriptor heap, record its basic storage class.
|
||||
uint32_t descHeapBaseArrayStride; // for descriptor heap, record its explicit array stride.
|
||||
Id descHeapBaseOffset; // byte offset applied to the heap base before descriptor lookup.
|
||||
std::vector<Id> descHeapIndexChain;
|
||||
Id descTy; // for target resource type
|
||||
StorageClass descStorageClass; // for descriptor heap, record its basic storage class.
|
||||
bool descReadonly; // for decorating OpBufferPointerEXT results.
|
||||
bool descWriteonly; // for decorating OpBufferPointerEXT results.
|
||||
std::vector<Instruction*> descHeapInstId;
|
||||
// for descriptor heap, record its data type for loading/store results.
|
||||
uint32_t structRsrcTyOffsetCount;
|
||||
uint32_t structRsrcTyFirstArrIndex;
|
||||
Id structRemappedBase;
|
||||
};
|
||||
DescHeapInfo descHeapInfo;
|
||||
|
||||
@@ -891,13 +1135,32 @@ public:
|
||||
AccessChain getAccessChain() { return accessChain; }
|
||||
void setAccessChain(AccessChain newChain) { accessChain = newChain; }
|
||||
|
||||
// for EXT_descriptor_heap and EXT_structured_descriptor_heap
|
||||
Id getAccessChainDescHeapBaseType() const { return accessChain.descHeapInfo.descHeapBaseTy; }
|
||||
void setAccessChainDescHeapBaseType(Id baseType) { accessChain.descHeapInfo.descHeapBaseTy = baseType; }
|
||||
void setAccessChainDescHeapBaseOffset(Id baseOffset) { accessChain.descHeapInfo.descHeapBaseOffset = baseOffset; }
|
||||
const std::vector<Id>& getAccessChainDescHeapIndexChain() const { return accessChain.descHeapInfo.descHeapIndexChain; }
|
||||
void accessChainPushDescHeapIndex(Id index) { accessChain.descHeapInfo.descHeapIndexChain.push_back(index); }
|
||||
bool hasAccessChainIndex() const { return !accessChain.indexChain.empty(); }
|
||||
void moveAccessChainIndexToDescHeapIndexChain()
|
||||
{
|
||||
assert(accessChain.indexChain.size() == 1);
|
||||
accessChainPushDescHeapIndex(accessChain.indexChain.back());
|
||||
accessChain.indexChain.pop_back();
|
||||
}
|
||||
void setAccessChainDescHeapDescriptorType(Id descTy, StorageClass storageClass, bool readonly, bool writeonly)
|
||||
{
|
||||
accessChain.descHeapInfo.descTy = descTy;
|
||||
accessChain.descHeapInfo.descStorageClass = storageClass;
|
||||
accessChain.descHeapInfo.descReadonly = readonly;
|
||||
accessChain.descHeapInfo.descWriteonly = writeonly;
|
||||
}
|
||||
|
||||
// clear accessChain
|
||||
void clearAccessChain();
|
||||
|
||||
Id createDescHeapAccessChain();
|
||||
Id createConstantSizeOfEXT(Id typeId);
|
||||
uint32_t isStructureHeapMember(Id id, std::vector<Id> indexChain, unsigned int idx, spv::BuiltIn* bt = nullptr,
|
||||
uint32_t* firstArrIndex = nullptr);
|
||||
|
||||
// set new base as an l-value base
|
||||
void setAccessChainLValue(Id lValue)
|
||||
@@ -913,25 +1176,6 @@ public:
|
||||
accessChain.base = rValue;
|
||||
}
|
||||
|
||||
// set access chain info for untyped descriptor heap variable
|
||||
void setAccessChainDescHeapInfo(StorageClass storageClass = StorageClass::Max, Id baseTy = NoResult,
|
||||
uint32_t explicitArrayStride = NoResult, uint32_t structRsrcTyOffsetCount = 0,
|
||||
spv::Id structRemappedBase = NoResult, uint32_t firstArrIndex = NoResult)
|
||||
{
|
||||
if (accessChain.descHeapInfo.descHeapStorageClass == StorageClass::Max)
|
||||
accessChain.descHeapInfo.descHeapStorageClass = storageClass;
|
||||
if (accessChain.descHeapInfo.descHeapBaseTy == NoResult)
|
||||
accessChain.descHeapInfo.descHeapBaseTy = baseTy;
|
||||
if (accessChain.descHeapInfo.descHeapBaseArrayStride == NoResult)
|
||||
accessChain.descHeapInfo.descHeapBaseArrayStride = explicitArrayStride;
|
||||
if (accessChain.descHeapInfo.structRemappedBase == NoResult)
|
||||
accessChain.descHeapInfo.structRemappedBase = structRemappedBase;
|
||||
if (accessChain.descHeapInfo.structRsrcTyOffsetCount == 0)
|
||||
accessChain.descHeapInfo.structRsrcTyOffsetCount = structRsrcTyOffsetCount;
|
||||
if (accessChain.descHeapInfo.structRsrcTyFirstArrIndex == 0)
|
||||
accessChain.descHeapInfo.structRsrcTyFirstArrIndex = firstArrIndex;
|
||||
}
|
||||
|
||||
// push offset onto the end of the chain
|
||||
void accessChainPush(Id offset, AccessChain::CoherentFlags coherentFlags, unsigned int alignment)
|
||||
{
|
||||
@@ -1022,8 +1266,9 @@ protected:
|
||||
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value);
|
||||
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2);
|
||||
Id findCompositeConstant(Op typeClass, Op opcode, Id typeId, const std::vector<Id>& comps, size_t numMembers);
|
||||
Id findStructConstant(Id typeId, const std::vector<Id>& comps);
|
||||
Id findStructConstant(Id typeId, const std::vector<Id>& comps, size_t numMembers);
|
||||
Id collapseAccessChain();
|
||||
Id getOrCreateDescHeapByteArrayType();
|
||||
void remapDynamicSwizzle();
|
||||
void transferAccessChainSwizzle(bool dynamic);
|
||||
void simplifyAccessChainSwizzle();
|
||||
@@ -1038,6 +1283,8 @@ protected:
|
||||
struct DecorationInstructionLessThan {
|
||||
bool operator()(const std::unique_ptr<Instruction>& lhs, const std::unique_ptr<Instruction>& rhs) const;
|
||||
};
|
||||
template <typename SpvUtilsType>
|
||||
Id makeFloatConstantHelper(float f, Id typeId, bool specConstant);
|
||||
|
||||
unsigned int spvVersion; // the version of SPIR-V to emit in the header
|
||||
SourceLanguage sourceLang;
|
||||
@@ -1159,10 +1406,20 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::unordered_set<
|
||||
CompositeConstantKey,
|
||||
CompositeConstantKey::Hash,
|
||||
CompositeConstantKey::Equal> CompositeConstantCache;
|
||||
|
||||
typedef std::unordered_set<
|
||||
StructConstantKey,
|
||||
StructConstantKey::Hash,
|
||||
StructConstantKey::Equal> StructConstantCache;
|
||||
|
||||
// map type opcodes to constant inst.
|
||||
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedCompositeConstants;
|
||||
CompositeConstantCache groupedCompositeConstants;
|
||||
// map struct-id to constant instructions
|
||||
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedStructConstants;
|
||||
StructConstantCache groupedStructConstants;
|
||||
// map type opcodes to type instructions
|
||||
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedTypes;
|
||||
// map type opcodes to debug type instructions
|
||||
@@ -1171,6 +1428,14 @@ protected:
|
||||
std::vector<Instruction*> nullConstants;
|
||||
// map scalar constants to result IDs
|
||||
std::unordered_map<ScalarConstantKey, Id, ScalarConstantKeyHash> groupedScalarConstantResultIDs;
|
||||
// map type ids to OpConstantSizeOfEXT result IDs
|
||||
std::unordered_map<Id, Id> constantSizeOfEXTIds;
|
||||
|
||||
// Descriptor heap shifted base cache.
|
||||
std::map<std::pair<Id, Id>, Id> descHeapShiftedBaseCache;
|
||||
|
||||
// Descriptor heap byte array type.
|
||||
Id descHeapByteArrayType;
|
||||
|
||||
// Track which types have explicit layouts, to avoid reusing in storage classes without layout.
|
||||
// Currently only tracks array types.
|
||||
|
||||
+3
-2
@@ -554,8 +554,9 @@ void Builder::postProcessFeatures() {
|
||||
}
|
||||
|
||||
// Add Aliased decoration if there's more than one Workgroup Block variable.
|
||||
if (capabilities.find(spv::Capability::WorkgroupMemoryExplicitLayoutKHR) != capabilities.end()) {
|
||||
assert(entryPoints.size() == 1);
|
||||
// Compile-only mode emits no entry point, so there is no interface to scan.
|
||||
if (capabilities.find(spv::Capability::WorkgroupMemoryExplicitLayoutKHR) != capabilities.end() &&
|
||||
!entryPoints.empty()) {
|
||||
auto &ep = entryPoints[0];
|
||||
|
||||
std::vector<Id> workgroup_variables;
|
||||
|
||||
Vendored
+8
-30
@@ -183,7 +183,7 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
|
||||
|
||||
// Apply the SPIRV-Tools optimizer to generated SPIR-V. HLSL SPIR-V is legalized in the process.
|
||||
void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger* logger, const SpvOptions* options)
|
||||
spv::SpvBuildLogger* logger, const SpvOptions* options, bool prelegalization)
|
||||
{
|
||||
spv_target_env target_env = MapToSpirvToolsEnv(intermediate.getSpv(), logger);
|
||||
|
||||
@@ -197,35 +197,13 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
|
||||
if (options->stripDebugInfo) {
|
||||
optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass());
|
||||
}
|
||||
optimizer.RegisterPass(spvtools::CreateWrapOpKillPass());
|
||||
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
|
||||
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadFunctionsPass());
|
||||
optimizer.RegisterPass(spvtools::CreateScalarReplacementPass());
|
||||
optimizer.RegisterPass(spvtools::CreateLocalAccessChainConvertPass());
|
||||
optimizer.RegisterPass(spvtools::CreateLocalSingleBlockLoadStoreElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateLocalSingleStoreElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateSimplificationPass());
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateVectorDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateBlockMergePass());
|
||||
optimizer.RegisterPass(spvtools::CreateLocalMultiStoreElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateIfConversionPass());
|
||||
optimizer.RegisterPass(spvtools::CreateSimplificationPass());
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateVectorDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
|
||||
optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass());
|
||||
if (options->optimizeSize) {
|
||||
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
|
||||
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsSafePass());
|
||||
}
|
||||
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
|
||||
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
|
||||
|
||||
if (prelegalization)
|
||||
optimizer.RegisterLegalizationPasses();
|
||||
if (options->optimizePerformance)
|
||||
optimizer.RegisterPerformancePasses();
|
||||
if (options->optimizeSize)
|
||||
optimizer.RegisterSizePasses();
|
||||
|
||||
spvtools::OptimizerOptions spvOptOptions;
|
||||
if (options->optimizerAllowExpandedIDBound)
|
||||
|
||||
Vendored
+1
-1
@@ -76,7 +76,7 @@ GLSLANG_EXPORT void SpirvToolsValidate(const glslang::TIntermediate& intermediat
|
||||
|
||||
// Apply the SPIRV-Tools optimizer to generated SPIR-V. HLSL SPIR-V is legalized in the process.
|
||||
GLSLANG_EXPORT void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||
spv::SpvBuildLogger*, const SpvOptions*);
|
||||
spv::SpvBuildLogger*, const SpvOptions*, bool prelegalization);
|
||||
|
||||
// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|.
|
||||
GLSLANG_EXPORT void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv,
|
||||
|
||||
+22
@@ -199,6 +199,9 @@ void SpirvStream::processInstructions()
|
||||
resultId = stream[word++];
|
||||
--numOperands;
|
||||
|
||||
if (resultId >= bound)
|
||||
Kill(out, "Bad <id>");
|
||||
|
||||
// save instruction for future reference
|
||||
idInstruction[resultId] = instructionStart;
|
||||
}
|
||||
@@ -382,6 +385,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
break;
|
||||
case Op::OpTypeFloat:
|
||||
switch (stream[word]) {
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
case 16:
|
||||
if (numOperands > 1) {
|
||||
@@ -397,6 +402,21 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
case (int)spv::FPEncoding::Float8E5M2EXT:
|
||||
idDescriptor[resultId] = "floate5m2_t";
|
||||
break;
|
||||
case (int)spv::FPEncoding::Float4E2M1EXT:
|
||||
idDescriptor[resultId] = "floate2m1_t";
|
||||
break;
|
||||
case (int)spv::FPEncoding::Float6E3M2EXT:
|
||||
idDescriptor[resultId] = "floate3m2_t";
|
||||
break;
|
||||
case (int)spv::FPEncoding::Float6E2M3EXT:
|
||||
idDescriptor[resultId] = "floate2m3_t";
|
||||
break;
|
||||
case (int)spv::FPEncoding::Float8UnsignedE8M0EXT:
|
||||
idDescriptor[resultId] = "floatue8m0_t";
|
||||
break;
|
||||
case (int)spv::FPEncoding::MXInt8EXT:
|
||||
idDescriptor[resultId] = "floatmxint8_t";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
idDescriptor[resultId] = "float16_t";
|
||||
@@ -418,6 +438,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
idDescriptor[resultId] = "ptr";
|
||||
break;
|
||||
case Op::OpTypeVector:
|
||||
if (stream[word] >= bound)
|
||||
Kill(out, "Bad <id>");
|
||||
if (idDescriptor[stream[word]].size() > 0) {
|
||||
if (idDescriptor[stream[word]].substr(0,2) == "bf") {
|
||||
idDescriptor[resultId].append(idDescriptor[stream[word]].begin(), idDescriptor[stream[word]].begin() + 2);
|
||||
|
||||
Vendored
+84
-38
@@ -236,6 +236,8 @@ const char* ExecutionModeString(int mode)
|
||||
|
||||
case (int)ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT";
|
||||
|
||||
case (int)ExecutionMode::OpacityMicromapIdKHR: return "OpacityMicromapIdKHR";
|
||||
|
||||
case ExecutionModeCeiling:
|
||||
default: return "Bad";
|
||||
}
|
||||
@@ -357,9 +359,11 @@ const char* DecorationString(int decoration)
|
||||
case (int)Decoration::BankNV: return "BankNV";
|
||||
case (int)Decoration::MemberOffsetNV: return "MemberOffsetNV";
|
||||
|
||||
case (int)Decoration::ArrayStrideIdEXT: return "DecorationArrayStrideIdEXT";
|
||||
case (int)Decoration::OffsetIdEXT: return "DecorationOffsetIdEXT";
|
||||
case (int)Decoration::ArrayStrideIdEXT: return "ArrayStrideIdEXT";
|
||||
case (int)Decoration::OffsetIdEXT: return "OffsetIdEXT";
|
||||
case (int)Decoration::UTFEncodedKHR: return "UTFEncodedKHR";
|
||||
|
||||
case (int)Decoration::CooperativeMatrixTransposeEXT: return "DecorationCooperativeMatrixTransposeEXT";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,6 +786,7 @@ const char* LoopControlString(int cont)
|
||||
case (int)LoopControlShift::IterationMultiple: return "IterationMultiple";
|
||||
case (int)LoopControlShift::PeelCount: return "PeelCount";
|
||||
case (int)LoopControlShift::PartialCount: return "PartialCount";
|
||||
case (int)LoopControlShift::MultipleWaitQueuesQCOM: return "MultipeWaitQueuesQCOM";
|
||||
|
||||
case LoopControlCeiling:
|
||||
default: return "Bad";
|
||||
@@ -1040,6 +1045,7 @@ const char* CapabilityString(int info)
|
||||
case (int)Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR";
|
||||
case (int)Capability::DisplacementMicromapNV: return "DisplacementMicromapNV";
|
||||
case (int)Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT";
|
||||
case (int)Capability::RayTracingOpacityMicromapExecutionModeKHR: return "RayTracingOpacityMicromapExecutionModeKHR";
|
||||
case (int)Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV";
|
||||
case (int)Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
|
||||
// ComputeDerivativeGroupQuadsKHR is an alias of ComputeDerivativeGroupQuadsNV
|
||||
@@ -1085,6 +1091,8 @@ const char* CapabilityString(int info)
|
||||
case (int)Capability::CooperativeMatrixBlockLoadsNV: return "CooperativeMatrixBlockLoadsNV";
|
||||
case (int)Capability::CooperativeMatrixDecodeVectorNV: return "CooperativeMatrixDecodeVectorNV";
|
||||
case (int)Capability::TensorAddressingNV: return "TensorAddressingNV";
|
||||
case (int)Capability::CooperativeMatrixConversionsEXT: return "CooperativeMatrixConversionsEXT";
|
||||
case (int)Capability::CooperativeMatrixGetCoordinateEXT: return "CooperativeMatrixGetCoordinateEXT";
|
||||
|
||||
case (int)Capability::ShaderSMBuiltinsNV: return "ShaderSMBuiltinsNV";
|
||||
|
||||
@@ -1140,6 +1148,8 @@ const char* CapabilityString(int info)
|
||||
case (int)Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM";
|
||||
|
||||
case (int)Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM";
|
||||
case (int)Capability::ImageGatherLinearQCOM: return "ImageGatherLinearQCOM";
|
||||
case (int)Capability::ImageGatherExtendedModesQCOM: return "ImageGatherExtendedModesQCOM";
|
||||
|
||||
case (int)Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT";
|
||||
|
||||
@@ -1164,6 +1174,13 @@ const char* CapabilityString(int info)
|
||||
|
||||
case (int)Capability::Shader64BitIndexingEXT: return "CapabilityShader64BitIndexingEXT";
|
||||
case (int)Capability::LongVectorEXT: return "LongVectorEXT";
|
||||
case (int)Capability::SplitBarrierEXT: return "SplitBarrierEXT";
|
||||
|
||||
case (int)Capability::Float4EXT: return "Float4EXT";
|
||||
case (int)Capability::Float6EXT: return "Float6EXT";
|
||||
case (int)Capability::Float8UnsignedE8M0EXT: return "Float8UnsignedE8M0EXT";
|
||||
case (int)Capability::MXInt8EXT: return "MXInt8EXT";
|
||||
case (int)Capability::BitcastExtractEXT: return "BitcastExtractEXT";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
@@ -1670,6 +1687,7 @@ const char* OpcodeString(int op)
|
||||
case (int)Op::OpTensorViewSetDimensionNV: return "OpTensorViewSetDimensionNV";
|
||||
case (int)Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV";
|
||||
case (int)Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV";
|
||||
case (int)Op::OpCooperativeMatrixGetCoordinateEXT: return "OpCooperativeMatrixGetCoordinateEXT";
|
||||
|
||||
case (int)Op::OpTypeTensorARM: return "OpTypeTensorARM";
|
||||
case (int)Op::OpTensorReadARM: return "OpTensorReadARM";
|
||||
@@ -1743,6 +1761,7 @@ const char* OpcodeString(int op)
|
||||
case (int)Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM";
|
||||
case (int)Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM";
|
||||
case (int)Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM";
|
||||
case (int)Op::OpImageGatherQCOM: return "OpImageGatherQCOM";
|
||||
|
||||
case (int)Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM";
|
||||
case (int)Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM";
|
||||
@@ -1797,6 +1816,10 @@ const char* OpcodeString(int op)
|
||||
case (int)Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT";
|
||||
case (int)Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT";
|
||||
|
||||
case (int)Op::OpBitcastExtractEXT: return "OpBitcastExtractEXT";
|
||||
case (int)Op::OpControlBarrierArriveEXT: return "OpControlBarrierArriveEXT";
|
||||
case (int)Op::OpControlBarrierWaitEXT: return "OpControlBarrierWaitEXT";
|
||||
|
||||
default:
|
||||
return "Bad";
|
||||
}
|
||||
@@ -1885,6 +1908,8 @@ void Parameterize()
|
||||
InstructionDesc[enumCast(Op::OpEmitStreamVertex)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpEndStreamPrimitive)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpControlBarrier)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierArriveEXT)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierWaitEXT)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpMemoryBarrier)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpAtomicStore)].setResultAndType(false, false);
|
||||
InstructionDesc[enumCast(Op::OpLoopMerge)].setResultAndType(false, false);
|
||||
@@ -3783,66 +3808,74 @@ void Parameterize()
|
||||
InstructionDesc[enumCast(Op::OpStencilAttachmentReadEXT)].operands.push(OperandId, "'Sample'", true);
|
||||
InstructionDesc[enumCast(Op::OpDepthAttachmentReadEXT)].operands.push(OperandId, "'Sample'", true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'source texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'texture coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'weights texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'Source Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'Texture Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandId, "'Weights Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageSampleWeightedQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'source texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'texture coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'box size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'Source Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'Texture Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandId, "'Box Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBoxFilterQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'target texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'target coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'reference texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'reference coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'block size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'Target Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'Target Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'Reference Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'Reference Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandId, "'Block Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSADQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'target texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'target coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'reference texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'reference coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'block size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'Target Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'Target Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'Reference Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'Reference Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandId, "'Block Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchSSDQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'target texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'target coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'reference texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'reference coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'block size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'Target Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'Target Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'Reference Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'Reference Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandId, "'Block Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSSDQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'target texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'target coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'reference texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'reference coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'block size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'Target Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'Target Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'Reference Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'Reference Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandId, "'Block Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchWindowSADQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'target texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'target coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'reference texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'reference coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'block size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'Target Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'Target Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'Reference Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'Reference Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandId, "'Block Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSSDQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'target texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'target coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'reference texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'reference coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'block size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'Target Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'Target Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'Reference Texture'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'Reference Coordinates'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandId, "'Block Size'");
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].operands.push(OperandId, "'Sampled Image'");
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].operands.push(OperandId, "'Coordinate'");
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].operands.push(OperandId, "'Component'");
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].operands.push(OperandId, "'Mode'");
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].operands.push(OperandImageOperands, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].operands.push(OperandVariableIds, "", true);
|
||||
InstructionDesc[enumCast(Op::OpImageGatherQCOM)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpBitCastArrayQCOM)].operands.push(OperandId, "'source array'");
|
||||
InstructionDesc[enumCast(Op::OpBitCastArrayQCOM)].setResultAndType(true, true);
|
||||
|
||||
@@ -3872,6 +3905,9 @@ void Parameterize()
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixPerElementOpNV)].operands.push(OperandId, "'Operation'");
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixPerElementOpNV)].operands.push(OperandVariableIds, "'Operands'");
|
||||
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixGetCoordinateEXT)].operands.push(OperandId, "'Matrix'");
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixGetCoordinateEXT)].operands.push(OperandId, "'Index'");
|
||||
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandId, "'Pointer'");
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandId, "'Object'");
|
||||
InstructionDesc[enumCast(Op::OpCooperativeMatrixLoadTensorNV)].operands.push(OperandId, "'TensorLayout'");
|
||||
@@ -4151,6 +4187,16 @@ void Parameterize()
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpBitcastExtractEXT)].operands.push(OperandId, "'Base'");
|
||||
InstructionDesc[enumCast(Op::OpBitcastExtractEXT)].operands.push(OperandId, "'Offset'");
|
||||
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierArriveEXT)].operands.push(OperandScope, "'Execution'");
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierArriveEXT)].operands.push(OperandScope, "'Memory'");
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierArriveEXT)].operands.push(OperandMemorySemantics, "'Semantics'");
|
||||
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierWaitEXT)].operands.push(OperandScope, "'Execution'");
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierWaitEXT)].operands.push(OperandScope, "'Memory'");
|
||||
InstructionDesc[enumCast(Op::OpControlBarrierWaitEXT)].operands.push(OperandMemorySemantics, "'Semantics'");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+164
-5
@@ -96,6 +96,81 @@ class FloatE4M3 {
|
||||
uint8_t val;
|
||||
};
|
||||
|
||||
class FloatE2M1 {
|
||||
public:
|
||||
FloatE2M1(uint8_t v) : val(v) {}
|
||||
FloatE2M1() {}
|
||||
static bool isNan(const FloatE2M1& val) {
|
||||
static_cast<void>(val);
|
||||
return false;
|
||||
}
|
||||
// Returns true if the given value is any kind of infinity.
|
||||
static bool isInfinity(const FloatE2M1& val) {
|
||||
static_cast<void>(val);
|
||||
return false;
|
||||
}
|
||||
FloatE2M1(const FloatE2M1& other) { val = other.val; }
|
||||
uint8_t get_value() const { return val; }
|
||||
|
||||
// Returns the maximum normal value.
|
||||
static FloatE2M1 max() { return FloatE2M1(0x7); }
|
||||
// Returns the lowest normal value.
|
||||
static FloatE2M1 lowest() { return FloatE2M1(0xF); }
|
||||
|
||||
private:
|
||||
uint8_t val;
|
||||
};
|
||||
|
||||
class FloatE3M2 {
|
||||
public:
|
||||
FloatE3M2(uint8_t v) : val(v) {}
|
||||
FloatE3M2() {}
|
||||
static bool isNan(const FloatE3M2& val) {
|
||||
static_cast<void>(val);
|
||||
return false;
|
||||
}
|
||||
// Returns true if the given value is any kind of infinity.
|
||||
static bool isInfinity(const FloatE3M2& val) {
|
||||
static_cast<void>(val);
|
||||
return false;
|
||||
}
|
||||
FloatE3M2(const FloatE3M2& other) { val = other.val; }
|
||||
uint8_t get_value() const { return val; }
|
||||
|
||||
// Returns the maximum normal value.
|
||||
static FloatE3M2 max() { return FloatE3M2(0x1F); }
|
||||
// Returns the lowest normal value.
|
||||
static FloatE3M2 lowest() { return FloatE3M2(0x3F); }
|
||||
|
||||
private:
|
||||
uint8_t val;
|
||||
};
|
||||
|
||||
class FloatE2M3 {
|
||||
public:
|
||||
FloatE2M3(uint8_t v) : val(v) {}
|
||||
FloatE2M3() {}
|
||||
static bool isNan(const FloatE2M3& val) {
|
||||
static_cast<void>(val);
|
||||
return false;
|
||||
}
|
||||
// Returns true if the given value is any kind of infinity.
|
||||
static bool isInfinity(const FloatE2M3& val) {
|
||||
static_cast<void>(val);
|
||||
return false;
|
||||
}
|
||||
FloatE2M3(const FloatE2M3& other) { val = other.val; }
|
||||
uint8_t get_value() const { return val; }
|
||||
|
||||
// Returns the maximum normal value.
|
||||
static FloatE2M3 max() { return FloatE2M3(0x1F); }
|
||||
// Returns the lowest normal value.
|
||||
static FloatE2M3 lowest() { return FloatE2M3(0x3F); }
|
||||
|
||||
private:
|
||||
uint8_t val;
|
||||
};
|
||||
|
||||
// To specialize this type, you must override uint_type to define
|
||||
// an unsigned integer that can fit your floating point type.
|
||||
// You must also add a isNan function that returns true if
|
||||
@@ -165,6 +240,42 @@ struct FloatProxyTraits<FloatE4M3> {
|
||||
static FloatE4M3 lowest() { return FloatE4M3::lowest(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct FloatProxyTraits<FloatE2M1> {
|
||||
typedef uint8_t uint_type;
|
||||
static bool isNan(FloatE2M1 f) { return FloatE2M1::isNan(f); }
|
||||
// Returns true if the given value is any kind of infinity.
|
||||
static bool isInfinity(FloatE2M1 f) { return FloatE2M1::isInfinity(f); }
|
||||
// Returns the maximum normal value.
|
||||
static FloatE2M1 max() { return FloatE2M1::max(); }
|
||||
// Returns the lowest normal value.
|
||||
static FloatE2M1 lowest() { return FloatE2M1::lowest(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct FloatProxyTraits<FloatE3M2> {
|
||||
typedef uint8_t uint_type;
|
||||
static bool isNan(FloatE3M2 f) { return FloatE3M2::isNan(f); }
|
||||
// Returns true if the given value is any kind of infinity.
|
||||
static bool isInfinity(FloatE3M2 f) { return FloatE3M2::isInfinity(f); }
|
||||
// Returns the maximum normal value.
|
||||
static FloatE3M2 max() { return FloatE3M2::max(); }
|
||||
// Returns the lowest normal value.
|
||||
static FloatE3M2 lowest() { return FloatE3M2::lowest(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct FloatProxyTraits<FloatE2M3> {
|
||||
typedef uint8_t uint_type;
|
||||
static bool isNan(FloatE2M3 f) { return FloatE2M3::isNan(f); }
|
||||
// Returns true if the given value is any kind of infinity.
|
||||
static bool isInfinity(FloatE2M3 f) { return FloatE2M3::isInfinity(f); }
|
||||
// Returns the maximum normal value.
|
||||
static FloatE2M3 max() { return FloatE2M3::max(); }
|
||||
// Returns the lowest normal value.
|
||||
static FloatE2M3 lowest() { return FloatE2M3::lowest(); }
|
||||
};
|
||||
|
||||
// Since copying a floating point number (especially if it is NaN)
|
||||
// does not guarantee that bits are preserved, this class lets us
|
||||
// store the type and use it as a float when necessary.
|
||||
@@ -186,10 +297,7 @@ class FloatProxy {
|
||||
FloatProxy(uint_type val) { data_ = val; }
|
||||
|
||||
// This is helpful to have and is guaranteed not to stomp bits.
|
||||
FloatProxy<T> operator-() const {
|
||||
return static_cast<uint_type>(data_ ^
|
||||
(uint_type(0x1) << (sizeof(T) * 8 - 1)));
|
||||
}
|
||||
FloatProxy<T> operator-() const;
|
||||
|
||||
// Returns the data as a floating point value.
|
||||
T getAsFloat() const { return BitwiseCast<T>(data_); }
|
||||
@@ -326,6 +434,45 @@ struct HexFloatTraits<FloatProxy<FloatE4M3>> {
|
||||
static bool supportsInfinity() { return false; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct HexFloatTraits<FloatProxy<FloatE2M1>> {
|
||||
typedef uint8_t uint_type;
|
||||
typedef int8_t int_type;
|
||||
typedef uint8_t underlying_type;
|
||||
typedef uint8_t native_type;
|
||||
static const uint_type num_used_bits = 4;
|
||||
static const uint_type num_exponent_bits = 2;
|
||||
static const uint_type num_fraction_bits = 1;
|
||||
static const uint_type exponent_bias = 1;
|
||||
static bool supportsInfinity() { return false; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct HexFloatTraits<FloatProxy<FloatE3M2>> {
|
||||
typedef uint8_t uint_type;
|
||||
typedef int8_t int_type;
|
||||
typedef uint8_t underlying_type;
|
||||
typedef uint8_t native_type;
|
||||
static const uint_type num_used_bits = 6;
|
||||
static const uint_type num_exponent_bits = 3;
|
||||
static const uint_type num_fraction_bits = 2;
|
||||
static const uint_type exponent_bias = 3;
|
||||
static bool supportsInfinity() { return false; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct HexFloatTraits<FloatProxy<FloatE2M3>> {
|
||||
typedef uint8_t uint_type;
|
||||
typedef int8_t int_type;
|
||||
typedef uint8_t underlying_type;
|
||||
typedef uint8_t native_type;
|
||||
static const uint_type num_used_bits = 6;
|
||||
static const uint_type num_exponent_bits = 2;
|
||||
static const uint_type num_fraction_bits = 3;
|
||||
static const uint_type exponent_bias = 1;
|
||||
static bool supportsInfinity() { return false; }
|
||||
};
|
||||
|
||||
enum round_direction {
|
||||
kRoundToZero,
|
||||
kRoundToNearestEven,
|
||||
@@ -333,6 +480,13 @@ enum round_direction {
|
||||
kRoundToNegativeInfinity
|
||||
};
|
||||
|
||||
// This is helpful to have and is guaranteed not to stomp bits.
|
||||
template <typename T>
|
||||
FloatProxy<T> FloatProxy<T>::operator-() const {
|
||||
return static_cast<uint_type>(data_ ^
|
||||
(uint_type(0x1) << (HexFloatTraits<FloatProxy<T>>::num_used_bits - 1)));
|
||||
}
|
||||
|
||||
// Template class that houses a floating pointer number.
|
||||
// It exposes a number of constants based on the provided traits to
|
||||
// assist in interpreting the bits of the value.
|
||||
@@ -392,6 +546,11 @@ class HexFloat {
|
||||
// The bit that is used as a sign.
|
||||
static const uint_type sign_mask = uint_type(1) << top_bit_left_shift;
|
||||
|
||||
// The set of all used bits
|
||||
static const uint_type used_bits_mask =
|
||||
(uint_type(1) << (num_used_bits - 1)) |
|
||||
((uint_type(1) << (num_used_bits - 1)) - 1);
|
||||
|
||||
// The bits that represent the exponent.
|
||||
static const uint_type exponent_mask =
|
||||
spvutils::SetBits<uint_type, num_fraction_bits, num_exponent_bits>::get;
|
||||
@@ -699,7 +858,7 @@ class HexFloat {
|
||||
} else {
|
||||
// encode as +/-nan
|
||||
other.set_value(BitwiseCast<typename other_T::underlying_type>(
|
||||
static_cast<typename other_T::uint_type>(negate ? ~0 : ~other_T::sign_mask)));
|
||||
static_cast<typename other_T::uint_type>(other_T::used_bits_mask & (negate ? ~0 : ~other_T::sign_mask))));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Vendored
+567
-192
File diff suppressed because it is too large
Load Diff
Vendored
+4
@@ -481,6 +481,10 @@ public:
|
||||
Id getReturnType() const { return functionInstruction.getTypeId(); }
|
||||
Id getFuncId() const { return functionInstruction.getResultId(); }
|
||||
Id getFuncTypeId() const { return functionInstruction.getIdOperand(1); }
|
||||
void setFunctionControl(FunctionControlMask functionControl)
|
||||
{
|
||||
functionInstruction.setImmediateOperand(0, static_cast<unsigned>(functionControl));
|
||||
}
|
||||
void setReturnPrecision(Decoration precision)
|
||||
{
|
||||
if (precision == Decoration::RelaxedPrecision)
|
||||
|
||||
+30
-6
@@ -114,6 +114,9 @@ enum TOptions : uint64_t {
|
||||
EOptionLinkTimeOptimization = (1ull << 34),
|
||||
EOptionValidateCrossStageIO = (1ull << 35),
|
||||
EOptionBindingsPerResourceType = (1ull << 36),
|
||||
EOptionRelaxSetBindingLimits = (1ull << 37),
|
||||
EOptionDiscardIsTerminate = (1ull << 38),
|
||||
EOptionOptimizePerformance = (1ull << 39),
|
||||
};
|
||||
bool targetHlslFunctionality1 = false;
|
||||
bool SpvToolsDisassembler = false;
|
||||
@@ -638,6 +641,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
lowerword == "auto-map-binding" ||
|
||||
lowerword == "amb") {
|
||||
Options |= EOptionAutoMapBindings;
|
||||
} else if (lowerword == "relax-set-binding-limits") {
|
||||
Options |= EOptionRelaxSetBindingLimits;
|
||||
} else if (lowerword == "auto-map-locations" || // synonyms
|
||||
lowerword == "aml") {
|
||||
Options |= EOptionAutoMapLocations;
|
||||
@@ -736,6 +741,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
AbsolutePath = true;
|
||||
} else if (lowerword == "auto-sampled-textures") {
|
||||
autoSampledTextures = true;
|
||||
} else if (lowerword == "discard-is-terminate") {
|
||||
Options |= EOptionDiscardIsTerminate;
|
||||
} else if (lowerword == "invert-y" || // synonyms
|
||||
lowerword == "iy") {
|
||||
Options |= EOptionInvertY;
|
||||
@@ -970,6 +977,12 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
|
||||
Options |= EOptionOptimizeSize;
|
||||
#else
|
||||
Error("-Os not available; optimizer not linked");
|
||||
#endif
|
||||
else if (argv[0][2] == '\0')
|
||||
#if ENABLE_OPT
|
||||
Options |= EOptionOptimizePerformance;
|
||||
#else
|
||||
Error("-O not available; optimizer not linked");
|
||||
#endif
|
||||
else
|
||||
Error("unknown -O option");
|
||||
@@ -1205,6 +1218,8 @@ void SetMessageOptions(EShMessages& messages)
|
||||
messages = (EShMessages)(messages | EShMsgLinkTimeOptimization);
|
||||
if (Options & EOptionValidateCrossStageIO)
|
||||
messages = (EShMessages)(messages | EShMsgValidateCrossStageIO);
|
||||
if (Options & EOptionRelaxSetBindingLimits)
|
||||
messages = (EShMessages)(messages | EShMsgRelaxSetBindingLimits);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1471,6 +1486,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
if (Options & EOptionBindingsPerResourceType)
|
||||
shader->setBindingsPerResourceType();
|
||||
|
||||
if (Options & EOptionDiscardIsTerminate)
|
||||
shader->setDiscardIsTerminate(true);
|
||||
|
||||
// Set up the environment, some subsettings take precedence over earlier
|
||||
// ways of setting things.
|
||||
if (Options & EOptionSpv) {
|
||||
@@ -1512,9 +1530,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
if (! (Options & EOptionSuppressInfolog) &&
|
||||
! (Options & EOptionMemoryLeakMode)) {
|
||||
if (!beQuiet)
|
||||
PutsIfNonEmpty(compUnit.fileName[0].c_str());
|
||||
PutsIfNonEmpty(shader->getInfoLog());
|
||||
PutsIfNonEmpty(shader->getInfoDebugLog());
|
||||
StderrIfNonEmpty(compUnit.fileName[0].c_str());
|
||||
StderrIfNonEmpty(shader->getInfoLog());
|
||||
StderrIfNonEmpty(shader->getInfoDebugLog());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1535,8 +1553,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
|
||||
// Report
|
||||
if (!(Options & EOptionSuppressInfolog) && !(Options & EOptionMemoryLeakMode)) {
|
||||
PutsIfNonEmpty(program.getInfoLog());
|
||||
PutsIfNonEmpty(program.getInfoDebugLog());
|
||||
StderrIfNonEmpty(program.getInfoLog());
|
||||
StderrIfNonEmpty(program.getInfoDebugLog());
|
||||
}
|
||||
|
||||
// Reflect
|
||||
@@ -1586,6 +1604,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
||||
spvOptions.stripDebugInfo = true;
|
||||
spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0;
|
||||
spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0;
|
||||
spvOptions.optimizePerformance = (Options & EOptionOptimizePerformance) != 0;
|
||||
spvOptions.disassemble = SpvToolsDisassembler;
|
||||
spvOptions.validate = SpvToolsValidate;
|
||||
spvOptions.compileOnly = compileOnly;
|
||||
@@ -2005,8 +2024,9 @@ void usage()
|
||||
" -H print human readable form of SPIR-V; turns on -V\n"
|
||||
" -I<dir> add <dir> to the include search path; includer's directory is\n"
|
||||
" searched first, followed by left-to-right order of -I\n"
|
||||
" -Od disables optimization; may cause illegal SPIR-V for HLSL\n"
|
||||
" -O optimizes SPIR-V for performance\n"
|
||||
" -Os optimizes SPIR-V to minimize size\n"
|
||||
" -Od disables optimization; may cause illegal SPIR-V for HLSL\n"
|
||||
" -P<text> | --P <text> | --preamble-text <text>\n"
|
||||
" inject custom preamble text which is treated as if it appeared\n"
|
||||
" immediately after the version declaration (if any)\n"
|
||||
@@ -2054,6 +2074,8 @@ void usage()
|
||||
" suppress GLSL warnings, except as required by '#extension : warn'\n"
|
||||
" -x save binary output as text-based 32-bit hexadecimal numbers\n"
|
||||
" --absolute-path prints absolute path for messages\n"
|
||||
" --relax-set-binding-limits allow larger layout(set) and\n"
|
||||
" layout(binding) values\n"
|
||||
" --auto-map-binding | --auto-map-bindings | --amb\n"
|
||||
" automatically bind uniform variables without\n"
|
||||
" explicit bindings\n"
|
||||
@@ -2064,6 +2086,8 @@ void usage()
|
||||
" --client {vulkan<ver> | opengl<ver>}\n"
|
||||
" see -V and -G\n"
|
||||
" --depfile <file> writes depfile for build systems\n"
|
||||
" --discard-is-terminate map GLSL discard to OpTerminateInvocation\n"
|
||||
" instead of OpDemoteToHelperInvocation\n"
|
||||
" --dump-builtin-symbols prints builtin symbol table prior each\n"
|
||||
" compile\n"
|
||||
" -dumpfullversion | -dumpversion print bare major.minor.patchlevel\n"
|
||||
|
||||
Vendored
+1
-1
@@ -35,7 +35,7 @@
|
||||
#define GLSLANG_BUILD_INFO
|
||||
|
||||
#define GLSLANG_VERSION_MAJOR 16
|
||||
#define GLSLANG_VERSION_MINOR 3
|
||||
#define GLSLANG_VERSION_MINOR 5
|
||||
#define GLSLANG_VERSION_PATCH 0
|
||||
#define GLSLANG_VERSION_FLAVOR ""
|
||||
|
||||
|
||||
@@ -219,6 +219,7 @@ static int c_shader_messages(glslang_messages_t messages)
|
||||
CONVERT_MSG(GLSLANG_MSG_ENHANCED, EShMsgEnhanced);
|
||||
CONVERT_MSG(GLSLANG_MSG_ABSOLUTE_PATH, EShMsgAbsolutePath);
|
||||
CONVERT_MSG(GLSLANG_MSG_DISPLAY_ERROR_COLUMN, EShMsgDisplayErrorColumn);
|
||||
CONVERT_MSG(GLSLANG_MSG_RELAX_SET_BINDING_LIMITS_BIT, EShMsgRelaxSetBindingLimits);
|
||||
return res;
|
||||
#undef CONVERT_MSG
|
||||
}
|
||||
@@ -351,6 +352,10 @@ GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const
|
||||
shader->shader->setPreamble(s);
|
||||
}
|
||||
|
||||
GLSLANG_EXPORT void glslang_shader_set_source_entry_point(glslang_shader_t* shader, const char* s) {
|
||||
shader->shader->setSourceEntryPoint(s);
|
||||
}
|
||||
|
||||
GLSLANG_EXPORT void glslang_shader_set_entry_point(glslang_shader_t* shader, const char* s) {
|
||||
shader->shader->setEntryPoint(s);
|
||||
}
|
||||
|
||||
+4
-2
@@ -1211,7 +1211,8 @@ bool HlslGrammar::acceptSubpassInputType(TType& type)
|
||||
}
|
||||
}
|
||||
|
||||
const TBasicType subpassBasicType = subpassType.isStruct() ? (*subpassType.getStruct())[0].type->getBasicType()
|
||||
const TBasicType subpassBasicType = (subpassType.isStruct() && !subpassType.getStruct()->empty())
|
||||
? (*subpassType.getStruct())[0].type->getBasicType()
|
||||
: subpassType.getBasicType();
|
||||
|
||||
TSampler sampler;
|
||||
@@ -1436,7 +1437,8 @@ bool HlslGrammar::acceptTextureType(TType& type)
|
||||
if (image || dim == EsdBuffer)
|
||||
format = parseContext.getLayoutFromTxType(token.loc, txType);
|
||||
|
||||
const TBasicType txBasicType = txType.isStruct() ? (*txType.getStruct())[0].type->getBasicType()
|
||||
const TBasicType txBasicType = (txType.isStruct() && !txType.getStruct()->empty())
|
||||
? (*txType.getStruct())[0].type->getBasicType()
|
||||
: txType.getBasicType();
|
||||
|
||||
// Non-image Buffers are combined
|
||||
|
||||
+63
-8
@@ -51,6 +51,16 @@
|
||||
|
||||
namespace glslang {
|
||||
|
||||
static bool isLayoutSetOutOfRange(int value, bool relaxSetBindingLimits)
|
||||
{
|
||||
return value < 0 || (!relaxSetBindingLimits && value >= static_cast<int>(TQualifier::layoutSetEnd));
|
||||
}
|
||||
|
||||
static bool isLayoutBindingOutOfRange(int value, bool relaxSetBindingLimits)
|
||||
{
|
||||
return value < 0 || (!relaxSetBindingLimits && value >= static_cast<int>(TQualifier::layoutBindingEnd));
|
||||
}
|
||||
|
||||
HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins,
|
||||
int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language,
|
||||
TInfoSink& infoSink,
|
||||
@@ -581,8 +591,8 @@ bool HlslParseContext::parseMatrixSwizzleSelector(const TSourceLoc& loc, const T
|
||||
error(loc, "matrix component swizzle has too many components", compString.c_str(), "");
|
||||
return false;
|
||||
}
|
||||
if (c > compString.size() - 3 ||
|
||||
((compString[c+1] == 'm' || compString[c+1] == 'M') && c > compString.size() - 4)) {
|
||||
if (c + 3 > compString.size() ||
|
||||
((compString[c+1] == 'm' || compString[c+1] == 'M') && c + 4 > compString.size())) {
|
||||
error(loc, "matrix component swizzle missing", compString.c_str(), "");
|
||||
return false;
|
||||
}
|
||||
@@ -1253,7 +1263,7 @@ int HlslParseContext::addFlattenedMember(const TVariable& variable, const TType&
|
||||
TVariable* memberVariable = makeInternalVariable(memberName, type);
|
||||
mergeQualifiers(memberVariable->getWritableType().getQualifier(), variable.getType().getQualifier());
|
||||
|
||||
if (flattenData.nextBinding != TQualifier::layoutBindingEnd)
|
||||
if (flattenData.nextBinding != TQualifier::layoutNotSet)
|
||||
memberVariable->getWritableType().getQualifier().layoutBinding = flattenData.nextBinding++;
|
||||
|
||||
if (memberVariable->getType().isBuiltIn()) {
|
||||
@@ -1755,6 +1765,12 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T
|
||||
case EatNumThreads:
|
||||
{
|
||||
const TIntermSequence& sequence = it->args->getSequence();
|
||||
// numthreads has three dimensions (x, y, z); localSize is sized to match,
|
||||
// so reject extra arguments rather than indexing past it.
|
||||
if (sequence.size() > 3) {
|
||||
error(loc, "expected at most three arguments", "numthreads", "");
|
||||
break;
|
||||
}
|
||||
for (int lid = 0; lid < int(sequence.size()); ++lid)
|
||||
intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst());
|
||||
break;
|
||||
@@ -3518,6 +3534,45 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
|
||||
if (argArray == nullptr)
|
||||
return; // It might not be a struct buffer method.
|
||||
|
||||
// These builtins resolve by name against a zero-parameter prototype, so normal
|
||||
// overload resolution never checks the argument count. Validate it here before
|
||||
// indexing the argument sequence, otherwise a call with too few arguments reads
|
||||
// past the end of the aggregate (or dereferences a null aggregate for a bare
|
||||
// buffer object with no arguments).
|
||||
const int argCount = argAggregate ? (int)argAggregate->getSequence().size() : 1;
|
||||
int minArgCount = 1; // the buffer object at index 0
|
||||
switch (op) {
|
||||
case EOpMethodLoad:
|
||||
case EOpMethodLoad2:
|
||||
case EOpMethodLoad3:
|
||||
case EOpMethodLoad4:
|
||||
case EOpMethodGetDimensions:
|
||||
case EOpMethodAppend:
|
||||
case EOpInterlockedAdd:
|
||||
case EOpInterlockedAnd:
|
||||
case EOpInterlockedExchange:
|
||||
case EOpInterlockedMax:
|
||||
case EOpInterlockedMin:
|
||||
case EOpInterlockedOr:
|
||||
case EOpInterlockedXor:
|
||||
case EOpInterlockedCompareExchange:
|
||||
case EOpInterlockedCompareStore:
|
||||
minArgCount = 2;
|
||||
break;
|
||||
case EOpMethodStore:
|
||||
case EOpMethodStore2:
|
||||
case EOpMethodStore3:
|
||||
case EOpMethodStore4:
|
||||
minArgCount = 3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (argCount < minArgCount) {
|
||||
error(loc, "too few arguments to buffer method", "", "");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (op) {
|
||||
case EOpMethodLoad:
|
||||
{
|
||||
@@ -7317,14 +7372,14 @@ void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TQualifier& qua
|
||||
qualifier.layoutLocation = value;
|
||||
return;
|
||||
} else if (id == "set") {
|
||||
if ((unsigned int)value >= TQualifier::layoutSetEnd)
|
||||
error(loc, "set is too large", id.c_str(), "");
|
||||
if (isLayoutSetOutOfRange(value, relaxSetBindingLimits()))
|
||||
error(loc, "set is out of range", id.c_str(), "");
|
||||
else
|
||||
qualifier.layoutSet = value;
|
||||
return;
|
||||
} else if (id == "binding") {
|
||||
if ((unsigned int)value >= TQualifier::layoutBindingEnd)
|
||||
error(loc, "binding is too large", id.c_str(), "");
|
||||
if (isLayoutBindingOutOfRange(value, relaxSetBindingLimits()))
|
||||
error(loc, "binding is out of range", id.c_str(), "");
|
||||
else
|
||||
qualifier.layoutBinding = value;
|
||||
return;
|
||||
@@ -7535,7 +7590,7 @@ void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQuali
|
||||
|
||||
if (src.hasSet())
|
||||
dst.layoutSet = src.layoutSet;
|
||||
if (src.layoutBinding != TQualifier::layoutBindingEnd)
|
||||
if (src.hasBinding())
|
||||
dst.layoutBinding = src.layoutBinding;
|
||||
|
||||
if (src.hasXfbStride())
|
||||
|
||||
+2
-2
@@ -225,13 +225,13 @@ public:
|
||||
|
||||
protected:
|
||||
struct TFlattenData {
|
||||
TFlattenData() : nextBinding(TQualifier::layoutBindingEnd),
|
||||
TFlattenData() : nextBinding(TQualifier::layoutNotSet),
|
||||
nextLocation(TQualifier::layoutLocationEnd) { }
|
||||
TFlattenData(int nb, int nl) : nextBinding(nb), nextLocation(nl) { }
|
||||
|
||||
TVector<TVariable*> members; // individual flattened variables
|
||||
TVector<int> offsets; // offset to next tree level
|
||||
unsigned int nextBinding; // next binding to use.
|
||||
int nextBinding; // next binding to use.
|
||||
unsigned int nextLocation; // next location to use
|
||||
};
|
||||
|
||||
|
||||
+31
@@ -52,6 +52,11 @@ enum TBasicType {
|
||||
EbtBFloat16,
|
||||
EbtFloatE5M2,
|
||||
EbtFloatE4M3,
|
||||
EbtFloatE2M1,
|
||||
EbtFloatE3M2,
|
||||
EbtFloatE2M3,
|
||||
EbtFloatUE8M0,
|
||||
EbtFloatMXINT8,
|
||||
EbtInt8,
|
||||
EbtUint8,
|
||||
EbtInt16,
|
||||
@@ -641,6 +646,25 @@ __inline bool isTypeFloat(TBasicType type)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
__inline bool isTypeOcpMicroscalingFloat(TBasicType type)
|
||||
{
|
||||
switch (type) {
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -650,6 +674,13 @@ __inline bool isTypeFloat(TBasicType type)
|
||||
__inline uint32_t GetNumBits(TBasicType type)
|
||||
{
|
||||
switch (type) {
|
||||
case EbtFloatE2M1:
|
||||
return 4;
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
return 6;
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtInt8:
|
||||
case EbtUint8:
|
||||
case EbtFloatE5M2:
|
||||
|
||||
+10
@@ -36,7 +36,9 @@
|
||||
#define _INFOSINK_INCLUDED_
|
||||
|
||||
#include "../Include/Common.h"
|
||||
#if __has_include(<filesystem>)
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#include <cmath>
|
||||
|
||||
namespace glslang {
|
||||
@@ -105,11 +107,19 @@ public:
|
||||
}
|
||||
|
||||
if(loc.getFilename() == nullptr && shaderFileName != nullptr && absolute) {
|
||||
#if defined(__cpp_lib_filesystem)
|
||||
append(std::filesystem::absolute(shaderFileName).string());
|
||||
#else
|
||||
append(shaderFileName);
|
||||
#endif
|
||||
} else {
|
||||
std::string location = loc.getStringNameOrNum(false);
|
||||
if (absolute) {
|
||||
#if defined(__cpp_lib_filesystem)
|
||||
append(std::filesystem::absolute(location).string());
|
||||
#else
|
||||
append(location);
|
||||
#endif
|
||||
} else {
|
||||
append(location);
|
||||
}
|
||||
|
||||
+65
-15
@@ -52,6 +52,7 @@
|
||||
namespace glslang {
|
||||
|
||||
class TIntermAggregate;
|
||||
class TIntermTyped;
|
||||
|
||||
const int GlslangMaxTypeLength = 200; // TODO: need to print block/struct one member per line, so this can stay bounded
|
||||
|
||||
@@ -262,6 +263,11 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
case EbtBFloat16: s.append("bf16"); break;
|
||||
case EbtFloatE5M2: s.append("fe5m2"); break;
|
||||
case EbtFloatE4M3: s.append("fe4m3"); break;
|
||||
case EbtFloatE2M1: s.append("fe2m1"); break;
|
||||
case EbtFloatE3M2: s.append("fe3m2"); break;
|
||||
case EbtFloatE2M3: s.append("fe2m3"); break;
|
||||
case EbtFloatUE8M0: s.append("fue8m0"); break;
|
||||
case EbtFloatMXINT8: s.append("fmxint8"); break;
|
||||
case EbtInt8: s.append("i8"); break;
|
||||
case EbtUint16: s.append("u8"); break;
|
||||
case EbtInt16: s.append("i16"); break;
|
||||
@@ -810,8 +816,8 @@ public:
|
||||
break;
|
||||
case EbsPushConstant :
|
||||
storage = EvqUniform;
|
||||
layoutSet = TQualifier::layoutSetEnd;
|
||||
layoutBinding = TQualifier::layoutBindingEnd;
|
||||
layoutSet = TQualifier::layoutNotSet;
|
||||
layoutBinding = TQualifier::layoutNotSet;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -862,6 +868,7 @@ public:
|
||||
|
||||
layoutPushConstant = false;
|
||||
layoutBufferReference = false;
|
||||
layoutDescriptorBufferType = false;
|
||||
layoutPassthrough = false;
|
||||
layoutViewportRelative = false;
|
||||
// -2048 as the default value indicating layoutSecondaryViewportRelative is not set
|
||||
@@ -884,8 +891,10 @@ public:
|
||||
layoutBank = layoutBankEnd;
|
||||
layoutDescriptorHeap = false;
|
||||
layoutDescriptorStride = layoutDescriptorStrideEnd;
|
||||
layoutDescriptorSize = layoutDescriptorSizeEnd;
|
||||
layoutHeapOffset = 0;
|
||||
layoutDescriptorInnerBlock = false;
|
||||
layoutHeapOffsetNode = nullptr;
|
||||
descriptorHeapDescriptorNode = false;
|
||||
}
|
||||
void clearInterstageLayout()
|
||||
{
|
||||
@@ -915,6 +924,7 @@ public:
|
||||
hasFormat() ||
|
||||
isShaderRecord() ||
|
||||
isPushConstant() ||
|
||||
isBufferType() ||
|
||||
hasBufferReference();
|
||||
}
|
||||
bool hasLayout() const
|
||||
@@ -935,10 +945,10 @@ public:
|
||||
unsigned int layoutComponent : 3;
|
||||
static const unsigned int layoutComponentEnd = 4;
|
||||
|
||||
unsigned int layoutSet : 7;
|
||||
int layoutSet;
|
||||
static const unsigned int layoutSetEnd = 0x3F;
|
||||
|
||||
unsigned int layoutBinding : 16;
|
||||
int layoutBinding;
|
||||
static const unsigned int layoutBindingEnd = 0xFFFF;
|
||||
|
||||
unsigned int layoutIndex : 8;
|
||||
@@ -956,8 +966,8 @@ public:
|
||||
unsigned int layoutXfbOffset : 13;
|
||||
static const unsigned int layoutXfbOffsetEnd = 0x1FFF;
|
||||
|
||||
unsigned int layoutAttachment : 8; // for input_attachment_index
|
||||
static const unsigned int layoutAttachmentEnd = 0XFF;
|
||||
unsigned int layoutAttachment; // for input_attachment_index
|
||||
static const unsigned int layoutAttachmentEnd = INT_MAX;
|
||||
|
||||
unsigned int layoutSpecConstantId;
|
||||
static const unsigned int layoutSpecConstantIdEnd = UINT_MAX;
|
||||
@@ -968,6 +978,9 @@ public:
|
||||
unsigned int layoutDescriptorStride;
|
||||
static const unsigned int layoutDescriptorStrideEnd = 0x0;
|
||||
|
||||
unsigned int layoutDescriptorSize;
|
||||
static const unsigned int layoutDescriptorSizeEnd = 0x0;
|
||||
|
||||
// stored as log2 of the actual alignment value
|
||||
unsigned int layoutBufferReferenceAlign : 6;
|
||||
static const unsigned int layoutBufferReferenceAlignEnd = 0x3F;
|
||||
@@ -976,6 +989,7 @@ public:
|
||||
|
||||
bool layoutPushConstant;
|
||||
bool layoutBufferReference;
|
||||
bool layoutDescriptorBufferType;
|
||||
bool layoutPassthrough;
|
||||
bool layoutViewportRelative;
|
||||
int layoutSecondaryViewportRelativeOffset;
|
||||
@@ -985,8 +999,9 @@ public:
|
||||
bool layoutHitObjectShaderRecordNV;
|
||||
bool layoutHitObjectShaderRecordEXT;
|
||||
bool layoutDescriptorHeap;
|
||||
bool layoutDescriptorInnerBlock;
|
||||
bool descriptorHeapDescriptorNode;
|
||||
int layoutHeapOffset;
|
||||
TIntermTyped* layoutHeapOffsetNode;
|
||||
|
||||
// GL_EXT_spirv_intrinsics
|
||||
int spirvStorageClass;
|
||||
@@ -1014,8 +1029,8 @@ public:
|
||||
layoutAlign = layoutNotSet;
|
||||
layoutMemberOffset = layoutNotSet;
|
||||
|
||||
layoutSet = layoutSetEnd;
|
||||
layoutBinding = layoutBindingEnd;
|
||||
layoutSet = layoutNotSet;
|
||||
layoutBinding = layoutNotSet;
|
||||
layoutAttachment = layoutAttachmentEnd;
|
||||
}
|
||||
|
||||
@@ -1043,11 +1058,11 @@ public:
|
||||
}
|
||||
bool hasSet() const
|
||||
{
|
||||
return layoutSet != layoutSetEnd;
|
||||
return layoutSet != layoutNotSet;
|
||||
}
|
||||
bool hasBinding() const
|
||||
{
|
||||
return layoutBinding != layoutBindingEnd;
|
||||
return layoutBinding != layoutNotSet;
|
||||
}
|
||||
bool hasOffset() const
|
||||
{
|
||||
@@ -1096,6 +1111,7 @@ public:
|
||||
TLayoutFormat getFormat() const { return layoutFormat; }
|
||||
bool isPushConstant() const { return layoutPushConstant; }
|
||||
bool isShaderRecord() const { return layoutShaderRecord; }
|
||||
bool isBufferType() const { return layoutDescriptorBufferType; }
|
||||
bool isFullQuads() const { return layoutFullQuads; }
|
||||
bool isQuadDeriv() const { return layoutQuadDeriv; }
|
||||
bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; }
|
||||
@@ -1970,8 +1986,7 @@ public:
|
||||
virtual void updateImplicitArraySize(int size) { assert(isArray()); arraySizes->updateImplicitSize(size); }
|
||||
virtual void setImplicitlySized(bool isImplicitSized) { arraySizes->setImplicitlySized(isImplicitSized); }
|
||||
virtual bool isStruct() const { return basicType == EbtStruct || basicType == EbtBlock; }
|
||||
virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble || basicType == EbtFloat16 ||
|
||||
basicType == EbtBFloat16 || basicType == EbtFloatE5M2 || basicType == EbtFloatE4M3; }
|
||||
virtual bool isFloatingDomain() const { return isTypeFloat(basicType); }
|
||||
virtual bool isIntegerDomain() const
|
||||
{
|
||||
switch (basicType) {
|
||||
@@ -2109,6 +2124,11 @@ public:
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtInt8:
|
||||
case EbtUint8:
|
||||
case EbtInt16:
|
||||
@@ -2149,6 +2169,20 @@ public:
|
||||
{
|
||||
return containsBasicType(EbtFloatE5M2) || containsBasicType(EbtFloatE4M3);
|
||||
}
|
||||
bool containsOcpMicroscalingFloat() const
|
||||
{
|
||||
return containsBasicType(EbtFloatE2M1) ||
|
||||
containsBasicType(EbtFloatE3M2) ||
|
||||
containsBasicType(EbtFloatE2M3) ||
|
||||
containsBasicType(EbtFloatUE8M0) ||
|
||||
containsBasicType(EbtFloatMXINT8);
|
||||
}
|
||||
bool containsOcpMicroscalingNonByteFloat() const
|
||||
{
|
||||
return containsBasicType(EbtFloatE2M1) ||
|
||||
containsBasicType(EbtFloatE3M2) ||
|
||||
containsBasicType(EbtFloatE2M3);
|
||||
}
|
||||
bool contains64BitInt() const
|
||||
{
|
||||
return containsBasicType(EbtInt64) || containsBasicType(EbtUint64);
|
||||
@@ -2277,6 +2311,11 @@ public:
|
||||
case EbtBFloat16: return "bfloat16_t";
|
||||
case EbtFloatE5M2: return "floate5m2_t";
|
||||
case EbtFloatE4M3: return "floate4m3_t";
|
||||
case EbtFloatE2M1: return "floate2m1_t";
|
||||
case EbtFloatE3M2: return "floate3m2_t";
|
||||
case EbtFloatE2M3: return "floate2m3_t";
|
||||
case EbtFloatUE8M0: return "floatue8m0_t";
|
||||
case EbtFloatMXINT8: return "floatmxint8_t";
|
||||
case EbtInt8: return "int8_t";
|
||||
case EbtUint8: return "uint8_t";
|
||||
case EbtInt16: return "int16_t";
|
||||
@@ -2390,6 +2429,8 @@ public:
|
||||
appendStr(" push_constant");
|
||||
if (qualifier.layoutBufferReference)
|
||||
appendStr(" buffer_reference");
|
||||
if (qualifier.layoutDescriptorBufferType)
|
||||
appendStr(" buffer_type");
|
||||
if (qualifier.hasBufferReferenceAlign()) {
|
||||
appendStr(" buffer_reference_align=");
|
||||
appendUint(1u << qualifier.layoutBufferReferenceAlign);
|
||||
@@ -2435,8 +2476,17 @@ public:
|
||||
appendStr(" descriptor_stride=");
|
||||
appendInt(qualifier.layoutDescriptorStride);
|
||||
}
|
||||
if (qualifier.layoutHeapOffset)
|
||||
if (qualifier.layoutDescriptorSize != TQualifier::layoutDescriptorSizeEnd) {
|
||||
appendStr(" descriptor_size=");
|
||||
appendInt(qualifier.layoutDescriptorSize);
|
||||
}
|
||||
if (qualifier.layoutHeapOffset || qualifier.layoutHeapOffsetNode) {
|
||||
appendStr(" heap_offset=");
|
||||
if (qualifier.layoutHeapOffsetNode)
|
||||
appendStr("<constant-expression>");
|
||||
else
|
||||
appendInt(qualifier.layoutHeapOffset);
|
||||
}
|
||||
|
||||
appendStr(")");
|
||||
}
|
||||
|
||||
+11
@@ -205,6 +205,12 @@ struct TSmallArrayVector {
|
||||
return (*sizes)[index];
|
||||
}
|
||||
|
||||
bool elementEqual(const TSmallArrayVector& rhs, uint32_t thisIdx, uint32_t rhsIdx) const
|
||||
{
|
||||
return sizes && rhs.sizes && thisIdx < sizes->size() && rhsIdx < rhs.sizes->size() &&
|
||||
(*sizes)[thisIdx] == (*rhs.sizes)[rhsIdx];
|
||||
}
|
||||
|
||||
protected:
|
||||
TSmallArrayVector(const TSmallArrayVector&);
|
||||
|
||||
@@ -354,6 +360,11 @@ struct TArraySizes {
|
||||
bool operator==(const TArraySizes& rhs) const { return sizes == rhs.sizes; }
|
||||
bool operator!=(const TArraySizes& rhs) const { return sizes != rhs.sizes; }
|
||||
|
||||
bool elementEqual(const TArraySizes& rhs, uint32_t thisIdx, uint32_t rhsIdx) const
|
||||
{
|
||||
return sizes.elementEqual(rhs.sizes, thisIdx, rhsIdx);
|
||||
}
|
||||
|
||||
protected:
|
||||
TSmallArrayVector sizes;
|
||||
|
||||
|
||||
@@ -233,6 +233,7 @@ typedef struct glslang_spv_options_s {
|
||||
bool strip_debug_info;
|
||||
bool disable_optimizer;
|
||||
bool optimize_size;
|
||||
bool optimize_performance;
|
||||
bool disassemble;
|
||||
bool validate;
|
||||
bool emit_nonsemantic_shader_debug_info;
|
||||
@@ -253,6 +254,9 @@ GLSLANG_EXPORT void glslang_finalize_process(void);
|
||||
GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input);
|
||||
GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader);
|
||||
GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s);
|
||||
// Set a different entry point than main in GLSL that will be renamed to value set by glslang_shader_set_entry_point (SPIRV only).
|
||||
GLSLANG_EXPORT void glslang_shader_set_source_entry_point(glslang_shader_t* shader, const char* s);
|
||||
// Set a different entry point than main in output target (SPIRV only).
|
||||
GLSLANG_EXPORT void glslang_shader_set_entry_point(glslang_shader_t* shader, const char* s);
|
||||
GLSLANG_EXPORT void glslang_shader_set_invert_y(glslang_shader_t* shader, bool y);
|
||||
GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base);
|
||||
|
||||
@@ -179,6 +179,7 @@ typedef enum {
|
||||
GLSLANG_MSG_DISPLAY_ERROR_COLUMN = (1 << 17),
|
||||
GLSLANG_MSG_LINK_TIME_OPTIMIZATION_BIT = (1 << 18),
|
||||
GLSLANG_MSG_VALIDATE_CROSS_STAGE_IO_BIT = (1 << 19),
|
||||
GLSLANG_MSG_RELAX_SET_BINDING_LIMITS_BIT = (1 << 20),
|
||||
LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT),
|
||||
} glslang_messages_t;
|
||||
|
||||
|
||||
+92
-3
@@ -236,6 +236,29 @@ enum TOperator {
|
||||
EOpUnpackInt4x16,
|
||||
EOpPackUint4x16,
|
||||
EOpUnpackUint4x16,
|
||||
EOpUnpackFloat2xE2M1,
|
||||
EOpUnpackFloat4xE2M1,
|
||||
EOpUnpackFloat8xE2M1,
|
||||
EOpUnpackFloat16xE2M1,
|
||||
EOpPackFloat2xE2M1,
|
||||
EOpPackFloat4xE2M1,
|
||||
EOpPackFloat8xE2M1,
|
||||
EOpPackFloat16xE2M1,
|
||||
EOpUnpackFloat4xE3M2,
|
||||
EOpUnpackFloat8xE3M2,
|
||||
EOpUnpackFloat16xE3M2,
|
||||
EOpPackFloat4xE3M2,
|
||||
EOpPackFloat8xE3M2,
|
||||
EOpPackFloat16xE3M2,
|
||||
EOpUnpackFloat4xE2M3,
|
||||
EOpUnpackFloat8xE2M3,
|
||||
EOpUnpackFloat16xE2M3,
|
||||
EOpPackFloat4xE2M3,
|
||||
EOpPackFloat8xE2M3,
|
||||
EOpPackFloat16xE2M3,
|
||||
EOpBitcastExtractE2M1,
|
||||
EOpBitcastExtractE3M2,
|
||||
EOpBitcastExtractE2M3,
|
||||
EOpPack16,
|
||||
EOpPack32,
|
||||
EOpPack64,
|
||||
@@ -287,6 +310,8 @@ enum TOperator {
|
||||
EOpEndStreamPrimitive, // geometry only
|
||||
|
||||
EOpBarrier,
|
||||
EOpControlBarrierArriveEXT,
|
||||
EOpControlBarrierWaitEXT,
|
||||
EOpMemoryBarrier,
|
||||
EOpMemoryBarrierAtomicCounter,
|
||||
EOpMemoryBarrierBuffer,
|
||||
@@ -459,6 +484,7 @@ enum TOperator {
|
||||
EOpCooperativeMatrixReduceNV,
|
||||
EOpCooperativeMatrixPerElementOpNV,
|
||||
EOpCooperativeMatrixTransposeNV,
|
||||
EOpCooperativeMatrixGetCoordinateEXT,
|
||||
|
||||
EOpCreateTensorLayoutNV,
|
||||
EOpTensorLayoutSetBlockSizeNV,
|
||||
@@ -627,6 +653,26 @@ enum TOperator {
|
||||
EOpConstructFloatE4M3Vec2,
|
||||
EOpConstructFloatE4M3Vec3,
|
||||
EOpConstructFloatE4M3Vec4,
|
||||
EOpConstructFloatE2M1,
|
||||
EOpConstructFloatE2M1Vec2,
|
||||
EOpConstructFloatE2M1Vec3,
|
||||
EOpConstructFloatE2M1Vec4,
|
||||
EOpConstructFloatE3M2,
|
||||
EOpConstructFloatE3M2Vec2,
|
||||
EOpConstructFloatE3M2Vec3,
|
||||
EOpConstructFloatE3M2Vec4,
|
||||
EOpConstructFloatE2M3,
|
||||
EOpConstructFloatE2M3Vec2,
|
||||
EOpConstructFloatE2M3Vec3,
|
||||
EOpConstructFloatE2M3Vec4,
|
||||
EOpConstructFloatUE8M0,
|
||||
EOpConstructFloatUE8M0Vec2,
|
||||
EOpConstructFloatUE8M0Vec3,
|
||||
EOpConstructFloatUE8M0Vec4,
|
||||
EOpConstructFloatMXINT8,
|
||||
EOpConstructFloatMXINT8Vec2,
|
||||
EOpConstructFloatMXINT8Vec3,
|
||||
EOpConstructFloatMXINT8Vec4,
|
||||
EOpConstructStruct,
|
||||
EOpConstructTextureSampler,
|
||||
EOpConstructNonuniform, // expected to be transformed away, not present in final AST
|
||||
@@ -739,6 +785,18 @@ enum TOperator {
|
||||
EOpFragmentMaskFetch,
|
||||
EOpFragmentFetch,
|
||||
|
||||
// QCOM Image processing3
|
||||
EOpTextureGatherExtendedGuardBegin,
|
||||
EOpTextureGather4x1QCOM,
|
||||
EOpTextureGatherV2QCOM,
|
||||
EOpTextureGatherH2QCOM,
|
||||
EOpTextureGatherDQCOM,
|
||||
EOpTextureGather4x1OffsetQCOM,
|
||||
EOpTextureGatherV2OffsetQCOM,
|
||||
EOpTextureGatherH2OffsetQCOM,
|
||||
EOpTextureGatherDOffsetQCOM,
|
||||
EOpTextureGatherExtendedGuardEnd,
|
||||
|
||||
EOpSparseTextureGuardBegin,
|
||||
|
||||
EOpSparseTexture,
|
||||
@@ -1061,6 +1119,12 @@ enum TLinkType {
|
||||
ELinkExport,
|
||||
};
|
||||
|
||||
enum TFunctionControl {
|
||||
EfcNone = 0,
|
||||
EfcInline = 0x1,
|
||||
EfcDontInline = 0x2,
|
||||
};
|
||||
|
||||
class TIntermTraverser;
|
||||
class TIntermVariableDecl;
|
||||
class TIntermOperator;
|
||||
@@ -1223,7 +1287,8 @@ public:
|
||||
maxIterations(iterationsInfinite),
|
||||
iterationMultiple(1),
|
||||
peelCount(0),
|
||||
partialCount(0)
|
||||
partialCount(0),
|
||||
multipleWaitQueuesQCOM(noMultipleQaitQueues)
|
||||
{ }
|
||||
|
||||
virtual TIntermLoop* getAsLoopNode() { return this; }
|
||||
@@ -1275,6 +1340,12 @@ public:
|
||||
}
|
||||
unsigned int getPartialCount() const { return partialCount; }
|
||||
|
||||
static const unsigned int noMultipleQaitQueues = 0xFFFFFFFF;
|
||||
void setMultipleWaitQueuesQCOM(unsigned int numQ) {
|
||||
multipleWaitQueuesQCOM = numQ;
|
||||
}
|
||||
unsigned int getMultipleWaitQueuesQCOM() const { return multipleWaitQueuesQCOM; }
|
||||
|
||||
protected:
|
||||
TIntermNode* body; // code to loop over
|
||||
TIntermNode* test; // exit condition associated with loop, could be 0 for 'for' loops
|
||||
@@ -1288,6 +1359,7 @@ protected:
|
||||
unsigned int iterationMultiple; // as per the SPIR-V specification
|
||||
unsigned int peelCount; // as per the SPIR-V specification
|
||||
unsigned int partialCount; // as per the SPIR-V specification
|
||||
unsigned int multipleWaitQueuesQCOM;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -1432,7 +1504,10 @@ public:
|
||||
bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
|
||||
bool isSparseImage() const { return op == EOpSparseImageLoad; }
|
||||
bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; }
|
||||
|
||||
bool isTextureGatherExtended() const
|
||||
{
|
||||
return op > EOpTextureGatherExtendedGuardBegin && op < EOpTextureGatherExtendedGuardEnd;
|
||||
}
|
||||
void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
|
||||
TPrecisionQualifier getOperationPrecision() const { return operationPrecision != EpqNone ?
|
||||
operationPrecision :
|
||||
@@ -1559,6 +1634,17 @@ public:
|
||||
break;
|
||||
case EOpTextureGather:
|
||||
case EOpSparseTextureGather:
|
||||
case EOpTextureGather4x1QCOM:
|
||||
case EOpTextureGatherV2QCOM:
|
||||
case EOpTextureGatherH2QCOM:
|
||||
case EOpTextureGatherDQCOM:
|
||||
cracked.gather = true;
|
||||
break;
|
||||
case EOpTextureGather4x1OffsetQCOM:
|
||||
case EOpTextureGatherV2OffsetQCOM:
|
||||
case EOpTextureGatherH2OffsetQCOM:
|
||||
case EOpTextureGatherDOffsetQCOM:
|
||||
cracked.offset = true;
|
||||
cracked.gather = true;
|
||||
break;
|
||||
case EOpTextureGatherOffset:
|
||||
@@ -1687,7 +1773,7 @@ typedef TVector<TStorageQualifier> TQualifierList;
|
||||
//
|
||||
class TIntermAggregate : public TIntermOperator {
|
||||
public:
|
||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) {
|
||||
TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(nullptr) {
|
||||
endLoc.init();
|
||||
}
|
||||
TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(nullptr) {
|
||||
@@ -1721,6 +1807,8 @@ public:
|
||||
|
||||
void setLinkType(TLinkType l) { linkType = l; }
|
||||
TLinkType getLinkType() const { return linkType; }
|
||||
void setFunctionControl(unsigned int fc) { functionControl = fc; }
|
||||
unsigned int getFunctionControl() const { return functionControl; }
|
||||
protected:
|
||||
TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
|
||||
TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
|
||||
@@ -1733,6 +1821,7 @@ protected:
|
||||
TPragmaTable* pragmaTable;
|
||||
TSpirvInstruction spirvInst;
|
||||
TLinkType linkType = ELinkNone;
|
||||
unsigned int functionControl = EfcNone;
|
||||
|
||||
// Marking the end source location of the aggregate.
|
||||
// This is currently only set for a compound statement or a function body, pointing to '}'.
|
||||
|
||||
+106
-22
@@ -41,6 +41,7 @@
|
||||
#include <cfloat>
|
||||
#include <cstdlib>
|
||||
#include <climits>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -48,6 +49,18 @@ using namespace glslang;
|
||||
|
||||
constexpr double pi = 3.1415926535897932384626433832795;
|
||||
|
||||
// Reinterpret the bits of 'from' as a 'To', for the *BitsTo* built-ins.
|
||||
// This matches how the SPIR-V back end emits these constants, so folding
|
||||
// them here cannot change the result.
|
||||
template<typename To, typename From>
|
||||
To bitCast(From from)
|
||||
{
|
||||
static_assert(sizeof(To) == sizeof(From), "bitCast requires equally sized types");
|
||||
To to;
|
||||
memcpy(&to, &from, sizeof(to));
|
||||
return to;
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
@@ -154,6 +167,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
if (rightUnionArray[i].getDConst() != 0.0)
|
||||
newConstArray[i].setDConst(leftUnionArray[i].getDConst() / rightUnionArray[i].getDConst());
|
||||
else if (leftUnionArray[i].getDConst() > 0.0)
|
||||
@@ -509,6 +527,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat:
|
||||
valf = unionArray[i].getDConst();
|
||||
srcType = CONV_FLOAT;
|
||||
@@ -560,6 +583,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat:
|
||||
dstType = CONV_FLOAT;
|
||||
break;
|
||||
@@ -633,6 +661,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat:
|
||||
newConstArray[i].setDConst(valf); break;
|
||||
case EbtInt8:
|
||||
@@ -667,6 +700,11 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
|
||||
// Note: avoid UBSAN error regarding negating 0x80000000
|
||||
case EbtInt: newConstArray[i].setIConst(
|
||||
@@ -724,6 +762,24 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpAtan:
|
||||
newConstArray[i].setDConst(atan(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpSinh:
|
||||
newConstArray[i].setDConst(sinh(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpCosh:
|
||||
newConstArray[i].setDConst(cosh(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpTanh:
|
||||
newConstArray[i].setDConst(tanh(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpAsinh:
|
||||
newConstArray[i].setDConst(asinh(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpAcosh:
|
||||
newConstArray[i].setDConst(acosh(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpAtanh:
|
||||
newConstArray[i].setDConst(atanh(unionArray[i].getDConst()));
|
||||
break;
|
||||
|
||||
case EOpDPdx:
|
||||
case EOpDPdy:
|
||||
@@ -818,23 +874,35 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
|
||||
case EOpConstructReference:
|
||||
newConstArray[i].setU64Const(unionArray[i].getU64Const()); break;
|
||||
|
||||
// The constant is held as a double, so narrow it back to the declared
|
||||
// width before reinterpreting its bits.
|
||||
case EOpFloatBitsToInt:
|
||||
newConstArray[i].setIConst(bitCast<int>(static_cast<float>(unionArray[i].getDConst())));
|
||||
break;
|
||||
case EOpFloatBitsToUint:
|
||||
newConstArray[i].setUConst(bitCast<unsigned int>(static_cast<float>(unionArray[i].getDConst())));
|
||||
break;
|
||||
case EOpIntBitsToFloat:
|
||||
newConstArray[i].setDConst(bitCast<float>(unionArray[i].getIConst()));
|
||||
break;
|
||||
case EOpUintBitsToFloat:
|
||||
newConstArray[i].setDConst(bitCast<float>(unionArray[i].getUConst()));
|
||||
break;
|
||||
case EOpDoubleBitsToInt64:
|
||||
newConstArray[i].setI64Const(bitCast<long long>(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpDoubleBitsToUint64:
|
||||
newConstArray[i].setU64Const(bitCast<unsigned long long>(unionArray[i].getDConst()));
|
||||
break;
|
||||
case EOpInt64BitsToDouble:
|
||||
newConstArray[i].setDConst(bitCast<double>(unionArray[i].getI64Const()));
|
||||
break;
|
||||
case EOpUint64BitsToDouble:
|
||||
newConstArray[i].setDConst(bitCast<double>(unionArray[i].getU64Const()));
|
||||
break;
|
||||
|
||||
// TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
|
||||
|
||||
case EOpSinh:
|
||||
case EOpCosh:
|
||||
case EOpTanh:
|
||||
case EOpAsinh:
|
||||
case EOpAcosh:
|
||||
case EOpAtanh:
|
||||
|
||||
case EOpFloatBitsToInt:
|
||||
case EOpFloatBitsToUint:
|
||||
case EOpIntBitsToFloat:
|
||||
case EOpUintBitsToFloat:
|
||||
case EOpDoubleBitsToInt64:
|
||||
case EOpDoubleBitsToUint64:
|
||||
case EOpInt64BitsToDouble:
|
||||
case EOpUint64BitsToDouble:
|
||||
case EOpFloat16BitsToInt16:
|
||||
case EOpFloat16BitsToUint16:
|
||||
case EOpInt16BitsToFloat16:
|
||||
@@ -906,13 +974,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
break;
|
||||
case EOpStep:
|
||||
componentwise = true;
|
||||
objectSize = std::max(children[0]->getAsTyped()->getType().getVectorSize(),
|
||||
children[1]->getAsTyped()->getType().getVectorSize());
|
||||
objectSize = std::max(children[0]->getAsTyped()->getType().computeNumComponents(),
|
||||
children[1]->getAsTyped()->getType().computeNumComponents());
|
||||
break;
|
||||
case EOpSmoothStep:
|
||||
componentwise = true;
|
||||
objectSize = std::max(children[0]->getAsTyped()->getType().getVectorSize(),
|
||||
children[2]->getAsTyped()->getType().getVectorSize());
|
||||
objectSize = std::max(children[0]->getAsTyped()->getType().computeNumComponents(),
|
||||
children[2]->getAsTyped()->getType().computeNumComponents());
|
||||
break;
|
||||
case EOpMul:
|
||||
{
|
||||
@@ -933,13 +1001,13 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
for (int comp = 0; comp < objectSize; comp++) {
|
||||
|
||||
// some arguments are scalars instead of matching vectors; simulate a smear
|
||||
int arg0comp = std::min(comp, children[0]->getAsTyped()->getType().getVectorSize() - 1);
|
||||
int arg0comp = std::min(comp, children[0]->getAsTyped()->getType().computeNumComponents() - 1);
|
||||
int arg1comp = 0;
|
||||
if (children.size() > 1)
|
||||
arg1comp = std::min(comp, children[1]->getAsTyped()->getType().getVectorSize() - 1);
|
||||
arg1comp = std::min(comp, children[1]->getAsTyped()->getType().computeNumComponents() - 1);
|
||||
int arg2comp = 0;
|
||||
if (children.size() > 2)
|
||||
arg2comp = std::min(comp, children[2]->getAsTyped()->getType().getVectorSize() - 1);
|
||||
arg2comp = std::min(comp, children[2]->getAsTyped()->getType().computeNumComponents() - 1);
|
||||
|
||||
switch (aggrNode->getOp()) {
|
||||
case EOpAtan:
|
||||
@@ -962,6 +1030,11 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||
@@ -999,6 +1072,11 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()));
|
||||
@@ -1036,6 +1114,11 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat:
|
||||
case EbtDouble:
|
||||
newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()),
|
||||
@@ -1272,6 +1355,7 @@ TIntermTyped* TIntermediate::foldDereference(TIntermTyped* node, int index, cons
|
||||
start += (*node->getType().getStruct())[i].type->computeNumComponents();
|
||||
}
|
||||
|
||||
size = std::min(size, node->getAsConstantUnion()->getConstArray().size());
|
||||
result = addConstantUnion(TConstUnionArray(node->getAsConstantUnion()->getConstArray(), start, size), node->getType(), loc);
|
||||
|
||||
if (result == nullptr)
|
||||
|
||||
+328
-1
@@ -4166,6 +4166,88 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"fe4m3vec4 uintBitsToFloate4m3EXT(u8vec4 value);"
|
||||
|
||||
"void saturatedConvertEXT();"
|
||||
|
||||
"int8_t floatue8m0BitsToIntEXT(floatue8m0_t value);"
|
||||
"i8vec2 floatue8m0BitsToIntEXT(fue8m0vec2 value);"
|
||||
"i8vec3 floatue8m0BitsToIntEXT(fue8m0vec3 value);"
|
||||
"i8vec4 floatue8m0BitsToIntEXT(fue8m0vec4 value);"
|
||||
|
||||
"uint8_t floatue8m0BitsToUintEXT(floatue8m0_t value);"
|
||||
"u8vec2 floatue8m0BitsToUintEXT(fue8m0vec2 value);"
|
||||
"u8vec3 floatue8m0BitsToUintEXT(fue8m0vec3 value);"
|
||||
"u8vec4 floatue8m0BitsToUintEXT(fue8m0vec4 value);"
|
||||
|
||||
"floatue8m0_t intBitsToFloatue8m0EXT(int8_t value);"
|
||||
"fue8m0vec2 intBitsToFloatue8m0EXT(i8vec2 value);"
|
||||
"fue8m0vec3 intBitsToFloatue8m0EXT(i8vec3 value);"
|
||||
"fue8m0vec4 intBitsToFloatue8m0EXT(i8vec4 value);"
|
||||
|
||||
"floatue8m0_t uintBitsToFloatue8m0EXT(uint8_t value);"
|
||||
"fue8m0vec2 uintBitsToFloatue8m0EXT(u8vec2 value);"
|
||||
"fue8m0vec3 uintBitsToFloatue8m0EXT(u8vec3 value);"
|
||||
"fue8m0vec4 uintBitsToFloatue8m0EXT(u8vec4 value);"
|
||||
|
||||
"int8_t floatmxint8BitsToIntEXT(floatmxint8_t value);"
|
||||
"i8vec2 floatmxint8BitsToIntEXT(fmxint8vec2 value);"
|
||||
"i8vec3 floatmxint8BitsToIntEXT(fmxint8vec3 value);"
|
||||
"i8vec4 floatmxint8BitsToIntEXT(fmxint8vec4 value);"
|
||||
|
||||
"uint8_t floatmxint8BitsToUintEXT(floatmxint8_t value);"
|
||||
"u8vec2 floatmxint8BitsToUintEXT(fmxint8vec2 value);"
|
||||
"u8vec3 floatmxint8BitsToUintEXT(fmxint8vec3 value);"
|
||||
"u8vec4 floatmxint8BitsToUintEXT(fmxint8vec4 value);"
|
||||
|
||||
"floatmxint8_t intBitsToFloatmxint8EXT(int8_t value);"
|
||||
"fmxint8vec2 intBitsToFloatmxint8EXT(i8vec2 value);"
|
||||
"fmxint8vec3 intBitsToFloatmxint8EXT(i8vec3 value);"
|
||||
"fmxint8vec4 intBitsToFloatmxint8EXT(i8vec4 value);"
|
||||
|
||||
"floatmxint8_t uintBitsToFloatmxint8EXT(uint8_t value);"
|
||||
"fmxint8vec2 uintBitsToFloatmxint8EXT(u8vec2 value);"
|
||||
"fmxint8vec3 uintBitsToFloatmxint8EXT(u8vec3 value);"
|
||||
"fmxint8vec4 uintBitsToFloatmxint8EXT(u8vec4 value);"
|
||||
|
||||
"fe2m1vec2 unpackFloat2xfe2m1EXT(uint8_t value);"
|
||||
"fe2m1vec4 unpackFloat4xfe2m1EXT(uint16_t value);"
|
||||
"vector<floate2m1_t, 8> unpackFloat8xfe2m1EXT(uint32_t value);"
|
||||
"vector<floate2m1_t, 16> unpackFloat16xfe2m1EXT(u32vec2 value);"
|
||||
|
||||
"uint8_t packFloat2xfe2m1EXT(fe2m1vec2 value);"
|
||||
"uint16_t packFloat4xfe2m1EXT(fe2m1vec4 value);"
|
||||
"uint32_t packFloat8xfe2m1EXT(vector<floate2m1_t, 8> value);"
|
||||
"u32vec2 packFloat16xfe2m1EXT(vector<floate2m1_t, 16> value);"
|
||||
|
||||
"fe3m2vec4 unpackFloat4xfe3m2EXT(u8vec3 value);"
|
||||
"vector<floate3m2_t, 8> unpackFloat8xfe3m2EXT(u16vec3 value);"
|
||||
"vector<floate3m2_t, 16> unpackFloat16xfe3m2EXT(u32vec3 value);"
|
||||
|
||||
"u8vec3 packFloat4xfe3m2EXT(fe3m2vec4 value);"
|
||||
"u16vec3 packFloat8xfe3m2EXT(vector<floate3m2_t, 8> value);"
|
||||
"u32vec3 packFloat16xfe3m2EXT(vector<floate3m2_t, 16> value);"
|
||||
|
||||
"fe2m3vec4 unpackFloat4xfe2m3EXT(u8vec3 value);"
|
||||
"vector<floate2m3_t, 8> unpackFloat8xfe2m3EXT(u16vec3 value);"
|
||||
"vector<floate2m3_t, 16> unpackFloat16xfe2m3EXT(u32vec3 value);"
|
||||
|
||||
"u8vec3 packFloat4xfe2m3EXT(fe2m3vec4 value);"
|
||||
"u16vec3 packFloat8xfe2m3EXT(vector<floate2m3_t, 8> value);"
|
||||
"u32vec3 packFloat16xfe2m3EXT(vector<floate2m3_t, 16> value);"
|
||||
|
||||
"floate2m1_t bitcastExtractfe2m1EXT(uint8_t, uint);"
|
||||
"fe2m1vec2 bitcastExtractfe2m1EXT(u8vec2, uint);"
|
||||
"fe2m1vec3 bitcastExtractfe2m1EXT(u8vec3, uint);"
|
||||
"fe2m1vec4 bitcastExtractfe2m1EXT(u8vec4, uint);"
|
||||
|
||||
"floate3m2_t bitcastExtractfe3m2EXT(uint8_t, uint);"
|
||||
"fe3m2vec2 bitcastExtractfe3m2EXT(u8vec2, uint);"
|
||||
"fe3m2vec3 bitcastExtractfe3m2EXT(u8vec3, uint);"
|
||||
"fe3m2vec4 bitcastExtractfe3m2EXT(u8vec4, uint);"
|
||||
|
||||
"floate2m3_t bitcastExtractfe2m3EXT(uint8_t, uint);"
|
||||
"fe2m3vec2 bitcastExtractfe2m3EXT(u8vec2, uint);"
|
||||
"fe2m3vec3 bitcastExtractfe2m3EXT(u8vec3, uint);"
|
||||
"fe2m3vec4 bitcastExtractfe2m3EXT(u8vec4, uint);"
|
||||
|
||||
"\n");
|
||||
}
|
||||
|
||||
@@ -4814,6 +4896,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void barrier();"
|
||||
);
|
||||
}
|
||||
if ((profile != EEsProfile && version >= 420) || esBarrier)
|
||||
stageBuiltins[EShLangCompute].append(
|
||||
"void controlBarrierArrive();"
|
||||
"void controlBarrierWait();"
|
||||
);
|
||||
if ((profile != EEsProfile && version >= 130) || esBarrier)
|
||||
commonBuiltins.append(
|
||||
"void memoryBarrier();"
|
||||
@@ -4847,6 +4934,9 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
commonBuiltins.append("void controlBarrier(int, int, int, int);\n"
|
||||
"void memoryBarrier(int, int, int);\n");
|
||||
|
||||
commonBuiltins.append("void controlBarrierArrive(int, int, int, int);\n"
|
||||
"void controlBarrierWait(int, int, int, int);\n");
|
||||
|
||||
commonBuiltins.append("void debugPrintfEXT();\n");
|
||||
|
||||
commonBuiltins.append("void abortEXT();\n");
|
||||
@@ -4993,11 +5083,23 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void coopMatPerElementNV();"
|
||||
);
|
||||
|
||||
commonBuiltins.append(
|
||||
"void coopMatTransposeEXT(out coopmat, coopmat);"
|
||||
"void coopMatReduceEXT(out coopmat, coopmat, int, __function);"
|
||||
"void coopMatPerElementEXT();"
|
||||
"uvec2 coopMatGetCoordinateEXT(coopmat, uint index);"
|
||||
);
|
||||
|
||||
commonBuiltins.append(
|
||||
"const int gl_CooperativeMatrixReduceRowNV = 0x1;\n"
|
||||
"const int gl_CooperativeMatrixReduceColumnNV = 0x2;\n"
|
||||
"const int gl_CooperativeMatrixReduceRowAndColumnNV = 0x3;\n"
|
||||
"const int gl_CooperativeMatrixReduce2x2NV = 0x4;\n"
|
||||
|
||||
"const int gl_CooperativeMatrixReduceRowEXT = 0x1;\n"
|
||||
"const int gl_CooperativeMatrixReduceColumnEXT = 0x2;\n"
|
||||
"const int gl_CooperativeMatrixReduceRowAndColumnEXT = 0x3;\n"
|
||||
"const int gl_CooperativeMatrixReduce2x2EXT = 0x4;\n"
|
||||
"\n"
|
||||
);
|
||||
|
||||
@@ -5226,6 +5328,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"vector intBitsToFloate4m3EXT(vector);"
|
||||
"vector uintBitsToFloate4m3EXT(vector);"
|
||||
|
||||
"vector floatue8m0BitsToIntEXT(vector);"
|
||||
"vector floatue8m0BitsToUintEXT(vector);"
|
||||
"vector intBitsToFloatue8m0EXT(vector);"
|
||||
"vector uintBitsToFloatue8m0EXT(vector);"
|
||||
"vector floatmxint8BitsToIntEXT(vector);"
|
||||
"vector floatmxint8BitsToUintEXT(vector);"
|
||||
"vector intBitsToFloatmxint8EXT(vector);"
|
||||
"vector uintBitsToFloatmxint8EXT(vector);"
|
||||
|
||||
"vector uaddCarry(highp vector, highp vector, out lowp vector carry);"
|
||||
"vector usubBorrow(highp vector, highp vector, out lowp vector borrow);"
|
||||
"void umulExtended(highp vector, highp vector, out highp vector, out highp vector);"
|
||||
@@ -5287,6 +5398,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"vector mix(vector, vector, int8_t);"
|
||||
|
||||
"vector expectEXT(vector, vector);"
|
||||
|
||||
"vector bitcastExtractfe2m1EXT(vector, uint);"
|
||||
"vector bitcastExtractfe3m2EXT(vector, uint);"
|
||||
"vector bitcastExtractfe2m3EXT(vector, uint);"
|
||||
;
|
||||
|
||||
std::string longVectorDerivativeFuncs =
|
||||
@@ -6951,6 +7066,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"\n");
|
||||
}
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 130)) {
|
||||
addGatherFunctionsQCOM();
|
||||
}
|
||||
|
||||
// GL_ARB_shader_ballot
|
||||
if (profile != EEsProfile && version >= 450) {
|
||||
const char* ballotDecls =
|
||||
@@ -7112,6 +7232,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"const uint gl_RayFlagsSkipBuiltinPrimitivesNV = 256U;"
|
||||
"const uint gl_RayFlagsSkipAABBEXT = 512U;"
|
||||
"const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;"
|
||||
"const bool gl_EnableOpacityMicromapEXT = false;"
|
||||
"const uint gl_HitKindFrontFacingTriangleEXT = 254U;"
|
||||
"const uint gl_HitKindBackFacingTriangleEXT = 255U;"
|
||||
"in uint gl_HitKindFrontFacingMicroTriangleNV;"
|
||||
@@ -8361,6 +8482,57 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
|
||||
}
|
||||
}
|
||||
|
||||
void TBuiltIns::addGatherFunctionsQCOM()
|
||||
{
|
||||
const TBasicType bTypes[] = { EbtFloat, EbtInt, EbtUint };
|
||||
const TSamplerDim sDims[] = { Esd2D };
|
||||
const TString modes[] = { "4x1", "V2", "H2", "D" };
|
||||
for (size_t arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
|
||||
for (size_t dimIdx = 0; dimIdx < std::size(sDims); ++dimIdx) {
|
||||
int dim = sDims[dimIdx];
|
||||
// Loop over the bTypes
|
||||
for (size_t bType = 0; bType < std::size(bTypes); ++bType) {
|
||||
for (size_t mode = 0; mode < std::size(modes); ++mode) {
|
||||
// loop over two forms of offset in the call name: none, and Offset
|
||||
for (int offset = 0; offset < 2; ++offset) {
|
||||
for (int comp = 0; comp < 2; ++comp) {
|
||||
//
|
||||
// Now, make all the function prototypes for the type we just built...
|
||||
//
|
||||
TSampler sampler;
|
||||
sampler.set(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, false, false);
|
||||
TString typeName = sampler.getString().c_str();
|
||||
|
||||
TString s;
|
||||
s.append(prefixes[sampler.type]);
|
||||
s.append("vec4 textureGather");
|
||||
s.append(modes[mode]);
|
||||
|
||||
if (offset == 1)
|
||||
s.append("Offset");
|
||||
|
||||
s.append("QCOM(");
|
||||
s.append(typeName);
|
||||
s.append(", vec");
|
||||
int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0);
|
||||
s.append(postfixes[totalDims]);
|
||||
|
||||
// offset argument
|
||||
if (offset == 1)
|
||||
s.append(", ivec2");
|
||||
|
||||
if (comp)
|
||||
s.append(", int");
|
||||
s.append(");\n");
|
||||
commonBuiltins.append(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Add context-dependent built-in functions and variables that are present
|
||||
// for the given version and profile. All the results are put into just the
|
||||
@@ -9458,6 +9630,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setVariableExtensions("gl_RayFlagsSkipAABBEXT", 1, &E_GL_EXT_ray_flags_primitive_culling);
|
||||
symbolTable.setVariableExtensions("gl_RayFlagsSkipTrianglesEXT", 1, &E_GL_EXT_ray_flags_primitive_culling);
|
||||
symbolTable.setVariableExtensions("gl_RayFlagsForceOpacityMicromap2StateEXT", 1, &E_GL_EXT_opacity_micromap);
|
||||
symbolTable.setVariableExtensions("gl_EnableOpacityMicromapEXT", 1, &E_GL_EXT_opacity_micromap_ray_query_mode);
|
||||
}
|
||||
|
||||
if ((profile != EEsProfile && version >= 130) ||
|
||||
@@ -10037,6 +10210,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setVariableExtensions("gl_TileDimensionQCOM", 1, &E_GL_QCOM_tile_shading);
|
||||
symbolTable.setVariableExtensions("gl_TileApronSizeQCOM", 1, &E_GL_QCOM_tile_shading);
|
||||
}
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 130)) {
|
||||
symbolTable.setFunctionExtensions("textureGather4x1QCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGatherV2QCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGatherH2QCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGatherDQCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGather4x1OffsetQCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGatherV2OffsetQCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGatherH2OffsetQCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
symbolTable.setFunctionExtensions("textureGatherDOffsetQCOM", 1, &E_GL_QCOM_image_processing3);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case EShLangCompute:
|
||||
@@ -10079,10 +10265,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader);
|
||||
}
|
||||
|
||||
|
||||
symbolTable.setFunctionExtensions("controlBarrier", 1, &E_GL_KHR_memory_scope_semantics);
|
||||
symbolTable.setFunctionExtensions("debugPrintfEXT", 1, &E_GL_EXT_debug_printf);
|
||||
symbolTable.setFunctionExtensions("abortEXT", 1, &E_GL_EXT_abort);
|
||||
symbolTable.setFunctionExtensions("controlBarrierArrive", 1, &E_GL_EXT_split_barrier);
|
||||
symbolTable.setFunctionExtensions("controlBarrierWait", 1, &E_GL_EXT_split_barrier);
|
||||
|
||||
// GL_ARB_shader_ballot
|
||||
if (profile != EEsProfile) {
|
||||
@@ -10217,6 +10404,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("setTensorViewClipNV", 1, &E_GL_NV_cooperative_matrix2);
|
||||
}
|
||||
|
||||
{
|
||||
symbolTable.setFunctionExtensions("coopMatReduceEXT", 1, &E_GL_EXT_cooperative_matrix_maintenance1);
|
||||
symbolTable.setFunctionExtensions("coopMatPerElementEXT", 1, &E_GL_EXT_cooperative_matrix_maintenance1);
|
||||
symbolTable.setFunctionExtensions("coopMatTransposeEXT", 1, &E_GL_EXT_cooperative_matrix_maintenance1);
|
||||
symbolTable.setFunctionExtensions("coopMatGetCoordinateEXT", 1, &E_GL_EXT_cooperative_matrix_maintenance1);
|
||||
}
|
||||
|
||||
{
|
||||
symbolTable.setFunctionExtensions("tensorReadARM", 1, &E_GL_ARM_tensors);
|
||||
symbolTable.setFunctionExtensions("tensorWriteARM", 1, &E_GL_ARM_tensors);
|
||||
@@ -10313,6 +10507,43 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
|
||||
const char *float8exts[] = {E_GL_EXT_float_e5m2, E_GL_EXT_float_e4m3};
|
||||
symbolTable.setFunctionExtensions("saturatedConvertEXT", 2, float8exts);
|
||||
|
||||
symbolTable.setFunctionExtensions("floatue8m0BitsToIntEXT", 1, &E_GL_EXT_float_ue8m0);
|
||||
symbolTable.setFunctionExtensions("floatue8m0BitsToUintEXT", 1, &E_GL_EXT_float_ue8m0);
|
||||
symbolTable.setFunctionExtensions("intBitsToFloatue8m0EXT", 1, &E_GL_EXT_float_ue8m0);
|
||||
symbolTable.setFunctionExtensions("uintBitsToFloatue8m0EXT", 1, &E_GL_EXT_float_ue8m0);
|
||||
|
||||
symbolTable.setFunctionExtensions("floatmxint8BitsToIntEXT", 1, &E_GL_EXT_float_mxint8);
|
||||
symbolTable.setFunctionExtensions("floatmxint8BitsToUintEXT", 1, &E_GL_EXT_float_mxint8);
|
||||
symbolTable.setFunctionExtensions("intBitsToFloatmxint8EXT", 1, &E_GL_EXT_float_mxint8);
|
||||
symbolTable.setFunctionExtensions("uintBitsToFloatmxint8EXT", 1, &E_GL_EXT_float_mxint8);
|
||||
|
||||
symbolTable.setFunctionExtensions("unpackFloat2xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("unpackFloat4xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("unpackFloat8xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("unpackFloat16xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("packFloat2xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("packFloat4xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("packFloat8xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("packFloat16xfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
|
||||
symbolTable.setFunctionExtensions("unpackFloat4xfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
symbolTable.setFunctionExtensions("unpackFloat8xfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
symbolTable.setFunctionExtensions("unpackFloat16xfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
symbolTable.setFunctionExtensions("packFloat4xfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
symbolTable.setFunctionExtensions("packFloat8xfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
symbolTable.setFunctionExtensions("packFloat16xfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
|
||||
symbolTable.setFunctionExtensions("unpackFloat4xfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
symbolTable.setFunctionExtensions("unpackFloat8xfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
symbolTable.setFunctionExtensions("unpackFloat16xfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
symbolTable.setFunctionExtensions("packFloat4xfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
symbolTable.setFunctionExtensions("packFloat8xfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
symbolTable.setFunctionExtensions("packFloat16xfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
|
||||
symbolTable.setFunctionExtensions("bitcastExtractfe2m1EXT", 1, &E_GL_EXT_float_e2m1);
|
||||
symbolTable.setFunctionExtensions("bitcastExtractfe3m2EXT", 1, &E_GL_EXT_float_e3m2);
|
||||
symbolTable.setFunctionExtensions("bitcastExtractfe2m3EXT", 1, &E_GL_EXT_float_e2m3);
|
||||
}
|
||||
|
||||
// E_SPV_QCOM_tile_shading
|
||||
@@ -11038,6 +11269,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter);
|
||||
symbolTable.relateToOperator("memoryBarrierImage", EOpMemoryBarrierImage);
|
||||
|
||||
symbolTable.relateToOperator("controlBarrierArrive", EOpControlBarrierArriveEXT);
|
||||
symbolTable.relateToOperator("controlBarrierWait", EOpControlBarrierWaitEXT);
|
||||
|
||||
if (spvVersion.vulkanRelaxed) {
|
||||
//
|
||||
// functions signature have been replaced to take uint operations on buffer variables
|
||||
@@ -11358,6 +11592,43 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("uintBitsToFloate4m3EXT", EOpUintBitsToFloat);
|
||||
|
||||
symbolTable.relateToOperator("saturatedConvertEXT", EOpConstructSaturated);
|
||||
|
||||
symbolTable.relateToOperator("floatue8m0BitsToIntEXT", EOpFloatBitsToInt);
|
||||
symbolTable.relateToOperator("floatue8m0BitsToUintEXT", EOpFloatBitsToUint);
|
||||
symbolTable.relateToOperator("intBitsToFloatue8m0EXT", EOpIntBitsToFloat);
|
||||
symbolTable.relateToOperator("uintBitsToFloatue8m0EXT", EOpUintBitsToFloat);
|
||||
|
||||
symbolTable.relateToOperator("floatmxint8BitsToIntEXT", EOpFloatBitsToInt);
|
||||
symbolTable.relateToOperator("floatmxint8BitsToUintEXT", EOpFloatBitsToUint);
|
||||
symbolTable.relateToOperator("intBitsToFloatmxint8EXT", EOpIntBitsToFloat);
|
||||
symbolTable.relateToOperator("uintBitsToFloatmxint8EXT", EOpUintBitsToFloat);
|
||||
|
||||
symbolTable.relateToOperator("unpackFloat2xfe2m1EXT", EOpUnpackFloat2xE2M1);
|
||||
symbolTable.relateToOperator("unpackFloat4xfe2m1EXT", EOpUnpackFloat4xE2M1);
|
||||
symbolTable.relateToOperator("unpackFloat8xfe2m1EXT", EOpUnpackFloat8xE2M1);
|
||||
symbolTable.relateToOperator("unpackFloat16xfe2m1EXT", EOpUnpackFloat16xE2M1);
|
||||
symbolTable.relateToOperator("packFloat2xfe2m1EXT", EOpPackFloat2xE2M1);
|
||||
symbolTable.relateToOperator("packFloat4xfe2m1EXT", EOpPackFloat4xE2M1);
|
||||
symbolTable.relateToOperator("packFloat8xfe2m1EXT", EOpPackFloat8xE2M1);
|
||||
symbolTable.relateToOperator("packFloat16xfe2m1EXT", EOpPackFloat16xE2M1);
|
||||
|
||||
symbolTable.relateToOperator("unpackFloat4xfe3m2EXT", EOpUnpackFloat4xE3M2);
|
||||
symbolTable.relateToOperator("unpackFloat8xfe3m2EXT", EOpUnpackFloat8xE3M2);
|
||||
symbolTable.relateToOperator("unpackFloat16xfe3m2EXT", EOpUnpackFloat16xE3M2);
|
||||
symbolTable.relateToOperator("packFloat4xfe3m2EXT", EOpPackFloat4xE3M2);
|
||||
symbolTable.relateToOperator("packFloat8xfe3m2EXT", EOpPackFloat8xE3M2);
|
||||
symbolTable.relateToOperator("packFloat16xfe3m2EXT", EOpPackFloat16xE3M2);
|
||||
|
||||
symbolTable.relateToOperator("unpackFloat4xfe2m3EXT", EOpUnpackFloat4xE2M3);
|
||||
symbolTable.relateToOperator("unpackFloat8xfe2m3EXT", EOpUnpackFloat8xE2M3);
|
||||
symbolTable.relateToOperator("unpackFloat16xfe2m3EXT", EOpUnpackFloat16xE2M3);
|
||||
symbolTable.relateToOperator("packFloat4xfe2m3EXT", EOpPackFloat4xE2M3);
|
||||
symbolTable.relateToOperator("packFloat8xfe2m3EXT", EOpPackFloat8xE2M3);
|
||||
symbolTable.relateToOperator("packFloat16xfe2m3EXT", EOpPackFloat16xE2M3);
|
||||
|
||||
symbolTable.relateToOperator("bitcastExtractfe2m1EXT", EOpBitcastExtractE2M1);
|
||||
symbolTable.relateToOperator("bitcastExtractfe3m2EXT", EOpBitcastExtractE3M2);
|
||||
symbolTable.relateToOperator("bitcastExtractfe2m3EXT", EOpBitcastExtractE2M3);
|
||||
}
|
||||
|
||||
// GL_KHR_shader_subgroup
|
||||
@@ -11469,6 +11740,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("textureBlockMatchGatherSADQCOM", EOpImageBlockMatchGatherSADQCOM);
|
||||
}
|
||||
|
||||
if ((profile == EEsProfile && version >= 310) ||
|
||||
(profile != EEsProfile && version >= 130)) {
|
||||
symbolTable.relateToOperator("textureGather4x1QCOM", EOpTextureGather4x1QCOM);
|
||||
symbolTable.relateToOperator("textureGatherV2QCOM", EOpTextureGatherV2QCOM);
|
||||
symbolTable.relateToOperator("textureGatherH2QCOM", EOpTextureGatherH2QCOM);
|
||||
symbolTable.relateToOperator("textureGatherDQCOM", EOpTextureGatherDQCOM);
|
||||
symbolTable.relateToOperator("textureGather4x1OffsetQCOM", EOpTextureGather4x1OffsetQCOM);
|
||||
symbolTable.relateToOperator("textureGatherV2OffsetQCOM", EOpTextureGatherV2OffsetQCOM);
|
||||
symbolTable.relateToOperator("textureGatherH2OffsetQCOM", EOpTextureGatherH2OffsetQCOM);
|
||||
symbolTable.relateToOperator("textureGatherDOffsetQCOM", EOpTextureGatherDOffsetQCOM);
|
||||
}
|
||||
|
||||
if (profile != EEsProfile && spvVersion.spv == 0) {
|
||||
symbolTable.relateToOperator("texture1DArray", EOpTexture);
|
||||
symbolTable.relateToOperator("texture2DArray", EOpTexture);
|
||||
@@ -11593,6 +11876,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("coopMatPerElementNV", EOpCooperativeMatrixPerElementOpNV);
|
||||
symbolTable.relateToOperator("coopMatTransposeNV", EOpCooperativeMatrixTransposeNV);
|
||||
|
||||
symbolTable.relateToOperator("coopMatReduceEXT", EOpCooperativeMatrixReduceNV);
|
||||
symbolTable.relateToOperator("coopMatPerElementEXT", EOpCooperativeMatrixPerElementOpNV);
|
||||
symbolTable.relateToOperator("coopMatTransposeEXT", EOpCooperativeMatrixTransposeNV);
|
||||
symbolTable.relateToOperator("coopMatGetCoordinateEXT", EOpCooperativeMatrixGetCoordinateEXT);
|
||||
|
||||
symbolTable.relateToOperator("createTensorLayoutNV", EOpCreateTensorLayoutNV);
|
||||
symbolTable.relateToOperator("setTensorLayoutBlockSizeNV", EOpTensorLayoutSetBlockSizeNV);
|
||||
symbolTable.relateToOperator("setTensorLayoutDimensionNV", EOpTensorLayoutSetDimensionNV);
|
||||
@@ -12032,6 +12320,10 @@ bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultTyp
|
||||
checkBitCast(EbtFloatE5M2, EbtInt8);
|
||||
} else if (fnCandidate->getName() == "floate4m3BitsToIntEXT") {
|
||||
checkBitCast(EbtFloatE4M3, EbtInt8);
|
||||
} else if (fnCandidate->getName() == "floatue8m0BitsToIntEXT") {
|
||||
checkBitCast(EbtFloatUE8M0, EbtInt8);
|
||||
} else if (fnCandidate->getName() == "floatmxint8BitsToIntEXT") {
|
||||
checkBitCast(EbtFloatMXINT8, EbtInt8);
|
||||
} else {
|
||||
checkBitCast(EbtFloat, EbtInt);
|
||||
}
|
||||
@@ -12043,6 +12335,10 @@ bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultTyp
|
||||
checkBitCast(EbtFloatE5M2, EbtUint8);
|
||||
} else if (fnCandidate->getName() == "floate4m3BitsToUintEXT") {
|
||||
checkBitCast(EbtFloatE4M3, EbtUint8);
|
||||
} else if (fnCandidate->getName() == "floatue8m0BitsToUintEXT") {
|
||||
checkBitCast(EbtFloatUE8M0, EbtUint8);
|
||||
} else if (fnCandidate->getName() == "floatmxint8BitsToUintEXT") {
|
||||
checkBitCast(EbtFloatMXINT8, EbtUint8);
|
||||
} else {
|
||||
checkBitCast(EbtFloat, EbtUint);
|
||||
}
|
||||
@@ -12054,6 +12350,10 @@ bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultTyp
|
||||
checkBitCast(EbtInt8, EbtFloatE5M2);
|
||||
} else if (fnCandidate->getName() == "intBitsToFloate4m3EXT") {
|
||||
checkBitCast(EbtInt8, EbtFloatE4M3);
|
||||
} else if (fnCandidate->getName() == "intBitsToFloatue8m0EXT") {
|
||||
checkBitCast(EbtInt8, EbtFloatUE8M0);
|
||||
} else if (fnCandidate->getName() == "intBitsToFloatmxint8EXT") {
|
||||
checkBitCast(EbtInt8, EbtFloatMXINT8);
|
||||
} else {
|
||||
checkBitCast(EbtInt, EbtFloat);
|
||||
}
|
||||
@@ -12065,6 +12365,10 @@ bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultTyp
|
||||
checkBitCast(EbtUint8, EbtFloatE5M2);
|
||||
} else if (fnCandidate->getName() == "uintBitsToFloate4m3EXT") {
|
||||
checkBitCast(EbtUint8, EbtFloatE4M3);
|
||||
} else if (fnCandidate->getName() == "uintBitsToFloatue8m0EXT") {
|
||||
checkBitCast(EbtUint8, EbtFloatUE8M0);
|
||||
} else if (fnCandidate->getName() == "uintBitsToFloatmxint8EXT") {
|
||||
checkBitCast(EbtUint8, EbtFloatMXINT8);
|
||||
} else {
|
||||
checkBitCast(EbtUint, EbtFloat);
|
||||
}
|
||||
@@ -12242,6 +12546,29 @@ bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultTyp
|
||||
resultType->deepCopy(getArg(0)->getType());
|
||||
}
|
||||
return valid;
|
||||
case EOpPackFloat8xE2M1:
|
||||
resultType->deepCopy(TType(EbtUint));
|
||||
return valid;
|
||||
case EOpPackFloat16xE2M1:
|
||||
resultType->deepCopy(TType(EbtUint, EvqTemporary, 2));
|
||||
return valid;
|
||||
case EOpPackFloat8xE3M2:
|
||||
case EOpPackFloat8xE2M3:
|
||||
resultType->deepCopy(TType(EbtUint16, EvqTemporary, 3));
|
||||
return valid;
|
||||
case EOpPackFloat16xE3M2:
|
||||
case EOpPackFloat16xE2M3:
|
||||
resultType->deepCopy(TType(EbtUint, EvqTemporary, 3));
|
||||
return valid;
|
||||
case EOpBitcastExtractE2M1:
|
||||
checkBitCast(EbtUint8, EbtFloatE2M1);
|
||||
return valid;
|
||||
case EOpBitcastExtractE3M2:
|
||||
checkBitCast(EbtUint8, EbtFloatE3M2);
|
||||
return valid;
|
||||
case EOpBitcastExtractE2M3:
|
||||
checkBitCast(EbtUint8, EbtFloatE2M3);
|
||||
return valid;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ protected:
|
||||
void addImageFunctions(TSampler, const TString& typeName, int version, EProfile profile);
|
||||
void addSamplingFunctions(TSampler, const TString& typeName, int version, EProfile profile);
|
||||
void addGatherFunctions(TSampler, const TString& typeName, int version, EProfile profile);
|
||||
void addGatherFunctionsQCOM();
|
||||
|
||||
// Helpers for making textual representations of the permutations
|
||||
// of texturing/imaging functions.
|
||||
|
||||
+117
-6
@@ -403,6 +403,11 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
|
||||
case EOpConstructBFloat16: newType = EbtBFloat16; break;
|
||||
case EOpConstructFloatE4M3: newType = EbtFloatE4M3; break;
|
||||
case EOpConstructFloatE5M2: newType = EbtFloatE5M2; break;
|
||||
case EOpConstructFloatE2M1: newType = EbtFloatE2M1; break;
|
||||
case EOpConstructFloatE3M2: newType = EbtFloatE3M2; break;
|
||||
case EOpConstructFloatE2M3: newType = EbtFloatE2M3; break;
|
||||
case EOpConstructFloatUE8M0: newType = EbtFloatUE8M0; break;
|
||||
case EOpConstructFloatMXINT8: newType = EbtFloatMXINT8; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
|
||||
@@ -439,7 +444,12 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
|
||||
case EOpConstructFloat16:
|
||||
case EOpConstructBFloat16:
|
||||
case EOpConstructFloatE5M2:
|
||||
case EOpConstructFloatE4M3: {
|
||||
case EOpConstructFloatE4M3:
|
||||
case EOpConstructFloatE2M1:
|
||||
case EOpConstructFloatE3M2:
|
||||
case EOpConstructFloatE2M3:
|
||||
case EOpConstructFloatUE8M0:
|
||||
case EOpConstructFloatMXINT8: {
|
||||
TIntermUnary* unary_node = child->getAsUnaryNode();
|
||||
if (unary_node != nullptr)
|
||||
unary_node->updatePrecision();
|
||||
@@ -581,8 +591,13 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
|
||||
bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& newOp) const
|
||||
{
|
||||
// (bfloat16_t,fp8) <-> bool not supported
|
||||
if (((src == EbtBFloat16 || src == EbtFloatE5M2 || src == EbtFloatE4M3) && dst == EbtBool) ||
|
||||
((dst == EbtBFloat16 || dst == EbtFloatE5M2 || dst == EbtFloatE4M3) && src == EbtBool)) {
|
||||
if (((src == EbtBFloat16 || src == EbtFloatE5M2 || src == EbtFloatE4M3 || isTypeOcpMicroscalingFloat(src)) && dst == EbtBool) ||
|
||||
((dst == EbtBFloat16 || dst == EbtFloatE5M2 || dst == EbtFloatE4M3 || isTypeOcpMicroscalingFloat(dst)) && src == EbtBool)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// no type conversions to microscaling types
|
||||
if (isTypeOcpMicroscalingFloat(dst) && src != dst) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -621,7 +636,8 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
|
||||
node->getBasicType() == EbtFloat ||
|
||||
node->getBasicType() == EbtDouble ||
|
||||
node->getBasicType() == EbtFloatE5M2 ||
|
||||
node->getBasicType() == EbtFloatE4M3);
|
||||
node->getBasicType() == EbtFloatE4M3 ||
|
||||
isTypeOcpMicroscalingFloat(node->getBasicType()));
|
||||
|
||||
if (((convertTo == EbtInt8 || convertTo == EbtUint8) && ! convertFromIntTypes) ||
|
||||
((node->getBasicType() == EbtInt8 || node->getBasicType() == EbtUint8) && ! convertToIntTypes)) {
|
||||
@@ -879,6 +895,11 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpConstructBFloat16:
|
||||
case EOpConstructFloatE5M2:
|
||||
case EOpConstructFloatE4M3:
|
||||
case EOpConstructFloatE2M1:
|
||||
case EOpConstructFloatE3M2:
|
||||
case EOpConstructFloatE2M3:
|
||||
case EOpConstructFloatUE8M0:
|
||||
case EOpConstructFloatMXINT8:
|
||||
case EOpConstructInt8:
|
||||
case EOpConstructUint8:
|
||||
case EOpConstructInt16:
|
||||
@@ -989,6 +1010,11 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
|
||||
case EOpConstructBFloat16:
|
||||
case EOpConstructFloatE5M2:
|
||||
case EOpConstructFloatE4M3:
|
||||
case EOpConstructFloatE2M1:
|
||||
case EOpConstructFloatE3M2:
|
||||
case EOpConstructFloatE2M3:
|
||||
case EOpConstructFloatUE8M0:
|
||||
case EOpConstructFloatMXINT8:
|
||||
canPromoteConstant = true;
|
||||
break;
|
||||
case EOpConstructFloat16:
|
||||
@@ -1296,6 +1322,10 @@ bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtFloat16:
|
||||
case EbtFloat:
|
||||
return true;
|
||||
@@ -1388,7 +1418,8 @@ bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
|
||||
|
||||
bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const
|
||||
{
|
||||
if (to == EbtFloat && (from == EbtFloat16 || from == EbtBFloat16 || from == EbtFloatE5M2 || from == EbtFloatE4M3)) {
|
||||
if (to == EbtFloat && (from == EbtFloat16 || from == EbtBFloat16 || from == EbtFloatE5M2 || from == EbtFloatE4M3 ||
|
||||
from == EbtFloatE2M1 || from == EbtFloatE3M2 || from == EbtFloatE2M3 || from == EbtFloatMXINT8)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1545,6 +1576,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatMXINT8:
|
||||
return true;
|
||||
case EbtInt8:
|
||||
case EbtUint8:
|
||||
@@ -1570,6 +1605,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatMXINT8:
|
||||
return true;
|
||||
case EbtInt8:
|
||||
case EbtUint8:
|
||||
@@ -1642,6 +1681,10 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
return numericFeatures.contains(TNumericFeatures::gpu_shader_int16);
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatMXINT8:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
@@ -1651,6 +1694,19 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
|
||||
switch (from) {
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatMXINT8:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE5M2:
|
||||
switch (from) {
|
||||
case EbtFloatE2M1:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
@@ -2137,6 +2193,51 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtFloatE2M1:
|
||||
switch (type.getVectorSize()) {
|
||||
case 1: op = EOpConstructFloatE2M1; break;
|
||||
case 2: op = EOpConstructFloatE2M1Vec2; break;
|
||||
case 3: op = EOpConstructFloatE2M1Vec3; break;
|
||||
case 4: op = EOpConstructFloatE2M1Vec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtFloatE3M2:
|
||||
switch (type.getVectorSize()) {
|
||||
case 1: op = EOpConstructFloatE3M2; break;
|
||||
case 2: op = EOpConstructFloatE3M2Vec2; break;
|
||||
case 3: op = EOpConstructFloatE3M2Vec3; break;
|
||||
case 4: op = EOpConstructFloatE3M2Vec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtFloatE2M3:
|
||||
switch (type.getVectorSize()) {
|
||||
case 1: op = EOpConstructFloatE2M3; break;
|
||||
case 2: op = EOpConstructFloatE2M3Vec2; break;
|
||||
case 3: op = EOpConstructFloatE2M3Vec3; break;
|
||||
case 4: op = EOpConstructFloatE2M3Vec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtFloatUE8M0:
|
||||
switch (type.getVectorSize()) {
|
||||
case 1: op = EOpConstructFloatUE8M0; break;
|
||||
case 2: op = EOpConstructFloatUE8M0Vec2; break;
|
||||
case 3: op = EOpConstructFloatUE8M0Vec3; break;
|
||||
case 4: op = EOpConstructFloatUE8M0Vec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtFloatMXINT8:
|
||||
switch (type.getVectorSize()) {
|
||||
case 1: op = EOpConstructFloatMXINT8; break;
|
||||
case 2: op = EOpConstructFloatMXINT8Vec2; break;
|
||||
case 3: op = EOpConstructFloatMXINT8Vec3; break;
|
||||
case 4: op = EOpConstructFloatMXINT8Vec4; break;
|
||||
default: break; // some compilers want this
|
||||
}
|
||||
break;
|
||||
case EbtInt8:
|
||||
switch(type.getVectorSize()) {
|
||||
case 1: op = EOpConstructInt8; break;
|
||||
@@ -2547,7 +2648,7 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc&
|
||||
|
||||
TIntermConstantUnion* TIntermediate::addConstantUnion(double d, TBasicType baseType, const TSourceLoc& loc, bool literal) const
|
||||
{
|
||||
assert(baseType == EbtFloat || baseType == EbtDouble || baseType == EbtFloat16 || baseType == EbtBFloat16 || baseType == EbtFloatE5M2 || baseType == EbtFloatE4M3);
|
||||
assert(isTypeFloat(baseType));
|
||||
|
||||
if (isEsProfile() && (baseType == EbtFloat || baseType == EbtFloat16)) {
|
||||
int exponent = 0;
|
||||
@@ -3909,6 +4010,11 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtBFloat16: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatE5M2: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatE4M3: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatE2M1: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatE3M2: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatE2M3: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatUE8M0: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloatMXINT8: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtFloat: PROMOTE(setDConst, double, Get); break; \
|
||||
case EbtDouble: PROMOTE(setDConst, double, Get); break; \
|
||||
@@ -3933,6 +4039,11 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
|
||||
case EbtBFloat16: TO_ALL(getDConst); break;
|
||||
case EbtFloatE5M2: TO_ALL(getDConst); break;
|
||||
case EbtFloatE4M3: TO_ALL(getDConst); break;
|
||||
case EbtFloatE2M1: TO_ALL(getDConst); break;
|
||||
case EbtFloatE3M2: TO_ALL(getDConst); break;
|
||||
case EbtFloatE2M3: TO_ALL(getDConst); break;
|
||||
case EbtFloatUE8M0: TO_ALL(getDConst); break;
|
||||
case EbtFloatMXINT8: TO_ALL(getDConst); break;
|
||||
case EbtDouble: TO_ALL(getDConst); break;
|
||||
case EbtInt8: TO_ALL(getI8Const); break;
|
||||
case EbtInt16: TO_ALL(getI16Const); break;
|
||||
|
||||
@@ -313,6 +313,11 @@ void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int
|
||||
error(loc, "", "[", "cooperative vector index out of range '%d'", index);
|
||||
index = type.computeNumComponents() - 1;
|
||||
}
|
||||
} else if (type.isLongVector()) {
|
||||
if (!type.hasSpecConstantVectorComponents() && index >= type.computeNumComponents()) {
|
||||
error(loc, "", "[", "vector index out of range '%d'", index);
|
||||
index = type.computeNumComponents() - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,6 +542,7 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin
|
||||
exyzw,
|
||||
ergba,
|
||||
estpq,
|
||||
ebadswizzle,
|
||||
} fieldSet[MaxSwizzleSelectors];
|
||||
|
||||
// Decode the swizzle string.
|
||||
@@ -596,13 +602,19 @@ void TParseContextBase::parseSwizzleSelector(const TSourceLoc& loc, const TStrin
|
||||
break;
|
||||
|
||||
default:
|
||||
error(loc, "unknown swizzle selection", compString.c_str(), "");
|
||||
fieldSet[i] = ebadswizzle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Additional error checking.
|
||||
for (int i = 0; i < selector.size(); ++i) {
|
||||
if (fieldSet[i] == ebadswizzle) {
|
||||
error(loc, "unknown swizzle selection", compString.c_str(), "");
|
||||
selector.resize(i);
|
||||
break;
|
||||
}
|
||||
|
||||
if (selector[i] >= vecSize) {
|
||||
error(loc, "vector swizzle selection out of range", compString.c_str(), "");
|
||||
selector.resize(i);
|
||||
@@ -694,7 +706,7 @@ void TParseContextBase::growAtomicCounterBlock(int binding, const TSourceLoc& lo
|
||||
blockQualifier.storage = EvqBuffer;
|
||||
|
||||
char charBuffer[512];
|
||||
if (binding != TQualifier::layoutBindingEnd) {
|
||||
if (binding != TQualifier::layoutNotSet) {
|
||||
snprintf(charBuffer, 512, "%s_%d", getAtomicCounterBlockName(), binding);
|
||||
} else {
|
||||
snprintf(charBuffer, 512, "%s_0", getAtomicCounterBlockName());
|
||||
|
||||
+657
-106
File diff suppressed because it is too large
Load Diff
@@ -91,9 +91,9 @@ public:
|
||||
parsingBuiltins(parsingBuiltins), scanContext(nullptr), ppContext(nullptr),
|
||||
limits(resources.limits),
|
||||
globalUniformBlock(nullptr),
|
||||
globalUniformBinding(TQualifier::layoutBindingEnd),
|
||||
globalUniformSet(TQualifier::layoutSetEnd),
|
||||
atomicCounterBlockSet(TQualifier::layoutSetEnd)
|
||||
globalUniformBinding(TQualifier::layoutNotSet),
|
||||
globalUniformSet(TQualifier::layoutNotSet),
|
||||
atomicCounterBlockSet(TQualifier::layoutNotSet)
|
||||
{
|
||||
// use storage buffer on SPIR-V 1.3 and up
|
||||
if (spvVersion.spv >= EShTargetSpv_1_3)
|
||||
@@ -230,8 +230,8 @@ protected:
|
||||
|
||||
// Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
|
||||
TVariable* globalUniformBlock; // the actual block, inserted into the symbol table
|
||||
unsigned int globalUniformBinding; // the block's binding number
|
||||
unsigned int globalUniformSet; // the block's set number
|
||||
int globalUniformBinding; // the block's binding number
|
||||
int globalUniformSet; // the block's set number
|
||||
int firstNewMember; // the index of the first member not yet inserted into the symbol table
|
||||
// override this to set the language-specific name
|
||||
virtual const char* getGlobalUniformBlockName() const { return ""; }
|
||||
@@ -240,7 +240,7 @@ protected:
|
||||
|
||||
// Manage the atomic counter block (used for atomic_uints with Vulkan-Relaxed)
|
||||
TMap<int, TVariable*> atomicCounterBuffers;
|
||||
unsigned int atomicCounterBlockSet;
|
||||
int atomicCounterBlockSet;
|
||||
TMap<int, int> atomicCounterBlockFirstNewMember;
|
||||
// override this to set the language-specific name
|
||||
virtual const char* getAtomicCounterBlockName() const { return ""; }
|
||||
@@ -358,7 +358,7 @@ public:
|
||||
TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermAggregate&) const;
|
||||
TIntermTyped* addAssign(const TSourceLoc&, TOperator op, TIntermTyped* left, TIntermTyped* right);
|
||||
void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
|
||||
void requireDerivativeLayout(const TSourceLoc&, const char* featureDesc);
|
||||
void requireDerivativeLayout(const TSourceLoc&, const char* featureDesc, bool isDerivativeOp);
|
||||
void nonOpBuiltInCheck(const TSourceLoc&, const TFunction&, TIntermAggregate&);
|
||||
void userFunctionCallCheck(const TSourceLoc&, TIntermAggregate&);
|
||||
void samplerConstructorLocationCheck(const TSourceLoc&, const char* token, TIntermNode*);
|
||||
@@ -458,7 +458,7 @@ public:
|
||||
TParameter getParamWithDefault(const TPublicType& ty, TString* identifier, TIntermTyped* initializer,
|
||||
const TSourceLoc& loc);
|
||||
void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to);
|
||||
void descHeapBuiltinRemap(TType* type, bool isInnerBlock);
|
||||
void descHeapBuiltinRemap(TType* type, bool rootNode);
|
||||
bool untypedHeapCheck(TSymbol* symbol, const TType& type, const TSourceLoc& loc, const char* name);
|
||||
TIntermNode* declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr);
|
||||
void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&);
|
||||
@@ -490,7 +490,7 @@ public:
|
||||
// Determine loop control from attributes
|
||||
void handleLoopAttributes(const TAttributes& attributes, TIntermNode*);
|
||||
// Function attributes
|
||||
void handleFunctionAttributes(const TSourceLoc&, const TAttributes&);
|
||||
void handleFunctionAttributes(const TSourceLoc&, TFunction&, const TAttributes&);
|
||||
|
||||
// GL_EXT_spirv_intrinsics
|
||||
TSpirvRequirement* makeSpirvRequirement(const TSourceLoc& loc, const TString& name,
|
||||
|
||||
+99
-2
@@ -48,6 +48,7 @@
|
||||
#include "../Include/Types.h"
|
||||
#include "SymbolTable.h"
|
||||
#include "ParseHelper.h"
|
||||
#include "Versions.h"
|
||||
#include "attribute.h"
|
||||
#include "glslang_tab.cpp.h"
|
||||
#include "ScanContext.h"
|
||||
@@ -552,6 +553,31 @@ const std::unordered_map<const char*, int, str_hash, str_eq> KeywordMap {
|
||||
{"fe4m3vec3",FE4M3VEC3},
|
||||
{"fe4m3vec4",FE4M3VEC4},
|
||||
|
||||
{"floate2m1_t",FLOATE2M1_T},
|
||||
{"fe2m1vec2",FE2M1VEC2},
|
||||
{"fe2m1vec3",FE2M1VEC3},
|
||||
{"fe2m1vec4",FE2M1VEC4},
|
||||
|
||||
{"floate3m2_t",FLOATE3M2_T},
|
||||
{"fe3m2vec2",FE3M2VEC2},
|
||||
{"fe3m2vec3",FE3M2VEC3},
|
||||
{"fe3m2vec4",FE3M2VEC4},
|
||||
|
||||
{"floate2m3_t",FLOATE2M3_T},
|
||||
{"fe2m3vec2",FE2M3VEC2},
|
||||
{"fe2m3vec3",FE2M3VEC3},
|
||||
{"fe2m3vec4",FE2M3VEC4},
|
||||
|
||||
{"floatue8m0_t",FLOATUE8M0_T},
|
||||
{"fue8m0vec2",FUE8M0VEC2},
|
||||
{"fue8m0vec3",FUE8M0VEC3},
|
||||
{"fue8m0vec4",FUE8M0VEC4},
|
||||
|
||||
{"floatmxint8_t",FLOATMXINT8_T},
|
||||
{"fmxint8vec2",FMXINT8VEC2},
|
||||
{"fmxint8vec3",FMXINT8VEC3},
|
||||
{"fmxint8vec4",FMXINT8VEC4},
|
||||
|
||||
{"float32_t",FLOAT32_T},
|
||||
{"f32vec2",F32VEC2},
|
||||
{"f32vec3",F32VEC3},
|
||||
@@ -782,6 +808,8 @@ const std::unordered_map<const char*, int, str_hash, str_eq> KeywordMap {
|
||||
{"vector",VECTOR},
|
||||
{"resourceheap",RESOURCEHEAP},
|
||||
{"samplerheap",SAMPLERHEAP},
|
||||
{"inline", INLINE},
|
||||
{"noinline", NOINLINE},
|
||||
};
|
||||
const std::unordered_set<const char*, str_hash, str_eq> ReservedSet {
|
||||
"common",
|
||||
@@ -795,8 +823,6 @@ const std::unordered_set<const char*, str_hash, str_eq> ReservedSet {
|
||||
"template",
|
||||
"this",
|
||||
"goto",
|
||||
"inline",
|
||||
"noinline",
|
||||
"public",
|
||||
"static",
|
||||
"extern",
|
||||
@@ -921,6 +947,11 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
|
||||
case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT;
|
||||
case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT;
|
||||
case PpAtomConstFloat16: parserToken->sType.lex.d = ppToken.dval; return FLOAT16CONSTANT;
|
||||
case PpAtomConstFloatE2M1: parserToken->sType.lex.d = ppToken.dval; return FLOATE2M1CONSTANT;
|
||||
case PpAtomConstFloatE3M2: parserToken->sType.lex.d = ppToken.dval; return FLOATE3M2CONSTANT;
|
||||
case PpAtomConstFloatE2M3: parserToken->sType.lex.d = ppToken.dval; return FLOATE2M3CONSTANT;
|
||||
case PpAtomConstFloatUE8M0: parserToken->sType.lex.d = ppToken.dval; return FLOATUE8M0CONSTANT;
|
||||
case PpAtomConstFloatMXINT8: parserToken->sType.lex.d = ppToken.dval; return FLOATMXINT8CONSTANT;
|
||||
case PpAtomIdentifier:
|
||||
{
|
||||
int token = tokenizeIdentifier();
|
||||
@@ -1556,6 +1587,66 @@ int TScanContext::tokenizeIdentifier()
|
||||
|
||||
return identifierOrType();
|
||||
|
||||
case FLOATE2M1_T:
|
||||
case FE2M1VEC2:
|
||||
case FE2M1VEC3:
|
||||
case FE2M1VEC4:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_float_e2m1)) {
|
||||
afterType = true;
|
||||
return keyword;
|
||||
}
|
||||
|
||||
return identifierOrType();
|
||||
|
||||
case FLOATE3M2_T:
|
||||
case FE3M2VEC2:
|
||||
case FE3M2VEC3:
|
||||
case FE3M2VEC4:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_float_e3m2)) {
|
||||
afterType = true;
|
||||
return keyword;
|
||||
}
|
||||
|
||||
return identifierOrType();
|
||||
|
||||
case FLOATE2M3_T:
|
||||
case FE2M3VEC2:
|
||||
case FE2M3VEC3:
|
||||
case FE2M3VEC4:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_float_e2m3)) {
|
||||
afterType = true;
|
||||
return keyword;
|
||||
}
|
||||
|
||||
return identifierOrType();
|
||||
|
||||
case FLOATUE8M0_T:
|
||||
case FUE8M0VEC2:
|
||||
case FUE8M0VEC3:
|
||||
case FUE8M0VEC4:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_float_ue8m0)) {
|
||||
afterType = true;
|
||||
return keyword;
|
||||
}
|
||||
|
||||
return identifierOrType();
|
||||
|
||||
case FLOATMXINT8_T:
|
||||
case FMXINT8VEC2:
|
||||
case FMXINT8VEC3:
|
||||
case FMXINT8VEC4:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
parseContext.extensionTurnedOn(E_GL_EXT_float_mxint8)) {
|
||||
afterType = true;
|
||||
return keyword;
|
||||
}
|
||||
|
||||
return identifierOrType();
|
||||
|
||||
case SAMPLERCUBEARRAY:
|
||||
case SAMPLERCUBEARRAYSHADOW:
|
||||
case ISAMPLERCUBEARRAY:
|
||||
@@ -1987,6 +2078,12 @@ int TScanContext::tokenizeIdentifier()
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case INLINE:
|
||||
case NOINLINE:
|
||||
if (!parseContext.extensionTurnedOn(E_GL_EXT_function_control_attributes))
|
||||
return reservedWord();
|
||||
return keyword;
|
||||
|
||||
default:
|
||||
parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc);
|
||||
return 0;
|
||||
|
||||
+32
-4
@@ -777,6 +777,8 @@ void RecordProcesses(TIntermediate& intermediate, EShMessages messages, const st
|
||||
intermediate.addProcess("suppress-warnings");
|
||||
if ((messages & EShMsgKeepUncalled) != 0)
|
||||
intermediate.addProcess("keep-uncalled");
|
||||
if ((messages & EShMsgRelaxSetBindingLimits) != 0)
|
||||
intermediate.setRelaxSetBindingLimits(true);
|
||||
if (sourceEntryPointName.size() > 0) {
|
||||
intermediate.addProcess("source-entrypoint");
|
||||
intermediate.addProcessArgument(sourceEntryPointName);
|
||||
@@ -1076,6 +1078,28 @@ private:
|
||||
int lastLine;
|
||||
};
|
||||
|
||||
// Re-escape characters that would otherwise be emitted literally
|
||||
// so the preprocessed output remains valid GLSL source.
|
||||
static void appendEscapedString(std::string& output, const char* string) {
|
||||
|
||||
for (const char* p = string; *p != '\0'; ++p) {
|
||||
switch (*p) {
|
||||
case '"': output += "\\\""; break;
|
||||
case '\\': output += "\\\\"; break;
|
||||
case '\a': output += "\\a"; break;
|
||||
case '\b': output += "\\b"; break;
|
||||
case '\f': output += "\\f"; break;
|
||||
case '\n': output += "\\n"; break;
|
||||
case '\r': output += "\\r"; break;
|
||||
case '\t': output += "\\t"; break;
|
||||
case '\v': output += "\\v"; break;
|
||||
default:
|
||||
output += *p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DoPreprocessing is a valid ProcessingContext template argument,
|
||||
// which only performs the preprocessing step of compilation.
|
||||
// It places the result in the "string" argument to its constructor.
|
||||
@@ -1176,7 +1200,8 @@ struct DoPreprocessing {
|
||||
// Don't emit whitespace onto empty lines.
|
||||
// Copy any whitespace characters at the start of a line
|
||||
// from the input to the output.
|
||||
outputBuffer += std::string(ppToken.loc.column - 1, ' ');
|
||||
if (ppToken.loc.column > 0)
|
||||
outputBuffer += std::string(ppToken.loc.column - 1, ' ');
|
||||
}
|
||||
|
||||
// Output a space in between tokens, but not at the start of a line,
|
||||
@@ -1200,11 +1225,13 @@ struct DoPreprocessing {
|
||||
if (token == PpAtomIdentifier)
|
||||
lastTokenName = ppToken.name;
|
||||
lastToken = token;
|
||||
if (token == PpAtomConstString)
|
||||
if (token == PpAtomConstString) {
|
||||
outputBuffer += "\"";
|
||||
outputBuffer += ppToken.name;
|
||||
if (token == PpAtomConstString)
|
||||
appendEscapedString(outputBuffer, ppToken.name);
|
||||
outputBuffer += "\"";
|
||||
} else {
|
||||
outputBuffer += ppToken.name;
|
||||
}
|
||||
} while (true);
|
||||
outputBuffer += '\n';
|
||||
*outputString = std::move(outputBuffer);
|
||||
@@ -1816,6 +1843,7 @@ void TShader::setInvertY(bool invert) { intermediate->setInver
|
||||
void TShader::setDxPositionW(bool invert) { intermediate->setDxPositionW(invert); }
|
||||
void TShader::setEnhancedMsgs() { intermediate->setEnhancedMsgs(); }
|
||||
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
|
||||
void TShader::setDiscardIsTerminate(bool discardIsTerminate) { intermediate->setDiscardIsTerminate(discardIsTerminate); }
|
||||
|
||||
// Set binding base for given resource type
|
||||
void TShader::setShiftBinding(TResourceType res, unsigned int base) {
|
||||
|
||||
@@ -75,6 +75,11 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
case EbtBFloat16: mangledName += "bf16"; break;
|
||||
case EbtFloatE5M2: mangledName += "fe5m2"; break;
|
||||
case EbtFloatE4M3: mangledName += "fe4m3"; break;
|
||||
case EbtFloatE2M1: mangledName += "fe2m1"; break;
|
||||
case EbtFloatE3M2: mangledName += "fe3m2"; break;
|
||||
case EbtFloatE2M3: mangledName += "fe2m3"; break;
|
||||
case EbtFloatUE8M0: mangledName += "fue8m0"; break;
|
||||
case EbtFloatMXINT8: mangledName += "fmxint8";break;
|
||||
case EbtInt8: mangledName += "i8"; break;
|
||||
case EbtUint8: mangledName += "u8"; break;
|
||||
case EbtInt16: mangledName += "i16"; break;
|
||||
@@ -448,6 +453,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
|
||||
illegalImplicitThis = copyOf.illegalImplicitThis;
|
||||
defaultParamCount = copyOf.defaultParamCount;
|
||||
spirvInst = copyOf.spirvInst;
|
||||
functionControl = copyOf.functionControl;
|
||||
}
|
||||
|
||||
TFunction* TFunction::clone() const
|
||||
|
||||
+11
-2
@@ -255,13 +255,14 @@ public:
|
||||
explicit TFunction(TOperator o) :
|
||||
TSymbol(nullptr),
|
||||
op(o),
|
||||
defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0) { }
|
||||
defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0),
|
||||
functionControl(EfcNone) { }
|
||||
TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) :
|
||||
TSymbol(name),
|
||||
mangledName(*name + '('),
|
||||
op(tOp),
|
||||
defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0),
|
||||
linkType(ELinkNone)
|
||||
functionControl(EfcNone), linkType(ELinkNone)
|
||||
{
|
||||
returnType.shallowCopy(retType);
|
||||
declaredBuiltIn = retType.getQualifier().builtIn;
|
||||
@@ -351,6 +352,13 @@ public:
|
||||
|
||||
void setExport() { linkType = ELinkExport; }
|
||||
TLinkType getLinkType() const { return linkType; }
|
||||
void addFunctionControl(unsigned int fc) { functionControl |= fc; }
|
||||
void setFunctionControl(unsigned int fc) { functionControl = fc; }
|
||||
unsigned int getFunctionControl() const { return functionControl; }
|
||||
bool hasIncompatibleFunctionControl() const
|
||||
{
|
||||
return (functionControl & EfcInline) != 0 && (functionControl & EfcDontInline) != 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
explicit TFunction(const TFunction&);
|
||||
@@ -374,6 +382,7 @@ protected:
|
||||
int defaultParamCount;
|
||||
|
||||
TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers
|
||||
unsigned int functionControl;
|
||||
TLinkType linkType;
|
||||
};
|
||||
|
||||
|
||||
+115
-28
@@ -4,6 +4,7 @@
|
||||
// Copyright (C) 2017, 2022-2024 Arm Limited.
|
||||
// Copyright (C) 2015-2020 Google, Inc.
|
||||
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
|
||||
// Modifications Copyright (C) 2026 Valve Corporation.
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@@ -149,6 +150,8 @@
|
||||
#include "parseVersions.h"
|
||||
#include "localintermediate.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace glslang {
|
||||
|
||||
//
|
||||
@@ -167,7 +170,8 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
{E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4},
|
||||
{E_GL_EXT_mesh_shader, EShTargetSpv_1_4},
|
||||
{E_GL_NV_cooperative_matrix2, EShTargetSpv_1_6},
|
||||
{E_GL_NV_cooperative_matrix_decode_vector, EShTargetSpv_1_6}
|
||||
{E_GL_NV_cooperative_matrix_decode_vector, EShTargetSpv_1_6},
|
||||
{E_GL_EXT_cooperative_matrix_maintenance1, EShTargetSpv_1_3},
|
||||
};
|
||||
|
||||
for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) {
|
||||
@@ -269,8 +273,10 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_expect_assume] = EBhDisable;
|
||||
|
||||
extensionBehavior[E_GL_EXT_control_flow_attributes2] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_function_control_attributes] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_spec_constant_composites] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_abort] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_split_barrier] = EBhDisable;
|
||||
|
||||
extensionBehavior[E_GL_KHR_cooperative_matrix] = EBhDisable;
|
||||
extensionBehavior[E_GL_NV_cooperative_vector] = EBhDisable;
|
||||
@@ -335,8 +341,10 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
// QCOM
|
||||
extensionBehavior[E_GL_QCOM_image_processing] = EBhDisable;
|
||||
extensionBehavior[E_GL_QCOM_image_processing2] = EBhDisable;
|
||||
extensionBehavior[E_GL_QCOM_image_processing3] = EBhDisable;
|
||||
extensionBehavior[E_GL_QCOM_tile_shading] = EBhDisable;
|
||||
extensionBehavior[E_GL_QCOM_cooperative_matrix_conversion] = EBhDisable;
|
||||
extensionBehavior[E_GL_QCOM_multiple_wait_queues] = EBhDisable;
|
||||
|
||||
// AEP
|
||||
extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable;
|
||||
@@ -356,6 +364,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_null_initializer] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_descriptor_heap] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_structured_descriptor_heap] = EBhDisable;
|
||||
|
||||
// OES matching AEP
|
||||
extensionBehavior[E_GL_OES_geometry_shader] = EBhDisable;
|
||||
@@ -386,6 +395,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_spirv_intrinsics] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_mesh_shader] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_opacity_micromap_ray_query_mode] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_quad_control] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_ray_tracing_position_fetch] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_tile_image] = EBhDisable;
|
||||
@@ -401,6 +411,13 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_shader_64bit_indexing] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_conservative_depth] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_long_vector] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_e2m1] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_e3m2] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_e2m3] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_ue8m0] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_mxint8] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_optional_input_attachment_index] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_cooperative_matrix_maintenance1] = EBhDisable;
|
||||
|
||||
// OVR extensions
|
||||
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
||||
@@ -470,6 +487,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_shader_integer_mix 1\n"
|
||||
"#define GL_EXT_blend_func_extended 1\n"
|
||||
"#define GL_EXT_descriptor_heap 1\n"
|
||||
"#define GL_EXT_structured_descriptor_heap 1\n"
|
||||
"#define GL_EXT_split_barrier 1\n"
|
||||
|
||||
// OES matching AEP
|
||||
"#define GL_OES_geometry_shader 1\n"
|
||||
@@ -485,8 +504,10 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
|
||||
"#define GL_QCOM_image_processing 1\n"
|
||||
"#define GL_QCOM_image_processing2 1\n"
|
||||
"#define GL_QCOM_image_processing3 1\n"
|
||||
"#define GL_QCOM_tile_shading 1\n"
|
||||
"#define GL_QCOM_cooperative_matrix_conversion 1\n"
|
||||
"#define GL_QCOM_multiple_wait_queues 1\n"
|
||||
;
|
||||
|
||||
if (version >= 300) {
|
||||
@@ -562,6 +583,8 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_shader_integer_mix 1\n"
|
||||
"#define GL_EXT_spec_constant_composites 1\n"
|
||||
"#define GL_EXT_abort 1\n"
|
||||
"#define GL_EXT_split_barrier 1\n"
|
||||
"#define GL_EXT_cooperative_matrix_maintenance1 1\n"
|
||||
|
||||
// GL_KHR_shader_subgroup
|
||||
"#define GL_KHR_shader_subgroup_basic 1\n"
|
||||
@@ -623,8 +646,10 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
|
||||
"#define GL_QCOM_image_processing 1\n"
|
||||
"#define GL_QCOM_image_processing2 1\n"
|
||||
"#define GL_QCOM_image_processing3 1\n"
|
||||
"#define GL_QCOM_tile_shading 1\n"
|
||||
"#define GL_QCOM_cooperative_matrix_conversion 1\n"
|
||||
"#define GL_QCOM_multiple_wait_queues 1\n"
|
||||
|
||||
"#define GL_EXT_shader_explicit_arithmetic_types 1\n"
|
||||
"#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n"
|
||||
@@ -648,6 +673,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_texture_array 1\n"
|
||||
|
||||
"#define GL_EXT_control_flow_attributes2 1\n"
|
||||
"#define GL_EXT_function_control_attributes 1\n"
|
||||
|
||||
"#define GL_EXT_integer_dot_product 1\n"
|
||||
"#define GL_EXT_bfloat16 1\n"
|
||||
@@ -655,9 +681,15 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_float_e4m3 1\n"
|
||||
"#define GL_EXT_uniform_buffer_unsized_array 1\n"
|
||||
"#define GL_EXT_shader_64bit_indexing 1\n"
|
||||
"#define GL_EXT_float_e2m1 1\n"
|
||||
"#define GL_EXT_float_e3m2 1\n"
|
||||
"#define GL_EXT_float_e2m3 1\n"
|
||||
"#define GL_EXT_float_ue8m0 1\n"
|
||||
"#define GL_EXT_float_mxint8 1\n"
|
||||
|
||||
"#define GL_EXT_shader_invocation_reorder 1\n"
|
||||
"#define GL_EXT_descriptor_heap 1\n"
|
||||
"#define GL_EXT_structured_descriptor_heap 1\n"
|
||||
;
|
||||
|
||||
if (spvVersion.spv == 0) {
|
||||
@@ -716,6 +748,11 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
;
|
||||
}
|
||||
|
||||
if ((!isEsProfile() && version >= 140) ||
|
||||
(isEsProfile() && version >= 300)) {
|
||||
preamble += "#define GL_EXT_optional_input_attachment_index 1\n";
|
||||
}
|
||||
|
||||
// #line and #include
|
||||
preamble +=
|
||||
"#define GL_GOOGLE_cpp_style_line_directive 1\n"
|
||||
@@ -1256,7 +1293,7 @@ void TParseVersions::float16Check(const TSourceLoc& loc, const char* op, bool bu
|
||||
E_GL_AMD_gpu_shader_half_float,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1267,7 +1304,7 @@ bool TParseVersions::float16Arithmetic()
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||
return extensionsTurnedOn(std::size(extensions), extensions);
|
||||
}
|
||||
|
||||
bool TParseVersions::int16Arithmetic()
|
||||
@@ -1277,7 +1314,7 @@ bool TParseVersions::int16Arithmetic()
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||
return extensionsTurnedOn(std::size(extensions), extensions);
|
||||
}
|
||||
|
||||
bool TParseVersions::int8Arithmetic()
|
||||
@@ -1286,7 +1323,7 @@ bool TParseVersions::int8Arithmetic()
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int8};
|
||||
return extensionsTurnedOn(sizeof(extensions)/sizeof(extensions[0]), extensions);
|
||||
return extensionsTurnedOn(std::size(extensions), extensions);
|
||||
}
|
||||
|
||||
void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc)
|
||||
@@ -1301,7 +1338,7 @@ void TParseVersions::requireFloat16Arithmetic(const TSourceLoc& loc, const char*
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||
requireExtensions(loc, std::size(extensions), extensions, combined.c_str());
|
||||
}
|
||||
|
||||
void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc)
|
||||
@@ -1316,7 +1353,7 @@ void TParseVersions::requireInt16Arithmetic(const TSourceLoc& loc, const char* o
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||
requireExtensions(loc, std::size(extensions), extensions, combined.c_str());
|
||||
}
|
||||
|
||||
void TParseVersions::requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc)
|
||||
@@ -1330,7 +1367,7 @@ void TParseVersions::requireInt8Arithmetic(const TSourceLoc& loc, const char* op
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int8};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, combined.c_str());
|
||||
requireExtensions(loc, std::size(extensions), extensions, combined.c_str());
|
||||
}
|
||||
|
||||
void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
@@ -1342,7 +1379,7 @@ void TParseVersions::float16ScalarVectorCheck(const TSourceLoc& loc, const char*
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1352,7 +1389,7 @@ void TParseVersions::bfloat16ScalarVectorCheck(const TSourceLoc& loc, const char
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_bfloat16,
|
||||
};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1362,7 +1399,7 @@ void TParseVersions::floate5m2ScalarVectorCheck(const TSourceLoc& loc, const cha
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_e5m2,
|
||||
};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1372,7 +1409,57 @@ void TParseVersions::floate4m3ScalarVectorCheck(const TSourceLoc& loc, const cha
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_e4m3,
|
||||
};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::floate2m1ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_e2m1,
|
||||
};
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::floate3m2ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_e3m2,
|
||||
};
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::floate2m3ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_e2m3,
|
||||
};
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::floatue8m0ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_ue8m0,
|
||||
};
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
void TParseVersions::floatmxint8ScalarVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn)
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {
|
||||
E_GL_EXT_float_mxint8,
|
||||
};
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1383,7 +1470,7 @@ void TParseVersions::explicitFloat32Check(const TSourceLoc& loc, const char* op,
|
||||
const char* const extensions[] = {E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float32};
|
||||
requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1394,7 +1481,7 @@ void TParseVersions::explicitFloat64Check(const TSourceLoc& loc, const char* op,
|
||||
const char* const extensions[] = {E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_float64};
|
||||
requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
if(extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) && extensionTurnedOn(E_GL_NV_gpu_shader5))
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 150, nullptr, op);
|
||||
@@ -1431,7 +1518,7 @@ void TParseVersions::explicitInt16Check(const TSourceLoc& loc, const char* op, b
|
||||
E_GL_AMD_gpu_shader_int16,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1444,7 +1531,7 @@ void TParseVersions::int16ScalarVectorCheck(const TSourceLoc& loc, const char* o
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int16};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1456,7 +1543,7 @@ void TParseVersions::int8ScalarVectorCheck(const TSourceLoc& loc, const char* op
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int8};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1467,7 +1554,7 @@ void TParseVersions::explicitInt32Check(const TSourceLoc& loc, const char* op, b
|
||||
const char* const extensions[] = {E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int32};
|
||||
requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1479,7 +1566,7 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil
|
||||
E_GL_EXT_shader_explicit_arithmetic_types,
|
||||
E_GL_NV_gpu_shader5,
|
||||
E_GL_EXT_shader_explicit_arithmetic_types_int64};
|
||||
requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, op);
|
||||
if (extensionTurnedOn(E_GL_NV_gpu_shader5))
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 150, nullptr, op);
|
||||
@@ -1492,7 +1579,7 @@ void TParseVersions::fcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_NV_cooperative_matrix};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1500,7 +1587,7 @@ void TParseVersions::intcoopmatCheckNV(const TSourceLoc& loc, const char* op, bo
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1508,7 +1595,7 @@ void TParseVersions::coopmatCheck(const TSourceLoc& loc, const char* op, bool bu
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_KHR_cooperative_matrix};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1516,7 +1603,7 @@ void TParseVersions::coopmatConverisonCheckQCOM(const TSourceLoc& loc, const cha
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_KHR_cooperative_matrix};
|
||||
requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1524,7 +1611,7 @@ void TParseVersions::tensorLayoutViewCheck(const TSourceLoc& loc, const char* op
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_NV_cooperative_matrix2};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1532,7 +1619,7 @@ void TParseVersions::coopvecCheck(const TSourceLoc& loc, const char* op, bool bu
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_NV_cooperative_vector};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1540,7 +1627,7 @@ void TParseVersions::intattachmentCheck(const TSourceLoc& loc, const char* op, b
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_QCOM_tile_shading};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1548,7 +1635,7 @@ void TParseVersions::tensorCheckARM(const TSourceLoc& loc, const char* op, bool
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_ARM_tensors};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1556,7 +1643,7 @@ void TParseVersions::longVectorCheck(const TSourceLoc& loc, const char* op, bool
|
||||
{
|
||||
if (!builtIn) {
|
||||
const char* const extensions[] = {E_GL_EXT_long_vector};
|
||||
requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
|
||||
requireExtensions(loc, std::size(extensions), extensions, op);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-1
@@ -4,7 +4,7 @@
|
||||
// Copyright (C) 2017, 2022-2024 Arm Limited.
|
||||
// Copyright (C) 2015-2018 Google, Inc.
|
||||
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
|
||||
// Modifications Copyright (C) 2024 Valve Corporation.
|
||||
// Modifications Copyright (C) 2024, 2026 Valve Corporation.
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
@@ -219,12 +219,14 @@ const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intr
|
||||
const char* const E_GL_EXT_fragment_shader_barycentric = "GL_EXT_fragment_shader_barycentric";
|
||||
const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shader";
|
||||
const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap";
|
||||
const char* const E_GL_EXT_opacity_micromap_ray_query_mode = "GL_EXT_opacity_micromap_ray_query_mode";
|
||||
const char* const E_GL_EXT_shader_quad_control = "GL_EXT_shader_quad_control";
|
||||
const char* const E_GL_EXT_draw_instanced = "GL_EXT_draw_instanced";
|
||||
const char* const E_GL_EXT_texture_array = "GL_EXT_texture_array";
|
||||
const char* const E_GL_EXT_maximal_reconvergence = "GL_EXT_maximal_reconvergence";
|
||||
const char* const E_GL_EXT_expect_assume = "GL_EXT_expect_assume";
|
||||
const char* const E_GL_EXT_control_flow_attributes2 = "GL_EXT_control_flow_attributes2";
|
||||
const char* const E_GL_EXT_function_control_attributes = "GL_EXT_function_control_attributes";
|
||||
const char* const E_GL_EXT_spec_constant_composites = "GL_EXT_spec_constant_composites";
|
||||
const char* const E_GL_EXT_texture_offset_non_const = "GL_EXT_texture_offset_non_const";
|
||||
const char* const E_GL_EXT_nontemporal_keyword = "GL_EXT_nontemporal_keyword";
|
||||
@@ -232,6 +234,8 @@ const char* const E_GL_EXT_uniform_buffer_unsized_array = "GL_EXT_uniform_bu
|
||||
const char* const E_GL_EXT_conservative_depth = "GL_EXT_conservative_depth";
|
||||
const char* const E_GL_EXT_descriptor_heap = "GL_EXT_descriptor_heap";
|
||||
const char* const E_GL_EXT_structured_descriptor_heap = "GL_EXT_structured_descriptor_heap";
|
||||
const char* const E_GL_EXT_split_barrier = "GL_EXT_split_barrier";
|
||||
const char* const E_GL_EXT_optional_input_attachment_index = "GL_EXT_optional_input_attachment_index";
|
||||
|
||||
// Arrays of extensions for the above viewportEXTs duplications
|
||||
|
||||
@@ -317,8 +321,10 @@ const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]);
|
||||
|
||||
const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing";
|
||||
const char* const E_GL_QCOM_image_processing2 = "GL_QCOM_image_processing2";
|
||||
const char* const E_GL_QCOM_image_processing3 = "GL_QCOM_image_processing3";
|
||||
const char* const E_GL_QCOM_tile_shading = "GL_QCOM_tile_shading";
|
||||
const char* const E_GL_QCOM_cooperative_matrix_conversion = "GL_QCOM_cooperative_matrix_conversion";
|
||||
const char* const E_GL_QCOM_multiple_wait_queues = "GL_QCOM_multiple_wait_queues";
|
||||
|
||||
// AEP
|
||||
const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a";
|
||||
@@ -377,12 +383,19 @@ const char* const E_GL_EXT_integer_dot_product = "GL_EXT_inte
|
||||
const char* const E_GL_EXT_bfloat16 = "GL_EXT_bfloat16";
|
||||
const char* const E_GL_EXT_float_e5m2 = "GL_EXT_float_e5m2";
|
||||
const char* const E_GL_EXT_float_e4m3 = "GL_EXT_float_e4m3";
|
||||
const char* const E_GL_EXT_float_e2m1 = "GL_EXT_float_e2m1";
|
||||
const char* const E_GL_EXT_float_e3m2 = "GL_EXT_float_e3m2";
|
||||
const char* const E_GL_EXT_float_e2m3 = "GL_EXT_float_e2m3";
|
||||
const char* const E_GL_EXT_float_ue8m0 = "GL_EXT_float_ue8m0";
|
||||
const char* const E_GL_EXT_float_mxint8 = "GL_EXT_float_mxint8";
|
||||
const char* const E_GL_EXT_long_vector = "GL_EXT_long_vector";
|
||||
|
||||
const char* const E_GL_EXT_shader_64bit_indexing = "GL_EXT_shader_64bit_indexing";
|
||||
|
||||
const char* const E_GL_EXT_shader_invocation_reorder = "GL_EXT_shader_invocation_reorder";
|
||||
|
||||
const char* const E_GL_EXT_cooperative_matrix_maintenance1 = "GL_EXT_cooperative_matrix_maintenance1";
|
||||
|
||||
// Arrays of extensions for the above AEP duplications
|
||||
|
||||
const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader };
|
||||
|
||||
+26
-1
@@ -127,6 +127,12 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const
|
||||
return EatExport;
|
||||
else if (name == "maximally_reconverges")
|
||||
return EatMaximallyReconverges;
|
||||
else if (name == "inline")
|
||||
return EatInline;
|
||||
else if (name == "noinline")
|
||||
return EatNoInline;
|
||||
else if (name == "multiple_wait_queuesQCOM")
|
||||
return EatMultipleWaitQueuesQCOM;
|
||||
else
|
||||
return EatNone;
|
||||
}
|
||||
@@ -338,6 +344,14 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN
|
||||
if (unsignedArgument("partial_count", uiValue))
|
||||
loop->setPartialCount(uiValue);
|
||||
break;
|
||||
case EatMultipleWaitQueuesQCOM:
|
||||
value = -1;
|
||||
if (it->size() == 0)
|
||||
loop->setMultipleWaitQueuesQCOM(0);
|
||||
else
|
||||
if (positiveSignedArgument("multiple_wait_queuesQCOM", value))
|
||||
loop->setMultipleWaitQueuesQCOM(value);
|
||||
break;
|
||||
default:
|
||||
warn(node->getLoc(), "attribute does not apply to a loop", "", "");
|
||||
break;
|
||||
@@ -349,7 +363,7 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN
|
||||
//
|
||||
// Function attributes
|
||||
//
|
||||
void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttributes& attributes)
|
||||
void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, TFunction& function, const TAttributes& attributes)
|
||||
{
|
||||
for (auto it = attributes.begin(); it != attributes.end(); ++it) {
|
||||
if (it->size() > 0) {
|
||||
@@ -366,11 +380,22 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri
|
||||
requireExtensions(loc, 1, &E_GL_EXT_maximal_reconvergence, "attribute");
|
||||
intermediate.setMaximallyReconverges();
|
||||
break;
|
||||
case EatInline:
|
||||
requireExtensions(loc, 1, &E_GL_EXT_function_control_attributes, "attribute");
|
||||
function.addFunctionControl(EfcInline);
|
||||
break;
|
||||
case EatNoInline:
|
||||
requireExtensions(loc, 1, &E_GL_EXT_function_control_attributes, "attribute");
|
||||
function.addFunctionControl(EfcDontInline);
|
||||
break;
|
||||
default:
|
||||
warn(loc, "attribute does not apply to a function", "", "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (function.hasIncompatibleFunctionControl())
|
||||
error(loc, "function attributes are incompatible", function.getName().c_str(), "");
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
@@ -122,6 +122,9 @@ namespace glslang {
|
||||
EatSubgroupUniformControlFlow,
|
||||
EatExport,
|
||||
EatMaximallyReconverges,
|
||||
EatInline,
|
||||
EatNoInline,
|
||||
EatMultipleWaitQueuesQCOM,
|
||||
};
|
||||
|
||||
class TIntermAggregate;
|
||||
|
||||
+186
-45
@@ -119,7 +119,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
|
||||
%parse-param {glslang::TParseContext* pParseContext}
|
||||
%lex-param {parseContext}
|
||||
%pure-parser // enable thread safety
|
||||
%define api.pure // enable thread safety
|
||||
%expect 1 // One shift reduce conflict because of if | else
|
||||
|
||||
%token <lex> CONST BOOL INT UINT FLOAT
|
||||
@@ -146,7 +146,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
|
||||
|
||||
%token <lex> ATTRIBUTE VARYING
|
||||
%token <lex> FLOATE5M2_T FLOATE4M3_T BFLOAT16_T FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
|
||||
%token <lex> FLOATE5M2_T FLOATE4M3_T BFLOAT16_T FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T FLOATE2M1_T FLOATE3M2_T FLOATE2M3_T FLOATUE8M0_T FLOATMXINT8_T
|
||||
%token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
|
||||
%token <lex> I64VEC2 I64VEC3 I64VEC4
|
||||
%token <lex> U64VEC2 U64VEC3 U64VEC4
|
||||
@@ -160,6 +160,11 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> BF16VEC2 BF16VEC3 BF16VEC4
|
||||
%token <lex> FE5M2VEC2 FE5M2VEC3 FE5M2VEC4
|
||||
%token <lex> FE4M3VEC2 FE4M3VEC3 FE4M3VEC4
|
||||
%token <lex> FE2M1VEC2 FE2M1VEC3 FE2M1VEC4
|
||||
%token <lex> FE3M2VEC2 FE3M2VEC3 FE3M2VEC4
|
||||
%token <lex> FE2M3VEC2 FE2M3VEC3 FE2M3VEC4
|
||||
%token <lex> FUE8M0VEC2 FUE8M0VEC3 FUE8M0VEC4
|
||||
%token <lex> FMXINT8VEC2 FMXINT8VEC3 FMXINT8VEC4
|
||||
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
|
||||
%token <lex> F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4
|
||||
%token <lex> F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4
|
||||
@@ -269,6 +274,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> INVARIANT
|
||||
%token <lex> HIGH_PRECISION MEDIUM_PRECISION LOW_PRECISION PRECISION
|
||||
%token <lex> PACKED RESOURCE SUPERP
|
||||
%token <lex> INLINE NOINLINE
|
||||
|
||||
%token <lex> FLOATCONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
|
||||
%token <lex> IDENTIFIER TYPE_NAME
|
||||
@@ -280,7 +286,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
|
||||
%token <lex> FLAT SMOOTH LAYOUT
|
||||
|
||||
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
|
||||
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT FLOATE2M1CONSTANT FLOATE3M2CONSTANT FLOATE2M3CONSTANT FLOATUE8M0CONSTANT FLOATMXINT8CONSTANT
|
||||
%token <lex> INT64CONSTANT UINT64CONSTANT
|
||||
%token <lex> SUBROUTINE DEMOTE FUNCTION
|
||||
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
|
||||
@@ -330,7 +336,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%type <interm.type> block_heap_inner_structure
|
||||
%type <interm.typeLine> struct_declarator
|
||||
%type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list
|
||||
%type <interm.typeList> struct_declaration_with_heap struct_declaration_without_heap
|
||||
%type <interm.typeList> struct_declaration_no_inline_block struct_declaration_no_inline_block_list
|
||||
%type <interm> block_structure
|
||||
%type <interm.function> function_header function_declarator
|
||||
%type <interm.function> function_header_with_parameters
|
||||
@@ -426,6 +432,26 @@ primary_expression
|
||||
parseContext.float16Check($1.loc, "half float literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
|
||||
}
|
||||
| FLOATE2M1CONSTANT {
|
||||
parseContext.floate2m1ScalarVectorCheck($1.loc, "fe2m1 literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloatE2M1, $1.loc, true);
|
||||
}
|
||||
| FLOATE3M2CONSTANT {
|
||||
parseContext.floate3m2ScalarVectorCheck($1.loc, "fe3m2 literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloatE3M2, $1.loc, true);
|
||||
}
|
||||
| FLOATE2M3CONSTANT {
|
||||
parseContext.floate2m3ScalarVectorCheck($1.loc, "fe2m3 literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloatE2M3, $1.loc, true);
|
||||
}
|
||||
| FLOATUE8M0CONSTANT {
|
||||
parseContext.floatue8m0ScalarVectorCheck($1.loc, "fue8m0 literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloatUE8M0, $1.loc, true);
|
||||
}
|
||||
| FLOATMXINT8CONSTANT {
|
||||
parseContext.floatmxint8ScalarVectorCheck($1.loc, "fmxint8 literal");
|
||||
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloatMXINT8, $1.loc, true);
|
||||
}
|
||||
;
|
||||
|
||||
postfix_expression
|
||||
@@ -940,7 +966,7 @@ declaration
|
||||
;
|
||||
|
||||
block_structure
|
||||
: type_qualifier IDENTIFIER LEFT_BRACE { parseContext.nestedBlockCheck($1.loc); } struct_declaration_without_heap RIGHT_BRACE {
|
||||
: type_qualifier IDENTIFIER LEFT_BRACE { parseContext.nestedBlockCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
|
||||
--parseContext.blockNestingLevel;
|
||||
parseContext.blockName = $2.string;
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
|
||||
@@ -972,26 +998,26 @@ function_prototype
|
||||
$$.function = $1;
|
||||
if (parseContext.compileOnly) $$.function->setExport();
|
||||
$$.loc = $2.loc;
|
||||
const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence };
|
||||
parseContext.requireExtensions($2.loc, 2, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($2.loc, *$3);
|
||||
const char * extensions[3] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence, E_GL_EXT_function_control_attributes };
|
||||
parseContext.requireExtensions($2.loc, 3, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($2.loc, *$$.function, *$3);
|
||||
}
|
||||
| attribute function_declarator RIGHT_PAREN {
|
||||
$$.function = $2;
|
||||
if (parseContext.compileOnly) $$.function->setExport();
|
||||
$$.loc = $3.loc;
|
||||
const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence };
|
||||
parseContext.requireExtensions($3.loc, 2, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($3.loc, *$1);
|
||||
const char * extensions[3] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence, E_GL_EXT_function_control_attributes };
|
||||
parseContext.requireExtensions($3.loc, 3, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($3.loc, *$$.function, *$1);
|
||||
}
|
||||
| attribute function_declarator RIGHT_PAREN attribute {
|
||||
$$.function = $2;
|
||||
if (parseContext.compileOnly) $$.function->setExport();
|
||||
$$.loc = $3.loc;
|
||||
const char * extensions[2] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence };
|
||||
parseContext.requireExtensions($3.loc, 2, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($3.loc, *$1);
|
||||
parseContext.handleFunctionAttributes($3.loc, *$4);
|
||||
const char * extensions[3] = { E_GL_EXT_subgroup_uniform_control_flow, E_GL_EXT_maximal_reconvergence, E_GL_EXT_function_control_attributes };
|
||||
parseContext.requireExtensions($3.loc, 3, extensions, "attribute");
|
||||
parseContext.handleFunctionAttributes($3.loc, *$$.function, *$1);
|
||||
parseContext.handleFunctionAttributes($3.loc, *$$.function, *$4);
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1367,7 +1393,7 @@ layout_qualifier_id
|
||||
$$.init($1.loc);
|
||||
parseContext.setLayoutQualifier($1.loc, $$, *$1.string);
|
||||
}
|
||||
| IDENTIFIER EQUAL constant_expression {
|
||||
| IDENTIFIER EQUAL assignment_expression {
|
||||
$$.init($1.loc);
|
||||
parseContext.setLayoutQualifier($1.loc, $$, *$1.string, $3);
|
||||
}
|
||||
@@ -1985,6 +2011,31 @@ type_specifier_nonarray
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE4M3;
|
||||
}
|
||||
| FLOATE2M1_T {
|
||||
parseContext.floate2m1ScalarVectorCheck($1.loc, "floate2m1_t", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M1;
|
||||
}
|
||||
| FLOATE3M2_T {
|
||||
parseContext.floate3m2ScalarVectorCheck($1.loc, "floate3m2_t", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE3M2;
|
||||
}
|
||||
| FLOATE2M3_T {
|
||||
parseContext.floate2m3ScalarVectorCheck($1.loc, "floate2m3_t", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M3;
|
||||
}
|
||||
| FLOATUE8M0_T {
|
||||
parseContext.floatue8m0ScalarVectorCheck($1.loc, "floatue8m0_t", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatUE8M0;
|
||||
}
|
||||
| FLOATMXINT8_T {
|
||||
parseContext.floatmxint8ScalarVectorCheck($1.loc, "floatmxint8_t", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatMXINT8;
|
||||
}
|
||||
| FLOAT16_T {
|
||||
parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
@@ -2118,6 +2169,96 @@ type_specifier_nonarray
|
||||
$$.basicType = EbtFloatE4M3;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| FE2M1VEC2 {
|
||||
parseContext.floate2m1ScalarVectorCheck($1.loc, "fe2m1 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M1;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| FE2M1VEC3 {
|
||||
parseContext.floate2m1ScalarVectorCheck($1.loc, "fe2m1 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M1;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| FE2M1VEC4 {
|
||||
parseContext.floate2m1ScalarVectorCheck($1.loc, "fe2m1 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M1;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| FE3M2VEC2 {
|
||||
parseContext.floate3m2ScalarVectorCheck($1.loc, "fe3m2 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE3M2;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| FE3M2VEC3 {
|
||||
parseContext.floate3m2ScalarVectorCheck($1.loc, "fe3m2 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE3M2;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| FE3M2VEC4 {
|
||||
parseContext.floate3m2ScalarVectorCheck($1.loc, "fe3m2 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE3M2;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| FE2M3VEC2 {
|
||||
parseContext.floate2m3ScalarVectorCheck($1.loc, "fe2m3 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M3;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| FE2M3VEC3 {
|
||||
parseContext.floate2m3ScalarVectorCheck($1.loc, "fe2m3 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M3;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| FE2M3VEC4 {
|
||||
parseContext.floate2m3ScalarVectorCheck($1.loc, "fe2m3 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatE2M3;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| FUE8M0VEC2 {
|
||||
parseContext.floatue8m0ScalarVectorCheck($1.loc, "fue8m0 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatUE8M0;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| FUE8M0VEC3 {
|
||||
parseContext.floatue8m0ScalarVectorCheck($1.loc, "fue8m0 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatUE8M0;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| FUE8M0VEC4 {
|
||||
parseContext.floatue8m0ScalarVectorCheck($1.loc, "fue8m0 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatUE8M0;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| FMXINT8VEC2 {
|
||||
parseContext.floatmxint8ScalarVectorCheck($1.loc, "fmxint8 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatMXINT8;
|
||||
$$.setVector(2);
|
||||
}
|
||||
| FMXINT8VEC3 {
|
||||
parseContext.floatmxint8ScalarVectorCheck($1.loc, "fmxint8 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatMXINT8;
|
||||
$$.setVector(3);
|
||||
}
|
||||
| FMXINT8VEC4 {
|
||||
parseContext.floatmxint8ScalarVectorCheck($1.loc, "fmxint8 vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtFloatMXINT8;
|
||||
$$.setVector(4);
|
||||
}
|
||||
| F16VEC2 {
|
||||
parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
@@ -3702,6 +3843,8 @@ type_specifier_nonarray
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtStruct;
|
||||
$$.userDef = &structure;
|
||||
if (structure.getQualifier().isBufferType())
|
||||
$$.qualifier = structure.getQualifier();
|
||||
} else
|
||||
parseContext.error($1.loc, "expected type name", $1.string->c_str(), "");
|
||||
}
|
||||
@@ -3752,23 +3895,10 @@ struct_specifier
|
||||
;
|
||||
|
||||
struct_declaration_list
|
||||
: struct_declaration_without_heap {
|
||||
: struct_declaration {
|
||||
$$ = $1;
|
||||
}
|
||||
| struct_declaration_with_heap {
|
||||
$$ = $1;
|
||||
}
|
||||
| struct_declaration_with_heap struct_declaration_without_heap {
|
||||
$$ = $1;
|
||||
for (unsigned int i = 0; i < $2->size(); ++i) {
|
||||
for (unsigned int j = 0; j < $$->size(); ++j) {
|
||||
if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName())
|
||||
parseContext.error((*$2)[i].loc, "duplicate member name:", "", (*$2)[i].type->getFieldName().c_str());
|
||||
}
|
||||
$$->push_back((*$2)[i]);
|
||||
}
|
||||
}
|
||||
| struct_declaration_without_heap struct_declaration_with_heap {
|
||||
| struct_declaration_list struct_declaration {
|
||||
$$ = $1;
|
||||
for (unsigned int i = 0; i < $2->size(); ++i) {
|
||||
for (unsigned int j = 0; j < $$->size(); ++j) {
|
||||
@@ -3780,8 +3910,11 @@ struct_declaration_list
|
||||
}
|
||||
;
|
||||
|
||||
struct_declaration_with_heap
|
||||
: block_heap_inner_structure struct_declarator_list SEMICOLON {
|
||||
struct_declaration
|
||||
: struct_declaration_no_inline_block {
|
||||
$$ = $1;
|
||||
}
|
||||
| block_heap_inner_structure struct_declarator_list SEMICOLON {
|
||||
$$ = $2;
|
||||
parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
|
||||
parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.hasTypeParameter());
|
||||
@@ -3798,25 +3931,26 @@ struct_declaration_with_heap
|
||||
;
|
||||
|
||||
block_heap_inner_structure
|
||||
: type_qualifier LEFT_BRACE { parseContext.nestedBlockCheck($1.loc, true); } struct_declaration_without_heap RIGHT_BRACE {
|
||||
: type_qualifier LEFT_BRACE { parseContext.nestedBlockCheck($1.loc, true); } struct_declaration_no_inline_block_list RIGHT_BRACE {
|
||||
--parseContext.blockNestingLevel;
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
|
||||
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
|
||||
$$.init($1.loc);
|
||||
TType* innerStructure = new TType($4, TString(""));
|
||||
$$.basicType = EbtBlock;
|
||||
$$.userDef = innerStructure;
|
||||
$$.qualifier = $1.qualifier;
|
||||
TType* innerStructure = new TType($4, TString(""), $1.qualifier);
|
||||
if (! $1.qualifier.hasBufferReference())
|
||||
parseContext.error($1.loc, "only buffer_reference blocks can be declared inline inside a heap block", "", "");
|
||||
TType* referenceType = new TType(EbtReference, *innerStructure, TString(""));
|
||||
$$.basicType = EbtReference;
|
||||
$$.userDef = referenceType;
|
||||
$$.qualifier.layoutDescriptorHeap = true;
|
||||
$$.qualifier.layoutDescriptorInnerBlock = true;
|
||||
}
|
||||
;
|
||||
|
||||
struct_declaration_without_heap
|
||||
: struct_declaration {
|
||||
struct_declaration_no_inline_block_list
|
||||
: struct_declaration_no_inline_block {
|
||||
$$ = $1;
|
||||
}
|
||||
| struct_declaration_without_heap struct_declaration {
|
||||
| struct_declaration_no_inline_block_list struct_declaration_no_inline_block {
|
||||
$$ = $1;
|
||||
for (unsigned int i = 0; i < $2->size(); ++i) {
|
||||
for (unsigned int j = 0; j < $$->size(); ++j) {
|
||||
@@ -3828,7 +3962,7 @@ struct_declaration_without_heap
|
||||
}
|
||||
;
|
||||
|
||||
struct_declaration
|
||||
struct_declaration_no_inline_block
|
||||
: type_specifier struct_declarator_list SEMICOLON {
|
||||
if ($1.arraySizes) {
|
||||
parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
|
||||
@@ -4158,8 +4292,8 @@ iteration_statement
|
||||
$$ = $1;
|
||||
}
|
||||
| attribute iteration_statement_nonattributed {
|
||||
const char * extensions[2] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2 };
|
||||
parseContext.requireExtensions($2->getLoc(), 2, extensions, "attribute");
|
||||
const char * extensions[3] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2, E_GL_QCOM_multiple_wait_queues };
|
||||
parseContext.requireExtensions($2->getLoc(), 3, extensions, "attribute");
|
||||
parseContext.handleLoopAttributes(*$1, $2);
|
||||
$$ = $2;
|
||||
}
|
||||
@@ -4343,6 +4477,7 @@ function_definition
|
||||
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
|
||||
$$ = parseContext.intermediate.growAggregate($1.intermNode, $3);
|
||||
$$->getAsAggregate()->setLinkType($1.function->getLinkType());
|
||||
$$->getAsAggregate()->setFunctionControl($1.function->getFunctionControl());
|
||||
parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc);
|
||||
$$->getAsAggregate()->setName($1.function->getMangledName().c_str());
|
||||
|
||||
@@ -4385,6 +4520,12 @@ single_attribute
|
||||
| IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN {
|
||||
$$ = parseContext.makeAttributes(*$1.string, $3);
|
||||
}
|
||||
| INLINE {
|
||||
$$ = parseContext.makeAttributes(TString("inline"));
|
||||
}
|
||||
| NOINLINE {
|
||||
$$ = parseContext.makeAttributes(TString("noinline"));
|
||||
}
|
||||
|
||||
spirv_requirements_list
|
||||
: spirv_requirements_parameter {
|
||||
|
||||
+6918
-6245
File diff suppressed because it is too large
Load Diff
+446
-419
@@ -121,424 +121,451 @@ extern int yydebug;
|
||||
FLOAT32_T = 322, /* FLOAT32_T */
|
||||
DOUBLE = 323, /* DOUBLE */
|
||||
FLOAT64_T = 324, /* FLOAT64_T */
|
||||
INT64_T = 325, /* INT64_T */
|
||||
UINT64_T = 326, /* UINT64_T */
|
||||
INT32_T = 327, /* INT32_T */
|
||||
UINT32_T = 328, /* UINT32_T */
|
||||
INT16_T = 329, /* INT16_T */
|
||||
UINT16_T = 330, /* UINT16_T */
|
||||
INT8_T = 331, /* INT8_T */
|
||||
UINT8_T = 332, /* UINT8_T */
|
||||
I64VEC2 = 333, /* I64VEC2 */
|
||||
I64VEC3 = 334, /* I64VEC3 */
|
||||
I64VEC4 = 335, /* I64VEC4 */
|
||||
U64VEC2 = 336, /* U64VEC2 */
|
||||
U64VEC3 = 337, /* U64VEC3 */
|
||||
U64VEC4 = 338, /* U64VEC4 */
|
||||
I32VEC2 = 339, /* I32VEC2 */
|
||||
I32VEC3 = 340, /* I32VEC3 */
|
||||
I32VEC4 = 341, /* I32VEC4 */
|
||||
U32VEC2 = 342, /* U32VEC2 */
|
||||
U32VEC3 = 343, /* U32VEC3 */
|
||||
U32VEC4 = 344, /* U32VEC4 */
|
||||
I16VEC2 = 345, /* I16VEC2 */
|
||||
I16VEC3 = 346, /* I16VEC3 */
|
||||
I16VEC4 = 347, /* I16VEC4 */
|
||||
U16VEC2 = 348, /* U16VEC2 */
|
||||
U16VEC3 = 349, /* U16VEC3 */
|
||||
U16VEC4 = 350, /* U16VEC4 */
|
||||
I8VEC2 = 351, /* I8VEC2 */
|
||||
I8VEC3 = 352, /* I8VEC3 */
|
||||
I8VEC4 = 353, /* I8VEC4 */
|
||||
U8VEC2 = 354, /* U8VEC2 */
|
||||
U8VEC3 = 355, /* U8VEC3 */
|
||||
U8VEC4 = 356, /* U8VEC4 */
|
||||
DVEC2 = 357, /* DVEC2 */
|
||||
DVEC3 = 358, /* DVEC3 */
|
||||
DVEC4 = 359, /* DVEC4 */
|
||||
DMAT2 = 360, /* DMAT2 */
|
||||
DMAT3 = 361, /* DMAT3 */
|
||||
DMAT4 = 362, /* DMAT4 */
|
||||
BF16VEC2 = 363, /* BF16VEC2 */
|
||||
BF16VEC3 = 364, /* BF16VEC3 */
|
||||
BF16VEC4 = 365, /* BF16VEC4 */
|
||||
FE5M2VEC2 = 366, /* FE5M2VEC2 */
|
||||
FE5M2VEC3 = 367, /* FE5M2VEC3 */
|
||||
FE5M2VEC4 = 368, /* FE5M2VEC4 */
|
||||
FE4M3VEC2 = 369, /* FE4M3VEC2 */
|
||||
FE4M3VEC3 = 370, /* FE4M3VEC3 */
|
||||
FE4M3VEC4 = 371, /* FE4M3VEC4 */
|
||||
F16VEC2 = 372, /* F16VEC2 */
|
||||
F16VEC3 = 373, /* F16VEC3 */
|
||||
F16VEC4 = 374, /* F16VEC4 */
|
||||
F16MAT2 = 375, /* F16MAT2 */
|
||||
F16MAT3 = 376, /* F16MAT3 */
|
||||
F16MAT4 = 377, /* F16MAT4 */
|
||||
F32VEC2 = 378, /* F32VEC2 */
|
||||
F32VEC3 = 379, /* F32VEC3 */
|
||||
F32VEC4 = 380, /* F32VEC4 */
|
||||
F32MAT2 = 381, /* F32MAT2 */
|
||||
F32MAT3 = 382, /* F32MAT3 */
|
||||
F32MAT4 = 383, /* F32MAT4 */
|
||||
F64VEC2 = 384, /* F64VEC2 */
|
||||
F64VEC3 = 385, /* F64VEC3 */
|
||||
F64VEC4 = 386, /* F64VEC4 */
|
||||
F64MAT2 = 387, /* F64MAT2 */
|
||||
F64MAT3 = 388, /* F64MAT3 */
|
||||
F64MAT4 = 389, /* F64MAT4 */
|
||||
DMAT2X2 = 390, /* DMAT2X2 */
|
||||
DMAT2X3 = 391, /* DMAT2X3 */
|
||||
DMAT2X4 = 392, /* DMAT2X4 */
|
||||
DMAT3X2 = 393, /* DMAT3X2 */
|
||||
DMAT3X3 = 394, /* DMAT3X3 */
|
||||
DMAT3X4 = 395, /* DMAT3X4 */
|
||||
DMAT4X2 = 396, /* DMAT4X2 */
|
||||
DMAT4X3 = 397, /* DMAT4X3 */
|
||||
DMAT4X4 = 398, /* DMAT4X4 */
|
||||
F16MAT2X2 = 399, /* F16MAT2X2 */
|
||||
F16MAT2X3 = 400, /* F16MAT2X3 */
|
||||
F16MAT2X4 = 401, /* F16MAT2X4 */
|
||||
F16MAT3X2 = 402, /* F16MAT3X2 */
|
||||
F16MAT3X3 = 403, /* F16MAT3X3 */
|
||||
F16MAT3X4 = 404, /* F16MAT3X4 */
|
||||
F16MAT4X2 = 405, /* F16MAT4X2 */
|
||||
F16MAT4X3 = 406, /* F16MAT4X3 */
|
||||
F16MAT4X4 = 407, /* F16MAT4X4 */
|
||||
F32MAT2X2 = 408, /* F32MAT2X2 */
|
||||
F32MAT2X3 = 409, /* F32MAT2X3 */
|
||||
F32MAT2X4 = 410, /* F32MAT2X4 */
|
||||
F32MAT3X2 = 411, /* F32MAT3X2 */
|
||||
F32MAT3X3 = 412, /* F32MAT3X3 */
|
||||
F32MAT3X4 = 413, /* F32MAT3X4 */
|
||||
F32MAT4X2 = 414, /* F32MAT4X2 */
|
||||
F32MAT4X3 = 415, /* F32MAT4X3 */
|
||||
F32MAT4X4 = 416, /* F32MAT4X4 */
|
||||
F64MAT2X2 = 417, /* F64MAT2X2 */
|
||||
F64MAT2X3 = 418, /* F64MAT2X3 */
|
||||
F64MAT2X4 = 419, /* F64MAT2X4 */
|
||||
F64MAT3X2 = 420, /* F64MAT3X2 */
|
||||
F64MAT3X3 = 421, /* F64MAT3X3 */
|
||||
F64MAT3X4 = 422, /* F64MAT3X4 */
|
||||
F64MAT4X2 = 423, /* F64MAT4X2 */
|
||||
F64MAT4X3 = 424, /* F64MAT4X3 */
|
||||
F64MAT4X4 = 425, /* F64MAT4X4 */
|
||||
ATOMIC_UINT = 426, /* ATOMIC_UINT */
|
||||
ACCSTRUCTNV = 427, /* ACCSTRUCTNV */
|
||||
ACCSTRUCTEXT = 428, /* ACCSTRUCTEXT */
|
||||
RAYQUERYEXT = 429, /* RAYQUERYEXT */
|
||||
FCOOPMATNV = 430, /* FCOOPMATNV */
|
||||
ICOOPMATNV = 431, /* ICOOPMATNV */
|
||||
UCOOPMATNV = 432, /* UCOOPMATNV */
|
||||
COOPMAT = 433, /* COOPMAT */
|
||||
COOPVECNV = 434, /* COOPVECNV */
|
||||
VECTOR = 435, /* VECTOR */
|
||||
HITOBJECTNV = 436, /* HITOBJECTNV */
|
||||
HITOBJECTATTRNV = 437, /* HITOBJECTATTRNV */
|
||||
HITOBJECTEXT = 438, /* HITOBJECTEXT */
|
||||
HITOBJECTATTREXT = 439, /* HITOBJECTATTREXT */
|
||||
TENSORLAYOUTNV = 440, /* TENSORLAYOUTNV */
|
||||
TENSORVIEWNV = 441, /* TENSORVIEWNV */
|
||||
TENSORARM = 442, /* TENSORARM */
|
||||
SAMPLERCUBEARRAY = 443, /* SAMPLERCUBEARRAY */
|
||||
SAMPLERCUBEARRAYSHADOW = 444, /* SAMPLERCUBEARRAYSHADOW */
|
||||
ISAMPLERCUBEARRAY = 445, /* ISAMPLERCUBEARRAY */
|
||||
USAMPLERCUBEARRAY = 446, /* USAMPLERCUBEARRAY */
|
||||
SAMPLER1D = 447, /* SAMPLER1D */
|
||||
SAMPLER1DARRAY = 448, /* SAMPLER1DARRAY */
|
||||
SAMPLER1DARRAYSHADOW = 449, /* SAMPLER1DARRAYSHADOW */
|
||||
ISAMPLER1D = 450, /* ISAMPLER1D */
|
||||
SAMPLER1DSHADOW = 451, /* SAMPLER1DSHADOW */
|
||||
SAMPLER2DRECT = 452, /* SAMPLER2DRECT */
|
||||
SAMPLER2DRECTSHADOW = 453, /* SAMPLER2DRECTSHADOW */
|
||||
ISAMPLER2DRECT = 454, /* ISAMPLER2DRECT */
|
||||
USAMPLER2DRECT = 455, /* USAMPLER2DRECT */
|
||||
SAMPLERBUFFER = 456, /* SAMPLERBUFFER */
|
||||
ISAMPLERBUFFER = 457, /* ISAMPLERBUFFER */
|
||||
USAMPLERBUFFER = 458, /* USAMPLERBUFFER */
|
||||
SAMPLER2DMS = 459, /* SAMPLER2DMS */
|
||||
ISAMPLER2DMS = 460, /* ISAMPLER2DMS */
|
||||
USAMPLER2DMS = 461, /* USAMPLER2DMS */
|
||||
SAMPLER2DMSARRAY = 462, /* SAMPLER2DMSARRAY */
|
||||
ISAMPLER2DMSARRAY = 463, /* ISAMPLER2DMSARRAY */
|
||||
USAMPLER2DMSARRAY = 464, /* USAMPLER2DMSARRAY */
|
||||
SAMPLEREXTERNALOES = 465, /* SAMPLEREXTERNALOES */
|
||||
SAMPLEREXTERNAL2DY2YEXT = 466, /* SAMPLEREXTERNAL2DY2YEXT */
|
||||
ISAMPLER1DARRAY = 467, /* ISAMPLER1DARRAY */
|
||||
USAMPLER1D = 468, /* USAMPLER1D */
|
||||
USAMPLER1DARRAY = 469, /* USAMPLER1DARRAY */
|
||||
F16SAMPLER1D = 470, /* F16SAMPLER1D */
|
||||
F16SAMPLER2D = 471, /* F16SAMPLER2D */
|
||||
F16SAMPLER3D = 472, /* F16SAMPLER3D */
|
||||
F16SAMPLER2DRECT = 473, /* F16SAMPLER2DRECT */
|
||||
F16SAMPLERCUBE = 474, /* F16SAMPLERCUBE */
|
||||
F16SAMPLER1DARRAY = 475, /* F16SAMPLER1DARRAY */
|
||||
F16SAMPLER2DARRAY = 476, /* F16SAMPLER2DARRAY */
|
||||
F16SAMPLERCUBEARRAY = 477, /* F16SAMPLERCUBEARRAY */
|
||||
F16SAMPLERBUFFER = 478, /* F16SAMPLERBUFFER */
|
||||
F16SAMPLER2DMS = 479, /* F16SAMPLER2DMS */
|
||||
F16SAMPLER2DMSARRAY = 480, /* F16SAMPLER2DMSARRAY */
|
||||
F16SAMPLER1DSHADOW = 481, /* F16SAMPLER1DSHADOW */
|
||||
F16SAMPLER2DSHADOW = 482, /* F16SAMPLER2DSHADOW */
|
||||
F16SAMPLER1DARRAYSHADOW = 483, /* F16SAMPLER1DARRAYSHADOW */
|
||||
F16SAMPLER2DARRAYSHADOW = 484, /* F16SAMPLER2DARRAYSHADOW */
|
||||
F16SAMPLER2DRECTSHADOW = 485, /* F16SAMPLER2DRECTSHADOW */
|
||||
F16SAMPLERCUBESHADOW = 486, /* F16SAMPLERCUBESHADOW */
|
||||
F16SAMPLERCUBEARRAYSHADOW = 487, /* F16SAMPLERCUBEARRAYSHADOW */
|
||||
IMAGE1D = 488, /* IMAGE1D */
|
||||
IIMAGE1D = 489, /* IIMAGE1D */
|
||||
UIMAGE1D = 490, /* UIMAGE1D */
|
||||
IMAGE2D = 491, /* IMAGE2D */
|
||||
IIMAGE2D = 492, /* IIMAGE2D */
|
||||
UIMAGE2D = 493, /* UIMAGE2D */
|
||||
IMAGE3D = 494, /* IMAGE3D */
|
||||
IIMAGE3D = 495, /* IIMAGE3D */
|
||||
UIMAGE3D = 496, /* UIMAGE3D */
|
||||
IMAGE2DRECT = 497, /* IMAGE2DRECT */
|
||||
IIMAGE2DRECT = 498, /* IIMAGE2DRECT */
|
||||
UIMAGE2DRECT = 499, /* UIMAGE2DRECT */
|
||||
IMAGECUBE = 500, /* IMAGECUBE */
|
||||
IIMAGECUBE = 501, /* IIMAGECUBE */
|
||||
UIMAGECUBE = 502, /* UIMAGECUBE */
|
||||
IMAGEBUFFER = 503, /* IMAGEBUFFER */
|
||||
IIMAGEBUFFER = 504, /* IIMAGEBUFFER */
|
||||
UIMAGEBUFFER = 505, /* UIMAGEBUFFER */
|
||||
IMAGE1DARRAY = 506, /* IMAGE1DARRAY */
|
||||
IIMAGE1DARRAY = 507, /* IIMAGE1DARRAY */
|
||||
UIMAGE1DARRAY = 508, /* UIMAGE1DARRAY */
|
||||
IMAGE2DARRAY = 509, /* IMAGE2DARRAY */
|
||||
IIMAGE2DARRAY = 510, /* IIMAGE2DARRAY */
|
||||
UIMAGE2DARRAY = 511, /* UIMAGE2DARRAY */
|
||||
IMAGECUBEARRAY = 512, /* IMAGECUBEARRAY */
|
||||
IIMAGECUBEARRAY = 513, /* IIMAGECUBEARRAY */
|
||||
UIMAGECUBEARRAY = 514, /* UIMAGECUBEARRAY */
|
||||
IMAGE2DMS = 515, /* IMAGE2DMS */
|
||||
IIMAGE2DMS = 516, /* IIMAGE2DMS */
|
||||
UIMAGE2DMS = 517, /* UIMAGE2DMS */
|
||||
IMAGE2DMSARRAY = 518, /* IMAGE2DMSARRAY */
|
||||
IIMAGE2DMSARRAY = 519, /* IIMAGE2DMSARRAY */
|
||||
UIMAGE2DMSARRAY = 520, /* UIMAGE2DMSARRAY */
|
||||
F16IMAGE1D = 521, /* F16IMAGE1D */
|
||||
F16IMAGE2D = 522, /* F16IMAGE2D */
|
||||
F16IMAGE3D = 523, /* F16IMAGE3D */
|
||||
F16IMAGE2DRECT = 524, /* F16IMAGE2DRECT */
|
||||
F16IMAGECUBE = 525, /* F16IMAGECUBE */
|
||||
F16IMAGE1DARRAY = 526, /* F16IMAGE1DARRAY */
|
||||
F16IMAGE2DARRAY = 527, /* F16IMAGE2DARRAY */
|
||||
F16IMAGECUBEARRAY = 528, /* F16IMAGECUBEARRAY */
|
||||
F16IMAGEBUFFER = 529, /* F16IMAGEBUFFER */
|
||||
F16IMAGE2DMS = 530, /* F16IMAGE2DMS */
|
||||
F16IMAGE2DMSARRAY = 531, /* F16IMAGE2DMSARRAY */
|
||||
I64IMAGE1D = 532, /* I64IMAGE1D */
|
||||
U64IMAGE1D = 533, /* U64IMAGE1D */
|
||||
I64IMAGE2D = 534, /* I64IMAGE2D */
|
||||
U64IMAGE2D = 535, /* U64IMAGE2D */
|
||||
I64IMAGE3D = 536, /* I64IMAGE3D */
|
||||
U64IMAGE3D = 537, /* U64IMAGE3D */
|
||||
I64IMAGE2DRECT = 538, /* I64IMAGE2DRECT */
|
||||
U64IMAGE2DRECT = 539, /* U64IMAGE2DRECT */
|
||||
I64IMAGECUBE = 540, /* I64IMAGECUBE */
|
||||
U64IMAGECUBE = 541, /* U64IMAGECUBE */
|
||||
I64IMAGEBUFFER = 542, /* I64IMAGEBUFFER */
|
||||
U64IMAGEBUFFER = 543, /* U64IMAGEBUFFER */
|
||||
I64IMAGE1DARRAY = 544, /* I64IMAGE1DARRAY */
|
||||
U64IMAGE1DARRAY = 545, /* U64IMAGE1DARRAY */
|
||||
I64IMAGE2DARRAY = 546, /* I64IMAGE2DARRAY */
|
||||
U64IMAGE2DARRAY = 547, /* U64IMAGE2DARRAY */
|
||||
I64IMAGECUBEARRAY = 548, /* I64IMAGECUBEARRAY */
|
||||
U64IMAGECUBEARRAY = 549, /* U64IMAGECUBEARRAY */
|
||||
I64IMAGE2DMS = 550, /* I64IMAGE2DMS */
|
||||
U64IMAGE2DMS = 551, /* U64IMAGE2DMS */
|
||||
I64IMAGE2DMSARRAY = 552, /* I64IMAGE2DMSARRAY */
|
||||
U64IMAGE2DMSARRAY = 553, /* U64IMAGE2DMSARRAY */
|
||||
TEXTURECUBEARRAY = 554, /* TEXTURECUBEARRAY */
|
||||
ITEXTURECUBEARRAY = 555, /* ITEXTURECUBEARRAY */
|
||||
UTEXTURECUBEARRAY = 556, /* UTEXTURECUBEARRAY */
|
||||
TEXTURE1D = 557, /* TEXTURE1D */
|
||||
ITEXTURE1D = 558, /* ITEXTURE1D */
|
||||
UTEXTURE1D = 559, /* UTEXTURE1D */
|
||||
TEXTURE1DARRAY = 560, /* TEXTURE1DARRAY */
|
||||
ITEXTURE1DARRAY = 561, /* ITEXTURE1DARRAY */
|
||||
UTEXTURE1DARRAY = 562, /* UTEXTURE1DARRAY */
|
||||
TEXTURE2DRECT = 563, /* TEXTURE2DRECT */
|
||||
ITEXTURE2DRECT = 564, /* ITEXTURE2DRECT */
|
||||
UTEXTURE2DRECT = 565, /* UTEXTURE2DRECT */
|
||||
TEXTUREBUFFER = 566, /* TEXTUREBUFFER */
|
||||
ITEXTUREBUFFER = 567, /* ITEXTUREBUFFER */
|
||||
UTEXTUREBUFFER = 568, /* UTEXTUREBUFFER */
|
||||
TEXTURE2DMS = 569, /* TEXTURE2DMS */
|
||||
ITEXTURE2DMS = 570, /* ITEXTURE2DMS */
|
||||
UTEXTURE2DMS = 571, /* UTEXTURE2DMS */
|
||||
TEXTURE2DMSARRAY = 572, /* TEXTURE2DMSARRAY */
|
||||
ITEXTURE2DMSARRAY = 573, /* ITEXTURE2DMSARRAY */
|
||||
UTEXTURE2DMSARRAY = 574, /* UTEXTURE2DMSARRAY */
|
||||
F16TEXTURE1D = 575, /* F16TEXTURE1D */
|
||||
F16TEXTURE2D = 576, /* F16TEXTURE2D */
|
||||
F16TEXTURE3D = 577, /* F16TEXTURE3D */
|
||||
F16TEXTURE2DRECT = 578, /* F16TEXTURE2DRECT */
|
||||
F16TEXTURECUBE = 579, /* F16TEXTURECUBE */
|
||||
F16TEXTURE1DARRAY = 580, /* F16TEXTURE1DARRAY */
|
||||
F16TEXTURE2DARRAY = 581, /* F16TEXTURE2DARRAY */
|
||||
F16TEXTURECUBEARRAY = 582, /* F16TEXTURECUBEARRAY */
|
||||
F16TEXTUREBUFFER = 583, /* F16TEXTUREBUFFER */
|
||||
F16TEXTURE2DMS = 584, /* F16TEXTURE2DMS */
|
||||
F16TEXTURE2DMSARRAY = 585, /* F16TEXTURE2DMSARRAY */
|
||||
SUBPASSINPUT = 586, /* SUBPASSINPUT */
|
||||
SUBPASSINPUTMS = 587, /* SUBPASSINPUTMS */
|
||||
ISUBPASSINPUT = 588, /* ISUBPASSINPUT */
|
||||
ISUBPASSINPUTMS = 589, /* ISUBPASSINPUTMS */
|
||||
USUBPASSINPUT = 590, /* USUBPASSINPUT */
|
||||
USUBPASSINPUTMS = 591, /* USUBPASSINPUTMS */
|
||||
F16SUBPASSINPUT = 592, /* F16SUBPASSINPUT */
|
||||
F16SUBPASSINPUTMS = 593, /* F16SUBPASSINPUTMS */
|
||||
SPIRV_INSTRUCTION = 594, /* SPIRV_INSTRUCTION */
|
||||
SPIRV_EXECUTION_MODE = 595, /* SPIRV_EXECUTION_MODE */
|
||||
SPIRV_EXECUTION_MODE_ID = 596, /* SPIRV_EXECUTION_MODE_ID */
|
||||
SPIRV_DECORATE = 597, /* SPIRV_DECORATE */
|
||||
SPIRV_DECORATE_ID = 598, /* SPIRV_DECORATE_ID */
|
||||
SPIRV_DECORATE_STRING = 599, /* SPIRV_DECORATE_STRING */
|
||||
SPIRV_TYPE = 600, /* SPIRV_TYPE */
|
||||
SPIRV_STORAGE_CLASS = 601, /* SPIRV_STORAGE_CLASS */
|
||||
SPIRV_BY_REFERENCE = 602, /* SPIRV_BY_REFERENCE */
|
||||
SPIRV_LITERAL = 603, /* SPIRV_LITERAL */
|
||||
ATTACHMENTEXT = 604, /* ATTACHMENTEXT */
|
||||
IATTACHMENTEXT = 605, /* IATTACHMENTEXT */
|
||||
UATTACHMENTEXT = 606, /* UATTACHMENTEXT */
|
||||
LEFT_OP = 607, /* LEFT_OP */
|
||||
RIGHT_OP = 608, /* RIGHT_OP */
|
||||
INC_OP = 609, /* INC_OP */
|
||||
DEC_OP = 610, /* DEC_OP */
|
||||
LE_OP = 611, /* LE_OP */
|
||||
GE_OP = 612, /* GE_OP */
|
||||
EQ_OP = 613, /* EQ_OP */
|
||||
NE_OP = 614, /* NE_OP */
|
||||
AND_OP = 615, /* AND_OP */
|
||||
OR_OP = 616, /* OR_OP */
|
||||
XOR_OP = 617, /* XOR_OP */
|
||||
MUL_ASSIGN = 618, /* MUL_ASSIGN */
|
||||
DIV_ASSIGN = 619, /* DIV_ASSIGN */
|
||||
ADD_ASSIGN = 620, /* ADD_ASSIGN */
|
||||
MOD_ASSIGN = 621, /* MOD_ASSIGN */
|
||||
LEFT_ASSIGN = 622, /* LEFT_ASSIGN */
|
||||
RIGHT_ASSIGN = 623, /* RIGHT_ASSIGN */
|
||||
AND_ASSIGN = 624, /* AND_ASSIGN */
|
||||
XOR_ASSIGN = 625, /* XOR_ASSIGN */
|
||||
OR_ASSIGN = 626, /* OR_ASSIGN */
|
||||
SUB_ASSIGN = 627, /* SUB_ASSIGN */
|
||||
STRING_LITERAL = 628, /* STRING_LITERAL */
|
||||
LEFT_PAREN = 629, /* LEFT_PAREN */
|
||||
RIGHT_PAREN = 630, /* RIGHT_PAREN */
|
||||
LEFT_BRACKET = 631, /* LEFT_BRACKET */
|
||||
RIGHT_BRACKET = 632, /* RIGHT_BRACKET */
|
||||
LEFT_BRACE = 633, /* LEFT_BRACE */
|
||||
RIGHT_BRACE = 634, /* RIGHT_BRACE */
|
||||
DOT = 635, /* DOT */
|
||||
COMMA = 636, /* COMMA */
|
||||
COLON = 637, /* COLON */
|
||||
EQUAL = 638, /* EQUAL */
|
||||
SEMICOLON = 639, /* SEMICOLON */
|
||||
BANG = 640, /* BANG */
|
||||
DASH = 641, /* DASH */
|
||||
TILDE = 642, /* TILDE */
|
||||
PLUS = 643, /* PLUS */
|
||||
STAR = 644, /* STAR */
|
||||
SLASH = 645, /* SLASH */
|
||||
PERCENT = 646, /* PERCENT */
|
||||
LEFT_ANGLE = 647, /* LEFT_ANGLE */
|
||||
RIGHT_ANGLE = 648, /* RIGHT_ANGLE */
|
||||
VERTICAL_BAR = 649, /* VERTICAL_BAR */
|
||||
CARET = 650, /* CARET */
|
||||
AMPERSAND = 651, /* AMPERSAND */
|
||||
QUESTION = 652, /* QUESTION */
|
||||
INVARIANT = 653, /* INVARIANT */
|
||||
HIGH_PRECISION = 654, /* HIGH_PRECISION */
|
||||
MEDIUM_PRECISION = 655, /* MEDIUM_PRECISION */
|
||||
LOW_PRECISION = 656, /* LOW_PRECISION */
|
||||
PRECISION = 657, /* PRECISION */
|
||||
PACKED = 658, /* PACKED */
|
||||
RESOURCE = 659, /* RESOURCE */
|
||||
SUPERP = 660, /* SUPERP */
|
||||
FLOATCONSTANT = 661, /* FLOATCONSTANT */
|
||||
INTCONSTANT = 662, /* INTCONSTANT */
|
||||
UINTCONSTANT = 663, /* UINTCONSTANT */
|
||||
BOOLCONSTANT = 664, /* BOOLCONSTANT */
|
||||
IDENTIFIER = 665, /* IDENTIFIER */
|
||||
TYPE_NAME = 666, /* TYPE_NAME */
|
||||
CENTROID = 667, /* CENTROID */
|
||||
IN = 668, /* IN */
|
||||
OUT = 669, /* OUT */
|
||||
INOUT = 670, /* INOUT */
|
||||
STRUCT = 671, /* STRUCT */
|
||||
VOID = 672, /* VOID */
|
||||
WHILE = 673, /* WHILE */
|
||||
BREAK = 674, /* BREAK */
|
||||
CONTINUE = 675, /* CONTINUE */
|
||||
DO = 676, /* DO */
|
||||
ELSE = 677, /* ELSE */
|
||||
FOR = 678, /* FOR */
|
||||
IF = 679, /* IF */
|
||||
DISCARD = 680, /* DISCARD */
|
||||
RETURN = 681, /* RETURN */
|
||||
SWITCH = 682, /* SWITCH */
|
||||
CASE = 683, /* CASE */
|
||||
DEFAULT = 684, /* DEFAULT */
|
||||
TERMINATE_INVOCATION = 685, /* TERMINATE_INVOCATION */
|
||||
TERMINATE_RAY = 686, /* TERMINATE_RAY */
|
||||
IGNORE_INTERSECTION = 687, /* IGNORE_INTERSECTION */
|
||||
UNIFORM = 688, /* UNIFORM */
|
||||
SHARED = 689, /* SHARED */
|
||||
BUFFER = 690, /* BUFFER */
|
||||
TILEIMAGEEXT = 691, /* TILEIMAGEEXT */
|
||||
FLAT = 692, /* FLAT */
|
||||
SMOOTH = 693, /* SMOOTH */
|
||||
LAYOUT = 694, /* LAYOUT */
|
||||
DOUBLECONSTANT = 695, /* DOUBLECONSTANT */
|
||||
INT16CONSTANT = 696, /* INT16CONSTANT */
|
||||
UINT16CONSTANT = 697, /* UINT16CONSTANT */
|
||||
FLOAT16CONSTANT = 698, /* FLOAT16CONSTANT */
|
||||
INT32CONSTANT = 699, /* INT32CONSTANT */
|
||||
UINT32CONSTANT = 700, /* UINT32CONSTANT */
|
||||
INT64CONSTANT = 701, /* INT64CONSTANT */
|
||||
UINT64CONSTANT = 702, /* UINT64CONSTANT */
|
||||
SUBROUTINE = 703, /* SUBROUTINE */
|
||||
DEMOTE = 704, /* DEMOTE */
|
||||
FUNCTION = 705, /* FUNCTION */
|
||||
PAYLOADNV = 706, /* PAYLOADNV */
|
||||
PAYLOADINNV = 707, /* PAYLOADINNV */
|
||||
HITATTRNV = 708, /* HITATTRNV */
|
||||
CALLDATANV = 709, /* CALLDATANV */
|
||||
CALLDATAINNV = 710, /* CALLDATAINNV */
|
||||
PAYLOADEXT = 711, /* PAYLOADEXT */
|
||||
PAYLOADINEXT = 712, /* PAYLOADINEXT */
|
||||
HITATTREXT = 713, /* HITATTREXT */
|
||||
CALLDATAEXT = 714, /* CALLDATAEXT */
|
||||
CALLDATAINEXT = 715, /* CALLDATAINEXT */
|
||||
PATCH = 716, /* PATCH */
|
||||
SAMPLE = 717, /* SAMPLE */
|
||||
NONUNIFORM = 718, /* NONUNIFORM */
|
||||
RESOURCEHEAP = 719, /* RESOURCEHEAP */
|
||||
SAMPLERHEAP = 720, /* SAMPLERHEAP */
|
||||
COHERENT = 721, /* COHERENT */
|
||||
VOLATILE = 722, /* VOLATILE */
|
||||
RESTRICT = 723, /* RESTRICT */
|
||||
READONLY = 724, /* READONLY */
|
||||
WRITEONLY = 725, /* WRITEONLY */
|
||||
NONTEMPORAL = 726, /* NONTEMPORAL */
|
||||
DEVICECOHERENT = 727, /* DEVICECOHERENT */
|
||||
QUEUEFAMILYCOHERENT = 728, /* QUEUEFAMILYCOHERENT */
|
||||
WORKGROUPCOHERENT = 729, /* WORKGROUPCOHERENT */
|
||||
SUBGROUPCOHERENT = 730, /* SUBGROUPCOHERENT */
|
||||
NONPRIVATE = 731, /* NONPRIVATE */
|
||||
SHADERCALLCOHERENT = 732, /* SHADERCALLCOHERENT */
|
||||
NOPERSPECTIVE = 733, /* NOPERSPECTIVE */
|
||||
EXPLICITINTERPAMD = 734, /* EXPLICITINTERPAMD */
|
||||
PERVERTEXEXT = 735, /* PERVERTEXEXT */
|
||||
PERVERTEXNV = 736, /* PERVERTEXNV */
|
||||
PERPRIMITIVENV = 737, /* PERPRIMITIVENV */
|
||||
PERVIEWNV = 738, /* PERVIEWNV */
|
||||
PERTASKNV = 739, /* PERTASKNV */
|
||||
PERPRIMITIVEEXT = 740, /* PERPRIMITIVEEXT */
|
||||
TASKPAYLOADWORKGROUPEXT = 741, /* TASKPAYLOADWORKGROUPEXT */
|
||||
PRECISE = 742 /* PRECISE */
|
||||
FLOATE2M1_T = 325, /* FLOATE2M1_T */
|
||||
FLOATE3M2_T = 326, /* FLOATE3M2_T */
|
||||
FLOATE2M3_T = 327, /* FLOATE2M3_T */
|
||||
FLOATUE8M0_T = 328, /* FLOATUE8M0_T */
|
||||
FLOATMXINT8_T = 329, /* FLOATMXINT8_T */
|
||||
INT64_T = 330, /* INT64_T */
|
||||
UINT64_T = 331, /* UINT64_T */
|
||||
INT32_T = 332, /* INT32_T */
|
||||
UINT32_T = 333, /* UINT32_T */
|
||||
INT16_T = 334, /* INT16_T */
|
||||
UINT16_T = 335, /* UINT16_T */
|
||||
INT8_T = 336, /* INT8_T */
|
||||
UINT8_T = 337, /* UINT8_T */
|
||||
I64VEC2 = 338, /* I64VEC2 */
|
||||
I64VEC3 = 339, /* I64VEC3 */
|
||||
I64VEC4 = 340, /* I64VEC4 */
|
||||
U64VEC2 = 341, /* U64VEC2 */
|
||||
U64VEC3 = 342, /* U64VEC3 */
|
||||
U64VEC4 = 343, /* U64VEC4 */
|
||||
I32VEC2 = 344, /* I32VEC2 */
|
||||
I32VEC3 = 345, /* I32VEC3 */
|
||||
I32VEC4 = 346, /* I32VEC4 */
|
||||
U32VEC2 = 347, /* U32VEC2 */
|
||||
U32VEC3 = 348, /* U32VEC3 */
|
||||
U32VEC4 = 349, /* U32VEC4 */
|
||||
I16VEC2 = 350, /* I16VEC2 */
|
||||
I16VEC3 = 351, /* I16VEC3 */
|
||||
I16VEC4 = 352, /* I16VEC4 */
|
||||
U16VEC2 = 353, /* U16VEC2 */
|
||||
U16VEC3 = 354, /* U16VEC3 */
|
||||
U16VEC4 = 355, /* U16VEC4 */
|
||||
I8VEC2 = 356, /* I8VEC2 */
|
||||
I8VEC3 = 357, /* I8VEC3 */
|
||||
I8VEC4 = 358, /* I8VEC4 */
|
||||
U8VEC2 = 359, /* U8VEC2 */
|
||||
U8VEC3 = 360, /* U8VEC3 */
|
||||
U8VEC4 = 361, /* U8VEC4 */
|
||||
DVEC2 = 362, /* DVEC2 */
|
||||
DVEC3 = 363, /* DVEC3 */
|
||||
DVEC4 = 364, /* DVEC4 */
|
||||
DMAT2 = 365, /* DMAT2 */
|
||||
DMAT3 = 366, /* DMAT3 */
|
||||
DMAT4 = 367, /* DMAT4 */
|
||||
BF16VEC2 = 368, /* BF16VEC2 */
|
||||
BF16VEC3 = 369, /* BF16VEC3 */
|
||||
BF16VEC4 = 370, /* BF16VEC4 */
|
||||
FE5M2VEC2 = 371, /* FE5M2VEC2 */
|
||||
FE5M2VEC3 = 372, /* FE5M2VEC3 */
|
||||
FE5M2VEC4 = 373, /* FE5M2VEC4 */
|
||||
FE4M3VEC2 = 374, /* FE4M3VEC2 */
|
||||
FE4M3VEC3 = 375, /* FE4M3VEC3 */
|
||||
FE4M3VEC4 = 376, /* FE4M3VEC4 */
|
||||
FE2M1VEC2 = 377, /* FE2M1VEC2 */
|
||||
FE2M1VEC3 = 378, /* FE2M1VEC3 */
|
||||
FE2M1VEC4 = 379, /* FE2M1VEC4 */
|
||||
FE3M2VEC2 = 380, /* FE3M2VEC2 */
|
||||
FE3M2VEC3 = 381, /* FE3M2VEC3 */
|
||||
FE3M2VEC4 = 382, /* FE3M2VEC4 */
|
||||
FE2M3VEC2 = 383, /* FE2M3VEC2 */
|
||||
FE2M3VEC3 = 384, /* FE2M3VEC3 */
|
||||
FE2M3VEC4 = 385, /* FE2M3VEC4 */
|
||||
FUE8M0VEC2 = 386, /* FUE8M0VEC2 */
|
||||
FUE8M0VEC3 = 387, /* FUE8M0VEC3 */
|
||||
FUE8M0VEC4 = 388, /* FUE8M0VEC4 */
|
||||
FMXINT8VEC2 = 389, /* FMXINT8VEC2 */
|
||||
FMXINT8VEC3 = 390, /* FMXINT8VEC3 */
|
||||
FMXINT8VEC4 = 391, /* FMXINT8VEC4 */
|
||||
F16VEC2 = 392, /* F16VEC2 */
|
||||
F16VEC3 = 393, /* F16VEC3 */
|
||||
F16VEC4 = 394, /* F16VEC4 */
|
||||
F16MAT2 = 395, /* F16MAT2 */
|
||||
F16MAT3 = 396, /* F16MAT3 */
|
||||
F16MAT4 = 397, /* F16MAT4 */
|
||||
F32VEC2 = 398, /* F32VEC2 */
|
||||
F32VEC3 = 399, /* F32VEC3 */
|
||||
F32VEC4 = 400, /* F32VEC4 */
|
||||
F32MAT2 = 401, /* F32MAT2 */
|
||||
F32MAT3 = 402, /* F32MAT3 */
|
||||
F32MAT4 = 403, /* F32MAT4 */
|
||||
F64VEC2 = 404, /* F64VEC2 */
|
||||
F64VEC3 = 405, /* F64VEC3 */
|
||||
F64VEC4 = 406, /* F64VEC4 */
|
||||
F64MAT2 = 407, /* F64MAT2 */
|
||||
F64MAT3 = 408, /* F64MAT3 */
|
||||
F64MAT4 = 409, /* F64MAT4 */
|
||||
DMAT2X2 = 410, /* DMAT2X2 */
|
||||
DMAT2X3 = 411, /* DMAT2X3 */
|
||||
DMAT2X4 = 412, /* DMAT2X4 */
|
||||
DMAT3X2 = 413, /* DMAT3X2 */
|
||||
DMAT3X3 = 414, /* DMAT3X3 */
|
||||
DMAT3X4 = 415, /* DMAT3X4 */
|
||||
DMAT4X2 = 416, /* DMAT4X2 */
|
||||
DMAT4X3 = 417, /* DMAT4X3 */
|
||||
DMAT4X4 = 418, /* DMAT4X4 */
|
||||
F16MAT2X2 = 419, /* F16MAT2X2 */
|
||||
F16MAT2X3 = 420, /* F16MAT2X3 */
|
||||
F16MAT2X4 = 421, /* F16MAT2X4 */
|
||||
F16MAT3X2 = 422, /* F16MAT3X2 */
|
||||
F16MAT3X3 = 423, /* F16MAT3X3 */
|
||||
F16MAT3X4 = 424, /* F16MAT3X4 */
|
||||
F16MAT4X2 = 425, /* F16MAT4X2 */
|
||||
F16MAT4X3 = 426, /* F16MAT4X3 */
|
||||
F16MAT4X4 = 427, /* F16MAT4X4 */
|
||||
F32MAT2X2 = 428, /* F32MAT2X2 */
|
||||
F32MAT2X3 = 429, /* F32MAT2X3 */
|
||||
F32MAT2X4 = 430, /* F32MAT2X4 */
|
||||
F32MAT3X2 = 431, /* F32MAT3X2 */
|
||||
F32MAT3X3 = 432, /* F32MAT3X3 */
|
||||
F32MAT3X4 = 433, /* F32MAT3X4 */
|
||||
F32MAT4X2 = 434, /* F32MAT4X2 */
|
||||
F32MAT4X3 = 435, /* F32MAT4X3 */
|
||||
F32MAT4X4 = 436, /* F32MAT4X4 */
|
||||
F64MAT2X2 = 437, /* F64MAT2X2 */
|
||||
F64MAT2X3 = 438, /* F64MAT2X3 */
|
||||
F64MAT2X4 = 439, /* F64MAT2X4 */
|
||||
F64MAT3X2 = 440, /* F64MAT3X2 */
|
||||
F64MAT3X3 = 441, /* F64MAT3X3 */
|
||||
F64MAT3X4 = 442, /* F64MAT3X4 */
|
||||
F64MAT4X2 = 443, /* F64MAT4X2 */
|
||||
F64MAT4X3 = 444, /* F64MAT4X3 */
|
||||
F64MAT4X4 = 445, /* F64MAT4X4 */
|
||||
ATOMIC_UINT = 446, /* ATOMIC_UINT */
|
||||
ACCSTRUCTNV = 447, /* ACCSTRUCTNV */
|
||||
ACCSTRUCTEXT = 448, /* ACCSTRUCTEXT */
|
||||
RAYQUERYEXT = 449, /* RAYQUERYEXT */
|
||||
FCOOPMATNV = 450, /* FCOOPMATNV */
|
||||
ICOOPMATNV = 451, /* ICOOPMATNV */
|
||||
UCOOPMATNV = 452, /* UCOOPMATNV */
|
||||
COOPMAT = 453, /* COOPMAT */
|
||||
COOPVECNV = 454, /* COOPVECNV */
|
||||
VECTOR = 455, /* VECTOR */
|
||||
HITOBJECTNV = 456, /* HITOBJECTNV */
|
||||
HITOBJECTATTRNV = 457, /* HITOBJECTATTRNV */
|
||||
HITOBJECTEXT = 458, /* HITOBJECTEXT */
|
||||
HITOBJECTATTREXT = 459, /* HITOBJECTATTREXT */
|
||||
TENSORLAYOUTNV = 460, /* TENSORLAYOUTNV */
|
||||
TENSORVIEWNV = 461, /* TENSORVIEWNV */
|
||||
TENSORARM = 462, /* TENSORARM */
|
||||
SAMPLERCUBEARRAY = 463, /* SAMPLERCUBEARRAY */
|
||||
SAMPLERCUBEARRAYSHADOW = 464, /* SAMPLERCUBEARRAYSHADOW */
|
||||
ISAMPLERCUBEARRAY = 465, /* ISAMPLERCUBEARRAY */
|
||||
USAMPLERCUBEARRAY = 466, /* USAMPLERCUBEARRAY */
|
||||
SAMPLER1D = 467, /* SAMPLER1D */
|
||||
SAMPLER1DARRAY = 468, /* SAMPLER1DARRAY */
|
||||
SAMPLER1DARRAYSHADOW = 469, /* SAMPLER1DARRAYSHADOW */
|
||||
ISAMPLER1D = 470, /* ISAMPLER1D */
|
||||
SAMPLER1DSHADOW = 471, /* SAMPLER1DSHADOW */
|
||||
SAMPLER2DRECT = 472, /* SAMPLER2DRECT */
|
||||
SAMPLER2DRECTSHADOW = 473, /* SAMPLER2DRECTSHADOW */
|
||||
ISAMPLER2DRECT = 474, /* ISAMPLER2DRECT */
|
||||
USAMPLER2DRECT = 475, /* USAMPLER2DRECT */
|
||||
SAMPLERBUFFER = 476, /* SAMPLERBUFFER */
|
||||
ISAMPLERBUFFER = 477, /* ISAMPLERBUFFER */
|
||||
USAMPLERBUFFER = 478, /* USAMPLERBUFFER */
|
||||
SAMPLER2DMS = 479, /* SAMPLER2DMS */
|
||||
ISAMPLER2DMS = 480, /* ISAMPLER2DMS */
|
||||
USAMPLER2DMS = 481, /* USAMPLER2DMS */
|
||||
SAMPLER2DMSARRAY = 482, /* SAMPLER2DMSARRAY */
|
||||
ISAMPLER2DMSARRAY = 483, /* ISAMPLER2DMSARRAY */
|
||||
USAMPLER2DMSARRAY = 484, /* USAMPLER2DMSARRAY */
|
||||
SAMPLEREXTERNALOES = 485, /* SAMPLEREXTERNALOES */
|
||||
SAMPLEREXTERNAL2DY2YEXT = 486, /* SAMPLEREXTERNAL2DY2YEXT */
|
||||
ISAMPLER1DARRAY = 487, /* ISAMPLER1DARRAY */
|
||||
USAMPLER1D = 488, /* USAMPLER1D */
|
||||
USAMPLER1DARRAY = 489, /* USAMPLER1DARRAY */
|
||||
F16SAMPLER1D = 490, /* F16SAMPLER1D */
|
||||
F16SAMPLER2D = 491, /* F16SAMPLER2D */
|
||||
F16SAMPLER3D = 492, /* F16SAMPLER3D */
|
||||
F16SAMPLER2DRECT = 493, /* F16SAMPLER2DRECT */
|
||||
F16SAMPLERCUBE = 494, /* F16SAMPLERCUBE */
|
||||
F16SAMPLER1DARRAY = 495, /* F16SAMPLER1DARRAY */
|
||||
F16SAMPLER2DARRAY = 496, /* F16SAMPLER2DARRAY */
|
||||
F16SAMPLERCUBEARRAY = 497, /* F16SAMPLERCUBEARRAY */
|
||||
F16SAMPLERBUFFER = 498, /* F16SAMPLERBUFFER */
|
||||
F16SAMPLER2DMS = 499, /* F16SAMPLER2DMS */
|
||||
F16SAMPLER2DMSARRAY = 500, /* F16SAMPLER2DMSARRAY */
|
||||
F16SAMPLER1DSHADOW = 501, /* F16SAMPLER1DSHADOW */
|
||||
F16SAMPLER2DSHADOW = 502, /* F16SAMPLER2DSHADOW */
|
||||
F16SAMPLER1DARRAYSHADOW = 503, /* F16SAMPLER1DARRAYSHADOW */
|
||||
F16SAMPLER2DARRAYSHADOW = 504, /* F16SAMPLER2DARRAYSHADOW */
|
||||
F16SAMPLER2DRECTSHADOW = 505, /* F16SAMPLER2DRECTSHADOW */
|
||||
F16SAMPLERCUBESHADOW = 506, /* F16SAMPLERCUBESHADOW */
|
||||
F16SAMPLERCUBEARRAYSHADOW = 507, /* F16SAMPLERCUBEARRAYSHADOW */
|
||||
IMAGE1D = 508, /* IMAGE1D */
|
||||
IIMAGE1D = 509, /* IIMAGE1D */
|
||||
UIMAGE1D = 510, /* UIMAGE1D */
|
||||
IMAGE2D = 511, /* IMAGE2D */
|
||||
IIMAGE2D = 512, /* IIMAGE2D */
|
||||
UIMAGE2D = 513, /* UIMAGE2D */
|
||||
IMAGE3D = 514, /* IMAGE3D */
|
||||
IIMAGE3D = 515, /* IIMAGE3D */
|
||||
UIMAGE3D = 516, /* UIMAGE3D */
|
||||
IMAGE2DRECT = 517, /* IMAGE2DRECT */
|
||||
IIMAGE2DRECT = 518, /* IIMAGE2DRECT */
|
||||
UIMAGE2DRECT = 519, /* UIMAGE2DRECT */
|
||||
IMAGECUBE = 520, /* IMAGECUBE */
|
||||
IIMAGECUBE = 521, /* IIMAGECUBE */
|
||||
UIMAGECUBE = 522, /* UIMAGECUBE */
|
||||
IMAGEBUFFER = 523, /* IMAGEBUFFER */
|
||||
IIMAGEBUFFER = 524, /* IIMAGEBUFFER */
|
||||
UIMAGEBUFFER = 525, /* UIMAGEBUFFER */
|
||||
IMAGE1DARRAY = 526, /* IMAGE1DARRAY */
|
||||
IIMAGE1DARRAY = 527, /* IIMAGE1DARRAY */
|
||||
UIMAGE1DARRAY = 528, /* UIMAGE1DARRAY */
|
||||
IMAGE2DARRAY = 529, /* IMAGE2DARRAY */
|
||||
IIMAGE2DARRAY = 530, /* IIMAGE2DARRAY */
|
||||
UIMAGE2DARRAY = 531, /* UIMAGE2DARRAY */
|
||||
IMAGECUBEARRAY = 532, /* IMAGECUBEARRAY */
|
||||
IIMAGECUBEARRAY = 533, /* IIMAGECUBEARRAY */
|
||||
UIMAGECUBEARRAY = 534, /* UIMAGECUBEARRAY */
|
||||
IMAGE2DMS = 535, /* IMAGE2DMS */
|
||||
IIMAGE2DMS = 536, /* IIMAGE2DMS */
|
||||
UIMAGE2DMS = 537, /* UIMAGE2DMS */
|
||||
IMAGE2DMSARRAY = 538, /* IMAGE2DMSARRAY */
|
||||
IIMAGE2DMSARRAY = 539, /* IIMAGE2DMSARRAY */
|
||||
UIMAGE2DMSARRAY = 540, /* UIMAGE2DMSARRAY */
|
||||
F16IMAGE1D = 541, /* F16IMAGE1D */
|
||||
F16IMAGE2D = 542, /* F16IMAGE2D */
|
||||
F16IMAGE3D = 543, /* F16IMAGE3D */
|
||||
F16IMAGE2DRECT = 544, /* F16IMAGE2DRECT */
|
||||
F16IMAGECUBE = 545, /* F16IMAGECUBE */
|
||||
F16IMAGE1DARRAY = 546, /* F16IMAGE1DARRAY */
|
||||
F16IMAGE2DARRAY = 547, /* F16IMAGE2DARRAY */
|
||||
F16IMAGECUBEARRAY = 548, /* F16IMAGECUBEARRAY */
|
||||
F16IMAGEBUFFER = 549, /* F16IMAGEBUFFER */
|
||||
F16IMAGE2DMS = 550, /* F16IMAGE2DMS */
|
||||
F16IMAGE2DMSARRAY = 551, /* F16IMAGE2DMSARRAY */
|
||||
I64IMAGE1D = 552, /* I64IMAGE1D */
|
||||
U64IMAGE1D = 553, /* U64IMAGE1D */
|
||||
I64IMAGE2D = 554, /* I64IMAGE2D */
|
||||
U64IMAGE2D = 555, /* U64IMAGE2D */
|
||||
I64IMAGE3D = 556, /* I64IMAGE3D */
|
||||
U64IMAGE3D = 557, /* U64IMAGE3D */
|
||||
I64IMAGE2DRECT = 558, /* I64IMAGE2DRECT */
|
||||
U64IMAGE2DRECT = 559, /* U64IMAGE2DRECT */
|
||||
I64IMAGECUBE = 560, /* I64IMAGECUBE */
|
||||
U64IMAGECUBE = 561, /* U64IMAGECUBE */
|
||||
I64IMAGEBUFFER = 562, /* I64IMAGEBUFFER */
|
||||
U64IMAGEBUFFER = 563, /* U64IMAGEBUFFER */
|
||||
I64IMAGE1DARRAY = 564, /* I64IMAGE1DARRAY */
|
||||
U64IMAGE1DARRAY = 565, /* U64IMAGE1DARRAY */
|
||||
I64IMAGE2DARRAY = 566, /* I64IMAGE2DARRAY */
|
||||
U64IMAGE2DARRAY = 567, /* U64IMAGE2DARRAY */
|
||||
I64IMAGECUBEARRAY = 568, /* I64IMAGECUBEARRAY */
|
||||
U64IMAGECUBEARRAY = 569, /* U64IMAGECUBEARRAY */
|
||||
I64IMAGE2DMS = 570, /* I64IMAGE2DMS */
|
||||
U64IMAGE2DMS = 571, /* U64IMAGE2DMS */
|
||||
I64IMAGE2DMSARRAY = 572, /* I64IMAGE2DMSARRAY */
|
||||
U64IMAGE2DMSARRAY = 573, /* U64IMAGE2DMSARRAY */
|
||||
TEXTURECUBEARRAY = 574, /* TEXTURECUBEARRAY */
|
||||
ITEXTURECUBEARRAY = 575, /* ITEXTURECUBEARRAY */
|
||||
UTEXTURECUBEARRAY = 576, /* UTEXTURECUBEARRAY */
|
||||
TEXTURE1D = 577, /* TEXTURE1D */
|
||||
ITEXTURE1D = 578, /* ITEXTURE1D */
|
||||
UTEXTURE1D = 579, /* UTEXTURE1D */
|
||||
TEXTURE1DARRAY = 580, /* TEXTURE1DARRAY */
|
||||
ITEXTURE1DARRAY = 581, /* ITEXTURE1DARRAY */
|
||||
UTEXTURE1DARRAY = 582, /* UTEXTURE1DARRAY */
|
||||
TEXTURE2DRECT = 583, /* TEXTURE2DRECT */
|
||||
ITEXTURE2DRECT = 584, /* ITEXTURE2DRECT */
|
||||
UTEXTURE2DRECT = 585, /* UTEXTURE2DRECT */
|
||||
TEXTUREBUFFER = 586, /* TEXTUREBUFFER */
|
||||
ITEXTUREBUFFER = 587, /* ITEXTUREBUFFER */
|
||||
UTEXTUREBUFFER = 588, /* UTEXTUREBUFFER */
|
||||
TEXTURE2DMS = 589, /* TEXTURE2DMS */
|
||||
ITEXTURE2DMS = 590, /* ITEXTURE2DMS */
|
||||
UTEXTURE2DMS = 591, /* UTEXTURE2DMS */
|
||||
TEXTURE2DMSARRAY = 592, /* TEXTURE2DMSARRAY */
|
||||
ITEXTURE2DMSARRAY = 593, /* ITEXTURE2DMSARRAY */
|
||||
UTEXTURE2DMSARRAY = 594, /* UTEXTURE2DMSARRAY */
|
||||
F16TEXTURE1D = 595, /* F16TEXTURE1D */
|
||||
F16TEXTURE2D = 596, /* F16TEXTURE2D */
|
||||
F16TEXTURE3D = 597, /* F16TEXTURE3D */
|
||||
F16TEXTURE2DRECT = 598, /* F16TEXTURE2DRECT */
|
||||
F16TEXTURECUBE = 599, /* F16TEXTURECUBE */
|
||||
F16TEXTURE1DARRAY = 600, /* F16TEXTURE1DARRAY */
|
||||
F16TEXTURE2DARRAY = 601, /* F16TEXTURE2DARRAY */
|
||||
F16TEXTURECUBEARRAY = 602, /* F16TEXTURECUBEARRAY */
|
||||
F16TEXTUREBUFFER = 603, /* F16TEXTUREBUFFER */
|
||||
F16TEXTURE2DMS = 604, /* F16TEXTURE2DMS */
|
||||
F16TEXTURE2DMSARRAY = 605, /* F16TEXTURE2DMSARRAY */
|
||||
SUBPASSINPUT = 606, /* SUBPASSINPUT */
|
||||
SUBPASSINPUTMS = 607, /* SUBPASSINPUTMS */
|
||||
ISUBPASSINPUT = 608, /* ISUBPASSINPUT */
|
||||
ISUBPASSINPUTMS = 609, /* ISUBPASSINPUTMS */
|
||||
USUBPASSINPUT = 610, /* USUBPASSINPUT */
|
||||
USUBPASSINPUTMS = 611, /* USUBPASSINPUTMS */
|
||||
F16SUBPASSINPUT = 612, /* F16SUBPASSINPUT */
|
||||
F16SUBPASSINPUTMS = 613, /* F16SUBPASSINPUTMS */
|
||||
SPIRV_INSTRUCTION = 614, /* SPIRV_INSTRUCTION */
|
||||
SPIRV_EXECUTION_MODE = 615, /* SPIRV_EXECUTION_MODE */
|
||||
SPIRV_EXECUTION_MODE_ID = 616, /* SPIRV_EXECUTION_MODE_ID */
|
||||
SPIRV_DECORATE = 617, /* SPIRV_DECORATE */
|
||||
SPIRV_DECORATE_ID = 618, /* SPIRV_DECORATE_ID */
|
||||
SPIRV_DECORATE_STRING = 619, /* SPIRV_DECORATE_STRING */
|
||||
SPIRV_TYPE = 620, /* SPIRV_TYPE */
|
||||
SPIRV_STORAGE_CLASS = 621, /* SPIRV_STORAGE_CLASS */
|
||||
SPIRV_BY_REFERENCE = 622, /* SPIRV_BY_REFERENCE */
|
||||
SPIRV_LITERAL = 623, /* SPIRV_LITERAL */
|
||||
ATTACHMENTEXT = 624, /* ATTACHMENTEXT */
|
||||
IATTACHMENTEXT = 625, /* IATTACHMENTEXT */
|
||||
UATTACHMENTEXT = 626, /* UATTACHMENTEXT */
|
||||
LEFT_OP = 627, /* LEFT_OP */
|
||||
RIGHT_OP = 628, /* RIGHT_OP */
|
||||
INC_OP = 629, /* INC_OP */
|
||||
DEC_OP = 630, /* DEC_OP */
|
||||
LE_OP = 631, /* LE_OP */
|
||||
GE_OP = 632, /* GE_OP */
|
||||
EQ_OP = 633, /* EQ_OP */
|
||||
NE_OP = 634, /* NE_OP */
|
||||
AND_OP = 635, /* AND_OP */
|
||||
OR_OP = 636, /* OR_OP */
|
||||
XOR_OP = 637, /* XOR_OP */
|
||||
MUL_ASSIGN = 638, /* MUL_ASSIGN */
|
||||
DIV_ASSIGN = 639, /* DIV_ASSIGN */
|
||||
ADD_ASSIGN = 640, /* ADD_ASSIGN */
|
||||
MOD_ASSIGN = 641, /* MOD_ASSIGN */
|
||||
LEFT_ASSIGN = 642, /* LEFT_ASSIGN */
|
||||
RIGHT_ASSIGN = 643, /* RIGHT_ASSIGN */
|
||||
AND_ASSIGN = 644, /* AND_ASSIGN */
|
||||
XOR_ASSIGN = 645, /* XOR_ASSIGN */
|
||||
OR_ASSIGN = 646, /* OR_ASSIGN */
|
||||
SUB_ASSIGN = 647, /* SUB_ASSIGN */
|
||||
STRING_LITERAL = 648, /* STRING_LITERAL */
|
||||
LEFT_PAREN = 649, /* LEFT_PAREN */
|
||||
RIGHT_PAREN = 650, /* RIGHT_PAREN */
|
||||
LEFT_BRACKET = 651, /* LEFT_BRACKET */
|
||||
RIGHT_BRACKET = 652, /* RIGHT_BRACKET */
|
||||
LEFT_BRACE = 653, /* LEFT_BRACE */
|
||||
RIGHT_BRACE = 654, /* RIGHT_BRACE */
|
||||
DOT = 655, /* DOT */
|
||||
COMMA = 656, /* COMMA */
|
||||
COLON = 657, /* COLON */
|
||||
EQUAL = 658, /* EQUAL */
|
||||
SEMICOLON = 659, /* SEMICOLON */
|
||||
BANG = 660, /* BANG */
|
||||
DASH = 661, /* DASH */
|
||||
TILDE = 662, /* TILDE */
|
||||
PLUS = 663, /* PLUS */
|
||||
STAR = 664, /* STAR */
|
||||
SLASH = 665, /* SLASH */
|
||||
PERCENT = 666, /* PERCENT */
|
||||
LEFT_ANGLE = 667, /* LEFT_ANGLE */
|
||||
RIGHT_ANGLE = 668, /* RIGHT_ANGLE */
|
||||
VERTICAL_BAR = 669, /* VERTICAL_BAR */
|
||||
CARET = 670, /* CARET */
|
||||
AMPERSAND = 671, /* AMPERSAND */
|
||||
QUESTION = 672, /* QUESTION */
|
||||
INVARIANT = 673, /* INVARIANT */
|
||||
HIGH_PRECISION = 674, /* HIGH_PRECISION */
|
||||
MEDIUM_PRECISION = 675, /* MEDIUM_PRECISION */
|
||||
LOW_PRECISION = 676, /* LOW_PRECISION */
|
||||
PRECISION = 677, /* PRECISION */
|
||||
PACKED = 678, /* PACKED */
|
||||
RESOURCE = 679, /* RESOURCE */
|
||||
SUPERP = 680, /* SUPERP */
|
||||
INLINE = 681, /* INLINE */
|
||||
NOINLINE = 682, /* NOINLINE */
|
||||
FLOATCONSTANT = 683, /* FLOATCONSTANT */
|
||||
INTCONSTANT = 684, /* INTCONSTANT */
|
||||
UINTCONSTANT = 685, /* UINTCONSTANT */
|
||||
BOOLCONSTANT = 686, /* BOOLCONSTANT */
|
||||
IDENTIFIER = 687, /* IDENTIFIER */
|
||||
TYPE_NAME = 688, /* TYPE_NAME */
|
||||
CENTROID = 689, /* CENTROID */
|
||||
IN = 690, /* IN */
|
||||
OUT = 691, /* OUT */
|
||||
INOUT = 692, /* INOUT */
|
||||
STRUCT = 693, /* STRUCT */
|
||||
VOID = 694, /* VOID */
|
||||
WHILE = 695, /* WHILE */
|
||||
BREAK = 696, /* BREAK */
|
||||
CONTINUE = 697, /* CONTINUE */
|
||||
DO = 698, /* DO */
|
||||
ELSE = 699, /* ELSE */
|
||||
FOR = 700, /* FOR */
|
||||
IF = 701, /* IF */
|
||||
DISCARD = 702, /* DISCARD */
|
||||
RETURN = 703, /* RETURN */
|
||||
SWITCH = 704, /* SWITCH */
|
||||
CASE = 705, /* CASE */
|
||||
DEFAULT = 706, /* DEFAULT */
|
||||
TERMINATE_INVOCATION = 707, /* TERMINATE_INVOCATION */
|
||||
TERMINATE_RAY = 708, /* TERMINATE_RAY */
|
||||
IGNORE_INTERSECTION = 709, /* IGNORE_INTERSECTION */
|
||||
UNIFORM = 710, /* UNIFORM */
|
||||
SHARED = 711, /* SHARED */
|
||||
BUFFER = 712, /* BUFFER */
|
||||
TILEIMAGEEXT = 713, /* TILEIMAGEEXT */
|
||||
FLAT = 714, /* FLAT */
|
||||
SMOOTH = 715, /* SMOOTH */
|
||||
LAYOUT = 716, /* LAYOUT */
|
||||
DOUBLECONSTANT = 717, /* DOUBLECONSTANT */
|
||||
INT16CONSTANT = 718, /* INT16CONSTANT */
|
||||
UINT16CONSTANT = 719, /* UINT16CONSTANT */
|
||||
FLOAT16CONSTANT = 720, /* FLOAT16CONSTANT */
|
||||
INT32CONSTANT = 721, /* INT32CONSTANT */
|
||||
UINT32CONSTANT = 722, /* UINT32CONSTANT */
|
||||
FLOATE2M1CONSTANT = 723, /* FLOATE2M1CONSTANT */
|
||||
FLOATE3M2CONSTANT = 724, /* FLOATE3M2CONSTANT */
|
||||
FLOATE2M3CONSTANT = 725, /* FLOATE2M3CONSTANT */
|
||||
FLOATUE8M0CONSTANT = 726, /* FLOATUE8M0CONSTANT */
|
||||
FLOATMXINT8CONSTANT = 727, /* FLOATMXINT8CONSTANT */
|
||||
INT64CONSTANT = 728, /* INT64CONSTANT */
|
||||
UINT64CONSTANT = 729, /* UINT64CONSTANT */
|
||||
SUBROUTINE = 730, /* SUBROUTINE */
|
||||
DEMOTE = 731, /* DEMOTE */
|
||||
FUNCTION = 732, /* FUNCTION */
|
||||
PAYLOADNV = 733, /* PAYLOADNV */
|
||||
PAYLOADINNV = 734, /* PAYLOADINNV */
|
||||
HITATTRNV = 735, /* HITATTRNV */
|
||||
CALLDATANV = 736, /* CALLDATANV */
|
||||
CALLDATAINNV = 737, /* CALLDATAINNV */
|
||||
PAYLOADEXT = 738, /* PAYLOADEXT */
|
||||
PAYLOADINEXT = 739, /* PAYLOADINEXT */
|
||||
HITATTREXT = 740, /* HITATTREXT */
|
||||
CALLDATAEXT = 741, /* CALLDATAEXT */
|
||||
CALLDATAINEXT = 742, /* CALLDATAINEXT */
|
||||
PATCH = 743, /* PATCH */
|
||||
SAMPLE = 744, /* SAMPLE */
|
||||
NONUNIFORM = 745, /* NONUNIFORM */
|
||||
RESOURCEHEAP = 746, /* RESOURCEHEAP */
|
||||
SAMPLERHEAP = 747, /* SAMPLERHEAP */
|
||||
COHERENT = 748, /* COHERENT */
|
||||
VOLATILE = 749, /* VOLATILE */
|
||||
RESTRICT = 750, /* RESTRICT */
|
||||
READONLY = 751, /* READONLY */
|
||||
WRITEONLY = 752, /* WRITEONLY */
|
||||
NONTEMPORAL = 753, /* NONTEMPORAL */
|
||||
DEVICECOHERENT = 754, /* DEVICECOHERENT */
|
||||
QUEUEFAMILYCOHERENT = 755, /* QUEUEFAMILYCOHERENT */
|
||||
WORKGROUPCOHERENT = 756, /* WORKGROUPCOHERENT */
|
||||
SUBGROUPCOHERENT = 757, /* SUBGROUPCOHERENT */
|
||||
NONPRIVATE = 758, /* NONPRIVATE */
|
||||
SHADERCALLCOHERENT = 759, /* SHADERCALLCOHERENT */
|
||||
NOPERSPECTIVE = 760, /* NOPERSPECTIVE */
|
||||
EXPLICITINTERPAMD = 761, /* EXPLICITINTERPAMD */
|
||||
PERVERTEXEXT = 762, /* PERVERTEXEXT */
|
||||
PERVERTEXNV = 763, /* PERVERTEXNV */
|
||||
PERPRIMITIVENV = 764, /* PERPRIMITIVENV */
|
||||
PERVIEWNV = 765, /* PERVIEWNV */
|
||||
PERTASKNV = 766, /* PERTASKNV */
|
||||
PERPRIMITIVEEXT = 767, /* PERPRIMITIVEEXT */
|
||||
TASKPAYLOADWORKGROUPEXT = 768, /* TASKPAYLOADWORKGROUPEXT */
|
||||
PRECISE = 769 /* PRECISE */
|
||||
};
|
||||
typedef enum yytokentype yytoken_kind_t;
|
||||
#endif
|
||||
@@ -586,7 +613,7 @@ union YYSTYPE
|
||||
glslang::TTypeParameters* typeParameters;
|
||||
} interm;
|
||||
|
||||
#line 590 "MachineIndependent/glslang_tab.cpp.h"
|
||||
#line 617 "MachineIndependent/glslang_tab.cpp.h"
|
||||
|
||||
};
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
||||
@@ -314,6 +314,30 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
|
||||
case EOpPackFloat2x16: out.debug << "packFloat2x16"; break;
|
||||
case EOpUnpackFloat2x16: out.debug << "unpackFloat2x16"; break;
|
||||
|
||||
case EOpUnpackFloat2xE2M1: out.debug << "unpackFloat2xfe2m1EXT"; break;
|
||||
case EOpUnpackFloat4xE2M1: out.debug << "unpackFloat4xfe2m1EXT"; break;
|
||||
case EOpUnpackFloat8xE2M1: out.debug << "unpackFloat8xfe2m1EXT"; break;
|
||||
case EOpUnpackFloat16xE2M1: out.debug << "unpackFloat16xfe2m1EXT"; break;
|
||||
case EOpPackFloat2xE2M1: out.debug << "packFloat2xfe2m1EXT"; break;
|
||||
case EOpPackFloat4xE2M1: out.debug << "packFloat4xfe2m1EXT"; break;
|
||||
case EOpPackFloat8xE2M1: out.debug << "packFloat8xfe2m1EXT"; break;
|
||||
case EOpPackFloat16xE2M1: out.debug << "packFloat16xfe2m1EXT"; break;
|
||||
case EOpUnpackFloat4xE3M2: out.debug << "unpackFloat4xfe3m2EXT"; break;
|
||||
case EOpUnpackFloat8xE3M2: out.debug << "unpackFloat8xfe3m2EXT"; break;
|
||||
case EOpUnpackFloat16xE3M2: out.debug << "unpackFloat16xfe3m2EXT"; break;
|
||||
case EOpPackFloat4xE3M2: out.debug << "packFloat4xfe3m2EXT"; break;
|
||||
case EOpPackFloat8xE3M2: out.debug << "packFloat8xfe3m2EXT"; break;
|
||||
case EOpPackFloat16xE3M2: out.debug << "packFloat16xfe3m2EXT"; break;
|
||||
case EOpUnpackFloat4xE2M3: out.debug << "unpackFloat4xfe2m3EXT"; break;
|
||||
case EOpUnpackFloat8xE2M3: out.debug << "unpackFloat8xfe2m3EXT"; break;
|
||||
case EOpUnpackFloat16xE2M3: out.debug << "unpackFloat16xfe2m3EXT"; break;
|
||||
case EOpPackFloat4xE2M3: out.debug << "packFloat4xfe2m3EXT"; break;
|
||||
case EOpPackFloat8xE2M3: out.debug << "packFloat8xfe2m3EXT"; break;
|
||||
case EOpPackFloat16xE2M3: out.debug << "packFloat16xfe2m3EXT"; break;
|
||||
case EOpBitcastExtractE2M1: out.debug << "bitcastExtractfe2m1EXT"; break;
|
||||
case EOpBitcastExtractE3M2: out.debug << "bitcastExtractfe3m2EXT"; break;
|
||||
case EOpBitcastExtractE2M3: out.debug << "bitcastExtractfe2m3EXT"; break;
|
||||
|
||||
case EOpLength: out.debug << "length"; break;
|
||||
case EOpNormalize: out.debug << "normalize"; break;
|
||||
case EOpDPdx: out.debug << "dPdx"; break;
|
||||
@@ -638,6 +662,26 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpConstructFloatE4M3Vec2: out.debug << "Construct fe4m3vec2"; break;
|
||||
case EOpConstructFloatE4M3Vec3: out.debug << "Construct fe4m3vec3"; break;
|
||||
case EOpConstructFloatE4M3Vec4: out.debug << "Construct fe4m3vec4"; break;
|
||||
case EOpConstructFloatE2M1: out.debug << "Construct floate2m1_t"; break;
|
||||
case EOpConstructFloatE2M1Vec2: out.debug << "Construct fe2m1vec2"; break;
|
||||
case EOpConstructFloatE2M1Vec3: out.debug << "Construct fe2m1vec3"; break;
|
||||
case EOpConstructFloatE2M1Vec4: out.debug << "Construct fe2m1vec4"; break;
|
||||
case EOpConstructFloatE3M2: out.debug << "Construct floate3m2_t"; break;
|
||||
case EOpConstructFloatE3M2Vec2: out.debug << "Construct fe3m2vec2"; break;
|
||||
case EOpConstructFloatE3M2Vec3: out.debug << "Construct fe3m2vec3"; break;
|
||||
case EOpConstructFloatE3M2Vec4: out.debug << "Construct fe3m2vec4"; break;
|
||||
case EOpConstructFloatE2M3: out.debug << "Construct floate2m3_t"; break;
|
||||
case EOpConstructFloatE2M3Vec2: out.debug << "Construct fe2m3vec2"; break;
|
||||
case EOpConstructFloatE2M3Vec3: out.debug << "Construct fe2m3vec3"; break;
|
||||
case EOpConstructFloatE2M3Vec4: out.debug << "Construct fe2m3vec4"; break;
|
||||
case EOpConstructFloatUE8M0: out.debug << "Construct floatue8m0_t"; break;
|
||||
case EOpConstructFloatUE8M0Vec2: out.debug << "Construct fue8m0vec2"; break;
|
||||
case EOpConstructFloatUE8M0Vec3: out.debug << "Construct fue8m0vec3"; break;
|
||||
case EOpConstructFloatUE8M0Vec4: out.debug << "Construct fue8m0vec4"; break;
|
||||
case EOpConstructFloatMXINT8: out.debug << "Construct floatmxint8_t"; break;
|
||||
case EOpConstructFloatMXINT8Vec2: out.debug << "Construct fmxint8vec2"; break;
|
||||
case EOpConstructFloatMXINT8Vec3: out.debug << "Construct fmxint8vec3"; break;
|
||||
case EOpConstructFloatMXINT8Vec4: out.debug << "Construct fmxint8vec4"; break;
|
||||
case EOpConstructFloat16: out.debug << "Construct float16_t"; break;
|
||||
case EOpConstructF16Vec2: out.debug << "Construct f16vec2"; break;
|
||||
case EOpConstructF16Vec3: out.debug << "Construct f16vec3"; break;
|
||||
@@ -806,6 +850,14 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpSparseTextureGatherLodOffset: out.debug << "sparseTextureGatherLodOffset"; break;
|
||||
case EOpSparseTextureGatherLodOffsets: out.debug << "sparseTextureGatherLodOffsets"; break;
|
||||
case EOpSparseImageLoadLod: out.debug << "sparseImageLoadLod"; break;
|
||||
case EOpTextureGather4x1QCOM: out.debug << "textureGather4x1QCOM"; break;
|
||||
case EOpTextureGatherV2QCOM: out.debug << "textureGatherV2QCOM"; break;
|
||||
case EOpTextureGatherH2QCOM: out.debug << "textureGatherH2QCOM"; break;
|
||||
case EOpTextureGatherDQCOM: out.debug << "textureGatherDQCOM"; break;
|
||||
case EOpTextureGather4x1OffsetQCOM: out.debug << "textureGather4x1OffsetQCOM"; break;
|
||||
case EOpTextureGatherV2OffsetQCOM: out.debug << "textureGatherV2OffsetQCOM"; break;
|
||||
case EOpTextureGatherH2OffsetQCOM: out.debug << "textureGatherH2OffsetQCOM"; break;
|
||||
case EOpTextureGatherDOffsetQCOM: out.debug << "textureGatherDOffsetQCOM"; break;
|
||||
case EOpImageSampleFootprintNV: out.debug << "imageSampleFootprintNV"; break;
|
||||
case EOpImageSampleFootprintClampNV: out.debug << "imageSampleFootprintClampNV"; break;
|
||||
case EOpImageSampleFootprintLodNV: out.debug << "imageSampleFootprintLodNV"; break;
|
||||
@@ -981,6 +1033,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
|
||||
case EOpCooperativeMatrixReduceNV: out.debug << "Reduce cooperative matrices"; break;
|
||||
case EOpCooperativeMatrixPerElementOpNV: out.debug << "cooperative matrix per element op"; break;
|
||||
case EOpCooperativeMatrixTransposeNV: out.debug << "Transpose cooperative matrix"; break;
|
||||
case EOpCooperativeMatrixGetCoordinateEXT: out.debug << "Cooperative matrix get coordinate"; break;
|
||||
|
||||
case EOpCooperativeVectorMatMulNV: out.debug << "Cooperative vector matrix multiply NV"; break;
|
||||
case EOpCooperativeVectorMatMulAddNV: out.debug << "Cooperative vector matrix multiply add NV"; break;
|
||||
@@ -1185,6 +1238,11 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const
|
||||
case EbtBFloat16:
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatE2M1:
|
||||
case EbtFloatE3M2:
|
||||
case EbtFloatE2M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
OutputDouble(out, constUnion[i].getDConst(), extra);
|
||||
out.debug << "\n";
|
||||
break;
|
||||
|
||||
+58
-76
@@ -61,83 +61,53 @@
|
||||
|
||||
namespace glslang {
|
||||
|
||||
struct TVarEntryInfo {
|
||||
long long id;
|
||||
TIntermSymbol* symbol;
|
||||
bool live;
|
||||
TLayoutPacking upgradedToPushConstantPacking; // ElpNone means it hasn't been upgraded
|
||||
int newBinding;
|
||||
int newSet;
|
||||
int newLocation;
|
||||
int newComponent;
|
||||
int newIndex;
|
||||
EShLanguage stage;
|
||||
static int getLayoutSetLimit(bool relaxSetBindingLimits)
|
||||
{
|
||||
return relaxSetBindingLimits ? INT_MAX : int(TQualifier::layoutSetEnd);
|
||||
}
|
||||
|
||||
void clearNewAssignments() {
|
||||
upgradedToPushConstantPacking = ElpNone;
|
||||
newBinding = -1;
|
||||
newSet = -1;
|
||||
newLocation = -1;
|
||||
newComponent = -1;
|
||||
newIndex = -1;
|
||||
}
|
||||
static int getLayoutBindingLimit(bool relaxSetBindingLimits)
|
||||
{
|
||||
return relaxSetBindingLimits ? INT_MAX : int(TQualifier::layoutBindingEnd);
|
||||
}
|
||||
|
||||
struct TOrderById {
|
||||
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; }
|
||||
};
|
||||
bool TVarEntryInfo::TOrderByPriority::operator()(const TVarEntryInfo& l, const TVarEntryInfo& r)
|
||||
{
|
||||
const TQualifier& lq = l.symbol->getQualifier();
|
||||
const TQualifier& rq = r.symbol->getQualifier();
|
||||
|
||||
struct TOrderByPriority {
|
||||
// ordering:
|
||||
// 1) has both binding and set
|
||||
// 2) has binding but no set
|
||||
// 3) has no binding but set
|
||||
// 4) has no binding and no set
|
||||
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) {
|
||||
const TQualifier& lq = l.symbol->getQualifier();
|
||||
const TQualifier& rq = r.symbol->getQualifier();
|
||||
// simple rules:
|
||||
// has binding gives 2 points
|
||||
// has set gives 1 point
|
||||
// who has the most points is more important.
|
||||
int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0);
|
||||
int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0);
|
||||
|
||||
// simple rules:
|
||||
// has binding gives 2 points
|
||||
// has set gives 1 point
|
||||
// who has the most points is more important.
|
||||
int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0);
|
||||
int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0);
|
||||
if (lPoints == rPoints)
|
||||
return l.id < r.id;
|
||||
return lPoints > rPoints;
|
||||
}
|
||||
|
||||
if (lPoints == rPoints)
|
||||
return l.id < r.id;
|
||||
return lPoints > rPoints;
|
||||
}
|
||||
};
|
||||
bool TVarEntryInfo::TOrderByPriorityAndLive::operator()(const TVarEntryInfo& l, const TVarEntryInfo& r)
|
||||
{
|
||||
const TQualifier& lq = l.symbol->getQualifier();
|
||||
const TQualifier& rq = r.symbol->getQualifier();
|
||||
|
||||
struct TOrderByPriorityAndLive {
|
||||
// ordering:
|
||||
// 1) do live variables first
|
||||
// 2) has both binding and set
|
||||
// 3) has binding but no set
|
||||
// 4) has no binding but set
|
||||
// 5) has no binding and no set
|
||||
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) {
|
||||
// simple rules:
|
||||
// has binding gives 2 points
|
||||
// has set gives 1 point
|
||||
// who has the most points is more important.
|
||||
int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0);
|
||||
int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0);
|
||||
|
||||
const TQualifier& lq = l.symbol->getQualifier();
|
||||
const TQualifier& rq = r.symbol->getQualifier();
|
||||
if (l.live != r.live)
|
||||
return l.live > r.live;
|
||||
|
||||
// simple rules:
|
||||
// has binding gives 2 points
|
||||
// has set gives 1 point
|
||||
// who has the most points is more important.
|
||||
int lPoints = (lq.hasBinding() ? 2 : 0) + (lq.hasSet() ? 1 : 0);
|
||||
int rPoints = (rq.hasBinding() ? 2 : 0) + (rq.hasSet() ? 1 : 0);
|
||||
if (lPoints != rPoints)
|
||||
return lPoints > rPoints;
|
||||
|
||||
if (l.live != r.live)
|
||||
return l.live > r.live;
|
||||
|
||||
if (lPoints != rPoints)
|
||||
return lPoints > rPoints;
|
||||
|
||||
return l.id < r.id;
|
||||
}
|
||||
};
|
||||
};
|
||||
return l.id < r.id;
|
||||
}
|
||||
|
||||
// override function "operator=", if a vector<const _Kty, _Ty> being sort,
|
||||
// when use vc++, the sort function will call :
|
||||
@@ -298,11 +268,13 @@ private:
|
||||
};
|
||||
|
||||
struct TResolverUniformAdaptor {
|
||||
TResolverUniformAdaptor(EShLanguage s, TIoMapResolver& r, TVarLiveMap* uniform[EShLangCount], TInfoSink& i, bool& e)
|
||||
TResolverUniformAdaptor(EShLanguage s, TIoMapResolver& r, TVarLiveMap* uniform[EShLangCount], TInfoSink& i,
|
||||
bool& e, bool relaxSetBindingLimits)
|
||||
: stage(s)
|
||||
, resolver(r)
|
||||
, infoSink(i)
|
||||
, error(e)
|
||||
, relaxSetBindingLimits(relaxSetBindingLimits)
|
||||
{
|
||||
memcpy(uniformVarMap, uniform, EShLangCount * (sizeof(TVarLiveMap*)));
|
||||
}
|
||||
@@ -317,7 +289,7 @@ struct TResolverUniformAdaptor {
|
||||
resolver.resolveUniformLocation(ent.stage, ent);
|
||||
|
||||
if (ent.newBinding != -1) {
|
||||
if (ent.newBinding >= int(TQualifier::layoutBindingEnd)) {
|
||||
if (ent.newBinding < 0 || ent.newBinding >= getLayoutBindingLimit(relaxSetBindingLimits)) {
|
||||
TString err = "mapped binding out of range: " + entKey.first;
|
||||
|
||||
infoSink.info.message(EPrefixInternalError, err.c_str());
|
||||
@@ -336,7 +308,7 @@ struct TResolverUniformAdaptor {
|
||||
}
|
||||
}
|
||||
if (ent.newSet != -1) {
|
||||
if (ent.newSet >= int(TQualifier::layoutSetEnd)) {
|
||||
if (ent.newSet < 0 || ent.newSet >= getLayoutSetLimit(relaxSetBindingLimits)) {
|
||||
TString err = "mapped set out of range: " + entKey.first;
|
||||
|
||||
infoSink.info.message(EPrefixInternalError, err.c_str());
|
||||
@@ -366,6 +338,7 @@ struct TResolverUniformAdaptor {
|
||||
TIoMapResolver& resolver;
|
||||
TInfoSink& infoSink;
|
||||
bool& error;
|
||||
bool relaxSetBindingLimits;
|
||||
TVarLiveMap* uniformVarMap[EShLangCount];
|
||||
private:
|
||||
TResolverUniformAdaptor& operator=(TResolverUniformAdaptor&) = delete;
|
||||
@@ -674,7 +647,7 @@ struct TSymbolValidater
|
||||
} else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant()) {
|
||||
// validate uniform type;
|
||||
for (int i = 0; i < EShLangCount; i++) {
|
||||
if (i != currentStage && outVarMaps[i] != nullptr) {
|
||||
if (i != currentStage && uniformVarMap[i] != nullptr) {
|
||||
auto ent2 = uniformVarMap[i]->find(name);
|
||||
if (ent2 != uniformVarMap[i]->end()) {
|
||||
ent2->second.symbol->getType().appendMangledName(mangleName2);
|
||||
@@ -1349,6 +1322,12 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink&
|
||||
const TType& type = ent.symbol->getType();
|
||||
const TString& name = ent.symbol->getAccessName();
|
||||
TResourceType resource = getResourceType(type);
|
||||
// getResourceType() returns EResCount for types that are not a binding-based
|
||||
// resource (e.g. atomic_uint). Those don't own a resourceSlotMap/slots row, so
|
||||
// indexing by EResCount would run off the end of those arrays. resolveBinding()
|
||||
// guards the same way.
|
||||
if (resource >= EResCount)
|
||||
return;
|
||||
int set = referenceIntermediate.getSpv().openGl != 0 ? 0 : resolveSet(ent.stage, ent);
|
||||
int resourceKey = referenceIntermediate.getSpv().openGl != 0 || referenceIntermediate.getBindingsPerResourceType() ? resource : 0;
|
||||
|
||||
@@ -1594,7 +1573,8 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TInfoSi
|
||||
TVarLiveMap* dummyUniformVarMap[EShLangCount] = {};
|
||||
TNotifyInOutAdaptor inOutNotify(stage, *resolver);
|
||||
TNotifyUniformAdaptor uniformNotify(stage, *resolver);
|
||||
TResolverUniformAdaptor uniformResolve(stage, *resolver, dummyUniformVarMap, infoSink, hadError);
|
||||
TResolverUniformAdaptor uniformResolve(stage, *resolver, dummyUniformVarMap, infoSink, hadError,
|
||||
intermediate.getRelaxSetBindingLimits());
|
||||
TResolverInOutAdaptor inOutResolve(stage, *resolver, infoSink, hadError);
|
||||
resolver->beginNotifications(stage);
|
||||
std::for_each(inVector.begin(), inVector.end(), inOutNotify);
|
||||
@@ -1670,6 +1650,7 @@ bool TGlslIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TIn
|
||||
// Profile and version are use for symbol validate.
|
||||
profile = intermediate.getProfile();
|
||||
version = intermediate.getVersion();
|
||||
relaxSetBindingLimits |= intermediate.getRelaxSetBindingLimits();
|
||||
|
||||
// Restrict the stricter condition to further check 'somethingToDo' only if 'somethingToDo' has not been set, reduce
|
||||
// unnecessary or insignificant for-loop operation after 'somethingToDo' have been true.
|
||||
@@ -1741,7 +1722,8 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
|
||||
resolver->endResolve(EShLangCount);
|
||||
if (!hadError) {
|
||||
//Resolve uniform location, ubo/ssbo/opaque bindings across stages
|
||||
TResolverUniformAdaptor uniformResolve(EShLangCount, *resolver, uniformVarMap, infoSink, hadError);
|
||||
TResolverUniformAdaptor uniformResolve(EShLangCount, *resolver, uniformVarMap, infoSink, hadError,
|
||||
relaxSetBindingLimits);
|
||||
TResolverInOutAdaptor inOutResolve(EShLangCount, *resolver, infoSink, hadError);
|
||||
TSymbolValidater symbolValidater(*resolver, infoSink, inVarMaps,
|
||||
outVarMaps, uniformVarMap, hadError, profile, version);
|
||||
@@ -1824,7 +1806,7 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
|
||||
qualifier.setBlockStorage(EbsPushConstant);
|
||||
qualifier.layoutPacking = autoPushConstantBlockPacking;
|
||||
// Push constants don't have set/binding etc. decorations, remove those.
|
||||
qualifier.layoutSet = TQualifier::layoutSetEnd;
|
||||
qualifier.layoutSet = TQualifier::layoutNotSet;
|
||||
at->second.clearNewAssignments();
|
||||
|
||||
upgraded = true;
|
||||
@@ -1839,7 +1821,7 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
|
||||
[this](TVarLivePair& p) {
|
||||
if (p.first == autoPushConstantBlockName) {
|
||||
p.second.upgradedToPushConstantPacking = autoPushConstantBlockPacking;
|
||||
p.second.newSet = TQualifier::layoutSetEnd;
|
||||
p.second.newSet = TQualifier::layoutNotSet;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+4
-3
@@ -85,9 +85,9 @@ public:
|
||||
int resolveInOutComponent(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
int resolveInOutIndex(EShLanguage /*stage*/, TVarEntryInfo& ent) override;
|
||||
void addStage(EShLanguage stage, TIntermediate& stageIntermediate) override {
|
||||
if (stage < EShLangCount) {
|
||||
stageMask[stage] = true;
|
||||
stageIntermediates[stage] = &stageIntermediate;
|
||||
if ((unsigned)stage < EShLangCount) {
|
||||
stageMask[(unsigned)stage] = true;
|
||||
stageIntermediates[(unsigned)stage] = &stageIntermediate;
|
||||
}
|
||||
}
|
||||
uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage);
|
||||
@@ -228,6 +228,7 @@ public:
|
||||
bool doMap(TIoMapResolver*, TInfoSink&) override;
|
||||
TIntermediate* intermediates[EShLangCount];
|
||||
bool hadError = false;
|
||||
bool relaxSetBindingLimits = false;
|
||||
EProfile profile;
|
||||
int version;
|
||||
|
||||
|
||||
@@ -2419,6 +2419,8 @@ int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
|
||||
case EbtBFloat16: size = 2; return 2;
|
||||
case EbtFloatE5M2:
|
||||
case EbtFloatE4M3:
|
||||
case EbtFloatUE8M0:
|
||||
case EbtFloatMXINT8:
|
||||
case EbtInt8:
|
||||
case EbtUint8: size = 1; return 1;
|
||||
case EbtInt16:
|
||||
@@ -2752,6 +2754,8 @@ int TIntermediate::getBlockSize(const TType& blockType)
|
||||
{
|
||||
const TTypeList& memberList = *blockType.getStruct();
|
||||
int lastIndex = (int)memberList.size() - 1;
|
||||
if (lastIndex < 0)
|
||||
return 0;
|
||||
int lastOffset = getOffset(blockType, lastIndex);
|
||||
|
||||
int lastMemberSize;
|
||||
|
||||
+53
-12
@@ -313,14 +313,15 @@ public:
|
||||
useStorageBuffer(false),
|
||||
invariantAll(false),
|
||||
nanMinMaxClamp(false),
|
||||
discardIsTerminate(false),
|
||||
depthReplacing(false),
|
||||
stencilReplacing(false),
|
||||
uniqueId(0),
|
||||
globalUniformBlockName(""),
|
||||
atomicCounterBlockName(""),
|
||||
globalUniformBlockSet(TQualifier::layoutSetEnd),
|
||||
globalUniformBlockBinding(TQualifier::layoutBindingEnd),
|
||||
atomicCounterBlockSet(TQualifier::layoutSetEnd),
|
||||
globalUniformBlockSet(TQualifier::layoutNotSet),
|
||||
globalUniformBlockBinding(TQualifier::layoutNotSet),
|
||||
atomicCounterBlockSet(TQualifier::layoutNotSet),
|
||||
implicitThisName("@this"), implicitCounterName("@count"),
|
||||
source(EShSourceNone),
|
||||
useVulkanMemoryModel(false),
|
||||
@@ -344,10 +345,14 @@ public:
|
||||
primitives(TQualifier::layoutNotSet),
|
||||
numTaskNVBlocks(0),
|
||||
layoutPrimitiveCulling(false),
|
||||
usesOpacityMicromap2StateFlag(false),
|
||||
enableOpacityMicromapSpecId(TQualifier::layoutNotSet),
|
||||
enableOpacityMicromapDefault(false),
|
||||
numTaskEXTPayloads(0),
|
||||
nonCoherentTileAttachmentReadQCOM(false),
|
||||
autoMapBindings(false),
|
||||
autoMapLocations(false),
|
||||
relaxSetBindingLimits(false),
|
||||
flattenUniformArrays(false),
|
||||
useUnknownFormat(false),
|
||||
hlslOffsets(false),
|
||||
@@ -519,6 +524,14 @@ public:
|
||||
}
|
||||
bool getEnhancedMsgs() const { return enhancedMsgs && getSource() == EShSourceGlsl; }
|
||||
|
||||
void setDiscardIsTerminate(bool discardIsTerminateP)
|
||||
{
|
||||
discardIsTerminate = discardIsTerminateP;
|
||||
if (discardIsTerminate)
|
||||
processes.addProcess("discard-is-terminate");
|
||||
}
|
||||
bool getDiscardIsTerminate() const { return discardIsTerminate; }
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
void setSource(EShSource s) { source = s; }
|
||||
EShSource getSource() const { return source; }
|
||||
@@ -610,15 +623,15 @@ public:
|
||||
|
||||
void setGlobalUniformBlockName(const char* name) { globalUniformBlockName = std::string(name); }
|
||||
const char* getGlobalUniformBlockName() const { return globalUniformBlockName.c_str(); }
|
||||
void setGlobalUniformSet(unsigned int set) { globalUniformBlockSet = set; }
|
||||
unsigned int getGlobalUniformSet() const { return globalUniformBlockSet; }
|
||||
void setGlobalUniformBinding(unsigned int binding) { globalUniformBlockBinding = binding; }
|
||||
unsigned int getGlobalUniformBinding() const { return globalUniformBlockBinding; }
|
||||
void setGlobalUniformSet(unsigned int set) { globalUniformBlockSet = static_cast<int>(set); }
|
||||
int getGlobalUniformSet() const { return globalUniformBlockSet; }
|
||||
void setGlobalUniformBinding(unsigned int binding) { globalUniformBlockBinding = static_cast<int>(binding); }
|
||||
int getGlobalUniformBinding() const { return globalUniformBlockBinding; }
|
||||
|
||||
void setAtomicCounterBlockName(const char* name) { atomicCounterBlockName = std::string(name); }
|
||||
const char* getAtomicCounterBlockName() const { return atomicCounterBlockName.c_str(); }
|
||||
void setAtomicCounterBlockSet(unsigned int set) { atomicCounterBlockSet = set; }
|
||||
unsigned int getAtomicCounterBlockSet() const { return atomicCounterBlockSet; }
|
||||
void setAtomicCounterBlockSet(unsigned int set) { atomicCounterBlockSet = static_cast<int>(set); }
|
||||
int getAtomicCounterBlockSet() const { return atomicCounterBlockSet; }
|
||||
|
||||
|
||||
void setUseStorageBuffer() { useStorageBuffer = true; }
|
||||
@@ -734,6 +747,13 @@ public:
|
||||
processes.addProcess("auto-map-locations");
|
||||
}
|
||||
bool getAutoMapLocations() const { return autoMapLocations; }
|
||||
void setRelaxSetBindingLimits(bool relax)
|
||||
{
|
||||
relaxSetBindingLimits = relax;
|
||||
if (relaxSetBindingLimits)
|
||||
processes.addProcess("relax-set-binding-limits");
|
||||
}
|
||||
bool getRelaxSetBindingLimits() const { return relaxSetBindingLimits; }
|
||||
|
||||
#ifdef ENABLE_HLSL
|
||||
void setFlattenUniformArrays(bool flatten)
|
||||
@@ -996,6 +1016,18 @@ public:
|
||||
TDerivativeGroupExtension getLayoutDerivativeExtension() const { return computeDerivativeExtension; }
|
||||
void setLayoutPrimitiveCulling() { layoutPrimitiveCulling = true; }
|
||||
bool getLayoutPrimitiveCulling() const { return layoutPrimitiveCulling; }
|
||||
void setUsesOpacityMicromap2StateFlag() { usesOpacityMicromap2StateFlag = true; }
|
||||
bool getUsesOpacityMicromap2StateFlag() const { return usesOpacityMicromap2StateFlag; }
|
||||
// GL_EXT_opacity_micromap_ray_query_mode: state for the gl_EnableOpacityMicromapEXT built-in. When
|
||||
// the extension is enabled the SPIR-V generator emits the OpacityMicromapIdKHR execution mode; the
|
||||
// operand id depends on how the built-in was (re)declared:
|
||||
// - redeclared with a constant_id -> OpSpecConstantFalse decorated with that SpecId
|
||||
// - redeclared 'const bool = true' -> OpConstantTrue (enableOpacityMicromapDefault == true)
|
||||
// - otherwise (default or '= false') -> OpConstantFalse
|
||||
void setEnableOpacityMicromapSpecId(int id) { enableOpacityMicromapSpecId = id; }
|
||||
int getEnableOpacityMicromapSpecId() const { return enableOpacityMicromapSpecId; }
|
||||
void setEnableOpacityMicromapDefault(bool v) { enableOpacityMicromapDefault = v; }
|
||||
bool getEnableOpacityMicromapDefault() const { return enableOpacityMicromapDefault; }
|
||||
bool setPrimitives(int m)
|
||||
{
|
||||
if (primitives != TQualifier::layoutNotSet)
|
||||
@@ -1093,6 +1125,10 @@ public:
|
||||
return IsRequestedExtension(E_GL_EXT_texture_offset_non_const);
|
||||
}
|
||||
|
||||
bool usingCoopMatMaint1() const {
|
||||
return IsRequestedExtension(E_GL_EXT_cooperative_matrix_maintenance1);
|
||||
}
|
||||
|
||||
bool IsRequestedExtension(const char* extension) const
|
||||
{
|
||||
return (requestedExtensions.find(extension) != requestedExtensions.end());
|
||||
@@ -1247,6 +1283,7 @@ protected:
|
||||
bool useStorageBuffer;
|
||||
bool invariantAll;
|
||||
bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN
|
||||
bool discardIsTerminate; // true if discard should be emitted as OpTerminateInvocation instead of OpDemoteToHelperInvocation
|
||||
bool depthReplacing;
|
||||
bool stencilReplacing;
|
||||
int localSize[3];
|
||||
@@ -1256,9 +1293,9 @@ protected:
|
||||
|
||||
std::string globalUniformBlockName;
|
||||
std::string atomicCounterBlockName;
|
||||
unsigned int globalUniformBlockSet;
|
||||
unsigned int globalUniformBlockBinding;
|
||||
unsigned int atomicCounterBlockSet;
|
||||
int globalUniformBlockSet;
|
||||
int globalUniformBlockBinding;
|
||||
int atomicCounterBlockSet;
|
||||
|
||||
public:
|
||||
const char* const implicitThisName;
|
||||
@@ -1298,6 +1335,9 @@ protected:
|
||||
int primitives;
|
||||
int numTaskNVBlocks;
|
||||
bool layoutPrimitiveCulling;
|
||||
bool usesOpacityMicromap2StateFlag;
|
||||
int enableOpacityMicromapSpecId;
|
||||
bool enableOpacityMicromapDefault;
|
||||
int numTaskEXTPayloads;
|
||||
|
||||
bool nonCoherentTileAttachmentReadQCOM;
|
||||
@@ -1313,6 +1353,7 @@ protected:
|
||||
std::vector<std::string> resourceSetBinding;
|
||||
bool autoMapBindings;
|
||||
bool autoMapLocations;
|
||||
bool relaxSetBindingLimits;
|
||||
bool flattenUniformArrays;
|
||||
bool useUnknownFormat;
|
||||
bool hlslOffsets;
|
||||
|
||||
@@ -106,6 +106,11 @@ public:
|
||||
virtual void bfloat16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floate5m2ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floate4m3ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floate2m1ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floate3m2ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floate2m3ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floatue8m0ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual void floatmxint8ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
virtual bool float16Arithmetic();
|
||||
virtual void requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc);
|
||||
virtual void int16ScalarVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false);
|
||||
@@ -132,6 +137,7 @@ public:
|
||||
virtual void tensorCheckARM(const TSourceLoc&, const char *op, bool builtIn = false);
|
||||
bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; }
|
||||
bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
|
||||
bool relaxSetBindingLimits() const { return (messages & EShMsgRelaxSetBindingLimits) != 0; }
|
||||
bool isForwardCompatible() const { return forwardCompatible; }
|
||||
|
||||
virtual void spvRemoved(const TSourceLoc&, const char* op);
|
||||
|
||||
@@ -316,7 +316,8 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken)
|
||||
}
|
||||
} else if (nextAtom == PpAtomEndif) {
|
||||
token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken));
|
||||
elseSeen[elsetracker] = false;
|
||||
if (elsetracker >= 0)
|
||||
elseSeen[elsetracker] = false;
|
||||
--elsetracker;
|
||||
if (depth == 0) {
|
||||
// found the #endif we are looking for
|
||||
@@ -325,7 +326,8 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken)
|
||||
break;
|
||||
}
|
||||
--depth;
|
||||
--ifdepth;
|
||||
if (ifdepth > 0)
|
||||
--ifdepth;
|
||||
} else if (matchelse && depth == 0) {
|
||||
if (nextAtom == PpAtomElse) {
|
||||
elseSeen[elsetracker] = true;
|
||||
@@ -412,11 +414,15 @@ namespace {
|
||||
int op_le(int a, int b) { return a <= b; }
|
||||
int op_gt(int a, int b) { return a > b; }
|
||||
int op_lt(int a, int b) { return a < b; }
|
||||
int op_shl(int a, int b) { return a << b; }
|
||||
int op_shr(int a, int b) { return a >> b; }
|
||||
int op_add(int a, int b) { return a + b; }
|
||||
int op_sub(int a, int b) { return a - b; }
|
||||
int op_mul(int a, int b) { return a * b; }
|
||||
// #if expressions are evaluated in 32-bit signed integers, so a shift count
|
||||
// coming from the source can be out of range, and +, - and * can overflow.
|
||||
// Both are undefined in C++, so give them a defined result here.
|
||||
const int intBits = (int)(sizeof(int) * CHAR_BIT);
|
||||
int op_shl(int a, int b) { return b < 0 || b >= intBits ? 0 : (int)((unsigned)a << b); }
|
||||
int op_shr(int a, int b) { return b < 0 || b >= intBits ? (a < 0 ? -1 : 0) : a >> b; }
|
||||
int op_add(int a, int b) { return (int)((unsigned)a + (unsigned)b); }
|
||||
int op_sub(int a, int b) { return (int)((unsigned)a - (unsigned)b); }
|
||||
int op_mul(int a, int b) { return (int)((unsigned)a * (unsigned)b); }
|
||||
int op_div(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a / b; }
|
||||
int op_mod(int a, int b) { return a == INT_MIN && b == -1 ? 0 : a % b; }
|
||||
int op_pos(int a) { return a; }
|
||||
@@ -634,7 +640,7 @@ int TPpContext::CPPif(TPpToken* ppToken)
|
||||
int TPpContext::CPPifdef(int defined, TPpToken* ppToken)
|
||||
{
|
||||
int token = scanToken(ppToken);
|
||||
if (ifdepth > maxIfNesting || elsetracker > maxIfNesting) {
|
||||
if (ifdepth >= maxIfNesting || elsetracker >= maxIfNesting) {
|
||||
parseContext.ppError(ppToken->loc, "maximum nesting depth exceeded", "#ifdef", "");
|
||||
return EndOfInput;
|
||||
} else {
|
||||
@@ -821,6 +827,11 @@ int TPpContext::CPPerror(TPpToken* ppToken)
|
||||
token == PpAtomConstInt || token == PpAtomConstUint ||
|
||||
token == PpAtomConstInt64 || token == PpAtomConstUint64 ||
|
||||
token == PpAtomConstFloat16 ||
|
||||
token == PpAtomConstFloatE2M1 ||
|
||||
token == PpAtomConstFloatE3M2 ||
|
||||
token == PpAtomConstFloatE2M3 ||
|
||||
token == PpAtomConstFloatUE8M0 ||
|
||||
token == PpAtomConstFloatMXINT8 ||
|
||||
token == PpAtomConstFloat || token == PpAtomConstDouble) {
|
||||
message.append(ppToken->name);
|
||||
} else if (token == PpAtomIdentifier || token == PpAtomConstString) {
|
||||
@@ -858,6 +869,11 @@ int TPpContext::CPPpragma(TPpToken* ppToken)
|
||||
case PpAtomConstFloat:
|
||||
case PpAtomConstDouble:
|
||||
case PpAtomConstFloat16:
|
||||
case PpAtomConstFloatE2M1:
|
||||
case PpAtomConstFloatE3M2:
|
||||
case PpAtomConstFloatE2M3:
|
||||
case PpAtomConstFloatUE8M0:
|
||||
case PpAtomConstFloatMXINT8:
|
||||
tokens.push_back(ppToken->name);
|
||||
break;
|
||||
default:
|
||||
@@ -998,7 +1014,8 @@ int TPpContext::readCPPline(TPpToken* ppToken)
|
||||
if (ifdepth == 0)
|
||||
parseContext.ppError(ppToken->loc, "mismatched statements", "#endif", "");
|
||||
else {
|
||||
elseSeen[elsetracker] = false;
|
||||
if (elsetracker >= 0)
|
||||
elseSeen[elsetracker] = false;
|
||||
--elsetracker;
|
||||
--ifdepth;
|
||||
}
|
||||
@@ -1224,6 +1241,20 @@ MacroExpandResult TPpContext::MacroExpand(TPpToken* ppToken, bool expandUndef, b
|
||||
{
|
||||
ppToken->space = false;
|
||||
int macroAtom = atomStrings.getAtom(ppToken->name);
|
||||
|
||||
// Bound total MacroExpand nesting depth to prevent stack overflow
|
||||
// via unbounded MacroExpand <-> PrescanMacroArg mutual recursion.
|
||||
if (macroExpandDepth >= maxMacroExpandDepth) {
|
||||
parseContext.ppError(ppToken->loc, "macro expansion depth limit exceeded",
|
||||
"macro expansion", ppToken->name);
|
||||
return MacroExpandNotStarted;
|
||||
}
|
||||
struct DepthGuard {
|
||||
int& d;
|
||||
explicit DepthGuard(int& d_) : d(d_) { ++d; }
|
||||
~DepthGuard() { --d; }
|
||||
} guard(macroExpandDepth);
|
||||
|
||||
if (ppToken->fullyExpanded)
|
||||
return MacroExpandNotStarted;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, T
|
||||
inElseSkip(false)
|
||||
{
|
||||
ifdepth = 0;
|
||||
for (elsetracker = 0; elsetracker < maxIfNesting; elsetracker++)
|
||||
for (elsetracker = 0; elsetracker <= maxIfNesting; elsetracker++)
|
||||
elseSeen[elsetracker] = false;
|
||||
elsetracker = 0;
|
||||
|
||||
|
||||
@@ -298,6 +298,11 @@ public:
|
||||
case PpAtomConstFloat:
|
||||
case PpAtomConstDouble:
|
||||
case PpAtomConstFloat16:
|
||||
case PpAtomConstFloatE2M1:
|
||||
case PpAtomConstFloatE3M2:
|
||||
case PpAtomConstFloatE2M3:
|
||||
case PpAtomConstFloatUE8M0:
|
||||
case PpAtomConstFloatMXINT8:
|
||||
case PpAtomConstString:
|
||||
case PpAtomIdentifier:
|
||||
return true;
|
||||
@@ -393,9 +398,9 @@ protected:
|
||||
|
||||
static const int maxIfNesting = 65;
|
||||
|
||||
int ifdepth; // current #if-#else-#endif nesting in the cpp.c file (pre-processor)
|
||||
bool elseSeen[maxIfNesting]; // Keep a track of whether an else has been seen at a particular depth
|
||||
int elsetracker; // #if-#else and #endif constructs...Counter.
|
||||
int ifdepth; // current #if-#else-#endif nesting in the cpp.c file (pre-processor)
|
||||
bool elseSeen[maxIfNesting + 1]; // Keep a track of whether an else has been seen at a particular depth
|
||||
int elsetracker; // #if-#else and #endif constructs...Counter.
|
||||
|
||||
class tMacroInput : public tInput {
|
||||
public:
|
||||
@@ -441,36 +446,13 @@ protected:
|
||||
static const int marker = -3;
|
||||
};
|
||||
|
||||
class tStringifyLevelInput : public tInput {
|
||||
int what;
|
||||
tStringifyLevelInput(TPpContext* pp) : tInput(pp) { }
|
||||
public:
|
||||
static tStringifyLevelInput popMarker(TPpContext* pp)
|
||||
{
|
||||
tStringifyLevelInput sl(pp);
|
||||
sl.what = POP;
|
||||
return sl;
|
||||
}
|
||||
|
||||
static tStringifyLevelInput pushMarker(TPpContext* pp)
|
||||
{
|
||||
tStringifyLevelInput sl(pp);
|
||||
sl.what = PUSH;
|
||||
return sl;
|
||||
}
|
||||
|
||||
int scan(TPpToken*) override
|
||||
{
|
||||
if (done)
|
||||
return EndOfInput;
|
||||
done = true;
|
||||
|
||||
return what;
|
||||
}
|
||||
virtual int getch() override { assert(0); return EndOfInput; }
|
||||
virtual void ungetch() override { assert(0); }
|
||||
static const int PUSH = -4;
|
||||
static const int POP = -5;
|
||||
struct tStringifyLevelInput {
|
||||
// PUSH is a token atom indicating a new stringizing (#) level
|
||||
// during macro body expansion.
|
||||
static constexpr int PUSH = -4;
|
||||
// PUSH is a token atom indicating the end of a stringizing level
|
||||
// during macro body expansion.
|
||||
static constexpr int POP = -5;
|
||||
};
|
||||
|
||||
class tZeroInput : public tInput {
|
||||
@@ -484,6 +466,10 @@ protected:
|
||||
std::vector<tInput*> inputStack;
|
||||
bool errorOnVersion;
|
||||
bool versionSeen;
|
||||
// Current nesting depth of MacroExpand() calls; bounded to prevent
|
||||
// stack overflow via unbounded MacroExpand <-> PrescanMacroArg recursion.
|
||||
int macroExpandDepth = 0;
|
||||
static const int maxMacroExpandDepth = 200;
|
||||
|
||||
//
|
||||
// from Pp.cpp
|
||||
|
||||
@@ -261,6 +261,11 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
||||
// Suffix:
|
||||
bool isDouble = false;
|
||||
bool isFloat16 = false;
|
||||
bool isFE2M1 = false;
|
||||
bool isFE3M2 = false;
|
||||
bool isFE2M3 = false;
|
||||
bool isFUE8M0 = false;
|
||||
bool isFMXINT8 = false;
|
||||
if (ch == 'l' || ch == 'L') {
|
||||
if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
|
||||
parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
|
||||
@@ -308,6 +313,44 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
||||
if (ifdepth == 0 && !hasDecimalOrExponent)
|
||||
parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
|
||||
saveName(ch);
|
||||
|
||||
auto const &try_str = [&](const char *str, size_t numChar) {
|
||||
size_t counter = 0;
|
||||
for (size_t i = 0; i < numChar; ++i) {
|
||||
if (getChar() != str[i]) {
|
||||
break;
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
if (counter == numChar) {
|
||||
for (size_t i = 0; i < numChar; ++i) {
|
||||
saveName(str[i]);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// called getChar one more than counter times
|
||||
counter++;
|
||||
while (counter) {
|
||||
ungetChar();
|
||||
counter--;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
if (ch == 'f') {
|
||||
if (try_str("e2m1", 4)) {
|
||||
isFE2M1 = true;
|
||||
} else if (try_str("e3m2", 4)) {
|
||||
isFE3M2 = true;
|
||||
} else if (try_str("e2m3", 4)) {
|
||||
isFE2M3 = true;
|
||||
} else if (try_str("ue8m0", 5)) {
|
||||
isFUE8M0 = true;
|
||||
} else if (try_str("mxint8", 6)) {
|
||||
isFMXINT8 = true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
ungetChar();
|
||||
|
||||
@@ -364,6 +407,16 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
|
||||
return PpAtomConstDouble;
|
||||
else if (isFloat16)
|
||||
return PpAtomConstFloat16;
|
||||
else if (isFE2M1)
|
||||
return PpAtomConstFloatE2M1;
|
||||
else if (isFE3M2)
|
||||
return PpAtomConstFloatE3M2;
|
||||
else if (isFE2M3)
|
||||
return PpAtomConstFloatE2M3;
|
||||
else if (isFUE8M0)
|
||||
return PpAtomConstFloatUE8M0;
|
||||
else if (isFMXINT8)
|
||||
return PpAtomConstFloatMXINT8;
|
||||
else
|
||||
return PpAtomConstFloat;
|
||||
}
|
||||
@@ -1308,6 +1361,11 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
||||
case PpAtomConstUint16:
|
||||
case PpAtomConstDouble:
|
||||
case PpAtomConstFloat16:
|
||||
case PpAtomConstFloatE2M1:
|
||||
case PpAtomConstFloatE3M2:
|
||||
case PpAtomConstFloatE2M3:
|
||||
case PpAtomConstFloatUE8M0:
|
||||
case PpAtomConstFloatMXINT8:
|
||||
if (ppToken.name[0] == '\0')
|
||||
continue;
|
||||
break;
|
||||
|
||||
@@ -132,6 +132,11 @@ enum EFixedAtoms {
|
||||
PpAtomConstFloat,
|
||||
PpAtomConstDouble,
|
||||
PpAtomConstFloat16,
|
||||
PpAtomConstFloatE2M1,
|
||||
PpAtomConstFloatE3M2,
|
||||
PpAtomConstFloatE2M3,
|
||||
PpAtomConstFloatUE8M0,
|
||||
PpAtomConstFloatMXINT8,
|
||||
PpAtomConstString,
|
||||
|
||||
// Identifiers
|
||||
|
||||
+51
-3
@@ -274,6 +274,7 @@ enum EShMessages : unsigned {
|
||||
EShMsgDisplayErrorColumn = (1 << 17), // Display error message column aswell as line
|
||||
EShMsgLinkTimeOptimization = (1 << 18), // perform cross-stage optimizations during linking
|
||||
EShMsgValidateCrossStageIO = (1 << 19), // validate shader inputs have matching outputs in previous stage
|
||||
EShMsgRelaxSetBindingLimits = (1 << 20), // relax layout(set/binding) limits
|
||||
LAST_ELEMENT_MARKER(EShMsgCount),
|
||||
};
|
||||
|
||||
@@ -508,6 +509,7 @@ public:
|
||||
#endif
|
||||
void setNoStorageFormat(bool useUnknownFormat);
|
||||
void setNanMinMaxClamp(bool nanMinMaxClamp);
|
||||
void setDiscardIsTerminate(bool discardIsTerminate);
|
||||
void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode);
|
||||
void addBlockStorageOverride(const char* nameStr, glslang::TBlockStorageClass backing);
|
||||
|
||||
@@ -781,9 +783,55 @@ protected:
|
||||
const TType* type;
|
||||
};
|
||||
|
||||
class TReflection;
|
||||
class TIoMapper;
|
||||
struct TVarEntryInfo;
|
||||
class TReflection;
|
||||
class TIoMapper;
|
||||
class TIntermSymbol;
|
||||
|
||||
struct GLSLANG_EXPORT TVarEntryInfo {
|
||||
long long id;
|
||||
TIntermSymbol* symbol;
|
||||
bool live;
|
||||
TLayoutPacking upgradedToPushConstantPacking; // ElpNone means it hasn't been upgraded
|
||||
int newBinding;
|
||||
int newSet;
|
||||
int newLocation;
|
||||
int newComponent;
|
||||
int newIndex;
|
||||
EShLanguage stage;
|
||||
|
||||
void clearNewAssignments() {
|
||||
upgradedToPushConstantPacking = ElpNone;
|
||||
newBinding = -1;
|
||||
newSet = -1;
|
||||
newLocation = -1;
|
||||
newComponent = -1;
|
||||
newIndex = -1;
|
||||
}
|
||||
|
||||
struct TOrderById {
|
||||
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; }
|
||||
};
|
||||
|
||||
struct TOrderByPriority {
|
||||
// ordering:
|
||||
// 1) has both binding and set
|
||||
// 2) has binding but no set
|
||||
// 3) has no binding but set
|
||||
// 4) has no binding and no set
|
||||
bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r);
|
||||
};
|
||||
|
||||
struct TOrderByPriorityAndLive {
|
||||
// ordering:
|
||||
// 1) do live variables first
|
||||
// 2) has both binding and set
|
||||
// 3) has binding but no set
|
||||
// 4) has no binding but set
|
||||
// 5) has no binding and no set
|
||||
bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Allows to customize the binding layout after linking.
|
||||
// All used uniform variables will invoke at least validateBinding.
|
||||
|
||||
Reference in New Issue
Block a user