<?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>1073</bug_id>
          
          <creation_ts>2014-09-20 21:42:27 +0200</creation_ts>
          <short_desc>Fix FBObject/GLFBODrawable: Redundancies, bind/unbind, renderbuffer depth/stencil bits</short_desc>
          <delta_ts>2019-03-29 17:54:45 +0100</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>2.3.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</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>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>84f367a73c5b16dcebfd877e82e1c2cb90ae74ce
aee2343620d0426fb7275a75a95c24eb4a4ccd83
91508fb026746c8b659e29bd7e62678e6aff892a
fce65d0b8887387bfb71bbfeea63bc7915163399
a7ff8b898780762b763c0b4544728067375955b6
711757aa4e087d97c3103489c47fbd7d76bcac3d
e99f5060d62aad25fcc37ebf50c8f2a270c9d5df
4d8d41d32b27ab8dc6a3898511011f8b3d4f07a5
38f6915fedb765313c1f4646acf9e13dfbccef36</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4242</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:42:27 +0200</bug_when>
    <thetext>- FBOObject : Remove redundancies
  - resetSamplingSink(..) shall only be called if required

  - resetSamplingSink(..) shall operate more simple

  - don&apos;t instantiate samplingSink early, might get re-defined 
    by fbo.setSamplingSink(..)

  - validate samplingSink passed by setSamplingSink(..)

  - Only expose dedicated init(..) and reset(..) methods,
    dropping dual-use reset(..) methods.
    This clarifies user code and state validation alot.

  - reset(..) and resetSamplingSink() shall return a boolean
    value stating whether operation has modified the instance.

  - isModified() shall be added to query whether the instances
    size, format or any attachments has been modified 
    since last sync*(), use() or resetSamplingSink() call.

- Close all FBObject bind w/ unbind
  - Ensure all bind(gl) operations at least are 
    completed by one markUnbound() for correctness

- Fix renderbuffer depth/stencil usage and format
  - Remove GLFBODrawable.FBOMODE_USE_DEPTH, 
    code shall use GLCapabilities.[get|set]DepthBits(..),
    similar to stencilBits.

    Note: Applications shall use _requested_ GLCapabilities,
    if passing caps down to the GLFBODrawable.
    Otherwise (using _chosen_ caps) we may end up in requesting
    properties not desired, e.g. stencil bits, if driver has chosen.

  - Allow generic bit count arguments for fbo.attachRenderbuffer(..)

  - Proper fallback for renderbuffer depth/stencil  bit count</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4243</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:45:38 +0200</bug_when>
    <thetext>84f367a73c5b16dcebfd877e82e1c2cb90ae74ce

GLJPanel Cleanup: Remove initial FBO reshape; Propagate reshape only if differs from panel-size; Use pre-fetched panel-size.

++++

aee2343620d0426fb7275a75a95c24eb4a4ccd83

FBObject.reset(..): Return true if modified, otherwise false

+++</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4244</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:46:17 +0200</bug_when>
    <thetext>91508fb026746c8b659e29bd7e62678e6aff892a

GLFBODrawableImpl: Utilize common self-contained setupFBO(..) method for FBO creation incl. Bug 1020 glClear(..) ; Fixes missing fbo.unbind(gl)

Utilize common self-contained setupFBO(..) method for FBO creation incl. Bug 1020 glClear(..)
  initialize(..) and reset(..)&apos;s fallback code
  contained duplicated FBO setup/creation code.

  The former was updated to suite the new FBO mode bits,
  where the latter left untouched, hence was buggy.

  Now setup and creation of a single FBO has been merged into setupFBO(..).

Fixes missing fbo.unbind(gl):
  We did no issue unbind() on each fbo instance
  while adding the workaround for Bug 1020.

  Adding fbo.markUnbound() call to all fbos but the last.

  Note: This might not cause any issues, since fbo.bind(gl) tests the currently bound fbo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4245</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:47:57 +0200</bug_when>
    <thetext>fce65d0b8887387bfb71bbfeea63bc7915163399

FBOobject GLEL Tests: Remove redundant detachAllColorbuffer(gl) for init call

+++

a7ff8b898780762b763c0b4544728067375955b6

