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

Add Assignment AND Operator Support #163

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anshikavashistha
Copy link
Contributor

@anshikavashistha anshikavashistha commented Sep 18, 2024

PR Description

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

Related Issue

Close #112

shader Sample

shader ANDShader {
vertex {
input vec3 position;
output vec2 vUV;
void main() {
vUV = position.xy * 10.0;
vUV.x &= 3.0; // AND 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; // AND 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

@samthakur587 PTAL

@samthakur587
Copy link
Contributor

hii @anshikavashistha can you please solve the merge conflict .

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 AND token
2 participants