Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit f569f8f1 authored by Jakob Weiss's avatar Jakob Weiss

Fixed Linux build

parent 5889d2b8
......@@ -206,8 +206,9 @@ if(NOT TBB_FOUND)
# Find each component
foreach(_comp ${TBB_SEARCH_COMPOMPONENTS})
if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")
#message(STATUS ${_comp} ${TBB_FIND_COMPONENTS})
#if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")
message(STATUS "if " ${_comp})
# Search for the libraries
find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}
HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
......@@ -240,7 +241,7 @@ if(NOT TBB_FOUND)
mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG)
mark_as_advanced(TBB_${_comp}_LIBRARY)
endif()
#endif()
endforeach()
##################################
......
......@@ -251,8 +251,16 @@ ELSE(GLEW_FOUND)
ENDIF(GLEW_FOUND)
# TBB
FIND_PACKAGE(TBB REQUIRED)
IF(TBB_FOUND)
find_package(TBB QUIET)
if(NOT TBB_FOUND)
find_package(TBB_ COMPONENTS tbb tbbmalloc)#cmake/FindTBB_.cmake)
endif(NOT TBB_FOUND)
if(NOT TBB_FOUND)
message(FATAL_ERROR "TBB not found!")
endif(NOT TBB_FOUND)
IF(TARGET TBB::tbb)
MESSAGE(STATUS "* Found TBB")
#LIST(APPEND CampvisGlobalDefinitions ${TBB_DEFINITIONS})
#LIST(APPEND CampvisGlobalIncludeDirs ${TBB_INCLUDE_DIR})
......@@ -265,9 +273,11 @@ IF(TBB_FOUND)
#LIST(APPEND CampvisExternalLicenseFiles ${TBB_LICENSE_FILE})
# unfortunately, the new TBB API does no longer allow copying of mutexes, hence we need to set a fallback define
LIST(APPEND CampvisGlobalDefinitions "-DTBB_DEPRECATED_MUTEX_COPYING")
ELSE(TBB_FOUND)
MESSAGE(FATAL_ERROR "TBB not found!")
ENDIF(TBB_FOUND)
elseif(TBB_LIBRARIES)
LIST(APPEND CampvisGlobalDefinitions ${TBB_DEFINITIONS})
LIST(APPEND CampvisGlobalExternalLibs ${TBB_LIBRARIES})
LIST(APPEND CampvisGlobalDefinitions "-DTBB_DEPRECATED_MUTEX_COPYING")
ENDIF(TARGET TBB::tbb)
# Eigen
IF(EXISTS "${CampvisHome}/ext/eigen/Eigen/Eigen")
......
......@@ -31,7 +31,7 @@
#include "cgt/bounds.h"
#include "core/coreapi.h"
#include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
//NOTE: This one is at the end of this file :) #include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
namespace campvis {
......@@ -67,7 +67,7 @@ namespace campvis {
// using MutexType = std::shared_timed_mutex;
// using LockType = std::shared_lock < MutexType>;
typedef tbb::queuing_rw_mutex MutexType;
typedef MutexType::scoped_lock LockType;
typedef tbb::queuing_rw_mutex::scoped_lock LockType;
/**
* Constructor, simply calles ReferenceCounted ctor.
......@@ -117,4 +117,6 @@ namespace campvis {
}
#include "core/datastructures/scopedtypeddata.h" // not directly needed here but by many classes including AbstractData
#endif // ABSTRACTDATA_H__
......@@ -84,13 +84,15 @@ namespace campvis {
if (renderData) {
// check if we can get a GL representation of the desired texture
ImageRepresentationGL* glRep;
if (attachment == GL_DEPTH_ATTACHMENT)
if (attachment == GL_DEPTH_ATTACHMENT) {
if(auto id = (*renderData)->getDepthTexture())
glRep = const_cast<ImageRepresentationGL*>(id->getRepresentation<ImageRepresentationGL>(false));
else
}
else {
if(auto id =(*renderData)->getColorTexture(_fbo->getNumColorAttachments())) //_fbo->getNumColorAttachments() is the index of the texture that is to be created
glRep = const_cast<ImageRepresentationGL*>(id->getRepresentation<ImageRepresentationGL>(false));
}
// check if the texture is compatible with what we want, and in that case detach from the old RenderTargetData
if (glRep) {
tex = const_cast<cgt::Texture*>(glRep->getTexture());
......
......@@ -38,6 +38,7 @@
#include "cgt/logmanager.h"
#include <algorithm>
//using namespace std;
using std::string;
......
......@@ -240,7 +240,7 @@ void cgt::TextureManager::run()
}
}
constexpr size_t cgt::TextureManager::textureByteSize(const cache_key_t & key)
size_t cgt::TextureManager::textureByteSize(const cache_key_t & key)
{
return key.size_x * key.size_y * key.size_z * GLTextureFormatTraits::get(key.internalFormat).bpp();
}
......
......@@ -88,7 +88,7 @@ namespace cgt {
const int garbageLifetime = 10;
/// Compute the memory size from the cache entry key
static constexpr size_t textureByteSize(const cache_key_t& key);
static size_t textureByteSize(const cache_key_t& key);
/// Convert the texture type to a humanly readable string
static std::string textureTypeToStr(GLenum tt);
......
......@@ -62,7 +62,7 @@ namespace campvis {
void LocalAmbientOcclusionDecorator::renderProlog(const DataContainer& dataContainer, cgt::Shader* shader) {
auto aotf = p_aoEmissiveTransferFunction.getTF();
_aoTFUnit = std::make_unique<cgt::TextureUnit>();
_aoTFUnit = std::unique_ptr<cgt::TextureUnit>(new cgt::TextureUnit());
aotf->bind(shader, *_aoTFUnit, "_aoEmissiveTF", "_aoEmissiveTFParams");
shader->setUniform("_aoSphereRadius", p_aoSphereRadius.getValue());
......
......@@ -34,7 +34,7 @@ namespace campvis {
// explicitly instantiate templates to register the processors
template class SmartProcessorRegistrar<DataSeriesSplitter>;
template class SmartProcessorRegistrar<LightSourceProvider>;
template class SmartProcessorRegistrar<MatrixProcessor>;
template class SmartProcessorRegistrar<TrackballCameraProvider>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment