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 Support for bitwise OR opeator(|) token in translator codegen frontend #107 (Same as PR #157) #168

Closed
wants to merge 6 commits into from

Conversation

mr-195
Copy link

@mr-195 mr-195 commented Sep 19, 2024

PR Description

New PR ( similar to PR #157 ) after resolving conflict with the main branch.

  • Feature: Added support for the Bitwise OR token (|) in the translator frontend, addressing issue Add translator support for Bitwise OR token #107. This ensures proper translation across the DirectX, Metal, and OpenGL backends.
  • Fix: Resolved a minor issue in crosstl/crosstl/src/translator/parser.py, where "ASSIGN_SHIFT_LEFT" and "ASSIGN_SHIFT_RIGHT" were mistakenly placed on the same line without a comma.
  • Maintenance: Updated .gitignore to remove unnecessary files from the project, streamlining the repository.

Related Issue

Close #107

shader Sample

shader OrTestShader {
    vertex {
        input vec3 position;
        output vec2 vUV;

        void main() {
            // Perform OR on the x and y components of the position
            vUV.x = float(int(position.x) | 3);  // OR with 3
            vUV.y = float(int(position.y) | 5);  // OR with 5
            gl_Position = vec4(position, 1.0);
        }
    }

    fragment {
        input vec2 vUV;
        output vec4 fragColor;

        void main() {
            // Use OR in fragment shader
            float result = float(int(vUV.x) | int(vUV.y));
            fragColor = vec4(result / 10.0, 1.0 - result / 10.0, 0.0, 1.0);
        }
    }
    }

Checklist

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

@mr-195
Copy link
Author

mr-195 commented Sep 19, 2024

Hi @samthakur587 Could you please try to merge this PR now. Thanks!

@samthakur587
Copy link
Contributor

hii @mr-195 your PR shows you have modified the 39 files . i guess you have pushed the code with pulling the latest changes can you please sync your branch and then push your changes .

@mr-195
Copy link
Author

mr-195 commented Sep 20, 2024

@samthakur587 can you check now?

@samthakur587
Copy link
Contributor

hii @mr-195 still the same . can we have a discord call tomorrow so we can see and fix this . ping me on discord if it's fine for you.

@CrossGL CrossGL deleted a comment from NripeshN Dec 26, 2024
@CrossGL CrossGL deleted a comment from NripeshN Dec 26, 2024
@CrossGL CrossGL deleted a comment from NripeshN Dec 26, 2024
Copy link

This pull request has been marked as stale because it has been inactive for more than 14 days. Please update this pull request or it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale label Jan 10, 2025
Copy link

This pull request has been automatically closed because it has been inactive for more than 14 days. Please reopen if you still intend to submit this pull request.

@github-actions github-actions bot closed this Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add translator support for Bitwise OR token
2 participants