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

No support variables in global scope when converting es shader to msl #6

Open
Mee-gu opened this issue Oct 19, 2018 · 0 comments
Open

Comments

@Mee-gu
Copy link

Mee-gu commented Oct 19, 2018

Here is a simple fragment shader:

vec3 redColor = vec3(1.0, 0.0, 0.0);

vec3 getColor()
{
    return redColor;
}
void main(void) {
    vec3 color = getColor();
    gl_FragColor = vec4(color, 1.0);
}

When we use the global variable redColor in getColor() method, after translated it to metal shader language, all variables defined in global scope will be skipped. It will make redColor undefined in getColor() method in msl:
float3 getColor () { return redColor; }

It is a bit complicate and will take more time to fix the issues, thus we don't take this into account for the time being.

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