glMultTransposeMatrixd bug with AMD graphics card

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

glMultTransposeMatrixd bug with AMD graphics card

Manu
Hi,

Recently, Sweet Home 3D users equipped with an AMD graphics card had some hard times with a completely buggy 3D view.
After a while, we discovered that a regression in AMD Adrenalin driver was introduced in version > 22.5.1 and that the origin of this bug came from their implementation of OpenGL glMultTransposeMatrixd function when a non identity matrix is passed in parameter. AMD is aware of this bug and will provide a fix in a coming update, but meanwhile you should avoid this function (for example using the alternative proposed in JoglPipeline class).
Hope this will be useful...
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

Sven Gothel
Administrator
Usually many use their own matrix math on a ES non-fixed-function pipeline these days, see our PMVMatrix.

Thank you for the heads up.
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
In reply to this post by Manu
Thank you for this suggestion. I'm almost sure that I transpose the matrix before calling glLoadMatrixd when the fixed pipeline is in use but I'll check that.

By the way, maybe it's possible to detect the buggy versions and apply the workaround only in this case, either in Java3D or (if doable) in JOGL itself. I can't be 100% sure, maybe a renderer quirk would be appropriate. What is the exact value of GL_VENDOR, GL_RENDERER and GL_VERSION in your case? Are both GNU Linux and Microsoft Windows affected? GL_VENDOR should be "ATI Technologies Inc." but detecting the driver version might be challenging, 22.*.* should be in the very beginning of GL_VERSION.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
In reply to this post by Manu
Actually, the driver version number isn't at the very beginning:
GL_VERSION: 4.6.14802 Compatibility Profile/Debug Context 22.1.2 30.0.14023.3004
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
isDriverATICatalyst is true in this case, vendorVersion is 22.5.1. This should work:
final VersionNumber amdSafeAdrenalinVersion = new VersionNumber(22, 5, 1);
if ( vendorVersion.compareTo(amdSafeAdrenalinVersion) > 0 ) {
    final int quirk = GLRendererQuirks.BuggyGlMultTransposeMatrixd;
    if(DEBUG) {
                    System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", [Vendor "+glVendor+" or Renderer "+glRenderer+"], driverVersion "+vendorVersion);
                }
    quirks.addQuirk( quirk );
}

Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
In reply to this post by Manu
Hello

I'll have to modify https://jogamp.org/cgit/jogl.git/tree/make/config/jogl/gl-gl4bc.cfg in order to use GLContext to know whether glLoadTransposeMatrixd and glMultTransposeMatrixd are broken and to use the suggested workaround in this case. Actually, I'll have to implement something a bit different to make it work when you call glMultTransposeMatrixd or glLoadTransposeMatrixd alone, I will probably convert the 4 × 4 row-major matrix into a  4 × 4 column-major matrix and call glMultMatrixd. I'll write a bug report.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

Sven Gothel
Administrator
As you wish, just mind that we have PMVMatrix and transpose is supported in our toolchain (FloatUtil etc).

EDIT: Ours implemented in software and the GL driver is ofc also in software.
Only if you must use the fixed pipeline ... this might be of interest.
Then we should have it in the quirks ..
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
Java3D still relies on the fixed pipeline and it's not the only API in this case. JogAmp's Ardor3D Continuation doesn't need to transpose matrices because of a difference in row-major and column-major matrices and anyway, I transpose matrices without calling the broken methods as far as I remember.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
In reply to this post by Manu
I have created a bug report for this problem:
https://jogamp.org/bugzilla/show_bug.cgi?id=1432
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

Manu
For your information, AMD confirmed that the bug in glMultTransposeMatrixd was fixed in Adrenalin driver 23.3.2 update (even if its release notes don't mention it).
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

gouessej
Administrator
Thank you for the feedback, it will help to use the quirk only when necessary.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

Manu
If it's easy to test AMD Adrenalin driver  22.5.1 < version < 23.3.2, would it possible to fix the bug #1432 in the coming version JOGL 2.5.0?
It would avoid me to maintain a branch of Java 3D to fix this bug. Thanks...
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: glMultTransposeMatrixd bug with AMD graphics card

Sven Gothel
Administrator
Thank you Julien for dropping the big report, and both of you for the discussion of course.

So who wants to fix it? :)
The software tools (Matrix4f etc) are available.

Edit: I see the API to replace uses double, so a Matrix4d might be desired ...