Fix a bug in vitagles2 renderer

This commit is contained in:
Ivan Epifanov 2020-12-09 15:28:57 +03:00 committed by Sam Lantinga
parent 639323ea0d
commit 47c6270ece
1 changed files with 10 additions and 6 deletions

View File

@ -1202,6 +1202,9 @@ VITA_GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void
}
/* upload the new VBO data for this set of commands. */
/* NULL/zero vertices could happen SetRenderTarget is the first render command */
if (vertsize > 0 && vertices != NULL)
{
data->glBindBuffer(GL_ARRAY_BUFFER, vbo);
if (data->vertex_buffer_size[vboidx] < vertsize) {
data->glBufferData(GL_ARRAY_BUFFER, vertsize, vertices, GL_DYNAMIC_DRAW);
@ -1209,6 +1212,7 @@ VITA_GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void
} else {
data->glBufferSubData(GL_ARRAY_BUFFER, 0, vertsize, vertices);
}
}
/* cycle through a few VBOs so the GL has some time with the data before we replace it. */
data->current_vertex_buffer++;