gpu: EQAA colour targets without FMASK, and mixed colour/depth sample counts (My First Gran Turismo) #1035
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!1035
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1035/head"
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?
@defektu on GitHub · 2026-10-04 01:20 UTC · original
defektu:pr/mfgt-mixed-samples→main· +56 −23 · 3 files · 2 commits · closed without mergingMy First Gran Turismo (PPSA24156) needs two render-target changes to get past the loading screen after "Start": EQAA colour targets without FMASK must be accepted, and a pass that mixes sample counts must not exit. The first is a real fix, the second is a stopgap with a known cost (below). Rebased on current
main(9e41d832).Commit 1: accept EQAA colour targets without FMASK, ignore the depth
PARTIALLY_RESIDENThintThe title stops earlier with
unsupported render-target sample configuration: samples=2 fragments=1(colorRenderTarget.cpp). A colour target with more coverage samples than fragments and no FMASK/CMASK/DCC metadata is plain EQAA and can be rendered as the fragment count. The depth path now also ignores thePARTIALLY_RESIDENThint, and its fatal diagnostics say which condition failed. (This was part of the closed #1033.)Commit 2: drop attachments whose sample count differs from the pass (stopgap)
Vulkan wants one sample count per pass. My First Gran Turismo mixes 1x colour with 2x depth. Without this change the session ends shortly after Start with
The highest sample count among the attachments wins, and an attachment with another count is dropped from the pass and logged.
Known cost of commit 2
VK_NV_framebuffer_mixed_samples/VK_AMD_mixed_attachment_samples). I tried that on an NVIDIA GPU: enabling the extension and giving the pipeline its per-attachment sample counts ended in a device lost (masterSemaphore.cpp,waitSemaphoresfailing) about two minutes into the run in two out of two runs, while this branch ran for 8 minutes. I do not know why yet, so it is not included. Suggestions welcome.Testing: both commits compile on current
main; in the game they were run together with the tessellation PR (#1032), where the title gets past the loading screen after Start.Independent of the other My First Gran Turismo PRs apart from that.
🤖 Generated with Claude Code
@coderabbitai[bot] on GitHub · 2026-10-16 03:51 UTC · original · edited 2026-10-16 04:29 UTC
📝 Walkthrough
Color target validation now accepts specified configurations where the sample count exceeds the derived fragment count. Graphics pipeline creation selects the maximum sample count and omits mismatched color and depth attachments. Depth target validation now reports specific unsupported register states.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: 🟠 High · up to
1d143Mixed-sample passes can still bind attachments that their pipelines omit, risking failed rendering in the targeted workload. Align render-time attachments with the pipeline and correct the depth guards before merging.
Pre-merge checks:
4 ·
1
#1033is closed and supplies historical context only. No linked-issue coding requirement applies to this pull request.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.@ -802,0 +820,4 @@}static_params.color_mask[slot] = 0;continue;}@coderabbitai[bot] on GitHub · 2026-10-16 03:51 UTC · original
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 13364
Pipeline drops attachments, but the render-target acquisition path still binds them. Verify that both paths use the same attachment set.
GetGraphicsPipelinecan omit a colour attachment when its sample count differs from the selected pass sample count. The render state still stores that attachment, andCommandBuffer::BeginRenderingpasses every slot belowstate.num_color_attachmentstovk::RenderingInfo.If the pipeline rendering info omits a slot but the begin-rendering info contains its view, the pipeline and render state can disagree. A mismatched-sample attachment can also reach
vk::RenderingInfo. Make the begin-rendering path apply the same filtering, and keepcolor_count,color_formats, and the colour attachment array consistent, including anyVK_FORMAT_UNDEFINEDholes.@coderabbitai[bot] on GitHub · 2026-10-16 03:51 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
2baaa059-edaf-4434-a2b5-f9d4dde4ae26📥 Commits
Reviewing files that changed from the base of the PR and between
9e41d8320aand 3cc0eb148cda9651bc5473a826fd3f172abb456d.📒 Files selected for processing: 1
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@ -861,0 +881,4 @@depth.desc.info.samples, attachment_samples);}}const bool with_depth = depth_in_use && !depth_mismatched;@coderabbitai[bot] on GitHub · 2026-10-16 03:51 UTC · original
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 4288
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 38665
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 26687
🌐 Web query:
Vulkan dynamic rendering pipeline depthAttachmentFormat VK_FORMAT_UNDEFINED depth attachment compatibility validation💡 Result:
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 22956
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 14282
Remove the mismatched depth attachment from the render state.
When the depth sample count differs from the selected pass sample count,
GetGraphicsPipelinecreates a pipeline with undefined depth and stencil formats. The draw path still passes the original depth state toAcquireRenderTargets, which creates a depth attachment.BeginRenderingthen submits that view.A pipeline with an undefined depth format is not compatible with a rendering instance that supplies a depth attachment. Derive one effective depth state and use it consistently for pipeline creation,
AcquireRenderTargets, andUpdateGraphicsDynamicState. Disable depth and stencil tests when the depth attachment is dropped. Keep the separateCopyDepthToColorpath on its existing state.Color-output masking does not remove the depth view, so color filtering does not fix this path.
@ -307,0 +310,4 @@z.z_read_base_addr);}if (has_stencil && !z.depth_view.stencil_write_disable &&z.stencil_write_base_addr != z.stencil_read_base_addr) {@coderabbitai[bot] on GitHub · 2026-10-16 04:29 UTC · original
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 33149
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 44752
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 10947
Gate base-mismatch checks on effective writes.
When
dc.z_enableis true anddc.z_write_enableis false,r.depth_write_enableis false and the normal attachment usesz_read_base_addr. The check still callsDepthFatalwhen the bases differ. The PM4 handlers accept read and write bases independently.Apply the same rule to stencil.
dc.stencil_enablealone does not prove a write because write masks and stencil operations can disable all writes. Check the effective write result, not onlystencil_write_disable.@ -307,0 +307,4 @@}if (!z.depth_view.depth_write_disable && z.z_write_base_addr != z.z_read_base_addr) {DepthFatal("depth write base 0x%08x differs from read base 0x%08x", z.z_write_base_addr,z.z_read_base_addr);@coderabbitai[bot] on GitHub · 2026-10-16 04:29 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use a 64-bit format for both base-address diagnostics.
The address fields are
uint64_t, but%xexpectsunsigned int. Passing these arguments throughDepthFataltovfprintfhas undefined behavior and can truncate the logged addresses. UsePRIx64for both messages.Also applies to: 314-315
@coderabbitai[bot] on GitHub · 2026-10-16 04:29 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
38264277-d88b-480d-bdac-cbc872b717dd📥 Commits
Reviewing files that changed from the base of the PR and between
a9525e8192and1d1430f44b.📒 Files selected for processing: 2
src/graphics/host_gpu/renderer/colorRenderTarget.cppsrc/graphics/host_gpu/renderer/depthRenderTarget.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
@Nmzik on GitHub · 2026-10-21 19:42 UTC · original
Superseded by
5f29374d5and7b7294aa0.Pull request closed