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

Support int type attribute/varying translation from es3 to es1 #75

Open
KaYaF opened this issue Sep 2, 2021 · 0 comments
Open

Support int type attribute/varying translation from es3 to es1 #75

KaYaF opened this issue Sep 2, 2021 · 0 comments
Assignees

Comments

@KaYaF
Copy link
Contributor

KaYaF commented Sep 2, 2021

If we convert a shader for es3 that contains int type attribute and varying to a shader for es1, we need a technique. This is because the es1 shader does not support int type attribute and varying variables.

An idea is to specify an attribute and varying as float types, and cast the values to int types, as shown below.

in float a_test;

int getTestAttr() {
  return int(a_test);
}

In this case, it may not be possible to get a large integer due to the precision of the float type, so the shader translator needs to output a warning to the console or file.

@KaYaF KaYaF self-assigned this Sep 2, 2021
@KaYaF KaYaF changed the title support int type attribute/varying translation from es3 to es1 Support int type attribute/varying translation from es3 to es1 Sep 9, 2021
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

1 participant