summaryrefslogtreecommitdiff
path: root/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl
diff options
context:
space:
mode:
Diffstat (limited to 'workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl')
-rw-r--r--workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl9
1 files changed, 5 insertions, 4 deletions
diff --git a/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl b/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl
index 63fafa8..309e832 100644
--- a/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl
+++ b/workspaces/main/shaders/cnn_v2/cnn_v2_static.wgsl
@@ -33,17 +33,18 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
// Parametric features (p0-p3) - bilinear sample from specified mip level
// Use UV coordinates for bilinear interpolation
+ // Note: Use textureSampleLevel (not textureSample) in compute shaders
let uv = (vec2<f32>(coord) + 0.5) / vec2<f32>(dims);
var rgba: vec4<f32>;
if (params.mip_level == 0u) {
- rgba = textureSample(input_tex, linear_sampler, uv);
+ rgba = textureSampleLevel(input_tex, linear_sampler, uv, 0.0);
} else if (params.mip_level == 1u) {
- rgba = textureSample(input_tex_mip1, linear_sampler, uv);
+ rgba = textureSampleLevel(input_tex_mip1, linear_sampler, uv, 0.0);
} else if (params.mip_level == 2u) {
- rgba = textureSample(input_tex_mip2, linear_sampler, uv);
+ rgba = textureSampleLevel(input_tex_mip2, linear_sampler, uv, 0.0);
} else {
// Mip 3 or higher: use mip 2 as fallback
- rgba = textureSample(input_tex_mip2, linear_sampler, uv);
+ rgba = textureSampleLevel(input_tex_mip2, linear_sampler, uv, 0.0);
}
let p0 = rgba.r;