Commit 490c20f93f85a4e4275bdf96bcb8ffd7f266590c

Sam Lantinga 2022-10-09T09:57:55

d3d12: reset the vertex buffer size when it is released

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c
index 1e57b8e..90b79af 100644
--- a/src/render/direct3d12/SDL_render_d3d12.c
+++ b/src/render/direct3d12/SDL_render_d3d12.c
@@ -352,6 +352,7 @@ D3D12_ReleaseAll(SDL_Renderer * renderer)
 
         for (i = 0; i < SDL_D3D12_NUM_VERTEX_BUFFERS; ++i) {
             SAFE_RELEASE(data->vertexBuffers[i].resource);
+            data->vertexBuffers[i].size = 0;
         }
         
         data->swapEffect = (DXGI_SWAP_EFFECT) 0;