mirror of https://github.com/encounter/SDL.git
d3d11: Don't fail if there's no vertex data to upload (thanks, Martin!).
Fixes Bugzilla #4832.
This commit is contained in:
parent
6dffc5d461
commit
1ce1364b29
|
@ -1818,6 +1818,10 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer,
|
||||||
HRESULT result = S_OK;
|
HRESULT result = S_OK;
|
||||||
const int vbidx = rendererData->currentVertexBuffer;
|
const int vbidx = rendererData->currentVertexBuffer;
|
||||||
|
|
||||||
|
if (dataSizeInBytes == 0) {
|
||||||
|
return 0; /* nothing to do. */
|
||||||
|
}
|
||||||
|
|
||||||
if (rendererData->vertexBuffers[vbidx] && rendererData->vertexBufferSizes[vbidx] >= dataSizeInBytes) {
|
if (rendererData->vertexBuffers[vbidx] && rendererData->vertexBufferSizes[vbidx] >= dataSizeInBytes) {
|
||||||
D3D11_MAPPED_SUBRESOURCE mappedResource;
|
D3D11_MAPPED_SUBRESOURCE mappedResource;
|
||||||
result = ID3D11DeviceContext_Map(rendererData->d3dContext,
|
result = ID3D11DeviceContext_Map(rendererData->d3dContext,
|
||||||
|
|
Loading…
Reference in New Issue