From 0754c122c631d7024f4ee89088353be1e1cbca24 Mon Sep 17 00:00:00 2001 From: Bigfoot71 Date: Tue, 17 Mar 2026 14:02:33 +0100 Subject: [PATCH] fix vla issue with msvc - fill depth / fill color --- src/external/rlsw.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/external/rlsw.h b/src/external/rlsw.h index d5f2e2d84..81d4a54f1 100644 --- a/src/external/rlsw.h +++ b/src/external/rlsw.h @@ -2658,7 +2658,10 @@ static inline void sw_default_framebuffer_free(sw_default_framebuffer_t* fb) static inline void sw_framebuffer_fill_color(sw_texture_t *colorBuffer, const float color[4]) { - uint8_t pixel[SW_FRAMEBUFFER_COLOR_SIZE]; + // NOTE: MSVC doesn't support VLA, so we allocate the largest possible size + //uint8_t pixel[SW_FRAMEBUFFER_COLOR_SIZE]; + + uint8_t pixel[16]; SW_FRAMEBUFFER_COLOR_SET(pixel, color, 0); uint8_t *dst = (uint8_t *)colorBuffer->pixels; @@ -2695,7 +2698,10 @@ static inline void sw_framebuffer_fill_color(sw_texture_t *colorBuffer, const fl static inline void sw_framebuffer_fill_depth(sw_texture_t *depthBuffer, float depth) { - uint8_t pixel[SW_FRAMEBUFFER_DEPTH_SIZE]; + // NOTE: MSVC doesn't support VLA, so we allocate the largest possible size + //uint8_t pixel[SW_FRAMEBUFFER_DEPTH_SIZE]; + + uint8_t pixel[4]; SW_FRAMEBUFFER_DEPTH_SET(pixel, depth, 0); uint8_t *dst = (uint8_t *)depthBuffer->pixels;