Bug 1432

Summary: glMultTransposeMatrixd and glLoadTransposeMatrixd buggy in AMD Adrenalin drivers
Product: [JogAmp] Jogl Reporter: Julien Gouesse <gouessej>
Component: coreAssignee: Sven Gothel <sgothel>
Status: CONFIRMED ---    
Severity: normal CC: sgothel
Priority: P4    
Version: 3.0.0   
Hardware: pc_all   
OS: windows   
URL: https://forum.jogamp.org/glMultTransposeMatrixd-bug-with-AMD-graphics-card-td4042205.html
Type: DEFECT SCM Refs:
Workaround: ---

Description Julien Gouesse 2023-04-20 13:15:38 CEST
glMultTransposeMatrixd and glLoadTransposeMatrixd don't transpose correcly in some AMD Adrenalin drivers (at least since the vendor version 22.5.1) under Microsoft Windows.

I suggest to detect the buggy drivers this ways (when isDriverATICatalyst is true):
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 );

I suggest to modify https://jogamp.org/cgit/jogl.git/tree/make/config/jogl/gl-gl4bc.cfg to override glMultTransposeMatrixd and glLoadTransposeMatrixd so that they use GLContext to know whether a workaround is needed and in this case the transposition should be done in software.
Comment 1 Sven Gothel 2023-05-23 17:08:55 CEST

"Calling glMultTransposeMatrix with matrix M is identical in operation to glMultMatrix with MT, where T represents the transpose."

Comment 2 Sven Gothel 2023-05-23 17:10:25 CEST
(In reply to Sven Gothel from comment #1)
Since the API entry in question is of type double, perhaps we copy Matrix4f -> Matrix4d (float -> double) and use it for the SW replacement if quirk is set?
Comment 3 Julien Gouesse 2023-07-17 13:26:32 CEST
(In reply to Sven Gothel from comment #2)
Good idea.