summaryrefslogtreecommitdiff
path: root/src/gpu/effects/post_process_helper.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-07 18:50:40 +0100
committerskal <pascal.massimino@gmail.com>2026-02-07 18:50:40 +0100
commit3b1d28500629b8488863aeaba3203ad5c3118d5f (patch)
treea55fe3c61682077d1717bde8dc8a719054a272d9 /src/gpu/effects/post_process_helper.h
parent01d3d4ecd33b74ffa8935a0a58079d59a3074700 (diff)
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
Diffstat (limited to 'src/gpu/effects/post_process_helper.h')
-rw-r--r--src/gpu/effects/post_process_helper.h6
1 files changed, 6 insertions, 0 deletions
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);