Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes: Add enableExtension() Method to GLSLNodeBuilder #28952

Merged
merged 5 commits into from
Jul 30, 2024

Conversation

cmhhelgeson
Copy link
Contributor

@cmhhelgeson cmhhelgeson commented Jul 24, 2024

Related issue: #28915

Create a getExtension() function that allows for the conditional application of a GLSL extension when necessary to access a given feature within WebGPURenderer's webgl-fallback.

Example implementation:

enableClipDistances() {

    const extensions = this.renderer.backend.extensions;

    if ( extensions.has( 'WEBGL_clip_cull_distance' ) ) {

        extensions.get( 'WEBGL_clip_cull_distance' );

	this.getExtension( 'GL_ANGLE_clip_cull_distance', 'enable' );

    }

}

Copy link

github-actions bot commented Jul 24, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
684 kB (169.4 kB) 684 kB (169.4 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
460.9 kB (111.2 kB) 460.9 kB (111.2 kB) +0 B

@cmhhelgeson cmhhelgeson marked this pull request as ready for review July 24, 2024 18:00
@cmhhelgeson cmhhelgeson changed the title Nodes: Add getExtension() Method to GLSLNodeBuilder Nodes: Add enableExtension() Method to GLSLNodeBuilder Jul 26, 2024
@Mugen87 Mugen87 added this to the r168 milestone Jul 29, 2024
@Mugen87 Mugen87 merged commit 2d335b7 into mrdoob:dev Jul 30, 2024
12 checks passed
@cmhhelgeson cmhhelgeson deleted the glsl_node_get_extension branch July 30, 2024 19:48
@RenaudRohlinger
Copy link
Collaborator

This PR breaks the webgpu_mesh_batch example in the WebGL backend.

@cmhhelgeson
Copy link
Contributor Author

cmhhelgeson commented Aug 9, 2024

This PR breaks the webgpu_mesh_batch example in the WebGL backend.

Shader stage is being passed in as null for the GL_ANGLE_Multi_Draw extension, which prevents the extension from being written in the vertex stage. I'll push in a fix.

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.

3 participants