d3d12: serve the console unbounded sampler heap as a sampler heap #580

Closed
csj0oe wants to merge 1 commit from upstream-pr/580 into main
csj0oe commented 2026-11-30 07:48:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T07:48:45Z.


What

The title creates a descriptor heap of guest type 4. The host does not know that type: vkd3d logs Unhandled type 0x4 and answers 0 to the increment query, so every descriptor in the heap would share one slot.

  • The console's unbounded sampler heap is defined in our own words from that observation: its descriptors use the sampler heap's stride.
  • guest_increment_size and create_heap translate guest type 4 to the sampler heap for the host, and keep the guest desc for GetDesc and SetDescriptorHeaps.
  • Types 0-3 are unchanged.

Tests

  • Failing first on origin/main: vkd3d logs Unhandled type 0x4, and the test fails with the unbounded sampler heap reported no increment (0).
  • After: the increment is nonzero and equals the type-1 sampler increment, CreateDescriptorHeap returns S_OK, GetDesc().Type is 4, and the native increment is nonzero.
  • Full D3D12 unit binary: 462 passed under GE-Proton on an RX 7600.

Not run

NVIDIA, and the Lanes/d3d12 GPU suites that CONTRIBUTING asks for on a runtime/d3d12 change. The hardware test above is the direct check for this path.

<!-- greyfinch-sync:brcly/TuxBox:issue:5561196050 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/580). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-30T07:48:45Z. --- ## What The title creates a descriptor heap of guest type 4. The host does not know that type: vkd3d logs `Unhandled type 0x4` and answers 0 to the increment query, so every descriptor in the heap would share one slot. - The console's unbounded sampler heap is defined in our own words from that observation: its descriptors use the sampler heap's stride. - `guest_increment_size` and `create_heap` translate guest type 4 to the sampler heap for the host, and keep the guest `desc` for `GetDesc` and `SetDescriptorHeaps`. - Types 0-3 are unchanged. ## Tests - Failing first on `origin/main`: vkd3d logs `Unhandled type 0x4`, and the test fails with `the unbounded sampler heap reported no increment` (0). - After: the increment is nonzero and equals the type-1 sampler increment, `CreateDescriptorHeap` returns S_OK, `GetDesc().Type` is 4, and the native increment is nonzero. - Full D3D12 unit binary: 462 passed under GE-Proton on an RX 7600. ## Not run NVIDIA, and the Lanes/d3d12 GPU suites that `CONTRIBUTING` asks for on a `runtime/d3d12` change. The hardware test above is the direct check for this path.
brcly commented 2026-11-30 09:49:28 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T09:49:28Z.


Thanks. I checked this against our boots before deciding, and I'm holding it for now, because the claim it rests on isn't shown yet.

What our logs show. Each boot has exactly one Unhandled type 0x4, and it comes from d3d12_device_get_descriptor_handle_increment_size, right after the device is created. So the title asks for the increment of type 4. There's no sign it creates a type-4 heap: main answers E_NOTIMPL to that today, and I'd expect the title to fail or log something if it did, yet the boot carries on. The test creates the heap itself, so it shows the mapping works, not that the title needs it.

Why that matters. Once the type has a heap behind it, the title starts using it, and the sampler mapping is a guess at what type 4 means:

  • If the title binds a type-4 heap and an ordinary sampler heap together, the host gets two sampler heaps in one SetDescriptorHeaps call, which is invalid.
  • Which heap a sampler table in a root signature then reads from is undefined.

The only change in title behaviour we'd actually see today is that its increment query returns 32 instead of 0, and we don't know what it does with that.

What would move this forward:

  1. A trace from a real boot showing the title calling CreateDescriptorHeap with type 4: its flags, its size, and what main returns.
  2. What the title then does with it, including whether it binds it and next to which heaps.
  3. If the title only ever queries the increment, say what goes wrong with the 0 it gets today. If nothing does, there's no fault to fix yet.
<!-- greyfinch-sync:brcly/TuxBox:comment:7274734762 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/580#issuecomment-7274734762). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T09:49:28Z. --- Thanks. I checked this against our boots before deciding, and I'm holding it for now, because the claim it rests on isn't shown yet. **What our logs show.** Each boot has exactly one `Unhandled type 0x4`, and it comes from `d3d12_device_get_descriptor_handle_increment_size`, right after the device is created. So the title *asks for the increment* of type 4. There's no sign it *creates* a type-4 heap: main answers `E_NOTIMPL` to that today, and I'd expect the title to fail or log something if it did, yet the boot carries on. The test creates the heap itself, so it shows the mapping works, not that the title needs it. **Why that matters.** Once the type has a heap behind it, the title starts using it, and the sampler mapping is a guess at what type 4 means: - If the title binds a type-4 heap *and* an ordinary sampler heap together, the host gets two sampler heaps in one `SetDescriptorHeaps` call, which is invalid. - Which heap a sampler table in a root signature then reads from is undefined. The only change in title behaviour we'd actually see today is that its increment query returns 32 instead of 0, and we don't know what it does with that. **What would move this forward:** 1. A trace from a real boot showing the title calling `CreateDescriptorHeap` with type 4: its flags, its size, and what main returns. 2. What the title then does with it, including whether it binds it and next to which heaps. 3. If the title only ever queries the increment, say what goes wrong with the 0 it gets today. If nothing does, there's no fault to fix yet.
csj0oe commented 2026-11-30 10:10:25 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T10:10:25Z.


Closing. You are right that the increment query is the only evidence, and a log line is not the answer you asked for. If a traced boot shows the title calling CreateDescriptorHeap with type 4 and what it does with the result, the trace belongs in a PR that fixes the behaviour, not in one that observes it. Branch kept.

<!-- greyfinch-sync:brcly/TuxBox:comment:7275228608 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/580#issuecomment-7275228608). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-30T10:10:25Z. --- Closing. You are right that the increment query is the only evidence, and a log line is not the answer you asked for. If a traced boot shows the title calling `CreateDescriptorHeap` with type 4 and what it does with the result, the trace belongs in a PR that fixes the behaviour, not in one that observes it. Branch kept.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!580
No description provided.