maxwell3d: full HLE for multi-layer clears

This commit is contained in:
Liam 2022-11-16 22:41:40 -05:00
parent ece0c1095d
commit 4c42655a2d
8 changed files with 17 additions and 24 deletions

View file

@ -130,19 +130,13 @@ void HLE_3F5E74B9C9A50164(Engines::Maxwell3D& maxwell3d, const std::vector<u32>&
void HLE_EAD26C3E2109B06B(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& parameters) {
ASSERT(parameters.size() == 1);
Engines::Maxwell3D::Regs::ClearSurface clear_params{parameters[0]};
const Engines::Maxwell3D::Regs::ClearSurface clear_params{parameters[0]};
const u32 rt_index = clear_params.RT;
const u32 num_layers = maxwell3d.regs.rt[rt_index].depth_volume;
const u32 num_layers = maxwell3d.regs.rt[rt_index].depth;
ASSERT(clear_params.layer == 0);
for (u32 i = 0; i < num_layers; i++) {
// 0x674 = regs.clear_surface
maxwell3d.CallMethod(0x674, clear_params.raw, true);
clear_params.layer.Assign(clear_params.layer + 1);
// FIXME: remove this when amdvlk can clear multiple layers without crashing
break;
}
maxwell3d.regs.clear_surface.raw = clear_params.raw;
maxwell3d.ProcessClearBuffers(num_layers);
}
constexpr std::array<std::pair<u64, HLEFunction>, 5> hle_funcs{{