diff options
| author | skal <pascal.massimino@gmail.com> | 2026-01-31 17:05:15 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-01-31 17:05:15 +0100 |
| commit | a958c6ca8dd48f642570037df127a4b23c984d82 (patch) | |
| tree | 9f1a3293858c00cbce37c75e573de0149edbd3ec /src/gpu/gpu.h | |
| parent | 843de420978cc4c976a2b71cf13c940685df8f56 (diff) | |
feat: Multi-pass rendering architecture and effect stubs
Implements a post-processing pipeline using offscreen framebuffers. Adds stubs for MovingEllipse, ParticleSpray, GaussianBlur, Solarize, Distort, and ChromaAberration effects. Updates MainSequence to orchestrate the scene pass and post-processing chain.
Diffstat (limited to 'src/gpu/gpu.h')
| -rw-r--r-- | src/gpu/gpu.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index b0b08c9..dd4fbd7 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -6,6 +6,34 @@ #include <webgpu.h> +#include <cstring> // For strlen + +#if defined(DEMO_CROSS_COMPILE_WIN32) +// Windows (MinGW) using wgpu-native v0.19.4.1 +#include <webgpu/webgpu.h> +#include <webgpu/wgpu.h> +using WGPUStringView = const char *; +static inline const char *str_view(const char *str) { return str; } +static inline const char *label_view(const char *str) { return str; } +#else +// Native (macOS/Linux) using newer wgpu-native +#include <webgpu.h> +#include <wgpu.h> +static inline WGPUStringView str_view(const char *str) { + if (!str) return {nullptr, 0}; + return {str, strlen(str)}; +} +static inline WGPUStringView label_view(const char *str) { +#ifndef STRIP_ALL + if (!str) return {nullptr, 0}; + return {str, strlen(str)}; +#else + (void)str; + return {nullptr, 0}; +#endif +} +#endif + struct GLFWwindow; // Basic wrapper for WebGPU buffers @@ -31,7 +59,7 @@ struct RenderPass { uint32_t instance_count; }; -void gpu_init(GLFWwindow *window); +void gpu_init(GLFWwindow *window, int width, int height); void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat); #ifndef STRIP_ALL void gpu_simulate_until(float time); |
