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

Add preprocessor for ShaderLab compiler #2059

Open
3 tasks
Sway007 opened this issue Mar 29, 2024 · 0 comments
Open
3 tasks

Add preprocessor for ShaderLab compiler #2059

Sway007 opened this issue Mar 29, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request medium priority Medium priority issue shader Shader related functions
Milestone

Comments

@Sway007
Copy link
Member

Sway007 commented Mar 29, 2024

The precessor should be capable of the following task:

  • support #include and #define macro expansion

    take the function-like macro expansion into account:

    #define saturate( a ) clamp( a, 0.0, 1.0 )
    edge cases and issues processing should be coherent with the glsl 100 specification
  • can interpret the expression of branch macro, e,g. #if, ifdef, ifndef, else, elif, endif
    #if defined(XXX) && YYY > 1.0 || ZZZ == 2
       ......
    #elif ...
      ......
    #endif
  • extract macros which have impact on the generated code (for engine use)

    not necessarily implemented in preprocessor, maybe can be done with another more light way

@Sway007 Sway007 self-assigned this Mar 29, 2024
@Sway007 Sway007 added enhancement New feature or request shader Shader related functions medium priority Medium priority issue labels Mar 29, 2024
@Sway007 Sway007 added this to the 1.3 milestone Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium priority Medium priority issue shader Shader related functions
Projects
Development

No branches or pull requests

1 participant