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
1 changed files with 5 additions and 4 deletions

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"); SDL_assert_release(!"For any texture: usage cannot contain both GRAPHICS_STORAGE_READ and SAMPLER");
failed = true; failed = true;
} }
if (createinfo->sample_count > 1 && (createinfo->usage & (SDL_GPU_TEXTUREUSAGE_SAMPLER | if (createinfo->sample_count > SDL_GPU_SAMPLECOUNT_1 &&
SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ | (createinfo->usage & (SDL_GPU_TEXTUREUSAGE_SAMPLER |
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ | SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ |
SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE))) { 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"); SDL_assert_release(!"For multisample textures: usage cannot contain SAMPLER or STORAGE flags");
failed = true; failed = true;
} }