GPU: Fix multisample texture usage validation

This commit is contained in:
Caleb Cornett 2024-09-16 17:55:27 -05:00
parent 926d143966
commit c499f79fe9

View File

@ -867,10 +867,11 @@ SDL_GPUTexture *SDL_CreateGPUTexture(
SDL_assert_release(!"For any texture: usage cannot contain both GRAPHICS_STORAGE_READ and SAMPLER");
failed = true;
}
if (createinfo->sample_count > 1 && (createinfo->usage & (SDL_GPU_TEXTUREUSAGE_SAMPLER |
SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ |
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ |
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE))) {
if (createinfo->sample_count > SDL_GPU_SAMPLECOUNT_1 &&
(createinfo->usage & (SDL_GPU_TEXTUREUSAGE_SAMPLER |
SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ |
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ |
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE))) {
SDL_assert_release(!"For multisample textures: usage cannot contain SAMPLER or STORAGE flags");
failed = true;
}