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
WebGLRenderer: Add #pragma unroll_loop_start/end syntax. #18804
Conversation
Just for the record: It's necessary to update the docs of ShaderMaterial. There is a section that explains the usage of Besides,
|
The core shaders and example shaders all still have to be converted. I wanted to keep the initial PR small so it's easier to review and look at. It's not always clear to me when something will or won't get merged even when it's been mentioned in other threads so if I can save time by not writing docs and updating everything until it's clear everyone is happy with the approach I will. If this will definitely get merged I can update the remaining files in this PR. I'm just trying to save time for myself and you guys!
Yes this should replace that PR. |
Actually, it may be good to continue using #pragma unroll_loop_start
for ( int i = 0; i < 5; i ++ ) {
// nested blocks for days
}
#pragma unroll_loop_end |
@mrdoob I just changed the syntax to include |
Thanks! |
As mentioned in #18751 (comment), this PR replaces
#pragma unroll_loop
with#unroll_loop_start
and#unroll_loop_end
to denote the beginning and end of the loop.This logs a warning when
#pragma unroll_loop
is used and updates both the CSM shader and light_fragment_begin shader to demonstrate that it works.In another PR I can upgrade the rest of the shaders and the docs if this is accepted.