summaryrefslogtreecommitdiff
path: root/src/video_core/macro
diff options
context:
space:
mode:
authorGravatar Liam2022-11-16 22:28:58 -0500
committerGravatar Liam2022-11-16 22:28:58 -0500
commitece0c1095d29d940796568d7ce20fd5f414c4066 (patch)
tree0eba8fd9793dcba48184b61e38b1ece4feb4fe45 /src/video_core/macro
parentMerge pull request #9250 from v1993/patch-10 (diff)
downloadyuzu-ece0c1095d29d940796568d7ce20fd5f414c4066.tar.gz
yuzu-ece0c1095d29d940796568d7ce20fd5f414c4066.tar.xz
yuzu-ece0c1095d29d940796568d7ce20fd5f414c4066.zip
maxwell3d: HLE multi-layer clear macro
Diffstat (limited to 'src/video_core/macro')
-rw-r--r--src/video_core/macro/macro_hle.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/video_core/macro/macro_hle.cpp b/src/video_core/macro/macro_hle.cpp
index f896591bf..6d35387d9 100644
--- a/src/video_core/macro/macro_hle.cpp
+++ b/src/video_core/macro/macro_hle.cpp
@@ -126,11 +126,31 @@ void HLE_3F5E74B9C9A50164(Engines::Maxwell3D& maxwell3d, const std::vector<u32>&
126 } 126 }
127} 127}
128 128
129constexpr std::array<std::pair<u64, HLEFunction>, 4> hle_funcs{{ 129// Multi-layer Clear
130void HLE_EAD26C3E2109B06B(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& parameters) {
131 ASSERT(parameters.size() == 1);
132
133 Engines::Maxwell3D::Regs::ClearSurface clear_params{parameters[0]};
134
135 const u32 rt_index = clear_params.RT;
136 const u32 num_layers = maxwell3d.regs.rt[rt_index].depth_volume;
137
138 for (u32 i = 0; i < num_layers; i++) {
139 // 0x674 = regs.clear_surface
140 maxwell3d.CallMethod(0x674, clear_params.raw, true);
141 clear_params.layer.Assign(clear_params.layer + 1);
142
143 // FIXME: remove this when amdvlk can clear multiple layers without crashing
144 break;
145 }
146}
147
148constexpr std::array<std::pair<u64, HLEFunction>, 5> hle_funcs{{
130 {0x771BB18C62444DA0, &HLE_771BB18C62444DA0}, 149 {0x771BB18C62444DA0, &HLE_771BB18C62444DA0},
131 {0x0D61FC9FAAC9FCAD, &HLE_0D61FC9FAAC9FCAD}, 150 {0x0D61FC9FAAC9FCAD, &HLE_0D61FC9FAAC9FCAD},
132 {0x0217920100488FF7, &HLE_0217920100488FF7}, 151 {0x0217920100488FF7, &HLE_0217920100488FF7},
133 {0x3F5E74B9C9A50164, &HLE_3F5E74B9C9A50164}, 152 {0x3F5E74B9C9A50164, &HLE_3F5E74B9C9A50164},
153 {0xEAD26C3E2109B06B, &HLE_EAD26C3E2109B06B},
134}}; 154}};
135 155
136class HLEMacroImpl final : public CachedMacro { 156class HLEMacroImpl final : public CachedMacro {