RetroArch
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
spv::Builder Class Reference

#include <SpvBuilder.h>

Collaboration diagram for spv::Builder:
[legend]

Classes

struct  AccessChain
 
class  If
 
struct  LoopBlocks
 
struct  TextureParameters
 

Public Member Functions

 Builder (unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger *logger)
 
virtual ~Builder ()
 
unsigned int getSpvVersion () const
 
void setSource (spv::SourceLanguage lang, int version)
 
void setSourceFile (const std::string &file)
 
void setSourceText (const std::string &text)
 
void addSourceExtension (const char *ext)
 
void addModuleProcessed (const std::string &p)
 
void setEmitOpLines ()
 
void addExtension (const char *ext)
 
Id import (const char *)
 
void setMemoryModel (spv::AddressingModel addr, spv::MemoryModel mem)
 
void addCapability (spv::Capability cap)
 
Id getUniqueId ()
 
Id getUniqueIds (int numIds)
 
void setLine (int line)
 
void addLine (Id fileName, int line, int column)
 
Id makeVoidType ()
 
Id makeBoolType ()
 
Id makePointer (StorageClass, Id type)
 
Id makeIntegerType (int width, bool hasSign)
 
Id makeIntType (int width)
 
Id makeUintType (int width)
 
Id makeFloatType (int width)
 
Id makeStructType (const std::vector< Id > &members, const char *)
 
Id makeStructResultType (Id type0, Id type1)
 
Id makeVectorType (Id component, int size)
 
Id makeMatrixType (Id component, int cols, int rows)
 
Id makeArrayType (Id element, Id sizeId, int stride)
 
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 getTypeId (Id resultId) const
 
Id getDerefTypeId (Id resultId) const
 
Op getOpCode (Id id) const
 
Op getTypeClass (Id typeId) const
 
Op getMostBasicTypeClass (Id typeId) const
 
int getNumComponents (Id resultId) const
 
int getNumTypeConstituents (Id typeId) const
 
int getNumTypeComponents (Id typeId) const
 
Id getScalarTypeId (Id typeId) const
 
Id getContainedTypeId (Id typeId) const
 
Id getContainedTypeId (Id typeId, int) const
 
StorageClass getTypeStorageClass (Id typeId) const
 
ImageFormat getImageTypeFormat (Id typeId) const
 
bool isPointer (Id resultId) const
 
bool isScalar (Id resultId) const
 
bool isVector (Id resultId) const
 
bool isMatrix (Id resultId) const
 
bool isAggregate (Id resultId) const
 
bool isSampledImage (Id resultId) const
 
bool isBoolType (Id typeId)
 
bool isIntType (Id typeId) const
 
bool isUintType (Id typeId) const
 
bool isFloatType (Id typeId) const
 
bool isPointerType (Id typeId) const
 
bool isScalarType (Id typeId) const
 
bool isVectorType (Id typeId) const
 
bool isMatrixType (Id typeId) const
 
bool isStructType (Id typeId) const
 
bool isArrayType (Id typeId) const
 
bool isAggregateType (Id typeId) const
 
bool isImageType (Id typeId) const
 
bool isSamplerType (Id typeId) const
 
bool isSampledImageType (Id typeId) const
 
bool isConstantOpCode (Op opcode) const
 
bool isSpecConstantOpCode (Op opcode) const
 
bool isConstant (Id resultId) const
 
bool isConstantScalar (Id resultId) const
 
bool isSpecConstant (Id resultId) const
 
unsigned int getConstantScalar (Id resultId) const
 
StorageClass getStorageClass (Id resultId) const
 
int getScalarTypeWidth (Id typeId) const
 
int getTypeNumColumns (Id typeId) const
 
int getNumColumns (Id resultId) const
 
int getTypeNumRows (Id typeId) const
 
int getNumRows (Id resultId) const
 
Dim getTypeDimensionality (Id typeId) const
 
Id getImageType (Id resultId) const
 
bool isArrayedImageType (Id typeId) const
 
Id makeBoolConstant (bool b, bool specConstant=false)
 
Id makeInt8Constant (int i, bool specConstant=false)
 
Id makeUint8Constant (unsigned u, bool specConstant=false)
 
Id makeInt16Constant (int i, bool specConstant=false)
 
Id makeUint16Constant (unsigned u, bool specConstant=false)
 
Id makeIntConstant (int i, bool specConstant=false)
 
Id makeUintConstant (unsigned u, bool specConstant=false)
 
Id makeInt64Constant (long long i, bool specConstant=false)
 
Id makeUint64Constant (unsigned long long u, bool specConstant=false)
 
Id makeFloatConstant (float f, bool specConstant=false)
 
Id makeDoubleConstant (double d, bool specConstant=false)
 
Id makeFloat16Constant (float f16, bool specConstant=false)
 
Id makeFpConstant (Id type, double d, bool specConstant=false)
 
Id makeCompositeConstant (Id type, const std::vector< Id > &comps, bool specConst=false)
 
InstructionaddEntryPoint (ExecutionModel, Function *, const char *name)
 
void addExecutionMode (Function *, ExecutionMode mode, int value1=-1, int value2=-1, int value3=-1)
 
