-
Notifications
You must be signed in to change notification settings - Fork 61
Do explicit uint
casting in GLSL operations
#1613
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
Conversation
75da0b2
to
6adf2d9
Compare
I confirm it fixes #1611: |
6adf2d9
to
ecb4ec2
Compare
Curiously the last commit (
When running with this environment: export MESA_GL_VERSION_OVERRIDE='3.1'
export MESA_GLSL_VERSION_OVERRIDE='140'
export MESA_EXTENSION_OVERRIDE='-GL_ARB_gpu_shader5' And this breaks dynamic lighting. But the last too commits (this one and the one before it) are totally optional. So without those commits making things cleaner, it would work anyway. |
ecb4ec2
to
a0b4a73
Compare
a0b4a73
to
6dbea2b
Compare
6dbea2b
to
7d0edc2
Compare
uint
casting in GLSL operations
I removed all commits that were not meant to fix the #1611 bug. Fixes for other bugs found when debugging this are now tracked there: Further improvements (like passing some variables as |
This could potentially fix #1491. |
@@ -213,7 +213,7 @@ idxs_t fetchIdxs( in vec3 coords, in usampler3D u_LightTiles ) { | |||
|
|||
// 8 bits per light ID | |||
uint nextIdx( in uint count, in idxs_t idxs ) { | |||
return ( idxs[count / 4] >> ( 8 * ( count % 4 ) ) ) & 0xFFu; | |||
return idxs[count / 4u] >> 8u * ( count % 4u ) & 0xFFu; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should keep at least the outer parentheses so it's clear immediately what the intended order of operations is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this is because I first added explicit cast everywhere to get something working, so I ended transforming ( ... )
into uint( ... )
. But then when I tracked down the useless casts, I mistakenly deleted the parentheses that were there before…
Now fixed.
7d0edc2
to
558d6a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you very much! |
Do explicit
uint
casting in GLSL operations.Fixes #1611: