Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2020.2.X, 2021.1.X
Votes
0
Found in
2019.4
2020.2
2021.1
2021.1.0a7
2021.2
Issue ID
1299704
Regression
No
Compute shader loop treating integer constants as floats
Reproduction steps:
1. Create a new project or open an existing one
2. Add the attached Sky.compute shader in the project
3. Make sure that GLcore is included as a graphics API target in the Player settings
4. Select the shader and in the Inspector click "Show compiled code" button
5. See that u_xlat1 is initialized as float data but later used as int via floatBitsToInt
Expected results:
u_xlat1.xy = vec2(noisePeriod, intBitsToFloat(noiseStart));
for( ; floatBitsToInt(u_xlat1.y)<noiseEnd ; u_xlat1.y = intBitsToFloat(floatBitsToInt(u_xlat1.y) + 1))
Actual results:
u_xlat1.xy = vec2(noisePeriod, noiseStart);
for( ; floatBitsToInt(u_xlat1.y)<noiseEnd ; u_xlat1.y++)
Reproducible with: 2019.4.18f1, 2020.2.2f1, 2021.1.0b2, 2021.2.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Caret moves by a character when typing "." and any number into 'Grid and Snap' toolbar's input field
- Missing #pragma directives warnings appear in Inspector when including .hlsl file in Shader
- Fixed Timestep setting gets resets to default when upgrading project
- Console displays "NullReferenceException: Object reference not set to an instance of an object." during Editor Theme change
- Editor interface has low contrast when any theme is used
Resolution Note (fix version 2021.2):
Fixed in 2021.2.0a2
Resolution Note (fix version 2021.1):
Fixed in 2021.1.0b7
Resolution Note (fix version 2020.2):
Fixed in 2020.2.6f1