void addName (Id, const char *name)
 
void addMemberName (Id, int member, const char *name)
 
void addDecoration (Id, Decoration, int num=-1)
 
void addDecoration (Id, Decoration, const char *)
 
void addDecorationId (Id id, Decoration, Id idDecoration)
 
void addMemberDecoration (Id, unsigned int member, Decoration, int num=-1)
 
void addMemberDecoration (Id, unsigned int member, Decoration, const char *)
 
void setBuildPoint (Block *bp)
 
BlockgetBuildPoint () const
 
FunctionmakeEntryPoint (const char *)
 
FunctionmakeFunctionEntry (Decoration precision, Id returnType, const char *name, const std::vector< Id > &paramTypes, const std::vector< std::vector< Decoration >> &precisions, Block **entry=0)
 
void makeReturn (bool implicit, Id retVal=0)
 
void leaveFunction ()
 
void makeDiscard ()
 
Id createVariable (StorageClass, Id type, const char *name=0)
 
Id createUndefined (Id type)
 
void createStore (Id rValue, Id lValue)
 
Id createLoad (Id lValue)
 
Id createAccessChain (StorageClass, Id base, const std::vector< Id > &offsets)
 
Id createArrayLength (Id base, unsigned int member)
 
Id createCompositeExtract (Id composite, Id typeId, unsigned index)
 
Id createCompositeExtract (Id composite, Id typeId, const std::vector< unsigned > &indexes)
 
Id createCompositeInsert (Id object, Id composite, Id typeId, unsigned index)
 
Id createCompositeInsert (Id object, Id composite, Id typeId, const std::vector< unsigned > &indexes)
 
Id createVectorExtractDynamic (Id vector, Id typeId, Id componentIndex)
 
Id createVectorInsertDynamic (Id vector, Id typeId, Id component, Id componentIndex)
 
void createNoResultOp (Op)
 
void createNoResultOp (Op, Id operand)
 
void createNoResultOp (Op, const std::vector< Id > &operands)
 
void createControlBarrier (Scope execution, Scope memory, MemorySemanticsMask)
 
void createMemoryBarrier (unsigned executionScope, unsigned memorySemantics)
 
Id createUnaryOp (Op, Id typeId, Id operand)
 
Id createBinOp (Op, Id typeId, Id operand1, Id operand2)
 
Id createTriOp (Op, Id typeId, Id operand1, Id operand2, Id operand3)
 
Id createOp (Op, Id typeId, const std::vector< Id > &operands)
 
Id createFunctionCall (spv::Function *, const std::vector< spv::Id > &)
 
Id createSpecConstantOp (Op, Id typeId, const std::vector< spv::Id > &operands, const std::vector< unsigned > &literals)
 
Id createRvalueSwizzle (Decoration precision, Id typeId, Id source, const std::vector< unsigned > &channels)
 
Id createLvalueSwizzle (Id typeId, Id target, Id source, const std::vector< unsigned > &channels)
 
Id setPrecision (Id id, Decoration precision)
 
void promoteScalar (Decoration precision, Id &left, Id &right)
 
Id smearScalar (Decoration precision, Id scalarVal, Id vectorType)
 
Id createBuiltinCall (Id resultType, Id builtins, int entryPoint, const std::vector< Id > &args)
 
Id createTextureCall (Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, bool noImplicit, const TextureParameters &)
 
Id createTextureQueryCall (Op, const TextureParameters &, bool isUnsignedResult)
 
Id createSamplePositionCall (Decoration precision, Id, Id)
 
Id createBitFieldExtractCall (Decoration precision, Id, Id, Id, bool isSigned)
 
Id createBitFieldInsertCall (Decoration precision, Id, Id, Id, Id)
 
Id createCompositeCompare (Decoration precision, Id, Id, bool)
 
Id createCompositeConstruct (Id typeId, const std::vector< Id > &constituents)
 
Id createConstructor (Decoration precision, const std::vector< Id > &sources, Id resultTypeId)
 
Id createMatrixConstructor (Decoration precision, const std::vector< Id > &sources, Id constructee)
 
void makeSwitch (Id condition, unsigned int control, int numSegments, const std::vector< int > &caseValues, const std::vector< int > &valueToSegment, int defaultSegment, std::vector< Block *> &segmentBB)
 
void addSwitchBreak ()
 
void nextSwitchSegment (std::vector< Block *> &segmentBB, int segment)
 
void endSwitch (std::vector< Block *> &segmentBB)
 
LoopBlocksmakeNewLoop ()
 
BlockmakeNewBlock ()
 
void createLoopContinue ()
 
void createLoopExit ()
 
void closeLoop ()
 
AccessChain getAccessChain ()
 
void setAccessChain (AccessChain newChain)
 
void clearAccessChain ()
 
void setAccessChainLValue (Id lValue)
 
void setAccessChainRValue (Id rValue)
 
void accessChainPush (Id offset)
 
void accessChainPushSwizzle (std::vector< unsigned > &swizzle, Id preSwizzleBaseType)
 
void accessChainPushComponent (Id component, Id preSwizzleBaseType)
 
void accessChainStore (Id rvalue)
 
Id accessChainLoad (Decoration precision, Decoration nonUniform, Id ResultType)
 
