Lines Matching defs:const
83 static const int maxMatrixSize = 4;
85 unsigned int getSpvVersion() const { return spvVersion; }
92 spv::Id getStringId(const std::string& str)
99 const char* file_c_str = str.c_str();
106 spv::Id getSourceFile() const
110 void setSourceFile(const std::string& file)
115 void setSourceText(const std::string& text) { sourceText = text; }
116 void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); }
117 void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
119 void setEmitNonSemanticShaderDebugInfo(bool const emit)
128 void setEmitNonSemanticShaderDebugSource(bool const src)
132 void addExtension(const char* ext) { extensions.insert(ext); }
133 void removeExtension(const char* ext)
137 void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion)
142 void promoteIncorporatedExtension(const char* baseExt, const char* promoExt, SpvVersion incorporatedVersion)
147 void addInclude(const std::string& name, const std::string& text)
152 Id import(const char*);
181 void setLine(int line, const char* filename);
196 Id makeStructType(const std::vector<Id>& members, const char* name, bool const compilerGenerated = true);
202 Id makeFunctionType(Id returnType, const std::vector<Id>& paramTypes);
219 Id makeBoolDebugType(int const size);
220 Id makeIntegerDebugType(int const width, bool const hasSign);
221 Id makeFloatDebugType(int const width);
222 Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType);
223 Id makeArrayDebugType(Id const baseType, Id const componentCount);
224 Id makeVectorDebugType(Id const baseType, int const componentCount);
225 Id makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor = true);
226 Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc);
227 Id makeCompositeDebugType(std::vector<Id> const& memberTypes, char const*const name,
228 NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false);
229 Id makeDebugSource(const Id fileName);
231 Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable);
232 Id createDebugLocalVariable(Id type, char const*const name, size_t const argNumber = 0);
234 Id makeDebugDeclare(Id const debugLocalVariable, Id const pointer);
235 Id makeDebugValue(Id const debugLocalVariable, Id const value);
236 Id makeDebugFunctionType(Id returnType, const std::vector<Id>& paramTypes);
239 std::string unmangleFunctionName(std::string const& name) const;
240 void setupDebugFunctionEntry(Function* function, const char* name, int line,
241 const std::vector<Id>& paramTypes,
242 const std::vector<char const*>& paramNames);
252 Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
253 Id getDerefTypeId(Id resultId) const;
254 Op getOpCode(Id id) const { return module.getInstruction(id)->getOpCode(); }
255 Op getTypeClass(Id typeId) const { return getOpCode(typeId); }
256 Op getMostBasicTypeClass(Id typeId) const;
257 int getNumComponents(Id resultId) const { return getNumTypeComponents(getTypeId(resultId)); }
258 int getNumTypeConstituents(Id typeId) const;
259 int getNumTypeComponents(Id typeId) const { return getNumTypeConstituents(typeId); }
260 Id getScalarTypeId(Id typeId) const;
261 Id getContainedTypeId(Id typeId) const;
262 Id getContainedTypeId(Id typeId, int) const;
263 StorageClass getTypeStorageClass(Id typeId) const { return module.getStorageClass(typeId); }
264 ImageFormat getImageTypeFormat(Id typeId) const
266 Id getResultingAccessChainType() const;
269 bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); }
270 bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); }
271 bool isVector(Id resultId) const { return isVectorType(getTypeId(resultId)); }
272 bool isMatrix(Id resultId) const { return isMatrixType(getTypeId(resultId)); }
273 bool isCooperativeMatrix(Id resultId)const { return isCooperativeMatrixType(getTypeId(resultId)); }
274 bool isAggregate(Id resultId) const { return isAggregateType(getTypeId(resultId)); }
275 bool isSampledImage(Id resultId) const { return isSampledImageType(getTypeId(resultId)); }
279 bool isIntType(Id typeId) const
281 bool isUintType(Id typeId) const
283 bool isFloatType(Id typeId) const { return getTypeClass(typeId) == OpTypeFloat; }
284 bool isPointerType(Id typeId) const { return getTypeClass(typeId) == OpTypePointer; }
285 bool isScalarType(Id typeId) const
288 bool isVectorType(Id typeId) const { return getTypeClass(typeId) == OpTypeVector; }
289 bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
290 bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
291 bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
292 bool isCooperativeMatrixType(Id typeId)const
296 bool isAggregateType(Id typeId) const
298 bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
299 bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; }
300 bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; }
301 bool containsType(Id typeId, Op typeOp, unsigned int width) const;
302 bool containsPhysicalStorageBufferOrArray(Id typeId) const;
304 bool isConstantOpCode(Op opcode) const;
305 bool isSpecConstantOpCode(Op opcode) const;
306 bool isConstant(Id resultId) const { return isConstantOpCode(getOpCode(resultId)); }
307 bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; }
308 bool isSpecConstant(Id resultId) const { return isSpecConstantOpCode(getOpCode(resultId)); }
309 unsigned int getConstantScalar(Id resultId) const
311 StorageClass getStorageClass(Id resultId) const { return getTypeStorageClass(getTypeId(resultId)); }
313 bool isVariableOpCode(Op opcode) const { return opcode == OpVariable; }
314 bool isVariable(Id resultId) const { return isVariableOpCode(getOpCode(resultId)); }
315 bool isGlobalStorage(Id resultId) const { return getStorageClass(resultId) != StorageClassFunction; }
316 bool isGlobalVariable(Id resultId) const { return isVariable(resultId) && isGlobalStorage(resultId); }
318 bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); }
320 bool isRayTracingOpCode(Op opcode) const;
322 int getScalarTypeWidth(Id typeId) const
329 int getTypeNumColumns(Id typeId) const
334 int getNumColumns(Id resultId) const { return getTypeNumColumns(getTypeId(resultId)); }
335 int getTypeNumRows(Id typeId) const
340 int getNumRows(Id resultId) const { return getTypeNumRows(getTypeId(resultId)); }
342 Dim getTypeDimensionality(Id typeId) const
347 Id getImageType(Id resultId) const
353 bool isArrayedImageType(Id typeId) const
386 Id makeCompositeConstant(Id type, const std::vector<Id>& comps, bool specConst = false);
389 Instruction* addEntryPoint(ExecutionModel, Function*, const char* name);
391 void addExecutionMode(Function*, ExecutionMode mode, const std::vector<unsigned>& literals);
392 void addExecutionModeId(Function*, ExecutionMode mode, const std::vector<Id>& operandIds);
393 void addName(Id, const char* name);
394 void addMemberName(Id, int member, const char* name);
396 void addDecoration(Id, Decoration, const char*);
397 void addDecoration(Id, Decoration, const std::vector<unsigned>& literals);
398 void addDecoration(Id, Decoration, const std::vector<const char*>& strings);
399 void addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType);
401 void addDecorationId(Id id, Decoration, const std::vector<Id>& operandIds);
403 void addMemberDecoration(Id, unsigned int member, Decoration, const char*);
404 void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector<unsigned>& literals);
405 void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector<const char*>& strings);
414 Block* getBuildPoint() const { return buildPoint; }
418 Function* makeEntryPoint(const char*);
423 Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, LinkageType linkType,
424 const std::vector<Id>& paramTypes,
425 const std::vector<std::vector<Decoration>>& precisions, Block** entry = nullptr);
438 void enterFunction(Function const* function);
445 void makeStatementTerminator(spv::Op opcode, const char *name);
449 void makeStatementTerminator(spv::Op opcode, const std::vector<Id>& operands, const char* name);
452 Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr,
453 Id initializer = NoResult, bool const compilerGenerated = true);
468 Id createAccessChain(StorageClass, Id base, const std::vector<Id>& offsets);
480 Id createCompositeExtract(Id composite, Id typeId, const std::vector<unsigned>& indexes);
482 Id createCompositeInsert(Id object, Id composite, Id typeId, const std::vector<unsigned>& indexes);
489 void createNoResultOp(Op, const std::vector<Id>& operands);
490 void createNoResultOp(Op, const std::vector<IdImmediate>& operands);
496 Id createOp(Op, Id typeId, const std::vector<Id>& operands);
497 Id createOp(Op, Id typeId, const std::vector<IdImmediate>& operands);
498 Id createFunctionCall(spv::Function*, const std::vector<spv::Id>&);
499 Id createSpecConstantOp(Op, Id typeId, const std::vector<spv::Id>& operands, const std::vector<unsigned>& literals);
503 Id createRvalueSwizzle(Decoration precision, Id typeId, Id source, const std::vector<unsigned>& channels);
509 Id createLvalueSwizzle(Id typeId, Id target, Id source, const std::vector<unsigned>& channels);
542 Id createBuiltinCall(Id resultType, Id builtins, int entryPoint, const std::vector<Id>& args);
567 bool noImplicit, const TextureParameters&, ImageOperandsMask);
571 Id createTextureQueryCall(Op, const TextureParameters&, bool isUnsignedResult);
582 Id createCompositeConstruct(Id typeId, const std::vector<Id>& constituents);
585 Id createConstructor(Decoration precision, const std::vector<Id>& sources, Id resultTypeId);
588 Id createMatrixConstructor(Decoration precision, const std::vector<Id>& sources, Id constructee);
600 If(const If&);
625 void makeSwitch(Id condition, unsigned int control, int numSegments, const std::vector<int>& caseValues,
626 const std::vector<int>& valueToSegment, int defaultSegment, std::vector<Block*>& segmentBB);
643 LoopBlocks& operator=(const LoopBlocks&) = delete;
711 bool isVolatile() const { return volatil; }
712 bool isNonUniform() const { return nonUniform; }
713 bool anyCoherent() const {
742 CoherentFlags operator |=(const CoherentFlags &other) {
824 bool isSpvLvalue() const { return accessChain.swizzle.size() <= 1; }
845 void postProcessType(const Instruction&, spv::Id typeId);
847 void dump(std::vector<unsigned int>&) const;
852 const std::vector<unsigned int>& operands);
866 Id findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>& comps);
867 Id findStructConstant(Id typeId, const std::vector<Id>& comps);
872 void createAndSetNoPredecessorBlock(const char*);
874 void dumpSourceInstructions(std::vector<unsigned int>&) const;
875 void dumpSourceInstructions(const spv::Id fileId, const std::string& text, std::vector<unsigned int>&) const;
876 void dumpInstructions(std::vector<unsigned int>&, const std::vector<std::unique_ptr<Instruction> >&) const;
877 void dumpModuleProcesses(std::vector<unsigned int>&) const;
879 const;
891 const char* currentFile;
900 std::vector<const char*> sourceExtensions;
901 std::vector<const char*> moduleProcesses;
947 std::map<spv::Id, const std::string*> includeFiles;