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

Improve preprocessor to allow for define value injection #7309

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jan 22, 2025

Improvement to Preprocessor to allow for defines starting with __INJECT_ to be injected into the processed text. This will be used during further shader refactoring, in order to remove manual shader code processing.

for example source code with defines:

        #define __INJECT_COUNT 2
        #define __INJECT_DECODE_SKYDOME decodeGamma

        for (int i = 0; i < __INJECT_COUNT; i++) {
            vec3 data = __INJECT_DECODE_SKYDOME(src);
        }

will generate code:

        for (int i = 0; i < 2; i++) {
            vec3 data = decodeGamma(src);
        }

@mvaligursky mvaligursky merged commit fb1ecb2 into main Jan 24, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-preprocess-injection branch January 24, 2025 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants