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

GLSL Struct initialization complicates MSL cross compilation #2098

Open
ld-kerley opened this issue Oct 30, 2024 · 2 comments
Open

GLSL Struct initialization complicates MSL cross compilation #2098

ld-kerley opened this issue Oct 30, 2024 · 2 comments

Comments

@ld-kerley
Copy link
Contributor

While looking at getting Masuo's Hextiling PR working #2094 for MSL, I discovered that GLSL and MSL differ in how structs are initialized.

I think its an easy refactor for the Hextiling PR, but noting this difference here, so we can investigate a more robust solution in the future.

Below is the problematic code from Masuo's PR.

HextileData tile_data = HextileData(
        st1, st2, st3,
        vec3(w1, w2, w3),
        trm1, trm2, trm3,
        ddx1, ddx2, ddx3,
        ddy1, ddy2, ddy3
    );

The workaround is to create the object and then initialize each member separately.

HextileData tile_data;

tile_data.coord1 = st1;
... 

But I can imagine cases where this might not be desirable.

@msuzuki-nvidia
Copy link
Contributor

I think no issues with the suggested change.

@ld-kerley
Copy link
Contributor Author

Thanks Masuo, for the Hextile PR I think we can roll with the refactor - I just wanted to log the issue here so we can remember to perhaps investigate a more robust solution moving forwards, or at least have the issue here for future people to discover if they need the same work around.

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

No branches or pull requests

2 participants