From 4aa40070ef6c58c24ac5f3bf30750058bd3bda38 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 1 Sep 2026 08:25:20 -0400 Subject: [PATCH] gpu: Return early when attempting to bind 0 samplers. This is a common occurrence for vertex shaders specifically, and allows backends to not have to handle this edge case every time. --- src/gpu/SDL_gpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c index 57e0c97d89..70a8656cc9 100644 --- a/src/gpu/SDL_gpu.c +++ b/src/gpu/SDL_gpu.c @@ -2090,6 +2090,10 @@ void SDL_BindGPUVertexSamplers( } } + if (num_bindings == 0) { + return; + } + RENDERPASS_DEVICE->BindVertexSamplers( RENDERPASS_COMMAND_BUFFER, first_slot, @@ -2197,6 +2201,10 @@ void SDL_BindGPUFragmentSamplers( } } + if (num_bindings == 0) { + return; + } + RENDERPASS_DEVICE->BindFragmentSamplers( RENDERPASS_COMMAND_BUFFER, first_slot,