<?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>630</bug_id>
          
          <creation_ts>2012-10-23 21:10:56 +0200</creation_ts>
          <short_desc>packed depth stencil extension not properly detected</short_desc>
          <delta_ts>2012-10-25 17:05:36 +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>macosx</component>
          <version>2</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>macosx</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="ac">andres.colubri</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>andres.colubri</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>jogl dedf4ea7ddab1279602208fa194231ea65409251</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1910</commentid>
    <comment_count>0</comment_count>
    <who name="ac">andres.colubri</who>
    <bug_when>2012-10-23 21:10:56 +0200</bug_when>
    <thetext>Hello, I&apos;m testing fairly recent (16th Oct) autobuilds jogl jars on OSX 10.6, using a 2007 mac Mini with the Intel GMA 950 chipset, and found that if I set the stencil bits of the requested capabilities to 8, then I get the following error:

Exception in thread &quot;AWT-EventQueue-0&quot; javax.media.opengl.GLException: stencil buffer n/a
	at com.jogamp.opengl.FBObject.attachRenderbuffer(FBObject.java:1389)
	at jogamp.opengl.GLFBODrawableImpl.initialize(GLFBODrawableImpl.java:130)
	at jogamp.opengl.GLFBODrawableImpl.contextRealized(GLFBODrawableImpl.java:321)
...

If I set the requested stencil bits to 0, then there is no error. I was surprised about this at first, because if I query the chosen caps I get:

GLCaps[rgba 0x8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms: 24/8/2, sample-ext default, dbl, mono  , hw, GLProfile[GL2/GL2.hw], offscr[fbo]]

which indicates that the 24/8 bit configurations for the depth and stencil buffers, respectively is supported. On the other hand, it is very likely that only packed depth+stencil buffers are supported (see this this thread for more info http://lists.apple.com/archives/mac-opengl/2008/Aug/msg00089.html).

I checked the source code of FBObject.java and found that the condition to use packed depth+stencil buffer is evaluated in the following line (804)

packedDepthStencilAvail = fullFBOSupport || gl.isExtensionAvailable(GLExtensions.OES_packed_depth_stencil);

fullFBOSupport is false on the GMA 950 for some reason (pgl.gl.hasFullFBOSupport() returns false), but I know for sure that the chipset supports packed depth and stencil because of tests I run earlier. Indeed, manually inspecting the extensions string returned by gl, I found GL_EXT_packed_depth_stencil. However jogl is checking for GL_OES_packed_depth_stencil instead, so I think this is the source of the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-10-24 12:49:09 +0200</bug_when>
    <thetext>(In reply to comment #0)
&gt; Hello, I&apos;m testing fairly recent (16th Oct) autobuilds jogl jars on OSX 10.6,
&gt; using a 2007 mac Mini with the Intel GMA 950 chipset, 

Thank you for testing on this config, which I don&apos;t have available!

&gt; If I set the requested stencil bits to 0, then there is no error. I was
&gt; surprised about this at first, because if I query the chosen caps I get:
&gt; 
&gt; GLCaps[rgba 0x8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms: 24/8/2, sample-ext
&gt; default, dbl, mono  , hw, GLProfile[GL2/GL2.hw], offscr[fbo]]

Yes, thats a &apos;fake&apos;, i.e. onscreen dp/st/ms config .. sorry.

&gt; 
&gt; which indicates that the 24/8 bit configurations for the depth and stencil
&gt; buffers, respectively is supported. On the other hand, it is very likely that
&gt; only packed depth+stencil buffers are supported (see this this thread for more
&gt; info http://lists.apple.com/archives/mac-opengl/2008/Aug/msg00089.html).
&gt; 
&gt; I checked the source code of FBObject.java and found that the condition to use
&gt; packed depth+stencil buffer is evaluated in the following line (804)
&gt; 
&gt; packedDepthStencilAvail = fullFBOSupport ||
&gt; gl.isExtensionAvailable(GLExtensions.OES_packed_depth_stencil);
&gt; 
&gt; fullFBOSupport is false on the GMA 950 for some reason

full FBO support is only enabled if (GLContext):
              ( isGL3() ||                                                         // GL &gt;= 3.0                
                isExtensionAvailable(GLExtensions.ARB_framebuffer_object) ||       // ARB_framebuffer_object
                ( isExtensionAvailable(GLExtensions.EXT_framebuffer_object) &amp;&amp;     // All EXT_framebuffer_object*
                  isExtensionAvailable(GLExtensions.EXT_framebuffer_multisample) &amp;&amp;
                  isExtensionAvailable(GLExtensions.EXT_framebuffer_blit) &amp;&amp;
                  isExtensionAvailable(GLExtensions.EXT_packed_depth_stencil)

&gt; (pgl.gl.hasFullFBOSupport() returns false), but I know for sure that the
&gt; chipset supports packed depth and stencil because of tests I run earlier.
&gt; Indeed, manually inspecting the extensions string returned by gl, I found
&gt; GL_EXT_packed_depth_stencil. However jogl is checking for
&gt; GL_OES_packed_depth_stencil instead, so I think this is the source of the
&gt; problem.

Yes, can add GLExtensions.EXT_packed_depth_stencil to the above query for packedDepthStencilAvail.

Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-10-24 12:54:19 +0200</bug_when>
    <thetext>Fixed w/ commit dedf4ea7ddab1279602208fa194231ea65409251</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1919</commentid>
    <comment_count>3</comment_count>
    <who name="ac">andres.colubri</who>
    <bug_when>2012-10-25 17:05:36 +0200</bug_when>
    <thetext>Great, thanks a lot for the quick fix.

Do the most recent autobuilds (jogl-b837-2012-10-23_19-29-45) already incorporate the fix?

(In reply to comment #2)
&gt; Fixed w/ commit dedf4ea7ddab1279602208fa194231ea65409251</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>