diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-22 16:23:25 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-22 16:23:25 +0100 |
| commit | b3c69d188943269769b7fee305f135faadcc60f2 (patch) | |
| tree | 34260ef2434652557e27443d665d2b180a2677cb /cnn_v3/tools/shaders.js | |
| parent | 159ca2ca19345515cdfebed9fd88646730492cd2 (diff) | |
fix(cnn_v3/tools): remove unused sampler binding from FULL_PACK_SHADER
WebGPU auto-reflects the BGL from the shader; a declared-but-unused sampler
binding is omitted from the layout, causing CreateBindGroup to reject it.
Removed binding 6 (sampler) entirely — all reads use textureLoad(). Renumbered
f0/f1 from 7/8 to 6/7 to match.
Diffstat (limited to 'cnn_v3/tools/shaders.js')
| -rw-r--r-- | cnn_v3/tools/shaders.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cnn_v3/tools/shaders.js b/cnn_v3/tools/shaders.js index d5b1fb4..a1b2929 100644 --- a/cnn_v3/tools/shaders.js +++ b/cnn_v3/tools/shaders.js @@ -252,9 +252,9 @@ const VIZ_U32=` }`; // Full G-buffer pack: assembles feat_tex0/feat_tex1 from individual G-buffer images. -// Bindings: albedo(0) normal(1) depth(2) matid(3) shadow(4) transp(5) sampler(6) f0(7) f1(8) +// Bindings: albedo(0) normal(1) depth(2) matid(3) shadow(4) transp(5) f0(6) f1(7) // All source textures are rgba8unorm (browser-loaded images, R channel for depth/matid/shadow/transp). -// Matches gbuf_pack.wgsl packing exactly so the CNN sees the same layout. +// Uses textureLoad() only (no sampler needed). Matches gbuf_pack.wgsl packing exactly. const FULL_PACK_SHADER=` @group(0) @binding(0) var albedo: texture_2d<f32>; @group(0) @binding(1) var normal: texture_2d<f32>; @@ -262,9 +262,8 @@ const FULL_PACK_SHADER=` @group(0) @binding(3) var matid: texture_2d<f32>; @group(0) @binding(4) var shadow: texture_2d<f32>; @group(0) @binding(5) var transp: texture_2d<f32>; -@group(0) @binding(6) var smp: sampler; -@group(0) @binding(7) var f0: texture_storage_2d<rgba32uint,write>; -@group(0) @binding(8) var f1: texture_storage_2d<rgba32uint,write>; +@group(0) @binding(6) var f0: texture_storage_2d<rgba32uint,write>; +@group(0) @binding(7) var f1: texture_storage_2d<rgba32uint,write>; fn ld(c:vec2i,d:vec2i)->f32{return textureLoad(depth,clamp(c,vec2i(0),d-vec2i(1)),0).r;} fn b2(tl:vec2i,d:vec2i)->vec3f{ var s=vec3f(0.); |
