From d861142abdefe0a5f36dc3d17fd58857d94a152f Mon Sep 17 00:00:00 2001 From: Greggman Date: Tue, 3 Sep 2024 16:20:20 -0700 Subject: [PATCH] Improve cube-array error logging (#3931) Before: layer: 6 (undefined) After: layer: 6, cube-layer: 1 (+x) The issue was the layer is in 2d layers not cube layers Cube layers = six 2d layers. So, now it prints both, and it prints the correct face name (+x, -x, +y, ...) for the face when layer > 6 --- .../execution/expression/call/builtin/texture_utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts index 115777aa6fd1..532925091dc2 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts @@ -2346,7 +2346,12 @@ async function identifySamplePoints( const orderedTexelIndices: number[] = []; lines.push(''); const unSampled = layerEntries ? '' : 'un-sampled'; - lines.push(`layer: ${layer}${isCube ? ` (${kFaceNames[layer]})` : ''} ${unSampled}`); + if (isCube) { + const face = kFaceNames[layer % 6]; + lines.push(`layer: ${layer}, cube-layer: ${(layer / 6) | 0} (${face}) ${unSampled}`); + } else { + lines.push(`layer: ${unSampled}`); + } if (!layerEntries) { continue;