diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-13 17:16:56 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-13 17:16:56 +0100 |
| commit | f6b3ea72a03850654b69986bc82bb249aaabe2e3 (patch) | |
| tree | 1f6c85b603462a661691854c1ce1e45a3dd1e142 /workspaces/main/shaders | |
| parent | f80869ba4378b82aa6ac28b19e0c55cbe340a48b (diff) | |
CNN v2: Fix WebGPU validation error in uniform buffer alignment
Fix two issues causing validation errors in test_demo:
1. Remove redundant pipeline creation without layout (static_pipeline_)
2. Change vec3<u32> to 3× u32 fields in StaticFeatureParams struct
WGSL vec3<u32> aligns to 16 bytes (std140), making struct 32 bytes,
while C++ struct was 16 bytes. Explicit fields ensure consistent layout.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'workspaces/main/shaders')
| -rw-r--r-- | workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl b/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl index 7039d96..35068a2 100644 --- a/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl +++ b/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl @@ -9,7 +9,9 @@ struct StaticFeatureParams { mip_level: u32, - padding: vec3<u32>, + padding0: u32, + padding1: u32, + padding2: u32, } @group(0) @binding(0) var input_tex: texture_2d<f32>; |
