mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 12:42:34 +01:00
Updated glslang.
This commit is contained in:
committed by
Branimir Karadžić
parent
c35f437910
commit
a0b921ca5f
2
3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
vendored
2
3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
vendored
@@ -42,5 +42,7 @@ static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_in
|
||||
static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image";
|
||||
static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader";
|
||||
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";
|
||||
|
||||
#endif // #ifndef GLSLextEXT_H
|
||||
|
||||
525
3rdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
525
3rdparty/glslang/SPIRV/GlslangToSpv.cpp
vendored
@@ -127,15 +127,16 @@ public:
|
||||
glslang::SpvOptions& options);
|
||||
virtual ~TGlslangToSpvTraverser() { }
|
||||
|
||||
bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*);
|
||||
bool visitBinary(glslang::TVisit, glslang::TIntermBinary*);
|
||||
void visitConstantUnion(glslang::TIntermConstantUnion*);
|
||||
bool visitSelection(glslang::TVisit, glslang::TIntermSelection*);
|
||||
bool visitSwitch(glslang::TVisit, glslang::TIntermSwitch*);
|
||||
void visitSymbol(glslang::TIntermSymbol* symbol);
|
||||
bool visitUnary(glslang::TVisit, glslang::TIntermUnary*);
|
||||
bool visitLoop(glslang::TVisit, glslang::TIntermLoop*);
|
||||
bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*);
|
||||
bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*) override;
|
||||
bool visitBinary(glslang::TVisit, glslang::TIntermBinary*) override;
|
||||
void visitConstantUnion(glslang::TIntermConstantUnion*) override;
|
||||
bool visitSelection(glslang::TVisit, glslang::TIntermSelection*) override;
|
||||
bool visitSwitch(glslang::TVisit, glslang::TIntermSwitch*) override;
|
||||
void visitSymbol(glslang::TIntermSymbol* symbol) override;
|
||||
bool visitUnary(glslang::TVisit, glslang::TIntermUnary*) override;
|
||||
bool visitLoop(glslang::TVisit, glslang::TIntermLoop*) override;
|
||||
bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*) override;
|
||||
bool visitVariableDecl(glslang::TVisit, glslang::TIntermVariableDecl*) override;
|
||||
|
||||
void finishSpv(bool compileOnly);
|
||||
void dumpSpv(std::vector<unsigned int>& out);
|
||||
@@ -194,7 +195,6 @@ protected:
|
||||
void makeGlobalInitializers(const glslang::TIntermSequence&);
|
||||
void collectRayTracingLinkerObjects();
|
||||
void visitFunctions(const glslang::TIntermSequence&);
|
||||
void handleFunctionEntry(const glslang::TIntermAggregate* node);
|
||||
void translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments,
|
||||
spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags);
|
||||
void translateArguments(glslang::TIntermUnary& node, std::vector<spv::Id>& arguments);
|
||||
@@ -390,6 +390,7 @@ spv::Decoration TranslateBlockDecoration(const glslang::TStorageQualifier storag
|
||||
case glslang::EvqCallableData: return spv::Decoration::Block;
|
||||
case glslang::EvqCallableDataIn: return spv::Decoration::Block;
|
||||
case glslang::EvqHitObjectAttrNV: return spv::Decoration::Block;
|
||||
case glslang::EvqHitObjectAttrEXT: return spv::Decoration::Block;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
@@ -465,6 +466,7 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T
|
||||
case glslang::EvqCallableData:
|
||||
case glslang::EvqCallableDataIn:
|
||||
case glslang::EvqHitObjectAttrNV:
|
||||
case glslang::EvqHitObjectAttrEXT:
|
||||
return spv::Decoration::Max;
|
||||
default:
|
||||
assert(0);
|
||||
@@ -1323,7 +1325,8 @@ spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang:
|
||||
// Translate glslang type to SPIR-V storage class.
|
||||
spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType& type)
|
||||
{
|
||||
if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV)
|
||||
if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV
|
||||
|| type.getBasicType() == glslang::EbtHitObjectEXT)
|
||||
return spv::StorageClass::Private;
|
||||
if (type.getQualifier().isSpirvByReference()) {
|
||||
if (type.getQualifier().isParamInput() || type.getQualifier().isParamOutput())
|
||||
@@ -1389,6 +1392,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
|
||||
case glslang::EvqCallableDataIn: return spv::StorageClass::IncomingCallableDataKHR;
|
||||
case glslang::EvqtaskPayloadSharedEXT : return spv::StorageClass::TaskPayloadWorkgroupEXT;
|
||||
case glslang::EvqHitObjectAttrNV: return spv::StorageClass::HitObjectAttributeNV;
|
||||
case glslang::EvqHitObjectAttrEXT: return spv::StorageClass::HitObjectAttributeEXT;
|
||||
case glslang::EvqSpirvStorageClass: return static_cast<spv::StorageClass>(type.getQualifier().spirvStorageClass);
|
||||
default:
|
||||
assert(0);
|
||||
@@ -1713,6 +1717,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionMode::RequireFullQuadsKHR);
|
||||
}
|
||||
|
||||
if (glslangIntermediate->usingShader64BitIndexing())
|
||||
{
|
||||
builder.addCapability(spv::Capability::Shader64BitIndexingEXT);
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_64bit_indexing);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionMode::Shader64BitIndexingEXT);
|
||||
}
|
||||
|
||||
spv::ExecutionMode mode;
|
||||
switch (glslangIntermediate->getStage()) {
|
||||
case EShLangVertex:
|
||||
@@ -2373,10 +2384,20 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||
coherentFlags.nonUniform = 0;
|
||||
|
||||
// normal case for indexing array or structure or block
|
||||
builder.accessChainPush(builder.makeIntConstant(spvIndex),
|
||||
coherentFlags,
|
||||
node->getLeft()->getType().getBufferReferenceAlignment());
|
||||
if ((node->getRight()->getType().getBasicType() == glslang::EbtUint && glslangIntermediate->usingPromoteUint32Indices()) ||
|
||||
node->getRight()->getType().contains64BitInt()) {
|
||||
int64_t idx = node->getRight()->getType().contains64BitInt() ?
|
||||
node->getRight()->getAsConstantUnion()->getConstArray()[0].getI64Const() :
|
||||
node->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
builder.accessChainPush(builder.makeInt64Constant(idx),
|
||||
coherentFlags,
|
||||
node->getLeft()->getType().getBufferReferenceAlignment());
|
||||
|
||||
} else {
|
||||
builder.accessChainPush(builder.makeIntConstant(spvIndex),
|
||||
coherentFlags,
|
||||
node->getLeft()->getType().getBufferReferenceAlignment());
|
||||
}
|
||||
// Add capabilities here for accessing PointSize and clip/cull distance.
|
||||
// We have deferred generation of associated capabilities until now.
|
||||
if (node->getLeft()->getType().isStruct() && ! node->getLeft()->getType().isArray())
|
||||
@@ -2429,9 +2450,15 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||
index, convertGlslangToSpvType(node->getLeft()->getType()), coherent_flags,
|
||||
glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(),
|
||||
dummySize));
|
||||
} else
|
||||
} else {
|
||||
if (glslangIntermediate->usingPromoteUint32Indices() &&
|
||||
node->getRight()->getType().getBasicType() == glslang::EbtUint) {
|
||||
index = createIntWidthConversion(index, 0, builder.makeIntegerType(64, true), glslang::EbtInt64, node->getRight()->getType().getBasicType());
|
||||
}
|
||||
|
||||
builder.accessChainPush(index, coherent_flags,
|
||||
node->getLeft()->getType().getBufferReferenceAlignment());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case glslang::EOpVectorSwizzle:
|
||||
@@ -2658,6 +2685,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
// So, this has to be block.lastMember.length().
|
||||
// SPV wants "block" and member number as the operands, go get them.
|
||||
|
||||
uint32_t bits = node->getType().contains64BitInt() ? 64 : 32;
|
||||
|
||||
spv::Id length;
|
||||
if (node->getOperand()->getType().isCoopMat()) {
|
||||
spv::Id typeId = convertGlslangToSpvType(node->getOperand()->getType());
|
||||
@@ -2677,7 +2706,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
block->traverse(this);
|
||||
unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion()
|
||||
->getConstArray()[0].getUConst();
|
||||
length = builder.createArrayLength(builder.accessChainGetLValue(), member);
|
||||
length = builder.createArrayLength(builder.accessChainGetLValue(), member, bits);
|
||||
}
|
||||
|
||||
// GLSL semantics say the result of .length() is an int, while SPIR-V says
|
||||
@@ -2685,9 +2714,9 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
// AST expectation of a signed result.
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) {
|
||||
if (builder.isInSpecConstCodeGenMode()) {
|
||||
length = builder.createBinOp(spv::Op::OpIAdd, builder.makeIntType(32), length, builder.makeIntConstant(0));
|
||||
length = builder.createBinOp(spv::Op::OpIAdd, builder.makeIntType(bits), length, builder.makeIntConstant(0));
|
||||
} else {
|
||||
length = builder.createUnaryOp(spv::Op::OpBitcast, builder.makeIntType(32), length);
|
||||
length = builder.createUnaryOp(spv::Op::OpBitcast, builder.makeIntType(bits), length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2756,6 +2785,28 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
case glslang::EOpHitObjectGetSphereRadiusNV:
|
||||
case glslang::EOpHitObjectIsSphereHitNV:
|
||||
case glslang::EOpHitObjectIsLSSHitNV:
|
||||
case glslang::EOpReorderThreadEXT:
|
||||
case glslang::EOpHitObjectGetCurrentTimeEXT:
|
||||
case glslang::EOpHitObjectGetHitKindEXT:
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexEXT:
|
||||
case glslang::EOpHitObjectGetGeometryIndexEXT:
|
||||
case glslang::EOpHitObjectGetInstanceIdEXT:
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexEXT:
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionEXT:
|
||||
case glslang::EOpHitObjectGetObjectRayOriginEXT:
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionEXT:
|
||||
case glslang::EOpHitObjectGetWorldRayOriginEXT:
|
||||
case glslang::EOpHitObjectGetWorldToObjectEXT:
|
||||
case glslang::EOpHitObjectGetObjectToWorldEXT:
|
||||
case glslang::EOpHitObjectGetRayTMaxEXT:
|
||||
case glslang::EOpHitObjectGetRayTMinEXT:
|
||||
case glslang::EOpHitObjectGetRayFlagsEXT:
|
||||
case glslang::EOpHitObjectIsEmptyEXT:
|
||||
case glslang::EOpHitObjectIsHitEXT:
|
||||
case glslang::EOpHitObjectIsMissEXT:
|
||||
case glslang::EOpHitObjectRecordEmptyEXT:
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT:
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -2927,9 +2978,15 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||
case glslang::EOpReorderThreadNV:
|
||||
builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectNV, operand);
|
||||
return false;
|
||||
case glslang::EOpReorderThreadEXT:
|
||||
builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectEXT, operand);
|
||||
return false;
|
||||
case glslang::EOpHitObjectRecordEmptyNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordEmptyNV, operand);
|
||||
return false;
|
||||
case glslang::EOpHitObjectRecordEmptyEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordEmptyEXT, operand);
|
||||
return false;
|
||||
|
||||
case glslang::EOpCreateTensorLayoutNV:
|
||||
result = builder.createOp(spv::Op::OpCreateTensorLayoutNV, resultType(), std::vector<spv::Id>{});
|
||||
@@ -3104,7 +3161,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
builder.enterFunction(shaderEntry);
|
||||
currentFunction = shaderEntry;
|
||||
} else {
|
||||
handleFunctionEntry(node);
|
||||
// SPIR-V functions should already be in the functionMap from the prepass
|
||||
// that called makeFunctions().
|
||||
currentFunction = functionMap[node->getName().c_str()];
|
||||
spv::Block* functionBlock = currentFunction->getEntryBlock();
|
||||
builder.setBuildPoint(functionBlock);
|
||||
builder.enterFunction(currentFunction);
|
||||
}
|
||||
if (options.generateDebugInfo && !options.emitNonSemanticShaderDebugInfo) {
|
||||
const auto& loc = node->getLoc();
|
||||
@@ -3113,6 +3175,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
currentFunction->setDebugLineInfo(sourceFileId, loc.line, loc.column);
|
||||
}
|
||||
} else {
|
||||
// Here we have finished visiting the function (post-visit). Finalize it.
|
||||
if (options.generateDebugInfo) {
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && node->getSequence().size() > 1) {
|
||||
auto endLoc = node->getSequence()[1]->getAsAggregate()->getEndLoc();
|
||||
@@ -3123,6 +3186,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
entryPointTerminated = true;
|
||||
builder.leaveFunction();
|
||||
inEntryPoint = false;
|
||||
currentFunction = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3576,6 +3640,46 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV);
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectTraceRayEXT:
|
||||
case glslang::EOpHitObjectTraceRayMotionEXT:
|
||||
case glslang::EOpHitObjectGetAttributesEXT:
|
||||
case glslang::EOpHitObjectExecuteShaderEXT:
|
||||
case glslang::EOpHitObjectRecordEmptyEXT:
|
||||
case glslang::EOpHitObjectRecordMissEXT:
|
||||
case glslang::EOpHitObjectRecordMissMotionEXT:
|
||||
case glslang::EOpReorderThreadEXT:
|
||||
case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT:
|
||||
case glslang::EOpHitObjectReorderExecuteEXT:
|
||||
case glslang::EOpHitObjectTraceReorderExecuteEXT:
|
||||
case glslang::EOpHitObjectTraceMotionReorderExecuteEXT:
|
||||
case glslang::EOpHitObjectRecordFromQueryEXT:
|
||||
case glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT:
|
||||
noReturnValue = true;
|
||||
[[fallthrough]];
|
||||
case glslang::EOpHitObjectIsEmptyEXT:
|
||||
case glslang::EOpHitObjectIsMissEXT:
|
||||
case glslang::EOpHitObjectIsHitEXT:
|
||||
case glslang::EOpHitObjectGetRayTMinEXT:
|
||||
case glslang::EOpHitObjectGetRayTMaxEXT:
|
||||
case glslang::EOpHitObjectGetRayFlagsEXT:
|
||||
case glslang::EOpHitObjectGetObjectRayOriginEXT:
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionEXT:
|
||||
case glslang::EOpHitObjectGetWorldRayOriginEXT:
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionEXT:
|
||||
case glslang::EOpHitObjectGetObjectToWorldEXT:
|
||||
case glslang::EOpHitObjectGetWorldToObjectEXT:
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexEXT:
|
||||
case glslang::EOpHitObjectGetInstanceIdEXT:
|
||||
case glslang::EOpHitObjectGetGeometryIndexEXT:
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexEXT:
|
||||
case glslang::EOpHitObjectGetHitKindEXT:
|
||||
case glslang::EOpHitObjectGetCurrentTimeEXT:
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT:
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT:
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_invocation_reorder);
|
||||
builder.addCapability(spv::Capability::ShaderInvocationReorderEXT);
|
||||
break;
|
||||
|
||||
case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:
|
||||
builder.addExtension(spv::E_SPV_KHR_ray_tracing_position_fetch);
|
||||
builder.addCapability(spv::Capability::RayQueryPositionFetchKHR);
|
||||
@@ -3683,6 +3787,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
|
||||
|
||||
|
||||
case glslang::EOpHitObjectRecordFromQueryEXT:
|
||||
case glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT:
|
||||
if (arg == 0 || arg == 1)
|
||||
lvalue = true;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectRecordHitNV:
|
||||
case glslang::EOpHitObjectRecordHitMotionNV:
|
||||
case glslang::EOpHitObjectRecordHitWithIndexNV:
|
||||
@@ -3694,6 +3804,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
case glslang::EOpHitObjectRecordMissMotionNV:
|
||||
case glslang::EOpHitObjectGetAttributesNV:
|
||||
case glslang::EOpHitObjectGetClusterIdNV:
|
||||
case glslang::EOpHitObjectTraceRayEXT:
|
||||
case glslang::EOpHitObjectTraceRayMotionEXT:
|
||||
case glslang::EOpHitObjectExecuteShaderEXT:
|
||||
case glslang::EOpHitObjectRecordMissEXT:
|
||||
case glslang::EOpHitObjectRecordMissMotionEXT:
|
||||
case glslang::EOpHitObjectGetAttributesEXT:
|
||||
case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT:
|
||||
case glslang::EOpHitObjectReorderExecuteEXT:
|
||||
case glslang::EOpHitObjectTraceReorderExecuteEXT:
|
||||
case glslang::EOpHitObjectTraceMotionReorderExecuteEXT:
|
||||
if (arg == 0)
|
||||
lvalue = true;
|
||||
break;
|
||||
@@ -3837,6 +3957,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
lvalue = true;
|
||||
break;
|
||||
case glslang::EOpReorderThreadNV:
|
||||
case glslang::EOpReorderThreadEXT:
|
||||
//Three variants of reorderThreadNV, two of them use hitObjectNV
|
||||
if (arg == 0 && glslangOperands.size() != 2)
|
||||
lvalue = true;
|
||||
@@ -3973,22 +4094,33 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
)) {
|
||||
bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst();
|
||||
operands.push_back(builder.makeIntConstant(cond ? 1 : 0));
|
||||
} else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV)) {
|
||||
const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
|
||||
const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
auto itNode = locationToSymbol[set].find(location);
|
||||
visitSymbol(itNode->second);
|
||||
spv::Id symId = getSymbolId(itNode->second);
|
||||
operands.push_back(symId);
|
||||
} else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderEXT) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayEXT) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionEXT) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectTraceMotionReorderExecuteEXT && glslangOperands.size() == 13) ||
|
||||
(arg == 14 && glslangOp == glslang::EOpHitObjectTraceMotionReorderExecuteEXT && glslangOperands.size() == 15) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectTraceReorderExecuteEXT && glslangOperands.size() == 12) ||
|
||||
(arg == 13 && glslangOp == glslang::EOpHitObjectTraceReorderExecuteEXT && glslangOperands.size() == 14) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectReorderExecuteEXT && glslangOperands.size() == 2) ||
|
||||
(arg == 3 && glslangOp == glslang::EOpHitObjectReorderExecuteEXT && glslangOperands.size() == 4)) {
|
||||
const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
|
||||
const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
auto itNode = locationToSymbol[set].find(location);
|
||||
visitSymbol(itNode->second);
|
||||
spv::Id symId = getSymbolId(itNode->second);
|
||||
operands.push_back(symId);
|
||||
} else if ((arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitNV) ||
|
||||
(arg == 13 && glslangOp == glslang::EOpHitObjectRecordHitMotionNV) ||
|
||||
(arg == 11 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexNV) ||
|
||||
(arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexMotionNV) ||
|
||||
(arg == 3 && glslangOp == glslang::EOpHitObjectRecordFromQueryEXT) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesEXT) ||
|
||||
(arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesNV)) {
|
||||
const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
const int set = 2;
|
||||
@@ -4198,7 +4330,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||
// store the result to the pointer (out param 'm')
|
||||
builder.createStore(result, operands[1]);
|
||||
result = 0;
|
||||
} else if (node->getOp() == glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT) {
|
||||
std::vector<spv::IdImmediate> idImmOps;
|
||||
|
||||
idImmOps.push_back(spv::IdImmediate(true, operands[0])); // hitObject
|
||||
|
||||
spv::Op spvOp = spv::Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT;
|
||||
spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3),
|
||||
builder.makeUintConstant(3), 0);
|
||||
|
||||
spv::Id result = builder.createOp(spvOp, typeId, idImmOps);
|
||||
// store the result to the pointer (out param 'm')
|
||||
builder.createStore(result, operands[1]);
|
||||
result = 0;
|
||||
} else if (node->getOp() == glslang::EOpCooperativeMatrixMulAdd) {
|
||||
auto matrixOperands = spv::CooperativeMatrixOperandsMask::MaskNone;
|
||||
|
||||
@@ -4800,7 +4944,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
|
||||
|
||||
builder.setBuildPoint(&test);
|
||||
node->getTest()->traverse(this);
|
||||
spv::Id condition = accessChainLoad(node->getTest()->getType());
|
||||
spv::Id condition = accessChainLoad(node->getTestExpr()->getType());
|
||||
builder.createConditionalBranch(condition, &blocks.body, &blocks.merge);
|
||||
|
||||
builder.setBuildPoint(&blocks.body);
|
||||
@@ -4831,7 +4975,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
|
||||
if (node->getTest()) {
|
||||
node->getTest()->traverse(this);
|
||||
spv::Id condition =
|
||||
accessChainLoad(node->getTest()->getType());
|
||||
accessChainLoad(node->getTestExpr()->getType());
|
||||
builder.createConditionalBranch(condition, &blocks.head, &blocks.merge);
|
||||
} else {
|
||||
// TODO: unless there was a break/return/discard instruction
|
||||
@@ -4914,6 +5058,18 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TGlslangToSpvTraverser::visitVariableDecl(glslang::TVisit visit, glslang::TIntermVariableDecl* node)
|
||||
{
|
||||
if (visit == glslang::EvPreVisit) {
|
||||
builder.setDebugSourceLocation(node->getDeclSymbol()->getLoc().line, node->getDeclSymbol()->getLoc().getFilename());
|
||||
// We touch the symbol once here to create the debug info.
|
||||
getSymbolId(node->getDeclSymbol());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node, spv::Id forcedType)
|
||||
{
|
||||
// First, steer off constants, which are not SPIR-V variables, but
|
||||
@@ -4921,8 +5077,12 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
|
||||
// This includes specialization constants.
|
||||
if (node->getQualifier().isConstant()) {
|
||||
spv::Id result = createSpvConstant(*node);
|
||||
if (result != spv::NoResult)
|
||||
if (result != spv::NoResult) {
|
||||
auto name = node->getAsSymbolNode()->getAccessName().c_str();
|
||||
auto typeId = convertGlslangToSpvType(node->getType());
|
||||
builder.createConstVariable(typeId, name, result, currentFunction == nullptr);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Now, handle actual variables
|
||||
@@ -5209,18 +5369,50 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
||||
case glslang::EbtSampler:
|
||||
{
|
||||
const glslang::TSampler& sampler = type.getSampler();
|
||||
std::string debugName;
|
||||
|
||||
if (sampler.isPureSampler()) {
|
||||
spvType = builder.makeSamplerType();
|
||||
if (options.emitNonSemanticShaderDebugInfo) {
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) {
|
||||
debugName = sampler.getString();
|
||||
}
|
||||
else {
|
||||
debugName = "type.sampler";
|
||||
}
|
||||
}
|
||||
spvType = builder.makeSamplerType(debugName.c_str());
|
||||
} else {
|
||||
// an image is present, make its type
|
||||
if (options.emitNonSemanticShaderDebugInfo) {
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) {
|
||||
debugName = sampler.removeCombined().getString();
|
||||
}
|
||||
else {
|
||||
switch (sampler.dim) {
|
||||
case glslang::Esd1D: debugName = "type.1d.image"; break;
|
||||
case glslang::Esd2D: debugName = "type.2d.image"; break;
|
||||
case glslang::Esd3D: debugName = "type.3d.image"; break;
|
||||
case glslang::EsdCube: debugName = "type.cube.image"; break;
|
||||
default: debugName = "type.image"; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler),
|
||||
sampler.isShadow(), sampler.isArrayed(), sampler.isMultiSample(),
|
||||
sampler.isImageClass() ? 2 : 1, TranslateImageFormat(type));
|
||||
sampler.isImageClass() ? 2 : 1, TranslateImageFormat(type), debugName.c_str());
|
||||
if (sampler.isCombined() &&
|
||||
(!sampler.isBuffer() || glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6)) {
|
||||
// Already has both image and sampler, make the combined type. Only combine sampler to
|
||||
// buffer if before SPIR-V 1.6.
|
||||
spvType = builder.makeSampledImageType(spvType);
|
||||
if (options.emitNonSemanticShaderDebugInfo) {
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) {
|
||||
debugName = sampler.getString();
|
||||
}
|
||||
else {
|
||||
debugName = "type.sampled.image";
|
||||
}
|
||||
}
|
||||
spvType = builder.makeSampledImageType(spvType, debugName.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5254,6 +5446,13 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
|
||||
spvType = builder.makeHitObjectNVType();
|
||||
}
|
||||
break;
|
||||
|
||||
case glslang::EbtHitObjectEXT: {
|
||||
builder.addExtension(spv::E_SPV_EXT_shader_invocation_reorder);
|
||||
builder.addCapability(spv::Capability::ShaderInvocationReorderEXT);
|
||||
spvType = builder.makeHitObjectEXTType();
|
||||
}
|
||||
break;
|
||||
case glslang::EbtSpirvType: {
|
||||
// GL_EXT_spirv_intrinsics
|
||||
const auto& spirvType = type.getSpirvType();
|
||||
@@ -5654,7 +5853,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
|
||||
|
||||
// Per the GLSL spec, bool variables inside of a uniform or buffer block are generated as uint.
|
||||
// But for debug info, we want to represent them as bool because that is the original type in
|
||||
// the source code. The bool type can be nested within a vector or a multidimensional array,
|
||||
// the source code. The bool type can be nested within a vector or a multidimensional array,
|
||||
// so we must construct the chain of types up from the scalar bool.
|
||||
if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && explicitLayout != glslang::ElpNone &&
|
||||
glslangMember.type->getBasicType() == glslang::EbtBool) {
|
||||
@@ -5830,6 +6029,8 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
|
||||
|
||||
if (qualifier.hasHitObjectShaderRecordNV())
|
||||
builder.addDecoration(spvType, spv::Decoration::HitObjectShaderRecordBufferNV);
|
||||
if (qualifier.hasHitObjectShaderRecordEXT())
|
||||
builder.addDecoration(spvType, spv::Decoration::HitObjectShaderRecordBufferEXT);
|
||||
}
|
||||
|
||||
// Turn the expression forming the array size into an id.
|
||||
@@ -6396,6 +6597,7 @@ void TGlslangToSpvTraverser::collectRayTracingLinkerObjects()
|
||||
break;
|
||||
|
||||
case glslang::EvqHitObjectAttrNV:
|
||||
case glslang::EvqHitObjectAttrEXT:
|
||||
set = 2;
|
||||
break;
|
||||
|
||||
@@ -6418,16 +6620,6 @@ void TGlslangToSpvTraverser::visitFunctions(const glslang::TIntermSequence& glsl
|
||||
}
|
||||
}
|
||||
|
||||
void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate* node)
|
||||
{
|
||||
// SPIR-V functions should already be in the functionMap from the prepass
|
||||
// that called makeFunctions().
|
||||
currentFunction = functionMap[node->getName().c_str()];
|
||||
spv::Block* functionBlock = currentFunction->getEntryBlock();
|
||||
builder.setBuildPoint(functionBlock);
|
||||
builder.enterFunction(currentFunction);
|
||||
}
|
||||
|
||||
void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments,
|
||||
spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags)
|
||||
{
|
||||
@@ -8075,74 +8267,150 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
|
||||
unaryOp = spv::Op::OpHitObjectIsEmptyNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsEmptyEXT:
|
||||
unaryOp = spv::Op::OpHitObjectIsEmptyEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsMissNV:
|
||||
unaryOp = spv::Op::OpHitObjectIsMissNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsMissEXT:
|
||||
unaryOp = spv::Op::OpHitObjectIsMissEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsHitNV:
|
||||
unaryOp = spv::Op::OpHitObjectIsHitNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectIsHitEXT:
|
||||
unaryOp = spv::Op::OpHitObjectIsHitEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectRayOriginNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetObjectRayOriginNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectRayOriginEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetObjectRayOriginEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetObjectRayDirectionNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetObjectRayDirectionEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldRayOriginNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetWorldRayOriginNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldRayOriginEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetWorldRayOriginEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetWorldRayDirectionNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetWorldRayDirectionEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectToWorldNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetObjectToWorldNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetObjectToWorldEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetObjectToWorldEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldToObjectNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetWorldToObjectNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetWorldToObjectEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetWorldToObjectEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayTMinNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetRayTMinNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayTMinEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetRayTMinEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayTMaxNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetRayTMaxNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayTMaxEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetRayTMaxEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetRayFlagsEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetRayFlagsEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetPrimitiveIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetPrimitiveIndexEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetInstanceIdNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetInstanceIdNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetInstanceIdEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetInstanceIdEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetInstanceCustomIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetInstanceCustomIndexEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetGeometryIndexNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetGeometryIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetGeometryIndexEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetGeometryIndexEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetHitKindNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetHitKindNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetHitKindEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetHitKindEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetCurrentTimeNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetCurrentTimeNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetCurrentTimeEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetCurrentTimeEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleNV:
|
||||
unaryOp = spv::Op::OpHitObjectGetShaderRecordBufferHandleNV;
|
||||
break;
|
||||
@@ -8182,6 +8450,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
|
||||
builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV);
|
||||
break;
|
||||
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT:
|
||||
unaryOp = spv::Op::OpHitObjectGetShaderRecordBufferHandleEXT;
|
||||
break;
|
||||
|
||||
case glslang::EOpFetchMicroTriangleVertexPositionNV:
|
||||
unaryOp = spv::Op::OpFetchMicroTriangleVertexPositionNV;
|
||||
break;
|
||||
@@ -9819,9 +10091,15 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
case glslang::EOpHitObjectTraceRayNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceRayNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectTraceRayEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceRayEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectTraceRayMotionNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceRayMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectTraceRayMotionEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceRayMotionEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordHitNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordHitNV, operands);
|
||||
return 0;
|
||||
@@ -9837,20 +10115,37 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
case glslang::EOpHitObjectRecordMissNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordMissNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordMissEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordMissEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordMissMotionNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordMissMotionNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordMissMotionEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordMissMotionEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectExecuteShaderNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectExecuteShaderNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectExecuteShaderEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectExecuteShaderEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectIsEmptyNV:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsEmptyNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsEmptyEXT:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsEmptyEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsMissNV:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsMissNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsMissEXT:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsMissEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsHitNV:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsHitNV;
|
||||
@@ -9863,69 +10158,143 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsLSSHitNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectIsHitEXT:
|
||||
typeId = builder.makeBoolType();
|
||||
opCode = spv::Op::OpHitObjectIsHitEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayTMinNV:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::Op::OpHitObjectGetRayTMinNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayTMinEXT:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::Op::OpHitObjectGetRayTMinEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayTMaxNV:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::Op::OpHitObjectGetRayTMaxNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayTMaxEXT:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::Op::OpHitObjectGetRayTMaxEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetRayFlagsEXT:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::Op::OpHitObjectGetRayFlagsEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectRayOriginNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetObjectRayOriginNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectRayOriginEXT:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetObjectRayOriginEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetObjectRayDirectionNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectRayDirectionEXT:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetObjectRayDirectionEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldRayOriginNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetWorldRayOriginNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldRayOriginEXT:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetWorldRayOriginEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionNV:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetWorldRayDirectionNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldRayDirectionEXT:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 3);
|
||||
opCode = spv::Op::OpHitObjectGetWorldRayDirectionEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldToObjectNV:
|
||||
typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3);
|
||||
opCode = spv::Op::OpHitObjectGetWorldToObjectNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetWorldToObjectEXT:
|
||||
typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3);
|
||||
opCode = spv::Op::OpHitObjectGetWorldToObjectEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectToWorldNV:
|
||||
typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3);
|
||||
opCode = spv::Op::OpHitObjectGetObjectToWorldNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetObjectToWorldEXT:
|
||||
typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3);
|
||||
opCode = spv::Op::OpHitObjectGetObjectToWorldEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetInstanceCustomIndexNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetInstanceCustomIndexEXT:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetInstanceCustomIndexEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetInstanceIdNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetInstanceIdNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetInstanceIdEXT:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetInstanceIdEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetGeometryIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetGeometryIndexNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetGeometryIndexEXT:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetGeometryIndexEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetPrimitiveIndexNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetPrimitiveIndexEXT:
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetPrimitiveIndexEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetHitKindNV:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::Op::OpHitObjectGetHitKindNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetHitKindEXT:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::Op::OpHitObjectGetHitKindEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetCurrentTimeNV:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::Op::OpHitObjectGetCurrentTimeNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetCurrentTimeEXT:
|
||||
typeId = builder.makeFloatType(32);
|
||||
opCode = spv::Op::OpHitObjectGetCurrentTimeEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV;
|
||||
return 0;
|
||||
case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT:
|
||||
typeId = builder.makeIntegerType(32, 0);
|
||||
opCode = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexEXT;
|
||||
return 0;
|
||||
case glslang::EOpHitObjectGetAttributesNV:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectGetAttributesNV, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectGetAttributesEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectGetAttributesEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectRecordFromQueryEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectRecordFromQueryEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleNV:
|
||||
typeId = builder.makeVectorType(builder.makeUintType(32), 2);
|
||||
opCode = spv::Op::OpHitObjectGetShaderRecordBufferHandleNV;
|
||||
@@ -9934,6 +10303,13 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
typeId = builder.makeIntegerType(32, 1);
|
||||
opCode = spv::Op::OpHitObjectGetClusterIdNV;
|
||||
break;
|
||||
case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT:
|
||||
typeId = builder.makeVectorType(builder.makeUintType(32), 2);
|
||||
opCode = spv::Op::OpHitObjectGetShaderRecordBufferHandleEXT;
|
||||
break;
|
||||
case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT:
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectSetShaderBindingTableRecordIndexEXT, operands);
|
||||
return 0;
|
||||
case glslang::EOpReorderThreadNV: {
|
||||
if (operands.size() == 2) {
|
||||
builder.createNoResultOp(spv::Op::OpReorderThreadWithHintNV, operands);
|
||||
@@ -9941,9 +10317,54 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
|
||||
builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectNV, operands);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
case glslang::EOpReorderThreadEXT: {
|
||||
if (operands.size() == 2) {
|
||||
builder.createNoResultOp(spv::Op::OpReorderThreadWithHintEXT, operands);
|
||||
} else {
|
||||
builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectEXT, operands);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case glslang::EOpHitObjectReorderExecuteEXT: {
|
||||
if (operands.size() == 2) {
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectReorderExecuteShaderEXT, operands);
|
||||
} else {
|
||||
// GLSL intrinsic is
|
||||
// hitObjectReorderExecuteEXT(hitObjectEXT hitObject, uint hint, uint bits,int payload) while
|
||||
// SPIRV is hitObject id , payload id, optional hint id, optional bits id hence reorder operands
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectReorderExecuteShaderEXT, {operands[0], operands[3], operands[1], operands[2]});
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case glslang::EOpHitObjectTraceReorderExecuteEXT: {
|
||||
if (operands.size() == 12) {
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceReorderExecuteEXT, operands);
|
||||
} else {
|
||||
std::vector<spv::Id> argOperands;
|
||||
std::copy(operands.begin(), operands.begin() + 11, std::back_inserter(argOperands));
|
||||
argOperands.push_back(operands[13]);
|
||||
argOperands.push_back(operands[11]);
|
||||
argOperands.push_back(operands[12]);
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceReorderExecuteEXT, argOperands);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: {
|
||||
if (operands.size() == 13) {
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceMotionReorderExecuteEXT, operands);
|
||||
} else {
|
||||
std::vector<spv::Id> argOperands;
|
||||
std::copy(operands.begin(), operands.begin() + 12, std::back_inserter(argOperands));
|
||||
argOperands.push_back(operands[14]);
|
||||
argOperands.push_back(operands[12]);
|
||||
argOperands.push_back(operands[13]);
|
||||
builder.createNoResultOp(spv::Op::OpHitObjectTraceMotionReorderExecuteEXT, argOperands);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case glslang::EOpImageSampleWeightedQCOM:
|
||||
typeId = builder.makeVectorType(builder.makeFloatType(32), 4);
|
||||
opCode = spv::Op::OpImageSampleWeightedQCOM;
|
||||
@@ -10367,11 +10788,13 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
|
||||
if (symbol->getQualifier().hasLocation()) {
|
||||
if (!(glslangIntermediate->isRayTracingStage() &&
|
||||
(glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing) ||
|
||||
glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder))
|
||||
glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder) ||
|
||||
glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_shader_invocation_reorder))
|
||||
&& (builder.getStorageClass(id) == spv::StorageClass::RayPayloadKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClass::IncomingRayPayloadKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClass::CallableDataKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClass::IncomingCallableDataKHR ||
|
||||
builder.getStorageClass(id) == spv::StorageClass::HitObjectAttributeEXT ||
|
||||
builder.getStorageClass(id) == spv::StorageClass::HitObjectAttributeNV))) {
|
||||
// Location values are used to link TraceRayKHR/ExecuteCallableKHR/HitObjectGetAttributesNV
|
||||
// to corresponding variables but are not valid in SPIRV since they are supported only
|
||||
@@ -10672,7 +11095,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
|
||||
int nextConst = 0;
|
||||
result = createSpvConstantFromConstUnionArray(sn->getType(), *const_union_array, nextConst, true);
|
||||
} else {
|
||||
logger->missingFunctionality("Invalid initializer for spec onstant.");
|
||||
logger->missingFunctionality("Invalid initializer for spec constant.");
|
||||
return spv::NoResult;
|
||||
}
|
||||
builder.addName(result, sn->getName().c_str());
|
||||
|
||||
92
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
92
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
@@ -125,7 +125,7 @@ Id Builder::makeBoolType()
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::makeSamplerType()
|
||||
Id Builder::makeSamplerType(const char* debugName)
|
||||
{
|
||||
Instruction* type;
|
||||
if (groupedTypes[enumCast(Op::OpTypeSampler)].size() == 0) {
|
||||
@@ -138,7 +138,7 @@ Id Builder::makeSamplerType()
|
||||
|
||||
if (emitNonSemanticShaderDebugInfo)
|
||||
{
|
||||
auto const debugResultId = makeOpaqueDebugType("type.sampler");
|
||||
auto const debugResultId = makeOpaqueDebugType(debugName);
|
||||
debugId[type->getResultId()] = debugResultId;
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ Id Builder::makeDebugFunctionType(Id returnType, const std::vector<Id>& paramTyp
|
||||
}
|
||||
|
||||
Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled,
|
||||
ImageFormat format)
|
||||
ImageFormat format, const char* debugName)
|
||||
{
|
||||
assert(sampled == 1 || sampled == 2);
|
||||
|
||||
@@ -922,24 +922,14 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
|
||||
|
||||
if (emitNonSemanticShaderDebugInfo)
|
||||
{
|
||||
auto TypeName = [&dim]() -> char const* {
|
||||
switch (dim) {
|
||||
case Dim::Dim1D: return "type.1d.image";
|
||||
case Dim::Dim2D: return "type.2d.image";
|
||||
case Dim::Dim3D: return "type.3d.image";
|
||||
case Dim::Cube: return "type.cube.image";
|
||||
default: return "type.image";
|
||||
}
|
||||
};
|
||||
|
||||
auto const debugResultId = makeOpaqueDebugType(TypeName());
|
||||
auto const debugResultId = makeOpaqueDebugType(debugName);
|
||||
debugId[type->getResultId()] = debugResultId;
|
||||
}
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::makeSampledImageType(Id imageType)
|
||||
Id Builder::makeSampledImageType(Id imageType, const char* debugName)
|
||||
{
|
||||
// try to find it
|
||||
Instruction* type;
|
||||
@@ -959,7 +949,7 @@ Id Builder::makeSampledImageType(Id imageType)
|
||||
|
||||
if (emitNonSemanticShaderDebugInfo)
|
||||
{
|
||||
auto const debugResultId = makeOpaqueDebugType("type.sampled.image");
|
||||
auto const debugResultId = makeOpaqueDebugType(debugName);
|
||||
debugId[type->getResultId()] = debugResultId;
|
||||
}
|
||||
|
||||
@@ -1512,6 +1502,20 @@ Id Builder::makeRayQueryType()
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::makeHitObjectEXTType()
|
||||
{
|
||||
Instruction *type;
|
||||
if (groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].size() == 0) {
|
||||
type = new Instruction(getUniqueId(), NoType, Op::OpTypeHitObjectEXT);
|
||||
groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].push_back(type);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
} else {
|
||||
type = groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].back();
|
||||
}
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
Id Builder::makeHitObjectNVType()
|
||||
{
|
||||
Instruction *type;
|
||||
@@ -1520,6 +1524,10 @@ Id Builder::makeHitObjectNVType()
|
||||
groupedTypes[enumCast(Op::OpTypeHitObjectNV)].push_back(type);
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
if (emitNonSemanticShaderDebugInfo) {
|
||||
spv::Id debugType = makeOpaqueDebugType("hitObjectNV");
|
||||
debugId[type->getResultId()] = debugType;
|
||||
}
|
||||
} else {
|
||||
type = groupedTypes[enumCast(Op::OpTypeHitObjectNV)].back();
|
||||
}
|
||||
@@ -2658,7 +2666,7 @@ Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id
|
||||
type->addIdOperand(makeDebugCompilationUnit()); // scope
|
||||
type->addIdOperand(nameId); // linkage name
|
||||
type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic));
|
||||
type->addIdOperand(makeUintConstant(currentLine));
|
||||
type->addIdOperand(makeUintConstant(currentLine));
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
return funcId;
|
||||
@@ -2734,6 +2742,8 @@ void Builder::leaveLexicalBlock()
|
||||
// Comments in header
|
||||
void Builder::enterFunction(Function const* function)
|
||||
{
|
||||
currentFunction = function;
|
||||
|
||||
// Save and disable debugInfo for HLSL entry point function. It is a wrapper
|
||||
// function with no user code in it.
|
||||
restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo;
|
||||
@@ -2784,6 +2794,9 @@ void Builder::leaveFunction()
|
||||
currentDebugScopeId.pop();
|
||||
|
||||
emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo;
|
||||
|
||||
// Clear current function record
|
||||
currentFunction = nullptr;
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
@@ -2803,6 +2816,20 @@ void Builder::makeStatementTerminator(spv::Op opcode, const std::vector<Id>& ope
|
||||
createAndSetNoPredecessorBlock(name);
|
||||
}
|
||||
|
||||
void Builder::createConstVariable(Id type, const char* name, Id constant, bool isGlobal)
|
||||
{
|
||||
if (emitNonSemanticShaderDebugInfo) {
|
||||
Id debugType = getDebugType(type);
|
||||
if (isGlobal) {
|
||||
createDebugGlobalVariable(debugType, name, constant);
|
||||
}
|
||||
else {
|
||||
auto debugLocal = createDebugLocalVariable(debugType, name);
|
||||
makeDebugValue(debugLocal, constant);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer,
|
||||
bool const compilerGenerated)
|
||||
@@ -2813,31 +2840,30 @@ Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id t
|
||||
if (initializer != NoResult)
|
||||
inst->addIdOperand(initializer);
|
||||
|
||||
switch (storageClass) {
|
||||
case StorageClass::Function:
|
||||
if (storageClass == StorageClass::Function) {
|
||||
// Validation rules require the declaration in the entry block
|
||||
buildPoint->getParent().addLocalVariable(std::unique_ptr<Instruction>(inst));
|
||||
}
|
||||
else {
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
|
||||
module.mapInstruction(inst);
|
||||
}
|
||||
|
||||
if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
|
||||
{
|
||||
if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
|
||||
{
|
||||
// For debug info, we prefer respecting how the variable is declared in source code.
|
||||
// We may emulate some local variables as global variable with private storage in SPIR-V, but we still want to
|
||||
// treat them as local variables in debug info.
|
||||
if (storageClass == StorageClass::Function || (currentFunction && storageClass == StorageClass::Private)) {
|
||||
auto const debugLocalVariableId = createDebugLocalVariable(debugId[type], name);
|
||||
debugId[inst->getResultId()] = debugLocalVariableId;
|
||||
|
||||
makeDebugDeclare(debugLocalVariableId, inst->getResultId());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
|
||||
module.mapInstruction(inst);
|
||||
|
||||
if (emitNonSemanticShaderDebugInfo)
|
||||
{
|
||||
else {
|
||||
auto const debugResultId = createDebugGlobalVariable(debugId[type], name, inst->getResultId());
|
||||
debugId[inst->getResultId()] = debugResultId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (name)
|
||||
@@ -2942,9 +2968,9 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec
|
||||
return chain->getResultId();
|
||||
}
|
||||
|
||||
Id Builder::createArrayLength(Id base, unsigned int member)
|
||||
Id Builder::createArrayLength(Id base, unsigned int member, unsigned int bits)
|
||||
{
|
||||
spv::Id intType = makeUintType(32);
|
||||
spv::Id intType = makeUintType(bits);
|
||||
Instruction* length = new Instruction(getUniqueId(), intType, Op::OpArrayLength);
|
||||
length->reserveOperands(2);
|
||||
length->addIdOperand(base);
|
||||
|
||||
24
3rdparty/glslang/SPIRV/SpvBuilder.h
vendored
24
3rdparty/glslang/SPIRV/SpvBuilder.h
vendored
@@ -138,7 +138,7 @@ public:
|
||||
if (trackDebugInfo) {
|
||||
dirtyLineTracker = true;
|
||||
if (line != 0) {
|
||||
// TODO: This is special handling of some AST nodes having (untracked) line 0.
|
||||
// TODO: This is special handling of some AST nodes having (untracked) line 0.
|
||||
// But they should have a valid line number.
|
||||
currentLine = line;
|
||||
if (filename) {
|
||||
@@ -235,9 +235,9 @@ public:
|
||||
Id makeArrayType(Id element, Id sizeId, int stride); // 0 stride means no stride decoration
|
||||
Id makeRuntimeArray(Id element);
|
||||
Id makeFunctionType(Id returnType, const std::vector<Id>& paramTypes);
|
||||
Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
|
||||
Id makeSamplerType();
|
||||
Id makeSampledImageType(Id imageType);
|
||||
Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format, const char* debugNames);
|
||||
Id makeSamplerType(const char* debugName);
|
||||
Id makeSampledImageType(Id imageType, const char* debugName);
|
||||
Id makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use);
|
||||
Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols);
|
||||
Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType);
|
||||
@@ -284,6 +284,8 @@ public:
|
||||
Id makeRayQueryType();
|
||||
// hitObjectNV type
|
||||
Id makeHitObjectNVType();
|
||||
// hitObjectEXT type
|
||||
Id makeHitObjectEXTType();
|
||||
|
||||
// For querying about types.
|
||||
Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
|
||||
@@ -511,6 +513,10 @@ public:
|
||||
// such as OpEmitMeshTasksEXT
|
||||
void makeStatementTerminator(spv::Op opcode, const std::vector<Id>& operands, const char* name);
|
||||
|
||||
// Create a global/local constant. Because OpConstant is automatically emitted by getting the constant
|
||||
// ids, this function only handles debug info.
|
||||
void createConstVariable(Id type, const char* name, Id constant, bool isGlobal);
|
||||
|
||||
// Create a global or function local or IO variable.
|
||||
Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr,
|
||||
Id initializer = NoResult, bool const compilerGenerated = true);
|
||||
@@ -531,7 +537,7 @@ public:
|
||||
Id createAccessChain(StorageClass, Id base, const std::vector<Id>& offsets);
|
||||
|
||||
// Create an OpArrayLength instruction
|
||||
Id createArrayLength(Id base, unsigned int member);
|
||||
Id createArrayLength(Id base, unsigned int member, unsigned int bits);
|
||||
|
||||
// Create an OpCooperativeMatrixLengthKHR instruction
|
||||
Id createCooperativeMatrixLengthKHR(Id type);
|
||||
@@ -936,7 +942,11 @@ public:
|
||||
|
||||
void setUseReplicatedComposites(bool use) { useReplicatedComposites = use; }
|
||||
|
||||
protected:
|
||||
private:
|
||||
// Helper to get size of a scalar (in bytes)
|
||||
unsigned int postProcessGetLargestScalarSize(const Instruction& type);
|
||||
|
||||
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);
|
||||
@@ -1002,6 +1012,8 @@ public:
|
||||
Block* buildPoint;
|
||||
Id uniqueId;
|
||||
Function* entryPointFunction;
|
||||
// This tracks the current function being built, or nullptr if not in a function.
|
||||
Function const* currentFunction { nullptr };
|
||||
bool generatingOpCodeForSpecConst;
|
||||
bool useReplicatedComposites { false };
|
||||
AccessChain accessChain;
|
||||
|
||||
81
3rdparty/glslang/SPIRV/SpvPostProcess.cpp
vendored
81
3rdparty/glslang/SPIRV/SpvPostProcess.cpp
vendored
@@ -43,6 +43,7 @@
|
||||
#include <unordered_set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "SPIRV/spvIR.h"
|
||||
#include "SpvBuilder.h"
|
||||
#include "spirv.hpp11"
|
||||
#include "spvUtil.h"
|
||||
@@ -201,6 +202,37 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int Builder::postProcessGetLargestScalarSize(const Instruction& type)
|
||||
{
|
||||
switch (type.getOpCode()) {
|
||||
case Op::OpTypeBool:
|
||||
return 1;
|
||||
case Op::OpTypeInt:
|
||||
case Op::OpTypeFloat:
|
||||
return type.getImmediateOperand(0) / 8;
|
||||
case Op::OpTypePointer:
|
||||
return 8;
|
||||
case Op::OpTypeVector:
|
||||
case Op::OpTypeMatrix:
|
||||
case Op::OpTypeArray:
|
||||
case Op::OpTypeRuntimeArray: {
|
||||
const Instruction* elem_type = module.getInstruction(type.getIdOperand(0));
|
||||
return postProcessGetLargestScalarSize(*elem_type);
|
||||
}
|
||||
case Op::OpTypeStruct: {
|
||||
unsigned int largest = 0;
|
||||
for (int i = 0; i < type.getNumOperands(); ++i) {
|
||||
const Instruction* elem_type = module.getInstruction(type.getIdOperand(i));
|
||||
unsigned int elem_size = postProcessGetLargestScalarSize(*elem_type);
|
||||
largest = std::max(largest, elem_size);
|
||||
}
|
||||
return largest;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Called for each instruction that resides in a block.
|
||||
void Builder::postProcess(Instruction& inst)
|
||||
{
|
||||
@@ -249,12 +281,12 @@ void Builder::postProcess(Instruction& inst)
|
||||
// and this function computes the rest from the SPIR-V Offset decorations.
|
||||
Instruction *accessChain = module.getInstruction(inst.getIdOperand(0));
|
||||
if (accessChain->getOpCode() == Op::OpAccessChain) {
|
||||
Instruction *base = module.getInstruction(accessChain->getIdOperand(0));
|
||||
const Instruction* base = module.getInstruction(accessChain->getIdOperand(0));
|
||||
// Get the type of the base of the access chain. It must be a pointer type.
|
||||
Id typeId = base->getTypeId();
|
||||
Instruction *type = module.getInstruction(typeId);
|
||||
assert(type->getOpCode() == Op::OpTypePointer);
|
||||
if (type->getImmediateOperand(0) != StorageClass::PhysicalStorageBufferEXT) {
|
||||
if (type->getImmediateOperand(0) != StorageClass::PhysicalStorageBuffer) {
|
||||
break;
|
||||
}
|
||||
// Get the pointee type.
|
||||
@@ -265,6 +297,7 @@ void Builder::postProcess(Instruction& inst)
|
||||
// Offset/ArrayStride/MatrixStride decorations, and bitwise OR them all
|
||||
// together.
|
||||
int alignment = 0;
|
||||
bool first_struct_elem = false;
|
||||
for (int i = 1; i < accessChain->getNumOperands(); ++i) {
|
||||
Instruction *idx = module.getInstruction(accessChain->getIdOperand(i));
|
||||
if (type->getOpCode() == Op::OpTypeStruct) {
|
||||
@@ -277,7 +310,12 @@ void Builder::postProcess(Instruction& inst)
|
||||
decoration.get()->getImmediateOperand(1) == c &&
|
||||
(decoration.get()->getImmediateOperand(2) == Decoration::Offset ||
|
||||
decoration.get()->getImmediateOperand(2) == Decoration::MatrixStride)) {
|
||||
alignment |= decoration.get()->getImmediateOperand(3);
|
||||
unsigned int opernad_value = decoration.get()->getImmediateOperand(3);
|
||||
alignment |= opernad_value;
|
||||
if (opernad_value == 0 &&
|
||||
decoration.get()->getImmediateOperand(2) == Decoration::Offset) {
|
||||
first_struct_elem = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
std::for_each(decorations.begin(), decorations.end(), function);
|
||||
@@ -303,18 +341,51 @@ void Builder::postProcess(Instruction& inst)
|
||||
}
|
||||
}
|
||||
assert(inst.getNumOperands() >= 3);
|
||||
auto const memoryAccess = (MemoryAccessMask)inst.getImmediateOperand((inst.getOpCode() == Op::OpStore) ? 2 : 1);
|
||||
const bool is_store = inst.getOpCode() == Op::OpStore;
|
||||
auto const memoryAccess = (MemoryAccessMask)inst.getImmediateOperand(is_store ? 2 : 1);
|
||||
assert(anySet(memoryAccess, MemoryAccessMask::Aligned));
|
||||
static_cast<void>(memoryAccess);
|
||||
|
||||
// Compute the index of the alignment operand.
|
||||
int alignmentIdx = 2;
|
||||
if (inst.getOpCode() == Op::OpStore)
|
||||
if (is_store)
|
||||
alignmentIdx++;
|
||||
// Merge new and old (mis)alignment
|
||||
alignment |= inst.getImmediateOperand(alignmentIdx);
|
||||
|
||||
if (!is_store) {
|
||||
Instruction* inst_type = module.getInstruction(inst.getTypeId());
|
||||
if (inst_type->getOpCode() == Op::OpTypePointer &&
|
||||
inst_type->getImmediateOperand(0) == StorageClass::PhysicalStorageBuffer) {
|
||||
// This means we are loading a pointer which means need to ensure it is at least 8-byte aligned
|
||||
// See https://github.com/KhronosGroup/glslang/issues/4084
|
||||
// In case the alignment is currently 4, need to ensure it is 8 before grabbing the LSB
|
||||
alignment |= 8;
|
||||
alignment &= 8;
|
||||
}
|
||||
}
|
||||
|
||||
// Pick the LSB
|
||||
alignment = alignment & ~(alignment & (alignment-1));
|
||||
|
||||
// The edge case we find is when copying a struct to another struct, we never find the alignment anywhere,
|
||||
// so in this case, fallback to doing a full size lookup on the type
|
||||
if (alignment == 0 && first_struct_elem) {
|
||||
// Quick get the struct type back
|
||||
const Instruction* pointer_type = module.getInstruction(base->getTypeId());
|
||||
const Instruction* struct_type = module.getInstruction(pointer_type->getIdOperand(1));
|
||||
assert(struct_type->getOpCode() == Op::OpTypeStruct);
|
||||
|
||||
const Instruction* elem_type = module.getInstruction(struct_type->getIdOperand(0));
|
||||
unsigned int largest_scalar = postProcessGetLargestScalarSize(*elem_type);
|
||||
if (largest_scalar != 0) {
|
||||
alignment = largest_scalar;
|
||||
} else {
|
||||
alignment = 16; // fallback if can't determine a godo alignment
|
||||
}
|
||||
}
|
||||
// update the Aligned operand
|
||||
assert(alignment != 0);
|
||||
inst.setImmediateOperand(alignmentIdx, alignment);
|
||||
}
|
||||
break;
|
||||
|
||||
229
3rdparty/glslang/SPIRV/doc.cpp
vendored
229
3rdparty/glslang/SPIRV/doc.cpp
vendored
@@ -231,6 +231,8 @@ const char* ExecutionModeString(int mode)
|
||||
case (int)ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT";
|
||||
case (int)ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT";
|
||||
|
||||
case (int)ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT";
|
||||
|
||||
case ExecutionModeCeiling:
|
||||
default: return "Bad";
|
||||
}
|
||||
@@ -265,6 +267,7 @@ const char* StorageClassString(int StorageClass)
|
||||
case (int)StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
|
||||
case (int)StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV";
|
||||
case (int)StorageClass::TileImageEXT: return "TileImageEXT";
|
||||
case (int)StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT";
|
||||
default: return "Bad";
|
||||
}
|
||||
}
|
||||
@@ -344,6 +347,7 @@ const char* DecorationString(int decoration)
|
||||
case (int)Decoration::AliasedPointerEXT: return "DecorationAliasedPointerEXT";
|
||||
|
||||
case (int)Decoration::HitObjectShaderRecordBufferNV: return "DecorationHitObjectShaderRecordBufferNV";
|
||||
case (int)Decoration::HitObjectShaderRecordBufferEXT: return "DecorationHitObjectShaderRecordBufferEXT";
|
||||
|
||||
case (int)Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "DecorationSaturatedToLargestFloat8NormalConversionEXT";
|
||||
}
|
||||
@@ -1107,6 +1111,7 @@ const char* CapabilityString(int info)
|
||||
case (int)Capability::CoreBuiltinsARM: return "CoreBuiltinsARM";
|
||||
|
||||
case (int)Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV";
|
||||
case (int)Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT";
|
||||
|
||||
case (int)Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM";
|
||||
case (int)Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM";
|
||||
@@ -1135,6 +1140,8 @@ const char* CapabilityString(int info)
|
||||
case (int)Capability::Float8EXT: return "Float8EXT";
|
||||
case (int)Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT";
|
||||
|
||||
case (int)Capability::Shader64BitIndexingEXT: return "CapabilityShader64BitIndexingEXT";
|
||||
|
||||
default: return "Bad";
|
||||
}
|
||||
}
|
||||
@@ -1718,6 +1725,43 @@ const char* OpcodeString(int op)
|
||||
case (int)Op::OpUDotAccSatKHR: return "OpUDotAccSatKHR";
|
||||
case (int)Op::OpSUDotAccSatKHR: return "OpSUDotAccSatKHR";
|
||||
|
||||
case (int)Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT";
|
||||
case (int)Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT";
|
||||
case (int)Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT";
|
||||
case (int)Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT";
|
||||
case (int)Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT";
|
||||
case (int)Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT";
|
||||
case (int)Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT";
|
||||
case (int)Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT";
|
||||
case (int)Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT";
|
||||
case (int)Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT";
|
||||
case (int)Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT";
|
||||
case (int)Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT";
|
||||
case (int)Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT";
|
||||
case (int)Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT";
|
||||
case (int)Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT";
|
||||
case (int)Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT";
|
||||
case (int)Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT";
|
||||
case (int)Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT";
|
||||
case (int)Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT";
|
||||
case (int)Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT";
|
||||
case (int)Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT";
|
||||
case (int)Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT";
|
||||
case (int)Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT";
|
||||
case (int)Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT";
|
||||
case (int)Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT";
|
||||
case (int)Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT";
|
||||
case (int)Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT";
|
||||
case (int)Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT";
|
||||
case (int)Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT";
|
||||
case (int)Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT";
|
||||
case (int)Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT";
|
||||
case (int)Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteEXT";
|
||||
case (int)Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT";
|
||||
case (int)Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT";
|
||||
case (int)Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT";
|
||||
case (int)Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT";
|
||||
|
||||
default:
|
||||
return "Bad";
|
||||
}
|
||||
@@ -3853,6 +3897,191 @@ void Parameterize()
|
||||
InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Tensor'");
|
||||
InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Dimension'", true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpTypeHitObjectEXT)].setResultAndType(true, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetHitKindEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetHitKindEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetRayFlagsEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetRayFlagsEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectIsEmptyEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectIsEmptyEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectIsHitEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectIsHitEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectIsMissEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectIsMissEXT)].setResultAndType(true, true);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].operands.push(OperandId, "'HitObjectAttribute'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'SBT Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'SBT Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Current Time'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Cullmask'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Cullmask'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Time'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'SBT Record Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Cullmask'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Acceleration Structure'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'RayFlags'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Cullmask'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Offset'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Stride'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Miss Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Origin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'TMin'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Direction'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'TMax'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Time'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Payload'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Hint'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Bits'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'RayQuery'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'SBT Record Index'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'HitObjectAttribute'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].setResultAndType(false, false);
|
||||
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].operands.push(OperandId, "'HitObject'");
|
||||
InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].setResultAndType(true, true);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
126
3rdparty/glslang/SPIRV/spirv.hpp11
vendored
126
3rdparty/glslang/SPIRV/spirv.hpp11
vendored
@@ -206,7 +206,8 @@ enum class ExecutionMode : unsigned {
|
||||
SampleInterlockOrderedEXT = 5368,
|
||||
SampleInterlockUnorderedEXT = 5369,
|
||||
ShadingRateInterlockOrderedEXT = 5370,
|
||||
ShadingRateInterlockUnorderedEXT = 5371,
|
||||
ShadingRateInterlockUnorderedEXT = 5371,
|
||||
Shader64BitIndexingEXT = 5427,
|
||||
SharedLocalMemorySizeINTEL = 5618,
|
||||
RoundingModeRTPINTEL = 5620,
|
||||
RoundingModeRTNINTEL = 5621,
|
||||
@@ -261,6 +262,7 @@ enum class StorageClass : unsigned {
|
||||
PhysicalStorageBufferEXT = 5349,
|
||||
HitObjectAttributeNV = 5385,
|
||||
TaskPayloadWorkgroupEXT = 5402,
|
||||
HitObjectAttributeEXT = 5411,
|
||||
CodeSectionINTEL = 5605,
|
||||
DeviceOnlyINTEL = 5936,
|
||||
HostOnlyINTEL = 5937,
|
||||
@@ -579,6 +581,7 @@ enum class Decoration : unsigned {
|
||||
AliasedPointer = 5356,
|
||||
AliasedPointerEXT = 5356,
|
||||
HitObjectShaderRecordBufferNV = 5386,
|
||||
HitObjectShaderRecordBufferEXT = 5389,
|
||||
BindlessSamplerNV = 5398,
|
||||
BindlessImageNV = 5399,
|
||||
BoundSamplerNV = 5400,
|
||||
@@ -1188,6 +1191,7 @@ enum class Capability : unsigned {
|
||||
DisplacementMicromapNV = 5380,
|
||||
RayTracingOpacityMicromapEXT = 5381,
|
||||
ShaderInvocationReorderNV = 5383,
|
||||
ShaderInvocationReorderEXT = 5388,
|
||||
BindlessTextureNV = 5390,
|
||||
RayQueryPositionFetchKHR = 5391,
|
||||
CooperativeVectorNV = 5394,
|
||||
@@ -1195,7 +1199,8 @@ enum class Capability : unsigned {
|
||||
RayTracingDisplacementMicromapNV = 5409,
|
||||
RawAccessChainsNV = 5414,
|
||||
RayTracingSpheresGeometryNV = 5418,
|
||||
RayTracingLinearSweptSpheresGeometryNV = 5419,
|
||||
RayTracingLinearSweptSpheresGeometryNV = 5419,
|
||||
Shader64BitIndexingEXT = 5426,
|
||||
CooperativeMatrixReductionsNV = 5430,
|
||||
CooperativeMatrixConversionsNV = 5431,
|
||||
CooperativeMatrixPerElementOperationsNV = 5432,
|
||||
@@ -2074,6 +2079,36 @@ enum class Op : unsigned {
|
||||
OpFetchMicroTriangleVertexBarycentricNV = 5301,
|
||||
OpCooperativeVectorLoadNV = 5302,
|
||||
OpCooperativeVectorStoreNV = 5303,
|
||||
OpHitObjectRecordFromQueryEXT = 5304,
|
||||
OpHitObjectRecordMissEXT = 5305,
|
||||
OpHitObjectRecordMissMotionEXT = 5306,
|
||||
OpHitObjectGetIntersectionTriangleVertexPositionsEXT = 5307,
|
||||
OpHitObjectGetRayFlagsEXT = 5308,
|
||||
OpHitObjectSetShaderBindingTableRecordIndexEXT = 5309,
|
||||
OpHitObjectReorderExecuteShaderEXT = 5310,
|
||||
OpHitObjectTraceReorderExecuteEXT = 5311,
|
||||
OpHitObjectTraceMotionReorderExecuteEXT = 5312,
|
||||
OpTypeHitObjectEXT = 5313,
|
||||
OpReorderThreadWithHintEXT = 5314,
|
||||
OpReorderThreadWithHitObjectEXT = 5315,
|
||||
OpHitObjectTraceRayEXT = 5316,
|
||||
OpHitObjectTraceRayMotionEXT = 5317,
|
||||
OpHitObjectRecordEmptyEXT = 5318,
|
||||
OpHitObjectExecuteShaderEXT = 5319,
|
||||
OpHitObjectGetCurrentTimeEXT = 5320,
|
||||
OpHitObjectGetAttributesEXT = 5321,
|
||||
OpHitObjectGetHitKindEXT = 5322,
|
||||
OpHitObjectGetPrimitiveIndexEXT = 5323,
|
||||
OpHitObjectGetGeometryIndexEXT = 5324,
|
||||
OpHitObjectGetInstanceIdEXT = 5325,
|
||||
OpHitObjectGetInstanceCustomIndexEXT = 5326,
|
||||
OpHitObjectGetObjectRayOriginEXT = 5327,
|
||||
OpHitObjectGetObjectRayDirectionEXT = 5328,
|
||||
OpHitObjectGetWorldRayDirectionEXT = 5329,
|
||||
OpHitObjectGetWorldRayOriginEXT = 5330,
|
||||
OpHitObjectGetObjectToWorldEXT = 5331,
|
||||
OpHitObjectGetWorldToObjectEXT = 5332,
|
||||
OpHitObjectGetRayTMaxEXT = 5333,
|
||||
OpReportIntersectionKHR = 5334,
|
||||
OpReportIntersectionNV = 5334,
|
||||
OpIgnoreIntersectionNV = 5335,
|
||||
@@ -2087,6 +2122,12 @@ enum class Op : unsigned {
|
||||
OpExecuteCallableNV = 5344,
|
||||
OpRayQueryGetClusterIdNV = 5345,
|
||||
OpHitObjectGetClusterIdNV = 5346,
|
||||
OpHitObjectGetRayTMinEXT = 5347,
|
||||
OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348,
|
||||
OpHitObjectGetShaderRecordBufferHandleEXT = 5349,
|
||||
OpHitObjectIsEmptyEXT = 5350,
|
||||
OpHitObjectIsHitEXT = 5351,
|
||||
OpHitObjectIsMissEXT = 5352,
|
||||
OpTypeCooperativeMatrixNV = 5358,
|
||||
OpCooperativeMatrixLoadNV = 5359,
|
||||
OpCooperativeMatrixStoreNV = 5360,
|
||||
@@ -2885,6 +2926,36 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case Op::OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectRecordFromQueryEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectRecordMissEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectRecordMissMotionEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetRayFlagsEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectReorderExecuteShaderEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectTraceReorderExecuteEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectTraceMotionReorderExecuteEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpTypeHitObjectEXT: *hasResult = true; *hasResultType = false; break;
|
||||
case Op::OpReorderThreadWithHintEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpReorderThreadWithHitObjectEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectTraceRayEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectTraceRayMotionEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectRecordEmptyEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectExecuteShaderEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectGetCurrentTimeEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetAttributesEXT: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpHitObjectGetHitKindEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetPrimitiveIndexEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetGeometryIndexEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetInstanceIdEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetInstanceCustomIndexEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetObjectRayOriginEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetObjectRayDirectionEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetWorldRayDirectionEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetWorldRayOriginEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetObjectToWorldEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetWorldToObjectEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetRayTMaxEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
|
||||
@@ -2896,6 +2967,12 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
|
||||
case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
|
||||
case Op::OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetRayTMinEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectGetShaderRecordBufferHandleEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectIsEmptyEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectIsHitEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpHitObjectIsMissEXT: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
|
||||
case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
|
||||
case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
|
||||
@@ -3349,7 +3426,8 @@ inline const char* ExecutionModeToString(ExecutionMode value) {
|
||||
case ExecutionMode::SampleInterlockOrderedEXT: return "SampleInterlockOrderedEXT";
|
||||
case ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT";
|
||||
case ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT";
|
||||
case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT";
|
||||
case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT";
|
||||
case ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT";
|
||||
case ExecutionMode::SharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL";
|
||||
case ExecutionMode::RoundingModeRTPINTEL: return "RoundingModeRTPINTEL";
|
||||
case ExecutionMode::RoundingModeRTNINTEL: return "RoundingModeRTNINTEL";
|
||||
@@ -3399,6 +3477,7 @@ inline const char* StorageClassToString(StorageClass value) {
|
||||
case StorageClass::PhysicalStorageBuffer: return "PhysicalStorageBuffer";
|
||||
case StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV";
|
||||
case StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
|
||||
case StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT";
|
||||
case StorageClass::CodeSectionINTEL: return "CodeSectionINTEL";
|
||||
case StorageClass::DeviceOnlyINTEL: return "DeviceOnlyINTEL";
|
||||
case StorageClass::HostOnlyINTEL: return "HostOnlyINTEL";
|
||||
@@ -3658,6 +3737,7 @@ inline const char* DecorationToString(Decoration value) {
|
||||
case Decoration::RestrictPointer: return "RestrictPointer";
|
||||
case Decoration::AliasedPointer: return "AliasedPointer";
|
||||
case Decoration::HitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV";
|
||||
case Decoration::HitObjectShaderRecordBufferEXT: return "HitObjectShaderRecordBufferEXT";
|
||||
case Decoration::BindlessSamplerNV: return "BindlessSamplerNV";
|
||||
case Decoration::BindlessImageNV: return "BindlessImageNV";
|
||||
case Decoration::BoundSamplerNV: return "BoundSamplerNV";
|
||||
@@ -4069,6 +4149,7 @@ inline const char* CapabilityToString(Capability value) {
|
||||
case Capability::DisplacementMicromapNV: return "DisplacementMicromapNV";
|
||||
case Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT";
|
||||
case Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV";
|
||||
case Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT";
|
||||
case Capability::BindlessTextureNV: return "BindlessTextureNV";
|
||||
case Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR";
|
||||
case Capability::CooperativeVectorNV: return "CooperativeVectorNV";
|
||||
@@ -4076,7 +4157,8 @@ inline const char* CapabilityToString(Capability value) {
|
||||
case Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV";
|
||||
case Capability::RawAccessChainsNV: return "RawAccessChainsNV";
|
||||
case Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV";
|
||||
case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV";
|
||||
case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV";
|
||||
case Capability::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT";
|
||||
case Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV";
|
||||
case Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV";
|
||||
case Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV";
|
||||
@@ -4831,6 +4913,36 @@ inline const char* OpToString(Op value) {
|
||||
case Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV";
|
||||
case Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV";
|
||||
case Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV";
|
||||
case Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT";
|
||||
case Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT";
|
||||
case Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT";
|
||||
case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT";
|
||||
case Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT";
|
||||
case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT";
|
||||
case Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteShaderEXT";
|
||||
case Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT";
|
||||
case Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT";
|
||||
case Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT";
|
||||
case Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT";
|
||||
case Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT";
|
||||
case Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT";
|
||||
case Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT";
|
||||
case Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT";
|
||||
case Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT";
|
||||
case Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT";
|
||||
case Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT";
|
||||
case Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT";
|
||||
case Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT";
|
||||
case Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT";
|
||||
case Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT";
|
||||
case Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT";
|
||||
case Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT";
|
||||
case Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT";
|
||||
case Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT";
|
||||
case Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT";
|
||||
case Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT";
|
||||
case Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT";
|
||||
case Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT";
|
||||
case Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR";
|
||||
case Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV";
|
||||
case Op::OpTerminateRayNV: return "OpTerminateRayNV";
|
||||
@@ -4842,6 +4954,12 @@ inline const char* OpToString(Op value) {
|
||||
case Op::OpExecuteCallableNV: return "OpExecuteCallableNV";
|
||||
case Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV";
|
||||
case Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV";
|
||||
case Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT";
|
||||
case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT";
|
||||
case Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT";
|
||||
case Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT";
|
||||
case Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT";
|
||||
case Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT";
|
||||
case Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV";
|
||||
case Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV";
|
||||
case Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV";
|
||||
|
||||
@@ -801,9 +801,16 @@ TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc,
|
||||
return result; // it was handled as an operator[]
|
||||
|
||||
bool flattened = false;
|
||||
int indexValue = 0;
|
||||
if (index->getQualifier().isFrontEndConstant())
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst();
|
||||
int64_t indexValue = 0;
|
||||
if (index->getQualifier().isFrontEndConstant()) {
|
||||
if (index->getType().contains64BitInt()) {
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getI64Const();
|
||||
} else if (index->getType().getBasicType() == EbtUint) {
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
} else {
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst();
|
||||
}
|
||||
}
|
||||
|
||||
variableCheck(base);
|
||||
if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) {
|
||||
|
||||
5
3rdparty/glslang/glslang/Include/BaseTypes.h
vendored
5
3rdparty/glslang/glslang/Include/BaseTypes.h
vendored
@@ -69,6 +69,7 @@ enum TBasicType {
|
||||
EbtReference,
|
||||
EbtRayQuery,
|
||||
EbtHitObjectNV,
|
||||
EbtHitObjectEXT,
|
||||
EbtCoopmat,
|
||||
EbtFunction,
|
||||
EbtTensorLayoutNV,
|
||||
@@ -111,6 +112,7 @@ enum TStorageQualifier {
|
||||
EvqCallableData,
|
||||
EvqCallableDataIn,
|
||||
EvqHitObjectAttrNV,
|
||||
EvqHitObjectAttrEXT,
|
||||
|
||||
EvqtaskPayloadSharedEXT,
|
||||
|
||||
@@ -398,7 +400,8 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
|
||||
case EvqCallableData: return "callableDataNV"; break;
|
||||
case EvqCallableDataIn: return "callableDataInNV"; break;
|
||||
case EvqtaskPayloadSharedEXT: return "taskPayloadSharedEXT"; break;
|
||||
case EvqHitObjectAttrNV:return "hitObjectAttributeNV"; break;
|
||||
case EvqHitObjectAttrNV: return "hitObjectAttributeNV"; break;
|
||||
case EvqHitObjectAttrEXT:return "hitObjectAttributeEXT"; break;
|
||||
default: return "unknown qualifier";
|
||||
}
|
||||
}
|
||||
|
||||
23
3rdparty/glslang/glslang/Include/Types.h
vendored
23
3rdparty/glslang/glslang/Include/Types.h
vendored
@@ -130,6 +130,13 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
|
||||
bool isTileAttachmentQCOM() const { return tileQCOM; }
|
||||
|
||||
// For combined sampler, returns the underlying texture. Otherwise, returns identity.
|
||||
TSampler removeCombined() const {
|
||||
TSampler result = *this;
|
||||
result.combined = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
type = EbtVoid;
|
||||
@@ -238,9 +245,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
||||
return ! operator==(right);
|
||||
}
|
||||
|
||||
TString getString() const
|
||||
std::string getString() const
|
||||
{
|
||||
TString s;
|
||||
std::string s;
|
||||
|
||||
if (isPureSampler()) {
|
||||
s.append("sampler");
|
||||
@@ -818,6 +825,9 @@ public:
|
||||
bool isHitObjectAttrNV() const {
|
||||
return storage == EvqHitObjectAttrNV;
|
||||
}
|
||||
bool isHitObjectAttrEXT() const {
|
||||
return storage == EvqHitObjectAttrEXT;
|
||||
}
|
||||
|
||||
// True if this type of IO is supposed to be arrayed with extra level for per-vertex data
|
||||
bool isArrayedIo(EShLanguage language) const
|
||||
@@ -854,6 +864,7 @@ public:
|
||||
layoutFullQuads = false;
|
||||
layoutQuadDeriv = false;
|
||||
layoutHitObjectShaderRecordNV = false;
|
||||
layoutHitObjectShaderRecordEXT = false;
|
||||
layoutBindlessSampler = false;
|
||||
layoutBindlessImage = false;
|
||||
layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd;
|
||||
@@ -954,6 +965,7 @@ public:
|
||||
bool layoutFullQuads;
|
||||
bool layoutQuadDeriv;
|
||||
bool layoutHitObjectShaderRecordNV;
|
||||
bool layoutHitObjectShaderRecordEXT;
|
||||
|
||||
// GL_EXT_spirv_intrinsics
|
||||
int spirvStorageClass;
|
||||
@@ -1065,6 +1077,7 @@ public:
|
||||
bool isFullQuads() const { return layoutFullQuads; }
|
||||
bool isQuadDeriv() const { return layoutQuadDeriv; }
|
||||
bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; }
|
||||
bool hasHitObjectShaderRecordEXT() const { return layoutHitObjectShaderRecordEXT; }
|
||||
bool hasBufferReference() const { return layoutBufferReference; }
|
||||
bool hasBufferReferenceAlign() const
|
||||
{
|
||||
@@ -1930,7 +1943,7 @@ public:
|
||||
}
|
||||
virtual bool isOpaque() const { return basicType == EbtSampler
|
||||
|| basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
|
||||
|| basicType == EbtHitObjectNV || isTileAttachmentQCOM()
|
||||
|| basicType == EbtHitObjectNV || basicType == EbtHitObjectEXT || isTileAttachmentQCOM()
|
||||
|| isTensorARM();
|
||||
}
|
||||
virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
|
||||
@@ -2326,6 +2339,8 @@ public:
|
||||
appendStr(" quad_derivatives");
|
||||
if (qualifier.layoutHitObjectShaderRecordNV)
|
||||
appendStr(" hitobjectshaderrecordnv");
|
||||
if (qualifier.layoutHitObjectShaderRecordEXT)
|
||||
appendStr(" hitobjectshaderrecordext");
|
||||
|
||||
if (qualifier.layoutBindlessSampler)
|
||||
appendStr(" layoutBindlessSampler");
|
||||
@@ -2595,7 +2610,7 @@ public:
|
||||
TString getBasicTypeString() const
|
||||
{
|
||||
if (basicType == EbtSampler)
|
||||
return sampler.getString();
|
||||
return TString{sampler.getString()};
|
||||
else
|
||||
return getBasicString();
|
||||
}
|
||||
|
||||
11
3rdparty/glslang/glslang/Include/arrays.h
vendored
11
3rdparty/glslang/glslang/Include/arrays.h
vendored
@@ -66,6 +66,7 @@ struct TArraySize {
|
||||
|
||||
return SameSpecializationConstants(node, rhs.node);
|
||||
}
|
||||
bool operator!=(const TArraySize& rhs) const { return !(*this == rhs); }
|
||||
};
|
||||
|
||||
//
|
||||
@@ -198,6 +199,12 @@ struct TSmallArrayVector {
|
||||
}
|
||||
bool operator!=(const TSmallArrayVector& rhs) const { return ! operator==(rhs); }
|
||||
|
||||
const TArraySize& operator[](int index) const
|
||||
{
|
||||
assert(sizes && index < (int)sizes->size());
|
||||
return (*sizes)[index];
|
||||
}
|
||||
|
||||
protected:
|
||||
TSmallArrayVector(const TSmallArrayVector&);
|
||||
|
||||
@@ -336,6 +343,10 @@ struct TArraySizes {
|
||||
|
||||
return true;
|
||||
}
|
||||
const TArraySize& getArraySize(int index) const
|
||||
{
|
||||
return sizes[index];
|
||||
}
|
||||
|
||||
void setVariablyIndexed() { variablyIndexed = true; }
|
||||
bool isVariablyIndexed() const { return variablyIndexed; }
|
||||
|
||||
115
3rdparty/glslang/glslang/Include/intermediate.h
vendored
115
3rdparty/glslang/glslang/Include/intermediate.h
vendored
@@ -875,6 +875,44 @@ enum TOperator {
|
||||
EOpFetchMicroTriangleVertexPositionNV,
|
||||
EOpFetchMicroTriangleVertexBarycentricNV,
|
||||
|
||||
//
|
||||
// GL_EXT_shader_invocation_reorder
|
||||
//
|
||||
|
||||
EOpHitObjectTraceRayEXT,
|
||||
EOpHitObjectTraceRayMotionEXT,
|
||||
EOpHitObjectRecordMissEXT,
|
||||
EOpHitObjectRecordMissMotionEXT,
|
||||
EOpHitObjectRecordEmptyEXT,
|
||||
EOpHitObjectExecuteShaderEXT,
|
||||
EOpHitObjectIsEmptyEXT,
|
||||
EOpHitObjectIsMissEXT,
|
||||
EOpHitObjectIsHitEXT,
|
||||
EOpHitObjectGetRayTMinEXT,
|
||||
EOpHitObjectGetRayTMaxEXT,
|
||||
EOpHitObjectGetRayFlagsEXT,
|
||||
EOpHitObjectGetObjectRayOriginEXT,
|
||||
EOpHitObjectGetObjectRayDirectionEXT,
|
||||
EOpHitObjectGetWorldRayOriginEXT,
|
||||
EOpHitObjectGetWorldRayDirectionEXT,
|
||||
EOpHitObjectGetWorldToObjectEXT,
|
||||
EOpHitObjectGetObjectToWorldEXT,
|
||||
EOpHitObjectGetInstanceCustomIndexEXT,
|
||||
EOpHitObjectGetInstanceIdEXT,
|
||||
EOpHitObjectGetGeometryIndexEXT,
|
||||
EOpHitObjectGetPrimitiveIndexEXT,
|
||||
EOpHitObjectGetHitKindEXT,
|
||||
EOpHitObjectGetShaderBindingTableRecordIndexEXT,
|
||||
EOpHitObjectSetShaderBindingTableRecordIndexEXT,
|
||||
EOpHitObjectGetShaderRecordBufferHandleEXT,
|
||||
EOpHitObjectGetAttributesEXT,
|
||||
EOpHitObjectGetCurrentTimeEXT,
|
||||
EOpReorderThreadEXT,
|
||||
EOpHitObjectReorderExecuteEXT,
|
||||
EOpHitObjectTraceReorderExecuteEXT,
|
||||
EOpHitObjectTraceMotionReorderExecuteEXT,
|
||||
EOpHitObjectRecordFromQueryEXT,
|
||||
EOpHitObjectGetIntersectionTriangleVertexPositionsEXT,
|
||||
// HLSL operations
|
||||
//
|
||||
|
||||
@@ -1021,6 +1059,7 @@ enum TLinkType {
|
||||
};
|
||||
|
||||
class TIntermTraverser;
|
||||
class TIntermVariableDecl;
|
||||
class TIntermOperator;
|
||||
class TIntermAggregate;
|
||||
class TIntermUnary;
|
||||
@@ -1049,6 +1088,7 @@ public:
|
||||
virtual const glslang::TSourceLoc& getLoc() const { return loc; }
|
||||
virtual void setLoc(const glslang::TSourceLoc& l) { loc = l; }
|
||||
virtual void traverse(glslang::TIntermTraverser*) = 0;
|
||||
virtual glslang::TIntermVariableDecl* getAsVariableDecl() { return nullptr; }
|
||||
virtual glslang::TIntermTyped* getAsTyped() { return nullptr; }
|
||||
virtual glslang::TIntermOperator* getAsOperator() { return nullptr; }
|
||||
virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return nullptr; }
|
||||
@@ -1062,6 +1102,7 @@ public:
|
||||
virtual glslang::TIntermBranch* getAsBranchNode() { return nullptr; }
|
||||
virtual glslang::TIntermLoop* getAsLoopNode() { return nullptr; }
|
||||
|
||||
virtual const glslang::TIntermVariableDecl* getAsVariableDecl() const { return nullptr; }
|
||||
virtual const glslang::TIntermTyped* getAsTyped() const { return nullptr; }
|
||||
virtual const glslang::TIntermOperator* getAsOperator() const { return nullptr; }
|
||||
virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return nullptr; }
|
||||
@@ -1092,6 +1133,37 @@ struct TIntermNodePair {
|
||||
TIntermNode* node2;
|
||||
};
|
||||
|
||||
//
|
||||
// Represent declaration of a variable.
|
||||
//
|
||||
class TIntermVariableDecl : public TIntermNode {
|
||||
public:
|
||||
TIntermVariableDecl(TIntermSymbol* declSymbol, TIntermNode* initNode) : declSymbol(declSymbol), initNode(initNode)
|
||||
{
|
||||
}
|
||||
TIntermVariableDecl(const TIntermVariableDecl&) = delete;
|
||||
TIntermVariableDecl& operator=(const TIntermVariableDecl&) = delete;
|
||||
|
||||
void traverse(glslang::TIntermTraverser* traverser) override;
|
||||
|
||||
TIntermVariableDecl* getAsVariableDecl() override { return this; }
|
||||
const TIntermVariableDecl* getAsVariableDecl() const override { return this; }
|
||||
|
||||
TIntermSymbol* getDeclSymbol() { return declSymbol; }
|
||||
const TIntermSymbol* getDeclSymbol() const { return declSymbol; }
|
||||
|
||||
TIntermNode* getInitNode() { return initNode; }
|
||||
const TIntermNode* getInitNode() const { return initNode; }
|
||||
|
||||
private:
|
||||
// This symbol represents the declared variable at its declaration point.
|
||||
// It's not traversed by default. To traverse it, the visitor needs to have includeDeclSymbol enabled.
|
||||
TIntermSymbol* declSymbol = nullptr;
|
||||
|
||||
// The initializer
|
||||
TIntermNode* initNode = nullptr;
|
||||
};
|
||||
|
||||
//
|
||||
// Intermediate class for nodes that have a type.
|
||||
//
|
||||
@@ -1136,7 +1208,7 @@ protected:
|
||||
//
|
||||
class TIntermLoop : public TIntermNode {
|
||||
public:
|
||||
TIntermLoop(TIntermNode* aBody, TIntermTyped* aTest, TIntermTyped* aTerminal, bool testFirst) :
|
||||
TIntermLoop(TIntermNode* aBody, TIntermNode* aTest, TIntermTyped* aTerminal, bool testFirst) :
|
||||
body(aBody),
|
||||
test(aTest),
|
||||
terminal(aTerminal),
|
||||
@@ -1155,10 +1227,20 @@ public:
|
||||
virtual const TIntermLoop* getAsLoopNode() const { return this; }
|
||||
virtual void traverse(TIntermTraverser*);
|
||||
TIntermNode* getBody() const { return body; }
|
||||
TIntermTyped* getTest() const { return test; }
|
||||
TIntermNode* getTest() const { return test; }
|
||||
TIntermTyped* getTerminal() const { return terminal; }
|
||||
bool testFirst() const { return first; }
|
||||
|
||||
// Because the test node can be a declaration in a while loop, this function unwraps it to get the actual expression.
|
||||
TIntermTyped* getTestExpr() const {
|
||||
if (auto decl = test->getAsVariableDecl()) {
|
||||
return decl->getInitNode()->getAsTyped();
|
||||
}
|
||||
else {
|
||||
return test->getAsTyped();
|
||||
}
|
||||
}
|
||||
|
||||
void setUnroll() { unroll = true; }
|
||||
void setDontUnroll() {
|
||||
dontUnroll = true;
|
||||
@@ -1192,7 +1274,7 @@ public:
|
||||
|
||||
protected:
|
||||
TIntermNode* body; // code to loop over
|
||||
TIntermTyped* test; // exit condition associated with loop, could be 0 for 'for' loops
|
||||
TIntermNode* test; // exit condition associated with loop, could be 0 for 'for' loops
|
||||
TIntermTyped* terminal; // exists for for-loops
|
||||
bool first; // true for while and for, not for do-while
|
||||
bool unroll; // true if unroll requested
|
||||
@@ -1753,24 +1835,26 @@ enum TVisit
|
||||
class TIntermTraverser {
|
||||
public:
|
||||
POOL_ALLOCATOR_NEW_DELETE(glslang::GetThreadPoolAllocator())
|
||||
TIntermTraverser(bool preVisit = true, bool inVisit = false, bool postVisit = false, bool rightToLeft = false) :
|
||||
TIntermTraverser(bool preVisit = true, bool inVisit = false, bool postVisit = false, bool rightToLeft = false, bool includeDeclSymbol = false) :
|
||||
preVisit(preVisit),
|
||||
inVisit(inVisit),
|
||||
postVisit(postVisit),
|
||||
rightToLeft(rightToLeft),
|
||||
includeDeclSymbol(includeDeclSymbol),
|
||||
depth(0),
|
||||
maxDepth(0) { }
|
||||
virtual ~TIntermTraverser() { }
|
||||
|
||||
virtual void visitSymbol(TIntermSymbol*) { }
|
||||
virtual void visitConstantUnion(TIntermConstantUnion*) { }
|
||||
virtual bool visitBinary(TVisit, TIntermBinary*) { return true; }
|
||||
virtual bool visitUnary(TVisit, TIntermUnary*) { return true; }
|
||||
virtual bool visitSelection(TVisit, TIntermSelection*) { return true; }
|
||||
virtual bool visitAggregate(TVisit, TIntermAggregate*) { return true; }
|
||||
virtual bool visitLoop(TVisit, TIntermLoop*) { return true; }
|
||||
virtual bool visitBranch(TVisit, TIntermBranch*) { return true; }
|
||||
virtual bool visitSwitch(TVisit, TIntermSwitch*) { return true; }
|
||||
virtual void visitSymbol(TIntermSymbol*) { }
|
||||
virtual void visitConstantUnion(TIntermConstantUnion*) { }
|
||||
virtual bool visitBinary(TVisit, TIntermBinary*) { return true; }
|
||||
virtual bool visitUnary(TVisit, TIntermUnary*) { return true; }
|
||||
virtual bool visitSelection(TVisit, TIntermSelection*) { return true; }
|
||||
virtual bool visitAggregate(TVisit, TIntermAggregate*) { return true; }
|
||||
virtual bool visitLoop(TVisit, TIntermLoop*) { return true; }
|
||||
virtual bool visitBranch(TVisit, TIntermBranch*) { return true; }
|
||||
virtual bool visitSwitch(TVisit, TIntermSwitch*) { return true; }
|
||||
virtual bool visitVariableDecl(TVisit, TIntermVariableDecl*) { return true; }
|
||||
|
||||
int getMaxDepth() const { return maxDepth; }
|
||||
|
||||
@@ -1797,6 +1881,11 @@ public:
|
||||
const bool postVisit;
|
||||
const bool rightToLeft;
|
||||
|
||||
// Whether to traverse declaration symbols in the traversal.
|
||||
// By default, declaration symbols are not visited in the traversal to avoid
|
||||
// visiting them in SPIR-V generation where they are not needed.
|
||||
const bool includeDeclSymbol;
|
||||
|
||||
protected:
|
||||
TIntermTraverser& operator=(TIntermTraverser&);
|
||||
|
||||
|
||||
@@ -4830,17 +4830,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"uint", "uvec2", "uvec4",
|
||||
"uint64_t", "u64vec2", "u64vec4",
|
||||
};
|
||||
for (auto t : allTypes) {
|
||||
cooperativeMatrixFuncs << "void coopMatLoad(out coopmat m, volatile coherent nontemporal " << t << "[] buf, uint element, uint stride, int matrixLayout);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatStore(coopmat m, volatile coherent nontemporal " << t << "[] buf, uint element, uint stride, int matrixLayout);\n";
|
||||
for (auto elemTy : {"uint", "uint64_t"}) {
|
||||
for (auto t : allTypes) {
|
||||
cooperativeMatrixFuncs << "void coopMatLoad(out coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatStore(coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n";
|
||||
}
|
||||
// Just use uint8_t for buffer type, we have special matching rules to allow any conversion
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, __function f);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v, __function f);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n";
|
||||
}
|
||||
// Just use uint8_t for buffer type, we have special matching rules to allow any conversion
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, tensorViewNV v);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, __function f);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, tensorViewNV v, __function f);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t);\n";
|
||||
cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, tensorViewNV v);\n";
|
||||
}
|
||||
|
||||
cooperativeMatrixFuncs <<
|
||||
@@ -5001,49 +5003,54 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"float32_t",
|
||||
"float64_t",
|
||||
};
|
||||
for (uint32_t i = 0; i < sizeof(basicTypes)/sizeof(basicTypes[0]); ++i) {
|
||||
std::string func = std::string("void coopVecMatMulNV(out coopvecNV result, ") +
|
||||
std::string("coopvecNV v, ") +
|
||||
std::string("int inputInterpretation, ") +
|
||||
std::string(basicTypes[i]) + std::string("[] matrix, ") +
|
||||
std::string("uint matrixOffset, ") +
|
||||
std::string("int matrixInterpretation, ") +
|
||||
std::string("uint M, ") +
|
||||
std::string("uint K, ") +
|
||||
std::string("int matrixLayout, ") +
|
||||
std::string("bool transpose, ") +
|
||||
std::string("uint matrixStride);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
std::string coopVecOffsetTypes[] = {
|
||||
"uint",
|
||||
"uint64_t",
|
||||
};
|
||||
for (auto offsetTy : coopVecOffsetTypes) {
|
||||
for (uint32_t i = 0; i < sizeof(basicTypes)/sizeof(basicTypes[0]); ++i) {
|
||||
std::string func = std::string("void coopVecMatMulNV(out coopvecNV result, ") +
|
||||
std::string("coopvecNV v, ") +
|
||||
std::string("int inputInterpretation, ") +
|
||||
std::string(basicTypes[i]) + std::string("[] matrix, ") +
|
||||
offsetTy + std::string(" matrixOffset, ") +
|
||||
std::string("int matrixInterpretation, ") +
|
||||
std::string("uint M, ") +
|
||||
std::string("uint K, ") +
|
||||
std::string("int matrixLayout, ") +
|
||||
std::string("bool transpose, ") +
|
||||
std::string("uint matrixStride);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
|
||||
for (uint32_t j = 0; j < sizeof(basicTypes)/sizeof(basicTypes[0]); ++j) {
|
||||
func = std::string("void coopVecMatMulAddNV(out coopvecNV result, ") +
|
||||
std::string("coopvecNV v, ") +
|
||||
std::string("int inputInterpretation, ") +
|
||||
std::string(basicTypes[i]) + std::string("[] matrix, ") +
|
||||
std::string("uint matrixOffset, ") +
|
||||
std::string("int matrixInterpretation, ") +
|
||||
std::string(basicTypes[j]) + std::string("[] bias, ") +
|
||||
std::string("uint biasOffset, ") +
|
||||
std::string("int biasInterpretation, ") +
|
||||
std::string("uint M, ") +
|
||||
std::string("uint K, ") +
|
||||
std::string("int matrixLayout, ") +
|
||||
std::string("bool transpose, ") +
|
||||
std::string("uint matrixStride);\n");
|
||||
for (uint32_t j = 0; j < sizeof(basicTypes)/sizeof(basicTypes[0]); ++j) {
|
||||
func = std::string("void coopVecMatMulAddNV(out coopvecNV result, ") +
|
||||
std::string("coopvecNV v, ") +
|
||||
std::string("int inputInterpretation, ") +
|
||||
std::string(basicTypes[i]) + std::string("[] matrix, ") +
|
||||
offsetTy + std::string(" matrixOffset, ") +
|
||||
std::string("int matrixInterpretation, ") +
|
||||
std::string(basicTypes[j]) + std::string("[] bias, ") +
|
||||
offsetTy + std::string(" biasOffset, ") +
|
||||
std::string("int biasInterpretation, ") +
|
||||
std::string("uint M, ") +
|
||||
std::string("uint K, ") +
|
||||
std::string("int matrixLayout, ") +
|
||||
std::string("bool transpose, ") +
|
||||
std::string("uint matrixStride);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
}
|
||||
|
||||
func = std::string("void coopVecOuterProductAccumulateNV(coopvecNV v1, coopvecNV v2, ") +
|
||||
std::string(basicTypes[i]) +
|
||||
std::string("[] buf, ") + offsetTy + std::string(" offset, uint stride, int matrixLayout, int matrixInterpretation);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
|
||||
func = std::string("void coopVecReduceSumAccumulateNV(coopvecNV v, ") +
|
||||
std::string(basicTypes[i]) +
|
||||
std::string("[] buf, ") + offsetTy + std::string(" offset);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
}
|
||||
|
||||
func = std::string("void coopVecOuterProductAccumulateNV(coopvecNV v1, coopvecNV v2, ") +
|
||||
std::string(basicTypes[i]) +
|
||||
std::string("[] buf, uint offset, uint stride, int matrixLayout, int matrixInterpretation);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
|
||||
func = std::string("void coopVecReduceSumAccumulateNV(coopvecNV v, ") +
|
||||
std::string(basicTypes[i]) +
|
||||
std::string("[] buf, uint offset);\n");
|
||||
commonBuiltins.append(func.c_str());
|
||||
}
|
||||
|
||||
std::string cooperativeVectorFuncs =
|
||||
"coopvecNV fma(coopvecNV, coopvecNV, coopvecNV);\n"
|
||||
"coopvecNV min(coopvecNV, coopvecNV);\n"
|
||||
@@ -5105,13 +5112,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"f32vec4",
|
||||
"f64vec4",
|
||||
};
|
||||
for (uint32_t i = 0; i < sizeof(scalarAndVectorTypes)/sizeof(scalarAndVectorTypes[0]); ++i) {
|
||||
std::string load = std::string("void coopVecLoadNV(out coopvecNV v, volatile coherent ") +
|
||||
std::string(scalarAndVectorTypes[i]) + std::string("[] buf, uint offset);");
|
||||
std::string store = std::string("void coopVecStoreNV(coopvecNV v, volatile coherent ") +
|
||||
std::string(scalarAndVectorTypes[i]) + std::string("[] buf, uint offset);");
|
||||
commonBuiltins.append(load.c_str());
|
||||
commonBuiltins.append(store.c_str());
|
||||
|
||||
for (auto offsetTy : coopVecOffsetTypes) {
|
||||
for (uint32_t i = 0; i < sizeof(scalarAndVectorTypes)/sizeof(scalarAndVectorTypes[0]); ++i) {
|
||||
std::string load = std::string("void coopVecLoadNV(out coopvecNV v, volatile coherent ") +
|
||||
std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);");
|
||||
std::string store = std::string("void coopVecStoreNV(coopvecNV v, volatile coherent ") +
|
||||
std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);");
|
||||
commonBuiltins.append(load.c_str());
|
||||
commonBuiltins.append(store.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
commonBuiltins.append(
|
||||
@@ -5397,6 +5407,45 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);"
|
||||
"bool hitObjectIsSphereHitNV(hitObjectNV);"
|
||||
"bool hitObjectIsLSSHitNV(hitObjectNV);"
|
||||
"void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);"
|
||||
"void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);"
|
||||
"void hitObjectRecordEmptyEXT(hitObjectEXT);"
|
||||
"void hitObjectExecuteShaderEXT(hitObjectEXT,int);"
|
||||
"bool hitObjectIsEmptyEXT(hitObjectEXT);"
|
||||
"bool hitObjectIsMissEXT(hitObjectEXT);"
|
||||
"bool hitObjectIsHitEXT(hitObjectEXT);"
|
||||
"float hitObjectGetRayTMinEXT(hitObjectEXT);"
|
||||
"float hitObjectGetRayTMaxEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetRayFlagsEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);"
|
||||
"mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);"
|
||||
"mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);"
|
||||
"int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);"
|
||||
"int hitObjectGetInstanceIdEXT(hitObjectEXT);"
|
||||
"int hitObjectGetGeometryIndexEXT(hitObjectEXT);"
|
||||
"int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetHitKindEXT(hitObjectEXT);"
|
||||
"void hitObjectGetAttributesEXT(hitObjectEXT,int);"
|
||||
"float hitObjectGetCurrentTimeEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);"
|
||||
"uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);"
|
||||
"void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);"
|
||||
"void hitObjectReorderExecuteEXT(hitObjectEXT,int);"
|
||||
"void hitObjectReorderExecuteEXT(hitObjectEXT,uint,uint,int);"
|
||||
"void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,uint,uint,int);"
|
||||
"void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,uint,uint,int);"
|
||||
"void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);"
|
||||
"void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);"
|
||||
"void reorderThreadEXT(uint, uint);"
|
||||
"void reorderThreadEXT(hitObjectEXT);"
|
||||
"void reorderThreadEXT(hitObjectEXT, uint, uint);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangIntersect].append(
|
||||
"bool reportIntersectionNV(float, uint);"
|
||||
@@ -5449,6 +5498,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);"
|
||||
"bool hitObjectIsSphereHitNV(hitObjectNV);"
|
||||
"bool hitObjectIsLSSHitNV(hitObjectNV);"
|
||||
"void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);"
|
||||
"void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);"
|
||||
"void hitObjectRecordEmptyEXT(hitObjectEXT);"
|
||||
"void hitObjectExecuteShaderEXT(hitObjectEXT,int);"
|
||||
"bool hitObjectIsEmptyEXT(hitObjectEXT);"
|
||||
"bool hitObjectIsMissEXT(hitObjectEXT);"
|
||||
"bool hitObjectIsHitEXT(hitObjectEXT);"
|
||||
"float hitObjectGetRayTMinEXT(hitObjectEXT);"
|
||||
"float hitObjectGetRayTMaxEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetRayFlagsEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);"
|
||||
"mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);"
|
||||
"mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);"
|
||||
"int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);"
|
||||
"int hitObjectGetInstanceIdEXT(hitObjectEXT);"
|
||||
"int hitObjectGetGeometryIndexEXT(hitObjectEXT);"
|
||||
"int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetHitKindEXT(hitObjectEXT);"
|
||||
"void hitObjectGetAttributesEXT(hitObjectEXT,int);"
|
||||
"float hitObjectGetCurrentTimeEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);"
|
||||
"uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);"
|
||||
"void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);"
|
||||
"void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT,uint, int);"
|
||||
"void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangMiss].append(
|
||||
"void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
@@ -5493,6 +5572,36 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
"void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);"
|
||||
"bool hitObjectIsSphereHitNV(hitObjectNV);"
|
||||
"bool hitObjectIsLSSHitNV(hitObjectNV);"
|
||||
"void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
|
||||
"void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
|
||||
"void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);"
|
||||
"void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);"
|
||||
"void hitObjectRecordEmptyEXT(hitObjectEXT);"
|
||||
"void hitObjectExecuteShaderEXT(hitObjectEXT,int);"
|
||||
"bool hitObjectIsEmptyEXT(hitObjectEXT);"
|
||||
"bool hitObjectIsMissEXT(hitObjectEXT);"
|
||||
"bool hitObjectIsHitEXT(hitObjectEXT);"
|
||||
"float hitObjectGetRayTMinEXT(hitObjectEXT);"
|
||||
"float hitObjectGetRayTMaxEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetRayFlagsEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);"
|
||||
"vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);"
|
||||
"mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);"
|
||||
"mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);"
|
||||
"int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);"
|
||||
"int hitObjectGetInstanceIdEXT(hitObjectEXT);"
|
||||
"int hitObjectGetGeometryIndexEXT(hitObjectEXT);"
|
||||
"int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetHitKindEXT(hitObjectEXT);"
|
||||
"void hitObjectGetAttributesEXT(hitObjectEXT,int);"
|
||||
"float hitObjectGetCurrentTimeEXT(hitObjectEXT);"
|
||||
"uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);"
|
||||
"uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);"
|
||||
"void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);"
|
||||
"void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);"
|
||||
"void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);"
|
||||
"\n");
|
||||
stageBuiltins[EShLangCallable].append(
|
||||
"void executeCallableNV(uint, int);"
|
||||
@@ -6965,7 +7074,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
|
||||
false,
|
||||
ms ? true : false);
|
||||
|
||||
TString typeName = sampler.getString();
|
||||
TString typeName = TString{sampler.getString()};
|
||||
|
||||
addQueryFunctions(sampler, typeName, version, profile);
|
||||
addImageFunctions(sampler, typeName, version, profile);
|
||||
@@ -7068,7 +7177,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
||||
ms ? true : false);
|
||||
}
|
||||
|
||||
TString typeName = sampler.getString();
|
||||
TString typeName = TString{sampler.getString()};
|
||||
|
||||
if (dim == EsdSubpass) {
|
||||
addSubpassSampling(sampler, typeName, version, profile);
|
||||
@@ -7092,7 +7201,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
||||
// texture types.
|
||||
sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow,
|
||||
sampler.ms);
|
||||
TString textureTypeName = sampler.getString();
|
||||
TString textureTypeName = TString{sampler.getString()};
|
||||
addSamplingFunctions(sampler, textureTypeName, version, profile);
|
||||
addQueryFunctions(sampler, textureTypeName, version, profile);
|
||||
}
|
||||
@@ -9782,10 +9891,32 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
}
|
||||
|
||||
{
|
||||
symbolTable.setFunctionExtensions("coopMatLoad", 1, &E_GL_KHR_cooperative_matrix);
|
||||
symbolTable.setFunctionExtensions("coopMatStore", 1, &E_GL_KHR_cooperative_matrix);
|
||||
auto coopMatKHRCallback = [](const char *name) -> std::vector<const char *> {
|
||||
std::vector<const char *> ret;
|
||||
if (strstr(name, "u64") != nullptr) {
|
||||
ret.push_back(E_GL_EXT_shader_64bit_indexing);
|
||||
} else {
|
||||
ret.push_back(E_GL_KHR_cooperative_matrix);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
auto coopMat2NVCallback = [](const char *name) -> std::vector<const char *> {
|
||||
std::vector<const char *> ret;
|
||||
if (strstr(name, "u64") != nullptr) {
|
||||
ret.push_back(E_GL_EXT_shader_64bit_indexing);
|
||||
} else {
|
||||
ret.push_back(E_GL_NV_cooperative_matrix2);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
symbolTable.setFunctionExtensionsCallback("coopMatLoad", coopMatKHRCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopMatStore", coopMatKHRCallback);
|
||||
symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix);
|
||||
|
||||
symbolTable.setFunctionExtensionsCallback("coopMatLoadTensorNV", coopMat2NVCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopMatStoreTensorNV", coopMat2NVCallback);
|
||||
|
||||
symbolTable.setFunctionExtensions("coopMatReduceNV", 1, &E_GL_NV_cooperative_matrix2);
|
||||
symbolTable.setFunctionExtensions("coopMatPerElementNV", 1, &E_GL_NV_cooperative_matrix2);
|
||||
symbolTable.setFunctionExtensions("coopMatTransposeNV", 1, &E_GL_NV_cooperative_matrix2);
|
||||
@@ -9808,12 +9939,23 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("tensorWriteARM", 1, &E_GL_ARM_tensors);
|
||||
symbolTable.setFunctionExtensions("tensorSizeARM", 1, &E_GL_ARM_tensors);
|
||||
}
|
||||
|
||||
{
|
||||
symbolTable.setFunctionExtensions("coopVecMatMulNV", 1, &E_GL_NV_cooperative_vector);
|
||||
symbolTable.setFunctionExtensions("coopVecMatMulAddNV", 1, &E_GL_NV_cooperative_vector);
|
||||
symbolTable.setFunctionExtensions("coopVecOuterProductAccumulateNV", 1, &E_GL_NV_cooperative_vector);
|
||||
symbolTable.setFunctionExtensions("coopVecReduceSumAccumulateNV", 1, &E_GL_NV_cooperative_vector);
|
||||
auto coopVecCallback = [](const char *name) -> std::vector<const char *> {
|
||||
std::vector<const char *> ret;
|
||||
// This looks for u64 as the last parameter (the offset)
|
||||
if (strstr(name, "u641;") != nullptr) {
|
||||
ret.push_back(E_GL_EXT_shader_64bit_indexing);
|
||||
} else {
|
||||
ret.push_back(E_GL_NV_cooperative_vector);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
symbolTable.setFunctionExtensionsCallback("coopVecMatMulNV", coopVecCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopVecMatMulAddNV", coopVecCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopVecLoadNV", coopVecCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopVecStoreNV", coopVecCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopVecOuterProductAccumulateNV", coopVecCallback);
|
||||
symbolTable.setFunctionExtensionsCallback("coopVecReduceSumAccumulateNV", coopVecCallback);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -9997,6 +10139,40 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.setFunctionExtensions("hitObjectGetLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsSphereHitNV", 1, &E_GL_NV_linear_swept_spheres);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsLSSHitNV", 1, &E_GL_NV_linear_swept_spheres);
|
||||
symbolTable.setFunctionExtensions("hitObjectTraceRayEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectTraceRayMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordMissEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordMissMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectExecuteShaderEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsMissEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectIsHitEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetRayTMinEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetRayTMaxEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetRayFlagsEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetObjectToWorldEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetInstanceIdEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetHitKindEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetAttributesEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectSetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("reorderThreadEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectTraceReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectTraceMotionReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectRecordFromQueryEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
symbolTable.setFunctionExtensions("hitObjectGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_shader_invocation_reorder);
|
||||
|
||||
|
||||
BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable);
|
||||
@@ -11200,6 +11376,40 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
|
||||
symbolTable.relateToOperator("hitObjectGetLSSRadiiNV", EOpHitObjectGetLSSRadiiNV);
|
||||
symbolTable.relateToOperator("hitObjectIsSphereHitNV", EOpHitObjectIsSphereHitNV);
|
||||
symbolTable.relateToOperator("hitObjectIsLSSHitNV", EOpHitObjectIsLSSHitNV);
|
||||
symbolTable.relateToOperator("hitObjectTraceRayEXT", EOpHitObjectTraceRayEXT);
|
||||
symbolTable.relateToOperator("hitObjectTraceRayMotionEXT", EOpHitObjectTraceRayMotionEXT);
|
||||
symbolTable.relateToOperator("hitObjectRecordMissEXT", EOpHitObjectRecordMissEXT);
|
||||
symbolTable.relateToOperator("hitObjectRecordMissMotionEXT", EOpHitObjectRecordMissMotionEXT);
|
||||
symbolTable.relateToOperator("hitObjectRecordEmptyEXT", EOpHitObjectRecordEmptyEXT);
|
||||
symbolTable.relateToOperator("hitObjectExecuteShaderEXT", EOpHitObjectExecuteShaderEXT);
|
||||
symbolTable.relateToOperator("hitObjectIsEmptyEXT", EOpHitObjectIsEmptyEXT);
|
||||
symbolTable.relateToOperator("hitObjectIsMissEXT", EOpHitObjectIsMissEXT);
|
||||
symbolTable.relateToOperator("hitObjectIsHitEXT", EOpHitObjectIsHitEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetRayTMinEXT", EOpHitObjectGetRayTMinEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetRayTMaxEXT", EOpHitObjectGetRayTMaxEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetRayFlagsEXT", EOpHitObjectGetRayFlagsEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetObjectRayOriginEXT", EOpHitObjectGetObjectRayOriginEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetObjectRayDirectionEXT", EOpHitObjectGetObjectRayDirectionEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetWorldRayOriginEXT", EOpHitObjectGetWorldRayOriginEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetWorldRayDirectionEXT", EOpHitObjectGetWorldRayDirectionEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetWorldToObjectEXT", EOpHitObjectGetWorldToObjectEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetObjectToWorldEXT", EOpHitObjectGetObjectToWorldEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexEXT", EOpHitObjectGetInstanceCustomIndexEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetInstanceIdEXT", EOpHitObjectGetInstanceIdEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetGeometryIndexEXT", EOpHitObjectGetGeometryIndexEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetPrimitiveIndexEXT", EOpHitObjectGetPrimitiveIndexEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetHitKindEXT", EOpHitObjectGetHitKindEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetAttributesEXT", EOpHitObjectGetAttributesEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetCurrentTimeEXT", EOpHitObjectGetCurrentTimeEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexEXT", EOpHitObjectGetShaderBindingTableRecordIndexEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleEXT", EOpHitObjectGetShaderRecordBufferHandleEXT);
|
||||
symbolTable.relateToOperator("hitObjectSetShaderBindingTableRecordIndexEXT", EOpHitObjectSetShaderBindingTableRecordIndexEXT);
|
||||
symbolTable.relateToOperator("reorderThreadEXT", EOpReorderThreadEXT);
|
||||
symbolTable.relateToOperator("hitObjectReorderExecuteEXT", EOpHitObjectReorderExecuteEXT);
|
||||
symbolTable.relateToOperator("hitObjectTraceReorderExecuteEXT", EOpHitObjectTraceReorderExecuteEXT);
|
||||
symbolTable.relateToOperator("hitObjectTraceMotionReorderExecuteEXT", EOpHitObjectTraceMotionReorderExecuteEXT);
|
||||
symbolTable.relateToOperator("hitObjectRecordFromQueryEXT", EOpHitObjectRecordFromQueryEXT);
|
||||
symbolTable.relateToOperator("hitObjectGetIntersectionTriangleVertexPositionsEXT", EOpHitObjectGetIntersectionTriangleVertexPositionsEXT);
|
||||
}
|
||||
break;
|
||||
case EShLangIntersect:
|
||||
|
||||
@@ -306,4 +306,35 @@ void TIntermSwitch::traverse(TIntermTraverser* it)
|
||||
it->visitSwitch(EvPostVisit, this);
|
||||
}
|
||||
|
||||
//
|
||||
// Traverse a variable declaration.
|
||||
//
|
||||
void TIntermVariableDecl::traverse(TIntermTraverser *it)
|
||||
{
|
||||
bool visit = true;
|
||||
|
||||
if (it->preVisit)
|
||||
visit = it->visitVariableDecl(EvPreVisit, this);
|
||||
|
||||
if (visit) {
|
||||
it->incrementDepth(this);
|
||||
if (it->rightToLeft) {
|
||||
if (it->includeDeclSymbol)
|
||||
declSymbol->traverse(it);
|
||||
if (initNode)
|
||||
initNode->traverse(it);
|
||||
}
|
||||
else {
|
||||
if (initNode)
|
||||
initNode->traverse(it);
|
||||
if (it->includeDeclSymbol)
|
||||
declSymbol->traverse(it);
|
||||
}
|
||||
it->decrementDepth();
|
||||
}
|
||||
|
||||
if (visit && it->postVisit)
|
||||
it->visitVariableDecl(EvPostVisit, this);
|
||||
}
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
@@ -118,7 +118,8 @@ TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc
|
||||
TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc& loc)
|
||||
{
|
||||
// No operations work on blocks
|
||||
if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock)
|
||||
if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock ||
|
||||
left->getType().getBasicType() == EbtString || right->getType().getBasicType() == EbtString)
|
||||
return nullptr;
|
||||
|
||||
// Convert "reference +/- int" and "reference - reference" to integer math
|
||||
@@ -2382,7 +2383,8 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
|
||||
trueBlock = std::get<0>(children);
|
||||
falseBlock = std::get<1>(children);
|
||||
|
||||
if (trueBlock == nullptr || falseBlock == nullptr)
|
||||
if (trueBlock == nullptr || falseBlock == nullptr ||
|
||||
trueBlock->getBasicType() == EbtString || falseBlock->getBasicType() == EbtString)
|
||||
return nullptr;
|
||||
|
||||
// Handle a vector condition as a mix
|
||||
@@ -2650,7 +2652,7 @@ const TIntermTyped* TIntermediate::traverseLValueBase(const TIntermTyped* node,
|
||||
//
|
||||
// Create while and do-while loop nodes.
|
||||
//
|
||||
TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst,
|
||||
TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermNode* test, TIntermTyped* terminal, bool testFirst,
|
||||
const TSourceLoc& loc)
|
||||
{
|
||||
TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst);
|
||||
@@ -2662,7 +2664,7 @@ TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TInte
|
||||
//
|
||||
// Create a for-loop sequence.
|
||||
//
|
||||
TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test,
|
||||
TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermNode* test,
|
||||
TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TIntermLoop*& node)
|
||||
{
|
||||
node = new TIntermLoop(body, test, terminal, testFirst);
|
||||
|
||||
@@ -59,8 +59,8 @@ namespace glslang {
|
||||
class TLiveTraverser : public TIntermTraverser {
|
||||
public:
|
||||
TLiveTraverser(const TIntermediate& i, bool traverseAll = false,
|
||||
bool preVisit = true, bool inVisit = false, bool postVisit = false) :
|
||||
TIntermTraverser(preVisit, inVisit, postVisit),
|
||||
bool preVisit = true, bool inVisit = false, bool postVisit = false, bool includeDeclSymbol = false) :
|
||||
TIntermTraverser(preVisit, inVisit, postVisit, false, includeDeclSymbol),
|
||||
intermediate(i), traverseAll(traverseAll)
|
||||
{ }
|
||||
|
||||
|
||||
@@ -171,6 +171,9 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
|
||||
case EbtHitObjectNV:
|
||||
message = "can't modify hitObjectNV";
|
||||
break;
|
||||
case EbtHitObjectEXT:
|
||||
message = "can't modify hitObjectEXT";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -279,7 +282,7 @@ void TParseContextBase::trackLinkage(TSymbol& symbol)
|
||||
|
||||
// Ensure index is in bounds, correct if necessary.
|
||||
// Give an error if not.
|
||||
void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int& index)
|
||||
void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int64_t& index)
|
||||
{
|
||||
const auto sizeIsSpecializationExpression = [&type]() {
|
||||
return type.containsSpecializationSize() &&
|
||||
@@ -484,6 +487,16 @@ const TFunction* TParseContextBase::selectFunction(
|
||||
return true;
|
||||
};
|
||||
|
||||
const auto enabled = [this](const TFunction& candidate) -> bool {
|
||||
bool enabled = candidate.getNumExtensions() == 0;
|
||||
for (int i = 0; i < candidate.getNumExtensions(); ++i) {
|
||||
TExtensionBehavior behavior = getExtensionBehavior(candidate.getExtensions()[i]);
|
||||
if (behavior == EBhEnable || behavior == EBhRequire)
|
||||
enabled = true;
|
||||
}
|
||||
return enabled;
|
||||
};
|
||||
|
||||
const TFunction* incumbent = viableCandidates.front();
|
||||
for (auto it = viableCandidates.begin() + 1; it != viableCandidates.end(); ++it) {
|
||||
const TFunction& candidate = *(*it);
|
||||
@@ -499,7 +512,7 @@ const TFunction* TParseContextBase::selectFunction(
|
||||
|
||||
// In the case of default parameters, it may have an identical initial set, which is
|
||||
// also ambiguous
|
||||
if (betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate))
|
||||
if ((betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate)) && enabled(candidate))
|
||||
tie = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "Scan.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "Versions.h"
|
||||
#include "preprocessor/PpContext.h"
|
||||
@@ -404,6 +405,14 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector<TString>&
|
||||
if (tokens.size() != 1)
|
||||
error(loc, "extra tokens", "#pragma", "");
|
||||
intermediate.setReplicatedComposites();
|
||||
} else if (spvVersion.spv > 0 && tokens[0].compare("promote_uint32_indices") == 0) {
|
||||
if (tokens.size() != 1)
|
||||
error(loc, "extra tokens", "#pragma", "");
|
||||
intermediate.setPromoteUint32Indices();
|
||||
} else if (spvVersion.spv > 0 && tokens[0].compare("shader_64bit_indexing") == 0) {
|
||||
if (tokens.size() != 1)
|
||||
error(loc, "extra tokens", "#pragma", "");
|
||||
intermediate.setShader64BitIndexing();
|
||||
} else if (tokens[0].compare("once") == 0) {
|
||||
warn(loc, "not implemented", "#pragma once", "");
|
||||
} else if (tokens[0].compare("glslang_binary_double_output") == 0) {
|
||||
@@ -542,10 +551,16 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb
|
||||
//
|
||||
TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
|
||||
{
|
||||
int indexValue = 0;
|
||||
if (index->getQualifier().isFrontEndConstant())
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst();
|
||||
|
||||
int64_t indexValue = 0;
|
||||
if (index->getQualifier().isFrontEndConstant()) {
|
||||
if (index->getType().contains64BitInt()) {
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getI64Const();
|
||||
} else if (index->getType().getBasicType() == EbtUint) {
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
} else {
|
||||
indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst();
|
||||
}
|
||||
}
|
||||
// basic type checks...
|
||||
variableCheck(base);
|
||||
|
||||
@@ -624,7 +639,8 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
|
||||
TType& leftType = binaryNode->getLeft()->getWritableType();
|
||||
TArraySizes& arraySizes = *leftType.getArraySizes();
|
||||
assert(arraySizes.getNumDims() == 2);
|
||||
arraySizes.setDimSize(1, std::max(arraySizes.getDimSize(1), indexValue + 1));
|
||||
assert(indexValue < std::numeric_limits<int>::max());
|
||||
arraySizes.setDimSize(1, std::max(arraySizes.getDimSize(1), (int)indexValue + 1));
|
||||
}
|
||||
}
|
||||
} else
|
||||
@@ -972,10 +988,10 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
|
||||
// Save away the name in the AST for now. Processing is completed in
|
||||
// handleLengthMethod().
|
||||
//
|
||||
if (field == "length") {
|
||||
if (field == "length" || field == "length64") {
|
||||
if (base->isArray()) {
|
||||
profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, ".length");
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, ".length");
|
||||
profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, (TString(".") + field).c_str());
|
||||
profileRequires(loc, EEsProfile, 300, nullptr, (TString(".") + field).c_str());
|
||||
} else if (base->isVector() || base->isMatrix()) {
|
||||
const char* feature = ".length() on vectors and matrices";
|
||||
requireProfile(loc, ~EEsProfile, feature);
|
||||
@@ -986,7 +1002,12 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
|
||||
return base;
|
||||
}
|
||||
|
||||
return intermediate.addMethod(base, TType(EbtInt), &field, loc);
|
||||
if (field == "length") {
|
||||
return intermediate.addMethod(base, TType(EbtInt), &field, loc);
|
||||
} else {
|
||||
requireExtensions(loc, 1, &E_GL_EXT_shader_64bit_indexing, "length64");
|
||||
return intermediate.addMethod(base, TType(EbtInt64), &field, loc);
|
||||
}
|
||||
}
|
||||
|
||||
// It's not .length() if we get to here.
|
||||
@@ -1484,6 +1505,17 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
|
||||
i == 1 && arg->getAsTyped()->getType().getBasicType() != aggregate->getSequence()[0]->getAsTyped()->getType().getBasicType())
|
||||
error(arguments->getLoc(), "cooperative vector basic types must match", fnCandidate->getName().c_str(), "");
|
||||
|
||||
// Check that coopVecLoadNV and coopVecStoreNV buffer parameter is in buffer or shared storage
|
||||
if (builtIn && (fnCandidate->getBuiltInOp() == EOpCooperativeVectorLoadNV ||
|
||||
fnCandidate->getBuiltInOp() == EOpCooperativeVectorStoreNV) &&
|
||||
i == 1) {
|
||||
TStorageQualifier storage = arg->getAsTyped()->getType().getQualifier().storage;
|
||||
if (storage != EvqBuffer && storage != EvqShared) {
|
||||
error(arguments->getLoc(), "buffer argument must be in buffer or shared storage",
|
||||
fnCandidate->getName().c_str(), "");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO 4.5 functionality: A shader will fail to compile
|
||||
// if the value passed to the memargument of an atomic memory function does not correspond to a buffer or
|
||||
// shared variable. It is acceptable to pass an element of an array or a single component of a vector to the
|
||||
@@ -1777,7 +1809,81 @@ void TParseContext::handleCoopMat2FunctionCall(const TSourceLoc& loc, const TFun
|
||||
// Set result type to match type of first parameter
|
||||
result->setType(result->getAsAggregate()->getSequence()[0]->getAsTyped()->getType());
|
||||
} else {
|
||||
// For MulAdd, set result type to match type of C parameter
|
||||
// The only remaining operation is MulAdd
|
||||
assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd ||
|
||||
fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAddNV);
|
||||
|
||||
// Validate that the matrix sizes are compatible for multiplication and addition
|
||||
const auto &sequence = arguments->getAsAggregate()->getSequence();
|
||||
|
||||
using ArrayDim = const TArraySize&;
|
||||
auto getDim = [](const TIntermSequence& seq, int idx) -> std::tuple<ArrayDim, ArrayDim, int> {
|
||||
const auto &type = seq[idx]->getAsTyped()->getType();
|
||||
const auto *size = type.getTypeParameters()->arraySizes;
|
||||
|
||||
if (type.isCoopMatNV()) {
|
||||
// coopmatNV don't encode usage, so provide the correct usage by default
|
||||
return {size->getArraySize(2), size->getArraySize(3), idx};
|
||||
} else {
|
||||
assert(type.isCoopMatKHR());
|
||||
return {size->getArraySize(1), size->getArraySize(2), size->getDimSize(3)};
|
||||
}
|
||||
};
|
||||
|
||||
// sizes look like: [scope, rows, cols, use]
|
||||
auto [aRows, aCols, aUse] = getDim(sequence, 0);
|
||||
auto [bRows, bCols, bUse] = getDim(sequence, 1);
|
||||
auto [cRows, cCols, cUse] = getDim(sequence, 2);
|
||||
|
||||
auto toString = [](ArrayDim dim) -> std::string {
|
||||
std::stringstream buf;
|
||||
if (dim.node == nullptr) {
|
||||
buf << dim.size;
|
||||
} else {
|
||||
buf << "spec_const";
|
||||
}
|
||||
return buf.str();
|
||||
};
|
||||
|
||||
if (aCols != bRows) {
|
||||
auto aRowsStr = toString(aRows);
|
||||
auto aColsStr = toString(aCols);
|
||||
auto bRowsStr = toString(bRows);
|
||||
auto bColsStr = toString(bCols);
|
||||
error(loc, "cannot multiply coop matrices with incompatible sizes",
|
||||
sequence[0]->getAsSymbolNode()->getMangledName().c_str(),
|
||||
"%s x %s with %s x %s",
|
||||
aRowsStr.c_str(),
|
||||
aColsStr.c_str(),
|
||||
bRowsStr.c_str(),
|
||||
bColsStr.c_str());
|
||||
} else if (aRows != cRows || bCols != cCols) {
|
||||
auto aRowsStr = toString(aRows);
|
||||
auto bColsStr = toString(bCols);
|
||||
auto cRowsStr = toString(cRows);
|
||||
auto cColsStr = toString(cCols);
|
||||
error(loc, "cannot add coop matrices with incompatible sizes",
|
||||
sequence[2]->getAsSymbolNode()->getMangledName().c_str(),
|
||||
"%s x %s with %s x %s",
|
||||
aRowsStr.c_str(),
|
||||
bColsStr.c_str(),
|
||||
cRowsStr.c_str(),
|
||||
cColsStr.c_str());
|
||||
} else if (aUse != 0) {
|
||||
error(loc, "coop matrix A in MulAdd operation has incompatible usage property,",
|
||||
sequence[0]->getAsSymbolNode()->getMangledName().c_str(),
|
||||
"found %d, but needed 0", aUse);
|
||||
} else if (bUse != 1) {
|
||||
error(loc, "coop matrix B in MulAdd operation has incompatible usage property,",
|
||||
sequence[1]->getAsSymbolNode()->getMangledName().c_str(),
|
||||
"found %d, but needed 1", bUse);
|
||||
} else if (cUse != 2) {
|
||||
error(loc, "coop matrix C in MulAdd operation has incompatible usage property,",
|
||||
sequence[2]->getAsSymbolNode()->getMangledName().c_str(),
|
||||
"found %d, but needed 2", cUse);
|
||||
}
|
||||
|
||||
// Set result type to match type of C parameter
|
||||
result->setType(result->getAsAggregate()->getSequence()[2]->getAsTyped()->getType());
|
||||
}
|
||||
}
|
||||
@@ -1789,9 +1895,9 @@ static const uint32_t spv_Scope_Subgroup = 3;
|
||||
void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, const TFunction* fnCandidate,
|
||||
TIntermTyped*& result, TIntermNode* arguments)
|
||||
{
|
||||
const int CM_MatrixUseA = 0; // == gl_MatrixUseA
|
||||
const int CM_MatrixUseB = 1; // == gl_MatrixUseB
|
||||
const int CM_MatrixUseAccumulator = 2; // == gl_MatrixUseAccumulator
|
||||
const uint32_t CM_MatrixUseA = 0; // == gl_MatrixUseA
|
||||
const uint32_t CM_MatrixUseB = 1; // == gl_MatrixUseB
|
||||
const uint32_t CM_MatrixUseAccumulator = 2; // == gl_MatrixUseAccumulator
|
||||
|
||||
TOperator builtinOp = fnCandidate->getBuiltInOp();
|
||||
|
||||
@@ -1883,7 +1989,7 @@ void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, co
|
||||
error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", "");
|
||||
}
|
||||
|
||||
if (coopMatKHRuse < CM_MatrixUseA || coopMatKHRuse > CM_MatrixUseAccumulator) {
|
||||
if (coopMatKHRuse > CM_MatrixUseAccumulator) {
|
||||
coopMatKHRuse = CM_MatrixUseA;
|
||||
error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator",
|
||||
"", "");
|
||||
@@ -1961,7 +2067,7 @@ void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, co
|
||||
error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", "");
|
||||
}
|
||||
|
||||
if (coopMatKHRuse < CM_MatrixUseA || coopMatKHRuse > CM_MatrixUseAccumulator) {
|
||||
if (coopMatKHRuse > CM_MatrixUseAccumulator) {
|
||||
coopMatKHRuse = CM_MatrixUseA;
|
||||
error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator",
|
||||
"", "");
|
||||
@@ -2354,7 +2460,7 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction
|
||||
error(loc, "", function->getName().c_str(), "array must first be sized by a redeclaration or layout qualifier");
|
||||
else if (isRuntimeLength(*intermNode->getAsTyped())) {
|
||||
// Create a unary op and let the back end handle it
|
||||
return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt));
|
||||
return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, function->getType());
|
||||
} else
|
||||
error(loc, "", function->getName().c_str(), "array must be declared with a size before using this method");
|
||||
}
|
||||
@@ -2737,6 +2843,19 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
|
||||
TString featureString;
|
||||
const char* feature = nullptr;
|
||||
|
||||
auto checkConstantArgWithLocation = [&](int argIndex, const char* argDescription,
|
||||
const char* errMsg, int ioRTLocationSet) {
|
||||
//ioRTLocationSet refers to grouping of locations of RT input/outputs as defined in TIntermediate::usedIoRT
|
||||
if (!(*argp)[argIndex]->getAsConstantUnion()) {
|
||||
error(loc, "argument must be compile-time constant", argDescription, argIndex == 10 ? "a" : "");
|
||||
} else if (ioRTLocationSet >= 0) {
|
||||
unsigned int location = (*argp)[argIndex]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(ioRTLocationSet, location) < 0)
|
||||
error(loc, "with layout(location =", errMsg, "%d)", location);
|
||||
}
|
||||
};
|
||||
|
||||
switch (callNode.getOp()) {
|
||||
case EOpTextureGather:
|
||||
case EOpTextureGatherOffset:
|
||||
@@ -3026,108 +3145,46 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case EOpTraceNV:
|
||||
if (!(*argp)[10]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "a");
|
||||
checkConstantArgWithLocation(10, "payload number", nullptr, -1);
|
||||
break;
|
||||
case EOpTraceRayMotionNV:
|
||||
if (!(*argp)[11]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "a");
|
||||
checkConstantArgWithLocation(11, "payload number", nullptr, -1);
|
||||
break;
|
||||
case EOpTraceKHR:
|
||||
if (!(*argp)[10]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "a");
|
||||
else {
|
||||
unsigned int location = (*argp)[10]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(10, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0);
|
||||
break;
|
||||
case EOpExecuteCallableNV:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "callable data number", "");
|
||||
checkConstantArgWithLocation(1, "callable data number", nullptr, -1);
|
||||
break;
|
||||
case EOpExecuteCallableKHR:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "callable data number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(1, location) < 0)
|
||||
error(loc, "with layout(location =", "no callableDataEXT/callableDataInEXT declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(1, "callable data number", "no callableDataEXT/callableDataInEXT declared", 1);
|
||||
break;
|
||||
|
||||
case EOpHitObjectTraceRayNV:
|
||||
if (!(*argp)[11]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(11, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0);
|
||||
break;
|
||||
case EOpHitObjectTraceRayMotionNV:
|
||||
if (!(*argp)[12]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(12, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0);
|
||||
break;
|
||||
case EOpHitObjectExecuteShaderNV:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "payload number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
|
||||
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(1, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0);
|
||||
break;
|
||||
case EOpHitObjectRecordHitNV:
|
||||
if (!(*argp)[12]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(12, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2);
|
||||
break;
|
||||
case EOpHitObjectRecordHitMotionNV:
|
||||
if (!(*argp)[13]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[13]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(13, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2);
|
||||
break;
|
||||
case EOpHitObjectRecordHitWithIndexNV:
|
||||
if (!(*argp)[11]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(11, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2);
|
||||
break;
|
||||
case EOpHitObjectRecordHitWithIndexMotionNV:
|
||||
if (!(*argp)[12]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(12, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2);
|
||||
break;
|
||||
case EOpHitObjectGetAttributesNV:
|
||||
if (!(*argp)[1]->getAsConstantUnion())
|
||||
error(loc, "argument must be compile-time constant", "hitobjectattribute number", "");
|
||||
else {
|
||||
unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
|
||||
if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0)
|
||||
error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location);
|
||||
}
|
||||
checkConstantArgWithLocation(1, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2);
|
||||
break;
|
||||
|
||||
case EOpRayQueryGetIntersectionType:
|
||||
@@ -4098,6 +4155,21 @@ void TParseContext::integerCheck(const TIntermTyped* node, const char* token)
|
||||
error(node->getLoc(), "scalar integer expression required", token, "");
|
||||
}
|
||||
|
||||
//
|
||||
// Both test, and if necessary spit out an error, to see if the node is really
|
||||
// supported as an array index.
|
||||
//
|
||||
void TParseContext::arrayIndexCheck(const TIntermTyped* node, const char* token)
|
||||
{
|
||||
auto from_type = node->getBasicType();
|
||||
|
||||
if ((from_type == EbtInt64 || from_type == EbtUint64) &&
|
||||
extensionTurnedOn(E_GL_EXT_shader_64bit_indexing))
|
||||
return;
|
||||
|
||||
integerCheck(node, token);
|
||||
}
|
||||
|
||||
//
|
||||
// Both test, and if necessary spit out an error, to see if we are currently
|
||||
// globally scoped.
|
||||
@@ -4773,11 +4845,22 @@ void TParseContext::accStructCheck(const TSourceLoc& loc, const TType& type, con
|
||||
|
||||
}
|
||||
|
||||
void TParseContext::hitObjectEXTCheck(const TSourceLoc & loc, const TType & type, const TString & identifier)
|
||||
{
|
||||
if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtHitObjectEXT)) {
|
||||
error(loc, "struct is not allowed to contain hitObjectEXT:", type.getTypeName().c_str(), identifier.c_str());
|
||||
} else if (type.getBasicType() == EbtHitObjectEXT) {
|
||||
TStorageQualifier qualifier = type.getQualifier().storage;
|
||||
if (qualifier != EvqGlobal && qualifier != EvqTemporary) {
|
||||
error(loc, "hitObjectEXT can only be declared in global or function scope with no storage qualifier:", "hitObjectEXT", identifier.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
void TParseContext::hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier)
|
||||
{
|
||||
if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtHitObjectNV)) {
|
||||
if (type.getBasicType() == EbtStruct && ( containsFieldWithBasicType(type, EbtHitObjectNV))) {
|
||||
error(loc, "struct is not allowed to contain hitObjectNV:", type.getTypeName().c_str(), identifier.c_str());
|
||||
} else if (type.getBasicType() == EbtHitObjectNV) {
|
||||
} else if ((type.getBasicType() == EbtHitObjectNV)) {
|
||||
TStorageQualifier qualifier = type.getQualifier().storage;
|
||||
if (qualifier != EvqGlobal && qualifier != EvqTemporary) {
|
||||
error(loc, "hitObjectNV can only be declared in global or function scope with no storage qualifier:", "hitObjectNV", identifier.c_str());
|
||||
@@ -5502,6 +5585,9 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua
|
||||
if (qualifier.storage == EvqBuffer && lastMember)
|
||||
return;
|
||||
|
||||
if (qualifier.storage == EvqUniform && lastMember && extensionTurnedOn(E_GL_EXT_uniform_buffer_unsized_array))
|
||||
return;
|
||||
|
||||
arraySizeRequiredCheck(loc, *arraySizes);
|
||||
}
|
||||
|
||||
@@ -5626,6 +5712,20 @@ void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermType
|
||||
}
|
||||
}
|
||||
|
||||
// Check for last member of a uniform block, which can be runtime sizeable
|
||||
// when using GL_EXT_uniform_buffer_unsized_array
|
||||
if (base.getType().getQualifier().storage == EvqUniform && extensionTurnedOn(E_GL_EXT_uniform_buffer_unsized_array)) {
|
||||
const TIntermBinary* binary = base.getAsBinaryNode();
|
||||
if (binary != nullptr &&
|
||||
binary->getOp() == EOpIndexDirectStruct) {
|
||||
|
||||
const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst();
|
||||
const int memberCount = (int)binary->getLeft()->getType().getStruct()->size();
|
||||
if (index == memberCount - 1)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// check for additional things allowed by GL_EXT_nonuniform_qualifier
|
||||
if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStruct || base.getBasicType() == EbtRayQuery ||
|
||||
base.getBasicType() == EbtHitObjectNV || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer()))
|
||||
@@ -6334,9 +6434,9 @@ void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init,
|
||||
inductiveLoopIds.insert(loopIndex);
|
||||
|
||||
// condition's form must be "loop-index relational-operator constant-expression"
|
||||
bool badCond = ! loop->getTest();
|
||||
bool badCond = ! loop->getTestExpr();
|
||||
if (! badCond) {
|
||||
TIntermBinary* binaryCond = loop->getTest()->getAsBinaryNode();
|
||||
TIntermBinary* binaryCond = loop->getTestExpr()->getAsBinaryNode();
|
||||
badCond = ! binaryCond;
|
||||
if (! badCond) {
|
||||
switch (binaryCond->getOp()) {
|
||||
@@ -6736,8 +6836,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
||||
}
|
||||
for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) {
|
||||
if (id == TQualifier::getLayoutDepthString(depth)) {
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile, "depth layout qualifier");
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, nullptr, "depth layout qualifier");
|
||||
const char* feature = "depth layout qualifier";
|
||||
requireProfile(loc, ECoreProfile | ECompatibilityProfile | EEsProfile, feature);
|
||||
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, E_GL_ARB_conservative_depth, feature);
|
||||
profileRequires(loc, EEsProfile, 0, E_GL_EXT_conservative_depth, feature);
|
||||
publicType.shaderQualifiers.layoutDepth = depth;
|
||||
return;
|
||||
}
|
||||
@@ -6827,6 +6929,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
||||
requireExtensions(loc, 1, &E_GL_NV_shader_invocation_reorder, "hitobject shader record NV");
|
||||
publicType.qualifier.layoutHitObjectShaderRecordNV = true;
|
||||
return;
|
||||
} else if (id == "hitobjectshaderrecordext") {
|
||||
requireExtensions(loc, 1, &E_GL_EXT_shader_invocation_reorder, "hitobject shader record EXT");
|
||||
publicType.qualifier.layoutHitObjectShaderRecordEXT = true;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7342,6 +7448,8 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
|
||||
if (src.layoutHitObjectShaderRecordNV)
|
||||
dst.layoutHitObjectShaderRecordNV = true;
|
||||
dst.layoutTileAttachmentQCOM |= src.layoutTileAttachmentQCOM;
|
||||
if (src.layoutHitObjectShaderRecordEXT)
|
||||
dst.layoutHitObjectShaderRecordEXT = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7508,6 +7616,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
case EvqCallableData:
|
||||
case EvqCallableDataIn:
|
||||
case EvqHitObjectAttrNV:
|
||||
case EvqHitObjectAttrEXT:
|
||||
case EvqSpirvStorageClass:
|
||||
break;
|
||||
case EvqTileImageEXT:
|
||||
@@ -8905,7 +9014,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
|
||||
if (initializer) {
|
||||
if (type.getBasicType() == EbtRayQuery) {
|
||||
error(loc, "ray queries can only be initialized by using the rayQueryInitializeEXT intrinsic:", "=", identifier.c_str());
|
||||
} else if (type.getBasicType() == EbtHitObjectNV) {
|
||||
} else if ((type.getBasicType() == EbtHitObjectNV) || (type.getBasicType() == EbtHitObjectEXT)) {
|
||||
error(loc, "hit objects cannot be initialized using initializers", "=", identifier.c_str());
|
||||
}
|
||||
|
||||
@@ -9005,6 +9114,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
|
||||
atomicUintCheck(loc, type, identifier);
|
||||
accStructCheck(loc, type, identifier);
|
||||
hitObjectNVCheck(loc, type, identifier);
|
||||
hitObjectEXTCheck(loc, type, identifier);
|
||||
checkAndResizeMeshViewDim(loc, type, /*isBlockMember*/ false);
|
||||
if (type.getQualifier().storage == EvqConst && type.containsReference()) {
|
||||
error(loc, "variables with reference type can't have qualifier 'const'", "qualifier", "");
|
||||
@@ -9109,7 +9219,22 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
|
||||
// fix up
|
||||
fixOffset(loc, *symbol);
|
||||
|
||||
return initNode;
|
||||
// TODO: The decl AST is turned on based on debug info right now. We should expose it as an explicit option.
|
||||
if (intermediate.getDebugInfo()) {
|
||||
TVariable* variable = symbol->getAsVariable();
|
||||
if (variable) {
|
||||
auto decl = new TIntermVariableDecl(intermediate.addSymbol(*variable, loc), initNode);
|
||||
decl->setLoc(loc);
|
||||
return decl;
|
||||
}
|
||||
else {
|
||||
// We ignore builtins redeclarations
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return initNode;
|
||||
}
|
||||
}
|
||||
|
||||
// Pick up global defaults from the provide global defaults into dst.
|
||||
@@ -10030,9 +10155,9 @@ void TParseContext::updateBindlessQualifier(TType& memberType)
|
||||
}
|
||||
|
||||
//
|
||||
// Do everything needed to add an interface block.
|
||||
// Do everything needed to add an interface block. Returns the declarator node if there's an instance declaration.
|
||||
//
|
||||
void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName,
|
||||
TIntermNode* TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName,
|
||||
TArraySizes* arraySizes)
|
||||
{
|
||||
if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed)
|
||||
@@ -10098,7 +10223,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
|
||||
// do all the rest.
|
||||
if (! symbolTable.atBuiltInLevel() && builtInName(*blockName)) {
|
||||
redeclareBuiltinBlock(loc, typeList, *blockName, instanceName, arraySizes);
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Not a redeclaration of a built-in; check that all names are user names.
|
||||
@@ -10264,7 +10389,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
|
||||
}
|
||||
}
|
||||
if (!instanceName) {
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
//
|
||||
@@ -10287,11 +10412,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
|
||||
if (existingName->getType().getBasicType() == EbtBlock) {
|
||||
if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) {
|
||||
error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString());
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
error(loc, "block name cannot redefine a non-block name", blockName->c_str(), "");
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10308,7 +10433,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
|
||||
else
|
||||
error(loc, "block instance name redefinition", variable.getName().c_str(), "");
|
||||
|
||||
return;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Check for general layout qualifier errors
|
||||
@@ -10323,6 +10448,17 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
|
||||
|
||||
// Save it in the AST for linker use.
|
||||
trackLinkage(variable);
|
||||
|
||||
TIntermAggregate* declNode = nullptr;
|
||||
if (intermediate.getDebugInfo()) {
|
||||
auto blockDeclNode = new TIntermVariableDecl(intermediate.addSymbol(variable, loc), nullptr);
|
||||
blockDeclNode->setLoc(loc);
|
||||
|
||||
// We have to wrap the declaration with a sequence to fit the same processing logic with variables.
|
||||
declNode = new TIntermAggregate(EOpSequence);
|
||||
declNode->getSequence().push_back(blockDeclNode);
|
||||
}
|
||||
return declNode;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -10411,6 +10547,10 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q
|
||||
profileRequires(loc, ~EEsProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV block");
|
||||
requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeNV block");
|
||||
break;
|
||||
case EvqHitObjectAttrEXT:
|
||||
profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT block");
|
||||
requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeEXT block");
|
||||
break;
|
||||
default:
|
||||
error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
|
||||
break;
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
|
||||
virtual void setLimits(const TBuiltInResource&) = 0;
|
||||
|
||||
void checkIndex(const TSourceLoc&, const TType&, int& index);
|
||||
void checkIndex(const TSourceLoc&, const TType&, int64_t& index);
|
||||
|
||||
EShLanguage getLanguage() const { return language; }
|
||||
void setScanContext(TScanContext* c) { scanContext = c; }
|
||||
@@ -381,6 +381,7 @@ public:
|
||||
void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;
|
||||
void constantValueCheck(TIntermTyped* node, const char* token);
|
||||
void integerCheck(const TIntermTyped* node, const char* token);
|
||||
void arrayIndexCheck(const TIntermTyped* node, const char* token);
|
||||
void globalCheck(const TSourceLoc&, const char* token);
|
||||
bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&);
|
||||
bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&);
|
||||
@@ -397,6 +398,7 @@ public:
|
||||
void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer);
|
||||
void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||
void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier);
|
||||
void hitObjectEXTCheck(const TSourceLoc& loc, const TType& type, const TString& identifier);
|
||||
void hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier);
|
||||
void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier);
|
||||
void memberQualifierCheck(glslang::TPublicType&);
|
||||
@@ -454,7 +456,7 @@ public:
|
||||
TParameter getParamWithDefault(const TPublicType& ty, TString* identifier, TIntermTyped* initializer,
|
||||
const TSourceLoc& loc);
|
||||
void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to);
|
||||
void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr);
|
||||
TIntermNode* declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr);
|
||||
void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&);
|
||||
void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
|
||||
void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace glslang {
|
||||
// Code to recursively delete the intermediate tree.
|
||||
//
|
||||
struct TRemoveTraverser : TIntermTraverser {
|
||||
TRemoveTraverser() : TIntermTraverser(false, false, true, false) {}
|
||||
TRemoveTraverser() : TIntermTraverser(false, false, true, false, true) {}
|
||||
|
||||
virtual void visitSymbol(TIntermSymbol* node)
|
||||
{
|
||||
@@ -103,6 +103,12 @@ struct TRemoveTraverser : TIntermTraverser {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* decl)
|
||||
{
|
||||
delete decl;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
@@ -771,6 +771,9 @@ const std::unordered_map<const char*, int, str_hash, str_eq> KeywordMap {
|
||||
|
||||
{"tensorARM",TENSORARM},
|
||||
|
||||
{"hitObjectEXT",HITOBJECTEXT},
|
||||
{"hitObjectAttributeEXT",HITOBJECTATTREXT},
|
||||
|
||||
{"__function",FUNCTION},
|
||||
{"tensorLayoutNV",TENSORLAYOUTNV},
|
||||
{"tensorViewNV",TENSORVIEWNV},
|
||||
@@ -1917,6 +1920,13 @@ int TScanContext::tokenizeIdentifier()
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case HITOBJECTEXT:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 460
|
||||
&& parseContext.extensionTurnedOn(E_GL_EXT_shader_invocation_reorder)))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case HITOBJECTATTRNV:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 460
|
||||
@@ -1924,6 +1934,13 @@ int TScanContext::tokenizeIdentifier()
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case HITOBJECTATTREXT:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() ||
|
||||
(!parseContext.isEsProfile() && parseContext.version >= 460
|
||||
&& parseContext.extensionTurnedOn(E_GL_EXT_shader_invocation_reorder)))
|
||||
return keyword;
|
||||
return identifierOrType();
|
||||
|
||||
case FUNCTION:
|
||||
case TENSORLAYOUTNV:
|
||||
case TENSORVIEWNV:
|
||||
|
||||
@@ -86,6 +86,7 @@ void TType::buildMangledName(TString& mangledName) const
|
||||
case EbtRayQuery: mangledName += "rq"; break;
|
||||
case EbtSpirvType: mangledName += "spv-t"; break;
|
||||
case EbtHitObjectNV: mangledName += "ho"; break;
|
||||
case EbtHitObjectEXT: mangledName += "ho"; break;
|
||||
case EbtTensorLayoutNV: mangledName += "tl"; break;
|
||||
case EbtTensorViewNV: mangledName += "tv"; break;
|
||||
case EbtSampler:
|
||||
@@ -346,6 +347,24 @@ void TSymbolTableLevel::setFunctionExtensions(const char* name, int num, const c
|
||||
}
|
||||
}
|
||||
|
||||
// Call the callback function to determine the required extensions
|
||||
void TSymbolTableLevel::setFunctionExtensionsCallback(const char* name, std::function<std::vector<const char *>(const char *)> const &func)
|
||||
{
|
||||
tLevel::const_iterator candidate = level.lower_bound(name);
|
||||
while (candidate != level.end()) {
|
||||
const TString& candidateName = (*candidate).first;
|
||||
TString::size_type parenAt = candidateName.find_first_of('(');
|
||||
if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0) {
|
||||
TSymbol* symbol = candidate->second;
|
||||
|
||||
auto exts = func(candidateName.c_str());
|
||||
symbol->setExtensions(exts.size(), exts.data());
|
||||
} else
|
||||
break;
|
||||
++candidate;
|
||||
}
|
||||
}
|
||||
|
||||
// Make a single function require an extension(s). i.e., this will only set the extensions for the symbol that matches 'name' exactly.
|
||||
// This is different from setFunctionExtensions, which uses std::map::lower_bound to effectively set all symbols that start with 'name'.
|
||||
// Should only be used for a version/profile that actually needs the extension(s).
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
#include "../Include/intermediate.h"
|
||||
#include "../Include/InfoSink.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace glslang {
|
||||
|
||||
//
|
||||
@@ -596,6 +598,7 @@ public:
|
||||
|
||||
void relateToOperator(const char* name, TOperator op);
|
||||
void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
|
||||
void setFunctionExtensionsCallback(const char* name, std::function<std::vector<const char *>(const char *)> const &func);
|
||||
void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]);
|
||||
void dump(TInfoSink& infoSink, bool complete = false) const;
|
||||
TSymbolTableLevel* clone() const;
|
||||
@@ -898,6 +901,12 @@ public:
|
||||
table[level]->setFunctionExtensions(name, num, extensions);
|
||||
}
|
||||
|
||||
void setFunctionExtensionsCallback(const char* name, std::function<std::vector<const char *>(const char *)> const &func)
|
||||
{
|
||||
for (unsigned int level = 0; level < table.size(); ++level)
|
||||
table[level]->setFunctionExtensionsCallback(name, func);
|
||||
}
|
||||
|
||||
void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[])
|
||||
{
|
||||
for (unsigned int level = 0; level < table.size(); ++level)
|
||||
|
||||
@@ -229,6 +229,7 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_bindless_texture] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_fragment_coord_conventions] = EBhDisable;
|
||||
extensionBehavior[E_GL_ARB_conservative_depth] = EBhDisable;
|
||||
|
||||
|
||||
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
|
||||
@@ -385,6 +386,9 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
extensionBehavior[E_GL_EXT_bfloat16] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_e4m3] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_float_e5m2] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_uniform_buffer_unsized_array] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_shader_64bit_indexing] = EBhDisable;
|
||||
extensionBehavior[E_GL_EXT_conservative_depth] = EBhDisable;
|
||||
|
||||
// OVR extensions
|
||||
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
|
||||
@@ -410,6 +414,8 @@ void TParseVersions::initializeExtensionBehavior()
|
||||
|
||||
extensionBehavior[E_GL_EXT_integer_dot_product] = EBhDisable;
|
||||
|
||||
extensionBehavior[E_GL_EXT_shader_invocation_reorder] = EBhDisable;
|
||||
|
||||
// Record extensions not for spv.
|
||||
spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture);
|
||||
}
|
||||
@@ -431,6 +437,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_shader_texture_lod 1\n"
|
||||
"#define GL_EXT_shadow_samplers 1\n"
|
||||
"#define GL_EXT_fragment_shading_rate 1\n"
|
||||
"#define GL_EXT_conservative_depth 1\n"
|
||||
|
||||
// AEP
|
||||
"#define GL_ANDROID_extension_pack_es31a 1\n"
|
||||
@@ -520,6 +527,7 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_NV_gpu_shader5 1\n"
|
||||
"#define GL_ARB_draw_instanced 1\n"
|
||||
"#define GL_ARB_fragment_coord_conventions 1\n"
|
||||
"#define GL_ARB_conservative_depth 1\n"
|
||||
|
||||
"#define GL_EXT_shader_non_constant_global_initializers 1\n"
|
||||
"#define GL_EXT_shader_image_load_formatted 1\n"
|
||||
@@ -627,6 +635,10 @@ void TParseVersions::getPreamble(std::string& preamble)
|
||||
"#define GL_EXT_bfloat16 1\n"
|
||||
"#define GL_EXT_float_e5m2 1\n"
|
||||
"#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_shader_invocation_reorder 1\n"
|
||||
;
|
||||
|
||||
if (spvVersion.spv == 0) {
|
||||
|
||||
@@ -165,6 +165,7 @@ const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_
|
||||
const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced";
|
||||
const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions";
|
||||
const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture";
|
||||
const char* const E_GL_ARB_conservative_depth = "GL_ARB_conservative_depth";
|
||||
|
||||
const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
|
||||
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
|
||||
@@ -226,6 +227,8 @@ const char* const E_GL_EXT_control_flow_attributes2 = "GL_EXT_control_fl
|
||||
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";
|
||||
const char* const E_GL_EXT_uniform_buffer_unsized_array = "GL_EXT_uniform_buffer_unsized_array";
|
||||
const char* const E_GL_EXT_conservative_depth = "GL_EXT_conservative_depth";
|
||||
|
||||
// Arrays of extensions for the above viewportEXTs duplications
|
||||
|
||||
@@ -364,6 +367,10 @@ 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_shader_64bit_indexing = "GL_EXT_shader_64bit_indexing";
|
||||
|
||||
const char* const E_GL_EXT_shader_invocation_reorder = "GL_EXT_shader_invocation_reorder";
|
||||
|
||||
// Arrays of extensions for the above AEP duplications
|
||||
|
||||
const char* const AEP_geometry_shader[] = { E_GL_EXT_geometry_shader, E_GL_OES_geometry_shader };
|
||||
|
||||
@@ -182,7 +182,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
|
||||
%token <lex> COOPMAT
|
||||
%token <lex> COOPVECNV
|
||||
%token <lex> HITOBJECTNV HITOBJECTATTRNV
|
||||
%token <lex> HITOBJECTNV HITOBJECTATTRNV HITOBJECTEXT HITOBJECTATTREXT
|
||||
%token <lex> TENSORLAYOUTNV TENSORVIEWNV
|
||||
%token <lex> TENSORARM
|
||||
|
||||
@@ -298,7 +298,8 @@ extern int yylex(YYSTYPE*, TParseContext&);
|
||||
%type <interm.intermTypedNode> conditional_expression constant_expression
|
||||
%type <interm.intermTypedNode> logical_or_expression logical_xor_expression logical_and_expression
|
||||
%type <interm.intermTypedNode> shift_expression and_expression exclusive_or_expression inclusive_or_expression
|
||||
%type <interm.intermTypedNode> function_call initializer condition conditionopt
|
||||
%type <interm.intermTypedNode> function_call initializer
|
||||
%type <interm.intermNode> condition conditionopt
|
||||
|
||||
%type <interm.intermNode> translation_unit function_definition
|
||||
%type <interm.intermNode> statement simple_statement
|
||||
@@ -451,7 +452,7 @@ postfix_expression
|
||||
|
||||
integer_expression
|
||||
: expression {
|
||||
parseContext.integerCheck($1, "[]");
|
||||
parseContext.arrayIndexCheck($1, "[]");
|
||||
$$ = $1;
|
||||
}
|
||||
;
|
||||
@@ -555,7 +556,7 @@ function_identifier
|
||||
|
||||
TIntermMethod* method = $1->getAsMethodNode();
|
||||
if (method) {
|
||||
$$.function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength);
|
||||
$$.function = new TFunction(&method->getMethodName(), method->getType(), EOpArrayLength);
|
||||
$$.intermNode = method->getObject();
|
||||
} else {
|
||||
TIntermSymbol* symbol = $1->getAsSymbolNode();
|
||||
@@ -912,16 +913,13 @@ declaration
|
||||
$$ = 0;
|
||||
}
|
||||
| block_structure SEMICOLON {
|
||||
parseContext.declareBlock($1.loc, *$1.typeList);
|
||||
$$ = 0;
|
||||
$$ = parseContext.declareBlock($1.loc, *$1.typeList);
|
||||
}
|
||||
| block_structure IDENTIFIER SEMICOLON {
|
||||
parseContext.declareBlock($1.loc, *$1.typeList, $2.string);
|
||||
$$ = 0;
|
||||
$$ = parseContext.declareBlock($1.loc, *$1.typeList, $2.string);
|
||||
}
|
||||
| block_structure IDENTIFIER array_specifier SEMICOLON {
|
||||
parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes);
|
||||
$$ = 0;
|
||||
$$ = parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes);
|
||||
}
|
||||
| type_qualifier SEMICOLON {
|
||||
parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
|
||||
@@ -1164,21 +1162,23 @@ init_declarator_list
|
||||
}
|
||||
| init_declarator_list COMMA IDENTIFIER {
|
||||
$$ = $1;
|
||||
parseContext.declareVariable($3.loc, *$3.string, $1.type);
|
||||
TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $3.loc);
|
||||
}
|
||||
| init_declarator_list COMMA IDENTIFIER array_specifier {
|
||||
$$ = $1;
|
||||
parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes);
|
||||
TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $3.loc);
|
||||
}
|
||||
| init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer {
|
||||
$$.type = $1.type;
|
||||
TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $5.loc);
|
||||
TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $5.loc);
|
||||
}
|
||||
| init_declarator_list COMMA IDENTIFIER EQUAL initializer {
|
||||
$$.type = $1.type;
|
||||
TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $4.loc);
|
||||
TIntermNode* declNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, declNode, $4.loc);
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1190,23 +1190,24 @@ single_declaration
|
||||
}
|
||||
| fully_specified_type IDENTIFIER {
|
||||
$$.type = $1;
|
||||
$$.intermNode = 0;
|
||||
parseContext.declareVariable($2.loc, *$2.string, $1);
|
||||
TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc);
|
||||
|
||||
}
|
||||
| fully_specified_type IDENTIFIER array_specifier {
|
||||
$$.type = $1;
|
||||
$$.intermNode = 0;
|
||||
parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes);
|
||||
TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc);
|
||||
}
|
||||
| fully_specified_type IDENTIFIER array_specifier EQUAL initializer {
|
||||
$$.type = $1;
|
||||
TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $4.loc);
|
||||
TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc);
|
||||
}
|
||||
| fully_specified_type IDENTIFIER EQUAL initializer {
|
||||
$$.type = $1;
|
||||
TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $3.loc);
|
||||
TIntermNode* declNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
|
||||
$$.intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, $2.loc);
|
||||
}
|
||||
|
||||
// Grammar Note: No 'enum', or 'typedef'.
|
||||
@@ -1537,14 +1538,22 @@ storage_qualifier
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitAttr;
|
||||
}
|
||||
| HITOBJECTATTRNV {
|
||||
| HITOBJECTATTRNV {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeNV");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask
|
||||
| EShLangMissMask), "hitObjectAttributeNV");
|
||||
parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitObjectAttrNV;
|
||||
}
|
||||
}
|
||||
| HITOBJECTATTREXT {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeEXT");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask
|
||||
| EShLangMissMask), "hitObjectAttributeEXT");
|
||||
parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.storage = EvqHitObjectAttrEXT;
|
||||
}
|
||||
| HITATTREXT {
|
||||
parseContext.globalCheck($1.loc, "hitAttributeEXT");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
|
||||
@@ -3647,10 +3656,14 @@ type_specifier_nonarray
|
||||
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
|
||||
$$ = $1;
|
||||
}
|
||||
| HITOBJECTNV {
|
||||
| HITOBJECTNV {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtHitObjectNV;
|
||||
}
|
||||
}
|
||||
| HITOBJECTEXT {
|
||||
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
|
||||
$$.basicType = EbtHitObjectEXT;
|
||||
}
|
||||
| struct_specifier {
|
||||
$$ = $1;
|
||||
$$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
|
||||
@@ -3990,11 +4003,7 @@ condition
|
||||
parseContext.boolCheck($2.loc, $1);
|
||||
|
||||
TType type($1);
|
||||
TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
|
||||
if (initNode)
|
||||
$$ = initNode->getAsTyped();
|
||||
else
|
||||
$$ = 0;
|
||||
$$ = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
|
||||
}
|
||||
;
|
||||
|
||||
@@ -4084,6 +4093,10 @@ iteration_statement_nonattributed
|
||||
condition RIGHT_PAREN statement_no_new_scope {
|
||||
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
|
||||
$$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.loc);
|
||||
if (parseContext.intermediate.getDebugInfo()) {
|
||||
$$ = parseContext.intermediate.makeAggregate($$, $1.loc);
|
||||
$$->getAsAggregate()->setOperator(EOpScope);
|
||||
}
|
||||
--parseContext.loopNestingLevel;
|
||||
--parseContext.statementNestingLevel;
|
||||
--parseContext.controlFlowNestingLevel;
|
||||
@@ -4101,6 +4114,10 @@ iteration_statement_nonattributed
|
||||
parseContext.boolCheck($8.loc, $6);
|
||||
|
||||
$$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc);
|
||||
if (parseContext.intermediate.getDebugInfo()) {
|
||||
$$ = parseContext.intermediate.makeAggregate($$, $4.loc);
|
||||
$$->getAsAggregate()->setOperator(EOpScope);
|
||||
}
|
||||
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
|
||||
--parseContext.loopNestingLevel;
|
||||
--parseContext.statementNestingLevel;
|
||||
@@ -4119,7 +4136,7 @@ iteration_statement_nonattributed
|
||||
if (! parseContext.limits.nonInductiveForLoops)
|
||||
parseContext.inductiveLoopCheck($1.loc, $4, forLoop);
|
||||
$$ = parseContext.intermediate.growAggregate($$, forLoop, $1.loc);
|
||||
$$->getAsAggregate()->setOperator(EOpSequence);
|
||||
$$->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
|
||||
--parseContext.loopNestingLevel;
|
||||
--parseContext.statementNestingLevel;
|
||||
--parseContext.controlFlowNestingLevel;
|
||||
|
||||
10965
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
vendored
10965
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
vendored
File diff suppressed because it is too large
Load Diff
@@ -233,307 +233,309 @@ extern int yydebug;
|
||||
COOPVECNV = 434, /* COOPVECNV */
|
||||
HITOBJECTNV = 435, /* HITOBJECTNV */
|
||||
HITOBJECTATTRNV = 436, /* HITOBJECTATTRNV */
|
||||
TENSORLAYOUTNV = 437, /* TENSORLAYOUTNV */
|
||||
TENSORVIEWNV = 438, /* TENSORVIEWNV */
|
||||
TENSORARM = 439, /* TENSORARM */
|
||||
SAMPLERCUBEARRAY = 440, /* SAMPLERCUBEARRAY */
|
||||
SAMPLERCUBEARRAYSHADOW = 441, /* SAMPLERCUBEARRAYSHADOW */
|
||||
ISAMPLERCUBEARRAY = 442, /* ISAMPLERCUBEARRAY */
|
||||
USAMPLERCUBEARRAY = 443, /* USAMPLERCUBEARRAY */
|
||||
SAMPLER1D = 444, /* SAMPLER1D */
|
||||
SAMPLER1DARRAY = 445, /* SAMPLER1DARRAY */
|
||||
SAMPLER1DARRAYSHADOW = 446, /* SAMPLER1DARRAYSHADOW */
|
||||
ISAMPLER1D = 447, /* ISAMPLER1D */
|
||||
SAMPLER1DSHADOW = 448, /* SAMPLER1DSHADOW */
|
||||
SAMPLER2DRECT = 449, /* SAMPLER2DRECT */
|
||||
SAMPLER2DRECTSHADOW = 450, /* SAMPLER2DRECTSHADOW */
|
||||
ISAMPLER2DRECT = 451, /* ISAMPLER2DRECT */
|
||||
USAMPLER2DRECT = 452, /* USAMPLER2DRECT */
|
||||
SAMPLERBUFFER = 453, /* SAMPLERBUFFER */
|
||||
ISAMPLERBUFFER = 454, /* ISAMPLERBUFFER */
|
||||
USAMPLERBUFFER = 455, /* USAMPLERBUFFER */
|
||||
SAMPLER2DMS = 456, /* SAMPLER2DMS */
|
||||
ISAMPLER2DMS = 457, /* ISAMPLER2DMS */
|
||||
USAMPLER2DMS = 458, /* USAMPLER2DMS */
|
||||
SAMPLER2DMSARRAY = 459, /* SAMPLER2DMSARRAY */
|
||||
ISAMPLER2DMSARRAY = 460, /* ISAMPLER2DMSARRAY */
|
||||
USAMPLER2DMSARRAY = 461, /* USAMPLER2DMSARRAY */
|
||||
SAMPLEREXTERNALOES = 462, /* SAMPLEREXTERNALOES */
|
||||
SAMPLEREXTERNAL2DY2YEXT = 463, /* SAMPLEREXTERNAL2DY2YEXT */
|
||||
ISAMPLER1DARRAY = 464, /* ISAMPLER1DARRAY */
|
||||
USAMPLER1D = 465, /* USAMPLER1D */
|
||||
USAMPLER1DARRAY = 466, /* USAMPLER1DARRAY */
|
||||
F16SAMPLER1D = 467, /* F16SAMPLER1D */
|
||||
F16SAMPLER2D = 468, /* F16SAMPLER2D */
|
||||
F16SAMPLER3D = 469, /* F16SAMPLER3D */
|
||||
F16SAMPLER2DRECT = 470, /* F16SAMPLER2DRECT */
|
||||
F16SAMPLERCUBE = 471, /* F16SAMPLERCUBE */
|
||||
F16SAMPLER1DARRAY = 472, /* F16SAMPLER1DARRAY */
|
||||
F16SAMPLER2DARRAY = 473, /* F16SAMPLER2DARRAY */
|
||||
F16SAMPLERCUBEARRAY = 474, /* F16SAMPLERCUBEARRAY */
|
||||
F16SAMPLERBUFFER = 475, /* F16SAMPLERBUFFER */
|
||||
F16SAMPLER2DMS = 476, /* F16SAMPLER2DMS */
|
||||
F16SAMPLER2DMSARRAY = 477, /* F16SAMPLER2DMSARRAY */
|
||||
F16SAMPLER1DSHADOW = 478, /* F16SAMPLER1DSHADOW */
|
||||
F16SAMPLER2DSHADOW = 479, /* F16SAMPLER2DSHADOW */
|
||||
F16SAMPLER1DARRAYSHADOW = 480, /* F16SAMPLER1DARRAYSHADOW */
|
||||
F16SAMPLER2DARRAYSHADOW = 481, /* F16SAMPLER2DARRAYSHADOW */
|
||||
F16SAMPLER2DRECTSHADOW = 482, /* F16SAMPLER2DRECTSHADOW */
|
||||
F16SAMPLERCUBESHADOW = 483, /* F16SAMPLERCUBESHADOW */
|
||||
F16SAMPLERCUBEARRAYSHADOW = 484, /* F16SAMPLERCUBEARRAYSHADOW */
|
||||
IMAGE1D = 485, /* IMAGE1D */
|
||||
IIMAGE1D = 486, /* IIMAGE1D */
|
||||
UIMAGE1D = 487, /* UIMAGE1D */
|
||||
IMAGE2D = 488, /* IMAGE2D */
|
||||
IIMAGE2D = 489, /* IIMAGE2D */
|
||||
UIMAGE2D = 490, /* UIMAGE2D */
|
||||
IMAGE3D = 491, /* IMAGE3D */
|
||||
IIMAGE3D = 492, /* IIMAGE3D */
|
||||
UIMAGE3D = 493, /* UIMAGE3D */
|
||||
IMAGE2DRECT = 494, /* IMAGE2DRECT */
|
||||
IIMAGE2DRECT = 495, /* IIMAGE2DRECT */
|
||||
UIMAGE2DRECT = 496, /* UIMAGE2DRECT */
|
||||
IMAGECUBE = 497, /* IMAGECUBE */
|
||||
IIMAGECUBE = 498, /* IIMAGECUBE */
|
||||
UIMAGECUBE = 499, /* UIMAGECUBE */
|
||||
IMAGEBUFFER = 500, /* IMAGEBUFFER */
|
||||
IIMAGEBUFFER = 501, /* IIMAGEBUFFER */
|
||||
UIMAGEBUFFER = 502, /* UIMAGEBUFFER */
|
||||
IMAGE1DARRAY = 503, /* IMAGE1DARRAY */
|
||||
IIMAGE1DARRAY = 504, /* IIMAGE1DARRAY */
|
||||
UIMAGE1DARRAY = 505, /* UIMAGE1DARRAY */
|
||||
IMAGE2DARRAY = 506, /* IMAGE2DARRAY */
|
||||
IIMAGE2DARRAY = 507, /* IIMAGE2DARRAY */
|
||||
UIMAGE2DARRAY = 508, /* UIMAGE2DARRAY */
|
||||
IMAGECUBEARRAY = 509, /* IMAGECUBEARRAY */
|
||||
IIMAGECUBEARRAY = 510, /* IIMAGECUBEARRAY */
|
||||
UIMAGECUBEARRAY = 511, /* UIMAGECUBEARRAY */
|
||||
IMAGE2DMS = 512, /* IMAGE2DMS */
|
||||
IIMAGE2DMS = 513, /* IIMAGE2DMS */
|
||||
UIMAGE2DMS = 514, /* UIMAGE2DMS */
|
||||
IMAGE2DMSARRAY = 515, /* IMAGE2DMSARRAY */
|
||||
IIMAGE2DMSARRAY = 516, /* IIMAGE2DMSARRAY */
|
||||
UIMAGE2DMSARRAY = 517, /* UIMAGE2DMSARRAY */
|
||||
F16IMAGE1D = 518, /* F16IMAGE1D */
|
||||
F16IMAGE2D = 519, /* F16IMAGE2D */
|
||||
F16IMAGE3D = 520, /* F16IMAGE3D */
|
||||
F16IMAGE2DRECT = 521, /* F16IMAGE2DRECT */
|
||||
F16IMAGECUBE = 522, /* F16IMAGECUBE */
|
||||
F16IMAGE1DARRAY = 523, /* F16IMAGE1DARRAY */
|
||||
F16IMAGE2DARRAY = 524, /* F16IMAGE2DARRAY */
|
||||
F16IMAGECUBEARRAY = 525, /* F16IMAGECUBEARRAY */
|
||||
F16IMAGEBUFFER = 526, /* F16IMAGEBUFFER */
|
||||
F16IMAGE2DMS = 527, /* F16IMAGE2DMS */
|
||||
F16IMAGE2DMSARRAY = 528, /* F16IMAGE2DMSARRAY */
|
||||
I64IMAGE1D = 529, /* I64IMAGE1D */
|
||||
U64IMAGE1D = 530, /* U64IMAGE1D */
|
||||
I64IMAGE2D = 531, /* I64IMAGE2D */
|
||||
U64IMAGE2D = 532, /* U64IMAGE2D */
|
||||
I64IMAGE3D = 533, /* I64IMAGE3D */
|
||||
U64IMAGE3D = 534, /* U64IMAGE3D */
|
||||
I64IMAGE2DRECT = 535, /* I64IMAGE2DRECT */
|
||||
U64IMAGE2DRECT = 536, /* U64IMAGE2DRECT */
|
||||
I64IMAGECUBE = 537, /* I64IMAGECUBE */
|
||||
U64IMAGECUBE = 538, /* U64IMAGECUBE */
|
||||
I64IMAGEBUFFER = 539, /* I64IMAGEBUFFER */
|
||||
U64IMAGEBUFFER = 540, /* U64IMAGEBUFFER */
|
||||
I64IMAGE1DARRAY = 541, /* I64IMAGE1DARRAY */
|
||||
U64IMAGE1DARRAY = 542, /* U64IMAGE1DARRAY */
|
||||
I64IMAGE2DARRAY = 543, /* I64IMAGE2DARRAY */
|
||||
U64IMAGE2DARRAY = 544, /* U64IMAGE2DARRAY */
|
||||
I64IMAGECUBEARRAY = 545, /* I64IMAGECUBEARRAY */
|
||||
U64IMAGECUBEARRAY = 546, /* U64IMAGECUBEARRAY */
|
||||
I64IMAGE2DMS = 547, /* I64IMAGE2DMS */
|
||||
U64IMAGE2DMS = 548, /* U64IMAGE2DMS */
|
||||
I64IMAGE2DMSARRAY = 549, /* I64IMAGE2DMSARRAY */
|
||||
U64IMAGE2DMSARRAY = 550, /* U64IMAGE2DMSARRAY */
|
||||
TEXTURECUBEARRAY = 551, /* TEXTURECUBEARRAY */
|
||||
ITEXTURECUBEARRAY = 552, /* ITEXTURECUBEARRAY */
|
||||
UTEXTURECUBEARRAY = 553, /* UTEXTURECUBEARRAY */
|
||||
TEXTURE1D = 554, /* TEXTURE1D */
|
||||
ITEXTURE1D = 555, /* ITEXTURE1D */
|
||||
UTEXTURE1D = 556, /* UTEXTURE1D */
|
||||
TEXTURE1DARRAY = 557, /* TEXTURE1DARRAY */
|
||||
ITEXTURE1DARRAY = 558, /* ITEXTURE1DARRAY */
|
||||
UTEXTURE1DARRAY = 559, /* UTEXTURE1DARRAY */
|
||||
TEXTURE2DRECT = 560, /* TEXTURE2DRECT */
|
||||
ITEXTURE2DRECT = 561, /* ITEXTURE2DRECT */
|
||||
UTEXTURE2DRECT = 562, /* UTEXTURE2DRECT */
|
||||
TEXTUREBUFFER = 563, /* TEXTUREBUFFER */
|
||||
ITEXTUREBUFFER = 564, /* ITEXTUREBUFFER */
|
||||
UTEXTUREBUFFER = 565, /* UTEXTUREBUFFER */
|
||||
TEXTURE2DMS = 566, /* TEXTURE2DMS */
|
||||
ITEXTURE2DMS = 567, /* ITEXTURE2DMS */
|
||||
UTEXTURE2DMS = 568, /* UTEXTURE2DMS */
|
||||
TEXTURE2DMSARRAY = 569, /* TEXTURE2DMSARRAY */
|
||||
ITEXTURE2DMSARRAY = 570, /* ITEXTURE2DMSARRAY */
|
||||
UTEXTURE2DMSARRAY = 571, /* UTEXTURE2DMSARRAY */
|
||||
F16TEXTURE1D = 572, /* F16TEXTURE1D */
|
||||
F16TEXTURE2D = 573, /* F16TEXTURE2D */
|
||||
F16TEXTURE3D = 574, /* F16TEXTURE3D */
|
||||
F16TEXTURE2DRECT = 575, /* F16TEXTURE2DRECT */
|
||||
F16TEXTURECUBE = 576, /* F16TEXTURECUBE */
|
||||
F16TEXTURE1DARRAY = 577, /* F16TEXTURE1DARRAY */
|
||||
F16TEXTURE2DARRAY = 578, /* F16TEXTURE2DARRAY */
|
||||
F16TEXTURECUBEARRAY = 579, /* F16TEXTURECUBEARRAY */
|
||||
F16TEXTUREBUFFER = 580, /* F16TEXTUREBUFFER */
|
||||
F16TEXTURE2DMS = 581, /* F16TEXTURE2DMS */
|
||||
F16TEXTURE2DMSARRAY = 582, /* F16TEXTURE2DMSARRAY */
|
||||
SUBPASSINPUT = 583, /* SUBPASSINPUT */
|
||||
SUBPASSINPUTMS = 584, /* SUBPASSINPUTMS */
|
||||
ISUBPASSINPUT = 585, /* ISUBPASSINPUT */
|
||||
ISUBPASSINPUTMS = 586, /* ISUBPASSINPUTMS */
|
||||
USUBPASSINPUT = 587, /* USUBPASSINPUT */
|
||||
USUBPASSINPUTMS = 588, /* USUBPASSINPUTMS */
|
||||
F16SUBPASSINPUT = 589, /* F16SUBPASSINPUT */
|
||||
F16SUBPASSINPUTMS = 590, /* F16SUBPASSINPUTMS */
|
||||
SPIRV_INSTRUCTION = 591, /* SPIRV_INSTRUCTION */
|
||||
SPIRV_EXECUTION_MODE = 592, /* SPIRV_EXECUTION_MODE */
|
||||
SPIRV_EXECUTION_MODE_ID = 593, /* SPIRV_EXECUTION_MODE_ID */
|
||||
SPIRV_DECORATE = 594, /* SPIRV_DECORATE */
|
||||
SPIRV_DECORATE_ID = 595, /* SPIRV_DECORATE_ID */
|
||||
SPIRV_DECORATE_STRING = 596, /* SPIRV_DECORATE_STRING */
|
||||
SPIRV_TYPE = 597, /* SPIRV_TYPE */
|
||||
SPIRV_STORAGE_CLASS = 598, /* SPIRV_STORAGE_CLASS */
|
||||
SPIRV_BY_REFERENCE = 599, /* SPIRV_BY_REFERENCE */
|
||||
SPIRV_LITERAL = 600, /* SPIRV_LITERAL */
|
||||
ATTACHMENTEXT = 601, /* ATTACHMENTEXT */
|
||||
IATTACHMENTEXT = 602, /* IATTACHMENTEXT */
|
||||
UATTACHMENTEXT = 603, /* UATTACHMENTEXT */
|
||||
LEFT_OP = 604, /* LEFT_OP */
|
||||
RIGHT_OP = 605, /* RIGHT_OP */
|
||||
INC_OP = 606, /* INC_OP */
|
||||
DEC_OP = 607, /* DEC_OP */
|
||||
LE_OP = 608, /* LE_OP */
|
||||
GE_OP = 609, /* GE_OP */
|
||||
EQ_OP = 610, /* EQ_OP */
|
||||
NE_OP = 611, /* NE_OP */
|
||||
AND_OP = 612, /* AND_OP */
|
||||
OR_OP = 613, /* OR_OP */
|
||||
XOR_OP = 614, /* XOR_OP */
|
||||
MUL_ASSIGN = 615, /* MUL_ASSIGN */
|
||||
DIV_ASSIGN = 616, /* DIV_ASSIGN */
|
||||
ADD_ASSIGN = 617, /* ADD_ASSIGN */
|
||||
MOD_ASSIGN = 618, /* MOD_ASSIGN */
|
||||
LEFT_ASSIGN = 619, /* LEFT_ASSIGN */
|
||||
RIGHT_ASSIGN = 620, /* RIGHT_ASSIGN */
|
||||
AND_ASSIGN = 621, /* AND_ASSIGN */
|
||||
XOR_ASSIGN = 622, /* XOR_ASSIGN */
|
||||
OR_ASSIGN = 623, /* OR_ASSIGN */
|
||||
SUB_ASSIGN = 624, /* SUB_ASSIGN */
|
||||
STRING_LITERAL = 625, /* STRING_LITERAL */
|
||||
LEFT_PAREN = 626, /* LEFT_PAREN */
|
||||
RIGHT_PAREN = 627, /* RIGHT_PAREN */
|
||||
LEFT_BRACKET = 628, /* LEFT_BRACKET */
|
||||
RIGHT_BRACKET = 629, /* RIGHT_BRACKET */
|
||||
LEFT_BRACE = 630, /* LEFT_BRACE */
|
||||
RIGHT_BRACE = 631, /* RIGHT_BRACE */
|
||||
DOT = 632, /* DOT */
|
||||
COMMA = 633, /* COMMA */
|
||||
COLON = 634, /* COLON */
|
||||
EQUAL = 635, /* EQUAL */
|
||||
SEMICOLON = 636, /* SEMICOLON */
|
||||
BANG = 637, /* BANG */
|
||||
DASH = 638, /* DASH */
|
||||
TILDE = 639, /* TILDE */
|
||||
PLUS = 640, /* PLUS */
|
||||
STAR = 641, /* STAR */
|
||||
SLASH = 642, /* SLASH */
|
||||
PERCENT = 643, /* PERCENT */
|
||||
LEFT_ANGLE = 644, /* LEFT_ANGLE */
|
||||
RIGHT_ANGLE = 645, /* RIGHT_ANGLE */
|
||||
VERTICAL_BAR = 646, /* VERTICAL_BAR */
|
||||
CARET = 647, /* CARET */
|
||||
AMPERSAND = 648, /* AMPERSAND */
|
||||
QUESTION = 649, /* QUESTION */
|
||||
INVARIANT = 650, /* INVARIANT */
|
||||
HIGH_PRECISION = 651, /* HIGH_PRECISION */
|
||||
MEDIUM_PRECISION = 652, /* MEDIUM_PRECISION */
|
||||
LOW_PRECISION = 653, /* LOW_PRECISION */
|
||||
PRECISION = 654, /* PRECISION */
|
||||
PACKED = 655, /* PACKED */
|
||||
RESOURCE = 656, /* RESOURCE */
|
||||
SUPERP = 657, /* SUPERP */
|
||||
FLOATCONSTANT = 658, /* FLOATCONSTANT */
|
||||
INTCONSTANT = 659, /* INTCONSTANT */
|
||||
UINTCONSTANT = 660, /* UINTCONSTANT */
|
||||
BOOLCONSTANT = 661, /* BOOLCONSTANT */
|
||||
IDENTIFIER = 662, /* IDENTIFIER */
|
||||
TYPE_NAME = 663, /* TYPE_NAME */
|
||||
CENTROID = 664, /* CENTROID */
|
||||
IN = 665, /* IN */
|
||||
OUT = 666, /* OUT */
|
||||
INOUT = 667, /* INOUT */
|
||||
STRUCT = 668, /* STRUCT */
|
||||
VOID = 669, /* VOID */
|
||||
WHILE = 670, /* WHILE */
|
||||
BREAK = 671, /* BREAK */
|
||||
CONTINUE = 672, /* CONTINUE */
|
||||
DO = 673, /* DO */
|
||||
ELSE = 674, /* ELSE */
|
||||
FOR = 675, /* FOR */
|
||||
IF = 676, /* IF */
|
||||
DISCARD = 677, /* DISCARD */
|
||||
RETURN = 678, /* RETURN */
|
||||
SWITCH = 679, /* SWITCH */
|
||||
CASE = 680, /* CASE */
|
||||
DEFAULT = 681, /* DEFAULT */
|
||||
TERMINATE_INVOCATION = 682, /* TERMINATE_INVOCATION */
|
||||
TERMINATE_RAY = 683, /* TERMINATE_RAY */
|
||||
IGNORE_INTERSECTION = 684, /* IGNORE_INTERSECTION */
|
||||
UNIFORM = 685, /* UNIFORM */
|
||||
SHARED = 686, /* SHARED */
|
||||
BUFFER = 687, /* BUFFER */
|
||||
TILEIMAGEEXT = 688, /* TILEIMAGEEXT */
|
||||
FLAT = 689, /* FLAT */
|
||||
SMOOTH = 690, /* SMOOTH */
|
||||
LAYOUT = 691, /* LAYOUT */
|
||||
DOUBLECONSTANT = 692, /* DOUBLECONSTANT */
|
||||
INT16CONSTANT = 693, /* INT16CONSTANT */
|
||||
UINT16CONSTANT = 694, /* UINT16CONSTANT */
|
||||
FLOAT16CONSTANT = 695, /* FLOAT16CONSTANT */
|
||||
INT32CONSTANT = 696, /* INT32CONSTANT */
|
||||
UINT32CONSTANT = 697, /* UINT32CONSTANT */
|
||||
INT64CONSTANT = 698, /* INT64CONSTANT */
|
||||
UINT64CONSTANT = 699, /* UINT64CONSTANT */
|
||||
SUBROUTINE = 700, /* SUBROUTINE */
|
||||
DEMOTE = 701, /* DEMOTE */
|
||||
FUNCTION = 702, /* FUNCTION */
|
||||
PAYLOADNV = 703, /* PAYLOADNV */
|
||||
PAYLOADINNV = 704, /* PAYLOADINNV */
|
||||
HITATTRNV = 705, /* HITATTRNV */
|
||||
CALLDATANV = 706, /* CALLDATANV */
|
||||
CALLDATAINNV = 707, /* CALLDATAINNV */
|
||||
PAYLOADEXT = 708, /* PAYLOADEXT */
|
||||
PAYLOADINEXT = 709, /* PAYLOADINEXT */
|
||||
HITATTREXT = 710, /* HITATTREXT */
|
||||
CALLDATAEXT = 711, /* CALLDATAEXT */
|
||||
CALLDATAINEXT = 712, /* CALLDATAINEXT */
|
||||
PATCH = 713, /* PATCH */
|
||||
SAMPLE = 714, /* SAMPLE */
|
||||
NONUNIFORM = 715, /* NONUNIFORM */
|
||||
COHERENT = 716, /* COHERENT */
|
||||
VOLATILE = 717, /* VOLATILE */
|
||||
RESTRICT = 718, /* RESTRICT */
|
||||
READONLY = 719, /* READONLY */
|
||||
WRITEONLY = 720, /* WRITEONLY */
|
||||
NONTEMPORAL = 721, /* NONTEMPORAL */
|
||||
DEVICECOHERENT = 722, /* DEVICECOHERENT */
|
||||
QUEUEFAMILYCOHERENT = 723, /* QUEUEFAMILYCOHERENT */
|
||||
WORKGROUPCOHERENT = 724, /* WORKGROUPCOHERENT */
|
||||
SUBGROUPCOHERENT = 725, /* SUBGROUPCOHERENT */
|
||||
NONPRIVATE = 726, /* NONPRIVATE */
|
||||
SHADERCALLCOHERENT = 727, /* SHADERCALLCOHERENT */
|
||||
NOPERSPECTIVE = 728, /* NOPERSPECTIVE */
|
||||
EXPLICITINTERPAMD = 729, /* EXPLICITINTERPAMD */
|
||||
PERVERTEXEXT = 730, /* PERVERTEXEXT */
|
||||
PERVERTEXNV = 731, /* PERVERTEXNV */
|
||||
PERPRIMITIVENV = 732, /* PERPRIMITIVENV */
|
||||
PERVIEWNV = 733, /* PERVIEWNV */
|
||||
PERTASKNV = 734, /* PERTASKNV */
|
||||
PERPRIMITIVEEXT = 735, /* PERPRIMITIVEEXT */
|
||||
TASKPAYLOADWORKGROUPEXT = 736, /* TASKPAYLOADWORKGROUPEXT */
|
||||
PRECISE = 737 /* PRECISE */
|
||||
HITOBJECTEXT = 437, /* HITOBJECTEXT */
|
||||
HITOBJECTATTREXT = 438, /* HITOBJECTATTREXT */
|
||||
TENSORLAYOUTNV = 439, /* TENSORLAYOUTNV */
|
||||
TENSORVIEWNV = 440, /* TENSORVIEWNV */
|
||||
TENSORARM = 441, /* TENSORARM */
|
||||
SAMPLERCUBEARRAY = 442, /* SAMPLERCUBEARRAY */
|
||||
SAMPLERCUBEARRAYSHADOW = 443, /* SAMPLERCUBEARRAYSHADOW */
|
||||
ISAMPLERCUBEARRAY = 444, /* ISAMPLERCUBEARRAY */
|
||||
USAMPLERCUBEARRAY = 445, /* USAMPLERCUBEARRAY */
|
||||
SAMPLER1D = 446, /* SAMPLER1D */
|
||||
SAMPLER1DARRAY = 447, /* SAMPLER1DARRAY */
|
||||
SAMPLER1DARRAYSHADOW = 448, /* SAMPLER1DARRAYSHADOW */
|
||||
ISAMPLER1D = 449, /* ISAMPLER1D */
|
||||
SAMPLER1DSHADOW = 450, /* SAMPLER1DSHADOW */
|
||||
SAMPLER2DRECT = 451, /* SAMPLER2DRECT */
|
||||
SAMPLER2DRECTSHADOW = 452, /* SAMPLER2DRECTSHADOW */
|
||||
ISAMPLER2DRECT = 453, /* ISAMPLER2DRECT */
|
||||
USAMPLER2DRECT = 454, /* USAMPLER2DRECT */
|
||||
SAMPLERBUFFER = 455, /* SAMPLERBUFFER */
|
||||
ISAMPLERBUFFER = 456, /* ISAMPLERBUFFER */
|
||||
USAMPLERBUFFER = 457, /* USAMPLERBUFFER */
|
||||
SAMPLER2DMS = 458, /* SAMPLER2DMS */
|
||||
ISAMPLER2DMS = 459, /* ISAMPLER2DMS */
|
||||
USAMPLER2DMS = 460, /* USAMPLER2DMS */
|
||||
SAMPLER2DMSARRAY = 461, /* SAMPLER2DMSARRAY */
|
||||
ISAMPLER2DMSARRAY = 462, /* ISAMPLER2DMSARRAY */
|
||||
USAMPLER2DMSARRAY = 463, /* USAMPLER2DMSARRAY */
|
||||
SAMPLEREXTERNALOES = 464, /* SAMPLEREXTERNALOES */
|
||||
SAMPLEREXTERNAL2DY2YEXT = 465, /* SAMPLEREXTERNAL2DY2YEXT */
|
||||
ISAMPLER1DARRAY = 466, /* ISAMPLER1DARRAY */
|
||||
USAMPLER1D = 467, /* USAMPLER1D */
|
||||
USAMPLER1DARRAY = 468, /* USAMPLER1DARRAY */
|
||||
F16SAMPLER1D = 469, /* F16SAMPLER1D */
|
||||
F16SAMPLER2D = 470, /* F16SAMPLER2D */
|
||||
F16SAMPLER3D = 471, /* F16SAMPLER3D */
|
||||
F16SAMPLER2DRECT = 472, /* F16SAMPLER2DRECT */
|
||||
F16SAMPLERCUBE = 473, /* F16SAMPLERCUBE */
|
||||
F16SAMPLER1DARRAY = 474, /* F16SAMPLER1DARRAY */
|
||||
F16SAMPLER2DARRAY = 475, /* F16SAMPLER2DARRAY */
|
||||
F16SAMPLERCUBEARRAY = 476, /* F16SAMPLERCUBEARRAY */
|
||||
F16SAMPLERBUFFER = 477, /* F16SAMPLERBUFFER */
|
||||
F16SAMPLER2DMS = 478, /* F16SAMPLER2DMS */
|
||||
F16SAMPLER2DMSARRAY = 479, /* F16SAMPLER2DMSARRAY */
|
||||
F16SAMPLER1DSHADOW = 480, /* F16SAMPLER1DSHADOW */
|
||||
F16SAMPLER2DSHADOW = 481, /* F16SAMPLER2DSHADOW */
|
||||
F16SAMPLER1DARRAYSHADOW = 482, /* F16SAMPLER1DARRAYSHADOW */
|
||||
F16SAMPLER2DARRAYSHADOW = 483, /* F16SAMPLER2DARRAYSHADOW */
|
||||
F16SAMPLER2DRECTSHADOW = 484, /* F16SAMPLER2DRECTSHADOW */
|
||||
F16SAMPLERCUBESHADOW = 485, /* F16SAMPLERCUBESHADOW */
|
||||
F16SAMPLERCUBEARRAYSHADOW = 486, /* F16SAMPLERCUBEARRAYSHADOW */
|
||||
IMAGE1D = 487, /* IMAGE1D */
|
||||
IIMAGE1D = 488, /* IIMAGE1D */
|
||||
UIMAGE1D = 489, /* UIMAGE1D */
|
||||
IMAGE2D = 490, /* IMAGE2D */
|
||||
IIMAGE2D = 491, /* IIMAGE2D */
|
||||
UIMAGE2D = 492, /* UIMAGE2D */
|
||||
IMAGE3D = 493, /* IMAGE3D */
|
||||
IIMAGE3D = 494, /* IIMAGE3D */
|
||||
UIMAGE3D = 495, /* UIMAGE3D */
|
||||
IMAGE2DRECT = 496, /* IMAGE2DRECT */
|
||||
IIMAGE2DRECT = 497, /* IIMAGE2DRECT */
|
||||
UIMAGE2DRECT = 498, /* UIMAGE2DRECT */
|
||||
IMAGECUBE = 499, /* IMAGECUBE */
|
||||
IIMAGECUBE = 500, /* IIMAGECUBE */
|
||||
UIMAGECUBE = 501, /* UIMAGECUBE */
|
||||
IMAGEBUFFER = 502, /* IMAGEBUFFER */
|
||||
IIMAGEBUFFER = 503, /* IIMAGEBUFFER */
|
||||
UIMAGEBUFFER = 504, /* UIMAGEBUFFER */
|
||||
IMAGE1DARRAY = 505, /* IMAGE1DARRAY */
|
||||
IIMAGE1DARRAY = 506, /* IIMAGE1DARRAY */
|
||||
UIMAGE1DARRAY = 507, /* UIMAGE1DARRAY */
|
||||
IMAGE2DARRAY = 508, /* IMAGE2DARRAY */
|
||||
IIMAGE2DARRAY = 509, /* IIMAGE2DARRAY */
|
||||
UIMAGE2DARRAY = 510, /* UIMAGE2DARRAY */
|
||||
IMAGECUBEARRAY = 511, /* IMAGECUBEARRAY */
|
||||
IIMAGECUBEARRAY = 512, /* IIMAGECUBEARRAY */
|
||||
UIMAGECUBEARRAY = 513, /* UIMAGECUBEARRAY */
|
||||
IMAGE2DMS = 514, /* IMAGE2DMS */
|
||||
IIMAGE2DMS = 515, /* IIMAGE2DMS */
|
||||
UIMAGE2DMS = 516, /* UIMAGE2DMS */
|
||||
IMAGE2DMSARRAY = 517, /* IMAGE2DMSARRAY */
|
||||
IIMAGE2DMSARRAY = 518, /* IIMAGE2DMSARRAY */
|
||||
UIMAGE2DMSARRAY = 519, /* UIMAGE2DMSARRAY */
|
||||
F16IMAGE1D = 520, /* F16IMAGE1D */
|
||||
F16IMAGE2D = 521, /* F16IMAGE2D */
|
||||
F16IMAGE3D = 522, /* F16IMAGE3D */
|
||||
F16IMAGE2DRECT = 523, /* F16IMAGE2DRECT */
|
||||
F16IMAGECUBE = 524, /* F16IMAGECUBE */
|
||||
F16IMAGE1DARRAY = 525, /* F16IMAGE1DARRAY */
|
||||
F16IMAGE2DARRAY = 526, /* F16IMAGE2DARRAY */
|
||||
F16IMAGECUBEARRAY = 527, /* F16IMAGECUBEARRAY */
|
||||
F16IMAGEBUFFER = 528, /* F16IMAGEBUFFER */
|
||||
F16IMAGE2DMS = 529, /* F16IMAGE2DMS */
|
||||
F16IMAGE2DMSARRAY = 530, /* F16IMAGE2DMSARRAY */
|
||||
I64IMAGE1D = 531, /* I64IMAGE1D */
|
||||
U64IMAGE1D = 532, /* U64IMAGE1D */
|
||||
I64IMAGE2D = 533, /* I64IMAGE2D */
|
||||
U64IMAGE2D = 534, /* U64IMAGE2D */
|
||||
I64IMAGE3D = 535, /* I64IMAGE3D */
|
||||
U64IMAGE3D = 536, /* U64IMAGE3D */
|
||||
I64IMAGE2DRECT = 537, /* I64IMAGE2DRECT */
|
||||
U64IMAGE2DRECT = 538, /* U64IMAGE2DRECT */
|
||||
I64IMAGECUBE = 539, /* I64IMAGECUBE */
|
||||
U64IMAGECUBE = 540, /* U64IMAGECUBE */
|
||||
I64IMAGEBUFFER = 541, /* I64IMAGEBUFFER */
|
||||
U64IMAGEBUFFER = 542, /* U64IMAGEBUFFER */
|
||||
I64IMAGE1DARRAY = 543, /* I64IMAGE1DARRAY */
|
||||
U64IMAGE1DARRAY = 544, /* U64IMAGE1DARRAY */
|
||||
I64IMAGE2DARRAY = 545, /* I64IMAGE2DARRAY */
|
||||
U64IMAGE2DARRAY = 546, /* U64IMAGE2DARRAY */
|
||||
I64IMAGECUBEARRAY = 547, /* I64IMAGECUBEARRAY */
|
||||
U64IMAGECUBEARRAY = 548, /* U64IMAGECUBEARRAY */
|
||||
I64IMAGE2DMS = 549, /* I64IMAGE2DMS */
|
||||
U64IMAGE2DMS = 550, /* U64IMAGE2DMS */
|
||||
I64IMAGE2DMSARRAY = 551, /* I64IMAGE2DMSARRAY */
|
||||
U64IMAGE2DMSARRAY = 552, /* U64IMAGE2DMSARRAY */
|
||||
TEXTURECUBEARRAY = 553, /* TEXTURECUBEARRAY */
|
||||
ITEXTURECUBEARRAY = 554, /* ITEXTURECUBEARRAY */
|
||||
UTEXTURECUBEARRAY = 555, /* UTEXTURECUBEARRAY */
|
||||
TEXTURE1D = 556, /* TEXTURE1D */
|
||||
ITEXTURE1D = 557, /* ITEXTURE1D */
|
||||
UTEXTURE1D = 558, /* UTEXTURE1D */
|
||||
TEXTURE1DARRAY = 559, /* TEXTURE1DARRAY */
|
||||
ITEXTURE1DARRAY = 560, /* ITEXTURE1DARRAY */
|
||||
UTEXTURE1DARRAY = 561, /* UTEXTURE1DARRAY */
|
||||
TEXTURE2DRECT = 562, /* TEXTURE2DRECT */
|
||||
ITEXTURE2DRECT = 563, /* ITEXTURE2DRECT */
|
||||
UTEXTURE2DRECT = 564, /* UTEXTURE2DRECT */
|
||||
TEXTUREBUFFER = 565, /* TEXTUREBUFFER */
|
||||
ITEXTUREBUFFER = 566, /* ITEXTUREBUFFER */
|
||||
UTEXTUREBUFFER = 567, /* UTEXTUREBUFFER */
|
||||
TEXTURE2DMS = 568, /* TEXTURE2DMS */
|
||||
ITEXTURE2DMS = 569, /* ITEXTURE2DMS */
|
||||
UTEXTURE2DMS = 570, /* UTEXTURE2DMS */
|
||||
TEXTURE2DMSARRAY = 571, /* TEXTURE2DMSARRAY */
|
||||
ITEXTURE2DMSARRAY = 572, /* ITEXTURE2DMSARRAY */
|
||||
UTEXTURE2DMSARRAY = 573, /* UTEXTURE2DMSARRAY */
|
||||
F16TEXTURE1D = 574, /* F16TEXTURE1D */
|
||||
F16TEXTURE2D = 575, /* F16TEXTURE2D */
|
||||
F16TEXTURE3D = 576, /* F16TEXTURE3D */
|
||||
F16TEXTURE2DRECT = 577, /* F16TEXTURE2DRECT */
|
||||
F16TEXTURECUBE = 578, /* F16TEXTURECUBE */
|
||||
F16TEXTURE1DARRAY = 579, /* F16TEXTURE1DARRAY */
|
||||
F16TEXTURE2DARRAY = 580, /* F16TEXTURE2DARRAY */
|
||||
F16TEXTURECUBEARRAY = 581, /* F16TEXTURECUBEARRAY */
|
||||
F16TEXTUREBUFFER = 582, /* F16TEXTUREBUFFER */
|
||||
F16TEXTURE2DMS = 583, /* F16TEXTURE2DMS */
|
||||
F16TEXTURE2DMSARRAY = 584, /* F16TEXTURE2DMSARRAY */
|
||||
SUBPASSINPUT = 585, /* SUBPASSINPUT */
|
||||
SUBPASSINPUTMS = 586, /* SUBPASSINPUTMS */
|
||||
ISUBPASSINPUT = 587, /* ISUBPASSINPUT */
|
||||
ISUBPASSINPUTMS = 588, /* ISUBPASSINPUTMS */
|
||||
USUBPASSINPUT = 589, /* USUBPASSINPUT */
|
||||
USUBPASSINPUTMS = 590, /* USUBPASSINPUTMS */
|
||||
F16SUBPASSINPUT = 591, /* F16SUBPASSINPUT */
|
||||
F16SUBPASSINPUTMS = 592, /* F16SUBPASSINPUTMS */
|
||||
SPIRV_INSTRUCTION = 593, /* SPIRV_INSTRUCTION */
|
||||
SPIRV_EXECUTION_MODE = 594, /* SPIRV_EXECUTION_MODE */
|
||||
SPIRV_EXECUTION_MODE_ID = 595, /* SPIRV_EXECUTION_MODE_ID */
|
||||
SPIRV_DECORATE = 596, /* SPIRV_DECORATE */
|
||||
SPIRV_DECORATE_ID = 597, /* SPIRV_DECORATE_ID */
|
||||
SPIRV_DECORATE_STRING = 598, /* SPIRV_DECORATE_STRING */
|
||||
SPIRV_TYPE = 599, /* SPIRV_TYPE */
|
||||
SPIRV_STORAGE_CLASS = 600, /* SPIRV_STORAGE_CLASS */
|
||||
SPIRV_BY_REFERENCE = 601, /* SPIRV_BY_REFERENCE */
|
||||
SPIRV_LITERAL = 602, /* SPIRV_LITERAL */
|
||||
ATTACHMENTEXT = 603, /* ATTACHMENTEXT */
|
||||
IATTACHMENTEXT = 604, /* IATTACHMENTEXT */
|
||||
UATTACHMENTEXT = 605, /* UATTACHMENTEXT */
|
||||
LEFT_OP = 606, /* LEFT_OP */
|
||||
RIGHT_OP = 607, /* RIGHT_OP */
|
||||
INC_OP = 608, /* INC_OP */
|
||||
DEC_OP = 609, /* DEC_OP */
|
||||
LE_OP = 610, /* LE_OP */
|
||||
GE_OP = 611, /* GE_OP */
|
||||
EQ_OP = 612, /* EQ_OP */
|
||||
NE_OP = 613, /* NE_OP */
|
||||
AND_OP = 614, /* AND_OP */
|
||||
OR_OP = 615, /* OR_OP */
|
||||
XOR_OP = 616, /* XOR_OP */
|
||||
MUL_ASSIGN = 617, /* MUL_ASSIGN */
|
||||
DIV_ASSIGN = 618, /* DIV_ASSIGN */
|
||||
ADD_ASSIGN = 619, /* ADD_ASSIGN */
|
||||
MOD_ASSIGN = 620, /* MOD_ASSIGN */
|
||||
LEFT_ASSIGN = 621, /* LEFT_ASSIGN */
|
||||
RIGHT_ASSIGN = 622, /* RIGHT_ASSIGN */
|
||||
AND_ASSIGN = 623, /* AND_ASSIGN */
|
||||
XOR_ASSIGN = 624, /* XOR_ASSIGN */
|
||||
OR_ASSIGN = 625, /* OR_ASSIGN */
|
||||
SUB_ASSIGN = 626, /* SUB_ASSIGN */
|
||||
STRING_LITERAL = 627, /* STRING_LITERAL */
|
||||
LEFT_PAREN = 628, /* LEFT_PAREN */
|
||||
RIGHT_PAREN = 629, /* RIGHT_PAREN */
|
||||
LEFT_BRACKET = 630, /* LEFT_BRACKET */
|
||||
RIGHT_BRACKET = 631, /* RIGHT_BRACKET */
|
||||
LEFT_BRACE = 632, /* LEFT_BRACE */
|
||||
RIGHT_BRACE = 633, /* RIGHT_BRACE */
|
||||
DOT = 634, /* DOT */
|
||||
COMMA = 635, /* COMMA */
|
||||
COLON = 636, /* COLON */
|
||||
EQUAL = 637, /* EQUAL */
|
||||
SEMICOLON = 638, /* SEMICOLON */
|
||||
BANG = 639, /* BANG */
|
||||
DASH = 640, /* DASH */
|
||||
TILDE = 641, /* TILDE */
|
||||
PLUS = 642, /* PLUS */
|
||||
STAR = 643, /* STAR */
|
||||
SLASH = 644, /* SLASH */
|
||||
PERCENT = 645, /* PERCENT */
|
||||
LEFT_ANGLE = 646, /* LEFT_ANGLE */
|
||||
RIGHT_ANGLE = 647, /* RIGHT_ANGLE */
|
||||
VERTICAL_BAR = 648, /* VERTICAL_BAR */
|
||||
CARET = 649, /* CARET */
|
||||
AMPERSAND = 650, /* AMPERSAND */
|
||||
QUESTION = 651, /* QUESTION */
|
||||
INVARIANT = 652, /* INVARIANT */
|
||||
HIGH_PRECISION = 653, /* HIGH_PRECISION */
|
||||
MEDIUM_PRECISION = 654, /* MEDIUM_PRECISION */
|
||||
LOW_PRECISION = 655, /* LOW_PRECISION */
|
||||
PRECISION = 656, /* PRECISION */
|
||||
PACKED = 657, /* PACKED */
|
||||
RESOURCE = 658, /* RESOURCE */
|
||||
SUPERP = 659, /* SUPERP */
|
||||
FLOATCONSTANT = 660, /* FLOATCONSTANT */
|
||||
INTCONSTANT = 661, /* INTCONSTANT */
|
||||
UINTCONSTANT = 662, /* UINTCONSTANT */
|
||||
BOOLCONSTANT = 663, /* BOOLCONSTANT */
|
||||
IDENTIFIER = 664, /* IDENTIFIER */
|
||||
TYPE_NAME = 665, /* TYPE_NAME */
|
||||
CENTROID = 666, /* CENTROID */
|
||||
IN = 667, /* IN */
|
||||
OUT = 668, /* OUT */
|
||||
INOUT = 669, /* INOUT */
|
||||
STRUCT = 670, /* STRUCT */
|
||||
VOID = 671, /* VOID */
|
||||
WHILE = 672, /* WHILE */
|
||||
BREAK = 673, /* BREAK */
|
||||
CONTINUE = 674, /* CONTINUE */
|
||||
DO = 675, /* DO */
|
||||
ELSE = 676, /* ELSE */
|
||||
FOR = 677, /* FOR */
|
||||
IF = 678, /* IF */
|
||||
DISCARD = 679, /* DISCARD */
|
||||
RETURN = 680, /* RETURN */
|
||||
SWITCH = 681, /* SWITCH */
|
||||
CASE = 682, /* CASE */
|
||||
DEFAULT = 683, /* DEFAULT */
|
||||
TERMINATE_INVOCATION = 684, /* TERMINATE_INVOCATION */
|
||||
TERMINATE_RAY = 685, /* TERMINATE_RAY */
|
||||
IGNORE_INTERSECTION = 686, /* IGNORE_INTERSECTION */
|
||||
UNIFORM = 687, /* UNIFORM */
|
||||
SHARED = 688, /* SHARED */
|
||||
BUFFER = 689, /* BUFFER */
|
||||
TILEIMAGEEXT = 690, /* TILEIMAGEEXT */
|
||||
FLAT = 691, /* FLAT */
|
||||
SMOOTH = 692, /* SMOOTH */
|
||||
LAYOUT = 693, /* LAYOUT */
|
||||
DOUBLECONSTANT = 694, /* DOUBLECONSTANT */
|
||||
INT16CONSTANT = 695, /* INT16CONSTANT */
|
||||
UINT16CONSTANT = 696, /* UINT16CONSTANT */
|
||||
FLOAT16CONSTANT = 697, /* FLOAT16CONSTANT */
|
||||
INT32CONSTANT = 698, /* INT32CONSTANT */
|
||||
UINT32CONSTANT = 699, /* UINT32CONSTANT */
|
||||
INT64CONSTANT = 700, /* INT64CONSTANT */
|
||||
UINT64CONSTANT = 701, /* UINT64CONSTANT */
|
||||
SUBROUTINE = 702, /* SUBROUTINE */
|
||||
DEMOTE = 703, /* DEMOTE */
|
||||
FUNCTION = 704, /* FUNCTION */
|
||||
PAYLOADNV = 705, /* PAYLOADNV */
|
||||
PAYLOADINNV = 706, /* PAYLOADINNV */
|
||||
HITATTRNV = 707, /* HITATTRNV */
|
||||
CALLDATANV = 708, /* CALLDATANV */
|
||||
CALLDATAINNV = 709, /* CALLDATAINNV */
|
||||
PAYLOADEXT = 710, /* PAYLOADEXT */
|
||||
PAYLOADINEXT = 711, /* PAYLOADINEXT */
|
||||
HITATTREXT = 712, /* HITATTREXT */
|
||||
CALLDATAEXT = 713, /* CALLDATAEXT */
|
||||
CALLDATAINEXT = 714, /* CALLDATAINEXT */
|
||||
PATCH = 715, /* PATCH */
|
||||
SAMPLE = 716, /* SAMPLE */
|
||||
NONUNIFORM = 717, /* NONUNIFORM */
|
||||
COHERENT = 718, /* COHERENT */
|
||||
VOLATILE = 719, /* VOLATILE */
|
||||
RESTRICT = 720, /* RESTRICT */
|
||||
READONLY = 721, /* READONLY */
|
||||
WRITEONLY = 722, /* WRITEONLY */
|
||||
NONTEMPORAL = 723, /* NONTEMPORAL */
|
||||
DEVICECOHERENT = 724, /* DEVICECOHERENT */
|
||||
QUEUEFAMILYCOHERENT = 725, /* QUEUEFAMILYCOHERENT */
|
||||
WORKGROUPCOHERENT = 726, /* WORKGROUPCOHERENT */
|
||||
SUBGROUPCOHERENT = 727, /* SUBGROUPCOHERENT */
|
||||
NONPRIVATE = 728, /* NONPRIVATE */
|
||||
SHADERCALLCOHERENT = 729, /* SHADERCALLCOHERENT */
|
||||
NOPERSPECTIVE = 730, /* NOPERSPECTIVE */
|
||||
EXPLICITINTERPAMD = 731, /* EXPLICITINTERPAMD */
|
||||
PERVERTEXEXT = 732, /* PERVERTEXEXT */
|
||||
PERVERTEXNV = 733, /* PERVERTEXNV */
|
||||
PERPRIMITIVENV = 734, /* PERPRIMITIVENV */
|
||||
PERVIEWNV = 735, /* PERVIEWNV */
|
||||
PERTASKNV = 736, /* PERTASKNV */
|
||||
PERPRIMITIVEEXT = 737, /* PERPRIMITIVEEXT */
|
||||
TASKPAYLOADWORKGROUPEXT = 738, /* TASKPAYLOADWORKGROUPEXT */
|
||||
PRECISE = 739 /* PRECISE */
|
||||
};
|
||||
typedef enum yytokentype yytoken_kind_t;
|
||||
#endif
|
||||
@@ -581,7 +583,7 @@ union YYSTYPE
|
||||
glslang::TTypeParameters* typeParameters;
|
||||
} interm;
|
||||
|
||||
#line 585 "MachineIndependent/glslang_tab.cpp.h"
|
||||
#line 587 "MachineIndependent/glslang_tab.cpp.h"
|
||||
|
||||
};
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
virtual bool visitLoop(TVisit, TIntermLoop* node);
|
||||
virtual bool visitBranch(TVisit, TIntermBranch* node);
|
||||
virtual bool visitSwitch(TVisit, TIntermSwitch* node);
|
||||
virtual bool visitVariableDecl(TVisit, TIntermVariableDecl* node);
|
||||
|
||||
TInfoSink& infoSink;
|
||||
protected:
|
||||
@@ -1399,6 +1400,16 @@ bool TOutputTraverser::visitSwitch(TVisit /* visit */, TIntermSwitch* node)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TOutputTraverser::visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* node)
|
||||
{
|
||||
TInfoSink& out = infoSink;
|
||||
|
||||
OutputTreeText(out, node, depth);
|
||||
|
||||
out.debug << "VarDecl: " << node->getDeclSymbol()->getName() << '\n';
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// This function is the one to call externally to start the traversal.
|
||||
// Individual functions can be initialized to 0 to skip processing of that
|
||||
|
||||
@@ -166,7 +166,7 @@ typedef std::vector<TVarLivePair> TVarLiveVector;
|
||||
class TVarGatherTraverser : public TLiveTraverser {
|
||||
public:
|
||||
TVarGatherTraverser(const TIntermediate& i, bool traverseDeadCode, TVarLiveMap& inList, TVarLiveMap& outList, TVarLiveMap& uniformList)
|
||||
: TLiveTraverser(i, traverseDeadCode, true, true, false)
|
||||
: TLiveTraverser(i, traverseDeadCode, true, true, false, false)
|
||||
, inputList(inList)
|
||||
, outputList(outList)
|
||||
, uniformList(uniformList)
|
||||
@@ -209,7 +209,7 @@ class TVarSetTraverser : public TLiveTraverser
|
||||
{
|
||||
public:
|
||||
TVarSetTraverser(const TIntermediate& i, const TVarLiveMap& inList, const TVarLiveMap& outList, const TVarLiveMap& uniformList)
|
||||
: TLiveTraverser(i, true, true, true, false)
|
||||
: TLiveTraverser(i, true, true, true, false, true)
|
||||
, inputList(inList)
|
||||
, outputList(outList)
|
||||
, uniformList(uniformList)
|
||||
|
||||
@@ -1986,6 +1986,8 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
||||
set = 1;
|
||||
else if (qualifier.isHitObjectAttrNV())
|
||||
set = 2;
|
||||
else if (qualifier.isHitObjectAttrEXT())
|
||||
set = 2;
|
||||
else
|
||||
return -1;
|
||||
|
||||
@@ -2024,7 +2026,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
||||
// For raytracing IO (payloads and callabledata) each declaration occupies a single
|
||||
// slot irrespective of type.
|
||||
int collision = -1; // no collision
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) {
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV() || qualifier.isHitObjectAttrEXT()) {
|
||||
TRange range(qualifier.layoutLocation, qualifier.layoutLocation);
|
||||
collision = checkLocationRT(set, qualifier.layoutLocation);
|
||||
if (collision < 0)
|
||||
|
||||
@@ -574,8 +574,8 @@ public:
|
||||
TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const;
|
||||
TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const;
|
||||
bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false);
|
||||
TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&);
|
||||
TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst,
|
||||
TIntermLoop* addLoop(TIntermNode*, TIntermNode*, TIntermTyped*, bool testFirst, const TSourceLoc&);
|
||||
TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermNode*, TIntermTyped*, bool testFirst,
|
||||
const TSourceLoc&, TIntermLoop*&);
|
||||
TIntermBranch* addBranch(TOperator, const TSourceLoc&);
|
||||
TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&);
|
||||
@@ -763,6 +763,16 @@ public:
|
||||
useReplicatedComposites = true;
|
||||
}
|
||||
bool usingReplicatedComposites() const { return useReplicatedComposites; }
|
||||
void setPromoteUint32Indices()
|
||||
{
|
||||
promoteUint32Indices = true;
|
||||
}
|
||||
bool usingPromoteUint32Indices() const { return promoteUint32Indices; }
|
||||
void setShader64BitIndexing()
|
||||
{
|
||||
shader64BitIndexing = true;
|
||||
}
|
||||
bool usingShader64BitIndexing() const { return shader64BitIndexing; }
|
||||
void setUseVariablePointers()
|
||||
{
|
||||
useVariablePointers = true;
|
||||
@@ -1295,6 +1305,8 @@ protected:
|
||||
bool maximallyReconverges;
|
||||
bool usePhysicalStorageBuffer;
|
||||
bool useReplicatedComposites { false };
|
||||
bool promoteUint32Indices { false };
|
||||
bool shader64BitIndexing { false };
|
||||
|
||||
TSpirvRequirement* spirvRequirement;
|
||||
TSpirvExecutionMode* spirvExecutionMode;
|
||||
|
||||
@@ -153,12 +153,57 @@ int TPpContext::CPPdefine(TPpToken* ppToken)
|
||||
return token;
|
||||
}
|
||||
|
||||
int pendingPoundSymbols = 0;
|
||||
TPpToken savePound;
|
||||
// record the definition of the macro
|
||||
while (token != '\n' && token != EndOfInput) {
|
||||
mac.body.putToken(token, ppToken);
|
||||
if (token == '#') {
|
||||
pendingPoundSymbols++;
|
||||
if (pendingPoundSymbols == 0) {
|
||||
savePound = *ppToken;
|
||||
}
|
||||
} else if (pendingPoundSymbols == 0) {
|
||||
mac.body.putToken(token, ppToken);
|
||||
} else if (pendingPoundSymbols == 1) {
|
||||
// A single #: stringify
|
||||
parseContext.requireProfile(ppToken->loc, ~EEsProfile, "stringify (#)");
|
||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "stringify (#)");
|
||||
bool isArg = false;
|
||||
if (token == PpAtomIdentifier) {
|
||||
for (int i = (int)mac.args.size() - 1; i >= 0; i--) {
|
||||
if (strcmp(atomStrings.getString(mac.args[i]), ppToken->name) == 0) {
|
||||
isArg = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isArg) {
|
||||
parseContext.ppError(ppToken->loc, "'#' is not followed by a macro parameter.", "#", "");
|
||||
return token;
|
||||
}
|
||||
mac.body.putToken(tStringifyLevelInput::PUSH, ppToken);
|
||||
mac.body.putToken(token, ppToken);
|
||||
mac.body.putToken(tStringifyLevelInput::POP, ppToken);
|
||||
pendingPoundSymbols = 0;
|
||||
} else if (pendingPoundSymbols % 2 == 0) {
|
||||
// Any number of pastes '##' in a row: idempotent, just becomes one paste
|
||||
parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)");
|
||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)");
|
||||
for (int i = 0; i < pendingPoundSymbols / 2; i++) {
|
||||
mac.body.putToken(PpAtomPaste, &savePound);
|
||||
}
|
||||
mac.body.putToken(token, ppToken);
|
||||
pendingPoundSymbols = 0;
|
||||
} else {
|
||||
// An odd number of '#' i.e., mix of paste and stringify: does not give valid preprocessing token
|
||||
parseContext.ppError(ppToken->loc, "Illegal sequence of paste (##) and stringify (#).", "#", "");
|
||||
return token;
|
||||
}
|
||||
|
||||
token = scanToken(ppToken);
|
||||
if (token != '\n' && ppToken->space)
|
||||
mac.body.putToken(' ', ppToken);
|
||||
}
|
||||
if (pendingPoundSymbols != 0) {
|
||||
parseContext.ppError(ppToken->loc, "Macro ended with incomplete '#' paste/stringify operators", "#", "");
|
||||
}
|
||||
|
||||
// check for duplicate definition
|
||||
@@ -1119,7 +1164,7 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken)
|
||||
}
|
||||
|
||||
// see if are preceding a ##
|
||||
if (mac->body.peekUntokenizedPasting()) {
|
||||
if (mac->body.peekTokenizedPasting(false)) {
|
||||
prepaste = true;
|
||||
pasting = true;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,6 @@ public:
|
||||
int getToken(TParseContextBase&, TPpToken*);
|
||||
bool atEnd() { return currentPos >= stream.size(); }
|
||||
bool peekTokenizedPasting(bool lastTokenPastes);
|
||||
bool peekUntokenizedPasting();
|
||||
void reset() { currentPos = 0; }
|
||||
|
||||
protected:
|
||||
@@ -373,22 +372,6 @@ protected:
|
||||
}
|
||||
if (!inputStack.empty() && inputStack.back()->isStringInput() && !inElseSkip) {
|
||||
if (token == '\n') {
|
||||
bool seenNumSign = false;
|
||||
for (int i = 0; i < (int)lastLineTokens.size() - 1;) {
|
||||
int curPos = i;
|
||||
int curToken = lastLineTokens[i++];
|
||||
if (curToken == '#' && lastLineTokens[i] == '#') {
|
||||
curToken = PpAtomPaste;
|
||||
i++;
|
||||
}
|
||||
if (curToken == '#') {
|
||||
if (seenNumSign) {
|
||||
parseContext.ppError(lastLineTokenLocs[curPos], "(#) can be preceded in its line only by spaces or horizontal tabs", "#", "");
|
||||
} else {
|
||||
seenNumSign = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
lastLineTokens.clear();
|
||||
lastLineTokenLocs.clear();
|
||||
} else {
|
||||
@@ -458,6 +441,38 @@ 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;
|
||||
};
|
||||
|
||||
class tZeroInput : public tInput {
|
||||
public:
|
||||
tZeroInput(TPpContext* pp) : tInput(pp) { }
|
||||
|
||||
@@ -97,7 +97,6 @@ namespace glslang {
|
||||
/////////////////////////////////// Floating point constants: /////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// Scan a single- or double-precision floating point constant.
|
||||
// Assumes that the scanner has seen at least one digit,
|
||||
// followed by either a decimal '.' or the letter 'e', or a
|
||||
@@ -1226,7 +1225,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
|
||||
//
|
||||
int TPpContext::tokenize(TPpToken& ppToken)
|
||||
{
|
||||
for(;;) {
|
||||
int stringifyDepth = 0;
|
||||
TPpToken stringifiedToken; // Tokens are appended to this as they come in
|
||||
for (;;) {
|
||||
int token = scanToken(&ppToken);
|
||||
|
||||
// Handle token-pasting logic
|
||||
@@ -1254,6 +1255,20 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
||||
if (token == '\n')
|
||||
continue;
|
||||
|
||||
if (token == tStringifyLevelInput::PUSH) {
|
||||
stringifyDepth++;
|
||||
continue;
|
||||
}
|
||||
if (token == tStringifyLevelInput::POP) {
|
||||
assert(stringifyDepth > 0);
|
||||
stringifyDepth--;
|
||||
if (stringifyDepth == 0) {
|
||||
snprintf(ppToken.name, sizeof(ppToken.name), "%s", stringifiedToken.name);
|
||||
return PpAtomConstString;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// expand macros
|
||||
if (token == PpAtomIdentifier) {
|
||||
switch (MacroExpand(&ppToken, false, true)) {
|
||||
@@ -1267,7 +1282,21 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
||||
}
|
||||
}
|
||||
|
||||
bool needStringSupport = ifdepth == 0 && (token == PpAtomConstString || stringifyDepth > 0);
|
||||
if (needStringSupport && parseContext.intermediate.getSource() != EShSourceHlsl) {
|
||||
// HLSL allows string literals.
|
||||
// GLSL allows string literals with GL_EXT_debug_printf.
|
||||
const char* const string_literal_EXTs[] = { E_GL_EXT_debug_printf, E_GL_EXT_spirv_intrinsics };
|
||||
parseContext.requireExtensions(ppToken.loc, 2, string_literal_EXTs, "string literal");
|
||||
if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf) &&
|
||||
!parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
switch (token) {
|
||||
case PpAtomConstString:
|
||||
break;
|
||||
case PpAtomIdentifier:
|
||||
case PpAtomConstInt:
|
||||
case PpAtomConstUint:
|
||||
@@ -1281,17 +1310,6 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
||||
if (ppToken.name[0] == '\0')
|
||||
continue;
|
||||
break;
|
||||
case PpAtomConstString:
|
||||
// HLSL allows string literals.
|
||||
// GLSL allows string literals with GL_EXT_debug_printf.
|
||||
if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) {
|
||||
const char* const string_literal_EXTs[] = { E_GL_EXT_debug_printf, E_GL_EXT_spirv_intrinsics };
|
||||
parseContext.requireExtensions(ppToken.loc, 2, string_literal_EXTs, "string literal");
|
||||
if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf) &&
|
||||
!parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '\'':
|
||||
parseContext.ppError(ppToken.loc, "character literals not supported", "\'", "");
|
||||
continue;
|
||||
@@ -1299,6 +1317,17 @@ int TPpContext::tokenize(TPpToken& ppToken)
|
||||
snprintf(ppToken.name, sizeof(ppToken.name), "%s", atomStrings.getString(token));
|
||||
break;
|
||||
}
|
||||
if (stringifyDepth > 0) {
|
||||
size_t existingLen = strlen(stringifiedToken.name);
|
||||
char* dst = stringifiedToken.name + existingLen;
|
||||
// stringify_depth would determine how many layers of \\\"\\\" are needed, if we wanted to.
|
||||
if (ppToken.space) {
|
||||
snprintf(dst, sizeof(stringifiedToken.name) - existingLen - 1, " %s", ppToken.name);
|
||||
} else {
|
||||
snprintf(dst, sizeof(stringifiedToken.name) - existingLen, "%s", ppToken.name);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
@@ -1329,6 +1358,7 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken)
|
||||
|
||||
// This covers end of macro expansion
|
||||
if (endOfReplacementList()) {
|
||||
// this should be unreachable, incomplete #/## sequences are caught at macro parsing time.
|
||||
parseContext.ppError(ppToken.loc, "unexpected location; end of replacement list", "##", "");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void TPpContext::TokenStream::putToken(int atom, TPpToken* ppToken)
|
||||
}
|
||||
|
||||
// Read the next token from a macro token stream.
|
||||
int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken *ppToken)
|
||||
int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken* ppToken)
|
||||
{
|
||||
if (atEnd())
|
||||
return EndOfInput;
|
||||
@@ -113,16 +113,6 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
|
||||
int atom = stream[currentPos++].get(*ppToken);
|
||||
ppToken->loc = parseContext.getCurrentLoc();
|
||||
|
||||
// Check for ##, unless the current # is the last character
|
||||
if (atom == '#') {
|
||||
if (peekToken('#')) {
|
||||
parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)");
|
||||
parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)");
|
||||
currentPos++;
|
||||
atom = PpAtomPaste;
|
||||
}
|
||||
}
|
||||
|
||||
return atom;
|
||||
}
|
||||
|
||||
@@ -146,8 +136,10 @@ bool TPpContext::TokenStream::peekTokenizedPasting(bool lastTokenPastes)
|
||||
|
||||
// 2. last token and we've been told after this there will be a ##
|
||||
|
||||
if (! lastTokenPastes)
|
||||
if (! lastTokenPastes) {
|
||||
currentPos = savePos;
|
||||
return false;
|
||||
}
|
||||
// Getting here means the last token will be pasted, after this
|
||||
|
||||
// Are we at the last non-whitespace token?
|
||||
@@ -167,29 +159,6 @@ bool TPpContext::TokenStream::peekTokenizedPasting(bool lastTokenPastes)
|
||||
return !moreTokens;
|
||||
}
|
||||
|
||||
// See if the next non-white-space tokens are two consecutive #
|
||||
bool TPpContext::TokenStream::peekUntokenizedPasting()
|
||||
{
|
||||
// don't return early, have to restore this
|
||||
size_t savePos = currentPos;
|
||||
|
||||
// skip white-space
|
||||
while (peekToken(' '))
|
||||
++currentPos;
|
||||
|
||||
// check for ##
|
||||
bool pasting = false;
|
||||
if (peekToken('#')) {
|
||||
++currentPos;
|
||||
if (peekToken('#'))
|
||||
pasting = true;
|
||||
}
|
||||
|
||||
currentPos = savePos;
|
||||
|
||||
return pasting;
|
||||
}
|
||||
|
||||
void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting, bool expanded)
|
||||
{
|
||||
pushInput(new tTokenInput(this, &ts, prepasting, expanded));
|
||||
|
||||
Reference in New Issue
Block a user