From 00fd1c29901524c5486d20da734217e73759e35a Mon Sep 17 00:00:00 2001 From: boykopovar Date: Thu, 17 Sep 2026 14:02:22 +0300 Subject: [PATCH] feat(shader): add dst sel packing helper to ir metadata --- .../include/IntermediateRepresentation/IrMetadata.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata.hpp b/core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata.hpp index 67de970e4..296d3893b 100644 --- a/core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata.hpp +++ b/core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata.hpp @@ -148,6 +148,10 @@ enum class IrTextureNumericClass { Unsupported, Float, Uint, Sint }; inline constexpr std::uint32_t ShaderImageIdentitySwizzle = 0x00000facu; +[[nodiscard]] constexpr std::uint32_t DstSel(std::uint32_t x, std::uint32_t y = 0, std::uint32_t z = 0, std::uint32_t w = 0) { + return (x & 0x7u) | ((y & 0x7u) << 3u) | ((z & 0x7u) << 6u) | ((w & 0x7u) << 9u); +} + enum class ResourceKind { None, ScalarBuffer,