From 3b1d28500629b8488863aeaba3203ad5c3118d5f Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 7 Feb 2026 18:50:40 +0100 Subject: feat(gpu): Systematize post-process bindings and enable vertex shader uniforms - Add PP_BINDING_* macros for standard post-process bind group layout - PP_BINDING_SAMPLER (0): Input texture sampler - PP_BINDING_TEXTURE (1): Input texture from previous pass - PP_BINDING_UNIFORMS (2): Custom uniforms buffer - Change uniforms visibility from Fragment-only to Vertex|Fragment - Enables dynamic geometry in vertex shaders (e.g., peak meter bar) - Replace all hardcoded binding numbers with macros in post_process_helper.cc - Update test_demo.cc to use systematic bindings - Benefits: All post-process effects can now access uniforms in vertex shaders Result: More flexible post-process effects, better code maintainability --- src/gpu/effects/post_process_helper.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gpu/effects/post_process_helper.h') diff --git a/src/gpu/effects/post_process_helper.h b/src/gpu/effects/post_process_helper.h index 1986ff3..45757cf 100644 --- a/src/gpu/effects/post_process_helper.h +++ b/src/gpu/effects/post_process_helper.h @@ -5,7 +5,13 @@ #include "gpu/gpu.h" +// Standard post-process bind group layout (group 0): +#define PP_BINDING_SAMPLER 0 // Sampler for input texture +#define PP_BINDING_TEXTURE 1 // Input texture (previous render pass) +#define PP_BINDING_UNIFORMS 2 // Custom uniforms buffer + // Helper to create a standard post-processing pipeline +// Uniforms are accessible to both vertex and fragment shaders WGPURenderPipeline create_post_process_pipeline(WGPUDevice device, WGPUTextureFormat format, const char* shader_code); -- cgit v1.2.3