MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / makeSampledImageType

Method makeSampledImageType

SPIRV/SpvBuilder.cpp:914–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912}
913
914Id Builder::makeSampledImageType(Id imageType, const char* debugName)
915{
916 // try to find it
917 Instruction* type;
918 for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeSampledImage)].size(); ++t) {
919 type = groupedTypes[enumCast(Op::OpTypeSampledImage)][t];
920 if (type->getIdOperand(0) == imageType)
921 return type->getResultId();
922 }
923
924 // not found, make it
925 type = new Instruction(getUniqueId(), NoType, Op::OpTypeSampledImage);
926 type->addIdOperand(imageType);
927
928 groupedTypes[enumCast(Op::OpTypeSampledImage)].push_back(type);
929 constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
930 module.mapInstruction(type);
931
932 if (emitNonSemanticShaderDebugInfo)
933 {
934 auto const debugResultId = makeOpaqueDebugType(debugName);
935 debugTypeIdLookup[type->getResultId()] = debugResultId;
936 }
937
938 return type->getResultId();
939}
940
941Id Builder::makeDebugInfoNone()
942{

Callers 1

Calls 7

enumCastFunction · 0.85
getResultIdMethod · 0.80
addIdOperandMethod · 0.80
mapInstructionMethod · 0.80
sizeMethod · 0.45
getIdOperandMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected