Skip to content
Permalink
Browse files

Using pression::data API (#591)

  • Loading branch information...
eile committed Dec 12, 2016
1 parent 3982749 commit b104964e6b725c6666aa0c9e816d4726017b0dc4
@@ -1,2 +1,2 @@
# -*- mode: cmake -*-
# CMake/common https://github.com/Eyescale/CMake.git 3d5d284
# CMake/common https://github.com/Eyescale/CMake.git 62cbc09
@@ -1,9 +1,9 @@
# -*- mode: cmake -*-
git_subproject(vmmlib https://github.com/Eyescale/vmmlib.git 8795629)
git_subproject(Servus https://github.com/HBPVIS/Servus 001588d)
git_subproject(Lunchbox https://github.com/Eyescale/Lunchbox.git d9d3ff1)
git_subproject(Pression https://github.com/Eyescale/Pression.git 0a6bf49)
git_subproject(hwsd https://github.com/Eyescale/hwsd.git 8d17ad9)
git_subproject(Collage https://github.com/Eyescale/Collage.git 75c145a)
git_subproject(GLStats https://github.com/Eyescale/GLStats.git 840c29d)
git_subproject(Deflect https://github.com/BlueBrain/Deflect.git fd77ea4)
git_subproject(Servus https://github.com/HBPVIS/Servus 2da95ea)
git_subproject(Lunchbox https://github.com/Eyescale/Lunchbox.git aae4011)
git_subproject(Pression https://github.com/Eyescale/Pression.git 5c9d135)
git_subproject(hwsd https://github.com/Eyescale/hwsd.git 2898f91)
git_subproject(Collage https://github.com/Eyescale/Collage.git fccd96b)
git_subproject(GLStats https://github.com/Eyescale/GLStats.git 12d73c9)
git_subproject(Deflect https://github.com/BlueBrain/Deflect.git 76526f0)
@@ -52,5 +52,5 @@ else()
add_definitions(-DGLEW_MX=1 -DGLEW_NO_GLU -DGLEW_BUILD=1)
common_library(${GLEW_LIBRARY})

message(STATUS "Configured ${GLEW_LIBRARY} [${GLEW_VERSION}]")
message(STATUS "${GLEW_LIBRARY} [${GLEW_VERSION}]")
endif()
@@ -52,6 +52,7 @@
#include <lunchbox/monitor.h>
#include <lunchbox/scopedMutex.h>
#include <lunchbox/spinLock.h>
#include <pression/data/CompressorInfo.h>
#include <pression/plugins/compressor.h>

#ifdef EQUALIZER_USE_GLSTATS
@@ -76,7 +77,7 @@ namespace
class LatencyObject : public co::Object
{
public:
LatencyObject( const ChangeType type, const uint32_t compressor,
LatencyObject( const ChangeType type, const co::CompressorInfo& compressor,
const uint32_t frame )
: frameNumber( frame ), _changeType( type )
, _compressor( compressor ) {}
@@ -87,11 +88,11 @@ class LatencyObject : public co::Object
virtual ChangeType getChangeType() const { return _changeType; }
virtual void getInstanceData( co::DataOStream& ){ LBDONTCALL }
virtual void applyInstanceData( co::DataIStream& ){ LBDONTCALL }
virtual uint32_t chooseCompressor() const { return _compressor; }
virtual co::CompressorInfo chooseCompressor() const { return _compressor; }

private:
const ChangeType _changeType;
const uint32_t _compressor;
const co::CompressorInfo _compressor;
};
#ifdef EQUALIZER_USE_GLSTATS
namespace
@@ -581,7 +582,7 @@ EventOCommand Config::sendError( const uint32_t type, const Error& error )
Errors Config::getErrors()
{
Errors errors;
errors.swap(_impl->errors );
errors.swap( _impl->errors );
return errors;
}

@@ -84,11 +84,11 @@ class Object : public co::Serializable
//@}

/** @return true if the object has data to commit. @version 1.0 */
EQFABRIC_API virtual bool isDirty() const;
EQFABRIC_API bool isDirty() const override;

/** @internal */
EQFABRIC_API virtual uint128_t commit( const uint32_t incarnation =
CO_COMMIT_NEXT );
EQFABRIC_API uint128_t commit( const uint32_t incarnation =
CO_COMMIT_NEXT ) override;

/** @internal Back up app-specific data, excluding child data. */
EQFABRIC_API virtual void backup();
@@ -138,12 +138,12 @@ class Object : public co::Serializable
/** @internal Set the tasks this entity might potentially execute. */
EQFABRIC_API void setTasks( const uint32_t tasks );

EQFABRIC_API virtual void notifyDetach();
EQFABRIC_API void notifyDetach() override;

EQFABRIC_API virtual void serialize( co::DataOStream& os,
const uint64_t dirtyBits );
EQFABRIC_API virtual void deserialize( co::DataIStream& is,
const uint64_t dirtyBits );
EQFABRIC_API void serialize( co::DataOStream& os,
uint64_t dirtyBits ) override;
EQFABRIC_API void deserialize( co::DataIStream& is,
uint64_t dirtyBits ) override;

/** @internal @return the bits to be re-committed by the master. */
virtual uint64_t getRedistributableBits() const
@@ -167,10 +167,10 @@ class Object : public co::Serializable
/** @internal commit slave instance to the server. */
template< class C > inline
void commitChild( C* child, const uint32_t incarnation )
{
LBASSERT( child->isAttached( ));
child->commit( incarnation );
}
{
LBASSERT( child->isAttached( ));
child->commit( incarnation );
}

/** @internal commit, register child slave instances with the server. */
template< class C, class S >
@@ -30,8 +30,6 @@
#include <eq/util/objectManager.h>
#include <eq/fabric/renderContext.h>

#include <co/global.h>

#include <lunchbox/buffer.h>
#include <lunchbox/memoryMap.h>
#include <pression/compressor.h>
@@ -235,7 +233,7 @@ class Image
const Memory& memory = attachment.memory;
TransferFinder finder( memory.internalFormat, memory.externalFormat, 0,
attachment.quality, ignoreAlpha, gl );
co::Global::getPluginRegistry().accept( finder );
pression::PluginRegistry::getInstance().accept( finder );
return finder.result;
}
};
@@ -387,9 +385,8 @@ class CompressorFinder : public pression::ConstPluginVisitor
std::vector< uint32_t > Image::findCompressors( const Frame::Buffer buffer )
const
{
const pression::PluginRegistry& registry = co::Global::getPluginRegistry();
CompressorFinder finder( getExternalFormat( buffer ));
registry.accept( finder );
pression::PluginRegistry::getInstance().accept( finder );

LBLOG( LOG_PLUGIN )
<< "Found " << finder.result.size() << " compressors for token type 0x"
@@ -489,8 +486,7 @@ bool Image::upload( const Frame::Buffer buffer, util::Texture* texture,
const GLEWContext* const gl = om.glewGetContext();

if( !uploader->supports( externalFormat, internalFormat, flags, gl ))
uploader->setup( co::Global::getPluginRegistry(), externalFormat,
internalFormat, flags, gl );
uploader->setup( externalFormat, internalFormat, flags, gl );

if( !uploader->isGood( gl ))
{
@@ -582,8 +578,7 @@ bool Image::startReadback( const Frame::Buffer buffer,
const bool noAlpha = _impl->ignoreAlpha && buffer == Frame::BUFFER_COLOR;

if( !downloader.supports( inputToken, noAlpha, flags ))
downloader.setup( co::Global::getPluginRegistry(), inputToken,
attachment.quality, noAlpha, flags, gl );
downloader.setup( inputToken, attachment.quality, noAlpha, flags, gl );

if( !downloader.isGood( ))
{
@@ -902,8 +897,7 @@ void Image::setPixelData( const Frame::Buffer buffer, const PixelData& pixels )
LBASSERT( pixels.compressedData.compressor != EQ_COMPRESSOR_AUTO );

Attachment& attachment = _impl->getAttachment( buffer );
if( !attachment.decompressor->setup( co::Global::getPluginRegistry(),
pixels.compressedData.compressor ))
if( !attachment.decompressor->setup( pixels.compressedData.compressor ))
{
LBASSERTINFO( false,
"Can't allocate decompressor " <<
@@ -946,7 +940,7 @@ bool Image::allocCompressor( const Frame::Buffer buffer, const uint32_t name )
return true;

attachment.memory.compressedData = pression::CompressorResult();
compressor.setup( co::Global::getPluginRegistry(), name );
compressor.setup( name );
LBLOG( LOG_PLUGIN ) << "Instantiated compressor of type 0x" << std::hex
<< name << std::dec << std::endl;
return compressor.isGood();
@@ -973,7 +967,7 @@ bool Image::allocDownloader( const Frame::Buffer buffer, const uint32_t name,
if( downloader.uses( name ))
return true;

if( !downloader.setup( co::Global::getPluginRegistry(), name, gl ))
if( !downloader.setup( name, gl ))
return false;

const EqCompressorInfo& info = downloader.getInfo();
@@ -1024,12 +1018,10 @@ const PixelData& Image::compressPixelData( const Frame::Buffer buffer )
attachment.downloader[ attachment.active ].getInfo().quality;
const float quality = attachment.quality / downloadQuality;

compressor.setup( co::Global::getPluginRegistry(), tokenType,
quality, _impl->ignoreAlpha );
compressor.setup( tokenType, quality, _impl->ignoreAlpha );
}
else
compressor.setup( co::Global::getPluginRegistry(),
memory.compressorName );
compressor.setup( memory.compressorName );

if( !compressor.isGood( ))
{
@@ -81,7 +81,6 @@ const char EQ_RENDER_CLIENT[] = "eq-render-client";

static bool _parseArguments( const int argc, char** argv );
static void _initPlugins();
static void _exitPlugins();

bool _init( const int argc, char** argv, NodeFactory* nodeFactory )
{
@@ -149,7 +148,6 @@ bool exit()
_windowSystems.clear();

Global::_nodeFactory = 0;
_exitPlugins();
return fabric::exit();
}

@@ -261,68 +259,40 @@ bool _parseArguments( const int argc, char** argv )

void _initPlugins()
{
pression::PluginRegistry& plugins = co::Global::getPluginRegistry();
pression::PluginRegistry& plugins = pression::PluginRegistry::getInstance();

plugins.addDirectory( lunchbox::getRootPath() +
"/share/Equalizer/plugins" ); // install dir
plugins.addDirectory( "/usr/share/Equalizer/plugins" );
plugins.addDirectory( "/usr/local/share/Equalizer/plugins" );
plugins.addDirectory( ".eqPlugins" );
plugins.addDirectory( "/opt/local/lib" ); // MacPorts
plugins.addDirectory( "/usr/local/lib" ); // Homebrew
plugins.loadDirectory( lunchbox::getRootPath() +
"/share/Equalizer/plugins" ); // install dir
plugins.loadDirectory( "/usr/share/Equalizer/plugins" );
plugins.loadDirectory( "/usr/local/share/Equalizer/plugins" );
plugins.loadDirectory( ".eqPlugins" );
plugins.loadDirectory( "/opt/local/lib" ); // MacPorts
plugins.loadDirectory( "/usr/local/lib" ); // Homebrew

const char* home = getenv( "HOME" );
if( home )
plugins.addDirectory( std::string( home ) + "/.eqPlugins" );
plugins.loadDirectory( std::string( home ) + "/.eqPlugins" );

#ifdef EQUALIZER_DSO_NAME
if( plugins.addPlugin( EQUALIZER_DSO_NAME )) // Found by LDD
return;

// Hard-coded compile locations as backup:
plugins.loadFile( EQUALIZER_DSO_NAME );
std::string absDSO = std::string( EQ_BUILD_DIR ) + "lib/" +
EQUALIZER_DSO_NAME;
if( plugins.addPlugin( absDSO ))
return;
plugins.loadFile( absDSO );

# ifdef NDEBUG
absDSO = std::string( EQ_BUILD_DIR ) + "lib/Release/" + EQUALIZER_DSO_NAME;
# else
absDSO = std::string( EQ_BUILD_DIR ) + "lib/Debug/" + EQUALIZER_DSO_NAME;
# endif

if( plugins.addPlugin( absDSO ))
return;

LBWARN << "Built-in Equalizer plugins not loaded: " << EQUALIZER_DSO_NAME
<< " not in library search path and " << absDSO << " not found"
<< std::endl;
plugins.loadFile( absDSO );
#else
# ifndef NDEBUG
# error "EQUALIZER_DSO_NAME not defined"
# endif
LBWARN << "Built-in Equalizer plugins not loaded: EQUALIZER_DSO_NAME not "
<< "defined" << std::endl;
#endif
}

void _exitPlugins()
{
pression::PluginRegistry& plugins = co::Global::getPluginRegistry();

plugins.removeDirectory( lunchbox::getRootPath() +
"/share/Equalizer/plugins" );
plugins.removeDirectory( "/usr/share/Equalizer/plugins" );
plugins.removeDirectory( "/usr/local/share/Equalizer/plugins" );
plugins.removeDirectory( ".eqPlugins" );
plugins.removeDirectory( "/opt/local/lib" ); // MacPorts
plugins.removeDirectory( "/usr/local/lib" ); // Homebrew

const char* home = getenv( "HOME" );
if( home )
plugins.removeDirectory( std::string( home ) + "/.eqPlugins" );
}

Config* getConfig( const int argc, char** argv )
{
// 1. initialization of a local client node
@@ -1,5 +1,5 @@

/* Copyright (c) 2007-2015, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2007-2016, Stefan Eilemann <eile@equalizergraphics.com>
* Daniel Nachbaur <danielnachbaur@gmail.com>
*
* This library is free software; you can redistribute it and/or modify it under
@@ -21,6 +21,7 @@

#include <eq/util/types.h>
#include <eq/api.h>
#include <pression/types.h>

namespace eq
{
@@ -152,7 +152,6 @@ void FrameData::adjustQuality( const float delta )

void FrameData::serialize( co::DataOStream& os, const uint64_t dirtyBits )
{
co::Serializable::serialize( os, dirtyBits );
if( dirtyBits & DIRTY_VIEW )
os << _currentViewID;

@@ -169,7 +168,6 @@ void FrameData::serialize( co::DataOStream& os, const uint64_t dirtyBits )

void FrameData::deserialize( co::DataIStream& is, const uint64_t dirtyBits)
{
co::Serializable::deserialize( is, dirtyBits );
if( dirtyBits & DIRTY_VIEW )
is >> _currentViewID;

@@ -49,7 +49,6 @@ FrameData::FrameData()

void FrameData::serialize( co::DataOStream& os, const uint64_t dirtyBits )
{
co::Serializable::serialize( os, dirtyBits );
if( dirtyBits & DIRTY_CAMERA )
os << _position << _rotation << _modelRotation;
if( dirtyBits & DIRTY_FLAGS )
@@ -64,7 +63,6 @@ void FrameData::serialize( co::DataOStream& os, const uint64_t dirtyBits )

void FrameData::deserialize( co::DataIStream& is, const uint64_t dirtyBits )
{
co::Serializable::deserialize( is, dirtyBits );
if( dirtyBits & DIRTY_CAMERA )
is >> _position >> _rotation >> _modelRotation;
if( dirtyBits & DIRTY_FLAGS )
@@ -42,7 +42,6 @@ FrameData::FrameData()

void FrameData::serialize( co::DataOStream& os, const uint64_t dirtyBits )
{
co::Serializable::serialize( os, dirtyBits );
if( dirtyBits & DIRTY_CAMERA )
os << _cameraPosition << _cameraLookAtPoint << _cameraUpVector;
if( dirtyBits & DIRTY_FLAGS )
@@ -52,7 +51,6 @@ void FrameData::serialize( co::DataOStream& os, const uint64_t dirtyBits )
void FrameData::deserialize( co::DataIStream& is,
const uint64_t dirtyBits )
{
co::Serializable::deserialize( is, dirtyBits );
if( dirtyBits & DIRTY_CAMERA )
is >> _cameraPosition >> _cameraLookAtPoint >> _cameraUpVector;
if( dirtyBits & DIRTY_FLAGS )

0 comments on commit b104964

Please sign in to comment.
You can’t perform that action at this time.