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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-12 19:35:26 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-15 13:43:59 +0300
commit6cb06501c3283a4d443151ddb93ec5a097cd9078 (patch)
tree377ffccf11693602f2b8dd64d1937fb8a2117f4b /source/blender/gpu
parentec52e64a5df7da7637c912d79734b236049e6761 (diff)
GPU buffers: Use bitflag to whether we want to show diffuse color
Those fine-tuning bits will be extended soon, so makes sense to start using some more verbose flag names when calling functions.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_buffers.h11
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index e4a837d0a5f..1423361e8cb 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -237,10 +237,15 @@ GPU_PBVH_Buffers *GPU_pbvh_bmesh_buffers_build(bool smooth_shading);
/* update */
+enum {
+ GPU_PBVH_BUFFERS_SHOW_DIFFUSE_COLOR = (1 << 0),
+};
+
void GPU_pbvh_mesh_buffers_update(
GPU_PBVH_Buffers *buffers, const struct MVert *mvert,
const int *vert_indices, int totvert, const float *vmask,
- const int (*face_vert_indices)[3], bool show_diffuse_color);
+ const int (*face_vert_indices)[3],
+ const int update_flags);
void GPU_pbvh_bmesh_buffers_update(
GPU_PBVH_Buffers *buffers,
@@ -248,13 +253,13 @@ void GPU_pbvh_bmesh_buffers_update(
struct GSet *bm_faces,
struct GSet *bm_unique_verts,
struct GSet *bm_other_verts,
- bool show_diffuse_color);
+ const int update_flags);
void GPU_pbvh_grid_buffers_update(
GPU_PBVH_Buffers *buffers, struct CCGElem **grids,
const struct DMFlagMat *grid_flag_mats,
int *grid_indices, int totgrid, const struct CCGKey *key,
- bool show_diffuse_color);
+ const int update_flags);
/* draw */
void GPU_pbvh_buffers_draw(
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index e288c74fee6..09d6f80abb8 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1033,8 +1033,10 @@ static void gpu_color_from_mask_quad_copy(const CCGKey *key,
void GPU_pbvh_mesh_buffers_update(
GPU_PBVH_Buffers *buffers, const MVert *mvert,
const int *vert_indices, int totvert, const float *vmask,
- const int (*face_vert_indices)[3], bool show_diffuse_color)
+ const int (*face_vert_indices)[3],
+ const int update_flags)
{
+ const bool show_diffuse_color = (update_flags & GPU_PBVH_BUFFERS_SHOW_DIFFUSE_COLOR) != 0;
VertexBufferFormat *vert_data;
int i;
@@ -1239,8 +1241,10 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(
void GPU_pbvh_grid_buffers_update(
GPU_PBVH_Buffers *buffers, CCGElem **grids,
const DMFlagMat *grid_flag_mats, int *grid_indices,
- int totgrid, const CCGKey *key, bool show_diffuse_color)
+ int totgrid, const CCGKey *key,
+ const int update_flags)
{
+ const bool show_diffuse_color = (update_flags & GPU_PBVH_BUFFERS_SHOW_DIFFUSE_COLOR) != 0;
VertexBufferFormat *vert_data;
int i, j, k, x, y;
@@ -1611,8 +1615,9 @@ void GPU_pbvh_bmesh_buffers_update(
GSet *bm_faces,
GSet *bm_unique_verts,
GSet *bm_other_verts,
- bool show_diffuse_color)
+ const int update_flags)
{
+ const bool show_diffuse_color = (update_flags & GPU_PBVH_BUFFERS_SHOW_DIFFUSE_COLOR) != 0;
VertexBufferFormat *vert_data;
void *tri_data;
int tottri, totvert, maxvert = 0;