fix(agc): gather a sampled depth cube at the descriptor's layer offsets #5054

Merged
NFSS10 merged 2 commits from upstream-pr/5054 into main 2026-10-14 18:32:29 +00:00
NFSS10 commented 2026-10-13 09:59:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NFSS10 on 2026-10-13T09:59:48Z.


What

DepthPlaneCopy is the image a layered depth texture is sampled through. DepthSurfaceTexture gathers a cube/array whose faces are all backed by host depth surfaces, one vkCmdCopyImage per layer. It located the surface for layer n at base.address + n * DepthSliceBytes(extent) and refused the gather unless the guest descriptor matched the host depth slices exactly:

Require(geometry.layers == layers && geometry.sliceLinearBytes == sliceBytes() && !geometry.mips.empty(), "depth plane copy geometry does not match its layers");

Both halves of that assume more than the call requires:

  • a depth surface need not sit at the host depth slice stride; the descriptor's own layer addresses are DescribeSurface(...).GuestLayerOffset(n);
  • a tiled descriptor's linear per-layer footprint (sliceLinearBytes) need not equal the host depth slice, even when its tiled footprint (layerBytes) does.

Bendy and the Ink Machine (PPSA27616) samples a 64x64 F32 cube over six contiguous D32 depth surfaces with mipCount = 1. The descriptor's linear layer footprint is 0x8000 while one host depth slice is 0x10000, so the copy aborted with depth plane copy geometry does not match its layers as soon as the title sampled the cube.

This change:

  • locates layer n at base.address + geometry.GuestLayerOffset(n) - the address the descriptor itself uses, and the one the guest fill path already used, so the two ways of finding a layer agree by construction;
  • runs the geometry check only when a layer has no host surface (VK_NULL_HANDLE) and would be filled from guest memory - the one path that reads the guest layout and needs sliceLinearBytes to line up with the host depth slices one to one.

The fill path is unchanged: a fill whose guest layout would misplace bytes is still refused with the same message. The storage-image path still refuses a layer pitch that is not the depth slice size; that is unchanged and out of scope.

Follow-up to #425, which added the layered depth plane copy. This is a new call shape (a fully host-backed cube), not a regression in that PR.

Before: No gameplay. The game wouldn't pass the main menu.

After: Game now loads pass the main menu and we have gameplay (with very graphical artifacts but it works)

https://github.com/user-attachments/assets/8285c6a3-6214-4b4d-904c-438a76c1e40d

Tested

Windows 11 Pro (build 22631), AMD Ryzen 9 7900X, MinGW-w64 GCC 15.2.0, on 23e93c054.

GPUs tested: AMD Radeon RX 7900 GRE (driver 32.0.21013.1000).

  • New cases in agc_driver_depth_plane_guest_layers:
    • a 256x256 cube over six depth surfaces placed at the descriptor's own layer offsets (per-layer footprint 0x50000, one host depth slice 0x40000). The gather finds all six faces host-to-host (6 surface copies into 1 plane copy). Dropping one face makes the plane copy fall back to the guest fill, and the mismatched footprint is still refused with the same message.
    • a 64x64 tiled cube with mipCount = 1, whose tiled layer footprint equals the depth slice but whose linear footprint does not (0x8000 vs 0x10000) - the shape from the reported abort. It gathers all six faces host-to-host.
  • agc_driver_graphics, the agc_driver_depth_* tests (bias per face, compare copy, fast clear, fast clear submit, plane sampling, storage, storage dispatch, storage reuse) and agc_driver_storage_* (cache budget, one slice alias) pass, as does check_conventions.py.
  • Bendy and the Ink Machine (PPSA27616), same run both ways;
    • on main (23e93c054) the title aborts at gameplay start with AGC graphics: depth plane copy geometry does not match its layers;
    • with this change the title runs through the same sequence with no depth-plane errors and closes.