Id accessChainGetLValue ()
 
Id accessChainGetInferredType ()
 
void eliminateDeadDecorations ()
 
void dump (std::vector< unsigned int > &) const
 
void createBranch (Block *block)
 
void createConditionalBranch (Id condition, Block *thenBlock, Block *elseBlock)
 
void createLoopMerge (Block *mergeBlock, Block *continueBlock, unsigned int control, unsigned int dependencyLength)
 
void setToSpecConstCodeGenMode ()
 
void setToNormalCodeGenMode ()
 
bool isInSpecConstCodeGenMode ()
 

Static Public Attributes

static const int maxMatrixSize = 4
 

Protected Member Functions

Id makeIntConstant (Id typeId, unsigned value, bool specConstant)
 
Id makeInt64Constant (Id typeId, unsigned long long value, bool specConstant)
 
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, const std::vector< Id > &comps)
 
Id findStructConstant (Id typeId, const std::vector< Id > &comps)
 
Id collapseAccessChain ()
 
void remapDynamicSwizzle ()
 
void transferAccessChainSwizzle (bool dynamic)
 
void simplifyAccessChainSwizzle ()
 
void createAndSetNoPredecessorBlock (const char *)
 
void createSelectionMerge (Block *mergeBlock, unsigned int control)
 
void dumpSourceInstructions (std::vector< unsigned int > &) const
 
void dumpInstructions (std::vector< unsigned int > &, const std::vector< std::unique_ptr< Instruction > > &) const
 
void dumpModuleProcesses (std::vector< unsigned int > &) const
 

Protected Attributes

unsigned int spvVersion
 
SourceLanguage source
 
int sourceVersion
 
spv::Id sourceFileStringId
 
std::string sourceText
 
int currentLine
 
bool emitOpLines
 
std::set< std::stringextensions
 
std::vector< const char * > sourceExtensions
 
std::vector< const char * > moduleProcesses
 
AddressingModel addressModel
 
MemoryModel memoryModel
 
std::set< spv::Capabilitycapabilities
 
int builderNumber
 
Module module
 
BlockbuildPoint
 
Id uniqueId
 
FunctionentryPointFunction
 
bool generatingOpCodeForSpecConst
 
AccessChain accessChain
 
std::vector< std::unique_ptr< Instruction > > strings
 
std::vector< std::unique_ptr< Instruction > > imports
 
std::vector< std::unique_ptr< Instruction > > entryPoints
 
std::vector< std::unique_ptr< Instruction > > executionModes
 
std::vector< std::unique_ptr< Instruction > > names
 
std::vector< std::unique_ptr< Instruction > > decorations
 
std::vector< std::unique_ptr< Instruction > > constantsTypesGlobals
 
std::vector< std::unique_ptr< Instruction > > externals
 
std::vector< std::unique_ptr< Function > > functions
 
std::unordered_map< unsigned int, std::vector< Instruction * > > groupedConstants
 
std::unordered_map< unsigned int, std::vector< Instruction * > > groupedStructConstants
 
std::unordered_map< unsigned int, std::vector< Instruction * > > groupedTypes
 
std::stack< Block * > switchMerges
 
std::stack< LoopBlocksloops
 
SpvBuildLoggerlogger
 

Constructor & Destructor Documentation

◆ Builder()

spv::Builder::Builder ( unsigned int  spvVersion,
unsigned int  userNumber,
SpvBuildLogger logger 
)
Here is the call graph for this function:

◆ ~Builder()

spv::Builder::~Builder ( )
virtual

Member Function Documentation

◆ accessChainGetInferredType()

Id spv::Builder::accessChainGetInferredType ( )
Here is the call graph for this function:

◆ accessChainGetLValue()

Id spv::Builder::accessChainGetLValue ( )
Here is the call graph for this function:

◆ accessChainLoad()

Id spv::Builder::accessChainLoad ( Decoration  precision,
Decoration  nonUniform,
Id  ResultType 
)
Here is the call graph for this function:

◆ accessChainPush()

void spv::Builder::accessChainPush ( Id  offset)
inline

◆ accessChainPushComponent()

void spv::Builder::accessChainPushComponent ( Id  component,
Id  preSwizzleBaseType 
)
inline

◆ accessChainPushSwizzle()

void spv::Builder::accessChainPushSwizzle ( std::vector< unsigned > &  swizzle,
Id  preSwizzleBaseType 
)
Here is the call graph for this function:

◆ accessChainStore()

void spv::Builder::accessChainStore ( Id  rvalue)
Here is the call graph for this function:

◆ addCapability()

void spv::Builder::addCapability ( spv::Capability  cap)
inline
Here is the caller graph for this function:

◆ addDecoration() [1/2]

