mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
PR feedback
This commit is contained in:
parent
d53b8b38ac
commit
d2fe9e2710
9 changed files with 36 additions and 66 deletions
|
@ -240,7 +240,7 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
||||||
if (NOT APPLE OR NOT ${${EXTERNAL}_UPPERCASE} MATCHES "SIXENSE")
|
if (NOT APPLE OR NOT ${${EXTERNAL}_UPPERCASE} MATCHES "SIXENSE")
|
||||||
target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES})
|
target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES})
|
||||||
elseif (APPLE AND NOT INSTALLER_BUILD)
|
elseif (APPLE AND NOT INSTALLER_BUILD)
|
||||||
#add_definitions(-DSIXENSE_LIB_FILENAME=\"${${${EXTERNAL}_UPPERCASE}_LIBRARY_RELEASE}\")
|
add_definitions(-DSIXENSE_LIB_FILENAME=\"${${${EXTERNAL}_UPPERCASE}_LIBRARY_RELEASE}\")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
@ -139,17 +139,9 @@ static void debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum s
|
||||||
if (GL_DEBUG_SEVERITY_NOTIFICATION == severity) {
|
if (GL_DEBUG_SEVERITY_NOTIFICATION == severity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qCDebug(glLogging) << "OpenGL: " << message;
|
// FIXME For high severity errors, force a sync to the log, since we might crash
|
||||||
|
|
||||||
// For high severity errors, force a sync to the log, since we might crash
|
|
||||||
// before the log file was flushed otherwise. Performance hit here
|
// before the log file was flushed otherwise. Performance hit here
|
||||||
//if (GL_DEBUG_SEVERITY_HIGH == severity) {
|
qCDebug(glLogging) << "OpenGL: " << message;
|
||||||
// AbstractLoggerInterface* logger = AbstractLoggerInterface::get();
|
|
||||||
// if (logger) {
|
|
||||||
// // FIXME find a way to force the log file to sync that doesn't lead to a deadlock
|
|
||||||
// // logger->sync();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setupPixelFormatSimple(HDC hdc) {
|
static void setupPixelFormatSimple(HDC hdc) {
|
||||||
|
|
|
@ -224,7 +224,7 @@ void GLBackend::renderPassTransfer(const Batch& batch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // Sync the transform buffers
|
{ // Sync the transform buffers
|
||||||
PROFILE_RANGE(render_gpu_gl_detail, "syncGPUTransform");
|
PROFILE_RANGE(render_gpu_gl_detail, "transferGPUTransform");
|
||||||
transferTransformState(batch);
|
transferTransformState(batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,21 +385,21 @@ void GLBackend::resetStages() {
|
||||||
|
|
||||||
void GLBackend::do_pushProfileRange(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_pushProfileRange(const Batch& batch, size_t paramOffset) {
|
||||||
if (trace_render_gpu_gl_detail().isDebugEnabled()) {
|
if (trace_render_gpu_gl_detail().isDebugEnabled()) {
|
||||||
auto name = batch._profileRanges.get(batch._params[paramOffset]._uint);
|
auto name = batch._profileRanges.get(batch._params[paramOffset]._uint);
|
||||||
profileRanges.push_back(name);
|
profileRanges.push_back(name);
|
||||||
#if defined(NSIGHT_FOUND)
|
#if defined(NSIGHT_FOUND)
|
||||||
nvtxRangePush(name.c_str());
|
nvtxRangePush(name.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::do_popProfileRange(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_popProfileRange(const Batch& batch, size_t paramOffset) {
|
||||||
if (trace_render_gpu_gl_detail().isDebugEnabled()) {
|
if (trace_render_gpu_gl_detail().isDebugEnabled()) {
|
||||||
profileRanges.pop_back();
|
profileRanges.pop_back();
|
||||||
#if defined(NSIGHT_FOUND)
|
#if defined(NSIGHT_FOUND)
|
||||||
nvtxRangePop();
|
nvtxRangePop();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: As long as we have gl calls explicitely issued from interface
|
// TODO: As long as we have gl calls explicitely issued from interface
|
||||||
|
|
|
@ -124,12 +124,14 @@ void GLBackend::do_setStateScissorEnable(bool enable) {
|
||||||
|
|
||||||
void GLBackend::do_setStateMultisampleEnable(bool enable) {
|
void GLBackend::do_setStateMultisampleEnable(bool enable) {
|
||||||
if (_pipeline._stateCache.multisampleEnable != enable) {
|
if (_pipeline._stateCache.multisampleEnable != enable) {
|
||||||
//if (enable) {
|
#if !defined(USE_GLES)
|
||||||
// glEnable(GL_MULTISAMPLE);
|
if (enable) {
|
||||||
//} else {
|
glEnable(GL_MULTISAMPLE);
|
||||||
// glDisable(GL_MULTISAMPLE);
|
} else {
|
||||||
//}
|
glDisable(GL_MULTISAMPLE);
|
||||||
|
}
|
||||||
(void)CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
|
#endif
|
||||||
|
|
||||||
_pipeline._stateCache.multisampleEnable = enable;
|
_pipeline._stateCache.multisampleEnable = enable;
|
||||||
}
|
}
|
||||||
|
@ -137,12 +139,14 @@ void GLBackend::do_setStateMultisampleEnable(bool enable) {
|
||||||
|
|
||||||
void GLBackend::do_setStateAntialiasedLineEnable(bool enable) {
|
void GLBackend::do_setStateAntialiasedLineEnable(bool enable) {
|
||||||
if (_pipeline._stateCache.antialisedLineEnable != enable) {
|
if (_pipeline._stateCache.antialisedLineEnable != enable) {
|
||||||
//if (enable) {
|
#if !defined(USE_GLES)
|
||||||
// glEnable(GL_LINE_SMOOTH);
|
if (enable) {
|
||||||
//} else {
|
glEnable(GL_LINE_SMOOTH);
|
||||||
// glDisable(GL_LINE_SMOOTH);
|
} else {
|
||||||
//}
|
glDisable(GL_LINE_SMOOTH);
|
||||||
|
}
|
||||||
(void)CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
|
#endif
|
||||||
|
|
||||||
_pipeline._stateCache.antialisedLineEnable = enable;
|
_pipeline._stateCache.antialisedLineEnable = enable;
|
||||||
}
|
}
|
||||||
|
@ -152,13 +156,17 @@ void GLBackend::do_setStateDepthBias(Vec2 bias) {
|
||||||
if ((bias.x != _pipeline._stateCache.depthBias) || (bias.y != _pipeline._stateCache.depthBiasSlopeScale)) {
|
if ((bias.x != _pipeline._stateCache.depthBias) || (bias.y != _pipeline._stateCache.depthBiasSlopeScale)) {
|
||||||
if ((bias.x != 0.0f) || (bias.y != 0.0f)) {
|
if ((bias.x != 0.0f) || (bias.y != 0.0f)) {
|
||||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||||
//glEnable(GL_POLYGON_OFFSET_LINE);
|
#if !defined(USE_GLES)
|
||||||
//glEnable(GL_POLYGON_OFFSET_POINT);
|
glEnable(GL_POLYGON_OFFSET_LINE);
|
||||||
|
glEnable(GL_POLYGON_OFFSET_POINT);
|
||||||
|
#endif
|
||||||
glPolygonOffset(bias.x, bias.y);
|
glPolygonOffset(bias.x, bias.y);
|
||||||
} else {
|
} else {
|
||||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||||
//glDisable(GL_POLYGON_OFFSET_LINE);
|
#if !defined(USE_GLES)
|
||||||
//glDisable(GL_POLYGON_OFFSET_POINT);
|
glDisable(GL_POLYGON_OFFSET_LINE);
|
||||||
|
glDisable(GL_POLYGON_OFFSET_POINT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
(void)CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ QUrl AddressManager::currentFacingShareableAddress() const {
|
||||||
|
|
||||||
void AddressManager::loadSettings(const QString& lookupString) {
|
void AddressManager::loadSettings(const QString& lookupString) {
|
||||||
if (lookupString.isEmpty()) {
|
if (lookupString.isEmpty()) {
|
||||||
handleUrl(DEFAULT_HIFI_ADDRESS, LookupTrigger::StartupFromSettings);
|
handleUrl(currentAddressHandle.get(), LookupTrigger::StartupFromSettings);
|
||||||
} else {
|
} else {
|
||||||
handleUrl(lookupString, LookupTrigger::StartupFromSettings);
|
handleUrl(lookupString, LookupTrigger::StartupFromSettings);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ void applyFade(FadeObjectParams params, vec3 position, out vec3 emissive) {
|
||||||
float edgeMask = alpha * fadeParameters[params.category]._edgeWidthInvWidth.y;
|
float edgeMask = alpha * fadeParameters[params.category]._edgeWidthInvWidth.y;
|
||||||
float edgeAlpha = 1.0-clamp(edgeMask, 0.0, 1.0);
|
float edgeAlpha = 1.0-clamp(edgeMask, 0.0, 1.0);
|
||||||
|
|
||||||
edgeMask = step(edgeMask, 1.f);
|
edgeMask = step(edgeMask, 1.0);
|
||||||
edgeAlpha *= edgeAlpha; // Square to have a nice ease out
|
edgeAlpha *= edgeAlpha; // Square to have a nice ease out
|
||||||
vec4 color = mix(fadeParameters[params.category]._innerEdgeColor, fadeParameters[params.category]._outerEdgeColor, edgeAlpha);
|
vec4 color = mix(fadeParameters[params.category]._innerEdgeColor, fadeParameters[params.category]._outerEdgeColor, edgeAlpha);
|
||||||
emissive = color.rgb * edgeMask * color.a;
|
emissive = color.rgb * edgeMask * color.a;
|
||||||
|
|
|
@ -271,31 +271,3 @@ bool PathUtils::isDescendantOf(const QUrl& childURL, const QUrl& parentURL) {
|
||||||
QString parent = stripFilename(parentURL);
|
QString parent = stripFilename(parentURL);
|
||||||
return child.startsWith(parent, PathUtils::getFSCaseSensitivity());
|
return child.startsWith(parent, PathUtils::getFSCaseSensitivity());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathUtils::copyDirDeep(QString src, QString dst) {
|
|
||||||
QDir dir = QDir::root();
|
|
||||||
dir.mkpath(dst);
|
|
||||||
QDirIterator it(src, QStringList() << "*", QDir::Files|QDir::AllDirs, QDirIterator::Subdirectories);
|
|
||||||
while (it.hasNext()) {
|
|
||||||
QString f = it.next();
|
|
||||||
QFileInfo fInfo(f);
|
|
||||||
QString newDst = dst + (dst.endsWith("/")?"":"/") + fInfo.fileName();
|
|
||||||
if (fInfo.isFile()) {
|
|
||||||
QFile dfile(f);
|
|
||||||
if (dfile.exists(f))
|
|
||||||
{
|
|
||||||
if (dfile.copy(newDst)) {
|
|
||||||
QFile::setPermissions(newDst, QFile::ReadOwner);
|
|
||||||
} else {
|
|
||||||
QFile::setPermissions(newDst, QFile::ReadOwner);
|
|
||||||
// sometimes copy returns false but it worked anyway
|
|
||||||
//qWarning() << "Could not copy to " << newDst;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (fInfo.isDir() ) {
|
|
||||||
copyDirDeep(f, newDst);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,6 @@ public:
|
||||||
// note: this is FS-case-sensitive version of parentURL.isParentOf(childURL)
|
// note: this is FS-case-sensitive version of parentURL.isParentOf(childURL)
|
||||||
static bool isDescendantOf(const QUrl& childURL, const QUrl& parentURL);
|
static bool isDescendantOf(const QUrl& childURL, const QUrl& parentURL);
|
||||||
static QUrl defaultScriptsLocation(const QString& newDefault = "");
|
static QUrl defaultScriptsLocation(const QString& newDefault = "");
|
||||||
static void copyDirDeep(QString src, QString dst);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions);
|
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions);
|
||||||
|
|
|
@ -28,7 +28,7 @@ int main(int argc, char** argv) {
|
||||||
if (!window->makeCurrent()) {
|
if (!window->makeCurrent()) {
|
||||||
throw std::runtime_error("Failed");
|
throw std::runtime_error("Failed");
|
||||||
}
|
}
|
||||||
glClearColor(1.0, 0.0, 1.0, 1.0);
|
glClearColor(1.0f, 0.0f, 1.0f, 1.0f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
window->swapBuffers();
|
window->swapBuffers();
|
||||||
window->doneCurrent();
|
window->doneCurrent();
|
||||||
|
|
Loading…
Reference in a new issue