irradiance: use textureSampleLevel for WebGPU support (#11893)

# Objective

- Fixes #11879 

## Solution

- Use `textureSampleLevel` instead of `textureSample`

Co-authored-by: Griffin <33357138+DGriffin91@users.noreply.github.com>
This commit is contained in:
François 2024-02-16 14:35:16 +01:00 committed by GitHub
parent 9505f6e6a9
commit 9a2ce8e31b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,9 +42,9 @@ fn irradiance_volume_light(world_position: vec3<f32>, N: vec3<f32>) -> vec3<f32>
let uvw_y = uvw + vec3(0.0f, neg_offset.y, 1.0f / 3.0f); let uvw_y = uvw + vec3(0.0f, neg_offset.y, 1.0f / 3.0f);
let uvw_z = uvw + vec3(0.0f, neg_offset.z, 2.0f / 3.0f); let uvw_z = uvw + vec3(0.0f, neg_offset.z, 2.0f / 3.0f);
let rgb_x = textureSample(irradiance_volume_texture, irradiance_volume_sampler, uvw_x).rgb; let rgb_x = textureSampleLevel(irradiance_volume_texture, irradiance_volume_sampler, uvw_x, 0.0).rgb;
let rgb_y = textureSample(irradiance_volume_texture, irradiance_volume_sampler, uvw_y).rgb; let rgb_y = textureSampleLevel(irradiance_volume_texture, irradiance_volume_sampler, uvw_y, 0.0).rgb;
let rgb_z = textureSample(irradiance_volume_texture, irradiance_volume_sampler, uvw_z).rgb; let rgb_z = textureSampleLevel(irradiance_volume_texture, irradiance_volume_sampler, uvw_z, 0.0).rgb;
// Use Valve's formula to sample. // Use Valve's formula to sample.
let NN = N * N; let NN = N * N;