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
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-31 19:42:14 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-01 01:30:36 +0300
commit13b0a697a07e84abe5a62168ba75f38d325d3f22 (patch)
tree71f2b3837d4bcca781300eb9697f146ec0d7e841 /source
parent052538edc1fba109d3427471047611888ed13bea (diff)
Cleanup: GPU: Remove GPU_draw_primitive and default_vao_
These are not used anymore and can be replicated using the GPUBatch API.
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/GPU_batch.h3
-rw-r--r--source/blender/gpu/intern/gpu_batch.cc16
-rw-r--r--source/blender/gpu/intern/gpu_context.cc6
-rw-r--r--source/blender/gpu/intern/gpu_context_private.hh2
-rw-r--r--source/blender/gpu/opengl/gl_context.cc3
-rw-r--r--source/blender/gpu/opengl/gl_context.hh2
6 files changed, 0 insertions, 32 deletions
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h
index e87ad328f1d..b45898f9c6a 100644
--- a/source/blender/gpu/GPU_batch.h
+++ b/source/blender/gpu/GPU_batch.h
@@ -154,9 +154,6 @@ void GPU_batch_draw_instanced(GPUBatch *batch, int i_count);
/* This does not bind/unbind shader and does not call GPU_matrix_bind() */
void GPU_batch_draw_advanced(GPUBatch *, int v_first, int v_count, int i_first, int i_count);
-/* Does not even need batch */
-void GPU_draw_primitive(GPUPrimType, int v_count);
-
#if 0 /* future plans */
/* Can multiple batches share a GPUVertBuf? Use ref count? */
diff --git a/source/blender/gpu/intern/gpu_batch.cc b/source/blender/gpu/intern/gpu_batch.cc
index c3554d9abc8..0b0c88a42e2 100644
--- a/source/blender/gpu/intern/gpu_batch.cc
+++ b/source/blender/gpu/intern/gpu_batch.cc
@@ -280,22 +280,6 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
static_cast<Batch *>(batch)->draw(v_first, v_count, i_first, i_count);
}
-/* just draw some vertices and let shader place them where we want. */
-void GPU_draw_primitive(GPUPrimType prim_type, int v_count)
-{
- GPU_context_active_get()->state_manager->apply_state();
-
- /* we cannot draw without vao ... annoying ... */
- glBindVertexArray(GPU_vao_default());
-
- GLenum type = blender::gpu::to_gl(prim_type);
- glDrawArrays(type, 0, v_count);
-
- /* Performance hog if you are drawing with the same vao multiple time.
- * Only activate for debugging.*/
- // glBindVertexArray(0);
-}
-
/** \} */
/* -------------------------------------------------------------------- */
diff --git a/source/blender/gpu/intern/gpu_context.cc b/source/blender/gpu/intern/gpu_context.cc
index 229456f9aa5..85e7dffe3e7 100644
--- a/source/blender/gpu/intern/gpu_context.cc
+++ b/source/blender/gpu/intern/gpu_context.cc
@@ -126,12 +126,6 @@ GPUContext *GPU_context_active_get(void)
return active_ctx;
}
-GLuint GPU_vao_default(void)
-{
- BLI_assert(active_ctx); /* need at least an active context */
- return static_cast<GLContext *>(active_ctx)->default_vao_;
-}
-
GLuint GPU_vao_alloc(void)
{
GLuint new_vao_id = 0;
diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh
index b32406bfc44..b72eee13105 100644
--- a/source/blender/gpu/intern/gpu_context_private.hh
+++ b/source/blender/gpu/intern/gpu_context_private.hh
@@ -82,8 +82,6 @@ struct GPUContext {
MEM_CXX_CLASS_ALLOC_FUNCS("GPUContext")
};
-GLuint GPU_vao_default(void);
-
/* These require a gl ctx bound. */
GLuint GPU_buf_alloc(void);
GLuint GPU_tex_alloc(void);
diff --git a/source/blender/gpu/opengl/gl_context.cc b/source/blender/gpu/opengl/gl_context.cc
index e5373777894..e89eeca1c8a 100644
--- a/source/blender/gpu/opengl/gl_context.cc
+++ b/source/blender/gpu/opengl/gl_context.cc
@@ -47,8 +47,6 @@ using namespace blender::gpu;
GLContext::GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list)
: shared_orphan_list_(shared_orphan_list)
{
- glGenVertexArrays(1, &default_vao_);
-
float data[4] = {0.0f, 0.0f, 0.0f, 1.0f};
glGenBuffers(1, &default_attr_vbo_);
glBindBuffer(GL_ARRAY_BUFFER, default_attr_vbo_);
@@ -101,7 +99,6 @@ GLContext::~GLContext()
for (GLVaoCache *cache : vao_caches_) {
cache->clear();
}
- glDeleteVertexArrays(1, &default_vao_);
glDeleteBuffers(1, &default_attr_vbo_);
}
diff --git a/source/blender/gpu/opengl/gl_context.hh b/source/blender/gpu/opengl/gl_context.hh
index c19731f217a..55af7d8f65d 100644
--- a/source/blender/gpu/opengl/gl_context.hh
+++ b/source/blender/gpu/opengl/gl_context.hh
@@ -61,8 +61,6 @@ class GLSharedOrphanLists {
class GLContext : public GPUContext {
/* TODO(fclem) these needs to become private. */
public:
- /** Default VAO for procedural draw calls. */
- GLuint default_vao_;
/** VBO for missing vertex attrib binding. Avoid undefined behavior on some implementation. */
GLuint default_attr_vbo_;
/**