-
Notifications
You must be signed in to change notification settings - Fork 217
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
Conversation
@@ -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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ibgreen it depends on how the end-user names uniforms in their shader, so WGSL really. the previous implementation would only work for all-lower-case names like lighting
or project
, but would fail if the user named a uniform in camelCase like pointCloud
, for example. i figured it's not something we have direct control over for custom layers/shaders so probably need to be flexible and handle that case.
Needed for visgl/deck.gl#9531 in order to port point-cloud-layer to WebGPU.
Change List
pointCloud
)wgsl_reflect
as the version being used crashes when encoutering a switch statement with multiple comma-separatedcase
s when one case isdefault
.