From c499f79fe9349637ef9e40c9a75153e2ab8e91af Mon Sep 17 00:00:00 2001
From: Caleb Cornett <[EMAIL REDACTED]>
Date: Mon, 16 Sep 2024 17:55:27 -0500
Subject: [PATCH] GPU: Fix multisample texture usage validation
---
src/gpu/SDL_gpu.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c
index 29698506e590e..2c09f1671dff9 100644
--- a/src/gpu/SDL_gpu.c
+++ b/src/gpu/SDL_gpu.c
@@ -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;
}