From f6b3ea72a03850654b69986bc82bb249aaabe2e3 Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 13 Feb 2026 17:16:56 +0100 Subject: CNN v2: Fix WebGPU validation error in uniform buffer alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix two issues causing validation errors in test_demo: 1. Remove redundant pipeline creation without layout (static_pipeline_) 2. Change vec3 to 3× u32 fields in StaticFeatureParams struct WGSL vec3 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 --- src/gpu/effects/cnn_v2_effect.cc | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src') 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] = {}; -- cgit v1.2.3