From e152a3cedb70ba5a97e0f507a24b48876ddd0890 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 7 Mar 2020 13:59:42 -0800 Subject: [PATCH] direct3d: Don't attempt to create zero sized vertex buffer --- src/render/direct3d/SDL_render_d3d.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 50065a61c..932c18363 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1238,7 +1238,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti /* upload the new VBO data for this set of commands. */ vbo = data->vertexBuffers[vboidx]; - if (!vbo || (data->vertexBufferSize[vboidx] < vertsize)) { + if (data->vertexBufferSize[vboidx] < vertsize) { const DWORD usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY; const DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1; if (vbo) { @@ -1632,6 +1632,7 @@ D3D_Reset(SDL_Renderer * renderer) IDirect3DVertexBuffer9_Release(data->vertexBuffers[i]); } data->vertexBuffers[i] = NULL; + data->vertexBufferSize[i] = 0; } result = IDirect3DDevice9_Reset(data->device, &data->pparams);