cleaned up opengl backend

Removed some legacy code (that had been all commented out by now anyway)
This commit is contained in:
itsmattkc
2019-11-17 13:48:36 +09:00
parent 823e820bfa
commit 2f8675f5f9
2 changed files with 6 additions and 87 deletions
@@ -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;i<deferred_maps_.size();i++) {
const HashTimeMapping& deferred = deferred_maps_.at(i);
if (deferred_maps_.at(i).hash == hash) {
// Insert into hash map
time_hash_map_.insert(deferred.time, deferred.hash);
deferred_maps_.removeAt(i);
i--;
}
}
}*/
+6 -4
View File
@@ -126,7 +126,6 @@ QVariant OpenGLWorker::RunNodeAccelerated(NodeOutput *out)
shader->setUniformValue(variable_location, input->value().value<QVector4D>());
break;
case NodeInput::kMatrix:
qDebug() << "Setting uniform value to matrix" << input->value().value<QMatrix4x4>();
shader->setUniformValue(variable_location, input->value().value<QMatrix4x4>());
break;
case NodeInput::kColor:
@@ -139,14 +138,17 @@ QVariant OpenGLWorker::RunNodeAccelerated(NodeOutput *out)
case NodeInput::kFootage:
{
OpenGLTexturePtr texture = input->value().value<OpenGLTexturePtr>();
//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;