CrossGL / crosstl

Translates native shader languages into CrossGL universal shader language and vice versa.
https://crossgl.net
Apache License 2.0
36 stars 39 forks source link

Add Assignment AND Operator Support #163

Open anshikavashistha opened 2 months ago

anshikavashistha commented 2 months ago

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

anshikavashistha commented 2 months ago

@samthakur587 PTAL

samthakur587 commented 1 month ago

hii @anshikavashistha can you please solve the merge conflict .