diff options
| author | 2019-12-09 23:40:32 -0300 | |
|---|---|---|
| committer | 2019-12-09 23:40:41 -0300 | |
| commit | 9ad6327fbda8761da8d11b24999e66418228727c (patch) | |
| tree | c992b78a5e606eb4ac3c5b4d5af7367c841f1386 /src | |
| parent | shader_ir/memory: Implement patch stores (diff) | |
| download | yuzu-9ad6327fbda8761da8d11b24999e66418228727c.tar.gz yuzu-9ad6327fbda8761da8d11b24999e66418228727c.tar.xz yuzu-9ad6327fbda8761da8d11b24999e66418228727c.zip | |
shader: Keep track of shaders using warp instructions
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/decode/warp.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/shader/shader_ir.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/warp.cpp b/src/video_core/shader/decode/warp.cpp index d98d0e1dd..11b77f795 100644 --- a/src/video_core/shader/decode/warp.cpp +++ b/src/video_core/shader/decode/warp.cpp | |||
| @@ -38,6 +38,9 @@ u32 ShaderIR::DecodeWarp(NodeBlock& bb, u32 pc) { | |||
| 38 | const Instruction instr = {program_code[pc]}; | 38 | const Instruction instr = {program_code[pc]}; |
| 39 | const auto opcode = OpCode::Decode(instr); | 39 | const auto opcode = OpCode::Decode(instr); |
| 40 | 40 | ||
| 41 | // Signal the backend that this shader uses warp instructions. | ||
| 42 | uses_warps = true; | ||
| 43 | |||
| 41 | switch (opcode->get().GetId()) { | 44 | switch (opcode->get().GetId()) { |
| 42 | case OpCode::Id::VOTE: { | 45 | case OpCode::Id::VOTE: { |
| 43 | const Node value = GetPredicate(instr.vote.value, instr.vote.negate_value != 0); | 46 | const Node value = GetPredicate(instr.vote.value, instr.vote.negate_value != 0); |
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 2f71a50d2..580f84fcb 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h | |||
| @@ -137,6 +137,10 @@ public: | |||
| 137 | return uses_vertex_id; | 137 | return uses_vertex_id; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | bool UsesWarps() const { | ||
| 141 | return uses_warps; | ||
| 142 | } | ||
| 143 | |||
| 140 | bool HasPhysicalAttributes() const { | 144 | bool HasPhysicalAttributes() const { |
| 141 | return uses_physical_attributes; | 145 | return uses_physical_attributes; |
| 142 | } | 146 | } |
| @@ -415,6 +419,7 @@ private: | |||
| 415 | bool uses_physical_attributes{}; // Shader uses AL2P or physical attribute read/writes | 419 | bool uses_physical_attributes{}; // Shader uses AL2P or physical attribute read/writes |
| 416 | bool uses_instance_id{}; | 420 | bool uses_instance_id{}; |
| 417 | bool uses_vertex_id{}; | 421 | bool uses_vertex_id{}; |
| 422 | bool uses_warps{}; | ||
| 418 | 423 | ||
| 419 | Tegra::Shader::Header header; | 424 | Tegra::Shader::Header header; |
| 420 | }; | 425 | }; |