From 646313624062da404e5c82d89e62ba093d2f64a2 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 13 Jan 2016 18:37:24 -0800 Subject: [PATCH] start/stopNamedCall run in renderPassTransfer too --- libraries/gpu/src/gpu/GLBackend.cpp | 16 ++++++++++++++++ libraries/gpu/src/gpu/GLBackend.h | 14 ++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/libraries/gpu/src/gpu/GLBackend.cpp b/libraries/gpu/src/gpu/GLBackend.cpp index b03346e96b..7f2f98e656 100644 --- a/libraries/gpu/src/gpu/GLBackend.cpp +++ b/libraries/gpu/src/gpu/GLBackend.cpp @@ -173,6 +173,8 @@ void GLBackend::renderPassTransfer(Batch& batch) { captureDrawCallInfo(); break; + case Batch::COMMAND_startNamedCall: + case Batch::COMMAND_stopNamedCall: case Batch::COMMAND_setModelTransform: case Batch::COMMAND_setViewportTransform: case Batch::COMMAND_setViewTransform: @@ -258,6 +260,20 @@ void GLBackend::render(Batch& batch) { _stereo._enable = savedStereo; } + +GLBackend::DrawCallInfoBuffer& GLBackend::getDrawCallInfoBuffer() { + if (_currentNamedCall.empty()) { + return _drawCallInfos; + } else { + return _namedDrawCallInfos[_currentNamedCall]; + } +} + +void GLBackend::captureDrawCallInfo() { + auto& drawCallInfos = getDrawCallInfoBuffer(); + drawCallInfos.push_back(_transform._objects.size() - 1); +} + bool GLBackend::checkGLError(const char* name) { GLenum error = glGetError(); if (!error) { diff --git a/libraries/gpu/src/gpu/GLBackend.h b/libraries/gpu/src/gpu/GLBackend.h index 8cda7e444b..86d06b9605 100644 --- a/libraries/gpu/src/gpu/GLBackend.h +++ b/libraries/gpu/src/gpu/GLBackend.h @@ -265,18 +265,8 @@ protected: std::string _currentNamedCall; - DrawCallInfoBuffer& getDrawCallInfoBuffer() { - if (_currentNamedCall.empty()) { - return _drawCallInfos; - } else { - return _namedDrawCallInfos[_currentNamedCall]; - } - } - - void captureDrawCallInfo() { - auto& drawCallInfos = getDrawCallInfoBuffer(); - drawCallInfos.push_back(_transform._objects.size() - 1); - } + DrawCallInfoBuffer& getDrawCallInfoBuffer(); + void captureDrawCallInfo(); Stats _stats;