From b0121b0d4415f10a9e0dc073dc4da2a4190a4184 Mon Sep 17 00:00:00 2001 From: Martin Valigursky Date: Thu, 23 Apr 2026 09:25:10 +0100 Subject: [PATCH] fix: avoid camera_params redefinition in pickPS (WGSL) Adds a CAMERAPLANES include guard around the camera_params uniform in the WGSL pickPS chunk, mirroring the fix applied to the GLSL version in #8640. Prevents duplicate definition errors when combined with other chunks that declare camera_params (e.g. linearizeDepth, screenDepth). --- src/scene/shader-lib/wgsl/chunks/common/frag/pick.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scene/shader-lib/wgsl/chunks/common/frag/pick.js b/src/scene/shader-lib/wgsl/chunks/common/frag/pick.js index 5d71ebedc1b..219e3ed245b 100644 --- a/src/scene/shader-lib/wgsl/chunks/common/frag/pick.js +++ b/src/scene/shader-lib/wgsl/chunks/common/frag/pick.js @@ -16,8 +16,10 @@ fn encodePickOutput(id: u32) -> vec4f { #ifdef DEPTH_PICK_PASS #include "floatAsUintPS" - uniform camera_params: vec4f; // x: 1/far, y: far, z: near, w: isOrtho - + #ifndef CAMERAPLANES + #define CAMERAPLANES + uniform camera_params: vec4f; // x: 1/far, y: far, z: near, w: isOrtho + #endif fn getPickDepth() -> vec4f { var linearDepth: f32; if (uniform.camera_params.w > 0.5) {