diff options
| author | 2021-06-24 02:41:09 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:39 -0400 | |
| commit | 7dafa96ab59892b7f1fbffdb61e4326e6443955f (patch) | |
| tree | 5ab58d56860db635542ea1ec24be258bd86b40b9 /src/shader_recompiler/frontend/ir | |
| parent | vk_graphics_pipeline: Implement conservative rendering (diff) | |
| download | yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.gz yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.xz yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.zip | |
shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.
Implement passthrough geometry shaders using host's.
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/attribute.h | 6 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/program.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/attribute.h b/src/shader_recompiler/frontend/ir/attribute.h index 8bf2ddf30..ca1199494 100644 --- a/src/shader_recompiler/frontend/ir/attribute.h +++ b/src/shader_recompiler/frontend/ir/attribute.h | |||
| @@ -222,6 +222,8 @@ enum class Attribute : u64 { | |||
| 222 | FrontFace = 255, | 222 | FrontFace = 255, |
| 223 | }; | 223 | }; |
| 224 | 224 | ||
| 225 | constexpr size_t NUM_GENERICS = 32; | ||
| 226 | |||
| 225 | [[nodiscard]] bool IsGeneric(Attribute attribute) noexcept; | 227 | [[nodiscard]] bool IsGeneric(Attribute attribute) noexcept; |
| 226 | 228 | ||
| 227 | [[nodiscard]] u32 GenericAttributeIndex(Attribute attribute); | 229 | [[nodiscard]] u32 GenericAttributeIndex(Attribute attribute); |
| @@ -230,6 +232,10 @@ enum class Attribute : u64 { | |||
| 230 | 232 | ||
| 231 | [[nodiscard]] std::string NameOf(Attribute attribute); | 233 | [[nodiscard]] std::string NameOf(Attribute attribute); |
| 232 | 234 | ||
| 235 | [[nodiscard]] constexpr IR::Attribute operator+(IR::Attribute attribute, size_t value) noexcept { | ||
| 236 | return static_cast<IR::Attribute>(static_cast<size_t>(attribute) + value); | ||
| 237 | } | ||
| 238 | |||
| 233 | } // namespace Shader::IR | 239 | } // namespace Shader::IR |
| 234 | 240 | ||
| 235 | template <> | 241 | template <> |
diff --git a/src/shader_recompiler/frontend/ir/program.h b/src/shader_recompiler/frontend/ir/program.h index 9ede5b48d..ebcaa8bc2 100644 --- a/src/shader_recompiler/frontend/ir/program.h +++ b/src/shader_recompiler/frontend/ir/program.h | |||
| @@ -27,6 +27,7 @@ struct Program { | |||
| 27 | u32 invocations{}; | 27 | u32 invocations{}; |
| 28 | u32 local_memory_size{}; | 28 | u32 local_memory_size{}; |
| 29 | u32 shared_memory_size{}; | 29 | u32 shared_memory_size{}; |
| 30 | bool is_geometry_passthrough{}; | ||
| 30 | }; | 31 | }; |
| 31 | 32 | ||
| 32 | [[nodiscard]] std::string DumpProgram(const Program& program); | 33 | [[nodiscard]] std::string DumpProgram(const Program& program); |