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

Incomplete Support for Preprocessor Directives #270

Open
code-with-parth opened this issue Jan 19, 2025 · 1 comment
Open

Incomplete Support for Preprocessor Directives #270

code-with-parth opened this issue Jan 19, 2025 · 1 comment

Comments

@code-with-parth
Copy link

Description:
The current implementation of the translator does not fully support all HLSL/Cg preprocessor directives (e.g., #ifdef, #elif, #undef). This results in translation failures or incorrect handling of conditional compilation blocks, which are essential for writing modular and reusable shader code.

Steps to Reproduce:

  1. Write an HLSL shader using a preprocessor directive such as #elif or #undef.

  2. Translate the shader using CrossGL.

  3. Observe that the translation fails or generates incorrect code.

Expected Behavior:
The translator should correctly interpret and translate all standard preprocessor directives to the target shading language.

Actual Behavior:
The translation either fails or skips conditional blocks, leading to broken or incomplete output shaders.

Environment Details:

OS: macOS Ventura 13.2

DirectX Version: 11

Python Version: 3.9

Additional Context:

The lexer.py and parser.py files currently handle basic directives (#define, #include, #ifdef), but directives like #elif and #undef are not supported.

This issue hinders developers from using flexible, conditional shader logic effectively.

@code-with-parth
Copy link
Author

@CrossGL-issue-bot assign me

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

No branches or pull requests

1 participant