mirror of
https://github.com/lubosz/overte.git
synced 2025-04-07 16:42:08 +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")
|
||||
target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES})
|
||||
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 ()
|
||||
endforeach()
|
||||
|
|
|
@ -139,17 +139,9 @@ static void debugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum s
|
|||
if (GL_DEBUG_SEVERITY_NOTIFICATION == severity) {
|
||||
return;
|
||||
}
|
||||
qCDebug(glLogging) << "OpenGL: " << message;
|
||||
|
||||
// For high severity errors, force a sync to the log, since we might crash
|
||||
// FIXME For high severity errors, force a sync to the log, since we might crash
|
||||
// before the log file was flushed otherwise. Performance hit here
|
||||
//if (GL_DEBUG_SEVERITY_HIGH == severity) {
|
||||
// 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();
|
||||
// }
|
||||
//}
|
||||
qCDebug(glLogging) << "OpenGL: " << message;
|
||||
}
|
||||
|
||||
static void setupPixelFormatSimple(HDC hdc) {
|
||||
|
|
|
@ -224,7 +224,7 @@ void GLBackend::renderPassTransfer(const Batch& batch) {
|
|||
}
|
||||
|
||||
{ // Sync the transform buffers
|
||||
PROFILE_RANGE(render_gpu_gl_detail, "syncGPUTransform");
|
||||
PROFILE_RANGE(render_gpu_gl_detail, "transferGPUTransform");
|
||||
transferTransformState(batch);
|
||||
}
|
||||
|
||||
|
@ -385,21 +385,21 @@ void GLBackend::resetStages() {
|
|||
|
||||
void GLBackend::do_pushProfileRange(const Batch& batch, size_t paramOffset) {
|
||||
if (trace_render_gpu_gl_detail().isDebugEnabled()) {
|
||||
auto name = batch._profileRanges.get(batch._params[paramOffset]._uint);
|
||||
profileRanges.push_back(name);
|
||||
auto name = batch._profileRanges.get(batch._params[paramOffset]._uint);
|
||||
profileRanges.push_back(name);
|
||||
#if defined(NSIGHT_FOUND)
|
||||
nvtxRangePush(name.c_str());
|
||||
nvtxRangePush(name.c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GLBackend::do_popProfileRange(const Batch& batch, size_t paramOffset) {
|
||||
if (trace_render_gpu_gl_detail().isDebugEnabled()) {
|
||||
profileRanges.pop_back();
|
||||
profileRanges.pop_back();
|
||||
#if defined(NSIGHT_FOUND)
|
||||
nvtxRangePop();
|
||||
nvtxRangePop();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
if (_pipeline._stateCache.multisampleEnable != enable) {
|
||||
//if (enable) {
|
||||
// glEnable(GL_MULTISAMPLE);
|
||||
//} else {
|
||||
// glDisable(GL_MULTISAMPLE);
|
||||
//}
|
||||
#if !defined(USE_GLES)
|
||||
if (enable) {
|
||||
glEnable(GL_MULTISAMPLE);
|
||||
} else {
|
||||
glDisable(GL_MULTISAMPLE);
|
||||
}
|
||||
(void)CHECK_GL_ERROR();
|
||||
#endif
|
||||
|
||||
_pipeline._stateCache.multisampleEnable = enable;
|
||||
}
|
||||
|
@ -137,12 +139,14 @@ void GLBackend::do_setStateMultisampleEnable(bool enable) {
|
|||
|
||||
void GLBackend::do_setStateAntialiasedLineEnable(bool enable) {
|
||||
if (_pipeline._stateCache.antialisedLineEnable != enable) {
|
||||
//if (enable) {
|
||||
// glEnable(GL_LINE_SMOOTH);
|
||||
//} else {
|
||||
// glDisable(GL_LINE_SMOOTH);
|
||||
//}
|
||||
#if !defined(USE_GLES)
|
||||
if (enable) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
} else {
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
}
|
||||
(void)CHECK_GL_ERROR();
|
||||
#endif
|
||||
|
||||
_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 != 0.0f) || (bias.y != 0.0f)) {
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
//glEnable(GL_POLYGON_OFFSET_LINE);
|
||||
//glEnable(GL_POLYGON_OFFSET_POINT);
|
||||
#if !defined(USE_GLES)
|
||||
glEnable(GL_POLYGON_OFFSET_LINE);
|
||||
glEnable(GL_POLYGON_OFFSET_POINT);
|
||||
#endif
|
||||
glPolygonOffset(bias.x, bias.y);
|
||||
} else {
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
//glDisable(GL_POLYGON_OFFSET_LINE);
|
||||
//glDisable(GL_POLYGON_OFFSET_POINT);
|
||||
#if !defined(USE_GLES)
|
||||
glDisable(GL_POLYGON_OFFSET_LINE);
|
||||
glDisable(GL_POLYGON_OFFSET_POINT);
|
||||
#endif
|
||||
}
|
||||
(void)CHECK_GL_ERROR();
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ QUrl AddressManager::currentFacingShareableAddress() const {
|
|||
|
||||
void AddressManager::loadSettings(const QString& lookupString) {
|
||||
if (lookupString.isEmpty()) {
|
||||
handleUrl(DEFAULT_HIFI_ADDRESS, LookupTrigger::StartupFromSettings);
|
||||
handleUrl(currentAddressHandle.get(), LookupTrigger::StartupFromSettings);
|
||||
} else {
|
||||
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 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
|
||||
vec4 color = mix(fadeParameters[params.category]._innerEdgeColor, fadeParameters[params.category]._outerEdgeColor, edgeAlpha);
|
||||
emissive = color.rgb * edgeMask * color.a;
|
||||
|
|
|
@ -271,31 +271,3 @@ bool PathUtils::isDescendantOf(const QUrl& childURL, const QUrl& parentURL) {
|
|||
QString parent = stripFilename(parentURL);
|
||||
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)
|
||||
static bool isDescendantOf(const QUrl& childURL, const QUrl& parentURL);
|
||||
static QUrl defaultScriptsLocation(const QString& newDefault = "");
|
||||
static void copyDirDeep(QString src, QString dst);
|
||||
|
||||
};
|
||||
|
||||
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions);
|
||||
|
|
|
@ -28,7 +28,7 @@ int main(int argc, char** argv) {
|
|||
if (!window->makeCurrent()) {
|
||||
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);
|
||||
window->swapBuffers();
|
||||
window->doneCurrent();
|
||||
|
|
Loading…
Reference in a new issue