diff options
| author | 2021-09-03 23:52:20 +0800 | |
|---|---|---|
| committer | 2021-09-03 23:52:20 +0800 | |
| commit | a7bbaa489755c9847416c8c96f0eefb9e78a50a0 (patch) | |
| tree | 341ab621a49becca148157877d6e57e2a31ba770 /src/shader_recompiler/frontend/ir/attribute.cpp | |
| parent | Fix create GraphicsPipelines crash (diff) | |
| download | yuzu-a7bbaa489755c9847416c8c96f0eefb9e78a50a0.tar.gz yuzu-a7bbaa489755c9847416c8c96f0eefb9e78a50a0.tar.xz yuzu-a7bbaa489755c9847416c8c96f0eefb9e78a50a0.zip | |
Rename parameters
Diffstat (limited to 'src/shader_recompiler/frontend/ir/attribute.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/attribute.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/ir/attribute.cpp b/src/shader_recompiler/frontend/ir/attribute.cpp index dc2bec06d..5b3694f65 100644 --- a/src/shader_recompiler/frontend/ir/attribute.cpp +++ b/src/shader_recompiler/frontend/ir/attribute.cpp | |||
| @@ -9,11 +9,21 @@ | |||
| 9 | 9 | ||
| 10 | namespace Shader::IR { | 10 | namespace Shader::IR { |
| 11 | 11 | ||
| 12 | u32 TxtCoordAttributeIndex(Attribute attribute) { | 12 | bool IsFixedFncTexture(Attribute attribute) { |
| 13 | return attribute >= Attribute::FixedFncTexture0S && attribute <= Attribute::FixedFncTexture9Q; | ||
| 14 | } | ||
| 15 | |||
| 16 | u32 FixedFncTextureAttributeIndex(Attribute attribute) { | ||
| 17 | if (!IsFixedFncTexture(attribute)) { | ||
| 18 | throw InvalidArgument("Attribute is not fixedfnctexture {}", attribute); | ||
| 19 | } | ||
| 13 | return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::FixedFncTexture0S)) / 4u; | 20 | return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::FixedFncTexture0S)) / 4u; |
| 14 | } | 21 | } |
| 15 | 22 | ||
| 16 | u32 TxtCoordAttributeElement(Attribute attribute) { | 23 | u32 FixedFncTextureAttributeElement(Attribute attribute) { |
| 24 | if (!IsFixedFncTexture(attribute)) { | ||
| 25 | throw InvalidArgument("Attribute is not fixedfnctexture {}", attribute); | ||
| 26 | } | ||
| 17 | return static_cast<u32>(attribute) % 4; | 27 | return static_cast<u32>(attribute) % 4; |
| 18 | } | 28 | } |
| 19 | 29 | ||