mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fix a bug in vitagles2 renderer
This commit is contained in:
parent
639323ea0d
commit
47c6270ece
@ -1202,12 +1202,16 @@ VITA_GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* upload the new VBO data for this set of commands. */
|
/* upload the new VBO data for this set of commands. */
|
||||||
data->glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
/* NULL/zero vertices could happen SetRenderTarget is the first render command */
|
||||||
if (data->vertex_buffer_size[vboidx] < vertsize) {
|
if (vertsize > 0 && vertices != NULL)
|
||||||
data->glBufferData(GL_ARRAY_BUFFER, vertsize, vertices, GL_DYNAMIC_DRAW);
|
{
|
||||||
data->vertex_buffer_size[vboidx] = vertsize;
|
data->glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||||
} else {
|
if (data->vertex_buffer_size[vboidx] < vertsize) {
|
||||||
data->glBufferSubData(GL_ARRAY_BUFFER, 0, vertsize, vertices);
|
data->glBufferData(GL_ARRAY_BUFFER, vertsize, vertices, GL_DYNAMIC_DRAW);
|
||||||
|
data->vertex_buffer_size[vboidx] = vertsize;
|
||||||
|
} 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. */
|
/* cycle through a few VBOs so the GL has some time with the data before we replace it. */
|
||||||
|
Loading…
Reference in New Issue
Block a user