Repository navigation
fix(vulkan): declare t10 so the display resolve gets a pipeline - #116
Merged
Merged
Conversation
#112 gave the display resolve a second texture, the gamma ramp at t10. The Vulkan backend's one descriptor set lists the slots the renderer binds, and a shader using any other slot gets no pipeline, so its draws are skipped: the resolve -- the draw that puts each frame on screen -- has been skipped on every Vulkan host since #112. macOS, Linux and Android presented nothing, for every title, whether or not it sets a ramp; D3D11 has no such list. The log said so once per run ('a shader uses binding 26, which the descriptor set does not declare'). Found through Max Payne, which went black when its pin moved past #112.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #112, every title on a Vulkan host (macOS, Linux, Android) has shown a black window. Windows on D3D11 is unaffected.
Cause
#112 gave the display resolve a second texture, the title's gamma ramp at
t10. The resolve is the draw that copies each frame to the screen.The Vulkan backend has one descriptor set, and it lists exactly the texture slots the renderer binds:
t0–t3,t8andt9.build_pipelinerefuses any shader that uses a slot outside that list, so the shader gets no pipeline and its draws are skipped. That happened to the resolve on every frame, whether or not the title sets a gamma ramp, because the shader declarest10either way.The log reported it once per run:
[RHI] vulkan: a shader uses binding 26, which the descriptor set does not declare.Fix
Add slot 10 to
g_tex_slots. The comment above the list now says that a new slot must be added there at the same time as it is used in a shader.How it was found and checked
Max Payne went black when its toolkit pin moved past #112.
RECOMP_HLE_D3D8_DUMP) read the back buffer before the resolve, so they looked normal. The "MoltenVK swap-chain readback returns black" seen while working on feat(hle): the title's gamma ramp is applied at present #112 was very likely this bug too.Not checked: Linux and Android. They take the same code path.