https://bugs.winehq.org/show_bug.cgi?id=34052
--- Comment #62 from Arthur Huillet arthur.huillet@free.fr --- Reproducing here my reply from https://devtalk.nvidia.com/default/topic/773623/linux/character-models-are-s...
---
We have investigated this issue and found out the cause of the problem. An OpenGL vertex shader (generated by Wine based on a D3D shader in the Witcher) is created with the following uniform: uniform vec4 vs_c[256];
The shader then dereferences vs_c[x], with "x" a dynamically computed value that sometimes exceeds 255. Reading outside of the bounds of a uniform array in GLSL is undefined behavior, which means that the implementation is allowed to do whatever it likes. On NVIDIA GPUs, the value returned will sometimes be 0.0, and sometimes different. Since this value is used to warp the bones of the characters (to animate them), having an unpredictable value can result in some vertices being offscreen and even some geometry disappearing entirely.
The problem is not a NVIDIA bug, since the application is asking the GPU to do something that is undefined in the specification. We have been working with Wine on the investigation of this issue, and have also communicated our findings to the developers of the game. A patch on the Wine bug tracker appears to work around the issue.
---
Arthur Huillet NVIDIA Linux Graphics