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

Adjusted syntax of variables the preprocessor uses for injection #7386

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Feb 27, 2025

use curly brackets around the define variable name to mark it for injection into shader code (we resolve it before passing it to platform compilers)

Before, the define had to be named

define _INJECT_COUNT 4

and the code using it would be

for (int i = 0; i < _INJECT_COUNT; i++)

now we have

define {COUNT} 4

and the code using it would be

for (int i = 0; i < {COUNT}; i++)

Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks a lot neater <3

@mvaligursky mvaligursky merged commit 08eeea6 into main Feb 27, 2025
7 checks passed
@mvaligursky mvaligursky deleted the mv-preprocessor-replace branch February 27, 2025 13:44
@LeXXik
Copy link
Contributor

LeXXik commented Feb 27, 2025

Does it allow spaces between the variable name and curly braces?

@mvaligursky
Copy link
Contributor Author

It does not, and will not.

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.

3 participants