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

fix: lighting WebGPU shaders #2353

Merged
merged 6 commits into from
Mar 29, 2025

Conversation

Kaapp
Copy link
Collaborator

@Kaapp Kaapp commented Mar 17, 2025

Needed for visgl/deck.gl#9531 in order to port point-cloud-layer to WebGPU.

Change List

  • Add missing WGSL source for gouraud material
  • Fix a typo in the lighting WGSL shader
  • Fix uniform bindings not being found when a uniform is named in camelCase (e.g. pointCloud)
  • Updated wgsl_reflect as the version being used crashes when encoutering a switch statement with multiple comma-separated cases when one case is default.

Kaapp and others added 4 commits March 17, 2025 00:30

Verified

This commit was signed with the committer’s verified signature.
Kaapp Chris Kapp

Verified

This commit was signed with the committer’s verified signature.
Kaapp Chris Kapp

Verified

This commit was signed with the committer’s verified signature.
Kaapp Chris Kapp
@Kaapp Kaapp requested review from felixpalmer and ibgreen March 20, 2025 10:34

Verified

This commit was signed with the committer’s verified signature.
Kaapp Chris Kapp
@@ -54,7 +54,8 @@ export function getShaderLayoutBinding(
): BindingDeclaration | null {
const bindingLayout = shaderLayout.bindings.find(
binding =>
binding.name === bindingName || `${binding.name}uniforms` === bindingName.toLocaleLowerCase()
binding.name === bindingName ||
`${binding.name.toLocaleLowerCase()}uniforms` === bindingName.toLocaleLowerCase()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Not completely sure I understand why we need this... Is it JS or WebGPU that is causing the issue. Regardless, no major objection, other than it often being better to fix issues at the source rather than loosening semantics.

@ibgreen ibgreen merged commit fae1e77 into visgl:master Mar 29, 2025
2 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.

None yet

2 participants