radv: Reading ViewportIndex in fragment shader returns garbage
Hello,
When running The Talos Principle with DXVK, the game reads gl_ViewportIndex
in its fragment shaders, which should be 0 since it doesn't actually export gl_ViewportIndex
from the vertex shader, but instead it reads random numbers. This leads to the game not rendering anything meaningful at all on RADV. Replacing the ViewportIndex
built-in with a zero-initialized private variable in all the shaders works around the issue.
Here's a RenderDoc capture, which should open on both RADV+ACO as well as AMDVLK. Interesting draw calls are e.g. EID 211. https://mega.nz/file/xfRgyKaD#0YR3PjwzUhAQVPHGyo6jZmK85NSgB5elhN42GXHx5Kw
The capture should show the Croteam logo. On RADV, it displays a black screen instead. AMDVLK works as expected.
- GPU: RX 480 (Polaris 10)
- Mesa: 20.0.4; 20.0.99-git (4daa3917)
Edited by Philip Rebohle