<?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>307</bug_id>
          
          <creation_ts>2007-07-04 09:57:48 +0200</creation_ts>
          <short_desc>Rectangular (but still pow2) dds textures with mipmaps incorrectly loaded</short_desc>
          <delta_ts>2010-03-24 07:50:41 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <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>323</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:50:41 +0100</bug_when>
    <thetext>


---- Reported by davelloyd 2007-07-04 09:57:48 ----

In the following from Texture.updateImage, the shorter of width or height will
become zero before all the mipmaps are loaded when the final mipmaps should be
(for example) 4x1, 2x1 and then 1x1:
        for (int i = 0; i &lt; mipmapData.length; i++) {
          if (data.isDataCompressed()) {
            // Need to use glCompressedTexImage2D directly to allocate and fill
this image
            gl.glCompressedTexImage2D(texTarget, i, data.getInternalFormat(),
                                      width, height, data.getBorder(),
                                      mipmapData[i].remaining(), mipmapData[i]);
          } else {
            // Allocate texture image at this level
            gl.glTexImage2D(texTarget, i, data.getInternalFormat(),
                            width, height, data.getBorder(),
                            data.getPixelFormat(), data.getPixelType(), null);
            updateSubImageImpl(data, texTarget, i, 0, 0, 0, 0, data.getWidth(),
data.getHeight());
          }

          width /= 2;
          height /= 2;
        }
   

Suggest fix of: 
width = Math.max (width/2, 1)

etc.

I believe there are other examples of this failure mode in Texture as well.



---- Additional Comments From kbr 2007-08-06 09:27:58 ----

Sorry for the delay in addressing this bug. A fix has been checked in; if it
doesn&apos;t work, please reopen the bug and attach an image which fails to load
properly. You should be able to test this with the demos.texture.TestTexture
test in the jogl-demos workspace.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:50 EDT  ---

This bug was previously known as _bug_ 307 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=307
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>