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 /src/gpu/effects | |
| 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 'src/gpu/effects')
| -rw-r--r-- | src/gpu/effects/cnn_v2_effect.cc | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/gpu/effects/cnn_v2_effect.cc b/src/gpu/effects/cnn_v2_effect.cc index 566686e..5e38f13 100644 --- a/src/gpu/effects/cnn_v2_effect.cc +++ b/src/gpu/effects/cnn_v2_effect.cc @@ -233,18 +233,6 @@ void CNNv2Effect::create_pipelines() { WGPUShaderModuleDescriptor shader_desc = {}; shader_desc.nextInChain = &wgsl_src.chain; - WGPUShaderModule static_module = wgpuDeviceCreateShaderModule(ctx_.device, &shader_desc); - if (!static_module) { - return; - } - - WGPUComputePipelineDescriptor pipeline_desc = {}; - pipeline_desc.compute.module = static_module; - pipeline_desc.compute.entryPoint = str_view("main"); - - static_pipeline_ = wgpuDeviceCreateComputePipeline(ctx_.device, &pipeline_desc); - wgpuShaderModuleRelease(static_module); - // Create bind group layout for static features compute // Bindings: 0=input_tex, 1=input_mip1, 2=input_mip2, 3=depth_tex, 4=output, 5=params WGPUBindGroupLayoutEntry bgl_entries[6] = {}; |
