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

Shader System

-

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

  1. Resolution Note (fix version 2021.2):

    Fixed in 2021.2.0a2

  2. Resolution Note (fix version 2021.1):

    Fixed in 2021.1.0b7

  3. Resolution Note (fix version 2020.2):

    Fixed in 2020.2.6f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.