diff --git a/eq/client/channel.cpp b/eq/client/channel.cpp index c659a4b3a8..b5f58a2a27 100644 --- a/eq/client/channel.cpp +++ b/eq/client/channel.cpp @@ -45,7 +45,6 @@ #include "window.h" #include -#include #include #include #include @@ -216,9 +215,6 @@ const DrawableConfig& Channel::getDrawableConfig() const { const Window* window = getWindow(); LBASSERT( window ); - if( _impl->fbo ) - return _impl->drawableConfig; - return window->getDrawableConfig(); } @@ -235,9 +231,6 @@ bool Channel::configExit() delete _impl->_dcProxy; _impl->_dcProxy = 0; #endif - - delete _impl->fbo; - _impl->fbo = 0; return true; } @@ -251,88 +244,15 @@ bool Channel::configInit( const uint128_t& ) _impl->_dcProxy = new dc::Proxy( this ); } #endif - return _configInitFBO(); -} - -bool Channel::_configInitFBO() -{ - const uint32_t drawable = getDrawable(); - if( drawable == FB_WINDOW ) - return true; - - const Window* window = getWindow(); - if( !window->getSystemWindow() || - !GLEW_ARB_texture_non_power_of_two || !GLEW_EXT_framebuffer_object ) - { - sendError( ERROR_FBO_UNSUPPORTED ); - return false; - } - - // needs glew initialized (see above) - _impl->fbo = new util::FrameBufferObject( glewGetContext( )); - - int depthSize = 0; - if( drawable & FBO_DEPTH ) - { - depthSize = window->getIAttribute( WindowSettings::IATTR_PLANES_DEPTH ); - if( depthSize < 1 ) - depthSize = 24; - } - - int stencilSize = 0; - if( drawable & FBO_STENCIL ) - { - stencilSize = - window->getIAttribute( WindowSettings::IATTR_PLANES_STENCIL ); - if( stencilSize < 1 ) - stencilSize = 1; - } - - const PixelViewport& pvp = getNativePixelViewport(); - const Error error = _impl->fbo->init( pvp.w, pvp.h, - window->getColorFormat(), depthSize, - stencilSize ); - if( !error ) - return true; - - sendError( error.getCode( )); - delete _impl->fbo; - _impl->fbo = 0; - return false; + return true; } void Channel::_initDrawableConfig() { const Window* window = getWindow(); _impl->drawableConfig = window->getDrawableConfig(); - if( !_impl->fbo ) - return; - - const util::Textures& colors = _impl->fbo->getColorTextures(); - if( !colors.empty( )) - { - switch( colors.front()->getType( )) - { - case GL_FLOAT: - _impl->drawableConfig.colorBits = 32; - break; - case GL_HALF_FLOAT: - _impl->drawableConfig.colorBits = 16; - break; - case GL_UNSIGNED_INT_10_10_10_2: - _impl->drawableConfig.colorBits = 10; - break; - - default: - LBUNIMPLEMENTED; - case GL_UNSIGNED_BYTE: - _impl->drawableConfig.colorBits = 8; - break; - } - } } - void Channel::notifyViewportChanged() { const PixelViewport oldPVP = getPixelViewport(); @@ -515,11 +435,6 @@ Frustumf Channel::getScreenFrustum() const -1.f, 1.f ); } -util::FrameBufferObject* Channel::getFrameBufferObject() -{ - return _impl->fbo; -} - View* Channel::getView() { LB_TS_THREAD( _pipeThread ); @@ -580,26 +495,11 @@ void Channel::removeResultImageListener( ResultImageListener* listener ) //--------------------------------------------------------------------------- // apply convenience methods //--------------------------------------------------------------------------- -void Channel::applyFrameBufferObject() -{ - LB_TS_THREAD( _pipeThread ); - if( _impl->fbo ) - { - const PixelViewport& pvp = getNativePixelViewport(); - const Error error = _impl->fbo->resize( pvp.w, pvp.h ); - if( error ) - sendError( error.getCode( )); - _impl->fbo->bind(); - } - else if( GLEW_EXT_framebuffer_object ) - glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 ); -} - void Channel::applyBuffer() { LB_TS_THREAD( _pipeThread ); const Window* window = getWindow(); - if( !_impl->fbo && window->getSystemWindow()->getFrameBufferObject() == 0 ) + if( !window->getSystemWindow()->getFrameBufferObject( )) { EQ_GL_CALL( glReadBuffer( getReadBuffer( ))); EQ_GL_CALL( glDrawBuffer( getDrawBuffer( ))); @@ -615,10 +515,7 @@ void Channel::bindFrameBuffer() if( !window->getSystemWindow( )) return; - if( _impl->fbo ) - applyFrameBufferObject(); - else - window->bindFrameBuffer(); + window->bindFrameBuffer(); } void Channel::applyColorMask() const diff --git a/eq/client/channel.h b/eq/client/channel.h index 7e2108bc85..db870c9143 100644 --- a/eq/client/channel.h +++ b/eq/client/channel.h @@ -119,9 +119,6 @@ class Channel : public fabric::Channel< Window, Channel > /** const-version of getNativeView() @version 1.0 */ EQ_API const View* getNativeView() const; - /** @return the FBO used as an alternate frame buffer. @version 1.0*/ - EQ_API util::FrameBufferObject* getFrameBufferObject(); - /** @return a fixed unique color for this channel. @version 1.0 */ EQ_API const Vector3ub& getUniqueColor() const; @@ -258,13 +255,7 @@ class Channel : public fabric::Channel< Window, Channel > EQ_API virtual void applyOrthoTransform() const; /** - * Apply the current alternate frame buffer. - * @version 1.0 - */ - EQ_API virtual void applyFrameBufferObject(); - - /** - * Rebind the current alternate FBO of the channel or window. + * Rebind the window frame buffer. * @version 1.0 */ EQ_API void bindFrameBuffer(); @@ -591,9 +582,6 @@ class Channel : public fabric::Channel< Window, Channel > /** Setup the current rendering context. */ void _overrideContext( RenderContext& context ); - /** Initialize the FBO */ - bool _configInitFBO(); - /** Initialize the channel's drawable config. */ void _initDrawableConfig(); diff --git a/eq/client/compositor.cpp b/eq/client/compositor.cpp index d5953fa55a..ac9e0d5353 100644 --- a/eq/client/compositor.cpp +++ b/eq/client/compositor.cpp @@ -35,7 +35,6 @@ #include "windowSystem.h" #include -#include #include #include diff --git a/eq/client/dc/proxy.cpp b/eq/client/dc/proxy.cpp index 68f7e60f48..8abc9825fd 100644 --- a/eq/client/dc/proxy.cpp +++ b/eq/client/dc/proxy.cpp @@ -28,7 +28,6 @@ #include "../windowSystem.h" #include -#include #include #include diff --git a/eq/client/detail/channel.ipp b/eq/client/detail/channel.ipp index 04385d9763..db4453ab19 100644 --- a/eq/client/detail/channel.ipp +++ b/eq/client/detail/channel.ipp @@ -48,7 +48,6 @@ class Channel public: Channel() : state( STATE_STOPPED ) - , fbo( 0 ) , initialSize( Vector2i::ZERO ) #ifdef EQUALIZER_USE_DEFLECT , _dcProxy( 0 ) @@ -64,7 +63,6 @@ public: { framebufferImage.flush(); statistics->clear(); - LBASSERT( !fbo ); } void addResultImageListener( ResultImageListener* listener ) @@ -130,15 +128,12 @@ public: } } - /** The channel's drawable config (FBO). */ + /** The channel's drawable config. */ DrawableConfig drawableConfig; /** The configInit/configExit state. */ State state; - /** Used as an alternate drawable. */ - util::FrameBufferObject* fbo; - /** A random, unique color for this channel. */ Vector3ub color; diff --git a/eq/fabric/channel.h b/eq/fabric/channel.h index bd2a9643bb..656383a571 100644 --- a/eq/fabric/channel.h +++ b/eq/fabric/channel.h @@ -36,20 +36,6 @@ template< class W, class C > class Channel : public Object typedef LeafVisitor< C > Visitor; //!< The channel visitor type typedef W Parent; //!< The parent window type - /** - * The drawable format defines the components used as an alternate drawable - * for this channel. If an alternate drawable is configured, the channel - * uses the appropriate targets in place of the window's frame buffer. - * @version 1.0 - */ - enum Drawable - { - FB_WINDOW = LB_BIT_NONE, //!< Use the window's frame buffer - FBO_COLOR = LB_BIT1, //!< Use an FBO for color values - FBO_DEPTH = LB_BIT2, //!< Use an FBO for depth values - FBO_STENCIL = LB_BIT3 //!< Use an FBO for stencil values - }; - /** @name Data Access */ //@{ /** @internal Initialize this channel (calls virtual methods) */ @@ -101,12 +87,6 @@ template< class W, class C > class Channel : public Object */ EQFABRIC_INL void setNearFar( const float nearPlane, const float farPlane ); - /** - * @return the channel's framebuffer attachment configuration. - * @version 1.0 - */ - uint32_t getDrawable() const { return _drawable; } - /** * Perform a depth-first traversal of this channel. * @@ -361,8 +341,6 @@ template< class W, class C > class Channel : public Object /** @internal @sa Serializable::setDirty() */ EQFABRIC_INL virtual void setDirty( const uint64_t bits ); - void setDrawable( const uint32_t drawable ); //!< @internal - /** @name Render context access */ //@{ /** @internal Override the channel's native render context. */ @@ -436,9 +414,6 @@ template< class W, class C > class Channel : public Object /** String attributes. */ std::string _sAttributes[SATTR_ALL]; - /** An alternate drawable config. */ - uint32_t _drawable; - /** Overdraw limiter */ Vector2i _maxSize; diff --git a/eq/fabric/channel.ipp b/eq/fabric/channel.ipp index 2f443b98f3..eead5b2542 100644 --- a/eq/fabric/channel.ipp +++ b/eq/fabric/channel.ipp @@ -47,7 +47,6 @@ template< class W, class C > Channel< W, C >::Channel( W* parent ) : _window( parent ) , _context( &_data.nativeContext ) - , _drawable( FB_WINDOW ) , _maxSize( Vector2i::ZERO ) { memset( _iAttributes, 0xff, IATTR_ALL * sizeof( int32_t )); @@ -61,7 +60,6 @@ Channel< W, C >::Channel( const Channel& from ) , _window( from._window ) , _data( from._data ) , _context( &_data.nativeContext ) - , _drawable( from._drawable ) , _maxSize( from._maxSize ) { _window->_addChannel( static_cast< C* >( this )); @@ -127,8 +125,7 @@ void Channel< W, C >::serialize( co::DataOStream& os, const uint64_t dirtyBits ) os << _data.nativeContext.vp << _data.nativeContext.pvp << _data.fixedVP << _maxSize; if( dirtyBits & DIRTY_MEMBER ) - os << _drawable << _data.nativeContext.view - << _data.nativeContext.overdraw; + os << _data.nativeContext.view << _data.nativeContext.overdraw; if( dirtyBits & DIRTY_FRUSTUM ) os << _data.nativeContext.frustum; if( dirtyBits & DIRTY_CAPABILITIES ) @@ -158,8 +155,7 @@ void Channel< W, C >::deserialize( co::DataIStream& is, sizeof( _data.fixedVP ) +sizeof( _maxSize )); } if( dirtyBits & DIRTY_MEMBER ) - is >> _drawable >> _data.nativeContext.view - >> _data.nativeContext.overdraw; + is >> _data.nativeContext.view >> _data.nativeContext.overdraw; if( dirtyBits & DIRTY_FRUSTUM ) is >> _data.nativeContext.frustum; if( dirtyBits & DIRTY_CAPABILITIES ) @@ -276,13 +272,6 @@ void Channel< W, C >::setNearFar( const float nearPlane, const float farPlane ) } } -template< class W, class C > -void Channel< W, C >::setDrawable( const uint32_t drawable ) -{ - _drawable = drawable; - setDirty( DIRTY_MEMBER ); -} - template< class W, class C > void Channel< W, C >::setViewVersion( const co::ObjectVersion& view ) { @@ -400,28 +389,6 @@ std::ostream& operator << ( std::ostream& os, os << "viewport " << pvp << std::endl; } - - const uint32_t drawable = channel.getDrawable(); - if( drawable != C::FB_WINDOW ) - { - os << "drawable ["; - - if ((drawable & C::FBO_COLOR) != 0 ) - { - os << " FBO_COLOR"; - } - - if ((drawable & C::FBO_DEPTH) != 0) - { - os << " FBO_DEPTH"; - } - if ((drawable & C::FBO_STENCIL) != 0) - { - os << " FBO_STENCIL"; - } - - os << " ]" << std::endl; - } os << lunchbox::exdent << "}" << std::endl << lunchbox::enableHeader << lunchbox::enableFlush; diff --git a/eq/server/channel.h b/eq/server/channel.h index 66e38e3467..0381268fec 100644 --- a/eq/server/channel.h +++ b/eq/server/channel.h @@ -136,8 +136,6 @@ class Channel : public fabric::Channel< Window, Channel > { fabric::Channel< Window, Channel >::setIAttribute( attr, value );} void setSAttribute( const SAttribute attr, const std::string& value ) { fabric::Channel< Window, Channel >::setSAttribute( attr, value );} - void setDrawable( const uint32_t drawable ) - { fabric::Channel< Window, Channel >::setDrawable( drawable ); } //@} /** diff --git a/eq/server/compound.cpp b/eq/server/compound.cpp index 3a46de2584..08324ad90d 100644 --- a/eq/server/compound.cpp +++ b/eq/server/compound.cpp @@ -1465,9 +1465,8 @@ void Compound::_updateInheritStereo() const Window* window = _inherit.channel->getWindow(); const bool stereoWindow = window->getDrawableConfig().stereo; - const bool usesFBO = window && - (( window->getIAttribute(WindowSettings::IATTR_HINT_DRAWABLE) == fabric::FBO) || - _inherit.channel->getDrawable() != Channel::FB_WINDOW ); + const bool usesFBO = window && window->getIAttribute( + WindowSettings::IATTR_HINT_DRAWABLE ) == fabric::FBO; if( stereoWindow && !usesFBO ) _inherit.iAttributes[IATTR_STEREO_MODE] = fabric::QUAD; diff --git a/eq/server/loader.l b/eq/server/loader.l index 05e86c58b5..9260111f4f 100644 --- a/eq/server/loader.l +++ b/eq/server/loader.l @@ -243,10 +243,6 @@ READBACK { return EQTOKEN_READBACK; } COLOR { return EQTOKEN_COLOR; } DEPTH { return EQTOKEN_DEPTH; } viewport { return EQTOKEN_VIEWPORT; } -drawable { return EQTOKEN_DRAWABLE; } -FBO_COLOR { return EQTOKEN_FBO_COLOR; } -FBO_DEPTH { return EQTOKEN_FBO_DEPTH; } -FBO_STENCIL { return EQTOKEN_FBO_STENCIL; } range { return EQTOKEN_RANGE; } period { return EQTOKEN_PERIOD; } phase { return EQTOKEN_PHASE; } diff --git a/eq/server/loader.y b/eq/server/loader.y index dfd38f191d..a2d868ecb3 100644 --- a/eq/server/loader.y +++ b/eq/server/loader.y @@ -248,10 +248,6 @@ %token EQTOKEN_LEFT %token EQTOKEN_RIGHT %token EQTOKEN_VIEWPORT -%token EQTOKEN_DRAWABLE -%token EQTOKEN_FBO_COLOR -%token EQTOKEN_FBO_DEPTH -%token EQTOKEN_FBO_STENCIL %token EQTOKEN_RANGE %token EQTOKEN_PERIOD %token EQTOKEN_PHASE @@ -757,8 +753,6 @@ channelField: channel->setViewport(eq::fabric::Viewport( $2[0], $2[1], $2[2], $2[3])); } - | EQTOKEN_DRAWABLE '[' { flags = eq::server::Channel::FB_WINDOW; } - drawables ']' { channel->setDrawable( flags ); flags = 0; } channelAttributes: /*null*/ | channelAttributes channelAttribute channelAttribute: EQTOKEN_HINT_STATISTICS IATTR @@ -1110,12 +1104,6 @@ buffer: EQTOKEN_COLOR { flags |= eq::fabric::Frame::BUFFER_COLOR; } | EQTOKEN_DEPTH { flags |= eq::fabric::Frame::BUFFER_DEPTH; } -drawables: /*null*/ | drawables drawable -drawable: - EQTOKEN_FBO_COLOR { flags |= eq::server::Channel::FBO_COLOR; } - | EQTOKEN_FBO_DEPTH { flags |= eq::server::Channel::FBO_DEPTH; } - | EQTOKEN_FBO_STENCIL { flags |= eq::server::Channel::FBO_STENCIL; } - wall: EQTOKEN_WALL '{' { wall = eq::fabric::Wall(); } wallFields '}' wallFields: /*null*/ | wallFields wallField diff --git a/examples/configs/1-window.DFR.eqc b/examples/configs/1-window.DFR.eqc index bbb9cd566b..1f009e9e4d 100644 --- a/examples/configs/1-window.DFR.eqc +++ b/examples/configs/1-window.DFR.eqc @@ -12,15 +12,18 @@ server { window { - name "Dynamic Frame Resize" - viewport [ 20 100 480 300 ] - + attributes { hint_drawable FBO } + viewport [ 0 0 2048 2048 ] channel { name "buffer" - viewport [ 0 0 2048 2048 ] - drawable [ FBO_COLOR FBO_DEPTH ] } + } + window + { + name "Dynamic Frame Resize" + viewport [ 20 100 480 300 ] + channel { name "channel" diff --git a/examples/configs/2-channel.DB.FBO.eqc b/examples/configs/2-channel.DB.FBO.eqc index 5e671ff7e9..12bd8fcc4f 100644 --- a/examples/configs/2-channel.DB.FBO.eqc +++ b/examples/configs/2-channel.DB.FBO.eqc @@ -13,14 +13,15 @@ server window { viewport [ .25 .25 .5 .5 ] - attributes{ planes_stencil ON } + attributes { hint_drawable FBO } + + channel { name "FBO" } + } + window + { + viewport [ .25 .25 .5 .5 ] + attributes { planes_stencil ON } - channel - { - drawable [ FBO_COLOR FBO_DEPTH ] - name "FBO" - } - channel{ name "channel" } } } diff --git a/examples/configs/stress.lb.2D.eqc b/examples/configs/stress.lb.2D.eqc index d212118dda..76e6dd3687 100644 --- a/examples/configs/stress.lb.2D.eqc +++ b/examples/configs/stress.lb.2D.eqc @@ -16,27 +16,28 @@ server { window { + attributes { hint_drawable FBO } viewport [ .25 .2 .5 .5 ] - channel { name "buffer0" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer1" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer2" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer3" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer4" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer5" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer6" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer7" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer8" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer9" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer10" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer11" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer12" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer13" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer14" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer15" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer16" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer17" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer18" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } - channel { name "buffer19" drawable [ FBO_COLOR FBO_DEPTH ] viewport [ 0 0 1 .5 ] } + channel { name "buffer0" viewport [ 0 0 1 .5 ] } + channel { name "buffer1" viewport [ 0 0 1 .5 ] } + channel { name "buffer2" viewport [ 0 0 1 .5 ] } + channel { name "buffer3" viewport [ 0 0 1 .5 ] } + channel { name "buffer4" viewport [ 0 0 1 .5 ] } + channel { name "buffer5" viewport [ 0 0 1 .5 ] } + channel { name "buffer6" viewport [ 0 0 1 .5 ] } + channel { name "buffer7" viewport [ 0 0 1 .5 ] } + channel { name "buffer8" viewport [ 0 0 1 .5 ] } + channel { name "buffer9" viewport [ 0 0 1 .5 ] } + channel { name "buffer10" viewport [ 0 0 1 .5 ] } + channel { name "buffer11" viewport [ 0 0 1 .5 ] } + channel { name "buffer12" viewport [ 0 0 1 .5 ] } + channel { name "buffer13" viewport [ 0 0 1 .5 ] } + channel { name "buffer14" viewport [ 0 0 1 .5 ] } + channel { name "buffer15" viewport [ 0 0 1 .5 ] } + channel { name "buffer16" viewport [ 0 0 1 .5 ] } + channel { name "buffer17" viewport [ 0 0 1 .5 ] } + channel { name "buffer18" viewport [ 0 0 1 .5 ] } + channel { name "buffer19" viewport [ 0 0 1 .5 ] } channel { name "channel" } } @@ -96,5 +97,5 @@ server inputframe { name "frame.buffer14" } inputframe { name "frame.buffer15" } } - } + } }