Skip to content

Commit

Permalink
d3d11: Don't fail if there's no vertex data to upload (thanks, Martin!).
Browse files Browse the repository at this point in the history
Fixes Bugzilla #4832.
  • Loading branch information
icculus committed Oct 26, 2019
1 parent 6dffc5d commit 1ce1364
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/render/direct3d11/SDL_render_d3d11.c
Expand Up @@ -1818,6 +1818,10 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer,
HRESULT result = S_OK;
const int vbidx = rendererData->currentVertexBuffer;

if (dataSizeInBytes == 0) {
return 0; /* nothing to do. */
}

if (rendererData->vertexBuffers[vbidx] && rendererData->vertexBufferSizes[vbidx] >= dataSizeInBytes) {
D3D11_MAPPED_SUBRESOURCE mappedResource;
result = ID3D11DeviceContext_Map(rendererData->d3dContext,
Expand Down

0 comments on commit 1ce1364

Please sign in to comment.