diff options
| author | 2021-04-14 01:04:59 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:27 -0400 | |
| commit | b126987c59964d81ae3705ad7ad6c0ace8714e19 (patch) | |
| tree | d6384469b9450431de5679dcd12fa2ce18e9a8dd /src/shader_recompiler/frontend | |
| parent | shader: Implement early Z tests (diff) | |
| download | yuzu-b126987c59964d81ae3705ad7ad6c0ace8714e19.tar.gz yuzu-b126987c59964d81ae3705ad7ad6c0ace8714e19.tar.xz yuzu-b126987c59964d81ae3705ad7ad6c0ace8714e19.zip | |
shader: Implement transform feedbacks and define file format
Diffstat (limited to 'src/shader_recompiler/frontend')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/attribute.cpp | 7 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/attribute.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/attribute.cpp b/src/shader_recompiler/frontend/ir/attribute.cpp index 7993e5c43..4d0b8b8e5 100644 --- a/src/shader_recompiler/frontend/ir/attribute.cpp +++ b/src/shader_recompiler/frontend/ir/attribute.cpp | |||
| @@ -20,6 +20,13 @@ u32 GenericAttributeIndex(Attribute attribute) { | |||
| 20 | return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::Generic0X)) / 4u; | 20 | return (static_cast<u32>(attribute) - static_cast<u32>(Attribute::Generic0X)) / 4u; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | u32 GenericAttributeElement(Attribute attribute) { | ||
| 24 | if (!IsGeneric(attribute)) { | ||
| 25 | throw InvalidArgument("Attribute is not generic {}", attribute); | ||
| 26 | } | ||
| 27 | return static_cast<u32>(attribute) % 4; | ||
| 28 | } | ||
| 29 | |||
| 23 | std::string NameOf(Attribute attribute) { | 30 | std::string NameOf(Attribute attribute) { |
| 24 | switch (attribute) { | 31 | switch (attribute) { |
| 25 | case Attribute::PrimitiveId: | 32 | case Attribute::PrimitiveId: |
diff --git a/src/shader_recompiler/frontend/ir/attribute.h b/src/shader_recompiler/frontend/ir/attribute.h index 34ec7e0cd..8bf2ddf30 100644 --- a/src/shader_recompiler/frontend/ir/attribute.h +++ b/src/shader_recompiler/frontend/ir/attribute.h | |||
| @@ -226,6 +226,8 @@ enum class Attribute : u64 { | |||
| 226 | 226 | ||
| 227 | [[nodiscard]] u32 GenericAttributeIndex(Attribute attribute); | 227 | [[nodiscard]] u32 GenericAttributeIndex(Attribute attribute); |
| 228 | 228 | ||
| 229 | [[nodiscard]] u32 GenericAttributeElement(Attribute attribute); | ||
| 230 | |||
| 229 | [[nodiscard]] std::string NameOf(Attribute attribute); | 231 | [[nodiscard]] std::string NameOf(Attribute attribute); |
| 230 | 232 | ||
| 231 | } // namespace Shader::IR | 233 | } // namespace Shader::IR |