Merge pull request #18362 from unknownbrackets/softgpu-zmirror

softgpu: Point depthbuf at the first VRAM mirror
This commit is contained in:
Henrik Rydgård 2023-10-15 22:53:00 +02:00 committed by GitHub
commit 618589abd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1040,7 +1040,9 @@ void SoftGPU::Execute_ZbufPtr(u32 op, u32 diff) {
// We assume depthbuf.data won't change while we're drawing.
if (diff) {
drawEngine_->transformUnit.Flush("depthbuf");
depthbuf.data = Memory::GetPointerWrite(gstate.getDepthBufAddress());
// For the pointer, ignore memory mirrors. This also gives some buffer for draws that go outside.
// TODO: Confirm how wrapping is handled in drawing. Adjust if we ever handle VRAM mirrors more accurately.
depthbuf.data = Memory::GetPointerWrite(gstate.getDepthBufAddress() & 0x041FFFF0);
}
}