Skip to content

Commit 9fcca83

Browse files
committed
gpu: Validate that CopyGPUTextureToTexture formats match
1 parent f286641 commit 9fcca83

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/gpu/SDL_gpu.c

+7
Original file line numberDiff line numberDiff line change
@@ -2359,6 +2359,13 @@ void SDL_CopyGPUTextureToTexture(
23592359
SDL_assert_release(!"Destination texture cannot be NULL!");
23602360
return;
23612361
}
2362+
2363+
TextureCommonHeader *srcHeader = (TextureCommonHeader *)source->texture;
2364+
TextureCommonHeader *dstHeader = (TextureCommonHeader *)destination->texture;
2365+
if (srcHeader->info.format != dstHeader->info.format) {
2366+
SDL_assert_release(!"Source and destination textures must have the same format!");
2367+
return;
2368+
}
23622369
}
23632370

23642371
COPYPASS_DEVICE->CopyTextureToTexture(

0 commit comments

Comments
 (0)