Don't try to create a vbo if we aren't using any vertices

This commit is contained in:
Sam Lantinga 2021-12-14 09:32:05 -08:00
parent b7885abc44
commit b08e57e926
1 changed files with 36 additions and 34 deletions

View File

@ -1090,6 +1090,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti
return -1; return -1;
} }
if (vertices) {
/* upload the new VBO data for this set of commands. */ /* upload the new VBO data for this set of commands. */
vbo = data->vertexBuffers[vboidx]; vbo = data->vertexBuffers[vboidx];
if (data->vertexBufferSize[vboidx] < vertsize) { if (data->vertexBufferSize[vboidx] < vertsize) {
@ -1131,6 +1132,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "This error will not be logged again for this renderer."); SDL_LogError(SDL_LOG_CATEGORY_RENDER, "This error will not be logged again for this renderer.");
data->reportedVboProblem = SDL_TRUE; data->reportedVboProblem = SDL_TRUE;
} }
}
IDirect3DDevice9_SetStreamSource(data->device, 0, vbo, 0, sizeof (Vertex)); IDirect3DDevice9_SetStreamSource(data->device, 0, vbo, 0, sizeof (Vertex));