diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp index a3cf91fcd5..f5d335adea 100644 --- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp @@ -571,10 +571,15 @@ void OpenGLDisplayPlugin::compositeLayers() { compositeScene(); } + +#ifdef HIFI_ENABLE_NSIGHT_DEBUG + if (false) // do not compositeoverlay if running nsight debug +#endif { PROFILE_RANGE_EX(render_detail, "compositeOverlay", 0xff0077ff, (uint64_t)presentCount()) compositeOverlay(); } + auto compositorHelper = DependencyManager::get(); if (compositorHelper->getReticleVisible()) { PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount()) diff --git a/libraries/gl/src/gl/Config.h b/libraries/gl/src/gl/Config.h index 7947bd45df..9efae96f2a 100644 --- a/libraries/gl/src/gl/Config.h +++ b/libraries/gl/src/gl/Config.h @@ -28,6 +28,9 @@ #include +// Uncomment this define and recompile to be able to avoid code path preventing to be able to run nsight graphics debug +//#define HIFI_ENABLE_NSIGHT_DEBUG 1 + #endif #endif // hifi_gpu_GPUConfig_h diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp index de0caf56a9..07bc4179b7 100644 --- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp +++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp @@ -278,6 +278,11 @@ void OffscreenQmlSurface::cleanup() { } void OffscreenQmlSurface::render() { + +#ifdef HIFI_ENABLE_NSIGHT_DEBUG + return; +#endif + if (_paused) { return; } diff --git a/libraries/gpu-gl/src/gpu/gl41/GL41BackendTransform.cpp b/libraries/gpu-gl/src/gpu/gl41/GL41BackendTransform.cpp index aa0a83689c..526bac9ec8 100644 --- a/libraries/gpu-gl/src/gpu/gl41/GL41BackendTransform.cpp +++ b/libraries/gpu-gl/src/gpu/gl41/GL41BackendTransform.cpp @@ -95,7 +95,6 @@ void GL41Backend::updateTransform(const Batch& batch) { } else { if (!_transform._enabledDrawcallInfoBuffer) { glEnableVertexAttribArray(gpu::Stream::DRAW_CALL_INFO); // Make sure attrib array is enabled - glBindBuffer(GL_ARRAY_BUFFER, _transform._drawCallInfoBuffer); #ifdef GPU_STEREO_DRAWCALL_INSTANCED glVertexAttribDivisor(gpu::Stream::DRAW_CALL_INFO, (isStereo() ? 2 : 1)); #else @@ -103,6 +102,7 @@ void GL41Backend::updateTransform(const Batch& batch) { #endif _transform._enabledDrawcallInfoBuffer = true; } + glBindBuffer(GL_ARRAY_BUFFER, _transform._drawCallInfoBuffer); glVertexAttribIPointer(gpu::Stream::DRAW_CALL_INFO, 2, GL_UNSIGNED_SHORT, 0, _transform._drawCallInfoOffsets[batch._currentNamedCall]); }