From e17741a6cb3d2c61f3628d39e7cd57d015c27156 Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Mon, 30 Sep 2024 18:29:54 -0700
Subject: [PATCH] Render GPU: Only cycle on update if entire texture is
replaced
---
src/render/gpu/SDL_render_gpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/render/gpu/SDL_render_gpu.c b/src/render/gpu/SDL_render_gpu.c
index fef2e9782bfc0..2e8bb28e9ed9c 100644
--- a/src/render/gpu/SDL_render_gpu.c
+++ b/src/render/gpu/SDL_render_gpu.c
@@ -303,7 +303,8 @@ static bool GPU_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture,
tex_dst.h = rect->h;
tex_dst.d = 1;
- SDL_UploadToGPUTexture(cpass, &tex_src, &tex_dst, true);
+ bool cycle = texture->w == rect->w && texture->h == rect->h;
+ SDL_UploadToGPUTexture(cpass, &tex_src, &tex_dst, cycle);
SDL_EndGPUCopyPass(cpass);
SDL_ReleaseGPUTransferBuffer(renderdata->device, tbuf);