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

Fix PCSS with WebGL1 #5403

Merged
merged 1 commit into from Jun 16, 2023
Merged

Fix PCSS with WebGL1 #5403

merged 1 commit into from Jun 16, 2023

Conversation

GSterbrant
Copy link
Contributor

@GSterbrant GSterbrant commented Jun 16, 2023

PCSS wouldn't compile with WebGL1 due to fetching a uniform value through a function. Moving the uniform value fetch to directly in the loop fixed the issue.

Fixes #5397

@GSterbrant GSterbrant added bug area: graphics Graphics related issue labels Jun 16, 2023
@GSterbrant GSterbrant self-assigned this Jun 16, 2023
Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea what the rule is here being broken in WebGL1?

@mvaligursky mvaligursky merged commit 757979f into main Jun 16, 2023
7 checks passed
@mvaligursky mvaligursky deleted the fix-pcss-webgl1 branch June 16, 2023 10:15
@GSterbrant
Copy link
Contributor Author

Using an argument to sample from a uniform makes the compiler complain that the value must be constant. What they mean is probably known at compile time.

It is also known at compile time obviously but the compiler probably sees the function outside of the scope of the callee and assumes it can be called anywhere, making it assume the uniform fetch can't be guaranteed to be invariant, which is what provokes the error.

But the error is simply Index expression must be constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contact Hardening Shadow example fails to run on WebGL1
3 participants