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

oslc doesn't notice a violation of function output param rules #1416

Closed
lgritz opened this issue Sep 30, 2021 · 0 comments · Fixed by #1417
Closed

oslc doesn't notice a violation of function output param rules #1416

lgritz opened this issue Sep 30, 2021 · 0 comments · Fixed by #1417

Comments

@lgritz
Copy link
Collaborator

lgritz commented Sep 30, 2021

Pointed out by Lee, consider this shader:

void g(output float b) {
    b = 1;  // ok, since b is marked as output
}

void f(float a) {
    g(a);  // <--- should be disallowed, a is not output, but the arg of g() is output
}

shader test (output color Out_Color = 0)
{
    float x = 2;
    f(x);
    printf("%f\n", x);
    Out_Color = x;
}

oslc is missing a check somewhere, it should flag this as an error.

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

Successfully merging a pull request may close this issue.

1 participant