mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-09 22:37:39 +08:00
GPU: Validate that 2D textures don't have layers (#15535)
(cherry picked from commit cbe3fbe9f3)
This commit is contained in:
committed by
Evan Hemsley
parent
a14da0d366
commit
7a827b145a
@@ -1258,6 +1258,11 @@ SDL_GPUTexture *SDL_CreateGPUTexture(
|
|||||||
SDL_assert_release(!"For any texture: num_levels must be >= 1");
|
SDL_assert_release(!"For any texture: num_levels must be >= 1");
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
if (createinfo->type == SDL_GPU_TEXTURETYPE_2D && createinfo->layer_count_or_depth != 1)
|
||||||
|
{
|
||||||
|
SDL_assert_release(!"2D textures must have a layer count of 1");
|
||||||
|
failed = true;
|
||||||
|
}
|
||||||
if ((createinfo->usage & SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ) && (createinfo->usage & SDL_GPU_TEXTUREUSAGE_SAMPLER)) {
|
if ((createinfo->usage & SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ) && (createinfo->usage & SDL_GPU_TEXTUREUSAGE_SAMPLER)) {
|
||||||
SDL_assert_release(!"For any texture: usage cannot contain both GRAPHICS_STORAGE_READ and SAMPLER");
|
SDL_assert_release(!"For any texture: usage cannot contain both GRAPHICS_STORAGE_READ and SAMPLER");
|
||||||
failed = true;
|
failed = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user