diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-17 06:31:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-17 06:31:01 +0300 |
commit | aa66f2c7eb4a79f30c3c3b329885181bdb034993 (patch) | |
tree | 2b4dbad08e74a5c67df529270a1913aa366feed9 /source/blender/editors/space_view3d/drawobject.c | |
parent | 431b7c8eb1a3795332f1c49a1ad0f69beba43bbd (diff) |
Use byte color for selection drawing
Some small advantage to using 1/4 sized data-type.
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cfde4adfd5f..aad175e8a65 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -9354,9 +9354,9 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset) VertexFormat *format = immVertexFormat(); data.pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, KEEP_INT); - immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR_U32); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); @@ -9387,9 +9387,9 @@ static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset) data.offset = offset; VertexFormat *format = immVertexFormat(); data.pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, KEEP_INT); - immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR_U32); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); @@ -9445,9 +9445,9 @@ static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset) if (imm_len == 0) return; data.pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, KEEP_INT); - immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR_U32); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); @@ -9516,9 +9516,9 @@ static void bbs_mesh_face(BMEditMesh *em, DerivedMesh *dm, const bool use_select VertexFormat *format = immVertexFormat(); data.pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, KEEP_INT); - immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR_U32); immBeginAtMost(PRIM_TRIANGLES, imm_len); @@ -9574,9 +9574,9 @@ static void bbs_mesh_face_dot(BMEditMesh *em, DerivedMesh *dm) data.bm = em->bm; VertexFormat *format = immVertexFormat(); data.pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 3, KEEP_FLOAT); - data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT); + data.col = VertexFormat_add_attrib(format, "color", COMP_U8, 3, KEEP_INT); - immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); + immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR_U32); glPointSize(UI_GetThemeValuef(TH_FACEDOT_SIZE)); |