Skip to content

Commit

Permalink
Add FunctionFamily and LLVMDbgOp enums to DXIL::Function
Browse files Browse the repository at this point in the history
Saves having to do repeated string comparisons for function calls to identify if the instruction is a DXOp call or an LLVM Dbg call.
The LLVM Dbg calls are unique and the specific llvm dbg operation is stored in the DXIL::Function
The DXOp calls are not unique and the zero'th argument of the CALL Instruction is used to determine the DXOp opcode.
  • Loading branch information
Zorro666 committed Aug 22, 2024
1 parent c64866b commit 0e2decb
Show file tree
Hide file tree
Showing 2 changed files with 741 additions and 694 deletions.
17 changes: 17 additions & 0 deletions renderdoc/driver/shaders/dxil/dxil_bytecode.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ namespace DXIL
static const rdcstr DXIL_FAKE_OUTPUT_STRUCT_NAME("_OUT");
static const rdcstr DXIL_FAKE_INPUT_STRUCT_NAME("_IN");

enum class FunctionFamily : uint8_t
{
LLVM,
DXOp,
LLVMDbg,
};

enum class LLVMDbgOp : uint8_t
{
Unknown = 0,
Declare,
Value,
};

struct BumpAllocator
{
BumpAllocator(size_t totalSize);
Expand Down Expand Up @@ -1365,6 +1379,9 @@ struct Function : public Value

rdcarray<UselistEntry> uselist;
AttachedMetadata attachedMeta;

FunctionFamily family = FunctionFamily::LLVM;
LLVMDbgOp llvmDbgOp = LLVMDbgOp::Unknown;
};

class LLVMOrderAccumulator
Expand Down
Loading

0 comments on commit 0e2decb

Please sign in to comment.