From 13b0a697a07e84abe5a62168ba75f38d325d3f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 31 Aug 2020 18:42:14 +0200 Subject: Cleanup: GPU: Remove GPU_draw_primitive and default_vao_ These are not used anymore and can be replicated using the GPUBatch API. --- source/blender/gpu/intern/gpu_batch.cc | 16 ---------------- source/blender/gpu/intern/gpu_context.cc | 6 ------ source/blender/gpu/intern/gpu_context_private.hh | 2 -- 3 files changed, 24 deletions(-) (limited to 'source/blender/gpu/intern') 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)->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(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); -- cgit v1.2.3