void spv::Builder::addDecoration ( Id  id,
Decoration  decoration,
int  num = -1 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addDecoration() [2/2]

void spv::Builder::addDecoration ( Id  id,
Decoration  decoration,
const char *  s 
)
Here is the call graph for this function:

◆ addDecorationId()

void spv::Builder::addDecorationId ( Id  id,
Decoration  decoration,
Id  idDecoration 
)
Here is the call graph for this function:

◆ addEntryPoint()

Instruction * spv::Builder::addEntryPoint ( ExecutionModel  model,
Function function,
const char *  name 
)

◆ addExecutionMode()

void spv::Builder::addExecutionMode ( Function entryPoint,
ExecutionMode  mode,
int  value1 = -1,
int  value2 = -1,
int  value3 = -1 
)
Here is the call graph for this function:

◆ addExtension()

void spv::Builder::addExtension ( const char *  ext)
inline

◆ addLine()

void spv::Builder::addLine ( Id  fileName,
int  line,
int  column 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addMemberDecoration() [1/2]

void spv::Builder::addMemberDecoration ( Id  id,
unsigned int  member,
Decoration  decoration,
int  num = -1 
)
Here is the call graph for this function:

◆ addMemberDecoration() [2/2]

void spv::Builder::addMemberDecoration ( Id  id,
unsigned int  member,
Decoration  decoration,
const char *  s 
)
Here is the call graph for this function:

◆ addMemberName()

void spv::Builder::addMemberName ( Id  id,
int  member,
const char *  name 
)

◆ addModuleProcessed()

void spv::Builder::addModuleProcessed ( const std::string p)
inline

◆ addName()

void spv::Builder::addName ( Id  id,
const char *  name 
)
Here is the caller graph for this function:

◆ addSourceExtension()

void spv::Builder::addSourceExtension ( const char *  ext)
inline

◆ addSwitchBreak()

void spv::Builder::addSwitchBreak ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearAccessChain()

void spv::Builder::clearAccessChain ( )
Here is the caller graph for this function:

◆ closeLoop()

void spv::Builder::closeLoop ( )

◆ collapseAccessChain()

Id spv::Builder::collapseAccessChain ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAccessChain()

Id spv::Builder::createAccessChain ( StorageClass  storageClass,
Id  base,
const std::vector< Id > &  offsets 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAndSetNoPredecessorBlock()

void spv::Builder::createAndSetNoPredecessorBlock ( const char *  )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createArrayLength()

Id spv::Builder::createArrayLength ( Id  base,
unsigned int  member 
)
Here is the call graph for this function:

◆ createBinOp()

Id spv::Builder::createBinOp ( Op  opCode,
Id  typeId,
Id  operand1,
Id  operand2 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBitFieldExtractCall()

Id spv::Builder::createBitFieldExtractCall ( Decoration  precision,
Id  ,
Id  ,
Id  ,
bool  isSigned 
)

◆ createBitFieldInsertCall()

Id spv::Builder::createBitFieldInsertCall ( Decoration  precision,
Id  ,
Id  ,
Id  ,
Id   
)

◆ createBranch()

void spv::Builder::createBranch ( Block block)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBuiltinCall()

Id spv::Builder::createBuiltinCall ( Id  resultType,
Id  builtins,
int  entryPoint,
const std::vector< Id > &  args 
)
Here is the call graph for this function:

◆ createCompositeCompare()

Id spv::Builder::createCompositeCompare ( Decoration  precision,
Id  value1,
Id  value2,
bool  equal 
)
Here is the call graph for this function:

◆ createCompositeConstruct()

Id spv::Builder::createCompositeConstruct ( Id  typeId,
const std::vector< Id > &  constituents 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCompositeExtract() [1/2]

Id spv::Builder::createCompositeExtract ( Id  composite,
Id  typeId,
unsigned  index 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCompositeExtract() [2/2]

Id spv::Builder::createCompositeExtract ( Id  composite,
Id  typeId,
const std::vector< unsigned > &  indexes 
)
Here is the call graph for this function:

◆ createCompositeInsert() [1/2]

Id spv::Builder::createCompositeInsert ( Id  object,
Id  composite,
Id  typeId,
unsigned  index 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCompositeInsert() [2/2]

Id spv::Builder::createCompositeInsert ( Id  object,
Id  composite,
Id  typeId,
const std::vector< unsigned > &  indexes 
)
Here is the call graph for this function:

◆ createConditionalBranch()

void spv::Builder::createConditionalBranch ( Id  condition,
Block thenBlock,
Block elseBlock 
)
Here is the call graph for this function:

◆ createConstructor()

Id spv::Builder::createConstructor ( Decoration  precision,
const std::vector< Id > &  sources,
Id  resultTypeId 
)
Here is the call graph for this function:

◆ createControlBarrier()

void spv::Builder::createControlBarrier ( Scope  execution,
Scope  memory,
MemorySemanticsMask  semantics 
)
Here is the call graph for this function:

◆ createFunctionCall()

Id spv::Builder::createFunctionCall ( spv::Function function,
const std::vector< spv::Id > &  args 
)
Here is the call graph for this function:

◆ createLoad()

Id spv::Builder::createLoad ( Id  lValue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createLoopContinue()

void spv::Builder::createLoopContinue ( )
Here is the call graph for this function:

◆ createLoopExit()

void spv::Builder::createLoopExit ( )
Here is the call graph for this function:

◆ createLoopMerge()

void spv::Builder::createLoopMerge ( Block mergeBlock,
Block continueBlock,
unsigned int  control,
unsigned int  dependencyLength 
)
Here is the call graph for this function:

◆ createLvalueSwizzle()

Id spv::Builder::createLvalueSwizzle ( Id  typeId,
Id  target,
Id  source,
const std::vector< unsigned > &  channels 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMatrixConstructor()

Id spv::Builder::createMatrixConstructor ( Decoration  precision,
const std::vector< Id > &  sources,
Id  constructee 
)
Here is the call graph for this function:

◆ createMemoryBarrier()

void spv::Builder::createMemoryBarrier ( unsigned  executionScope,
unsigned  memorySemantics 
)
Here is the call graph for this function:

◆ createNoResultOp() [1/3]

void spv::Builder::createNoResultOp ( Op  opCode)
Here is the call graph for this function:

◆ createNoResultOp() [2/3]

void spv::Builder::createNoResultOp ( Op  opCode,
Id  operand 
)
Here is the call graph for this function:

◆ createNoResultOp() [3/3]

void spv::Builder::createNoResultOp ( Op  opCode,
const std::vector< Id > &  operands 
)
Here is the call graph for this function:

◆ createOp()

Id spv::Builder::createOp ( Op  opCode,
Id  typeId,
const std::vector< Id > &  operands 
)
Here is the call graph for this function:

◆ createRvalueSwizzle()

Id spv::Builder::createRvalueSwizzle ( Decoration  precision,
Id  typeId,
Id  source,
const std::vector< unsigned > &  channels 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSamplePositionCall()

Id spv::Builder::createSamplePositionCall ( Decoration  precision,
Id  ,
Id   
)

◆ createSelectionMerge()

void spv::Builder::createSelectionMerge ( Block mergeBlock,
unsigned int  control 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSpecConstantOp()

Id spv::Builder::createSpecConstantOp ( Op  opCode,
Id  typeId,
const std::vector< spv::Id > &  operands,
const std::vector< unsigned > &  literals 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createStore()

void spv::Builder::createStore ( Id  rValue,
Id  lValue 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTextureCall()

Id spv::Builder::createTextureCall ( Decoration  precision,
Id  resultType,
bool  sparse,
bool  fetch,
bool  proj,
bool  gather,
bool  noImplicit,
const TextureParameters parameters 
)
Here is the call graph for this function:

◆ createTextureQueryCall()

Id spv::Builder::createTextureQueryCall ( Op  opCode,
const TextureParameters parameters,
bool  isUnsignedResult 
)
Here is the call graph for this function:

◆ createTriOp()

Id spv::Builder::createTriOp ( Op  opCode,
Id  typeId,
Id  operand1,
Id  operand2,
Id  operand3 
)
Here is the call graph for this function:

◆ createUnaryOp()

Id spv::Builder::createUnaryOp ( Op  opCode,
Id  typeId,
Id  operand 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createUndefined()

Id spv::Builder::createUndefined ( Id  type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createVariable()

Id spv::Builder::createVariable ( StorageClass  storageClass,
Id  type,
const char *  name = 0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createVectorExtractDynamic()

Id spv::Builder::createVectorExtractDynamic ( Id  vector,
Id  typeId,
Id  componentIndex 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createVectorInsertDynamic()

Id spv::Builder::createVectorInsertDynamic ( Id  vector,
Id  typeId,
Id  component,
Id  componentIndex 
)
Here is the call graph for this function:

◆ dump()

void spv::Builder::dump ( std::vector< unsigned int > &  out) const
Here is the call graph for this function:

◆ dumpInstructions()

void spv::Builder::dumpInstructions ( std::vector< unsigned int > &  out,
const std::vector< std::unique_ptr< Instruction > > &  instructions 
) const
protected
Here is the caller graph for this function:

◆ dumpModuleProcesses()

void spv::Builder::dumpModuleProcesses ( std::vector< unsigned int > &  out) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dumpSourceInstructions()

void spv::Builder::dumpSourceInstructions ( std::vector< unsigned int > &  out) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eliminateDeadDecorations()

void spv::Builder::eliminateDeadDecorations ( )
Here is the call graph for this function:

◆ endSwitch()

void spv::Builder::endSwitch ( std::vector< Block *> &  segmentBB)
Here is the call graph for this function:

◆ findCompositeConstant()

Id spv::Builder::findCompositeConstant ( Op  typeClass,
const std::vector< Id > &  comps 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findScalarConstant() [1/2]

Id spv::Builder::findScalarConstant ( Op  typeClass,
Op  opcode,
Id  typeId,
unsigned  value 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findScalarConstant() [2/2]

Id spv::Builder::findScalarConstant ( Op  typeClass,
Op  opcode,
Id  typeId,
unsigned  v1,
unsigned  v2 
)
protected
Here is the call graph for this function:

◆ findStructConstant()

Id spv::Builder::findStructConstant ( Id  typeId,
const std::vector< Id > &  comps 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAccessChain()

AccessChain spv::Builder::getAccessChain ( )
inline

◆ getBuildPoint()

Block* spv::Builder::getBuildPoint ( ) const
inline
Here is the caller graph for this function:

◆ getConstantScalar()

unsigned int spv::Builder::getConstantScalar ( Id  resultId) const
inline
Here is the caller graph for this function:

◆ getContainedTypeId() [1/2]

Id spv::Builder::getContainedTypeId ( Id  typeId) const
Here is the caller graph for this function:

◆ getContainedTypeId() [2/2]

Id spv::Builder::getContainedTypeId ( Id  typeId,
int  member 
) const
Here is the call graph for this function:

◆ getDerefTypeId()

Id spv::Builder::getDerefTypeId ( Id  resultId) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getImageType()

Id spv::Builder::getImageType ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getImageTypeFormat()

ImageFormat spv::Builder::getImageTypeFormat ( Id  typeId) const
inline

◆ getMostBasicTypeClass()

Op spv::Builder::getMostBasicTypeClass ( Id  typeId) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumColumns()

int spv::Builder::getNumColumns ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumComponents()

int spv::Builder::getNumComponents ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumRows()

int spv::Builder::getNumRows ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumTypeComponents()

int spv::Builder::getNumTypeComponents ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumTypeConstituents()

int spv::Builder::getNumTypeConstituents ( Id  typeId) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOpCode()

Op spv::Builder::getOpCode ( Id  id) const
inline
Here is the caller graph for this function:

◆ getScalarTypeId()

Id spv::Builder::getScalarTypeId ( Id  typeId) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getScalarTypeWidth()

int spv::Builder::getScalarTypeWidth ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSpvVersion()

unsigned int spv::Builder::getSpvVersion ( ) const
inline

◆ getStorageClass()

StorageClass spv::Builder::getStorageClass ( Id  resultId) const
inline
Here is the call graph for this function:

◆ getTypeClass()

Op spv::Builder::getTypeClass ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypeDimensionality()

Dim spv::Builder::getTypeDimensionality ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypeId()

Id spv::Builder::getTypeId ( Id  resultId) const
inline
Here is the caller graph for this function:

◆ getTypeNumColumns()

int spv::Builder::getTypeNumColumns ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypeNumRows()

int spv::Builder::getTypeNumRows ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypeStorageClass()

StorageClass spv::Builder::getTypeStorageClass ( Id  typeId) const
inline
Here is the caller graph for this function:

◆ getUniqueId()

Id spv::Builder::getUniqueId ( )
inline

◆ getUniqueIds()

Id spv::Builder::getUniqueIds ( int  numIds)
inline
Here is the caller graph for this function:

◆ import()

Id spv::Builder::import ( const char *  name)
Here is the call graph for this function:

◆ isAggregate()

bool spv::Builder::isAggregate ( Id  resultId) const
inline
Here is the call graph for this function:

◆ isAggregateType()

bool spv::Builder::isAggregateType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isArrayedImageType()

bool spv::Builder::isArrayedImageType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isArrayType()

bool spv::Builder::isArrayType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBoolType()

bool spv::Builder::isBoolType ( Id  typeId)
inline

◆ isConstant()

bool spv::Builder::isConstant ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isConstantOpCode()

bool spv::Builder::isConstantOpCode ( Op  opcode) const
Here is the caller graph for this function:

◆ isConstantScalar()

bool spv::Builder::isConstantScalar ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isFloatType()

bool spv::Builder::isFloatType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isImageType()

bool spv::Builder::isImageType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInSpecConstCodeGenMode()

bool spv::Builder::isInSpecConstCodeGenMode ( )
inline

◆ isIntType()

bool spv::Builder::isIntType ( Id  typeId) const
inline
Here is the call graph for this function:

◆ isMatrix()

bool spv::Builder::isMatrix ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMatrixType()

bool spv::Builder::isMatrixType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPointer()

bool spv::Builder::isPointer ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPointerType()

bool spv::Builder::isPointerType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSampledImage()

bool spv::Builder::isSampledImage ( Id  resultId) const
inline
Here is the call graph for this function:

◆ isSampledImageType()

bool spv::Builder::isSampledImageType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSamplerType()

bool spv::Builder::isSamplerType ( Id  typeId) const
inline
Here is the call graph for this function:

◆ isScalar()

bool spv::Builder::isScalar ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isScalarType()

bool spv::Builder::isScalarType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSpecConstant()

bool spv::Builder::isSpecConstant ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSpecConstantOpCode()

bool spv::Builder::isSpecConstantOpCode ( Op  opcode) const
Here is the caller graph for this function:

◆ isStructType()

bool spv::Builder::isStructType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isUintType()

bool spv::Builder::isUintType ( Id  typeId) const
inline
Here is the call graph for this function:

◆ isVector()

bool spv::Builder::isVector ( Id  resultId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isVectorType()

bool spv::Builder::isVectorType ( Id  typeId) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leaveFunction()

void spv::Builder::leaveFunction ( )
Here is the call graph for this function:

◆ makeArrayType()

Id spv::Builder::makeArrayType ( Id  element,
Id  sizeId,
int  stride 
)
Here is the call graph for this function:

◆ makeBoolConstant()

Id spv::Builder::makeBoolConstant ( bool  b,
bool  specConstant = false 
)
Here is the call graph for this function:

◆ makeBoolType()

Id spv::Builder::makeBoolType ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeCompositeConstant()

Id spv::Builder::makeCompositeConstant ( Id  type,
const std::vector< Id > &  comps,
bool  specConst = false 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeDiscard()

void spv::Builder::makeDiscard ( )
Here is the call graph for this function:

◆ makeDoubleConstant()

Id spv::Builder::makeDoubleConstant ( double  d,
bool  specConstant = false 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeEntryPoint()

Function * spv::Builder::makeEntryPoint ( const char *  entryPoint)
Here is the call graph for this function:

◆ makeFloat16Constant()

Id spv::Builder::makeFloat16Constant ( float  f16,
bool  specConstant = false 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeFloatConstant()

Id spv::Builder::makeFloatConstant ( float  f,
bool  specConstant = false 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeFloatType()

Id spv::Builder::makeFloatType ( int  width)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeFpConstant()

Id spv::Builder::makeFpConstant ( Id  type,
double  d,
bool  specConstant = false 
)
Here is the call graph for this function:

◆ makeFunctionEntry()

Function * spv::Builder::makeFunctionEntry ( Decoration  precision,
Id  returnType,
const char *  name,
const std::vector< Id > &  paramTypes,
const std::vector< std::vector< Decoration >> &  precisions,
Block **  entry = 0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeFunctionType()

Id spv::Builder::makeFunctionType ( Id  returnType,
const std::vector< Id > &  paramTypes 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeImageType()

Id spv::Builder::makeImageType ( Id  sampledType,
Dim  dim,
bool  depth,
bool  arrayed,
bool  ms,
unsigned  sampled,
ImageFormat  format 
)
Here is the call graph for this function:

◆ makeInt16Constant()

Id spv::Builder::makeInt16Constant ( int  i,
bool  specConstant = false 
)
inline
Here is the call graph for this function:

◆ makeInt64Constant() [1/2]

Id spv::Builder::makeInt64Constant ( long long  i,
bool  specConstant = false 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeInt64Constant() [2/2]

Id spv::Builder::makeInt64Constant ( Id  typeId,
unsigned long long  value,
bool  specConstant 
)
protected
Here is the call graph for this function:

◆ makeInt8Constant()

Id spv::Builder::makeInt8Constant ( int  i,
bool  specConstant = false 
)
inline
Here is the call graph for this function:

◆ makeIntConstant() [1/2]

Id spv::Builder::makeIntConstant ( int  i,
bool  specConstant = false 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeIntConstant() [2/2]

Id spv::Builder::makeIntConstant ( Id  typeId,
unsigned  value,
bool  specConstant 
)
protected
Here is the call graph for this function:

◆ makeIntegerType()

Id spv::Builder::makeIntegerType ( int  width,
bool  hasSign 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeIntType()

Id spv::Builder::makeIntType ( int  width)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeMatrixType()

Id spv::Builder::makeMatrixType ( Id  component,
int  cols,
int  rows 
)
Here is the call graph for this function:

◆ makeNewBlock()

Block & spv::Builder::makeNewBlock ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeNewLoop()

Builder::LoopBlocks & spv::Builder::makeNewLoop ( )
Here is the call graph for this function:

◆ makePointer()

Id spv::Builder::makePointer ( StorageClass  storageClass,
Id  type 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeReturn()

void spv::Builder::makeReturn ( bool  implicit,
Id  retVal = 0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeRuntimeArray()

Id spv::Builder::makeRuntimeArray ( Id  element)
Here is the call graph for this function:

◆ makeSampledImageType()

Id spv::Builder::makeSampledImageType ( Id  imageType)
Here is the call graph for this function:

◆ makeSamplerType()

Id spv::Builder::makeSamplerType ( )
Here is the call graph for this function:

◆ makeStructResultType()

Id spv::Builder::makeStructResultType ( Id  type0,
Id  type1 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeStructType()

Id spv::Builder::makeStructType ( const std::vector< Id > &  members,
const char *  name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeSwitch()

void spv::Builder::makeSwitch ( Id  condition,
unsigned int  control,
int  numSegments,
const std::vector< int > &  caseValues,
const std::vector< int > &  valueToSegment,
int  defaultSegment,
std::vector< Block *> &  segmentBB 
)
Here is the call graph for this function:

◆ makeUint16Constant()

Id spv::Builder::makeUint16Constant ( unsigned  u,
bool  specConstant = false 
)
inline
Here is the call graph for this function:

◆ makeUint64Constant()

Id spv::Builder::makeUint64Constant ( unsigned long long  u,
bool  specConstant = false 
)
inline
Here is the call graph for this function:

◆ makeUint8Constant()

Id spv::Builder::makeUint8Constant ( unsigned  u,
bool  specConstant = false 
)
inline
Here is the call graph for this function:

◆ makeUintConstant()

Id spv::Builder::makeUintConstant ( unsigned  u,
bool  specConstant = false 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeUintType()

Id spv::Builder::makeUintType ( int  width)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeVectorType()

Id spv::Builder::makeVectorType ( Id  component,
int  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeVoidType()

Id spv::Builder::makeVoidType ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nextSwitchSegment()

void spv::Builder::nextSwitchSegment ( std::vector< Block *> &  segmentBB,
int  segment 
)
Here is the call graph for this function:

◆ promoteScalar()

void spv::Builder::promoteScalar ( Decoration  precision,
Id left,
Id right 
)
Here is the call graph for this function:

◆ remapDynamicSwizzle()

void spv::Builder::remapDynamicSwizzle ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAccessChain()

void spv::Builder::setAccessChain ( AccessChain  newChain)
inline

◆ setAccessChainLValue()

void spv::Builder::setAccessChainLValue ( Id  lValue)
inline
Here is the call graph for this function:

◆ setAccessChainRValue()

void spv::Builder::setAccessChainRValue ( Id  rValue)
inline

◆ setBuildPoint()

void spv::Builder::setBuildPoint ( Block bp)
inline
Here is the caller graph for this function:

◆ setEmitOpLines()

void spv::Builder::setEmitOpLines ( )
inline

◆ setLine()

void spv::Builder::setLine ( int  line)
Here is the call graph for this function:

◆ setMemoryModel()

void spv::Builder::setMemoryModel ( spv::AddressingModel  addr,
spv::MemoryModel  mem 
)
inline

◆ setPrecision()

Id spv::Builder::setPrecision ( Id  id,
Decoration  precision 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSource()

void spv::Builder::setSource ( spv::SourceLanguage  lang,
int  version 
)
inline

◆ setSourceFile()

void spv::Builder::setSourceFile ( const std::string file)
inline
Here is the call graph for this function:

◆ setSourceText()

void spv::Builder::setSourceText ( const std::string text)
inline

◆ setToNormalCodeGenMode()

void spv::Builder::setToNormalCodeGenMode ( )
inline

◆ setToSpecConstCodeGenMode()

void spv::Builder::setToSpecConstCodeGenMode ( )
inline

◆ simplifyAccessChainSwizzle()

void spv::Builder::simplifyAccessChainSwizzle ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smearScalar()

Id spv::Builder::smearScalar ( Decoration  precision,
Id  scalarVal,
Id  vectorType 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transferAccessChainSwizzle()

void spv::Builder::transferAccessChainSwizzle ( bool  dynamic)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ accessChain

AccessChain spv::Builder::accessChain
protected

◆ addressModel

AddressingModel spv::Builder::addressModel
protected

◆ builderNumber

int spv::Builder::builderNumber
protected

◆ buildPoint

Block* spv::Builder::buildPoint
protected

◆ capabilities

std::set<spv::Capability> spv::Builder::capabilities
protected

◆ constantsTypesGlobals

std::vector<std::unique_ptr<Instruction> > spv::Builder::constantsTypesGlobals
protected

◆ currentLine

int spv::Builder::currentLine
protected

◆ decorations

std::vector<std::unique_ptr<Instruction> > spv::Builder::decorations
protected

◆ emitOpLines

bool spv::Builder::emitOpLines
protected

◆ entryPointFunction

Function* spv::Builder::entryPointFunction
protected

◆ entryPoints

std::vector<std::unique_ptr<Instruction> > spv::Builder::entryPoints
protected

◆ executionModes

std::vector<std::unique_ptr<Instruction> > spv::Builder::executionModes
protected

◆ extensions

std::set<std::string> spv::Builder::extensions
protected

◆ externals

std::vector<std::unique_ptr<Instruction> > spv::Builder::externals
protected

◆ functions

std::vector<std::unique_ptr<Function> > spv::Builder::functions
protected

◆ generatingOpCodeForSpecConst

bool spv::Builder::generatingOpCodeForSpecConst
protected

◆ groupedConstants

std::unordered_map<unsigned int, std::vector<Instruction*> > spv::Builder::groupedConstants
protected

◆ groupedStructConstants

std::unordered_map<unsigned int, std::vector<Instruction*> > spv::Builder::groupedStructConstants
protected

◆ groupedTypes

std::unordered_map<unsigned int, std::vector<Instruction*> > spv::Builder::groupedTypes
protected

◆ imports

std::vector<std::unique_ptr<Instruction> > spv::Builder::imports
protected

◆ logger

SpvBuildLogger* spv::Builder::logger
protected

◆ loops

std::stack<LoopBlocks> spv::Builder::loops
protected

◆ maxMatrixSize

const int spv::Builder::maxMatrixSize = 4
static

◆ memoryModel

MemoryModel spv::Builder::memoryModel
protected

◆ module

Module spv::Builder::module
protected

◆ moduleProcesses

std::vector<const char*> spv::Builder::moduleProcesses
protected

◆ names

std::vector<std::unique_ptr<Instruction> > spv::Builder::names
protected

◆ source

SourceLanguage spv::Builder::source
protected

◆ sourceExtensions

std::vector<const char*> spv::Builder::sourceExtensions
protected

◆ sourceFileStringId

spv::Id spv::Builder::sourceFileStringId
protected

◆ sourceText

std::string spv::Builder::sourceText
protected

◆ sourceVersion

int spv::Builder::sourceVersion
protected

◆ spvVersion

unsigned int spv::Builder::spvVersion
protected

◆ strings

std::vector<std::unique_ptr<Instruction> > spv::Builder::strings
protected

◆ switchMerges

std::stack<Block*> spv::Builder::switchMerges
protected

◆ uniqueId

Id spv::Builder::uniqueId
protected

The documentation for this class was generated from the following files: