Don't declare colorWriteEnable dynamic state on depth-only pipelines #160
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!160
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/160/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?
@Death-Whispers-U on GitHub · 2026-08-03 22:58 UTC · original
Death-Whispers-U:fix/color-write-enable-dynamic-state→main· +7 −1 · 1 files · 1 commits · merged 2026-08-08 06:21 UTCPipelines are created with
VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXTunconditionally on non-Apple platforms, but the draw path only callsvkCmdSetColorWriteEnableEXTwhen there is at least one color attachment (renderDraw.cpp:405).So a depth-only draw — a shadow pass or a depth prepass — reaches
vkCmdDrawIndexedwith the dynamic state declared and never set. That is whatVUID-vkCmdDrawIndexed-None-07749forbids:Why it shows up now
The launcher turns validation on by default (
vulkan_validation_enabled = trueinconfiguration.h), and the debug callback currently treats validation errors as fatal, so PAC-MAN WORLD Re-PAC dies a few seconds after launch. From the command line with--vulkan-validation falsethe same build runs fine, which is probably why this went unnoticed.Even without validation running, the draw is still out of spec — the value of colorWriteEnable is undefined at that point. This change is about the violation; whether a violation should end the process is a separate question.
Fix
Only declare the dynamic state when the pipeline has color attachments.
Both places read
state.color_countfrom the same draw (renderDraw.cpp:1057for pipeline creation,:1084for the dynamic params), so the two conditions now match instead of drifting apart.One file, 12 lines.
Testing
PAC-MAN WORLD Re-PAC with validation on:
Reproduce with:
Two other unrelated validation errors still show up in both runs. I left those alone.
@Crispy81 on GitHub · 2026-08-04 00:27 UTC · original
Interesting... I don't get that result. I've got both those settings ie - Shader and Vulkan validation turned on for that game, and I still get ingame.