From c275436f565b28d7a301395c0d45c7f1085b5f18 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 9 Jan 2022 00:39:02 -0500 Subject: [PATCH] opengles2: Batching lines/points used wrong var for summing vertex counts. Fixed this in the vitagxm backend too, but I don't know what the state of that code is otherwise. Reference Issue #5061. --- src/render/opengles2/SDL_render_gles2.c | 4 ++-- src/render/vitagxm/SDL_render_vita_gxm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 3011c2e12..c38ee9723 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1205,7 +1205,7 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver break; /* can't go any further on this draw call, different blendmode copy up next. */ } else { finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += cmd->data.draw.count; + count += nextcmd->data.draw.count; } nextcmd = nextcmd->next; } @@ -1236,7 +1236,7 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ } else { finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += cmd->data.draw.count; + count += nextcmd->data.draw.count; } nextcmd = nextcmd->next; } diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index 761abe7c5..937701298 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -817,7 +817,7 @@ VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void * break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ } else { finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += cmd->data.draw.count; + count += nextcmd->data.draw.count; } nextcmd = nextcmd->next; }