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:
authorJoseph Eagar <joeedh@gmail.com>2022-06-30 07:04:07 +0300
committerThomas Dinges <blender@dingto.org>2022-06-30 17:08:12 +0300
commit8677874168162d4d4e3f6cbbec2ec2bd566dd588 (patch)
tree751d233f2374e8779482427487d7827aeecc0b08
parent9410d7bd2e9d8c5fc45341624ee5968490bca388 (diff)
Fix T98886: PBVH_GRIDS ignores face smooth flag on first gpu build
-rw-r--r--source/blender/blenkernel/intern/pbvh.c9
-rw-r--r--source/blender/gpu/GPU_buffers.h4
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c3
3 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 640b532e417..d82f2bbf99d 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1301,9 +1301,14 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata,
if (node->flag & PBVH_RebuildDrawBuffers) {
switch (pbvh->type) {
- case PBVH_GRIDS:
- node->draw_buffers = GPU_pbvh_grid_buffers_build(node->totprim, pbvh->grid_hidden);
+ case PBVH_GRIDS: {
+ bool smooth = node->totprim > 0 ?
+ pbvh->grid_flag_mats[node->prim_indices[0]].flag & ME_SMOOTH :
+ false;
+
+ node->draw_buffers = GPU_pbvh_grid_buffers_build(node->totprim, pbvh->grid_hidden, smooth);
break;
+ }
case PBVH_FACES:
node->draw_buffers = GPU_pbvh_mesh_buffers_build(
pbvh->mpoly,
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index 1af0080baef..4c682a5e378 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -53,7 +53,9 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const struct MPoly *mpoly,
/**
* Threaded: do not call any functions that use OpenGL calls!
*/
-GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(int totgrid, unsigned int **grid_hidden);
+GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(int totgrid,
+ unsigned int **grid_hidden,
+ bool smooth);
/**
* Threaded: do not call any functions that use OpenGL calls!
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index fed998bb33e..11c80fb0326 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -783,13 +783,14 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers,
buffers->show_overlay = !empty_mask || !default_face_set;
}
-GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(int totgrid, BLI_bitmap **grid_hidden)
+GPU_PBVH_Buffers *GPU_pbvh_grid_buffers_build(int totgrid, BLI_bitmap **grid_hidden, bool smooth)
{
GPU_PBVH_Buffers *buffers;
buffers = MEM_callocN(sizeof(GPU_PBVH_Buffers), "GPU_Buffers");
buffers->grid_hidden = grid_hidden;
buffers->totgrid = totgrid;
+ buffers->smooth = smooth;
buffers->show_overlay = false;