gl-render-manager: Now threaded mode seems to work fine (and fast!). Shutdown doesn't, though, and there are stability issues.

This commit is contained in:
Henrik Rydgård 2018-01-16 15:19:35 +01:00
parent af6431986d
commit e5d571c25a
3 changed files with 9 additions and 3 deletions

View file

@ -116,7 +116,7 @@ void FormatDebugOutputARB(char outStr[], size_t outStrSize, GLenum source, GLenu
}
snprintf(severityStr, sizeof(severityStr), severityFmt, severity);
snprintf(outStr, sizeof(outStr), "OpenGL: %s [source=%s type=%s severity=%s id=%d]\n", msg, sourceStr, typeStr, severityStr, id);
snprintf(outStr, outStrSize, "OpenGL: %s [source=%s type=%s severity=%s id=%d]\n", msg, sourceStr, typeStr, severityStr, id);
}
void DebugCallbackARB(GLenum source, GLenum type, GLuint id, GLenum severity,

View file

@ -735,7 +735,9 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
tex->minFilter = c.textureSampler.minFilter;
}
if (tex->anisotropy != c.textureSampler.anisotropy) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, c.textureSampler.anisotropy);
if (c.textureSampler.anisotropy != 0.0f) {
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, c.textureSampler.anisotropy);
}
tex->anisotropy = c.textureSampler.anisotropy;
}
break;

View file

@ -285,7 +285,7 @@ void GLRenderManager::BeginFrame() {
}
// vulkan_->BeginFrame();
frameData.deleter.Perform();
// In GL, we have to do deletes on the submission thread.
insideFrame_ = true;
}
@ -328,6 +328,10 @@ void GLRenderManager::BeginSubmitFrame(int frame) {
if (!frameData.hasBegun) {
frameData.hasBegun = true;
}
// This should be the best time to perform deletes for the next frame.
FrameData &nextFrameData = frameData_[(frame + 1) % MAX_INFLIGHT_FRAMES];
nextFrameData.deleter.Perform();
}
void GLRenderManager::Submit(int frame, bool triggerFence) {