From d4440c0446c994c8fe246ba1a531f2847c0061e7 Mon Sep 17 00:00:00 2001
From: Caleb Cornett <[EMAIL REDACTED]>
Date: Thu, 13 Aug 2026 21:04:43 -0400
Subject: [PATCH] test: Fix MSAA support in testgpu_spinning_cube
---
test/testgpu_spinning_cube.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/test/testgpu_spinning_cube.c b/test/testgpu_spinning_cube.c
index 0391af5e54577..843d514001975 100644
--- a/test/testgpu_spinning_cube.c
+++ b/test/testgpu_spinning_cube.c
@@ -715,8 +715,6 @@ static void Render(SDL_Window *window, const int windownum)
color_target.store_op = SDL_GPU_STOREOP_RESOLVE;
color_target.texture = winstate->tex_msaa;
color_target.resolve_texture = winstate->tex_resolve;
- color_target.cycle = true;
- color_target.cycle_resolve_texture = true;
} else {
color_target.load_op = SDL_GPU_LOADOP_CLEAR;
color_target.store_op = SDL_GPU_STOREOP_STORE;
@@ -753,6 +751,13 @@ static void Render(SDL_Window *window, const int windownum)
/* Load the existing color target so we can blend with it */
color_target.load_op = SDL_GPU_LOADOP_LOAD;
+ if (render_state.sample_count > SDL_GPU_SAMPLECOUNT_1) {
+ /* Use the resolve texture for the sprite overlay */
+ color_target.texture = winstate->tex_resolve;
+ color_target.resolve_texture = NULL;
+ color_target.store_op = SDL_GPU_STOREOP_STORE;
+ }
+
pass = SDL_BeginGPURenderPass(cmd, &color_target, 1, NULL);
RenderSpriteOverlay(pass, &sprite_render_state, &winstate->sprite_state);
SDL_EndGPURenderPass(pass);