| 912 | } |
| 913 | |
| 914 | Id 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 | |
| 941 | Id Builder::makeDebugInfoNone() |
| 942 | { |
no test coverage detected