fixed issues with some opengl implementations

This commit is contained in:
itsmattkc
2019-09-13 00:32:41 +10:00
parent 28687d4852
commit c5572876fa
10 changed files with 102 additions and 48 deletions
+7
View File
@@ -254,6 +254,10 @@ void RendererProcessor::Start()
int background_thread_count = QThread::idealThreadCount();
// Some OpenGL implementations (notably wgl) require the context not to be current before sharing
QSurface* old_surface = ctx->surface();
ctx->doneCurrent();
threads_.resize(background_thread_count);
for (int i=0;i<threads_.size();i++) {
@@ -297,6 +301,9 @@ void RendererProcessor::Start()
last_download_thread_ = 0;
// Restore context now that thread creation is complete
ctx->makeCurrent(old_surface);
// Create master texture (the one sent to the viewer)
master_texture_ = std::make_shared<RenderTexture>();
master_texture_->Create(ctx, effective_width_, effective_height_, format_);