<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1432</bug_id>
          
          <creation_ts>2023-04-20 13:15:38 +0200</creation_ts>
          <short_desc>glMultTransposeMatrixd and glLoadTransposeMatrixd buggy in AMD Adrenalin drivers</short_desc>
          <delta_ts>2023-07-17 13:26:32 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>3.0.0</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>CONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://forum.jogamp.org/glMultTransposeMatrixd-bug-with-AMD-graphics-card-td4042205.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Julien Gouesse">gouessej</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6778</commentid>
    <comment_count>0</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2023-04-20 13:15:38 +0200</bug_when>
    <thetext>glMultTransposeMatrixd and glLoadTransposeMatrixd don&apos;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) &gt; 0 ) {
    final int quirk = GLRendererQuirks.BuggyGlMultTransposeMatrixd;
    if(DEBUG) {
                    System.err.println(&quot;Quirk: &quot;+GLRendererQuirks.toString(quirk)+&quot;: cause: OS &quot;+Platform.getOSType()+&quot;, [Vendor &quot;+glVendor+&quot; or Renderer &quot;+glRenderer+&quot;], driverVersion &quot;+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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6780</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-05-23 17:08:55 +0200</bug_when>
    <thetext>https://docs.gl/gl3/glMultTransposeMatrix

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

https://jogamp.org/deployment/archive/rc/v2.5.0-rc-20230523/javadoc/jogl/javadoc/com/jogamp/opengl/math/Matrix4f.html#transpose(com.jogamp.opengl.math.Matrix4f)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6781</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2023-05-23 17:10:25 +0200</bug_when>
    <thetext>(In reply to Sven Gothel from comment #1)
Since the API entry in question is of type double, perhaps we copy Matrix4f -&gt; Matrix4d (float -&gt; double) and use it for the SW replacement if quirk is set?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6816</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2023-07-17 13:26:32 +0200</bug_when>
    <thetext>(In reply to Sven Gothel from comment #2)
Good idea.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>