-
Notifications
You must be signed in to change notification settings - Fork 39
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
Added translator support for Modulus token #136
base: main
Are you sure you want to change the base?
Conversation
"LESS_THAN": "<", | ||
"GREATER_THAN": ">", | ||
"ASSIGN_ADD": "+=", | ||
"ASSIGN_SUB": "-=", | ||
"ASSIGN_MUL": "*=", | ||
"ASSIGN_DIV": "/=", | ||
"ASSIGN_MOD": "%=", | ||
"LESS_EQUAL": "<=", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have working on MOD
operator so only add changes for MOD
don't add Assign_MOD
here someone else might working on this task . or you can assign this task also to yourself and mention in PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll make the changes and only include the modifications for the MOD operator in the PR
examples/PerlinNoise.cgl
Outdated
@@ -24,6 +24,9 @@ shader PerlinNoise { | |||
float height = noise * 10.0; | |||
vec3 color = vec3(height / 10.0, 1.0 - height / 10.0, 0.0); | |||
fragColor = vec4(color, 1.0); | |||
|
|||
int color2 = 1200 % 10; //MOD test | |||
color2 %= 10; //ASSIGN_MOD test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a demo shader file do not change anything here . write tests only at tests/test_translator/test_codegen/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! I won't make any changes to the demo shader file.
Thanks for the clarification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add tests also for you changes
"ASSIGN_ADD", | ||
"ASSIGN_SUB", | ||
"ASSIGN_MUL", | ||
"ASSIGN_DIV", | ||
"ASSIGN_AND", | ||
"ASSIGN_OR", | ||
"ASSIGN_XOR", | ||
"ASSIGN_MOD", | ||
"BITWISE_SHIFT_RIGHT", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you removed the Assign_MOD
no need to remove it your task it to just add MOD
support at translator frontend.
hii @vishalghige43 can you please fix this and also solve the merge conflict . |
ok,I'll complete it today. |
PR Description
Added support for the modulus operator (
%
) and the assignment modulus operator (%=
) in the CGL translator.Related Issue
Resolves #116
Working on adding modulus support to the backend.
Shader Sample
This is the
PerlinNoise.cgl
example code for testing the modulus operator (%
) and assignment modulus operator (%=
):Checklist