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

Translator Support for Assignment OR Token #162

Merged

Conversation

anshikavashistha
Copy link
Contributor

@anshikavashistha anshikavashistha commented Sep 18, 2024

PR Description

This PR implements support for the Assignment OR token in the CrossGL project. The token is now properly translated across the DirectX, Metal, and OpenGL backends.

Related Issue

Close #113

shader Sample

shader ORShader {
vertex {
input vec3 position;
output vec2 vUV;
void main() {
vUV = position.xy * 10.0;
vUV.x |= 3.0; // OR assignment operator
gl_Position = vec4(position, 1.0);
}
}
fragment {
input vec2 vUV;
output vec4 fragColor;
void main() {
float noise = perlinNoise(vUV);
float height = noise * 10.0;
height |= 2.0; // OR assignment operator
vec3 color = vec3(height / 10.0, 1.0 - height / 10.0, 0.0);
fragColor = vec4(color, 1.0);
}
}
}

Checklist

  • Have you added the necessary tests?
  • Only modified the files mentioned in the related issue(s)?
  • Are all tests passing?

@anshikavashistha
Copy link
Contributor Author

PTAL @samthakur587

Copy link
Contributor

@samthakur587 samthakur587 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@samthakur587 samthakur587 merged commit d1997a3 into CrossGL:main Sep 19, 2024
36 checks passed
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

Successfully merging this pull request may close these issues.

Add translator support for Assignment OR token
2 participants