Commit 443da4e
Fix lighting volume WGSL depth texture binding
LightingVolume binds the shadow generator's shadow map
depthStencilTexture - a depth-format texture - as the shadowMap input of
the lightingVolume compute shader. Declare that binding as
texture_depth_2d instead of texture_2d<f32>, and drop the .r swizzle on
the textureLoad result since textureLoad on texture_depth_2d returns a
scalar f32. The loaded value is the same depth that .r previously
carried, so far-plane fitting results are unchanged.
This completes the compute depth sample-type support introduced in
PR BabylonJS#18460: _GetComputeTextureSampleType classifies this texture as bind
group layout sampleType "depth", and WebGPU validation requires a
texture_depth_2d WGSL declaration for a "depth" layout entry. With the
previous texture_2d<f32> declaration, createComputePipeline fails
validation (observed in Chromium and wgpu-native) as soon as the
lighting volume compute shaders run with an explicit pipeline layout.
The change is also safe with the default auto layout: texture_depth_2d
derives sampleType "depth", which is valid for the depth-aspect view
Babylon binds, so behavior is identical there.
This came from the Hill Valley GLTF/NativeXR AR Portal validation pass.
(cherry picked from commit a81ccfb)1 parent 11ae68e commit 443da4e
1 file changed
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments