HFW: fix indirect texture tracking and loading-time Vulkan errors #1980
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1980
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1980"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tototomate123 on GitHub · 2026-10-29 18:06 UTC · original
tototomate123:fix/hfw-loading-consolidated→main· +4128 −2379 · 23 files · 5 commits · openHorizon Forbidden West (PPSA01521) hits resource-tracking failures and invalid Vulkan image operations while loading. This consolidates the remaining shader and renderer fixes on current main.
Earlier testing of the full local HFW branch reached the loading screen; gameplay remains blocked by compute shader
a8857e9a25dfc8d8atpc=0x41c. This consolidated branch has not yet had a fresh game run.Validation: Linux build, resource tracking/materialization, CFG, and the full GPU regression suite pass. Windows has not been tested locally.
Supersedes #852, #976, and #977.
Related work: #1118 (indirect texture-table proofs), #373 (protected-image eviction scans), #1879 (standalone stencil targets), and #1961 (Vanguard memory pressure). These have partial or complementary scope; this PR does not supersede them. The shared shader/renderer fixes may benefit other games, which have not been tested on this branch.
AI-assisted implementation and testing.
@coderabbitai[bot] on GitHub · 2026-10-29 18:21 UTC · original · edited 2026-10-29 19:19 UTC
Walkthrough
The change adds GPU format metadata and mappings, including
k32FloatClampandk16UScaled. It adds standalone stencil-storage materialization and publication, device-memory-aware cache collection, and storage-view validation. Shader IR serialization now tracks selector metadata and inactive descriptors. SPIR-V emission supports integer level-zero 3D gathers. New tests cover these paths and update 3D image fixtures.Suggested reviewers:
nmzik,thecruzPriority:
Normal
Change: Bug fix
Merge Risk:
High · up to
97e50Fix the selector materialization failure and refresh device usage after texture eviction before merging; otherwise affected shaders may fail to load and image allocation can still abort under memory pressure.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 11.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 137 functions across 19 files. (1 skipped: 1 too large.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -1208,0 +1253,4 @@desc.info.data != association.info.data);const auto depth_id = association.depth_id;const auto range = association.stencil_subresources;RefreshImage(depth_id);@coderabbitai[bot] on GitHub · 2026-10-29 18:21 UTC · original · edited 2026-10-29 18:59 UTC
Refresh the stencil association before copying its contents.
If guest memory changes after a stencil association is created, the association can be CPU-dirty while its depth owner remains clean.
RefreshImage(depth_id)does not upload that association.CopyStencilStoragethen copies stale native stencil bytes into the storage image, so a partial compute write preserves incorrect values. Refreshidbefore copying, while it still refers to the association. (raw.githubusercontent.com)✅ Addressed in commit
97e504b@coderabbitai[bot] on GitHub · 2026-10-29 18:21 UTC · original · reviewed
Actionable comments posted: 1
c6b07ba8-f57e-4dc5-8320-e206d798d286Reviewing files that changed from the base of the PR and between
5eab0ec738andf40f5e6672.CMakeLists.txtsrc/graphics/guest_gpu/gpu_defs.hsrc/graphics/guest_gpu/gpu_format.cppsrc/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.hsrc/graphics/host_gpu/renderer/image/image.hsrc/graphics/host_gpu/renderer/image/imageInfo.hsrc/graphics/host_gpu/renderer/image/imageView.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/render.hsrc/graphics/host_gpu/renderer/renderCompute.cppsrc/graphics/host_gpu/vulkanCommon.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cppsrc/graphics/shader/recompiler/ir/Serialize.hsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppsrc/graphics/shader/recompiler/ir/passes/ResourceTracking.cppsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cpptests/ResourceMaterializationTests.cpptests/ResourceTrackingTests.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-29 18:49 UTC · original · reviewed
55de5c69-fd2a-4344-84e4-03e4bd00188aReviewing files that changed from the base of the PR and between
f40f5e6672andb703fde38b.src/graphics/host_gpu/renderer/cache/textureCache.cpptests/ResourceMaterializationTests.cpptests/ShaderRayTracingGpuTests.inctests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-29 19:19 UTC · original · reviewed
262826f7-6651-40ff-a337-fc2cbc5a8b50Reviewing files that changed from the base of the PR and between
b703fde38band97e504bc05.src/graphics/host_gpu/renderer/cache/textureCache.cpptests/ResourceMaterializationTests.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.