perf(texture): reuse surface sizes for identical layouts #1294

Closed
TibixDev wants to merge 1 commit from upstream-pr/1294 into main
TibixDev commented 2026-10-07 22:39:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-07T22:39:09Z.


What

Texture lookups rebuild mip-layout vectors when they only need a surface size. Cache the size in 128 entries per thread, keyed by all seven layout fields. Full key checks prevent collisions from returning the wrong size.

Tested

Fedora 44, Release: agc_driver_graphics passes. The added test compares 4,096 layouts with DescribeSurface, including rejected layouts, cache replacement, and changed view fields.

Earlier paired tests on the combined fork reduced CPU time from 9.89–10.00 to 9.50–9.55 µs per draw with eight textures. Total draw time was unchanged.

Checklist

  • Current main; no duplicate open PR.
  • One topic.
  • No new code comments.
  • Unsupported paths still throw; UI stubs are documented.
  • No notes, logs, or images in the repository.
  • No new third-party code.
  • General behavior.
  • Depends on: none.
  • AI-assisted: yes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4779339810 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1294). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-07T22:39:09Z. --- ### What Texture lookups rebuild mip-layout vectors when they only need a surface size. Cache the size in 128 entries per thread, keyed by all seven layout fields. Full key checks prevent collisions from returning the wrong size. ### Tested Fedora 44, Release: `agc_driver_graphics` passes. The added test compares 4,096 layouts with `DescribeSurface`, including rejected layouts, cache replacement, and changed view fields. Earlier paired tests on the combined fork reduced CPU time from 9.89–10.00 to 9.50–9.55 µs per draw with eight textures. Total draw time was unchanged. ### Checklist - [x] Current `main`; no duplicate open PR. - [x] One topic. - [x] No new code comments. - [x] Unsupported paths still throw; UI stubs are documented. - [x] No notes, logs, or images in the repository. - [x] No new third-party code. - [x] General behavior. - [x] Depends on: none. - [x] AI-assisted: yes.
oneandonlydean commented 2026-10-08 02:44:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:44:47Z.


Closing: the measurement shows total draw time unchanged, and the 0.4 µs per draw comes from a combined fork, not main against main plus this change (#218). If you measure a gain, please comment here with main vs main+this numbers.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051108026 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1294#issuecomment-6051108026). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T02:44:47Z. --- Closing: the measurement shows total draw time unchanged, and the 0.4 µs per draw comes from a combined fork, not main against main plus this change (#218). If you measure a gain, please comment here with main vs main+this numbers.

Pull request closed

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!1294
No description provided.