[Bf-blender-cvs] [c5c6b5ddb31] master: GPUCapabilities: Isolate GL_STEREO to GLContext
Clément Foucault
noreply at git.blender.org
Mon Sep 7 20:17:48 CEST 2020
Commit: c5c6b5ddb31c8a79667d6dcd689808efd3dadd8a
Author: Clément Foucault
Date: Mon Sep 7 19:52:22 2020 +0200
Branches: master
https://developer.blender.org/rBc5c6b5ddb31c8a79667d6dcd689808efd3dadd8a
GPUCapabilities: Isolate GL_STEREO to GLContext
This is part of the Vulkan task T68990
This is a simple cleanup.
===================================================================
M source/blender/gpu/intern/gpu_capabilities.cc
M source/blender/gpu/opengl/gl_context.cc
===================================================================
diff --git a/source/blender/gpu/intern/gpu_capabilities.cc b/source/blender/gpu/intern/gpu_capabilities.cc
index 83b9597abbb..71bf479b4a8 100644
--- a/source/blender/gpu/intern/gpu_capabilities.cc
+++ b/source/blender/gpu/intern/gpu_capabilities.cc
@@ -143,9 +143,7 @@ void GPU_mem_stats_get(int *totalmem, int *freemem)
/* Return support for the active context + window. */
bool GPU_stereo_quadbuffer_support(void)
{
- GLboolean stereo = GL_FALSE;
- glGetBooleanv(GL_STEREO, &stereo);
- return stereo == GL_TRUE;
+ return GPU_context_active_get()->front_right != nullptr;
}
/** \} */
diff --git a/source/blender/gpu/opengl/gl_context.cc b/source/blender/gpu/opengl/gl_context.cc
index 1495e665aa8..ec6cc9e6159 100644
--- a/source/blender/gpu/opengl/gl_context.cc
+++ b/source/blender/gpu/opengl/gl_context.cc
@@ -80,8 +80,8 @@ GLContext::GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list
front_left = new GLFrameBuffer("front_left", this, GL_FRONT_LEFT, 0, w, h);
back_left = new GLFrameBuffer("back_left", this, GL_BACK_LEFT, 0, w, h);
}
- /* TODO(fclem) enable is supported. */
- const bool supports_stereo_quad_buffer = false;
+ GLboolean supports_stereo_quad_buffer = GL_FALSE;
+ glGetBooleanv(GL_STEREO, &supports_stereo_quad_buffer);
if (supports_stereo_quad_buffer) {
front_right = new GLFrameBuffer("front_right", this, GL_FRONT_RIGHT, 0, w, h);
back_right = new GLFrameBuffer("back_right", this, GL_BACK_RIGHT, 0, w, h);
More information about the Bf-blender-cvs
mailing list