|
@@ -227,6 +227,7 @@ protected:
|
|
spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId);
|
|
spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId);
|
|
spv::Id getSymbolId(const glslang::TIntermSymbol* node);
|
|
spv::Id getSymbolId(const glslang::TIntermSymbol* node);
|
|
void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier);
|
|
void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier);
|
|
|
|
+ bool hasQCOMImageProceessingDecoration(spv::Id id, spv::Decoration decor);
|
|
void addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor);
|
|
void addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor);
|
|
void addImageProcessing2QCOMDecoration(spv::Id id, bool isForGather);
|
|
void addImageProcessing2QCOMDecoration(spv::Id id, bool isForGather);
|
|
spv::Id createSpvConstant(const glslang::TIntermTyped&);
|
|
spv::Id createSpvConstant(const glslang::TIntermTyped&);
|
|
@@ -283,6 +284,7 @@ protected:
|
|
spv::Id taskPayloadID;
|
|
spv::Id taskPayloadID;
|
|
// Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData
|
|
// Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData
|
|
std::unordered_map<unsigned int, glslang::TIntermSymbol *> locationToSymbol[4];
|
|
std::unordered_map<unsigned int, glslang::TIntermSymbol *> locationToSymbol[4];
|
|
|
|
+ std::unordered_map<spv::Id, std::vector<spv::Decoration> > idToQCOMDecorations;
|
|
};
|
|
};
|
|
|
|
|
|
//
|
|
//
|
|
@@ -398,11 +400,11 @@ void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector
|
|
bool useVulkanMemoryModel)
|
|
bool useVulkanMemoryModel)
|
|
{
|
|
{
|
|
if (!useVulkanMemoryModel) {
|
|
if (!useVulkanMemoryModel) {
|
|
- if (qualifier.isCoherent())
|
|
|
|
- memory.push_back(spv::DecorationCoherent);
|
|
|
|
if (qualifier.isVolatile()) {
|
|
if (qualifier.isVolatile()) {
|
|
memory.push_back(spv::DecorationVolatile);
|
|
memory.push_back(spv::DecorationVolatile);
|
|
memory.push_back(spv::DecorationCoherent);
|
|
memory.push_back(spv::DecorationCoherent);
|
|
|
|
+ } else if (qualifier.isCoherent()) {
|
|
|
|
+ memory.push_back(spv::DecorationCoherent);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (qualifier.isRestrict())
|
|
if (qualifier.isRestrict())
|
|
@@ -987,18 +989,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|
return spv::BuiltInHitTriangleVertexPositionsKHR;
|
|
return spv::BuiltInHitTriangleVertexPositionsKHR;
|
|
case glslang::EbvInstanceCustomIndex:
|
|
case glslang::EbvInstanceCustomIndex:
|
|
return spv::BuiltInInstanceCustomIndexKHR;
|
|
return spv::BuiltInInstanceCustomIndexKHR;
|
|
- case glslang::EbvHitT:
|
|
|
|
- {
|
|
|
|
- // this is a GLSL alias of RayTmax
|
|
|
|
- // in SPV_NV_ray_tracing it has a dedicated builtin
|
|
|
|
- // but in SPV_KHR_ray_tracing it gets mapped to RayTmax
|
|
|
|
- auto& extensions = glslangIntermediate->getRequestedExtensions();
|
|
|
|
- if (extensions.find("GL_NV_ray_tracing") != extensions.end()) {
|
|
|
|
- return spv::BuiltInHitTNV;
|
|
|
|
- } else {
|
|
|
|
- return spv::BuiltInRayTmaxKHR;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
case glslang::EbvHitKind:
|
|
case glslang::EbvHitKind:
|
|
return spv::BuiltInHitKindKHR;
|
|
return spv::BuiltInHitKindKHR;
|
|
case glslang::EbvObjectToWorld:
|
|
case glslang::EbvObjectToWorld:
|
|
@@ -1593,6 +1583,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
|
|
builder.addInclude(iItr->first, iItr->second);
|
|
builder.addInclude(iItr->first, iItr->second);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ builder.setUseReplicatedComposites(glslangIntermediate->usingReplicatedComposites());
|
|
|
|
+
|
|
stdBuiltins = builder.import("GLSL.std.450");
|
|
stdBuiltins = builder.import("GLSL.std.450");
|
|
|
|
|
|
spv::AddressingModel addressingModel = spv::AddressingModelLogical;
|
|
spv::AddressingModel addressingModel = spv::AddressingModelLogical;
|
|
@@ -2007,8 +1999,9 @@ void TGlslangToSpvTraverser::finishSpv(bool compileOnly)
|
|
}
|
|
}
|
|
|
|
|
|
// finish off the entry-point SPV instruction by adding the Input/Output <id>
|
|
// finish off the entry-point SPV instruction by adding the Input/Output <id>
|
|
- for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
|
|
|
|
- entryPoint->addIdOperand(*it);
|
|
|
|
|
|
+ entryPoint->reserveOperands(iOSet.size());
|
|
|
|
+ for (auto id : iOSet)
|
|
|
|
+ entryPoint->addIdOperand(id);
|
|
}
|
|
}
|
|
|
|
|
|
// Add capabilities, extensions, remove unneeded decorations, etc.,
|
|
// Add capabilities, extensions, remove unneeded decorations, etc.,
|
|
@@ -3381,6 +3374,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
|
|
|
|
case glslang::EOpImageBlockMatchGatherSSDQCOM:
|
|
case glslang::EOpImageBlockMatchGatherSSDQCOM:
|
|
case glslang::EOpImageBlockMatchGatherSADQCOM:
|
|
case glslang::EOpImageBlockMatchGatherSADQCOM:
|
|
|
|
+ builder.addCapability(spv::CapabilityTextureBlockMatchQCOM);
|
|
|
|
+ builder.addExtension(spv::E_SPV_QCOM_image_processing);
|
|
builder.addCapability(spv::CapabilityTextureBlockMatch2QCOM);
|
|
builder.addCapability(spv::CapabilityTextureBlockMatch2QCOM);
|
|
builder.addExtension(spv::E_SPV_QCOM_image_processing2);
|
|
builder.addExtension(spv::E_SPV_QCOM_image_processing2);
|
|
break;
|
|
break;
|
|
@@ -3710,6 +3705,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[1])); // buf
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixLoad) {
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixLoad) {
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
|
|
|
|
+ auto layout = builder.getConstantScalar(operands[3]);
|
|
|
|
+ if (layout == spv::CooperativeMatrixLayoutRowBlockedInterleavedARM ||
|
|
|
|
+ layout == spv::CooperativeMatrixLayoutColumnBlockedInterleavedARM) {
|
|
|
|
+ builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts);
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixLayoutsARM);
|
|
|
|
+ }
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
} else {
|
|
} else {
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
@@ -3734,6 +3735,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[0])); // object
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixStore) {
|
|
if (node->getOp() == glslang::EOpCooperativeMatrixStore) {
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[3])); // matrixLayout
|
|
|
|
+ auto layout = builder.getConstantScalar(operands[3]);
|
|
|
|
+ if (layout == spv::CooperativeMatrixLayoutRowBlockedInterleavedARM ||
|
|
|
|
+ layout == spv::CooperativeMatrixLayoutColumnBlockedInterleavedARM) {
|
|
|
|
+ builder.addExtension(spv::E_SPV_ARM_cooperative_matrix_layouts);
|
|
|
|
+ builder.addCapability(spv::CapabilityCooperativeMatrixLayoutsARM);
|
|
|
|
+ }
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
} else {
|
|
} else {
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
idImmOps.push_back(spv::IdImmediate(true, operands[2])); // stride
|
|
@@ -5376,17 +5383,37 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType
|
|
int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout,
|
|
int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout,
|
|
matrixLayout == glslang::ElmRowMajor);
|
|
matrixLayout == glslang::ElmRowMajor);
|
|
|
|
|
|
|
|
+ bool isVectorLike = memberType.isVector();
|
|
|
|
+ if (memberType.isMatrix()) {
|
|
|
|
+ if (matrixLayout == glslang::ElmRowMajor)
|
|
|
|
+ isVectorLike = memberType.getMatrixRows() == 1;
|
|
|
|
+ else
|
|
|
|
+ isVectorLike = memberType.getMatrixCols() == 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
// Adjust alignment for HLSL rules
|
|
// Adjust alignment for HLSL rules
|
|
// TODO: make this consistent in early phases of code:
|
|
// TODO: make this consistent in early phases of code:
|
|
// adjusting this late means inconsistencies with earlier code, which for reflection is an issue
|
|
// adjusting this late means inconsistencies with earlier code, which for reflection is an issue
|
|
// Until reflection is brought in sync with these adjustments, don't apply to $Global,
|
|
// Until reflection is brought in sync with these adjustments, don't apply to $Global,
|
|
// which is the most likely to rely on reflection, and least likely to rely implicit layouts
|
|
// which is the most likely to rely on reflection, and least likely to rely implicit layouts
|
|
if (glslangIntermediate->usingHlslOffsets() &&
|
|
if (glslangIntermediate->usingHlslOffsets() &&
|
|
- ! memberType.isArray() && memberType.isVector() && structType.getTypeName().compare("$Global") != 0) {
|
|
|
|
- int dummySize;
|
|
|
|
- int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, dummySize);
|
|
|
|
- if (componentAlignment <= 4)
|
|
|
|
|
|
+ ! memberType.isStruct() && structType.getTypeName().compare("$Global") != 0) {
|
|
|
|
+ int componentSize;
|
|
|
|
+ int componentAlignment = glslangIntermediate->getBaseAlignmentScalar(memberType, componentSize);
|
|
|
|
+ if (! memberType.isArray() && isVectorLike && componentAlignment <= 4)
|
|
memberAlignment = componentAlignment;
|
|
memberAlignment = componentAlignment;
|
|
|
|
+
|
|
|
|
+ // Don't add unnecessary padding after this member
|
|
|
|
+ // (undo std140 bumping size to a mutliple of vec4)
|
|
|
|
+ if (explicitLayout == glslang::ElpStd140) {
|
|
|
|
+ if (memberType.isMatrix()) {
|
|
|
|
+ if (matrixLayout == glslang::ElmRowMajor)
|
|
|
|
+ memberSize -= componentSize * (4 - memberType.getMatrixCols());
|
|
|
|
+ else
|
|
|
|
+ memberSize -= componentSize * (4 - memberType.getMatrixRows());
|
|
|
|
+ } else if (memberType.isArray())
|
|
|
|
+ memberSize -= componentSize * (4 - memberType.getVectorSize());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// Bump up to member alignment
|
|
// Bump up to member alignment
|
|
@@ -5394,7 +5421,7 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType
|
|
|
|
|
|
// Bump up to vec4 if there is a bad straddle
|
|
// Bump up to vec4 if there is a bad straddle
|
|
if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize,
|
|
if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize,
|
|
- currentOffset))
|
|
|
|
|
|
+ currentOffset, isVectorLike))
|
|
glslang::RoundToPow2(currentOffset, 16);
|
|
glslang::RoundToPow2(currentOffset, 16);
|
|
|
|
|
|
nextOffset = currentOffset + memberSize;
|
|
nextOffset = currentOffset + memberSize;
|
|
@@ -5479,8 +5506,10 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
|
|
// memory and use RestrictPointer/AliasedPointer.
|
|
// memory and use RestrictPointer/AliasedPointer.
|
|
if (originalParam(type.getQualifier().storage, type, false) ||
|
|
if (originalParam(type.getQualifier().storage, type, false) ||
|
|
!writableParam(type.getQualifier().storage)) {
|
|
!writableParam(type.getQualifier().storage)) {
|
|
- decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrict :
|
|
|
|
- spv::DecorationAliased);
|
|
|
|
|
|
+ // TranslateMemoryDecoration added Restrict decoration already.
|
|
|
|
+ if (!type.getQualifier().isRestrict()) {
|
|
|
|
+ decorations.push_back(spv::DecorationAliased);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrictPointerEXT :
|
|
decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrictPointerEXT :
|
|
spv::DecorationAliasedPointerEXT);
|
|
spv::DecorationAliasedPointerEXT);
|
|
@@ -5492,12 +5521,16 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
|
|
glslang::TIntermAggregate* glslFunction = glslFunctions[f]->getAsAggregate();
|
|
glslang::TIntermAggregate* glslFunction = glslFunctions[f]->getAsAggregate();
|
|
if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction)
|
|
if (! glslFunction || glslFunction->getOp() != glslang::EOpFunction)
|
|
continue;
|
|
continue;
|
|
|
|
+
|
|
|
|
+ builder.setDebugSourceLocation(glslFunction->getLoc().line, glslFunction->getLoc().getFilename());
|
|
|
|
+
|
|
if (isShaderEntryPoint(glslFunction)) {
|
|
if (isShaderEntryPoint(glslFunction)) {
|
|
|
|
+ // For HLSL, the entry function is actually a compiler generated function to resolve the difference of
|
|
|
|
+ // entry function signature between HLSL and SPIR-V. So we don't emit debug information for that.
|
|
if (glslangIntermediate->getSource() != glslang::EShSourceHlsl) {
|
|
if (glslangIntermediate->getSource() != glslang::EShSourceHlsl) {
|
|
- builder.setupDebugFunctionEntry(shaderEntry, glslangIntermediate->getEntryPointMangledName().c_str(),
|
|
|
|
- glslFunction->getLoc().line,
|
|
|
|
- std::vector<spv::Id>(), // main function has no param
|
|
|
|
- std::vector<char const*>());
|
|
|
|
|
|
+ builder.setupFunctionDebugInfo(shaderEntry, glslangIntermediate->getEntryPointMangledName().c_str(),
|
|
|
|
+ std::vector<spv::Id>(), // main function has no param
|
|
|
|
+ std::vector<char const*>());
|
|
}
|
|
}
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -5550,8 +5583,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
|
|
TranslatePrecisionDecoration(glslFunction->getType()), convertGlslangToSpvType(glslFunction->getType()),
|
|
TranslatePrecisionDecoration(glslFunction->getType()), convertGlslangToSpvType(glslFunction->getType()),
|
|
glslFunction->getName().c_str(), convertGlslangLinkageToSpv(glslFunction->getLinkType()), paramTypes,
|
|
glslFunction->getName().c_str(), convertGlslangLinkageToSpv(glslFunction->getLinkType()), paramTypes,
|
|
paramDecorations, &functionBlock);
|
|
paramDecorations, &functionBlock);
|
|
- builder.setupDebugFunctionEntry(function, glslFunction->getName().c_str(), glslFunction->getLoc().line,
|
|
|
|
- paramTypes, paramNames);
|
|
|
|
|
|
+ builder.setupFunctionDebugInfo(function, glslFunction->getName().c_str(), paramTypes, paramNames);
|
|
if (implicitThis)
|
|
if (implicitThis)
|
|
function->setImplicitThis();
|
|
function->setImplicitThis();
|
|
|
|
|
|
@@ -5775,8 +5807,16 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate&
|
|
lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
|
|
lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
|
|
builder.addDecoration(lvalue_id, TranslateNonUniformDecoration(lvalueCoherentFlags));
|
|
builder.addDecoration(lvalue_id, TranslateNonUniformDecoration(lvalueCoherentFlags));
|
|
lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType());
|
|
lvalueCoherentFlags |= TranslateCoherent(glslangArguments[i]->getAsTyped()->getType());
|
|
- } else
|
|
|
|
- arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType()));
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (i > 0 &&
|
|
|
|
+ glslangArguments[i]->getAsSymbolNode() && glslangArguments[i-1]->getAsSymbolNode() &&
|
|
|
|
+ glslangArguments[i]->getAsSymbolNode()->getId() == glslangArguments[i-1]->getAsSymbolNode()->getId()) {
|
|
|
|
+ // Reuse the id if possible
|
|
|
|
+ arguments.push_back(arguments[i-1]);
|
|
|
|
+ } else {
|
|
|
|
+ arguments.push_back(accessChainLoad(glslangArguments[i]->getAsTyped()->getType()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6407,6 +6447,9 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Reset source location to the function call location after argument evaluation
|
|
|
|
+ builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename());
|
|
|
|
+
|
|
// 2. Allocate space for anything needing a copy, and if it's "in" or "inout"
|
|
// 2. Allocate space for anything needing a copy, and if it's "in" or "inout"
|
|
// copy the original into that space.
|
|
// copy the original into that space.
|
|
//
|
|
//
|
|
@@ -8055,6 +8098,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
|
|
}
|
|
}
|
|
|
|
|
|
std::vector<spv::Id> spvAtomicOperands; // hold the spv operands
|
|
std::vector<spv::Id> spvAtomicOperands; // hold the spv operands
|
|
|
|
+ spvAtomicOperands.reserve(6);
|
|
spvAtomicOperands.push_back(pointerId);
|
|
spvAtomicOperands.push_back(pointerId);
|
|
spvAtomicOperands.push_back(scopeId);
|
|
spvAtomicOperands.push_back(scopeId);
|
|
spvAtomicOperands.push_back(semanticsId);
|
|
spvAtomicOperands.push_back(semanticsId);
|
|
@@ -9813,6 +9857,16 @@ void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const g
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool TGlslangToSpvTraverser::hasQCOMImageProceessingDecoration(spv::Id id, spv::Decoration decor)
|
|
|
|
+{
|
|
|
|
+ std::vector<spv::Decoration> &decoVec = idToQCOMDecorations[id];
|
|
|
|
+ for ( auto d : decoVec ) {
|
|
|
|
+ if ( d == decor )
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor)
|
|
void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::Decoration decor)
|
|
{
|
|
{
|
|
spv::Op opc = builder.getOpCode(id);
|
|
spv::Op opc = builder.getOpCode(id);
|
|
@@ -9823,7 +9877,10 @@ void TGlslangToSpvTraverser::addImageProcessingQCOMDecoration(spv::Id id, spv::D
|
|
|
|
|
|
if (opc == spv::OpLoad) {
|
|
if (opc == spv::OpLoad) {
|
|
spv::Id texid = builder.getIdOperand(id, 0);
|
|
spv::Id texid = builder.getIdOperand(id, 0);
|
|
- builder.addDecoration(texid, decor);
|
|
|
|
|
|
+ if (!hasQCOMImageProceessingDecoration(texid, decor)) {//
|
|
|
|
+ builder.addDecoration(texid, decor);
|
|
|
|
+ idToQCOMDecorations[texid].push_back(decor);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -9841,7 +9898,10 @@ void TGlslangToSpvTraverser::addImageProcessing2QCOMDecoration(spv::Id id, bool
|
|
if (this->glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) {
|
|
if (this->glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) {
|
|
assert(iOSet.count(tsid) > 0);
|
|
assert(iOSet.count(tsid) > 0);
|
|
}
|
|
}
|
|
- this->builder.addDecoration(tsid, decor);
|
|
|
|
|
|
+ if (!hasQCOMImageProceessingDecoration(tsid, decor)) {
|
|
|
|
+ this->builder.addDecoration(tsid, decor);
|
|
|
|
+ idToQCOMDecorations[tsid].push_back(decor);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -10183,6 +10243,7 @@ spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslan
|
|
|
|
|
|
// Operands to accumulate OpPhi operands
|
|
// Operands to accumulate OpPhi operands
|
|
std::vector<spv::Id> phiOperands;
|
|
std::vector<spv::Id> phiOperands;
|
|
|
|
+ phiOperands.reserve(4);
|
|
// accumulate left operand's phi information
|
|
// accumulate left operand's phi information
|
|
phiOperands.push_back(leftId);
|
|
phiOperands.push_back(leftId);
|
|
phiOperands.push_back(builder.getBuildPoint()->getId());
|
|
phiOperands.push_back(builder.getBuildPoint()->getId());
|