Commit fae7936
committed
D3D8: Route texture unload through video thread when threaded video active
Mirrors the fix for the D3D9 drivers. d3d8_load_texture already
routes through video_thread_texture_handle via
d3d8_video_texture_load_wrap_d3d, but d3d8_unload_texture called
IDirect3DTexture8_Release directly on the caller's thread.
Under threaded video, the video thread runs d3d8_frame and may
have draw calls pending that reference the texture. Releasing
the texture's refcount from the main thread while the video
thread is using it can cause the D3D8 runtime to free the
underlying resource before the pending draws complete.
Fix: add d3d8_video_texture_unload_wrap_d3d and dispatch through
video_thread_texture_handle when threaded video is active,
matching the existing load pattern.
Same class of race already addressed in D3D12, Vulkan, D3D10,
D3D11, D3D9 Cg, and D3D9 HLSL. With this commit, every
D3D-family driver in the codebase serialises texture load and
unload on the video thread under threaded video.
No behavioural change on non-threaded video.1 parent b0c7881 commit fae7936
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2130 | 2130 | | |
2131 | 2131 | | |
2132 | 2132 | | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
2133 | 2144 | | |
2134 | 2145 | | |
2135 | 2146 | | |
2136 | 2147 | | |
2137 | 2148 | | |
2138 | 2149 | | |
2139 | 2150 | | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
2140 | 2163 | | |
2141 | 2164 | | |
2142 | 2165 | | |
| |||
0 commit comments