From 2f8675f5f9f771e92047004012c48a96d8c12982 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 17 Nov 2019 13:48:36 +0900 Subject: [PATCH] cleaned up opengl backend Removed some legacy code (that had been all commented out by now anyway) --- app/render/backend/opengl/openglbackend.cpp | 83 --------------------- app/render/backend/opengl/openglworker.cpp | 10 ++- 2 files changed, 6 insertions(+), 87 deletions(-) diff --git a/app/render/backend/opengl/openglbackend.cpp b/app/render/backend/opengl/openglbackend.cpp index 560fa8973..1fbc2b779 100644 --- a/app/render/backend/opengl/openglbackend.cpp +++ b/app/render/backend/opengl/openglbackend.cpp @@ -204,54 +204,6 @@ void OpenGLBackend::ThreadCompletedFrame(NodeDependency path, QByteArray hash) CacheNext(); } -/*void OpenGLBackend::ThreadCallback(OpenGLTexturePtr texture, const rational& time, const QByteArray& hash) -{ - // Threads are all done now, time to proceed - caching_ = false; - - DeferMap(time, hash); - - if (texture != nullptr) { - // We received a texture, time to start downloading it - QString fn = CachePathName(hash); - } else { - // There was no texture here, we must update the viewer - DownloadThreadComplete(hash); - } - - // If the connected output is using this time, signal it to update - if (last_time_requested_ == time) { - - copy_buffer_.Bind(); - - QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); - - if (texture == nullptr) { - - // No texture, clear the master and push it - f->glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - f->glClear(GL_COLOR_BUFFER_BIT); - - } else { - texture->Bind(); - - f->glViewport(0, 0, master_texture_->width(), master_texture_->height()); - - olive::gl::Blit(copy_pipeline_); - - texture->Release(); - } - - copy_buffer_.Release(); - - push_time_ = time; - - emit CachedFrameReady(time); - } - - CacheNext(); -}*/ - void OpenGLBackend::ThreadCompletedDownload(NodeDependency dep, QByteArray hash) { frame_cache()->SetHash(dep.in(), hash); @@ -271,38 +223,3 @@ void OpenGLBackend::ThreadHashAlreadyExists(NodeDependency dep, QByteArray hash) ThreadSkippedFrame(); } - -/*void OpenGLBackend::ThreadSkippedFrame(const rational& time, const QByteArray& hash) -{ - caching_ = false; - - DeferMap(time, hash); - - if (!IsCaching(hash)) { - DownloadThreadComplete(hash); - - // Signal output to update value - emit CachedFrameReady(time); - } - - CacheNext(); -}*/ - -/*void OpenGLBackend::DownloadThreadComplete(const QByteArray &hash) -{ - cache_hash_list_mutex_.lock(); - cache_hash_list_.removeAll(hash); - cache_hash_list_mutex_.unlock(); - - for (int i=0;isetUniformValue(variable_location, input->value().value()); break; case NodeInput::kMatrix: - qDebug() << "Setting uniform value to matrix" << input->value().value(); shader->setUniformValue(variable_location, input->value().value()); break; case NodeInput::kColor: @@ -139,14 +138,17 @@ QVariant OpenGLWorker::RunNodeAccelerated(NodeOutput *out) case NodeInput::kFootage: { OpenGLTexturePtr texture = input->value().value(); - //qDebug() << " Binding" << texture->texture() << "from" << input << "to GL_TEXTURE" << input_texture_count; functions_->glActiveTexture(GL_TEXTURE0 + input_texture_count); - functions_->glBindTexture(GL_TEXTURE_2D, texture->texture()); + + if (texture == nullptr) { + functions_->glBindTexture(GL_TEXTURE_2D, 0); + } else { + functions_->glBindTexture(GL_TEXTURE_2D, texture->texture()); + } // Set value to bound texture shader->setUniformValue(variable_location, input_texture_count); - //qDebug() << " Setting" << input->id() << "to" << input_texture_count; input_texture_count++; break;