From fc8b2e9e52f1c409c404128420a26dbc0f1a2db2 Mon Sep 17 00:00:00 2001 From: boykopovar Date: Mon, 14 Sep 2026 16:07:04 +0300 Subject: [PATCH] feat(shader): add new fields for rdna img op decoder --- .../RdnaDecoder/RdnaImageOpDecoder.hpp | 2 +- .../include/RdnaDecoder/RdnaInstruction.hpp | 89 +++++++++++-------- 2 files changed, 51 insertions(+), 40 deletions(-) diff --git a/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaImageOpDecoder.hpp b/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaImageOpDecoder.hpp index b2eec24ad..a746beb93 100644 --- a/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaImageOpDecoder.hpp +++ b/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaImageOpDecoder.hpp @@ -7,7 +7,7 @@ namespace ShaderRecompiler { -[[nodiscard]] RdnaInstruction DecodeRdnaImageOp(std::span code, std::uint32_t wordIndex); + [[nodiscard]] RdnaInstruction DecodeRdnaImageOp(std::span code, std::uint32_t wordIndex); } diff --git a/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaInstruction.hpp b/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaInstruction.hpp index 0644aad13..d4e825a75 100644 --- a/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaInstruction.hpp +++ b/core/shader/recompilier/RdnaDecoder/include/RdnaDecoder/RdnaInstruction.hpp @@ -2,51 +2,62 @@ #define SHADER_RECOMPILIER_RDNADECODER_RDNAINSTRUCTION_HPP #include +#include #include namespace ShaderRecompiler { -enum class RdnaOperandKind { - None, - ScalarRegister, - VectorRegister, - VccLo, - VccHi, - ExecLo, - ExecHi, - Scc, - Null, - LiteralConstant, - IntegerInlineConstant, - FloatInlineConstant -}; + enum class RdnaOperandKind { + None, + ScalarRegister, + VectorRegister, + VccLo, + VccHi, + ExecLo, + ExecHi, + Scc, + Null, + LiteralConstant, + IntegerInlineConstant, + FloatInlineConstant + }; -struct RdnaOperand { - RdnaOperandKind kind; - std::uint32_t reg; - std::uint32_t value; - bool negate; - bool absolute; -}; + struct RdnaOperand { + RdnaOperandKind kind; + std::uint32_t reg; + std::uint32_t value; + bool negate; + bool absolute; + }; -struct RdnaInstruction { - RdnaOpcode op; - std::uint32_t programCounter; - RdnaOperand destination; - RdnaOperand source0; - RdnaOperand source1; - RdnaOperand source2; - RdnaOperand source3; - std::int32_t branchOffset; - std::uint32_t memoryOffset; - std::uint32_t dataDwordCount; - bool clampResult; - bool is64Bit; - std::uint32_t exportTarget; - std::uint32_t exportEnableMask; - bool exportIsCompressed; - bool exportIsLast; -}; + struct RdnaInstruction { + RdnaOpcode op; + std::uint32_t programCounter; + RdnaOperand destination; + RdnaOperand source0; + RdnaOperand source1; + RdnaOperand source2; + RdnaOperand source3; + std::int32_t branchOffset; + std::uint32_t memoryOffset; + std::uint32_t dataDwordCount; + bool clampResult; + bool is64Bit; + std::uint32_t exportTarget; + std::uint32_t exportEnableMask; + bool exportIsCompressed; + bool exportIsLast; + std::uint32_t imageOpcodeId; + std::uint32_t imageDmask; + std::uint32_t imageDimension; + bool imageR128; + bool imageGlc; + bool imageSlc; + bool imageA16; + bool imageD16; + std::uint32_t imageNsaDwordCount; + std::array imageNsaVectorRegisters; + }; }