mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 03:48:14 +00:00
d3d11: Don't fail if there's no vertex data to upload (thanks, Martin!).
Fixes Bugzilla #4832.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user