graphics: create the image heap before the pipeline cache prewarms pipelines #2062

Closed
github-bot wants to merge 2 commits from github-bot/gh-2062 into main AGit
Owner

@⁠Nawid3333 on GitHub · 2026-11-02 01:34 UTC · original
Nawid3333:fix/image-heap-before-warmup → main · +4 −3 · 2 files · 2 commits · closed without merging

Summary

Since ec8b75b24 the pipeline cache creates the stored pipelines in its constructor (WarmUp). Pipelines whose shaders read the image heap (27dc7c281) use graphics.image_heap_layout as set 1. RenderContext constructed m_pipeline_cache before m_image_heap, and only ImageHeap's constructor sets that layout. So on every boot with a shader store that holds such a pipeline, WarmUp created a pipeline layout whose set 1 is VK_NULL_HANDLE.

On a Radeon RX 9070 XT (AMD Windows driver 26.10.1), Ghost of Yōtei (PPSA26344) crashed on its second boot, in amdvlk64.dll while the prewarm created pipelines (access violation reading 0x20). The validation layer reports:

  • VUID-VkPipelineLayoutCreateInfo-graphicsPipelineLibrary-06753: pSetLayouts[1] is VK_NULL_HANDLE;
  • VUID-VkGraphicsPipelineCreateInfo-layout-07988: the fragment shader uses set 1 binding 0, which the layout does not declare.

Change

m_pipeline_cache is declared and initialized after m_image_heap. No constructor between the old and the new position uses the pipeline cache.

Tests

Ghost of Yōtei (#1599) on a Radeon RX 9070 XT (AMD Windows driver 26.10.1), with #1967 and #1758, which this game needs
to get far enough to compile image-heap shaders:

  • Without this change: the boot after a long first run crashes in the prewarm; the validation layer reports the two
    errors above.
  • With this change: a first run writes the store; the next boot loads 445 programs, 505 modules and 477 pipelines, with
    no validation error from the prewarm, and the game keeps loading until it stops at
    image heaps exceed 65536 resident images (imageHeap.cpp:389), which is unrelated.

AI use: drafted with AI assistance (Claude Code); verified and tested by me.

**@⁠Nawid3333** on GitHub · 2026-11-02 01:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2062) `Nawid3333:fix/image-heap-before-warmup` → `main` · +4 −3 · 2 files · 2 commits · closed without merging ## Summary Since ec8b75b24 the pipeline cache creates the stored pipelines in its constructor (`WarmUp`). Pipelines whose shaders read the image heap (27dc7c281) use `graphics.image_heap_layout` as set 1. `RenderContext` constructed `m_pipeline_cache` before `m_image_heap`, and only `ImageHeap`'s constructor sets that layout. So on every boot with a shader store that holds such a pipeline, `WarmUp` created a pipeline layout whose set 1 is `VK_NULL_HANDLE`. On a Radeon RX 9070 XT (AMD Windows driver 26.10.1), Ghost of Yōtei (PPSA26344) crashed on its second boot, in `amdvlk64.dll` while the prewarm created pipelines (access violation reading `0x20`). The validation layer reports: - `VUID-VkPipelineLayoutCreateInfo-graphicsPipelineLibrary-06753`: `pSetLayouts[1]` is `VK_NULL_HANDLE`; - `VUID-VkGraphicsPipelineCreateInfo-layout-07988`: the fragment shader uses set 1 binding 0, which the layout does not declare. ## Change `m_pipeline_cache` is declared and initialized after `m_image_heap`. No constructor between the old and the new position uses the pipeline cache. ## Tests Ghost of Yōtei (#1599) on a Radeon RX 9070 XT (AMD Windows driver 26.10.1), with #1967 and #1758, which this game needs to get far enough to compile image-heap shaders: - Without this change: the boot after a long first run crashes in the prewarm; the validation layer reports the two errors above. - With this change: a first run writes the store; the next boot loads 445 programs, 505 modules and 477 pipelines, with no validation error from the prewarm, and the game keeps loading until it stops at `image heaps exceed 65536 resident images` (`imageHeap.cpp:389`), which is unrelated. AI use: drafted with AI assistance (Claude Code); verified and tested by me.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:13:07 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-02 01:39 UTC · original · edited 2026-11-23 17:14 UTC

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