Checklist

  • Based on current main; no other open PR implements the same functions (#5003 covers storage-image access to depth planes, not the sampled copy)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA27616 (Bendy and the Ink Machine; no Game bring-up discussion opened)
  • AI-assisted: yes. Written with an AI coding assistant under my direction; reviewed and tested.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4841537240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054). Originally posted by [NFSS10](https://github.com/NFSS10) on 2026-10-13T09:59:48Z. --- ### What `DepthPlaneCopy` is the image a layered depth texture is sampled through. `DepthSurfaceTexture` gathers a cube/array whose faces are all backed by host depth surfaces, one `vkCmdCopyImage` per layer. It located the surface for layer `n` at `base.address + n * DepthSliceBytes(extent)` and refused the gather unless the guest descriptor matched the host depth slices exactly: ```cpp Require(geometry.layers == layers && geometry.sliceLinearBytes == sliceBytes() && !geometry.mips.empty(), "depth plane copy geometry does not match its layers"); ``` Both halves of that assume more than the call requires: - a depth surface need not sit at the host depth slice stride; the descriptor's own layer addresses are `DescribeSurface(...).GuestLayerOffset(n)`; - a tiled descriptor's linear per-layer footprint (`sliceLinearBytes`) need not equal the host depth slice, even when its tiled footprint (`layerBytes`) does. Bendy and the Ink Machine (PPSA27616) samples a 64x64 F32 cube over six contiguous D32 depth surfaces with `mipCount = 1`. The descriptor's linear layer footprint is 0x8000 while one host depth slice is 0x10000, so the copy aborted with `depth plane copy geometry does not match its layers` as soon as the title sampled the cube. This change: - locates layer `n` at `base.address + geometry.GuestLayerOffset(n)` - the address the descriptor itself uses, and the one the guest fill path already used, so the two ways of finding a layer agree by construction; - runs the geometry check only when a layer has no host surface (`VK_NULL_HANDLE`) and would be filled from guest memory - the one path that reads the guest layout and needs `sliceLinearBytes` to line up with the host depth slices one to one. The fill path is unchanged: a fill whose guest layout would misplace bytes is still refused with the same message. The storage-image path still refuses a layer pitch that is not the depth slice size; that is unchanged and out of scope. Follow-up to #425, which added the layered depth plane copy. This is a new call shape (a fully host-backed cube), not a regression in that PR. **Before:** No gameplay. The game wouldn't pass the main menu. **After:** Game now loads pass the main menu and we have gameplay (with very graphical artifacts but it works) https://github.com/user-attachments/assets/8285c6a3-6214-4b4d-904c-438a76c1e40d ### Tested Windows 11 Pro (build 22631), AMD Ryzen 9 7900X, MinGW-w64 GCC 15.2.0, on `23e93c054`. GPUs tested: AMD Radeon RX 7900 GRE (driver 32.0.21013.1000). - New cases in `agc_driver_depth_plane_guest_layers`: - a 256x256 cube over six depth surfaces placed at the descriptor's own layer offsets (per-layer footprint 0x50000, one host depth slice 0x40000). The gather finds all six faces host-to-host (6 surface copies into 1 plane copy). Dropping one face makes the plane copy fall back to the guest fill, and the mismatched footprint is still refused with the same message. - a 64x64 tiled cube with `mipCount = 1`, whose tiled layer footprint equals the depth slice but whose linear footprint does not (0x8000 vs 0x10000) - the shape from the reported abort. It gathers all six faces host-to-host. - `agc_driver_graphics`, the `agc_driver_depth_*` tests (bias per face, compare copy, fast clear, fast clear submit, plane sampling, storage, storage dispatch, storage reuse) and `agc_driver_storage_*` (cache budget, one slice alias) pass, as does `check_conventions.py`. - Bendy and the Ink Machine (PPSA27616), same run both ways; - on `main` (`23e93c054`) the title aborts at gameplay start with `AGC graphics: depth plane copy geometry does not match its layers`; - with this change the title runs through the same sequence with no depth-plane errors and closes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#5003 covers storage-image access to depth planes, not the sampled copy) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - Depends on: none - Unblocks: PPSA27616 (Bendy and the Ink Machine; no Game bring-up discussion opened) - AI-assisted: yes. Written with an AI coding assistant under my direction; reviewed and tested.
coltken95 commented 2026-10-13 18:54:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T18:54:22Z.


Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 7bca0b6b3 merged into main 9d0a41d5a:

  • With the PR: agc_driver_depth_plane_guest_layers passes.
  • With main's sources and the PR's test: agc_driver_depth_plane_guest_layers fails.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152849756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#issuecomment-6152849756). Originally posted by [coltken95](https://github.com/coltken95) on 2026-10-13T18:54:22Z. --- Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 7bca0b6b3 merged into main 9d0a41d5a: - With the PR: `agc_driver_depth_plane_guest_layers` passes. - With main's sources and the PR's test: `agc_driver_depth_plane_guest_layers` fails. AI-assisted: yes (Claude Code)
NFSS10 commented 2026-10-13 22:54:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NFSS10 on 2026-10-13T22:54:02Z.


Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 7bca0b6 merged into main 9d0a41d:

* With the PR: `agc_driver_depth_plane_guest_layers` passes.

* With main's sources and the PR's test: `agc_driver_depth_plane_guest_layers` fails.

AI-assisted: yes (Claude Code)

Thanks for testing this against main. I’ve rebased PR #5054 onto current main and reran agc_driver_depth_plane_guest_layers; it passes locally on the updated branch. The PR’s guest-layer change is independent of the padded-layout work in #4722/#4873, and it does not rely on #5344, so I’ve kept Depends on: none. I’ll verify the combined DepthSurface.cpp behavior if those overlapping changes are merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156923862 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#issuecomment-6156923862). Originally posted by [NFSS10](https://github.com/NFSS10) on 2026-10-13T22:54:02Z. --- > Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with [7bca0b6](https://github.com/boykopovar/AnyPS5/commit/7bca0b6b35a41dfe640ae5b5feaeb02a8c1bd389) merged into main [9d0a41d](https://github.com/boykopovar/AnyPS5/commit/9d0a41d5a10c64c5a7182ceacafb201ee3ead654): > > * With the PR: `agc_driver_depth_plane_guest_layers` passes. > > * With main's sources and the PR's test: `agc_driver_depth_plane_guest_layers` fails. > > > AI-assisted: yes (Claude Code) Thanks for testing this against main. I’ve rebased PR #5054 onto current main and reran agc_driver_depth_plane_guest_layers; it passes locally on the updated branch. The PR’s guest-layer change is independent of the padded-layout work in #4722/#4873, and it does not rely on #5344, so I’ve kept Depends on: none. I’ll verify the combined DepthSurface.cpp behavior if those overlapping changes are merged.
CnRJay commented 2026-10-14 01:51:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T01:51:02Z.

Review: COMMENTED


I don't think the check can be skipped when every layer has a surface, because it does more than validate the guest-memory fallback. It is the only thing that keeps the two ways of locating a layer the same.

DepthSurfaceTexture finds the surface for layer n at base.address + n * DepthSliceBytes(extent), using the host slice size as the stride. The guest descriptor puts layer n at baseAddress + geometry.GuestLayerOffset(n), and for this cube that is n * 0x500000 because each face carries its mip chain. With the check in place the two strides are equal, so the surface found for a layer is the one at that face's address. With the check skipped they differ for every face after the first. Faces 1–5 are then gathered from the surfaces at 0x400000, 0x800000, … while the descriptor addresses 0x500000, 0xA00000, …, which are inside other surfaces. The storage-image path refuses the same layout in DepthSurface.cpp ("with a layer pitch of 0x%llx bytes, not the depth slice size 0x%llx, is not implemented"), so the two paths would disagree too.

That may be what the artifacts in the video are. The texture is a cube, so wrong faces would show up as shadows or reflections that look right from one direction and wrong from others.

To get past the menu without that, I see two options:

  • Look the slices up at baseAddress + geometry.GuestLayerOffset(layer), so each face uses the surface at its own address (or falls back to guest memory when nothing is there), and keep the check for the mixed case.
  • If the title really renders six faces at a 0x400000 stride and samples them as a cube with a 0x500000 stride, that is worth establishing from the log first: the six DepthTarget addresses and the texture descriptor (baseAddress, mipCount, lastLevel). On the console the descriptor would read faces 1–5 from the middle of other surfaces, so one of the two values is probably not what the code assumes.

Minor: this changes libSceAgcDriver only, so the relinker label looks unintended. The GPU should be named (model and driver) in a GPUs tested line.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5512139405 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#pullrequestreview-5512139405). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T01:51:02Z. **Review:** COMMENTED --- I don't think the check can be skipped when every layer has a surface, because it does more than validate the guest-memory fallback. It is the only thing that keeps the two ways of locating a layer the same. `DepthSurfaceTexture` finds the surface for layer `n` at `base.address + n * DepthSliceBytes(extent)`, using the host slice size as the stride. The guest descriptor puts layer `n` at `baseAddress + geometry.GuestLayerOffset(n)`, and for this cube that is `n * 0x500000` because each face carries its mip chain. With the check in place the two strides are equal, so the surface found for a layer is the one at that face's address. With the check skipped they differ for every face after the first. Faces 1–5 are then gathered from the surfaces at `0x400000`, `0x800000`, … while the descriptor addresses `0x500000`, `0xA00000`, …, which are inside other surfaces. The storage-image path refuses the same layout in `DepthSurface.cpp` ("with a layer pitch of 0x%llx bytes, not the depth slice size 0x%llx, is not implemented"), so the two paths would disagree too. That may be what the artifacts in the video are. The texture is a cube, so wrong faces would show up as shadows or reflections that look right from one direction and wrong from others. To get past the menu without that, I see two options: - Look the slices up at `baseAddress + geometry.GuestLayerOffset(layer)`, so each face uses the surface at its own address (or falls back to guest memory when nothing is there), and keep the check for the mixed case. - If the title really renders six faces at a `0x400000` stride and samples them as a cube with a `0x500000` stride, that is worth establishing from the log first: the six `DepthTarget` addresses and the texture descriptor (`baseAddress`, `mipCount`, `lastLevel`). On the console the descriptor would read faces 1–5 from the middle of other surfaces, so one of the two values is probably not what the code assumes. Minor: this changes `libSceAgcDriver` only, so the `relinker` label looks unintended. The GPU should be named (model and driver) in a `GPUs tested` line.
NFSS10 commented 2026-10-14 10:36:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NFSS10 on 2026-10-14T10:36:40Z.


I don't think the check can be skipped when every layer has a surface, because it does more than validate the guest-memory fallback. It is the only thing that keeps the two ways of locating a layer the same.

DepthSurfaceTexture finds the surface for layer n at base.address + n * DepthSliceBytes(extent), using the host slice size as the stride. The guest descriptor puts layer n at baseAddress + geometry.GuestLayerOffset(n), and for this cube that is n * 0x500000 because each face carries its mip chain. With the check in place the two strides are equal, so the surface found for a layer is the one at that face's address. With the check skipped they differ for every face after the first. Faces 1–5 are then gathered from the surfaces at 0x400000, 0x800000, … while the descriptor addresses 0x500000, 0xA00000, …, which are inside other surfaces. The storage-image path refuses the same layout in DepthSurface.cpp ("with a layer pitch of 0x%llx bytes, not the depth slice size 0x%llx, is not implemented"), so the two paths would disagree too.

That may be what the artifacts in the video are. The texture is a cube, so wrong faces would show up as shadows or reflections that look right from one direction and wrong from others.

To get past the menu without that, I see two options:

* Look the slices up at `baseAddress + geometry.GuestLayerOffset(layer)`, so each face uses the surface at its own address (or falls back to guest memory when nothing is there), and keep the check for the mixed case.

* If the title really renders six faces at a `0x400000` stride and samples them as a cube with a `0x500000` stride, that is worth establishing from the log first: the six `DepthTarget` addresses and the texture descriptor (`baseAddress`, `mipCount`, `lastLevel`). On the console the descriptor would read faces 1–5 from the middle of other surfaces, so one of the two values is probably not what the code assumes.

Minor: this changes libSceAgcDriver only, so the relinker label looks unintended. The GPU should be named (model and driver) in a GPUs tested line.

Thanks for the careful review.

You're right, and I went with option 1: the lookup no longer uses the host depth slice stride.

const auto geometry = DescribeSurface(resource);
for (std::uint32_t layer = 0; layer < layers; ++layer) {
    const auto address = base.address + geometry.GuestLayerOffset(layer);
    auto* slice = depthSlice(context.device, address, base);
    ...
}

So the gather and the guest fill find a layer at the same address by construction, instead of by the check happening to hold. The geometry check is kept, now only for the mixed case (a layer left at VK_NULL_HANDLE that has to be filled from guest memory), which is the only path that actually reads the guest layout.

On the 0x400000 / 0x500000 point: I re-checked the log and the resource that actually aborts is not a two-level chain. It's a 64x64 F32 cube with mipCount = 1: its tiled layerBytes equals the host depth slice, but sliceLinearBytes is 0x8000 against a 0x10000 host depth slice, so the old sliceLinearBytes == sliceBytes() predicate refused it. I've corrected the PR description - my earlier note about a 0x500000 per-layer footprint and a two-level mip chain was wrong.

I added a fixture for the stride case as well: a 256x256 cube whose surfaces sit at the descriptor's own offsets (0x50000 apart, one host depth slice 0x40000). With the old lookup only the first face was found, so the copy fell back to the guest path and was refused; now all six are gathered host-to-host. The missing-face variant still takes the fill path and is refused with the same message.

The storage-image path is indeed unchanged and still refuses a pitch that isn't the depth slice size; I agree that's out of scope here.

Rebased onto current main (23e93c054); agc_driver_depth_plane_guest_layers passes, and running the title the same way both before and after - on main it aborts at gameplay start with depth plane copy geometry does not match its layers, and with this change it goes through the menu into gameplay with no depth-plane errors.

About the labels, I can't change the labels, they were auto-assigned by the bot and I don't have permissions to change them :/

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166427250 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#issuecomment-6166427250). Originally posted by [NFSS10](https://github.com/NFSS10) on 2026-10-14T10:36:40Z. --- > I don't think the check can be skipped when every layer has a surface, because it does more than validate the guest-memory fallback. It is the only thing that keeps the two ways of locating a layer the same. > > `DepthSurfaceTexture` finds the surface for layer `n` at `base.address + n * DepthSliceBytes(extent)`, using the host slice size as the stride. The guest descriptor puts layer `n` at `baseAddress + geometry.GuestLayerOffset(n)`, and for this cube that is `n * 0x500000` because each face carries its mip chain. With the check in place the two strides are equal, so the surface found for a layer is the one at that face's address. With the check skipped they differ for every face after the first. Faces 1–5 are then gathered from the surfaces at `0x400000`, `0x800000`, … while the descriptor addresses `0x500000`, `0xA00000`, …, which are inside other surfaces. The storage-image path refuses the same layout in `DepthSurface.cpp` ("with a layer pitch of 0x%llx bytes, not the depth slice size 0x%llx, is not implemented"), so the two paths would disagree too. > > That may be what the artifacts in the video are. The texture is a cube, so wrong faces would show up as shadows or reflections that look right from one direction and wrong from others. > > To get past the menu without that, I see two options: > > * Look the slices up at `baseAddress + geometry.GuestLayerOffset(layer)`, so each face uses the surface at its own address (or falls back to guest memory when nothing is there), and keep the check for the mixed case. > > * If the title really renders six faces at a `0x400000` stride and samples them as a cube with a `0x500000` stride, that is worth establishing from the log first: the six `DepthTarget` addresses and the texture descriptor (`baseAddress`, `mipCount`, `lastLevel`). On the console the descriptor would read faces 1–5 from the middle of other surfaces, so one of the two values is probably not what the code assumes. > > > Minor: this changes `libSceAgcDriver` only, so the `relinker` label looks unintended. The GPU should be named (model and driver) in a `GPUs tested` line. Thanks for the careful review. You're right, and I went with option 1: the lookup no longer uses the host depth slice stride. ```cpp const auto geometry = DescribeSurface(resource); for (std::uint32_t layer = 0; layer < layers; ++layer) { const auto address = base.address + geometry.GuestLayerOffset(layer); auto* slice = depthSlice(context.device, address, base); ... } ``` So the gather and the guest fill find a layer at the same address by construction, instead of by the check happening to hold. The geometry check is kept, now only for the mixed case (a layer left at `VK_NULL_HANDLE` that has to be filled from guest memory), which is the only path that actually reads the guest layout. On the 0x400000 / 0x500000 point: I re-checked the log and the resource that actually aborts is not a two-level chain. It's a 64x64 F32 cube with `mipCount = 1`: its tiled `layerBytes` equals the host depth slice, but `sliceLinearBytes` is 0x8000 against a 0x10000 host depth slice, so the old `sliceLinearBytes == sliceBytes()` predicate refused it. I've corrected the PR description - my earlier note about a 0x500000 per-layer footprint and a two-level mip chain was wrong. I added a fixture for the stride case as well: a 256x256 cube whose surfaces sit at the descriptor's own offsets (0x50000 apart, one host depth slice 0x40000). With the old lookup only the first face was found, so the copy fell back to the guest path and was refused; now all six are gathered host-to-host. The missing-face variant still takes the fill path and is refused with the same message. The storage-image path is indeed unchanged and still refuses a pitch that isn't the depth slice size; I agree that's out of scope here. Rebased onto current `main` (`23e93c054`); `agc_driver_depth_plane_guest_layers` passes, and running the title the same way both before and after - on `main` it aborts at gameplay start with `depth plane copy geometry does not match its layers`, and with this change it goes through the menu into gameplay with no depth-plane errors. About the labels, I can't change the labels, they were auto-assigned by the bot and I don't have permissions to change them :/
CnRJay commented 2026-10-14 16:52:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T16:52:11Z.


Thanks. Looking each slice up at baseAddress + geometry.GuestLayerOffset(layer) addresses what I raised: the gather and the guest fill now agree by construction, and the geometry check only guards the path that actually reads the guest layout. The corrected description (a 64×64 mipCount = 1 cube refused by the old sliceLinearBytes comparison) also explains the abort better than the earlier mip-chain note. The new 0x50000-stride fixture covers the case the old lookup got wrong.

The label isn't something you can change. A maintainer can drop relinker when they look at it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6173598002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#issuecomment-6173598002). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T16:52:11Z. --- Thanks. Looking each slice up at `baseAddress + geometry.GuestLayerOffset(layer)` addresses what I raised: the gather and the guest fill now agree by construction, and the geometry check only guards the path that actually reads the guest layout. The corrected description (a 64×64 `mipCount = 1` cube refused by the old `sliceLinearBytes` comparison) also explains the abort better than the earlier mip-chain note. The new 0x50000-stride fixture covers the case the old lookup got wrong. The label isn't something you can change. A maintainer can drop `relinker` when they look at it.
adriadam10 commented 2026-10-14 17:37:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:37:56Z.


Checked the layer lookup at GuestLayerOffset and the geometry check now limited to the guest-fill path; the new cases in agc_driver_depth_plane_guest_layers pass and fail without the change (negative check). libSceAgcDriver build and ctest are green apart from agc_driver_tessellation, which crashes inside the local RADV pipeline-library link and does not touch this path. Also confirmed by @coltken95 on Linux/lavapipe. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174471746 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#issuecomment-6174471746). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T17:37:56Z. --- Checked the layer lookup at `GuestLayerOffset` and the geometry check now limited to the guest-fill path; the new cases in `agc_driver_depth_plane_guest_layers` pass and fail without the change (negative check). `libSceAgcDriver` build and ctest are green apart from `agc_driver_tessellation`, which crashes inside the local RADV pipeline-library link and does not touch this path. Also confirmed by @coltken95 on Linux/lavapipe. Merging once the full Build is green.
adriadam10 commented 2026-10-14 18:02:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T18:02:39Z.


Main changed DepthPlaneCopy::Refresh after this was approved (the geometry check is now sliceLinearBytes < sliceBytes() with a detailed message), which conflicted. I rebased and kept both: main's message and staging code, and the check only when a face is filled from guest memory.

Added one commit: the two "missing face must be refused" cases in DepthPlaneGuestLayers.cpp are gone, since with main's < check the 0x50000 and 0x8000 footprints are accepted and no longer refused. The two gather cases remain and still fail without the change in DepthSurface.cpp (negative check). libSceAgcDriver ctest is green on the rebased tree apart from agc_driver_tessellation (crash in the local RADV pipeline-library link, not on this path). Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174940691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5054#issuecomment-6174940691). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T18:02:39Z. --- Main changed `DepthPlaneCopy::Refresh` after this was approved (the geometry check is now `sliceLinearBytes < sliceBytes()` with a detailed message), which conflicted. I rebased and kept both: main's message and staging code, and the check only when a face is filled from guest memory. Added one commit: the two "missing face must be refused" cases in `DepthPlaneGuestLayers.cpp` are gone, since with main's `<` check the 0x50000 and 0x8000 footprints are accepted and no longer refused. The two gather cases remain and still fail without the change in `DepthSurface.cpp` (negative check). `libSceAgcDriver` ctest is green on the rebased tree apart from `agc_driver_tessellation` (crash in the local RADV pipeline-library link, not on this path). Merging once the full Build is green.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5054
No description provided.