direct3d: Don't attempt to create zero sized vertex buffer
authorCameron Gutman <aicommander@gmail.com>
Sat, 07 Mar 2020 13:59:42 -0800
changeset 135949b5e16574ea9
parent 13593 ea9492fc2eae
child 13595 36aabb2051e9
direct3d: Don't attempt to create zero sized vertex buffer
src/render/direct3d/SDL_render_d3d.c
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Sat Mar 07 13:17:28 2020 -0800
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Sat Mar 07 13:59:42 2020 -0800
     1.3 @@ -1238,7 +1238,7 @@
     1.4  
     1.5      /* upload the new VBO data for this set of commands. */
     1.6      vbo = data->vertexBuffers[vboidx];
     1.7 -    if (!vbo || (data->vertexBufferSize[vboidx] < vertsize)) {
     1.8 +    if (data->vertexBufferSize[vboidx] < vertsize) {
     1.9          const DWORD usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY;
    1.10          const DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1;
    1.11          if (vbo) {
    1.12 @@ -1632,6 +1632,7 @@
    1.13              IDirect3DVertexBuffer9_Release(data->vertexBuffers[i]);
    1.14          }
    1.15          data->vertexBuffers[i] = NULL;
    1.16 +        data->vertexBufferSize[i] = 0;
    1.17      }
    1.18  
    1.19      result = IDirect3DDevice9_Reset(data->device, &data->pparams);