summaryrefslogtreecommitdiff
path: root/src/gpu/effects/flash_effect.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects/flash_effect.h')
-rw-r--r--src/gpu/effects/flash_effect.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gpu/effects/flash_effect.h b/src/gpu/effects/flash_effect.h
index 8241557..373b48b 100644
--- a/src/gpu/effects/flash_effect.h
+++ b/src/gpu/effects/flash_effect.h
@@ -15,12 +15,16 @@ struct FlashEffectParams {
};
// Uniform data sent to GPU shader
+// IMPORTANT: Must match WGSL struct layout with proper alignment
+// vec3<f32> in WGSL has 16-byte alignment, not 12-byte!
struct FlashUniforms {
- float flash_intensity;
- float intensity;
- float color[3]; // RGB flash color
- float _pad;
+ float flash_intensity; // offset 0
+ float intensity; // offset 4
+ float _pad1[2]; // offset 8-15 (padding for vec3 alignment)
+ float color[3]; // offset 16-27 (vec3 aligned to 16 bytes)
+ float _pad2; // offset 28-31
};
+static_assert(sizeof(FlashUniforms) == 32, "FlashUniforms must be 32 bytes for WGSL alignment");
class FlashEffect : public PostProcessEffect {
public: