aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/attribute.cpp
diff options
context:
space:
mode:
authorFeng Chen <vonchenplus@gmail.com>2021-09-01 00:07:25 +0800
committerFeng Chen <vonchenplus@gmail.com>2021-09-01 00:07:25 +0800
commit73b11f390e3dabf42d22af78670c8aa6d8f52cee (patch)
tree3af775771173d1e827d2e1a05ada642a43fba9a9 /src/shader_recompiler/frontend/ir/attribute.cpp
parent5f19b6618930d33857fa2a4785ad7404b9e8c41c (diff)
Add colorfront and txtcoord support
Diffstat (limited to 'src/shader_recompiler/frontend/ir/attribute.cpp')
-rw-r--r--src/shader_recompiler/frontend/ir/attribute.cpp8
1 files changed, 8 insertions, 0 deletions
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;
}