From 6eddc0b982991a9628a67b3219935a1a82b63c81 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 22 Mar 2025 01:08:03 +1000 Subject: [PATCH] GPUDevice: Don't allow copy-resize between different formats That's a spec violation. --- src/util/gpu_device.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/gpu_device.cpp b/src/util/gpu_device.cpp index 114942c35..50d2bdc07 100644 --- a/src/util/gpu_device.cpp +++ b/src/util/gpu_device.cpp @@ -1297,7 +1297,9 @@ bool GPUDevice::ResizeTexture(std::unique_ptr* tex, u32 new_width, u const u32 copy_height = std::min(new_height, old_tex->GetHeight()); if (type == GPUTexture::Type::RenderTarget) ClearRenderTarget(new_tex.get(), 0); - CopyTextureRegion(new_tex.get(), 0, 0, 0, 0, old_tex, 0, 0, 0, 0, copy_width, copy_height); + + if (old_tex->GetFormat() == new_tex->GetFormat()) + CopyTextureRegion(new_tex.get(), 0, 0, 0, 0, old_tex, 0, 0, 0, 0, copy_width, copy_height); } } else if (preserve)