diff options
| author | 2020-04-09 00:17:39 -0400 | |
|---|---|---|
| committer | 2020-04-09 00:17:39 -0400 | |
| commit | b96fd0bd0e562770399441c8164069d2437f00e7 (patch) | |
| tree | 44c8516bec954176e6c68796a660cfa82023b253 /src | |
| parent | Merge pull request #3624 from Kewlan/fix-sl-sr-position (diff) | |
| parent | shader/other: Add error message for some S2R registers (diff) | |
| download | yuzu-b96fd0bd0e562770399441c8164069d2437f00e7.tar.gz yuzu-b96fd0bd0e562770399441c8164069d2437f00e7.tar.xz yuzu-b96fd0bd0e562770399441c8164069d2437f00e7.zip | |
Merge pull request #3601 from ReinUsesLisp/some-shader-encodings
video_core/shader: Add some instruction and S2R encodings
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 8 | ||||
| -rw-r--r-- | src/video_core/shader/decode/other.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/shader/shader_ir.cpp | 3 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 930b605af..498936f0c 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -1712,6 +1712,7 @@ public: | |||
| 1712 | BRK, | 1712 | BRK, |
| 1713 | DEPBAR, | 1713 | DEPBAR, |
| 1714 | VOTE, | 1714 | VOTE, |
| 1715 | VOTE_VTG, | ||
| 1715 | SHFL, | 1716 | SHFL, |
| 1716 | FSWZADD, | 1717 | FSWZADD, |
| 1717 | BFE_C, | 1718 | BFE_C, |
| @@ -1758,6 +1759,7 @@ public: | |||
| 1758 | IPA, | 1759 | IPA, |
| 1759 | OUT_R, // Emit vertex/primitive | 1760 | OUT_R, // Emit vertex/primitive |
| 1760 | ISBERD, | 1761 | ISBERD, |
| 1762 | BAR, | ||
| 1761 | MEMBAR, | 1763 | MEMBAR, |
| 1762 | VMAD, | 1764 | VMAD, |
| 1763 | VSETP, | 1765 | VSETP, |
| @@ -1842,7 +1844,7 @@ public: | |||
| 1842 | MOV_C, | 1844 | MOV_C, |
| 1843 | MOV_R, | 1845 | MOV_R, |
| 1844 | MOV_IMM, | 1846 | MOV_IMM, |
| 1845 | MOV_SYS, | 1847 | S2R, |
| 1846 | MOV32_IMM, | 1848 | MOV32_IMM, |
| 1847 | SHL_C, | 1849 | SHL_C, |
| 1848 | SHL_R, | 1850 | SHL_R, |
| @@ -2026,6 +2028,7 @@ private: | |||
| 2026 | INST("111000110000----", Id::EXIT, Type::Flow, "EXIT"), | 2028 | INST("111000110000----", Id::EXIT, Type::Flow, "EXIT"), |
| 2027 | INST("1111000011110---", Id::DEPBAR, Type::Synch, "DEPBAR"), | 2029 | INST("1111000011110---", Id::DEPBAR, Type::Synch, "DEPBAR"), |
| 2028 | INST("0101000011011---", Id::VOTE, Type::Warp, "VOTE"), | 2030 | INST("0101000011011---", Id::VOTE, Type::Warp, "VOTE"), |
| 2031 | INST("0101000011100---", Id::VOTE_VTG, Type::Warp, "VOTE_VTG"), | ||
| 2029 | INST("1110111100010---", Id::SHFL, Type::Warp, "SHFL"), | 2032 | INST("1110111100010---", Id::SHFL, Type::Warp, "SHFL"), |
| 2030 | INST("0101000011111---", Id::FSWZADD, Type::Warp, "FSWZADD"), | 2033 | INST("0101000011111---", Id::FSWZADD, Type::Warp, "FSWZADD"), |
| 2031 | INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"), | 2034 | INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"), |
| @@ -2063,6 +2066,7 @@ private: | |||
| 2063 | INST("11100000--------", Id::IPA, Type::Trivial, "IPA"), | 2066 | INST("11100000--------", Id::IPA, Type::Trivial, "IPA"), |
| 2064 | INST("1111101111100---", Id::OUT_R, Type::Trivial, "OUT_R"), | 2067 | INST("1111101111100---", Id::OUT_R, Type::Trivial, "OUT_R"), |
| 2065 | INST("1110111111010---", Id::ISBERD, Type::Trivial, "ISBERD"), | 2068 | INST("1110111111010---", Id::ISBERD, Type::Trivial, "ISBERD"), |
| 2069 | INST("1111000010101---", Id::BAR, Type::Trivial, "BAR"), | ||
| 2066 | INST("1110111110011---", Id::MEMBAR, Type::Trivial, "MEMBAR"), | 2070 | INST("1110111110011---", Id::MEMBAR, Type::Trivial, "MEMBAR"), |
| 2067 | INST("01011111--------", Id::VMAD, Type::Video, "VMAD"), | 2071 | INST("01011111--------", Id::VMAD, Type::Video, "VMAD"), |
| 2068 | INST("0101000011110---", Id::VSETP, Type::Video, "VSETP"), | 2072 | INST("0101000011110---", Id::VSETP, Type::Video, "VSETP"), |
| @@ -2134,7 +2138,7 @@ private: | |||
| 2134 | INST("0100110010011---", Id::MOV_C, Type::Arithmetic, "MOV_C"), | 2138 | INST("0100110010011---", Id::MOV_C, Type::Arithmetic, "MOV_C"), |
| 2135 | INST("0101110010011---", Id::MOV_R, Type::Arithmetic, "MOV_R"), | 2139 | INST("0101110010011---", Id::MOV_R, Type::Arithmetic, "MOV_R"), |
| 2136 | INST("0011100-10011---", Id::MOV_IMM, Type::Arithmetic, "MOV_IMM"), | 2140 | INST("0011100-10011---", Id::MOV_IMM, Type::Arithmetic, "MOV_IMM"), |
| 2137 | INST("1111000011001---", Id::MOV_SYS, Type::Trivial, "MOV_SYS"), | 2141 | INST("1111000011001---", Id::S2R, Type::Trivial, "S2R"), |
| 2138 | INST("000000010000----", Id::MOV32_IMM, Type::ArithmeticImmediate, "MOV32_IMM"), | 2142 | INST("000000010000----", Id::MOV32_IMM, Type::ArithmeticImmediate, "MOV32_IMM"), |
| 2139 | INST("0100110001100---", Id::FMNMX_C, Type::Arithmetic, "FMNMX_C"), | 2143 | INST("0100110001100---", Id::FMNMX_C, Type::Arithmetic, "FMNMX_C"), |
| 2140 | INST("0101110001100---", Id::FMNMX_R, Type::Arithmetic, "FMNMX_R"), | 2144 | INST("0101110001100---", Id::FMNMX_R, Type::Arithmetic, "FMNMX_R"), |
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index e6edec459..d4f95b18c 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp | |||
| @@ -71,18 +71,24 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) { | |||
| 71 | bb.push_back(Operation(OperationCode::Discard)); | 71 | bb.push_back(Operation(OperationCode::Discard)); |
| 72 | break; | 72 | break; |
| 73 | } | 73 | } |
| 74 | case OpCode::Id::MOV_SYS: { | 74 | case OpCode::Id::S2R: { |
| 75 | const Node value = [this, instr] { | 75 | const Node value = [this, instr] { |
| 76 | switch (instr.sys20) { | 76 | switch (instr.sys20) { |
| 77 | case SystemVariable::LaneId: | 77 | case SystemVariable::LaneId: |
| 78 | LOG_WARNING(HW_GPU, "MOV_SYS instruction with LaneId is incomplete"); | 78 | LOG_WARNING(HW_GPU, "S2R instruction with LaneId is incomplete"); |
| 79 | return Immediate(0U); | 79 | return Immediate(0U); |
| 80 | case SystemVariable::InvocationId: | 80 | case SystemVariable::InvocationId: |
| 81 | return Operation(OperationCode::InvocationId); | 81 | return Operation(OperationCode::InvocationId); |
| 82 | case SystemVariable::Ydirection: | 82 | case SystemVariable::Ydirection: |
| 83 | return Operation(OperationCode::YNegate); | 83 | return Operation(OperationCode::YNegate); |
| 84 | case SystemVariable::InvocationInfo: | 84 | case SystemVariable::InvocationInfo: |
| 85 | LOG_WARNING(HW_GPU, "MOV_SYS instruction with InvocationInfo is incomplete"); | 85 | LOG_WARNING(HW_GPU, "S2R instruction with InvocationInfo is incomplete"); |
| 86 | return Immediate(0U); | ||
| 87 | case SystemVariable::WscaleFactorXY: | ||
| 88 | UNIMPLEMENTED_MSG("S2R WscaleFactorXY is not implemented"); | ||
| 89 | return Immediate(0U); | ||
| 90 | case SystemVariable::WscaleFactorZ: | ||
| 91 | UNIMPLEMENTED_MSG("S2R WscaleFactorZ is not implemented"); | ||
| 86 | return Immediate(0U); | 92 | return Immediate(0U); |
| 87 | case SystemVariable::Tid: { | 93 | case SystemVariable::Tid: { |
| 88 | Node value = Immediate(0); | 94 | Node value = Immediate(0); |
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index baf7188d2..8852c8a1b 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp | |||
| @@ -359,6 +359,9 @@ Node ShaderIR::GetConditionCode(Tegra::Shader::ConditionCode cc) const { | |||
| 359 | switch (cc) { | 359 | switch (cc) { |
| 360 | case Tegra::Shader::ConditionCode::NEU: | 360 | case Tegra::Shader::ConditionCode::NEU: |
| 361 | return GetInternalFlag(InternalFlag::Zero, true); | 361 | return GetInternalFlag(InternalFlag::Zero, true); |
| 362 | case Tegra::Shader::ConditionCode::FCSM_TR: | ||
| 363 | UNIMPLEMENTED_MSG("EXIT.FCSM_TR is not implemented"); | ||
| 364 | return MakeNode<PredicateNode>(Pred::NeverExecute, false); | ||
| 362 | default: | 365 | default: |
| 363 | UNIMPLEMENTED_MSG("Unimplemented condition code: {}", static_cast<u32>(cc)); | 366 | UNIMPLEMENTED_MSG("Unimplemented condition code: {}", static_cast<u32>(cc)); |
| 364 | return MakeNode<PredicateNode>(Pred::NeverExecute, false); | 367 | return MakeNode<PredicateNode>(Pred::NeverExecute, false); |