Commit c24a896
D3D12: forget cached command list state after a driver callback
A driver callback hands the command buffer to native code the driver knows
nothing about. Streamline, running DLSS, rebinds descriptor heaps, the pipeline
state and the root signature inside that callback. D3D12 binds descriptor heaps
to the command list rather than to a draw, so the driver caches what it believes
is bound for the whole command buffer and sets the heaps only once. After the
callback that cache is a lie: the driver kept feeding handles from its own heap
to SetComputeRootDescriptorTable while Streamline's heap was bound, and the
usermode driver dereferenced out of bounds and crashed.
Only DLSS combined with SSIL reached it. SSIL copies the internal colour buffer
into its last frame texture, and nothing consumes that copy until the next
frame, so the graph is free to schedule those compute passes after the upscaling
callback. SSAO and SSR are pinned ahead of the upscale by their dependency
chains and never land behind it.
Add RenderingDeviceDriver::command_buffer_forget_cached_state(), a no-op for
drivers that cache nothing, and call it from the graph once every driver
callback returns. The D3D12 override clears the same state command_buffer_end()
already clears. Vulkan and FSR2 were never affected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KCbSdUNssPYFx8HD2TMD31 parent 6706902 commit c24a896
4 files changed
Lines changed: 18 additions & 0 deletions
File tree
- drivers/d3d12
- servers/rendering
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2823 | 2823 | | |
2824 | 2824 | | |
2825 | 2825 | | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
2826 | 2838 | | |
2827 | 2839 | | |
2828 | 2840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| 543 | + | |
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
462 | 466 | | |
463 | 467 | | |
464 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| 1145 | + | |
1145 | 1146 | | |
1146 | 1147 | | |
1147 | 1148 | | |
| |||
0 commit comments