From 1b351968fac7fd98a3316e8f54aab41d3ddede12 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Thu, 2 May 2024 11:48:45 +0100 Subject: [PATCH] Added DXIL::AtomicBinOpCode enum and DoStringise --- renderdoc/driver/shaders/dxil/dxil_bytecode.h | 15 +++++++++++++++ .../driver/shaders/dxil/dxil_disassemble.cpp | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/renderdoc/driver/shaders/dxil/dxil_bytecode.h b/renderdoc/driver/shaders/dxil/dxil_bytecode.h index e01cdf56b..15f65776d 100644 --- a/renderdoc/driver/shaders/dxil/dxil_bytecode.h +++ b/renderdoc/driver/shaders/dxil/dxil_bytecode.h @@ -348,6 +348,20 @@ enum class DXOp : uint32_t sampleCmpBias = 255, }; +enum class AtomicBinOpCode : uint32_t +{ + Add, + And, + Or, + Xor, + IMin, + IMax, + UMin, + UMax, + Exchange, + Invalid // Must be last. +}; + inline Operation DecodeBinOp(const Type *type, uint64_t opcode) { bool isFloatOp = (type->scalarType == Type::Float); @@ -1377,3 +1391,4 @@ rdcstr escapeStringIfNeeded(const rdcstr &name); DECLARE_REFLECTION_ENUM(DXIL::Attribute); DECLARE_STRINGISE_TYPE(DXIL::InstructionFlags); +DECLARE_STRINGISE_TYPE(DXIL::AtomicBinOpCode); diff --git a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp index 4241401a7..f847472c1 100644 --- a/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_disassemble.cpp @@ -4565,3 +4565,22 @@ rdcstr DoStringise(const DXIL::Attribute &el) } END_BITFIELD_STRINGISE(); } + +template <> +rdcstr DoStringise(const DXIL::AtomicBinOpCode &el) +{ + BEGIN_ENUM_STRINGISE(DXIL::AtomicBinOpCode) + { + STRINGISE_ENUM_CLASS_NAMED(Add, "Add") + STRINGISE_ENUM_CLASS_NAMED(And, "And") + STRINGISE_ENUM_CLASS_NAMED(Or, "Or") + STRINGISE_ENUM_CLASS_NAMED(Xor, "Xor") + STRINGISE_ENUM_CLASS_NAMED(IMin, "IMin") + STRINGISE_ENUM_CLASS_NAMED(IMax, "IMax") + STRINGISE_ENUM_CLASS_NAMED(UMin, "UMin") + STRINGISE_ENUM_CLASS_NAMED(UMax, "UMax") + STRINGISE_ENUM_CLASS_NAMED(Exchange, "Exchange") + STRINGISE_ENUM_CLASS_NAMED(Invalid, "Invalid") + } + END_ENUM_STRINGISE(); +} \ No newline at end of file