Search Issue Tracker
By Design
Votes
0
Found in
2017.4.9f1
Issue ID
1079723
Regression
No
Shader compiler determines that screenPos is not required when using an #ifdef with UNITY_INSTANCING_ENABLED
How to reproduce:
1. Download user's attached project "ScreenPosBug.zip"
2. Open the Scene "ClipTest" and play it
3. Now open the custom surface shader "ClipShader" and change line 32 to "#ifndef INSTANCING_ON"
4. Notice that when using "UNITY_INSTANCING_ENABLED" the value of the perspective corrected screenPos is not displayed as the color of the quad
Expected result: The value of the perspective corrected screenPos should be displayed as the color of the quad. The bottom left should be black, the right red, the top green, and the top right yellow
Actual result: The quad is blue. The generated vertex and fragment shader do not show that the screenPos is required.
Reproducible with: 2017.4.11f1, 2018.1.9f2, 2018.2.8f1, 2018.3.0b1
Note: The line that changes the color to green is disabled with an "#ifndef UNITY_INSTANCING_ENABLED" (ClipShader.shader L32-33). When viewing the generated vertex and fragment shaders, the "INSTANCING_ON" should inform that the screenPos is required.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
- "TLS Allocator ALLOC_TEMP_TLS" errors are thrown when unsuccessfully importing an FBX file
Add comment