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-08-09 00:37:43 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-13 15:20:23 +0300
commit186abf7d3bab9ed8b905c6914de02427bb2547cf (patch)
tree0f442dec935f30192eaf50300fb65d5553f6d718 /source/blender/draw/intern
parent38ef35b1ed1d38ab58c7d7fb121f4f3b33869810 (diff)
GPUBatch: Remove usage of gl_prim_type outside of GPU module
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_instance_data.c4
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c
index 5005f38c558..a40fc1726d7 100644
--- a/source/blender/draw/intern/draw_instance_data.c
+++ b/source/blender/draw/intern/draw_instance_data.c
@@ -152,7 +152,7 @@ GPUBatch *DRW_temp_batch_instance_request(DRWInstanceDataList *idatalist,
bool instancer_compat = buf ? ((batch->inst[0] == buf) && (buf->vbo_id != 0)) :
((batch->inst[0] == instancer->inst[0]) &&
(batch->inst[1] == instancer->inst[1]));
- bool is_compatible = (batch->gl_prim_type == geom->gl_prim_type) && instancer_compat &&
+ bool is_compatible = (batch->prim_type == geom->prim_type) && instancer_compat &&
(batch->phase == GPU_BATCH_READY_TO_DRAW) && (batch->elem == geom->elem);
for (int i = 0; i < GPU_BATCH_VBO_MAX_LEN && is_compatible; i++) {
if (batch->verts[i] != geom->verts[i]) {
@@ -186,7 +186,7 @@ GPUBatch *DRW_temp_batch_request(DRWInstanceDataList *idatalist,
GPUBatch *batch = *batch_ptr;
bool is_compatible = (batch->verts[0] == buf) && (buf->vbo_id != 0) &&
- (batch->gl_prim_type == convert_prim_type_to_gl(prim_type));
+ (batch->prim_type == prim_type);
if (!is_compatible) {
GPU_batch_clear(batch);
GPU_batch_init(batch, prim_type, buf, NULL);
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index 8f5dba87a56..c36b8834b9d 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -865,10 +865,10 @@ BLI_INLINE void draw_select_buffer(DRWShadingGroup *shgroup,
/* Batching */
if (!is_instancing) {
/* FIXME: Meh a bit nasty. */
- if (batch->gl_prim_type == convert_prim_type_to_gl(GPU_PRIM_TRIS)) {
+ if (batch->prim_type == GPU_PRIM_TRIS) {
count = 3;
}
- else if (batch->gl_prim_type == convert_prim_type_to_gl(GPU_PRIM_LINES)) {
+ else if (batch->prim_type == GPU_PRIM_LINES) {
count = 2;
}
}