From 19c6afacd38bfff5d1ef6c90f23587d7977039a7 Mon Sep 17 00:00:00 2001
From: Ivan Vecera <[EMAIL REDACTED]>
Date: Thu, 18 Jun 2026 09:32:37 +0200
Subject: [PATCH] Fix solid_shader leak and incorrect sampler_count in
testgputext
The solid_shader GPU shader object was not released after pipeline
creation and the sampler_count was incorrectly set to 1 despite the
solid fragment shader using no sampler.
---
examples/testgputext.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/examples/testgputext.c b/examples/testgputext.c
index aceb9121..00d48492 100644
--- a/examples/testgputext.c
+++ b/examples/testgputext.c
@@ -346,7 +346,7 @@ int main(int argc, char *argv[])
SDL_GPUShader *vertex_shader = check_error_ptr(load_shader(context.device, VertexShader, 0, 1, 0, 0));
SDL_GPUShader *fragment_shader = check_error_ptr(load_shader(context.device, use_SDF ? PixelShader_SDF : PixelShader, 1, 0, 0, 0));
- SDL_GPUShader *solid_shader = check_error_ptr(load_shader(context.device, PixelShader_Solid, 1, 0, 0, 0));
+ SDL_GPUShader *solid_shader = check_error_ptr(load_shader(context.device, PixelShader_Solid, 0, 0, 0, 0));
SDL_GPUGraphicsPipelineCreateInfo pipeline_create_info = {
.target_info = {
@@ -403,6 +403,7 @@ int main(int argc, char *argv[])
SDL_ReleaseGPUShader(context.device, vertex_shader);
SDL_ReleaseGPUShader(context.device, fragment_shader);
+ SDL_ReleaseGPUShader(context.device, solid_shader);
SDL_GPUBufferCreateInfo vbf_info = {
.usage = SDL_GPU_BUFFERUSAGE_VERTEX,