How to reproduce:
1. Open the project “IN-123001_D3DTest”
2. Observe the Console
Expected result: No shader error appears in the Console
Actual result: Shader error “… cannot use casts on l-values at Assets/SampleShader.shader(98) (on d3d11)” in the Console
Reproducible with: 2023.1.0a1, 6000.0.62f1, 6000.2.11f1, 6000.3.0b9, 6000.4.0a4
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- If the error does not appear, reimport the SampleShader asset (in the Assets tab, right click the asset → Reimport)
- The shader experiencing the error does not work, appears pink
- The issue reproduces on both DX11 and DX12
- The error appears when nesting the variable in the second level of an if statement