diff --git a/include/SDL3/SDL_gpu.h b/include/SDL3/SDL_gpu.h index fe2692fd2..c6402bbca 100644 --- a/include/SDL3/SDL_gpu.h +++ b/include/SDL3/SDL_gpu.h @@ -1,4 +1,4 @@ -/* +/* Simple DirectMedia Layer Copyright (C) 1997-2024 Sam Lantinga diff --git a/src/render/sdlgpu/SDL_render_gpu.c b/src/render/sdlgpu/SDL_render_gpu.c index af5f61dd4..cd286bb51 100644 --- a/src/render/sdlgpu/SDL_render_gpu.c +++ b/src/render/sdlgpu/SDL_render_gpu.c @@ -965,35 +965,23 @@ static bool GPU_RenderPresent(SDL_Renderer *renderer) } SDL_GPUTextureFormat swapchain_fmt = SDL_GetGPUSwapchainTextureFormat(data->device, renderer->window); + SDL_GPUBlitRegion src; + SDL_zero(src); + src.texture = data->backbuffer.texture; + src.w = data->backbuffer.width; + src.h = data->backbuffer.height; + + SDL_GPUBlitRegion dst; + SDL_zero(dst); + dst.texture = swapchain; + dst.w = swapchain_w; + dst.h = swapchain_h; + + SDL_BlitGPUTexture(data->state.command_buffer, &src, &dst, SDL_FLIP_NONE, SDL_GPU_FILTER_LINEAR, true); if (swapchain_w != data->backbuffer.width || swapchain_h != data->backbuffer.height || swapchain_fmt != data->backbuffer.format) { - SDL_GPUBlitRegion src; - SDL_zero(src); - src.texture = data->backbuffer.texture; - src.w = data->backbuffer.width; - src.h = data->backbuffer.height; - - SDL_GPUBlitRegion dst; - SDL_zero(dst); - dst.texture = swapchain; - dst.w = swapchain_w; - dst.h = swapchain_h; - - SDL_BlitGPUTexture(data->state.command_buffer, &src, &dst, SDL_FLIP_NONE, SDL_GPU_FILTER_LINEAR, true); SDL_ReleaseGPUTexture(data->device, data->backbuffer.texture); CreateBackbuffer(data, swapchain_w, swapchain_h, swapchain_fmt); - } else { - SDL_GPUTextureLocation src; - SDL_zero(src); - src.texture = data->backbuffer.texture; - - SDL_GPUTextureLocation dst; - SDL_zero(dst); - dst.texture = swapchain; - - SDL_GPUCopyPass *pass = SDL_BeginGPUCopyPass(data->state.command_buffer); - SDL_CopyGPUTextureToTexture(pass, &src, &dst, swapchain_w, swapchain_h, 1, true); - SDL_EndGPUCopyPass(pass); } // *** FIXME ***