StereoClientRenderer: Remove redundant FBObject.detachAllColorbuffer(gl) for init call

+++</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4246</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:49:15 +0200</bug_when>
    <thetext>711757aa4e087d97c3103489c47fbd7d76bcac3d

- FBObject: Simplify API (init/reset)
- Only issue automatic resetSamplingSink(..) if required; 
- Fix resetSamplingSink(..), isBound(), ..

+++

- Simplify API (init/reset)
  - use new unique methods for init and reset:
    - void init(final GL gl, final int newWidth, final int newHeight, final int newSamples)
      - does not issue resetSamplingSink(..)
    - boolean reset(final GL gl, final int newWidth, final int newHeight, final int newSamples)
      - always issues resetSamplingSink(..)

  - deprecated dual-use (init/reset):
    - boolean reset(final GL gl, final int newWidth, final int newHeight)
    - boolean reset(final GL gl, int newWidth, int newHeight, int newSamples, final boolean resetSamplingSink)

- reset(..) no more creates a dummy &apos;samplingSink&apos; instance if sampling &gt; 0,
  left up to resetSamplingSink(..)

- Track &apos;modified&apos; state of FBObject,
  if size, format or any attachment has been changed since last
    - use(..)
    - syncSamplingSink(..)
    - resetSamplingSink(..)

- Only issue resetSamplingSink(..) from syncSamplingSink(..)/use(..)
  if &apos;modified == true&apos;

+++

- Fix setSamplingSink(..), i.e. samplingSink state handling:
  - Validated whether given samplingSink is initialized,
    throws Exception if not.

- Fix resetSamplingSink(..)
  - resets the bound state, i.e. leaves it untouched
    - also unbinds the samplingSink

  - sampleSinkDepthStencilMismatch() also returns true if
    this.depth/stencil == null, but samplingSink is not.

  - Newly created colorbuffer/-texture matches
    exiting colorbuffer&apos;s internal-format, if exists.

  - Using simplified resetSizeImpl(..) for size mismatch

  - Simplified samplingColorSink init check

- Fix isBound()
    was: &apos;bound = bound &amp;&amp; fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)&apos;
    fix: &apos;bound = bound &amp;&amp; fbName == gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)&apos;

- Fix detachRenderbuffer(..) validates whether detachment was successful,
  similar to detachColorbuffer(..)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4247</commentid>
    <comment_count>5</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:56:44 +0200</bug_when>
    <thetext>e99f5060d62aad25fcc37ebf50c8f2a270c9d5df

FBObject: Fix depth- and stencil bit count selection for attachRenderbuffer(..);

- Fix depth- and stencil bit count selection for attachRenderbuffer(..)
  - Add generic values: DEFAULT_BITS, REQUESTED_BITS, CHOSEN_BITS, MAXIMUM_BITS

  - Refactor depth- and stencil bit-count -&gt; format into own method

  - Allow depth- and stencil bit-count select a higher bit-count if required (fix)

- GLFBODrawable.FBOMODE_USE_DEPTH is deprecated, using GLCapabilities.[get|set]DepthBits(..)
  - It was an oversight to introduce the bit flag in the first place,
    since we should have used the capabilities depth bit-count

- Graph Test: GLEventListenerButton shall use requested capabilities for FBO drawable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4248</commentid>
    <comment_count>6</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-09-20 21:58:20 +0200</bug_when>
    <thetext>4d8d41d32b27ab8dc6a3898511011f8b3d4f07a5

- Add GLJPanelsAndGLCanvasDemoGL2Applet: 
  - Simple applet test for GLJPanel/GL2 testing (offscreen, ..)

- Clean up GL2 Gears and Teapot state enable/disable

+++

38f6915fedb765313c1f4646acf9e13dfbccef36

FBObject/GLFBODrawable: Remove deprecated methods
    
- dual-use reset(..), use dedicated init(..) and reset(..)
    
- GLFBODrawable.FBOMODE_USE_DEPTH: Use GLCapabilities.[get|set]DepthBits(int)
    Note: Applications shall use _requested_ GLCapabilities,
    if passing caps down to the GLFBODrawable.
    Otherwise (using _chosen_ caps) we may end up in requesting
    properties not desired, e.g. stencil bits, if driver has chosen.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>