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

chore(shadertools): Support boolean shader defines only (v9.2) #2190

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Aug 19, 2024

For #

  • Proposal for luma.gl API change, defines: Record<string, number, boolean> => defines: Record<string, boolean>

Background

  • See discussion in shadertools: PBR module using UBO #2173 (comment)
  • WGSL doesn't have a preprocessor, we have a simple #ifdef/#endif processor in shadertools, but no interest in making it more full featured (e.g. support text replacement, #if defined(...) etc.
  • WGSL has @override constants for scalar values, that can be set at Pipeline creation "modifying" an already compiled shader. Suggest we add a new constants or overrides section for numeric values that takes advantage of this on WebGPU.
  • For string valued defines, we already have an injection system, let's rely on that.

Change List

  • defines can only have boolean values.

@ibgreen ibgreen marked this pull request as ready for review August 20, 2024 12:16
@ibgreen ibgreen changed the title chore(shadertools): Support boolean shader defines only chore(shadertools): Support boolean shader defines only (v9.2) Sep 7, 2024
@ibgreen ibgreen changed the base branch from master to 9.2-dev September 7, 2024 23:53
@ibgreen ibgreen merged commit 47db71d into 9.2-dev Sep 8, 2024
2 checks passed
@ibgreen ibgreen deleted the ib/boolean-defines branch September 8, 2024 01:12
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.

1 participant