فهرست منبع

Render GPU: Only cycle on update if entire texture is replaced

cosmonaut 6 ماه پیش
والد
کامیت
e17741a6cb
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/render/gpu/SDL_render_gpu.c

+ 2 - 1
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);