Commit 72cb324
committed
gfx/d3d10,d3d11,d3d12: Restore sprite-pipeline state before gfx_widgets_frame
When an onscreen overlay was active, gfx_widgets (the fast-forward
indicator, FPS counter, achievement popups, load-progress bars,
etc.) silently rendered nothing on d3d10/d3d11/d3d12. Same symptom
across all three backends, same root cause: d3dN_render_overlay
clobbers render state that gfx_widgets_frame relies on, and the
state isn't restored before the widget draw.
Specifically, the overlay render path:
- Binds overlays.vbo (d3d10/d3d11) / overlays.vbo_view (d3d12)
as the IA-stage vertex buffer.
- Sets frame.viewport / frame.scissorRect when the overlay is
not fullscreen (i.e. clamped to the game viewport, not the
full screen).
- On d3d12, also leaves sprites.pipe_blend bound — fine for SDR,
but the OSD-msg block immediately below selects pipe_blend_hdr
in HDR modes, and widgets need to follow the same selection.
gfx_display_d3dN_draw (the entry point widgets use) writes its
sprite vertices into sprites.vbo via Map(), then issues a Draw()
that reads from whatever vbo is currently bound. After an
overlay, that's overlays.vbo — so the GPU pulls vertices from the
wrong buffer at the wrong stride and the result is invisible
geometry, even though the widget state machine has run normally
and the sprite buffer contents are correct. Widgets without an
overlay work because nothing has clobbered the binding the menu
path or the post-frame setup left in place.
Restore the sprite-pipeline state at the top of each widget block,
mirroring the OSD-msg block that follows the widget block in each
of these drivers (which already does this and works for the same
reason):
- d3d10: viewport, blend state, sprites.vbo.
- d3d11: viewport, blend state, sprites.vbo (the existing
viewport-only restore was only a partial fix).
- d3d12: PSO (HDR-aware), viewport, scissor rect, sprites.vbo_view.
Vulkan and gl1 don't hit this because their overlay render paths
either don't share input bindings with widgets (separate command
buffers / fixed-function state) or they happen to set up widget
state from scratch on every frame.
Reported by users of the Steam Deck / Windows community on builds
where overlay + widgets are both enabled. Companion to 7d6477b
which fixed the analogous (but different-mechanism — widgets
weren't being rendered at all) bug on d3d8.1 parent c82db9f commit 72cb324
3 files changed
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3343 | 3343 | | |
3344 | 3344 | | |
3345 | 3345 | | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
3346 | 3370 | | |
| 3371 | + | |
3347 | 3372 | | |
3348 | 3373 | | |
3349 | 3374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4746 | 4746 | | |
4747 | 4747 | | |
4748 | 4748 | | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
4749 | 4763 | | |
| 4764 | + | |
| 4765 | + | |
| 4766 | + | |
| 4767 | + | |
| 4768 | + | |
4750 | 4769 | | |
4751 | 4770 | | |
4752 | 4771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5796 | 5796 | | |
5797 | 5797 | | |
5798 | 5798 | | |
| 5799 | + | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
| 5805 | + | |
| 5806 | + | |
| 5807 | + | |
| 5808 | + | |
| 5809 | + | |
| 5810 | + | |
| 5811 | + | |
| 5812 | + | |
| 5813 | + | |
| 5814 | + | |
| 5815 | + | |
| 5816 | + | |
| 5817 | + | |
| 5818 | + | |
| 5819 | + | |
| 5820 | + | |
| 5821 | + | |
| 5822 | + | |
| 5823 | + | |
| 5824 | + | |
5799 | 5825 | | |
| 5826 | + | |
5800 | 5827 | | |
5801 | 5828 | | |
5802 | 5829 | | |
| |||
0 commit comments