mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
gpu: Validate that CopyGPUTextureToTexture formats match
This commit is contained in:

committed by
Caleb Cornett

parent
f2866418d4
commit
9fcca83512
@@ -2359,6 +2359,13 @@ void SDL_CopyGPUTextureToTexture(
|
|||||||
SDL_assert_release(!"Destination texture cannot be NULL!");
|
SDL_assert_release(!"Destination texture cannot be NULL!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextureCommonHeader *srcHeader = (TextureCommonHeader *)source->texture;
|
||||||
|
TextureCommonHeader *dstHeader = (TextureCommonHeader *)destination->texture;
|
||||||
|
if (srcHeader->info.format != dstHeader->info.format) {
|
||||||
|
SDL_assert_release(!"Source and destination textures must have the same format!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
COPYPASS_DEVICE->CopyTextureToTexture(
|
COPYPASS_DEVICE->CopyTextureToTexture(
|
||||||
|
Reference in New Issue
Block a user