Skip to content

Commit

Permalink
Merge pull request #18362 from unknownbrackets/softgpu-zmirror
Browse files Browse the repository at this point in the history
softgpu: Point depthbuf at the first VRAM mirror
  • Loading branch information
hrydgard authored Oct 15, 2023
2 parents 5580d47 + f7f0507 commit 618589a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GPU/Software/SoftGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 618589a

Please sign in to comment.