Skip to content

fix(vulkan): declare t10 so the display resolve gets a pipeline - #116

Merged
phobos665 merged 1 commit into
mainfrom
fix/vulkan-gamma-ramp-binding
Nov 2, 2026
Merged

phobos665 merged 1 commit into
mainfrom
fix/vulkan-gamma-ramp-binding

Conversation

@phobos665

Copy link
Copy Markdown
Owner

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, t8 and t9. build_pipeline refuses 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 declares t10 either 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.

  • With the fix: the warning no longer appears, Max Payne runs at 60 fps with its gamma ramp applied, and the window shows the game again.
  • Why it went unnoticed: the frame dumps used in testing (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.

#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.
@phobos665
phobos665 merged commit a316171 into main Nov 2, 2026
5 of 7 checks passed
@phobos665
phobos665 deleted the fix/vulkan-gamma-ramp-binding branch November 2, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant