renderer: clamp image copies to shared extents #374

Closed
github-bot wants to merge 1 commit from gh-pr/374/head into gh-pr/374/base
Owner

@⁠Techx3 on GitHub · 2026-08-28 23:04 UTC · original
Techx3:techx3/image-copy-clamp-both-extents → main · +32 −9 · 2 files · 1 commits · closed without merging

Summary

  • clamp width and height at every mip to the extent shared by source and destination
  • clamp 3D depth when both images are volumes
  • clamp 2D-array layers against 3D mip depth in both conversion directions
  • apply the same width/height rule to the buffer-mediated fallback path

Why

Cached aliases may share pitch and memory while differing by a texel, layer, or volume depth. Building the copy exclusively from the source extent can exceed the destination subresource and trigger Vulkan validation/device errors.

This isolates and hardens the image-copy part of #266.

Game / PPSA context

  • Scars Above — PPSA08597
  • Demon's Souls — PPSA01342

Validation

  • runtime regression covers unequal 2D-array/3D slice counts in both directions
  • built: kyty_emulator, shader_recompiler_compute_tests
  • passed: texture_cache_image_overlap
  • passed: shader_recompiler_compute
  • git diff --check
**@⁠Techx3** on GitHub · 2026-08-28 23:04 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/374) `Techx3:techx3/image-copy-clamp-both-extents` → `main` · +32 −9 · 2 files · 1 commits · closed without merging ## Summary - clamp width and height at every mip to the extent shared by source and destination - clamp 3D depth when both images are volumes - clamp 2D-array layers against 3D mip depth in both conversion directions - apply the same width/height rule to the buffer-mediated fallback path ## Why Cached aliases may share pitch and memory while differing by a texel, layer, or volume depth. Building the copy exclusively from the source extent can exceed the destination subresource and trigger Vulkan validation/device errors. This isolates and hardens the image-copy part of #266. ## Game / PPSA context - Scars Above — PPSA08597 - Demon's Souls — PPSA01342 ## Validation - runtime regression covers unequal 2D-array/3D slice counts in both directions - built: kyty_emulator, shader_recompiler_compute_tests - passed: texture_cache_image_overlap - passed: shader_recompiler_compute - git diff --check
Limit every mip copy to dimensions available in both images. Clamp array-layer and volume-depth conversions in either direction so Vulkan never receives a copy region outside the source or destination subresource.

Co-authored-by: shadowbeat070 <[email protected]>

Co-authored-by: SueryRD <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:18:16 +00:00
github-bot closed this pull request 2026-11-26 09:18:16 +00:00
Author
Owner

@⁠Nmzik on GitHub · 2026-10-21 19:42 UTC · original

Duplicate of #1176.

**@⁠Nmzik** on GitHub · 2026-10-21 19:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/374#issuecomment-6324946306) Duplicate of #1176.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.