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>2018-09-05 18:02:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-05 20:00:13 +0300
commit457df4fa9ba4bebff69caff62c98586d62337f8d (patch)
tree4bc359a12e035b847521a9ce949a9bd3a655e30b /source/blender/draw/intern
parentc05b9bbcc09f15912c741809646902458ea27958 (diff)
Edit Mesh: Add support for draw option parameters
The visuals was already implemented but we could not toggle them off.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/DRW_render.h1
-rw-r--r--source/blender/draw/intern/draw_cache_impl.h23
-rw-r--r--source/blender/draw/intern/draw_cache_impl_curve.c4
-rw-r--r--source/blender/draw/intern/draw_cache_impl_lattice.c5
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c23
-rw-r--r--source/blender/draw/intern/draw_manager_data.c5
6 files changed, 29 insertions, 32 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 7c3701266c7..eedac5e43c2 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -405,6 +405,7 @@ void DRW_shgroup_uniform_bool(DRWShadingGroup *shgroup, const char *name, const
void DRW_shgroup_uniform_int(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize);
void DRW_shgroup_uniform_ivec2(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize);
void DRW_shgroup_uniform_ivec3(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize);
+void DRW_shgroup_uniform_ivec4(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize);
void DRW_shgroup_uniform_mat3(DRWShadingGroup *shgroup, const char *name, const float (*value)[3]);
void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, const char *name, const float (*value)[4]);
/* Store value instead of referencing it. */
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h
index bae7e65f5e8..d601bfc3a3e 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -134,6 +134,29 @@ void DRW_mesh_batch_cache_get_wireframes_face_texbuf(
void DRW_mesh_cache_sculpt_coords_ensure(struct Mesh *me);
+/* Edit mesh bitflags (is this the right place?) */
+
+enum {
+ VFLAG_VERTEX_ACTIVE = 1 << 0,
+ VFLAG_VERTEX_SELECTED = 1 << 1,
+ VFLAG_FACE_ACTIVE = 1 << 2,
+ VFLAG_FACE_SELECTED = 1 << 3,
+ VFLAG_FACE_FREESTYLE = 1 << 4,
+ /* Beware to not go over 1 << 7 (it's a byte flag)
+ * (see gpu_shader_edit_mesh_overlay_geom.glsl) */
+};
+
+enum {
+ VFLAG_EDGE_EXISTS = 1 << 0,
+ VFLAG_EDGE_ACTIVE = 1 << 1,
+ VFLAG_EDGE_SELECTED = 1 << 2,
+ VFLAG_EDGE_SEAM = 1 << 3,
+ VFLAG_EDGE_SHARP = 1 << 4,
+ VFLAG_EDGE_FREESTYLE = 1 << 5,
+ /* Beware to not go over 1 << 7 (it's a byte flag)
+ * (see gpu_shader_edit_mesh_overlay_geom.glsl) */
+};
+
/* Particles */
struct GPUBatch *DRW_particles_batch_cache_get_hair(
struct Object *object, struct ParticleSystem *psys, struct ModifierData *md);
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c
index 3fd8a970db9..bad15dfe697 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.c
+++ b/source/blender/draw/intern/draw_cache_impl_curve.c
@@ -292,10 +292,6 @@ static int curve_render_data_normal_len_get(const CurveRenderData *rdata)
return rdata->normal.len;
}
-enum {
- VFLAG_VERTEX_SELECTED = 1 << 0,
- VFLAG_VERTEX_ACTIVE = 1 << 1,
-};
/* ---------------------------------------------------------------------- */
/* Curve GPUBatch Cache */
diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c
index 4ffbe7b7546..b077162b41d 100644
--- a/source/blender/draw/intern/draw_cache_impl_lattice.c
+++ b/source/blender/draw/intern/draw_cache_impl_lattice.c
@@ -273,11 +273,6 @@ static void lattice_render_data_weight_col_get(const LatticeRenderData *rdata, c
}
}
-enum {
- VFLAG_VERTEX_SELECTED = 1 << 0,
- VFLAG_VERTEX_ACTIVE = 1 << 1,
-};
-
/* ---------------------------------------------------------------------- */
/* Lattice GPUBatch Cache */
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 1c70d40d6f1..238d2f28c43 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1331,29 +1331,6 @@ static bool mesh_render_data_edge_vcos_manifold_pnors(
return true;
}
-
-/* First 2 bytes are bit flags
- * 3rd is for sharp edges
- * 4rd is for creased edges */
-enum {
- VFLAG_VERTEX_ACTIVE = 1 << 0,
- VFLAG_VERTEX_SELECTED = 1 << 1,
- VFLAG_FACE_ACTIVE = 1 << 2,
- VFLAG_FACE_SELECTED = 1 << 3,
- VFLAG_FACE_FREESTYLE = 1 << 4,
-};
-
-enum {
- VFLAG_EDGE_EXISTS = 1 << 0,
- VFLAG_EDGE_ACTIVE = 1 << 1,
- VFLAG_EDGE_SELECTED = 1 << 2,
- VFLAG_EDGE_SEAM = 1 << 3,
- VFLAG_EDGE_SHARP = 1 << 4,
- VFLAG_EDGE_FREESTYLE = 1 << 5,
- /* Beware to not go over 1 << 7
- * (see gpu_shader_edit_mesh_overlay_geom.glsl) */
-};
-
static uchar mesh_render_data_looptri_flag(MeshRenderData *rdata, const BMFace *efa)
{
uchar fflag = 0;
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 96e862d2439..26507a83553 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -220,6 +220,11 @@ void DRW_shgroup_uniform_ivec3(DRWShadingGroup *shgroup, const char *name, const
drw_shgroup_uniform(shgroup, name, DRW_UNIFORM_INT, value, 3, arraysize);
}
+void DRW_shgroup_uniform_ivec4(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
+{
+ drw_shgroup_uniform(shgroup, name, DRW_UNIFORM_INT, value, 4, arraysize);
+}
+
void DRW_shgroup_uniform_mat3(DRWShadingGroup *shgroup, const char *name, const float (*value)[3])
{
drw_shgroup_uniform(shgroup, name, DRW_UNIFORM_FLOAT, (float *)value, 9, 1);