Bug 71760 - [GLSL] Transformation of vertex position looks incorrect
Summary: [GLSL] Transformation of vertex position looks incorrect
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: 9.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-18 21:37 UTC by Victor Luchits
Modified: 2013-11-21 18:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
test case (4.16 KB, text/plain)
2013-11-18 21:37 UTC, Victor Luchits
Details

Description Victor Luchits 2013-11-18 21:37:27 UTC
Created attachment 89432 [details]
test case

Hello,

I'm the lead programmer of game "Warsow" - an open source first person shooter. We just tried running development version of the game with open source AMD drivers shipped with Ubuntu 13.10 and custom-installed 3.12 Linux kernel. While the performance was better than we had expected, there were a few visual glitches.

In the game we use the so called "hardware skinning" for skeletal models to transform vertex coordinates by the influencing bones on the GPU. The transformation code is pretty complex and involves quaternion maths and accessing uniform arrays by index read from vertex attribute.

Despite the fact that vertex shader compiles successfully, the end result looks quite a bit off, meaning that sometimes meshes look deformed in unexpected directions. Unfortunately I can't take a screenshot to demonstrate the bug right now, but I managed to cook a somewhat minimal version of the shader. You will find the aforementioned transformation code in function QF_VertexDualQuatsTransform.

If you need to access our repository to be able to reproduce and observe the bug, just let me know.

Best regards,
Victor
Comment 1 Ian Romanick 2013-11-18 21:53:18 UTC
Does this occur only on AMD GPUs, or does it occur on other GPUs as well?  If it does only occur on Radeons, are there specific ones?  The issue could either be in the Radeon-specific back-end code or in the main compiler.
Comment 2 Victor Luchits 2013-11-21 18:31:36 UTC
Tried to reproduce this on a few machines with different hardware and I came to the conclusion that Mesa and/or drivers in fact have got nothing to do with the bug. The wrong transformation was in fact caused by an embarrassing bug in our dual quaternion to matrix conversion code which only manifested itself when the program executed the software fallback branch of code, which happened to be caused by Mesa reporting GLSL version lower than 1.40.

Sorry for wasting your time on this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.