Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-07 19:52:30 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-07 20:37:04 +0300
commit171b36683a774d70a8f25529858b9c002a2a317e (patch)
treec87999c9f5ae85936d283868fc70f192af44263d /source/blender/gpu/opengl/gl_batch.cc
parent360489c75167d47653bc34ad9ba9a65076bf384c (diff)
GPUExtensions: GL backend isolation
This is part of the Vulkan task T68990. This commits changes a few things: - Rename extensions to capabilities (but left the file name untouched). - Cubemap mip render workaround detection is rewritten using gl commands to avoid using the GPU API before initialization. - Put all the capabilities that are only relevant for the GL backend inside GLContext as static variables. - Cleanup the names of the limit variables. - Separate all GL related workaround search inside the GL module.
Diffstat (limited to 'source/blender/gpu/opengl/gl_batch.cc')
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index db30a57953d..f4ad7194ce1 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -34,6 +34,7 @@
#include "gpu_batch_private.hh"
#include "gpu_shader_private.hh"
+#include "gl_backend.hh"
#include "gl_context.hh"
#include "gl_debug.hh"
#include "gl_index_buffer.hh"
@@ -314,7 +315,7 @@ void GLBatch::bind(int i_first)
#endif
/* Can be removed if GL 4.2 is required. */
- if (!GPU_arb_base_instance_is_supported() && (i_first > 0)) {
+ if (!GLContext::base_instance_support && (i_first > 0)) {
glBindVertexArray(vao_cache_.base_instance_vao_get(this, i_first));
}
else {
@@ -339,7 +340,7 @@ void GLBatch::draw(int v_first, int v_count, int i_first, int i_count)
GLint base_index = el->index_base_;
void *v_first_ofs = el->offset_ptr(v_first);
- if (GPU_arb_base_instance_is_supported()) {
+ if (GLContext::base_instance_support) {
glDrawElementsInstancedBaseVertexBaseInstance(
gl_type, v_count, index_type, v_first_ofs, i_count, base_index, i_first);
}
@@ -353,7 +354,7 @@ void GLBatch::draw(int v_first, int v_count, int i_first, int i_count)
#ifdef __APPLE__
glDisable(GL_PRIMITIVE_RESTART);
#endif
- if (GPU_arb_base_instance_is_supported()) {
+ if (GLContext::base_instance_support) {
glDrawArraysInstancedBaseInstance(gl_type, v_first, v_count, i_count, i_first);
}
else {