Skip to content

GLSLNodeBuilder: Fix texelFetch lod type.#33399

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev5
Apr 16, 2026
Merged

GLSLNodeBuilder: Fix texelFetch lod type.#33399
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev5

Conversation

@Mugen87

@Mugen87 Mugen87 commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Fixed #33394.

Description

The PR makes sure the lod parameter for the texelFetch() call is of type int.

We could also make the change below and change float to int.

const levelSnippet = levelNode ? levelNode.build( builder, 'float' ) : null;

However, textureSampleLevel() and textureLod() required their lod parameter as a float. So we need at least one type cast.

@Mugen87 Mugen87 added this to the r184 milestone Apr 16, 2026
@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 361.4
85.82
361.4
85.82
+0 B
+0 B
WebGPU 637.46
177.05
637.49
177.06
+28 B
+10 B
WebGPU Nodes 635.58
176.76
635.61
176.77
+28 B
+9 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 493.91
120.5
493.91
120.5
+0 B
+0 B
WebGPU 709.22
191.87
709.24
191.88
+28 B
+9 B
WebGPU Nodes 658.43
179.17
658.46
179.18
+28 B
+9 B

@Mugen87 Mugen87 merged commit 469d8e0 into mrdoob:dev Apr 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TSL textureLoad() with int(0) LOD generates texelFetch(..., 0.0) under WebGLBackend (GLSL2 compile error)

1 participant