From 73b11f390e3dabf42d22af78670c8aa6d8f52cee Mon Sep 17 00:00:00 2001 From: Feng Chen <vonchenplus@gmail.com> Date: Wed, 1 Sep 2021 00:07:25 +0800 Subject: Add colorfront and txtcoord support --- src/shader_recompiler/frontend/ir/attribute.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/shader_recompiler/frontend/ir/attribute.cpp') diff --git a/src/shader_recompiler/frontend/ir/attribute.cpp b/src/shader_recompiler/frontend/ir/attribute.cpp index 4d0b8b8e5c..dc2bec06db 100644 --- a/src/shader_recompiler/frontend/ir/attribute.cpp +++ b/src/shader_recompiler/frontend/ir/attribute.cpp @@ -9,6 +9,14 @@ namespace Shader::IR { +u32 TxtCoordAttributeIndex(Attribute attribute) { + return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::FixedFncTexture0S)) / 4u; +} + +u32 TxtCoordAttributeElement(Attribute attribute) { + return static_cast<u32>(attribute) % 4; +} + bool IsGeneric(Attribute attribute) noexcept { return attribute >= Attribute::Generic0X && attribute <= Attribute::Generic31X; } -- cgit v1.2.3-70-g09d2