RenderContext cache and heap members were reordered in the class declaration. The constructor initializer list was reordered to match. This changes member initialization and destruction order.

Suggested reviewers: nmzik

Change: Bug fix

Merge Risk: Minimal · up to 0aad7

This change builds the image heap before the pipeline cache prewarms pipelines, so prewarmed pipeline layouts include the image heap layout. No lifetime hazard was found. The change is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the image heap is now created before the pipeline cache, so that prewarm sees the image heap layout. It matches the reordering in renderContext.h and renderContext.cpp…
Description check Passed The description explains the bug and the fix. It states that m_pipeline_cache is now declared and initialized after m_image_heap, which matches the reordering in the changed files. It also gives test …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the image heap is now created before the pipeline cache, so that prewarm sees the image heap layout. It matches the reordering in renderContext.h and renderContext.cpp and the objectives in the PR.

Full details: Description check

Explanation

The description explains the bug and the fix. It states that m_pipeline_cache is now declared and initialized after m_image_heap, which matches the reordering in the changed files. It also gives test details for the crash and the validation errors.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 85e775f014 and 0aad72099e.

Files selected for processing: 2

  • src/graphics/host_gpu/renderer/renderContext.cpp
  • src/graphics/host_gpu/renderer/renderContext.h
Files skipped from review as they are similar to previous changes: 1

  • src/graphics/host_gpu/renderer/renderContext.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-02 01:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2062#issuecomment-6567033084) · edited 2026-11-23 17:14 UTC <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/2062?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_status_start --> No actionable comments were generated in the recent review. <!-- recent_review_status_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> `RenderContext` cache and heap members were reordered in the class declaration. The constructor initializer list was reordered to match. This changes member initialization and destruction order. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"0aad72099edad76d3a99b4067c609ace2809839d" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>0aad7</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `0aad7` --> <!-- final_review_risk_coverage:{"sourceCommitId":"0aad72099edad76d3a99b4067c609ace2809839d","coveredCommitId":"0aad72099edad76d3a99b4067c609ace2809839d","kind":"reviewed"} --> This change builds the image heap before the pipeline cache prewarms pipelines, so prewarmed pipeline layouts include the image heap layout. No lifetime hazard was found. The change is low risk to merge. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main change: the image heap is now created before the pipeline cache, so that prewarm sees the image heap layout. It matches the reordering in renderContext.h and renderContext.cpp… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the bug and the fix. It states that m_pipeline_cache is now declared and initialized after m_image_heap, which matches the reordering in the changed files. It also gives test … | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: the image heap is now created before the pipeline cache, so that prewarm sees the image heap layout. It matches the reordering in renderContext.h and renderContext.cpp and the objectives in the PR. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the bug and the fix. It states that m_pipeline_cache is now declared and initialized after m_image_heap, which matches the reordering in the changed files. It also gives test details for the crash and the validation errors. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2062)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <!-- tips_end --> <!-- recent_review_start --> <h6> <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <br> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/578f2d43fe5d018617afaad94b1c90a07f6d9acc/.coderabbit.yaml>) - **Commit**: [578f2d4](<https://github.com/KytyPS5/KytyPS5/commit/578f2d43fe5d018617afaad94b1c90a07f6d9acc>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `276d5c6b-c8ba-4174-b8bd-2bddcc145957` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 85e775f014cf766a4438c8e8a266923d76549e0f and 0aad72099edad76d3a99b4067c609ace2809839d. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 2</strong></summary> <dl> <dd> <br> * `src/graphics/host_gpu/renderer/renderContext.cpp` * `src/graphics/host_gpu/renderer/renderContext.h` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-similar-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-similar.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files skipped from review as they are similar to previous changes: 1</strong></summary> <dl> <dd> <br> * src/graphics/host_gpu/renderer/renderContext.cpp </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. </dd> </dl> </details> </h6> <!-- recent_review_end -->
github-bot closed this pull request 2026-11-27 00:43:22 +00:00
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-26 21:30 UTC · original

Main has the same change since 832d6dac1 (graphics: initialize image heap before pipeline cache warm-up), so I'm closing this one.

**@⁠Nawid3333** on GitHub · 2026-11-26 21:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2062#issuecomment-7203795139) Main has the same change since 832d6dac1 (graphics: initialize image heap before pipeline cache warm-up), so I'm closing this one.

Pull request closed

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