[Bf-blender-cvs] [0947c97fade] blender2.8: OpenGL: use PRIM instead of GL enum everywhere else
Commit: 0947c97fade7a5400e22d85b1f61c5a0f552976a Author: Mike Erwin Date: Sat Apr 8 00:50:36 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB0947c97fade7a5400e22d85b1f61c5a0f552976a OpenGL: use PRIM instead of GL enum everywhere else Well, everywhere that uses Gawain for drawing. Places that call OpenGL directly still use GL enums. Part of T49043 === M source/blender/blenkernel/intern/mesh_render.c M source/blender/draw/intern/draw_cache.c M source/blender/draw/intern/draw_manager.c M source/blender/editors/interface/interface_draw.c M source/blender/editors/space_view3d/drawarmature.c M source/blender/editors/space_view3d/drawobject.c M source/blender/editors/uvedit/uvedit_smart_stitch.c M source/blender/gpu/intern/gpu_batch.c M source/blender/gpu/intern/gpu_compositing.c M source/blender/windowmanager/manipulators/intern/wm_manipulator.c === diff --git a/source/blender/blenkernel/intern/mesh_render.c b/source/blender/blenkernel/intern/mesh_render.c index cde412e3ae5..c1495ab325b 100644 --- a/source/blender/blenkernel/intern/mesh_render.c +++ b/source/blender/blenkernel/intern/mesh_render.c @@ -971,7 +971,7 @@ static ElementList *mesh_batch_cache_get_edges_in_order(MeshRenderData *mrdata, const int edge_ct = mesh_render_data_edges_num_get(mrdata); ElementListBuilder elb; - ElementListBuilder_init(, GL_LINES, edge_ct, vertex_ct); + ElementListBuilder_init(, PRIM_LINES, edge_ct, vertex_ct); for (int i = 0; i < edge_ct; ++i) { int vert_idx[2]; mesh_render_data_edge_verts_indices_get(mrdata, i, vert_idx); @@ -992,7 +992,7 @@ static ElementList *mesh_batch_cache_get_triangles_in_order(MeshRenderData *mrda const int tri_ct = mesh_render_data_looptri_num_get(mrdata); ElementListBuilder elb; - ElementListBuilder_init(, GL_TRIANGLES, tri_ct, vertex_ct); + ElementListBuilder_init(, PRIM_TRIANGLES, tri_ct, vertex_ct); for (int i = 0; i < tri_ct; ++i) { int tri_vert_idx[3]; mesh_render_data_looptri_verts_indices_get(mrdata, i, tri_vert_idx); @@ -1013,7 +1013,7 @@ Batch *BKE_mesh_batch_cache_get_all_edges(Mesh *me) /* create batch from Mesh */ MeshRenderData *mrdata = mesh_render_data_create(me, MR_DATATYPE_VERT | MR_DATATYPE_EDGE); - cache->all_edges = Batch_create(GL_LINES, mesh_batch_cache_get_pos_and_nor_in_order(mrdata, cache), + cache->all_edges = Batch_create(PRIM_LINES, mesh_batch_cache_get_pos_and_nor_in_order(mrdata, cache), mesh_batch_cache_get_edges_in_order(mrdata, cache)); mesh_render_data_free(mrdata); @@ -1030,7 +1030,7 @@ Batch *BKE_mesh_batch_cache_get_all_triangles(Mesh *me) /* create batch from DM */ MeshRenderData *mrdata = mesh_render_data_create(me, MR_DATATYPE_VERT | MR_DATATYPE_LOOPTRI); - cache->all_triangles = Batch_create(GL_TRIANGLES, mesh_batch_cache_get_pos_and_nor_in_order(mrdata, cache), + cache->all_triangles = Batch_create(PRIM_TRIANGLES, mesh_batch_cache_get_pos_and_nor_in_order(mrdata, cache), mesh_batch_cache_get_triangles_in_order(mrdata, cache)); mesh_render_data_free(mrdata); @@ -1046,7 +1046,7 @@ Batch *BKE_mesh_batch_cache_get_triangles_with_normals(Mesh *me) if (cache->triangles_with_normals == NULL) { MeshRenderData *mrdata = mesh_render_data_create(me, MR_DATATYPE_VERT | MR_DATATYPE_LOOPTRI | MR_DATATYPE_LOOP | MR_DATATYPE_POLY); - cache->triangles_with_normals = Batch_create(GL_TRIANGLES, mesh_batch_cache_get_pos_and_normals(mrdata, cache), NULL); + cache->triangles_with_normals = Batch_create(PRIM_TRIANGLES, mesh_batch_cache_get_pos_and_normals(mrdata, cache), NULL); mesh_render_data_free(mrdata); } @@ -1061,7 +1061,7 @@ Batch *BKE_mesh_batch_cache_get_points_with_normals(Mesh *me) if (cache->points_with_normals == NULL) { MeshRenderData *mrdata = mesh_render_data_create(me, MR_DATATYPE_VERT | MR_DATATYPE_LOOPTRI | MR_DATATYPE_LOOP | MR_DATATYPE_POLY); - cache->points_with_normals = Batch_create(GL_POINTS, mesh_batch_cache_get_pos_and_normals(mrdata, cache), NULL); + cache->points_with_normals = Batch_create(PRIM_POINTS, mesh_batch_cache_get_pos_and_normals(mrdata, cache), NULL); mesh_render_data_free(mrdata); } @@ -1077,7 +1077,7 @@ Batch *BKE_mesh_batch_cache_get_all_verts(Mesh
[Bf-blender-cvs] [d5883bb1ba6] blender2.8: Gawain: remove GL enum from primitive API
Commit: d5883bb1ba6e4cfdd70bd3b8c0531a22c616b1be Author: Mike Erwin Date: Sat Apr 8 01:19:25 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBd5883bb1ba6e4cfdd70bd3b8c0531a22c616b1be Gawain: remove GL enum from primitive API Callers now have to use Gawain's PRIM enum to specify geometric primitives. This makes the API more bullet-proof (at least less vulnerable) since GLenum covers waaay more than GL_POINTS, GL_LINES, etc. Also prepares us for Vulkan. === M intern/gawain/gawain/batch.h M intern/gawain/gawain/primitive.h M intern/gawain/src/batch.c M intern/gawain/src/immediate.c M intern/gawain/src/primitive.c === diff --git a/intern/gawain/gawain/batch.h b/intern/gawain/gawain/batch.h index 189a586f964..532c45ae832 100644 --- a/intern/gawain/gawain/batch.h +++ b/intern/gawain/gawain/batch.h @@ -28,6 +28,7 @@ typedef struct Batch { VertexBuffer* verts[BATCH_MAX_VBO_CT]; // verts[0] is required, others can be NULL ElementList* elem; // NULL if element list not needed PrimitiveType prim_type; + GLenum gl_prim_type; // book-keeping GLuint vao_id; // remembers all geometry state (vertex attrib bindings & element buffer) diff --git a/intern/gawain/gawain/primitive.h b/intern/gawain/gawain/primitive.h index 214902e9a2b..c9123ec79df 100644 --- a/intern/gawain/gawain/primitive.h +++ b/intern/gawain/gawain/primitive.h @@ -14,21 +14,21 @@ #include "common.h" typedef enum { - PRIM_POINTS = GL_POINTS, - PRIM_LINES = GL_LINES, - PRIM_TRIANGLES = GL_TRIANGLES, + PRIM_POINTS, + PRIM_LINES, + PRIM_TRIANGLES, + PRIM_LINE_STRIP, + PRIM_LINE_LOOP, // GL has this, Vulkan does not + PRIM_TRIANGLE_STRIP, + PRIM_TRIANGLE_FAN, + + PRIM_LINE_STRIP_ADJACENCY, #ifdef WITH_GL_PROFILE_COMPAT - PRIM_QUADS_XXX = GL_QUADS, // legacy GL has this, modern GL & Vulkan do not + PRIM_QUADS_XXX, // legacy GL has this, modern GL & Vulkan do not #endif - PRIM_LINE_STRIP = GL_LINE_STRIP, - PRIM_LINE_STRIP_ADJACENCY = GL_LINE_STRIP_ADJACENCY, - PRIM_LINE_LOOP = GL_LINE_LOOP, // GL has this, Vulkan does not - PRIM_TRIANGLE_STRIP = GL_TRIANGLE_STRIP, - PRIM_TRIANGLE_FAN = GL_TRIANGLE_FAN, - - PRIM_NONE = 0xF + PRIM_NONE } PrimitiveType; // what types of primitives does each shader expect? @@ -42,3 +42,5 @@ typedef enum { PrimitiveClass prim_class_of_type(PrimitiveType); bool prim_type_belongs_to_class(PrimitiveType, PrimitiveClass); + +GLenum convert_prim_type_to_gl(PrimitiveType); diff --git a/intern/gawain/src/batch.c b/intern/gawain/src/batch.c index 68771e59383..7e904cbd487 100644 --- a/intern/gawain/src/batch.c +++ b/intern/gawain/src/batch.c @@ -30,8 +30,6 @@ void Batch_init(Batch* batch, PrimitiveType prim_type, VertexBuffer* verts, Elem { #if TRUST_NO_ONE assert(verts != NULL); - // assert(prim_type == PRIM_POINTS || prim_type == PRIM_LINES || prim_type == PRIM_TRIANGLES); - // we will allow other primitive types in a future update #endif batch->verts[0] = verts; @@ -39,6 +37,7 @@ void Batch_init(Batch* batch, PrimitiveType prim_type, VertexBuffer* verts, Elem batch->verts[v] = NULL; batch->elem = elem; batch->prim_type = prim_type; + batch->gl_prim_type = convert_prim_type_to_gl(prim_type); batch->phase = READY_TO_DRAW; } @@ -304,15 +303,15 @@ void Batch_draw(Batch* batch) #if TRACK_INDEX_RANGE if (el->base_index) - glDrawRangeElementsBaseVertex(batch->prim_type, el->min_index, el->max_index, el->index_ct, el->index_type, 0, el->base_index); + glDrawRangeElementsBaseVertex(batch->gl_prim_type, el->min_index, el->max_index, el->index_ct, el->index_type, 0, el->base_index); else - glDrawRangeElements(batch->prim_type, el->min_index, el->max_index, el->index_ct, el->index_type, 0); + glDrawRangeElements(batch->gl_prim_type, el->min_index, el->max_index, el->index_ct, el->index_type, 0); #else - glDrawElements(batch->prim_type, el->index_ct, GL_UNSIGNED_INT, 0); + glDrawElements(batch->gl_prim_type, el->index_ct, GL_UNSIGNED_INT, 0); #endif } else - glDrawArrays(batch->prim_type, 0, batch->verts[0]->vertex_ct); + glDrawArrays(batch->gl_prim_type, 0, batch->verts[0]->vertex_ct); Batch_done_using_program(batch); glBindVertexArray(0); @@ -341,15 +340,15 @@ void Batch_draw_stupid(Batch* batch) #if TRACK_INDEX_RANGE if (el->base_index) - glDrawRangeElementsBaseVertex(batch->prim_type, el->min_index, el->max_index,
[Bf-blender-cvs] [fca0b1a7901] workspaces: Merge branch 'blender2.8' into workspaces
Commit: fca0b1a7901ed2e9edc32f47596ab36d20572c26 Author: Campbell Barton Date: Sat Apr 8 14:22:24 2017 +1000 Branches: workspaces https://developer.blender.org/rBfca0b1a7901ed2e9edc32f47596ab36d20572c26 Merge branch 'blender2.8' into workspaces === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a1a4f587262] custom-manipulators: Add back widgets accidentally lost in merge (facemaps usable again)
Commit: a1a4f587262b6947c0766c62a1ddc37b5b6996bf Author: Campbell Barton Date: Sat Apr 8 12:33:18 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rBa1a4f587262b6947c0766c62a1ddc37b5b6996bf Add back widgets accidentally lost in merge (facemaps usable again) === M release/scripts/startup/bl_ui/properties_data_bone.py M release/scripts/startup/bl_ui/properties_data_mesh.py M source/blender/editors/space_view3d/space_view3d.c === diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index e3baa4caed3..090371f2e64 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -486,6 +486,7 @@ classes = ( BONE_PT_transform_locks, BONE_PT_curved, BONE_PT_relations, +BONE_PT_facemaps, BONE_PT_display, BONE_PT_inverse_kinematics, BONE_PT_deform, diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 672a011717a..fe55bc61dd7 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -448,17 +448,20 @@ classes = ( MESH_MT_vertex_group_specials, MESH_MT_shape_key_specials, MESH_UL_vgroups, +MESH_UL_fmaps, MESH_UL_shape_keys, MESH_UL_uvmaps_vcols, DATA_PT_context_mesh, DATA_PT_normals, DATA_PT_texture_space, DATA_PT_vertex_groups, +DATA_PT_face_maps, DATA_PT_shape_keys, DATA_PT_uv_texture, DATA_PT_vertex_colors, DATA_PT_customdata, DATA_PT_custom_props_mesh, + ) if __name__ == "__main__": # only for live edit. diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index af25c9de781..7aa0067eab7 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -736,6 +736,10 @@ static void view3d_widgets(void) wmManipulatorMapType *wmaptype = WM_manipulatormaptype_ensure(_params); WM_manipulatorgrouptype_append(wmaptype, TRANSFORM_WGT_manipulator); + WM_manipulatorgrouptype_append(wmaptype, VIEW3D_WGT_armature_facemaps); + WM_manipulatorgrouptype_append(wmaptype, VIEW3D_WGT_lamp); + WM_manipulatorgrouptype_append(wmaptype, VIEW3D_WGT_force_field); + WM_manipulatorgrouptype_append(wmaptype, VIEW3D_WGT_camera); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [51223284e1b] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators
Commit: 51223284e1bc8186891d9db7c6b02d578869ceb3 Author: Campbell Barton Date: Sat Apr 8 12:10:36 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rB51223284e1bc8186891d9db7c6b02d578869ceb3 Merge branch 'blender2.8' into custom-manipulators === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1de61696fd2] blender2.8: Correct constraint manipulator colors
Commit: 1de61696fd2ffc9d800a2eff964045b90c9f2347 Author: Campbell Barton Date: Sat Apr 8 12:08:51 2017 +1000 Branches: blender2.8 https://developer.blender.org/rB1de61696fd2ffc9d800a2eff964045b90c9f2347 Correct constraint manipulator colors Widget show as color of constrained axis === M source/blender/editors/transform/transform_manipulator.c === diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index e12f1b4286a..024d465e29c 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -367,22 +367,22 @@ static void manipulator_get_axis_color( case MAN_AXIS_TRANS_X: case MAN_AXIS_ROT_X: case MAN_AXIS_SCALE_X: - case MAN_AXIS_TRANS_XY: - case MAN_AXIS_SCALE_XY: + case MAN_AXIS_TRANS_YZ: + case MAN_AXIS_SCALE_YZ: UI_GetThemeColor4fv(TH_AXIS_X, r_col); break; case MAN_AXIS_TRANS_Y: case MAN_AXIS_ROT_Y: case MAN_AXIS_SCALE_Y: - case MAN_AXIS_TRANS_YZ: - case MAN_AXIS_SCALE_YZ: + case MAN_AXIS_TRANS_ZX: + case MAN_AXIS_SCALE_ZX: UI_GetThemeColor4fv(TH_AXIS_Y, r_col); break; case MAN_AXIS_TRANS_Z: case MAN_AXIS_ROT_Z: case MAN_AXIS_SCALE_Z: - case MAN_AXIS_TRANS_ZX: - case MAN_AXIS_SCALE_ZX: + case MAN_AXIS_TRANS_XY: + case MAN_AXIS_SCALE_XY: UI_GetThemeColor4fv(TH_AXIS_Z, r_col); break; case MAN_AXIS_TRANS_C: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [039fcb524ef] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators
Commit: 039fcb524ef468099f518bca131dfa94f2d41416 Author: Campbell Barton Date: Sat Apr 8 12:02:44 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rB039fcb524ef468099f518bca131dfa94f2d41416 Merge branch 'blender2.8' into custom-manipulators === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8205a193234] blender2.8: Fix WITH_LEGACY_OPENGL=ON
Commit: 8205a1932341834f31d5efd16cef51bc66eab9de Author: Campbell Barton Date: Sat Apr 8 12:00:46 2017 +1000 Branches: blender2.8 https://developer.blender.org/rB8205a1932341834f31d5efd16cef51bc66eab9de Fix WITH_LEGACY_OPENGL=ON This wasn't working outside of gpu module. === M source/CMakeLists.txt M source/blender/gpu/CMakeLists.txt === diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index c696719e650..4e4724771f3 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -23,6 +23,10 @@ # # * END GPL LICENSE BLOCK * +if(WITH_LEGACY_OPENGL) + add_definitions(-DWITH_LEGACY_OPENGL) +endif() + add_subdirectory(blender) if(WITH_GAMEENGINE) diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 29ad827c6bc..6a61b93e621 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -236,9 +236,5 @@ if(WITH_OPENSUBDIV) add_definitions(-DWITH_OPENSUBDIV) endif() -if(WITH_LEGACY_OPENGL) - add_definitions(-DWITH_LEGACY_OPENGL) -endif() - blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}") ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f4a3689492e] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators
Commit: f4a3689492ed8fc5f17ab7f9183c750423a3073b Author: Campbell Barton Date: Sat Apr 8 11:33:24 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rBf4a3689492ed8fc5f17ab7f9183c750423a3073b Merge branch 'blender2.8' into custom-manipulators === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bd3a1b9490d] blender2.8: OpenGL: use PRIM instead of GL enum for immBegin
Commit: bd3a1b9490d96ca00748f405037379b743744877 Author: Mike Erwin Date: Fri Apr 7 16:31:26 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBbd3a1b9490d96ca00748f405037379b743744877 OpenGL: use PRIM instead of GL enum for immBegin Getting ready for a Gawain API change... Part of T49043 === M source/blender/draw/intern/draw_view.c M source/blender/editors/animation/anim_channels_defines.c M source/blender/editors/animation/anim_draw.c M source/blender/editors/animation/anim_markers.c M source/blender/editors/curve/editcurve_paint.c M source/blender/editors/gpencil/drawgpencil.c M source/blender/editors/interface/interface_draw.c M source/blender/editors/interface/interface_icons.c M source/blender/editors/interface/interface_panel.c M source/blender/editors/interface/interface_widgets.c M source/blender/editors/interface/view2d.c M source/blender/editors/mesh/editmesh_knife.c M source/blender/editors/mesh/editmesh_loopcut.c M source/blender/editors/screen/area.c M source/blender/editors/screen/glutil.c M source/blender/editors/screen/screen_draw.c M source/blender/editors/sculpt_paint/paint_cursor.c M source/blender/editors/sculpt_paint/paint_image.c M source/blender/editors/sculpt_paint/paint_stroke.c M source/blender/editors/space_action/action_draw.c M source/blender/editors/space_clip/clip_draw.c M source/blender/editors/space_clip/clip_graph_draw.c M source/blender/editors/space_clip/clip_utils.c M source/blender/editors/space_file/file_draw.c M source/blender/editors/space_graph/graph_draw.c M source/blender/editors/space_graph/space_graph.c M source/blender/editors/space_image/image_draw.c M source/blender/editors/space_nla/nla_draw.c M source/blender/editors/space_node/drawnode.c M source/blender/editors/space_node/node_draw.c M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/space_sequencer/sequencer_draw.c M source/blender/editors/space_text/text_draw.c M source/blender/editors/space_time/space_time.c M source/blender/editors/space_view3d/drawanimviz.c M source/blender/editors/space_view3d/drawarmature.c M source/blender/editors/space_view3d/drawobject.c M source/blender/editors/space_view3d/drawsimdebug.c M source/blender/editors/space_view3d/view3d_draw.c M source/blender/editors/space_view3d/view3d_fly.c M source/blender/editors/space_view3d/view3d_ruler.c M source/blender/editors/space_view3d/view3d_walk.c M source/blender/editors/transform/transform_constraints.c M source/blender/editors/transform/transform_generics.c M source/blender/editors/transform/transform_snap.c M source/blender/editors/util/ed_util.c M source/blender/editors/uvedit/uvedit_draw.c M source/blender/gpu/intern/gpu_immediate_util.c M source/blender/gpu/intern/gpu_viewport.c M source/blender/windowmanager/intern/wm_operators.c M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c === diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index b5f4a13587d..5fc7fe1d8f4 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -240,7 +240,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** if (gridline_ct == 0) goto drawgrid_cleanup; /* nothing to draw */ - immBegin(GL_LINES, gridline_ct * 2); + immBegin(PRIM_LINES, gridline_ct * 2); } float blend_fac = 1.0f - ((GRID_MIN_PX_F * 2.0f) / (float)dx_scalar); @@ -293,7 +293,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char ** if (gridline_ct == 0) goto drawgrid_cleanup; /* nothing to draw */ - immBegin(GL_LINES, gridline_ct * 2); + immBegin(PRIM_LINES, gridline_ct * 2); if (grids_to_draw == 2) { UI_GetThemeColorBlend3ubv(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0), col2); @@ -373,7 +373,7 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit) immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR); - immBegin(GL_LINES, vertex_ct); + immBegin(PRIM_LINES, vertex_ct); /* draw normal grid lines */ UI_GetColorPtrShade3ubv(col_grid,
[Bf-blender-cvs] [1ad52872604] blender2.8: use COMP instead of GL enum to construct vertex format
Commit: 1ad52872604efb0a11011bcc7cd198c56ea97163 Author: Mike Erwin Date: Fri Apr 7 15:51:39 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB1ad52872604efb0a11011bcc7cd198c56ea97163 use COMP instead of GL enum to construct vertex format I converted all other files a day or two ago; this file was part of a recent merge. === M source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c index 844de194845..63b02cb1509 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c @@ -102,7 +102,7 @@ static void dial_geom_draw( glLineWidth(dial->manipulator.line_width); VertexFormat *format = immVertexFormat(); - unsigned int pos = VertexFormat_add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); if (clip_plane) { immBindBuiltinProgram(GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR); @@ -139,7 +139,7 @@ static void dial_ghostarc_draw_helpline(const float angle, const float co_outer[ gpuPushMatrix(); gpuRotate3f(RAD2DEGF(angle), 0.0f, 0.0f, -1.0f); - unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", GL_FLOAT, 3, KEEP_FLOAT); + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); @@ -161,7 +161,7 @@ static void dial_ghostarc_draw( const float width_inner = DIAL_WIDTH - dial->manipulator.line_width * 0.5f / U.manipulator_scale; VertexFormat *format = immVertexFormat(); - unsigned int pos = VertexFormat_add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int pos = VertexFormat_add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); immUniformColor4fv(color); imm_draw_disk_partial_fill( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c1dc0788405] blender2.8: Gawain: remove GL enum from vertex format API
Commit: c1dc078840541bd64f95fdeca52267c75a061e04 Author: Mike Erwin Date: Fri Apr 7 16:00:03 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBc1dc078840541bd64f95fdeca52267c75a061e04 Gawain: remove GL enum from vertex format API Callers now have to use Gawain's COMP enum to specify vertex attributes. This makes the API more bullet-proof (at least less vulnerable) since GLenum covers waaay more than component types. Also prepares us for Vulkan. === M intern/gawain/gawain/vertex_format.h M intern/gawain/src/batch.c M intern/gawain/src/immediate.c M intern/gawain/src/vertex_format.c === diff --git a/intern/gawain/gawain/vertex_format.h b/intern/gawain/gawain/vertex_format.h index fcebaec8772..a5cab4a9d99 100644 --- a/intern/gawain/gawain/vertex_format.h +++ b/intern/gawain/gawain/vertex_format.h @@ -22,17 +22,17 @@ // ^-- this is only guaranteed on Windows right now, will be true on all platforms soon typedef enum { - COMP_I8 = GL_BYTE, - COMP_U8 = GL_UNSIGNED_BYTE, - COMP_I16 = GL_SHORT, - COMP_U16 = GL_UNSIGNED_SHORT, - COMP_I32 = GL_INT, - COMP_U32 = GL_UNSIGNED_INT, + COMP_I8, + COMP_U8, + COMP_I16, + COMP_U16, + COMP_I32, + COMP_U32, - COMP_F32 = GL_FLOAT, // TODO: drop the GL_ equivalence here, use a private lookup table + COMP_F32, #if USE_10_10_10 - COMP_I10 = GL_INT_2_10_10_10_REV + COMP_I10 #endif } VertexCompType; @@ -45,6 +45,7 @@ typedef enum { typedef struct { VertexCompType comp_type; + unsigned gl_comp_type; unsigned comp_ct; // 1 to 4 unsigned sz; // size in bytes, 1 to 16 unsigned offset; // from beginning of vertex, in bytes diff --git a/intern/gawain/src/batch.c b/intern/gawain/src/batch.c index cac34d445bb..68771e59383 100644 --- a/intern/gawain/src/batch.c +++ b/intern/gawain/src/batch.c @@ -137,13 +137,13 @@ static void Batch_update_program_bindings(Batch* batch) { case KEEP_FLOAT: case CONVERT_INT_TO_FLOAT: - glVertexAttribPointer(loc, a->comp_ct, a->comp_type, GL_FALSE, stride, pointer); + glVertexAttribPointer(loc, a->comp_ct, a->gl_comp_type, GL_FALSE, stride, pointer); break; case NORMALIZE_INT_TO_FLOAT: - glVertexAttribPointer(loc, a->comp_ct, a->comp_type, GL_TRUE, stride, pointer); + glVertexAttribPointer(loc, a->comp_ct, a->gl_comp_type, GL_TRUE, stride, pointer); break; case KEEP_INT: - glVertexAttribIPointer(loc, a->comp_ct, a->comp_type, stride, pointer); + glVertexAttribIPointer(loc, a->comp_ct, a->gl_comp_type, stride, pointer); } } } diff --git a/intern/gawain/src/immediate.c b/intern/gawain/src/immediate.c index e6d338afbc1..8867c541edc 100644 --- a/intern/gawain/src/immediate.c +++ b/intern/gawain/src/immediate.c @@ -329,13 +329,13 @@ static void immDrawSetup(void) { case KEEP_FLOAT: case CONVERT_INT_TO_FLOAT: - glVertexAttribPointer(loc, a->comp_ct, a->comp_type, GL_FALSE, stride, pointer); + glVertexAttribPointer(loc, a->comp_ct, a->gl_comp_type, GL_FALSE, stride, pointer); break; case NORMALIZE_INT_TO_FLOAT: - glVertexAttribPointer(loc, a->comp_ct, a->comp_type, GL_TRUE, stride, pointer); + glVertexAttribPointer(loc, a->comp_ct, a->gl_comp_type, GL_TRUE, stride, pointer); break; case KEEP_INT: - glVertexAttribIPointer(loc, a->comp_ct, a->comp_type, stride, pointer); + glVertexAttribIPointer(loc, a->comp_ct, a->gl_comp_type, stride, pointer); } } diff --git a/intern/gawain/src/vertex_format.c b/intern/gawain/src/vertex_format.c index b1fb7721e38..924cff42362 100644 --- a/intern/gawain/src/vertex_format.c +++ b/intern/gawain/src/vertex_format.c @@ -36,14 +36,33 @@ void VertexFormat_copy(VertexFormat* dest, const VertexFormat* src) memcpy(dest, src, sizeof(VertexFormat)); } +static GLenum convert_comp_type_to_gl(VertexCompType type) + { + static const GLenum table[] = { +
[Bf-blender-cvs] [7a75581d92a] blender2.8: OpenGL: transition away from GL_QUADS
Commit: 7a75581d92ad1df005f1da23a84a3d0aea20188e Author: Mike Erwin Date: Fri Apr 7 15:03:24 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB7a75581d92ad1df005f1da23a84a3d0aea20188e OpenGL: transition away from GL_QUADS Single quads are drawn as a TRIANGLE_FAN, with 4 verts in the same order. Multiple quads now use PRIM_QUADS_XXX and will need further work. Only 8 places still use this. Part of T49043 === M source/blender/blenfont/intern/blf_font.c M source/blender/draw/intern/draw_view.c M source/blender/editors/gpencil/drawgpencil.c M source/blender/editors/interface/interface_draw.c M source/blender/editors/sculpt_paint/paint_cursor.c M source/blender/editors/space_clip/clip_draw.c M source/blender/editors/space_outliner/outliner_draw.c M source/blender/editors/space_sequencer/sequencer_draw.c M source/blender/editors/space_time/space_time.c M source/blender/editors/space_view3d/drawobject.c M source/blender/windowmanager/intern/wm_draw.c M source/blender/windowmanager/intern/wm_gesture.c M source/blender/windowmanager/intern/wm_operators.c M source/blender/windowmanager/intern/wm_stereo.c === diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index d0293eccf3a..3702c70be35 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -206,7 +206,7 @@ static void blf_font_draw_ex( blf_font_ensure_ascii_table(font); - immBeginAtMost(GL_QUADS, verts_needed(font, str, len)); + immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len)); /* at most because some glyphs might be clipped & not drawn */ while ((i < len) && str[i]) { @@ -253,7 +253,7 @@ static void blf_font_draw_ascii_ex( blf_font_ensure_ascii_table(font); - immBeginAtMost(GL_QUADS, verts_needed(font, str, len)); + immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len)); while ((c = *(str++)) && len--) { BLI_assert(c < 128); @@ -293,7 +293,7 @@ int blf_font_draw_mono(FontBLF *font, const char *str, size_t len, int cwidth) blf_font_ensure_ascii_table(font); - immBeginAtMost(GL_QUADS, verts_needed(font, str, len)); + immBeginAtMost(PRIM_QUADS_XXX, verts_needed(font, str, len)); while ((i < len) && str[i]) { BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index a0f0fb1a9ee..b5f4a13587d 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -568,7 +568,7 @@ void DRW_draw_background(void) UI_GetThemeColor3ubv(TH_LOW_GRAD, col_lo); UI_GetThemeColor3ubv(TH_HIGH_GRAD, col_hi); - immBegin(GL_QUADS, 4); + immBegin(PRIM_TRIANGLE_FAN, 4); immAttrib3ubv(color, col_lo); immVertex2f(pos, -1.0f, -1.0f); immVertex2f(pos, 1.0f, -1.0f); diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 229aecc21ae..7e33de7b271 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -740,7 +740,7 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi unsigned int color = VertexFormat_add_attrib(format, "color", COMP_U8, 4, NORMALIZE_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); - immBegin(GL_QUADS, (totpoints - 2) * 4 + 12); + immBegin(PRIM_QUADS_XXX, (totpoints - 2) * 4 + 12); for (i = 0, pt1 = points, pt2 = points + 1; i < (totpoints - 1); i++, pt1++, pt2++) { float s0[2], s1[2]; /* segment 'center' points */ diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 89d9fe992ba..5e4cb9c1ba1 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1195,7 +1195,7 @@ static void ui_draw_colorband_handle_tri(unsigned int pos, float x1, float y1, f static void ui_draw_colorband_handle_box(unsigned int pos, float x1, float y1, float x2, float y2, bool fill) { - immBegin(fill ? GL_QUADS : GL_LINE_LOOP, 4); + immBegin(fill ? PRIM_TRIANGLE_FAN : PRIM_LINE_LOOP, 4); immVertex2f(pos, x1, y1); immVertex2f(pos, x1, y2); immVertex2f(pos, x2, y2); @@ -1916,6 +1916,9 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol /* ** */ +/* TODO:
[Bf-blender-cvs] [da24848fb45] blender2.8: OpenGL: remove UI_reinit_gl_state function
Commit: da24848fb45695365aaf79e577ee241a97188eb5 Author: Mike Erwin Date: Fri Apr 7 15:10:48 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBda24848fb45695365aaf79e577ee241a97188eb5 OpenGL: remove UI_reinit_gl_state function All line & point drawing is responsible for setting its own state (as of January 2016) making this redundant. === M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_draw.c M source/blender/editors/space_api/spacetypes.c === diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index c0b457be918..75c28331c4b 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -793,7 +793,6 @@ void UI_popup_handlers_remove_all(struct bContext *C, struct ListBase *handlers) void UI_init(void); void UI_init_userdef(void); void UI_reinit_font(void); -void UI_reinit_gl_state(void); void UI_exit(void); /* Layout diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 5e4cb9c1ba1..3162584e910 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -2011,15 +2011,3 @@ void ui_draw_dropshadow(const rctf *rct, float radius, float aspect, float alpha glDisable(GL_BLEND); } - -/** - * Reset GL state (keep minimal). - * - * \note Blender's internal code doesn't assume these are reset, - * but external callbacks may depend on their state. - */ -void UI_reinit_gl_state(void) -{ - glLineWidth(1.0f); - glPointSize(1.0f); -} diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 5ff1d758563..4d601a31251 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -256,7 +256,6 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type) for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) { if (rdc->type == type) { - UI_reinit_gl_state(); rdc->draw(C, ar, rdc->customdata); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [23b10b549a1] blender2.8: fix use of uninitialized variable
Commit: 23b10b549a1b7e713abd97dea32483d40d9bb18f Author: Mike Erwin Date: Fri Apr 7 13:48:11 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB23b10b549a1b7e713abd97dea32483d40d9bb18f fix use of uninitialized variable Bug crawled in via 2944438e9a276e48d7eabb5bb88ecec9b2f1e7dc as part of custom manipulators. === M source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c index 7d33a82568f..9755d090e8b 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c @@ -84,18 +84,20 @@ static void manipulator_primitive_draw_geom( const float col_inner[4], const float col_outer[4], const int style) { float (*verts)[3]; - float vert_count; - unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + unsigned int vert_count = 0; if (style == MANIPULATOR_PRIMITIVE_STYLE_PLANE) { verts = verts_plane; vert_count = ARRAY_SIZE(verts_plane); } - immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_TRIANGLE_FAN); - wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, PRIM_LINE_LOOP); - immUnbindProgram(); + if (vert_count > 0) { + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); + wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_TRIANGLE_FAN); + wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, PRIM_LINE_LOOP); + immUnbindProgram(); + } } static void manipulator_primitive_draw_intern( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d6ae3789a14] blender2.8: Gawain: append XXX to PRIM_QUADS to make it scary
Commit: d6ae3789a1462931f29b523badb5f2173aa83902 Author: Mike Erwin Date: Fri Apr 7 14:21:10 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBd6ae3789a1462931f29b523badb5f2173aa83902 Gawain: append XXX to PRIM_QUADS to make it scary Quads are not part of modern GL or Vulkan, so we should avoid them. XXX makes coders think "hmm how could I draw this without using quads?" Quads will be removed during the transition to core profile. Part of T49043 === M intern/gawain/gawain/primitive.h M intern/gawain/src/immediate.c M intern/gawain/src/primitive.c === diff --git a/intern/gawain/gawain/primitive.h b/intern/gawain/gawain/primitive.h index 55333be6c9e..214902e9a2b 100644 --- a/intern/gawain/gawain/primitive.h +++ b/intern/gawain/gawain/primitive.h @@ -19,7 +19,7 @@ typedef enum { PRIM_TRIANGLES = GL_TRIANGLES, #ifdef WITH_GL_PROFILE_COMPAT - PRIM_QUADS = GL_QUADS, // legacy GL has this, modern GL & Vulkan do not + PRIM_QUADS_XXX = GL_QUADS, // legacy GL has this, modern GL & Vulkan do not #endif PRIM_LINE_STRIP = GL_LINE_STRIP, diff --git a/intern/gawain/src/immediate.c b/intern/gawain/src/immediate.c index 4e584dcb3cb..e6d338afbc1 100644 --- a/intern/gawain/src/immediate.c +++ b/intern/gawain/src/immediate.c @@ -168,7 +168,7 @@ static bool vertex_count_makes_sense_for_primitive(unsigned vertex_ct, Primitive case PRIM_TRIANGLE_FAN: return vertex_ct >= 3; #ifdef WITH_GL_PROFILE_COMPAT - case PRIM_QUADS: + case PRIM_QUADS_XXX: return vertex_ct % 4 == 0; #endif default: diff --git a/intern/gawain/src/primitive.c b/intern/gawain/src/primitive.c index 95472c289e8..7fee06021b8 100644 --- a/intern/gawain/src/primitive.c +++ b/intern/gawain/src/primitive.c @@ -25,7 +25,7 @@ PrimitiveClass prim_class_of_type(PrimitiveType prim_type) [PRIM_TRIANGLE_FAN] = PRIM_CLASS_SURFACE, #ifdef WITH_GL_PROFILE_COMPAT - [PRIM_QUADS] = PRIM_CLASS_SURFACE, + [PRIM_QUADS_XXX] = PRIM_CLASS_SURFACE, #endif }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1a156f71038] blender2.8: use best GPU matrix function for the job
Commit: 1a156f71038e68d8781d0ce5dd6cee0eb339ebe5 Author: Mike Erwin Date: Fri Apr 7 13:24:00 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB1a156f71038e68d8781d0ce5dd6cee0eb339ebe5 use best GPU matrix function for the job Follow-up to 204e067111af9346fccea9981a0a7962ec8ef906 which coverted manipulators' legacy GL matrix calls to new ones. part of T49450 === M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c index 3f7dadbc9c2..9edff5b6107 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c @@ -76,11 +76,11 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float origin[2]) const float draw_line_ofs = (arrow->manipulator.line_width * 0.5f) / arrow->manipulator.scale; gpuPushMatrix(); - gpuTranslate3f(UNPACK2(origin), 0.0f); - gpuScale3f(arrow->manipulator.scale, arrow->manipulator.scale, 0.0f); - gpuRotate3f(RAD2DEGF(arrow->angle), 0.0f, 0.0f, 1.0f); + gpuTranslate2fv(origin); + gpuScaleUniform(arrow->manipulator.scale); + gpuRotate2D(RAD2DEGF(arrow->angle)); /* local offset */ - gpuTranslate3f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1], 0.0f); + gpuTranslate2f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1]); /* TODO get rid of immediate mode */ glBegin(GL_LINES); diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c index c963ede3a42..f0a6cbb3778 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c @@ -190,12 +190,12 @@ static void manipulator_rect_transform_draw(const bContext *UNUSED(C), wmManipul r.ymax = half_h; gpuPushMatrix(); - gpuTranslate3f(manipulator->origin[0] + manipulator->offset[0], - manipulator->origin[1] + manipulator->offset[1], 0.0f); + gpuTranslate2f(manipulator->origin[0] + manipulator->offset[0], + manipulator->origin[1] + manipulator->offset[1]); if (cage->style & MANIPULATOR_RECT_TRANSFORM_STYLE_SCALE_UNIFORM) - gpuScale3f(cage->scale[0], cage->scale[0], 1.0); + gpuScaleUniform(cage->scale[0]); else - gpuScale3f(cage->scale[0], cage->scale[1], 1.0); + gpuScale2fv(cage->scale); if (w > h) aspx = h / w; diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c index cd54f0546a4..7d33a82568f 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c @@ -149,7 +149,7 @@ static void manipulator_primitive_draw_intern( gpuMultMatrix3D(mat); glEnable(GL_BLEND); - gpuTranslate3f(UNPACK3(prim->manipulator.offset)); + gpuTranslate3fv(prim->manipulator.offset); manipulator_primitive_draw_geom(col_inner, col_outer, prim->style); glDisable(GL_BLEND); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3f6d25f4ebc] blender2.8: shrink fixed-size internal GLSL string buffers
Commit: 3f6d25f4ebcccaafeb74e3d2c8aa505d0f8f5a7e Author: Mike Erwin Date: Fri Apr 7 13:28:42 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB3f6d25f4ebcccaafeb74e3d2c8aa505d0f8f5a7e shrink fixed-size internal GLSL string buffers We concatenate #defines and #extensions into these, and can count the max string lengths needed. 256 is enough to hold today's strings; we can adjust later if needed. === M source/blender/gpu/intern/gpu_shader.c === diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index cea03b09843..1532bf87c7c 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -42,9 +42,9 @@ #include "gpu_shader_private.h" -/* TODO(sergey): Find better default values for this constants. */ -#define MAX_DEFINE_LENGTH 1024 -#define MAX_EXT_DEFINE_LENGTH 1024 +/* Adjust these constants as needed. */ +#define MAX_DEFINE_LENGTH 256 +#define MAX_EXT_DEFINE_LENGTH 256 /* Non-generated shaders */ extern char datatoc_gpu_shader_depth_only_frag_glsl[]; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f0ce39ab169] blender2.8: OpenGL: support GLSL 3.3 core profile
Commit: f0ce39ab169a1f12ee2e89dc8cc71a1d3709d98b Author: Mike Erwin Date: Fri Apr 7 12:50:44 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBf0ce39ab169a1f12ee2e89dc8cc71a1d3709d98b OpenGL: support GLSL 3.3 core profile When WITH_LEGACY_OPENGL = OFF. This is our final target for Blender 2.8, all previous versions will be dropped in the future. GLSL 3.3 is richer so we don't require as many extensions. === M source/blender/gpu/intern/gpu_shader.c === diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index 7e705662ac5..cea03b09843 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -178,6 +178,7 @@ static void shader_print_errors(const char *task, const char *log, const char ** static const char *gpu_shader_version(void) { +#ifdef WITH_LEGACY_OPENGL if (GLEW_VERSION_3_3) { if (GPU_legacy_support()) { return "#version 330 compatibility\n"; @@ -201,9 +202,11 @@ static const char *gpu_shader_version(void) return "#version 120\n"; /* minimum supported */ } +#else + return "#version 330\n"; +#endif } - static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH], bool use_geometry_shader) { /* enable extensions for features that are not part of our base GLSL version @@ -215,6 +218,7 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH], strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n"); } +#ifdef WITH_LEGACY_OPENGL if (use_geometry_shader && GPU_geometry_shader_support_via_extension()) { strcat(defines, "#extension GL_EXT_geometry_shader4: enable\n"); } @@ -232,6 +236,9 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH], strcat(defines, "#extension GL_EXT_gpu_shader4: require\n"); } } +#else + (void)use_geometry_shader; +#endif } static void gpu_shader_standard_defines(char defines[MAX_DEFINE_LENGTH], ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [867d3113076] master: Cycles: Fix warning with MSVC
Commit: 867d31130769b45c6f1b71ef619f247634ae890c Author: Sergey Sharybin Date: Fri Apr 7 18:28:16 2017 +0200 Branches: master https://developer.blender.org/rB867d31130769b45c6f1b71ef619f247634ae890c Cycles: Fix warning with MSVC === M intern/cycles/device/device_cuda.cpp M intern/cycles/device/opencl/opencl_split.cpp === diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 606494f08ed..4c1a49878f5 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -1613,7 +1613,7 @@ int2 CUDASplitKernel::split_kernel_local_size() return make_int2(32, 1); } -int2 CUDASplitKernel::split_kernel_global_size(device_memory& /*kg*/, device_memory& /*data*/, DeviceTask */*task*/) +int2 CUDASplitKernel::split_kernel_global_size(device_memory& /*kg*/, device_memory& /*data*/, DeviceTask * /*task*/) { /* TODO(mai): implement something here to detect ideal work size */ return make_int2(256, 256); diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp index 579dbc84f53..b8df57ec7b9 100644 --- a/intern/cycles/device/opencl/opencl_split.cpp +++ b/intern/cycles/device/opencl/opencl_split.cpp @@ -340,7 +340,7 @@ public: return make_int2(64, 1); } - virtual int2 split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask */*task*/) + virtual int2 split_kernel_global_size(device_memory& kg, device_memory& data, DeviceTask * /*task*/) { cl_device_type type = OpenCLInfo::get_device_type(device->cdDevice); /* Use small global size on CPU devices as it seems to be much faster. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7d77b3e8133] master: Cycles: Fix compilation error with certain CUDA and host compiler configuration
Commit: 7d77b3e813355d832b7fbc5e4f55773ab792d0e3 Author: Sergey Sharybin Date: Fri Apr 7 18:27:07 2017 +0200 Branches: master https://developer.blender.org/rB7d77b3e813355d832b7fbc5e4f55773ab792d0e3 Cycles: Fix compilation error with certain CUDA and host compiler configuration This seems to happen on Windows only, happened to Thomas and Nathan already. Similar patch Thomas was showing, but i do not see it committted. So comitting now in order to get more developers and users happy. === M intern/cycles/kernel/kernel_compat_cuda.h === diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index 39e98c7dda6..a6b44acc809 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -33,6 +33,7 @@ #include #include #include +#include /* Qualifier wrappers for different names on different devices */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8c22a974d63] master: Tests: Compare vectors with epsilon
Commit: 8c22a974d63db2b3182a5b7855c5794bc9cb111f Author: Sergey Sharybin Date: Fri Apr 7 18:26:39 2017 +0200 Branches: master https://developer.blender.org/rB8c22a974d63db2b3182a5b7855c5794bc9cb111f Tests: Compare vectors with epsilon SOlves the test false-positively failing in 32 bit environment. === M tests/python/bl_pyapi_mathutils.py === diff --git a/tests/python/bl_pyapi_mathutils.py b/tests/python/bl_pyapi_mathutils.py index 7761b6cb7b1..9ca0376192a 100644 --- a/tests/python/bl_pyapi_mathutils.py +++ b/tests/python/bl_pyapi_mathutils.py @@ -260,6 +260,11 @@ class KDTreeTesting(unittest.TestCase): k.balance() return k +def assertAlmostEqualVector(self, first, second, places=7, msg=None, delta=None): +self.assertAlmostEqual(first[0], second[0], places=places, msg=msg, delta=delta) +self.assertAlmostEqual(first[1], second[1], places=places, msg=msg, delta=delta) +self.assertAlmostEqual(first[2], second[2], places=places, msg=msg, delta=delta) + def test_kdtree_single(self): co = (0,) * 3 index = 2 @@ -360,12 +365,12 @@ class KDTreeTesting(unittest.TestCase): ret_regular = k_odd.find(co) self.assertEqual(ret_regular[1] % 2, 1) ret_filter = k_all.find(co, lambda i: (i % 2) == 1) -self.assertEqual(ret_regular, ret_filter) +self.assertAlmostEqualVector(ret_regular, ret_filter) ret_regular = k_evn.find(co) self.assertEqual(ret_regular[1] % 2, 0) ret_filter = k_all.find(co, lambda i: (i % 2) == 0) -self.assertEqual(ret_regular, ret_filter) +self.assertAlmostEqualVector(ret_regular, ret_filter) # filter out all values (search odd tree for even values and the reverse) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b332fc8f23c] master: [Cycles/msvc] Get cycles_kernel compile time under control.
Commit: b332fc8f23c9995923abbf526e67517f1a26f073 Author: lazydodo Date: Fri Apr 7 10:25:54 2017 -0600 Branches: master https://developer.blender.org/rBb332fc8f23c9995923abbf526e67517f1a26f073 [Cycles/msvc] Get cycles_kernel compile time under control. Ever since we merged the extra texture types (half etc) and spit kernel the compile time for cycles_kernel has been going out of control. It's currently sitting at a cool 1295.762 seconds with our standard compiler (2013/x64/release) I'm not entirely sure why msvc gets upset with it, but the inlining of matrix near the bottom of the tri-cubic 3d interpolator is the source of the issue, this patch excludes it from being inlined. This patch bring it back down to a manageable 186 seconds. (7x faster!!) with the attached bzzt.blend that @sergey kindly provided i got the following results with builds with identical hashes 58:51.73 buildbot 58:04.23 Patched it's really close, the slight speedup could be explained by the switch instead of having multiple if's (switches do generate more optimal code than a chain of if/else/if/else statements) but in all honesty it might just have been pure luck (dev box,very polluted, bad for benchmarks) regardless, this patch doesn't seem to slow down anything with my limited testing. {F532336} {F532337} Reviewers: brecht, lukasstockner97, juicyfruit, dingto, sergey Reviewed By: brecht, dingto, sergey Subscribers: InsigMathK, sergey Tags: #cycles Differential Revision: https://developer.blender.org/D2595 === M intern/cycles/kernel/kernel_compat_cpu.h M intern/cycles/util/util_types.h === diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index ae7c9b836c4..cad5f4d2959 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -316,184 +316,203 @@ template struct texture_image { return interp_3d_ex(x, y, z, interpolation); } - ccl_always_inline float4 interp_3d_ex(float x, float y, float z, - int interpolation = INTERPOLATION_LINEAR) + ccl_always_inline float4 interp_3d_ex_closest(float x, float y, float z) { - if(UNLIKELY(!data)) - return make_float4(0.0f, 0.0f, 0.0f, 0.0f); - - int ix, iy, iz, nix, niy, niz; - - if(interpolation == INTERPOLATION_CLOSEST) { - frac(x*(float)width, ); - frac(y*(float)height, ); - frac(z*(float)depth, ); - - switch(extension) { - case EXTENSION_REPEAT: - ix = wrap_periodic(ix, width); - iy = wrap_periodic(iy, height); - iz = wrap_periodic(iz, depth); - break; - case EXTENSION_CLIP: - if(x < 0.0f || y < 0.0f || z < 0.0f || - x > 1.0f || y > 1.0f || z > 1.0f) - { - return make_float4(0.0f, 0.0f, 0.0f, 0.0f); - } - /* Fall through. */ - case EXTENSION_EXTEND: - ix = wrap_clamp(ix, width); - iy = wrap_clamp(iy, height); - iz = wrap_clamp(iz, depth); - break; - default: - kernel_assert(0); + int ix, iy, iz; + frac(x*(float)width, ); + frac(y*(float)height, ); + frac(z*(float)depth, ); + + switch(extension) { + case EXTENSION_REPEAT: + ix = wrap_periodic(ix, width); + iy = wrap_periodic(iy, height); + iz = wrap_periodic(iz, depth); + break; + case EXTENSION_CLIP: + if(x < 0.0f || y < 0.0f || z < 0.0f || + x > 1.0f || y > 1.0f || z > 1.0f) + { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); - } - - return read(data[ix + iy*width + iz*width*height]); + } + /* Fall through. */ + case EXTENSION_EXTEND: + ix =
[Bf-blender-cvs] [db444fc783a] blender2.8: Workaround for weightpoint not working
Commit: db444fc783af03de6e4568f8f5d613ba7598f7b4 Author: Dalai Felinto Date: Fri Apr 7 18:00:39 2017 +0200 Branches: blender2.8 https://developer.blender.org/rBdb444fc783af03de6e4568f8f5d613ba7598f7b4 Workaround for weightpoint not working Kudos to Germano Cavalcante for spotting the issue, the real fix is to pass SL to the function though === M source/blender/blenkernel/intern/DerivedMesh.c === diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 97bb38c9b15..40c16f5fbff 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2677,7 +2677,8 @@ static void editbmesh_build_data(Scene *scene, Object *obedit, BMEditMesh *em, C static CustomDataMask object_get_datamask(const Scene *scene, Object *ob, bool *r_need_mapping) { - Object *actob = scene->basact ? scene->basact->object : NULL; + SceneLayer *sl = scene->render_layers.first; /* XXX TODO pass SceneLayer to this function */ + Object *actob = sl->basact ? sl->basact->object : NULL; CustomDataMask mask = ob->customdata_mask; if (r_need_mapping) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8e0cdfd0c91] master: Libmv: Correction to previous commit
Commit: 8e0cdfd0c916e30b1496d0632e824042e9406cd5 Author: Sergey Sharybin Date: Fri Apr 7 17:57:48 2017 +0200 Branches: master https://developer.blender.org/rB8e0cdfd0c916e30b1496d0632e824042e9406cd5 Libmv: Correction to previous commit We do need to make a copy of the values. === M intern/libmv/libmv/multiview/homography.cc === diff --git a/intern/libmv/libmv/multiview/homography.cc b/intern/libmv/libmv/multiview/homography.cc index a7679c33bbf..69177743f94 100644 --- a/intern/libmv/libmv/multiview/homography.cc +++ b/intern/libmv/libmv/multiview/homography.cc @@ -209,8 +209,10 @@ class HomographySymmetricGeometricCostFunctor { return true; } - const Vec2 _; - const Vec2 _; + EIGEN_MAKE_ALIGNED_OPERATOR_NEW + + const Vec2 x_; + const Vec2 y_; }; // Termination checking callback used for homography estimation. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [86d6ee427c4] workspaces: Sync with blender2.8, cleanup, remove unintentionally committed files
Commit: 86d6ee427c4dd4b857b10a644aa229706ee4c943 Author: Julian Eisel Date: Fri Apr 7 17:54:08 2017 +0200 Branches: workspaces https://developer.blender.org/rB86d6ee427c4dd4b857b10a644aa229706ee4c943 Sync with blender2.8, cleanup, remove unintentionally committed files === M doc/doxygen/doxygen.source.h M source/blender/blenkernel/intern/context.c M source/blender/editors/armature/editarmature_sketch.c M source/blender/editors/screen/area.c M source/blender/editors/screen/glutil.c D source/blender/editors/screen/glutil.c.orig M source/blender/editors/screen/screen_context.c M source/blender/editors/screen/screen_draw.c D source/blender/editors/screen/screen_draw.c.orig M source/blender/editors/screen/screen_edit.c M source/blender/editors/screen/screen_intern.h M source/blender/editors/screen/screen_ops.c M source/blender/editors/screen/screendump.c M source/blender/editors/screen/workspace_edit.c M source/blender/editors/screen/workspace_layout_edit.c M source/blender/editors/space_action/space_action.c M source/blender/editors/space_buttons/space_buttons.c M source/blender/editors/space_clip/space_clip.c M source/blender/editors/space_graph/space_graph.c M source/blender/editors/space_image/space_image.c M source/blender/editors/space_info/space_info.c M source/blender/editors/space_nla/space_nla.c M source/blender/editors/space_node/space_node.c M source/blender/editors/space_outliner/space_outliner.c M source/blender/editors/space_sequencer/space_sequencer.c M source/blender/editors/space_time/space_time.c M source/blender/editors/space_view3d/space_view3d.c M source/blender/makesrna/intern/rna_mask.c M source/blender/makesrna/intern/rna_userdef.c M source/blender/makesrna/intern/rna_wm.c M source/blender/makesrna/intern/rna_workspace.c M source/blender/windowmanager/WM_types.h M source/blender/windowmanager/intern/wm_event_system.c M source/blender/windowmanager/intern/wm_window.c === diff --git a/doc/doxygen/doxygen.source.h b/doc/doxygen/doxygen.source.h index eb56f52ae73..6f12991fb44 100644 --- a/doc/doxygen/doxygen.source.h +++ b/doc/doxygen/doxygen.source.h @@ -219,7 +219,7 @@ * \ingroup editors */ -/** \defgroup edscreen screen +/** \defgroup edscr screen * \ingroup editors */ diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index b6fdd6e929e..8f12b31da63 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -836,7 +836,9 @@ void CTX_wm_manager_set(bContext *C, wmWindowManager *wm) void CTX_wm_window_set(bContext *C, wmWindow *win) { C->wm.window = win; - C->data.scene = (win) ? win->scene : NULL; + if (win) { + C->data.scene = win->scene; + } C->wm.workspace = (win) ? BKE_workspace_active_get(win->workspace_hook) : NULL; C->wm.screen = (win) ? BKE_workspace_active_screen_get(win->workspace_hook) : NULL; C->wm.area = NULL; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index a2eca395740..b53bba8db32 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -2163,7 +2163,7 @@ static int sketch_delete(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNU sk_deleteSelectedStrokes(sketch); // allqueue(REDRAWVIEW3D, 0); } - WM_event_add_notifier(C, NC_WORKSPACE | ND_SKETCH | NA_REMOVED, NULL); + WM_event_add_notifier(C, NC_SCREEN | ND_SKETCH | NA_REMOVED, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 20f7c76351b..d00bc38c262 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -25,7 +25,7 @@ */ /** \file blender/editors/screen/area.c - * \ingroup edscreen + * \ingroup edscr */ diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 6ed6b6aa364..f9e7a27e337 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -24,7 +24,7 @@ */ /** \file blender/editors/screen/glutil.c - * \ingroup edscreen + * \ingroup edscr */ diff --git a/source/blender/editors/screen/glutil.c.orig b/source/blender/editors/screen/glutil.c.orig deleted file mode 100644 index 948895f9089..000 --- a/source/blender/editors/screen/glutil.c.orig +++ /dev/null @@ -1,1249 +0,0 @@ -/* - * * BEGIN GPL LICENSE BLOCK * - * - * This program is free
[Bf-blender-cvs] [31c272e840a] blender2.8: Simplified some test code in render_layer_common.py
Commit: 31c272e840af0ae4400ffee87e6ac86076580ee5 Author: Sybren A. Stüvel Date: Fri Apr 7 17:51:23 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB31c272e840af0ae4400ffee87e6ac86076580ee5 Simplified some test code in render_layer_common.py === M tests/python/render_layer/render_layer_common.py === diff --git a/tests/python/render_layer/render_layer_common.py b/tests/python/render_layer/render_layer_common.py index 645b111b49c..4fb714e429e 100644 --- a/tests/python/render_layer/render_layer_common.py +++ b/tests/python/render_layer/render_layer_common.py @@ -127,11 +127,10 @@ def query_scene(filepath, name, callbacks): with blendfile.open_blend(filepath) as blend: scenes = [block for block in blend.blocks if block.code == b'SC'] for scene in scenes: -if scene.get((b'id', b'name'))[2:] == name: -output = [] -for callback in callbacks: -output.append(callback(scene)) -return output +if scene.get((b'id', b'name'))[2:] != name: +continue + +return [callback(scene) for callback in callbacks] # ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ad60283bc87] blender2.8: No more need to alter sys.path in each and every render_layer unit test.
Commit: ad60283bc87ff85332bdfe46a8db06fb1ad03de2 Author: Sybren A. Stüvel Date: Fri Apr 7 17:50:47 2017 +0200 Branches: blender2.8 https://developer.blender.org/rBad60283bc87ff85332bdfe46a8db06fb1ad03de2 No more need to alter sys.path in each and every render_layer unit test. I tried the clean way, by setting the PYTHONPATH environment variable for CTest, using SET (CTEST_ENVIRONMENT blablab), but that didn't seem to work. === M tests/python/render_layer/CMakeLists.txt M tests/python/render_layer/test_active_collection.py M tests/python/render_layer/test_collection_rename.py M tests/python/render_layer/test_evaluation_selectability_a.py M tests/python/render_layer/test_evaluation_selectability_b.py M tests/python/render_layer/test_evaluation_selectability_c.py M tests/python/render_layer/test_evaluation_selectability_d.py M tests/python/render_layer/test_evaluation_selectability_e.py M tests/python/render_layer/test_evaluation_selectability_f.py M tests/python/render_layer/test_evaluation_visibility_a.py M tests/python/render_layer/test_evaluation_visibility_b.py M tests/python/render_layer/test_evaluation_visibility_c.py M tests/python/render_layer/test_evaluation_visibility_d.py M tests/python/render_layer/test_evaluation_visibility_e.py M tests/python/render_layer/test_evaluation_visibility_f.py M tests/python/render_layer/test_evaluation_visibility_g.py M tests/python/render_layer/test_evaluation_visibility_h.py M tests/python/render_layer/test_evaluation_visibility_i.py M tests/python/render_layer/test_layer_linking.py M tests/python/render_layer/test_move_above_below_layer_collection_a.py M tests/python/render_layer/test_move_above_below_layer_collection_b.py M tests/python/render_layer/test_move_above_below_layer_collection_c.py M tests/python/render_layer/test_move_above_below_layer_collection_d.py M tests/python/render_layer/test_move_above_below_layer_collection_e.py M tests/python/render_layer/test_move_above_below_layer_collection_f.py M tests/python/render_layer/test_move_above_below_layer_collection_g.py M tests/python/render_layer/test_move_above_below_layer_collection_h.py M tests/python/render_layer/test_move_above_below_layer_collection_i.py M tests/python/render_layer/test_move_above_below_layer_collection_j.py M tests/python/render_layer/test_move_above_below_layer_collection_k.py M tests/python/render_layer/test_move_above_below_layer_collection_l.py M tests/python/render_layer/test_move_above_below_scene_collection_a.py M tests/python/render_layer/test_move_above_below_scene_collection_b.py M tests/python/render_layer/test_move_above_below_scene_collection_c.py M tests/python/render_layer/test_move_above_below_scene_collection_d.py M tests/python/render_layer/test_move_above_below_scene_collection_e.py M tests/python/render_layer/test_move_above_below_scene_collection_f.py M tests/python/render_layer/test_move_above_below_scene_collection_g.py M tests/python/render_layer/test_move_above_below_scene_collection_h.py M tests/python/render_layer/test_move_above_below_scene_collection_i.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_a.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_b.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_c.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_d.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_e.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_f.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_g.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_h.py M tests/python/render_layer/test_move_above_below_scene_collection_sync_i.py M tests/python/render_layer/test_move_into_layer_collection_a.py M tests/python/render_layer/test_move_into_layer_collection_b.py M tests/python/render_layer/test_move_into_layer_collection_c.py M tests/python/render_layer/test_move_into_layer_collection_d.py M tests/python/render_layer/test_move_into_layer_collection_e.py M tests/python/render_layer/test_move_into_layer_collection_f.py M tests/python/render_layer/test_move_into_layer_collection_g.py M tests/python/render_layer/test_move_into_layer_collection_h.py M tests/python/render_layer/test_move_into_layer_collection_i.py M tests/python/render_layer/test_move_into_layer_collection_j.py M tests/python/render_layer/test_move_into_scene_collection_a.py M tests/python/render_layer/test_move_into_scene_collection_b.py M
[Bf-blender-cvs] [6cf3fa9ff0b] blender2.8: Tests: import blendfile without modifying sys.path
Commit: 6cf3fa9ff0b697dc9efeec8578e3341434b6a9ce Author: Sybren A. Stüvel Date: Fri Apr 7 17:25:09 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB6cf3fa9ff0b697dc9efeec8578e3341434b6a9ce Tests: import blendfile without modifying sys.path === M tests/python/render_layer/render_layer_common.py === diff --git a/tests/python/render_layer/render_layer_common.py b/tests/python/render_layer/render_layer_common.py index e1785dbd084..645b111b49c 100644 --- a/tests/python/render_layer/render_layer_common.py +++ b/tests/python/render_layer/render_layer_common.py @@ -122,7 +122,8 @@ def get_scene_collections(scene): def query_scene(filepath, name, callbacks): """Return the equivalent to bpy.context.scene""" -import blendfile +from io_blend_utils.blend import blendfile + with blendfile.open_blend(filepath) as blend: scenes = [block for block in blend.blocks if block.code == b'SC'] for scene in scenes: @@ -137,22 +138,6 @@ def query_scene(filepath, name, callbacks): # Utils # -def import_blendfile(): -import bpy -import os -import sys -path = os.path.join( -bpy.utils.resource_path('LOCAL'), -'scripts', -'addons', -'io_blend_utils', -'blend', -) - -if path not in sys.path: -sys.path.append(path) - - def dump(data): import json return json.dumps( @@ -199,7 +184,6 @@ class RenderLayerTesting(unittest.TestCase): @classmethod def setUpClass(cls): """Runs once""" -cls.pretest_import_blendfile() cls.pretest_parsing() @classmethod @@ -225,15 +209,6 @@ class RenderLayerTesting(unittest.TestCase): root = cls.get_root() cls.assertTrue(root, "Testdir not set") -@staticmethod -def pretest_import_blendfile(): -""" -Make sure blendfile imports with no problems -name has extra _ because we need this test to run first -""" -import_blendfile() -import blendfile - def setUp(self): """Runs once per test""" import bpy ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [063bae4fcc0] blender2.8: Merge branch 'master' into blender2.8
Commit: 063bae4fcc079d0ba7b7f86d327179df36a95146 Author: Sybren A. Stüvel Date: Fri Apr 7 17:28:22 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB063bae4fcc079d0ba7b7f86d327179df36a95146 Merge branch 'master' into blender2.8 # Conflicts: # source/blender/alembic/intern/abc_exporter.h # source/blender/alembic/intern/abc_util.cc === === diff --cc build_files/cmake/macros.cmake index 7b47578cbc7,b7f6649e507..27728917af5 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@@ -595,10 -595,9 +595,11 @@@ function(SETUP_BLENDER_SORTED_LIBS bf_freestyle bf_ikplugin bf_modifiers + bf_alembic bf_bmesh bf_gpu + bf_draw + bf_intern_gawain bf_blenloader bf_blenkernel bf_physics diff --cc source/blender/alembic/intern/abc_exporter.h index cf2a3432da9,0f08037fd17..f0e8e6b6815 --- a/source/blender/alembic/intern/abc_exporter.h +++ b/source/blender/alembic/intern/abc_exporter.h @@@ -110,11 -110,11 +113,11 @@@ private void createTransformWritersHierarchy(EvaluationContext *eval_ctx); void createTransformWritersFlat(); - void createTransformWriter(Object *ob, Object *parent, Object *dupliObParent); + AbcTransformWriter * createTransformWriter(Object *ob, Object *parent, Object *dupliObParent); - void exploreTransform(EvaluationContext *eval_ctx, Object *ob, Object *parent, Object *dupliObParent = NULL); - void exploreObject(EvaluationContext *eval_ctx, Object *ob, Object *dupliObParent); + void exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, Object *parent, Object *dupliObParent); + void exploreObject(EvaluationContext *eval_ctx, Base *ob_base, Object *dupliObParent); void createShapeWriters(EvaluationContext *eval_ctx); - void createShapeWriter(Object *ob, Object *dupliObParent); + void createShapeWriter(Base *ob_base, Object *dupliObParent); AbcTransformWriter *getXForm(const std::string ); diff --cc source/blender/alembic/intern/abc_util.cc index 41cc53b0716,224e0eccd00..b99be718c18 --- a/source/blender/alembic/intern/abc_util.cc +++ b/source/blender/alembic/intern/abc_util.cc @@@ -61,17 -60,7 +61,16 @@@ std::string get_id_name(const ID * cons return name; } - +/** + * @brief get_object_dag_path_name returns the name under which the object + * will be exported in the Alembic file. It is of the form + * "[../grandparent/]parent/object" if dupli_parent is NULL, or + * "dupli_parent/[../grandparent/]parent/object" otherwise. + * @param ob + * @param dupli_parent + * @return + */ - std::string get_object_dag_path_name(Object *ob, Object *dupli_parent) + std::string get_object_dag_path_name(const Object * const ob, Object *dupli_parent) { std::string name = get_id_name(ob); diff --cc source/blender/alembic/intern/abc_util.h index ab2cce59afa,5b53c86a859..7217d5d5cef --- a/source/blender/alembic/intern/abc_util.h +++ b/source/blender/alembic/intern/abc_util.h @@@ -43,17 -48,16 +48,16 @@@ struct ImportSettings struct ID; struct Object; +struct Base; - std::string get_id_name(ID *id); - std::string get_id_name(Object *ob); - std::string get_object_dag_path_name(Object *ob, Object *dupli_parent); + std::string get_id_name(const ID * const id); + std::string get_id_name(const Object * const ob); + std::string get_object_dag_path_name(const Object * const ob, Object *dupli_parent); -bool object_selected(Object *ob); -bool parent_selected(Object *ob); +bool object_selected(const Base * const ob_base); Imath::M44d convert_matrix(float mat[4][4]); - void create_transform_matrix(float r_mat[4][4]); - void create_transform_matrix(Object *obj, float transform_mat[4][4]); + void create_transform_matrix(Object *obj, float r_transform_mat[4][4]); void split(const std::string , const char delim, std::vector ); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [07708b85b4e] master: Buildbot: Link statically against freetype
Commit: 07708b85b4e903ea1be82d82396285c2518e1b3a Author: Sergey Sharybin Date: Fri Apr 7 17:00:43 2017 +0200 Branches: master https://developer.blender.org/rB07708b85b4e903ea1be82d82396285c2518e1b3a Buildbot: Link statically against freetype === M build_files/buildbot/config/blender_linux.cmake === diff --git a/build_files/buildbot/config/blender_linux.cmake b/build_files/buildbot/config/blender_linux.cmake index ed5417c1c6e..45b327f8aeb 100644 --- a/build_files/buildbot/config/blender_linux.cmake +++ b/build_files/buildbot/config/blender_linux.cmake @@ -94,6 +94,10 @@ set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO. set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a" CACHE STRING "" FORCE) set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a" CACHE STRING "" FORCE) +# Freetype +set(FREETYPE_INCLUDE_DIRS "/usr/include/freetype2" CACHE STRING "" FORCE) +set(FREETYPE_LIBRARY "/usr/lib${MULTILIB}/libfreetype.a" CACHE STRING "" FORCE) + # OpenImageIO if(GLIBC EQUAL "2.19") set(OPENIMAGEIO_LIBRARY ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a1f8755d32d] master: Libmv: Fix crash of keyframe selection on 32bit linux
Commit: a1f8755d32d547190f781fa162a80fbd210b9671 Author: Sergey Sharybin Date: Fri Apr 7 17:10:44 2017 +0200 Branches: master https://developer.blender.org/rBa1f8755d32d547190f781fa162a80fbd210b9671 Libmv: Fix crash of keyframe selection on 32bit linux === M intern/libmv/libmv/multiview/homography.cc === diff --git a/intern/libmv/libmv/multiview/homography.cc b/intern/libmv/libmv/multiview/homography.cc index ce533a3ead2..a7679c33bbf 100644 --- a/intern/libmv/libmv/multiview/homography.cc +++ b/intern/libmv/libmv/multiview/homography.cc @@ -209,8 +209,8 @@ class HomographySymmetricGeometricCostFunctor { return true; } - const Vec2 x_; - const Vec2 y_; + const Vec2 _; + const Vec2 _; }; // Termination checking callback used for homography estimation. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [eae691f89e3] master: Buildbot: List freetype for OIIO libraries
Commit: eae691f89e3cb584047196b15c6e75eaea287dcc Author: Sergey Sharybin Date: Fri Apr 7 17:01:07 2017 +0200 Branches: master https://developer.blender.org/rBeae691f89e3cb584047196b15c6e75eaea287dcc Buildbot: List freetype for OIIO libraries OIIO in release environment is compiled with Freetype support. This fixes compilation error of static unit tests. === M build_files/buildbot/config/blender_linux.cmake === diff --git a/build_files/buildbot/config/blender_linux.cmake b/build_files/buildbot/config/blender_linux.cmake index 45b327f8aeb..56f18967300 100644 --- a/build_files/buildbot/config/blender_linux.cmake +++ b/build_files/buildbot/config/blender_linux.cmake @@ -106,6 +106,7 @@ if(GLIBC EQUAL "2.19") /usr/lib${MULTILIB}/libwebp.a /usr/lib${MULTILIB}/liblzma.a /usr/lib${MULTILIB}/libjbig.a + ${FREETYPE_LIBRARY} CACHE STRING "" FORCE ) endif() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4360a74715c] master: CMake: Fix detection of idiff program
Commit: 4360a74715c635b7dd6c5a5cb76e4679fb6d5e42 Author: Sergey Sharybin Date: Fri Apr 7 17:00:06 2017 +0200 Branches: master https://developer.blender.org/rB4360a74715c635b7dd6c5a5cb76e4679fb6d5e42 CMake: Fix detection of idiff program === M build_files/cmake/Modules/FindOpenImageIO.cmake === diff --git a/build_files/cmake/Modules/FindOpenImageIO.cmake b/build_files/cmake/Modules/FindOpenImageIO.cmake index 789097dfd51..d59f9cfcdfc 100644 --- a/build_files/cmake/Modules/FindOpenImageIO.cmake +++ b/build_files/cmake/Modules/FindOpenImageIO.cmake @@ -60,7 +60,7 @@ FIND_FILE(OPENIMAGEIO_IDIFF NAMES idiff HINTS -${OPENIMAGEIO_ROOT_DIR} +${_openimageio_SEARCH_DIRS} PATH_SUFFIXES bin ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [711ac03fa14] blender2.8: OpenGL: Get rid of PRIM_QUADS usage in manipulators code
Commit: 711ac03fa14a0087d72e2429140357f6748b6972 Author: Julian Eisel Date: Fri Apr 7 17:04:14 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB711ac03fa14a0087d72e2429140357f6748b6972 OpenGL: Get rid of PRIM_QUADS usage in manipulators code === M source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c index 7dd5d199e62..cd54f0546a4 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c @@ -93,7 +93,7 @@ static void manipulator_primitive_draw_geom( } immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_QUADS); + wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_TRIANGLE_FAN); wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, PRIM_LINE_LOOP); immUnbindProgram(); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1042a22cbb0] workspaces: OpenGL: Get rid of PRIM_QUADS usage in manipulators code
Commit: 1042a22cbb096a9a6068f7296903a33951f02532 Author: Julian Eisel Date: Fri Apr 7 17:04:14 2017 +0200 Branches: workspaces https://developer.blender.org/rB1042a22cbb096a9a6068f7296903a33951f02532 OpenGL: Get rid of PRIM_QUADS usage in manipulators code === M source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c index 7dd5d199e62..cd54f0546a4 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c @@ -93,7 +93,7 @@ static void manipulator_primitive_draw_geom( } immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_QUADS); + wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, PRIM_TRIANGLE_FAN); wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, PRIM_LINE_LOOP); immUnbindProgram(); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4e09533f8cb] blender2.8: OpenGL / Outliner: QUADS are not supported in core
Commit: 4e09533f8cb67333a268f4af21637f77c8bf13d0 Author: Dalai Felinto Date: Fri Apr 7 16:42:56 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB4e09533f8cb67333a268f4af21637f77c8bf13d0 OpenGL / Outliner: QUADS are not supported in core === M source/blender/editors/space_outliner/outliner_draw.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 9836ae314d1..cfe6e6a2bb5 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1554,9 +1554,9 @@ static void outliner_draw_tree_element_floating( BLI_assert(te_floating->drag_data->insert_type == TE_INSERT_INTO); immUniformColor4ub(UNPACK3(col), col[3] * 0.5f); - immBegin(PRIM_QUADS, 4); - immVertex2f(pos, coord_x, coord_y); + immBegin(PRIM_TRIANGLE_STRIP, 4); immVertex2f(pos, coord_x, coord_y + UI_UNIT_Y); + immVertex2f(pos, coord_x, coord_y); immVertex2f(pos, ar->v2d.cur.xmax, coord_y + UI_UNIT_Y); immVertex2f(pos, ar->v2d.cur.xmax, coord_y); immEnd(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5ec9754286a] workspaces: Merge branch 'blender2.8' into workspaces
Commit: 5ec9754286a89c99f1d7e6d2419374ad1d1b2659 Author: Julian Eisel Date: Fri Apr 7 16:30:18 2017 +0200 Branches: workspaces https://developer.blender.org/rB5ec9754286a89c99f1d7e6d2419374ad1d1b2659 Merge branch 'blender2.8' into workspaces Conflicts: source/blender/depsgraph/intern/depsgraph_tag.cc source/blender/editors/screen/screen_edit.c === === diff --cc source/blender/blenkernel/intern/library_remap.c index b5f795545c7,1f146ece690..1e0ab549c84 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@@ -107,9 -106,11 +106,12 @@@ #include "BKE_scene.h" #include "BKE_text.h" #include "BKE_texture.h" +#include "BKE_workspace.h" #include "BKE_world.h" + #include "DEG_depsgraph.h" + #include "DEG_depsgraph_build.h" + #ifdef WITH_PYTHON #include "BPY_extern.h" #endif diff --cc source/blender/blenloader/intern/readfile.c index cd650ef8bdd,08f2c56e0ad..d31a6d84b88 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@@ -151,8 -148,9 +150,10 @@@ #include "BKE_outliner_treehash.h" #include "BKE_sound.h" #include "BKE_colortools.h" +#include "BKE_workspace.h" + #include "DEG_depsgraph.h" + #include "NOD_common.h" #include "NOD_socket.h" diff --cc source/blender/editors/screen/screen_draw.c index de757078ade,31acaecf029..faf0234932d --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@@ -302,9 -301,9 +302,9 @@@ void ED_screen_draw(wmWindow *win ScrArea *sa2 = NULL; ScrArea *sa3 = NULL; - wmSubWindowSet(win, win->screen->mainwin); + wmSubWindowSet(win, screen->mainwin); - unsigned int pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); /* Note: first loop only draws if U.pixelsize > 1, skip otherwise */ diff --cc source/blender/editors/space_view3d/space_view3d.c index 302d5a5540f,af25c9de781..f5266c1f3ce --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@@ -812,11 -829,13 +830,13 @@@ static void view3d_recalc_used_layers(A } } -static void view3d_main_region_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmNotifier *wmn) +static void view3d_main_region_listener(bScreen *UNUSED(sc), ScrArea *sa, ARegion *ar, +wmNotifier *wmn, const Scene *scene) { - Scene *scene = sc->scene; View3D *v3d = sa->spacedata.first; - + RegionView3D *rv3d = ar->regiondata; + wmManipulatorMap *mmap = ar->manipulator_map; + /* context changes */ switch (wmn->category) { case NC_ANIMATION: @@@ -842,13 -861,8 +862,14 @@@ if (wmn->reference) view3d_recalc_used_layers(ar, wmn, wmn->reference); ED_region_tag_redraw(ar); + WM_manipulatormap_tag_refresh(mmap); break; + case ND_LAYER: + if (wmn->reference) { + BKE_screen_view3d_sync(v3d, wmn->reference); + } + ED_region_tag_redraw(ar); + break; case ND_FRAME: case ND_TRANSFORM: case ND_OB_ACTIVE: @@@ -1027,13 -1044,12 +1051,14 @@@ /* screen was changed, need to update used layers due to NC_SCENE|ND_LAYER_CONTENT */ /* updates used layers only for View3D in active screen */ if (wmn->reference) { - bScreen *sc_ref = wmn->reference; - view3d_recalc_used_layers(ar, wmn, sc_ref->scene); + view3d_recalc_used_layers(ar, wmn, scene); } + WM_manipulatormap_tag_refresh(mmap); ED_region_tag_redraw(ar); break; + case ND_LAYER: + ED_region_tag_redraw(ar); + break; }
[Bf-blender-cvs] [c637e749b2b] master: Tests: Fix compilation error with static OpenMP
Commit: c637e749b2bab67f9ce27937cf0430965cacc907 Author: Sergey Sharybin Date: Fri Apr 7 16:06:05 2017 +0200 Branches: master https://developer.blender.org/rBc637e749b2bab67f9ce27937cf0430965cacc907 Tests: Fix compilation error with static OpenMP === M build_files/cmake/Modules/GTestTesting.cmake === diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake index 0732e10133c..e688db35ef1 100644 --- a/build_files/cmake/Modules/GTestTesting.cmake +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -39,6 +39,9 @@ macro(BLENDER_SRC_GTEST_EX NAME SRC EXTRA_LIBS DO_ADD_TEST) ${PTHREADS_LIBRARIES} extern_glog extern_gflags) + if(WITH_OPENMP_STATIC) + target_link_libraries(${NAME}_test ${OpenMP_LIBRARIES}) + endif() set_target_properties(${NAME}_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}" RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3748ca432d2] master: Alembic import: prevent double user decrement when cancelling import.
Commit: 3748ca432d2d91b9e1d90774726a0fcf07d288bf Author: Sybren A. Stüvel Date: Fri Apr 7 16:02:51 2017 +0200 Branches: master https://developer.blender.org/rB3748ca432d2d91b9e1d90774726a0fcf07d288bf Alembic import: prevent double user decrement when cancelling import. BKE_libblock_free_us() was called on the object data, which decrements its user count, after which the same function was called on the object, which decrements the user count of the object data again. This double decrement was too much. === M source/blender/alembic/intern/alembic_capi.cc === diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc index 0c9f5a1b0d6..c16a2089982 100644 --- a/source/blender/alembic/intern/alembic_capi.cc +++ b/source/blender/alembic/intern/alembic_capi.cc @@ -766,10 +766,6 @@ static void import_endjob(void *user_data) for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { Object *ob = (*iter)->object(); - if (ob->data) { - BKE_libblock_free_us(data->bmain, ob->data); - ob->data = NULL; - } BKE_libblock_free_us(data->bmain, ob); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [43a910abce5] master: Alembic import: prevent crash when cancelling import.
Commit: 43a910abce50963d12c0ccde596347459d921b9a Author: Sybren A. Stüvel Date: Fri Apr 7 16:03:16 2017 +0200 Branches: master https://developer.blender.org/rB43a910abce50963d12c0ccde596347459d921b9a Alembic import: prevent crash when cancelling import. It's possible that cancellation occured between the creation of the reader and the creation of the Blender object, in which case reader->object() returns a NULL pointer. === M source/blender/alembic/intern/alembic_capi.cc === diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc index c16a2089982..9529b370928 100644 --- a/source/blender/alembic/intern/alembic_capi.cc +++ b/source/blender/alembic/intern/alembic_capi.cc @@ -766,6 +766,9 @@ static void import_endjob(void *user_data) for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) { Object *ob = (*iter)->object(); + /* It's possible that cancellation occured between the creation of +* the reader and the creation of the Blender object. */ + if (ob == NULL) continue; BKE_libblock_free_us(data->bmain, ob); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [204e067111a] blender2.8: Fix drawing of planar transfrom manipulators, update matrix code
Commit: 204e067111af9346fccea9981a0a7962ec8ef906 Author: Julian Eisel Date: Fri Apr 7 16:02:45 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB204e067111af9346fccea9981a0a7962ec8ef906 Fix drawing of planar transfrom manipulators, update matrix code === M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c M source/blender/windowmanager/manipulators/intern/wm_manipulator.c M source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h M source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c index 310aec9cbc1..3f7dadbc9c2 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c @@ -44,6 +44,8 @@ #include "ED_screen.h" +#include "GPU_matrix.h" + #include "MEM_guardedalloc.h" #include "RNA_access.h" @@ -73,12 +75,12 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float origin[2]) const float len = arrow->line_len; const float draw_line_ofs = (arrow->manipulator.line_width * 0.5f) / arrow->manipulator.scale; - glPushMatrix(); - glTranslatef(UNPACK2(origin), 0.0f); - glScalef(arrow->manipulator.scale, arrow->manipulator.scale, 0.0f); - glRotatef(RAD2DEGF(arrow->angle), 0.0f, 0.0f, 1.0f); + gpuPushMatrix(); + gpuTranslate3f(UNPACK2(origin), 0.0f); + gpuScale3f(arrow->manipulator.scale, arrow->manipulator.scale, 0.0f); + gpuRotate3f(RAD2DEGF(arrow->angle), 0.0f, 0.0f, 1.0f); /* local offset */ - glTranslatef(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1], 0.0f); + gpuTranslate3f(arrow->manipulator.offset[0] + draw_line_ofs, arrow->manipulator.offset[1], 0.0f); /* TODO get rid of immediate mode */ glBegin(GL_LINES); @@ -91,7 +93,7 @@ static void arrow2d_draw_geom(ArrowManipulator2D *arrow, const float origin[2]) glVertex2f(0.0f, len + size * 1.7f); glEnd(); - glPopMatrix(); + gpuPopMatrix(); } static void manipulator_arrow2d_draw(const bContext *UNUSED(C), struct wmManipulator *manipulator) diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c index 8236d9950a2..05fa0d78c4f 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c @@ -101,9 +101,12 @@ static void manipulator_arrow_get_final_pos(wmManipulator *manipulator, float r_ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, const float color[4]) { + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + bool unbind_shader = true; + + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); + if (arrow->style & MANIPULATOR_ARROW_STYLE_CROSS) { - immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); immUniformColor4fv(color); immBegin(GL_LINES, 4); @@ -112,8 +115,6 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, co immVertex2f(pos, 0.f, -1.0); immVertex2f(pos, 0.f, 1.0); immEnd(); - - immUnbindProgram(); } else if (arrow->style & MANIPULATOR_ARROW_STYLE_CONE) { const float unitx = arrow->aspect[0]; @@ -125,32 +126,13 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, co {-unitx, unity, 0}, }; - unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); - - immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); - immUniformColor4fv(color); - glLineWidth(arrow->manipulator.line_width); - - const int vec_size = ARRAY_SIZE(vec); -
[Bf-blender-cvs] [fd08570665f] master: Cycles: Fix access of NULL pointer as array
Commit: fd08570665ff02dfb4d80f7943d7ac4338743fbc Author: Sergey Sharybin Date: Fri Apr 7 15:07:25 2017 +0200 Branches: master https://developer.blender.org/rBfd08570665ff02dfb4d80f7943d7ac4338743fbc Cycles: Fix access of NULL pointer as array Was confusing guarded allocator for some reason. === M intern/cycles/blender/blender_mesh.cpp === diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 304b1992032..54571b1fea1 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -560,6 +560,9 @@ static void attr_create_pointiness(Scene *scene, return; } const int num_verts = b_mesh.vertices.length(); + if(num_verts == 0) { + return; + } /* STEP 1: Find out duplicated vertices and point duplicates to a single * original vertex. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7fee1af6c87] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators
Commit: 7fee1af6c872d44f62699433fd14ba9739551386 Author: Campbell Barton Date: Fri Apr 7 23:04:10 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rB7fee1af6c872d44f62699433fd14ba9739551386 Merge branch 'blender2.8' into custom-manipulators === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2dd84c9570c] custom-manipulators: 3D Manipulator: add back protected flags check
Commit: 2dd84c9570c54b5061eca1f55854674b65cfb9b1 Author: Campbell Barton Date: Fri Apr 7 23:01:20 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rB2dd84c9570c54b5061eca1f55854674b65cfb9b1 3D Manipulator: add back protected flags check This used to be a separate pass === M source/blender/editors/transform/transform_manipulator.c === diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 91aaa5da0e9..e12f1b4286a 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -921,6 +921,7 @@ static int calc_manipulator_stats(const bContext *C) if (ob == NULL) ob = base->object; calc_tw_center(scene, base->object->obmat[3]); + protectflag_to_drawflags(base->object->protectflag, >twdrawflag); totsel++; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d30f313141c] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators
Commit: d30f313141cbf9f733ef1ae0c3351eda98376a52 Author: Campbell Barton Date: Fri Apr 7 21:44:21 2017 +1000 Branches: custom-manipulators https://developer.blender.org/rBd30f313141cbf9f733ef1ae0c3351eda98376a52 Merge branch 'blender2.8' into custom-manipulators === === diff --cc source/blender/editors/object/object_edit.c index 953471c6827,abdbf3afd5a..51fce12f872 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@@ -2009,42 -2008,6 +2009,44 @@@ void OBJECT_OT_game_physics_copy(struc ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } ++#if 0 +static int object_widget_add_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *ob = ED_object_active_context((bContext *)C); + wmManipulatorMapType *mmaptype = WM_manipulatormaptype_find(&(const struct wmManipulatorMapType_Params) { + "View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW}); + wmManipulatorGroupType *wgrouptype = WM_manipulatorgrouptype_append(mmaptype, TRANSFORM_WGT_object); + /* assign the objects id name to the widget */ + strcpy(wgrouptype->idname, ob->id.name); + + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_widget_add(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name = "Add Widget"; + ot->description = "Add a widget to the active object"; + ot->idname = "OBJECT_OT_widget_add"; + + /* api callbacks */ + ot->invoke = WM_menu_invoke; + ot->exec = object_widget_add_exec; + ot->poll = ED_operator_object_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* properties */ + prop = RNA_def_enum(ot->srna, "type", rna_enum_wm_widget_type_items, 0, "Type", "Select the type of widget to add"); + ot->prop = prop; +} ++#endif + /* generic utility function */ bool ED_object_editmode_calc_active_center(Object *obedit, const bool select_only, float r_center[3]) diff --cc source/blender/editors/object/object_ops.c index 8e1eaa08db2,91950872a3d..3ab6828d637 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@@ -258,8 -250,6 +258,10 @@@ void ED_operatortypes_object(void WM_operatortype_append(OBJECT_OT_data_transfer); WM_operatortype_append(OBJECT_OT_datalayout_transfer); WM_operatortype_append(OBJECT_OT_surfacedeform_bind); + ++#if 0 + WM_operatortype_append(OBJECT_OT_widget_add); ++#endif } void ED_operatormacros_object(void) diff --cc source/blender/editors/transform/transform_manipulator.c index a857ec827c7,91aaa5da0e9..e12f1b4286a --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@@ -921,6 -921,6 +921,7 @@@ static int calc_manipulator_stats(cons if (ob == NULL) ob = base->object; calc_tw_center(scene, base->object->obmat[3]); ++ protectflag_to_drawflags(base->object->protectflag, >twdrawflag); totsel++; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ddb42076c9d] master: Alembic: synced gather_objects_paths with visit_objects
Commit: ddb42076c9d9c9e5b606764e283d09d4df78fb59 Author: Sybren A. Stüvel Date: Fri Apr 7 13:40:38 2017 +0200 Branches: master https://developer.blender.org/rBddb42076c9d9c9e5b606764e283d09d4df78fb59 Alembic: synced gather_objects_paths with visit_objects This was necessary, but was only mentioned at gather_object_paths (which I didn't see earlier). That's now also fixed. === M source/blender/alembic/intern/alembic_capi.cc === diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc index 263a2068543..0c9f5a1b0d6 100644 --- a/source/blender/alembic/intern/alembic_capi.cc +++ b/source/blender/alembic/intern/alembic_capi.cc @@ -121,91 +121,62 @@ ABC_INLINE AbcArchiveHandle *handle_from_archive(ArchiveReader *archive) /* NOTE: this function is similar to visit_objects below, need to keep them in * sync. */ -static void gather_objects_paths(const IObject , ListBase *object_paths) +static bool gather_objects_paths(const IObject , ListBase *object_paths) { if (!object.valid()) { - return; + return false; } - for (int i = 0; i < object.getNumChildren(); ++i) { - IObject child = object.getChild(i); - if (!child.valid()) { - continue; - } + size_t children_claiming_this_object = 0; + size_t num_children = object.getNumChildren(); - bool get_path = false; + for (size_t i = 0; i < num_children; ++i) { + bool child_claims_this_object = gather_objects_paths(object.getChild(i), object_paths); + children_claiming_this_object += child_claims_this_object ? 1 : 0; + } - const MetaData = child.getMetaData(); + const MetaData = object.getMetaData(); + bool get_path = false; + bool parent_is_part_of_this_object = false; - if (IXform::matches(md)) { - /* Check whether or not this object is a Maya locator, which is -* similar to empties used as parent object in Blender. */ - if (has_property(child.getProperties(), "locator")) { - get_path = true; - } - else { - /* Avoid creating an empty object if the child of this transform -* is not a transform (that is an empty). */ - if (child.getNumChildren() == 1) { - if (IXform::matches(child.getChild(0).getMetaData())) { - get_path = true; - } -#if 0 - else { - std::cerr << "gather_objects_paths(" << object.getFullName() << "): Skipping " << child.getFullName() << '\n'; - } -#endif - } - else { - get_path = true; - } - } - } - else if (IPolyMesh::matches(md)) { - get_path = true; - } - else if (ISubD::matches(md)) { - get_path = true; - } - else if (INuPatch::matches(md)) { -#ifdef USE_NURBS - get_path = true; -#endif - } - else if (ICamera::matches(md)) { - get_path = true; - } - else if (IPoints::matches(md)) { - get_path = true; - } - else if (IMaterial::matches(md)) { - /* Pass for now. */ - } - else if (ILight::matches(md)) { - /* Pass for now. */ - } - else if (IFaceSet::matches(md)) { - /* Pass, those are handled in the mesh reader. */ - } - else if (ICurves::matches(md)) { + if (!object.getParent()) { + /* The root itself is not an object we should import. */ + } + else if (IXform::matches(md)) { + if (has_property(object.getProperties(), "locator")) { get_path = true; } else { - assert(false); + get_path = children_claiming_this_object == 0; } - if (get_path) { - AlembicObjectPath *abc_path = static_cast( - MEM_callocN(sizeof(AlembicObjectPath),
[Bf-blender-cvs] [2944438e9a2] blender2.8: 3D View: manipulator from custom-manipulators branch
Commit: 2944438e9a276e48d7eabb5bb88ecec9b2f1e7dc Author: Campbell Barton Date: Fri Apr 7 00:35:57 2017 +1000 Branches: blender2.8 https://developer.blender.org/rB2944438e9a276e48d7eabb5bb88ecec9b2f1e7dc 3D View: manipulator from custom-manipulators branch Original code from @Severin with changes from @dfelinto & @hypersomniac. This doesn't cause many functional changes besides using new transform manipulators. Submitted as D2604 === M source/blender/draw/CMakeLists.txt M source/blender/draw/intern/draw_view.c M source/blender/editors/include/ED_transform.h M source/blender/editors/physics/physics_ops.c M source/blender/editors/space_view3d/space_view3d.c M source/blender/editors/space_view3d/view3d_draw.c M source/blender/editors/space_view3d/view3d_draw_legacy.c M source/blender/editors/space_view3d/view3d_edit.c M source/blender/editors/space_view3d/view3d_intern.h M source/blender/editors/space_view3d/view3d_ops.c M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform.h M source/blender/editors/transform/transform_constraints.c M source/blender/editors/transform/transform_generics.c M source/blender/editors/transform/transform_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c M source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c M source/blender/windowmanager/manipulators/intern/wm_manipulator.c M source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h === diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index cf94fccd4e3..e921a65bfe8 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -43,6 +43,7 @@ set(INC ../editors/space_view3d ../render/extern/include ../render/intern/include + ../windowmanager ../../../intern/glew-mx ../../../intern/guardedalloc diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index eba72fac958..a0f0fb1a9ee 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -41,6 +41,9 @@ #include "UI_resources.h" +#include "WM_api.h" +#include "WM_types.h" + #include "BKE_global.h" #include "BKE_object.h" #include "BKE_paint.h" @@ -699,5 +702,13 @@ void DRW_draw_manipulator(void) const bContext *C = DRW_get_context(); View3D *v3d = CTX_wm_view3d(C); v3d->zbuf = false; - BIF_draw_manipulator(C); + ARegion *ar = CTX_wm_region(C); + + + /* TODO, only draws 3D manipulators right now, need to see how 2D drawing will work in new viewport */ + + /* draw depth culled manipulators - manipulators need to be updated *after* view matrix was set up */ + /* TODO depth culling manipulators is not yet supported, just drawing _3D here, should +* later become _IN_SCENE (and draw _3D separate) */ + WM_manipulatormap_draw(ar->manipulator_map, C, WM_MANIPULATORMAP_DRAWSTEP_3D); } diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 898eecd3e42..376ae8ca567 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -112,6 +112,8 @@ struct TransInfo; struct BaseLegacy; struct Scene; struct Object; +struct wmManipulatorGroup; +struct wmManipulatorGroupType; struct wmOperator; /* UNUSED */ @@ -152,10 +154,17 @@ int BIF_countTransformOrientation(const struct bContext *C); void Transform_Properties(struct wmOperatorType *ot, int flags); -/* view3d manipulators */ +/* transform manipulators */ + +void TRANSFORM_WGT_manipulator(struct wmManipulatorGroupType *wgt); + +void TRANSFORM_WGT_object(struct wmManipulatorGroupType *wgt); + +bool WIDGETGROUP_manipulator2d_poll(const struct bContext *C, struct wmManipulatorGroupType *wgrouptype); +void WIDGETGROUP_manipulator2d_init(const struct bContext *C, struct wmManipulatorGroup *wgroup); +void WIDGETGROUP_manipulator2d_refresh(const struct bContext *C, struct wmManipulatorGroup *wgroup); +void WIDGETGROUP_manipulator2d_draw_prepare(const struct bContext *C, struct wmManipulatorGroup *wgroup); -int BIF_do_manipulator(struct bContext *C, const struct wmEvent *event, struct wmOperator *op); -void BIF_draw_manipulator(const struct bContext *C); /* Snapping */ diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index b1d708ebc07..758ef43590e 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -137,23 +137,6 @@ static void
[Bf-blender-cvs] [8ec1a05ef51] blender2.8: Replace CGSubSurf direct includes to GL/glew.h
Commit: 8ec1a05ef514aff978ec550d89638d0e654d7a0a Author: Dalai Felinto Date: Fri Apr 7 13:03:24 2017 +0200 Branches: blender2.8 https://developer.blender.org/rB8ec1a05ef514aff978ec550d89638d0e654d7a0a Replace CGSubSurf direct includes to GL/glew.h === M source/blender/blenkernel/intern/CCGSubSurf.c M source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c === diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 792e9195f12..68bcfa878ac 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -42,7 +42,7 @@ # include "opensubdiv_converter_capi.h" #endif -#include "GL/glew.h" +#include "GPU_glew.h" /***/ diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c index 65cf899b42b..d18a461add5 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c @@ -43,7 +43,7 @@ #include "opensubdiv_capi.h" #include "opensubdiv_converter_capi.h" -#include "GL/glew.h" +#include "GPU_glew.h" #include "GPU_extensions.h" #define OSD_LOG if (false) printf ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1d9f369824a] master: Cleanup: Unused function
Commit: 1d9f369824a3176e3ba74042787ee16a4daf1957 Author: Sergey Sharybin Date: Fri Apr 7 12:55:04 2017 +0200 Branches: master https://developer.blender.org/rB1d9f369824a3176e3ba74042787ee16a4daf1957 Cleanup: Unused function === M intern/locale/msgfmt.cc === diff --git a/intern/locale/msgfmt.cc b/intern/locale/msgfmt.cc index 6ee1ee14781..02c58ebc5bc 100644 --- a/intern/locale/msgfmt.cc +++ b/intern/locale/msgfmt.cc @@ -42,18 +42,6 @@ bool starts_with(const std::string , } } -std::string ltrim(const std::string ) { - std::string result = str; - result.erase(0, result.find_first_not_of(" \t\r\n")); - return result; -} - -std::string rtrim(const std::string ) { - std::string result = str; - result.erase(result.find_last_not_of(" \t\r\n") + 1); - return result; -} - std::string trim(const std::string ) { std::string result = str; result.erase(0, result.find_first_not_of(" \t\r\n")); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9706bfd25d7] master: Cycles: Fix corrupted mesh render when topology differs at the next frame
Commit: 9706bfd25d7befc4f2c036d207fd88359fd15621 Author: Sergey Sharybin Date: Fri Apr 7 12:48:43 2017 +0200 Branches: master https://developer.blender.org/rB9706bfd25d7befc4f2c036d207fd88359fd15621 Cycles: Fix corrupted mesh render when topology differs at the next frame === M intern/cycles/blender/blender_mesh.cpp === diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index e0e89cec65c..304b1992032 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -1164,8 +1164,8 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob, } /* skip empty meshes */ - size_t numverts = mesh->verts.size(); - size_t numkeys = mesh->curve_keys.size(); + const size_t numverts = mesh->verts.size(); + const size_t numkeys = mesh->curve_keys.size(); if(!numverts && !numkeys) return; @@ -1223,13 +1223,12 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob, /* TODO(sergey): Perform preliminary check for number of verticies. */ if(numverts) { - /* find attributes */ + /* Find attributes. */ Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); Attribute *attr_mN = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_NORMAL); Attribute *attr_N = mesh->attributes.find(ATTR_STD_VERTEX_NORMAL); bool new_attribute = false; - - /* add new attributes if they don't exist already */ + /* Add new attributes if they don't exist already. */ if(!attr_mP) { attr_mP = mesh->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION); if(attr_N) @@ -1237,22 +1236,21 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob, new_attribute = true; } - - /* load vertex data from mesh */ + /* Load vertex data from mesh. */ float3 *mP = attr_mP->data_float3() + time_index*numverts; float3 *mN = (attr_mN)? attr_mN->data_float3() + time_index*numverts: NULL; - + /* NOTE: We don't copy more that existing amount of vertices to prevent +* possible memory corruption. +*/ BL::Mesh::vertices_iterator v; int i = 0; - for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end() && i < numverts; ++v, ++i) { mP[i] = get_float3(v->co()); if(mN) mN[i] = get_float3(v->normal()); } - - /* in case of new attribute, we verify if there really was any motion */ if(new_attribute) { + /* In case of new attribute, we verify if there really was any motion. */ if(b_mesh.vertices.length() != numverts || memcmp(mP, >verts[0], sizeof(float3)*numverts) == 0) { @@ -1275,7 +1273,6 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob, * they had no motion, but we need them anyway now */ float3 *P = >verts[0]; float3 *N = (attr_N)? attr_N->data_float3(): NULL; - for(int step = 0; step < time_index; step++) { memcpy(attr_mP->data_float3() + step*numverts, P, sizeof(float3)*numverts); if(attr_mN) @@ -1283,6 +1280,16 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob, } } } + else { + if(b_mesh.vertices.length() != numverts) { + VLOG(1) << "Topology differs, discarding motion blur for object " + << b_ob.name() << " at time " << time_index; + memcpy(mP, >verts[0], sizeof(float3)*numverts); + if(mN != NULL) { + memcpy(mN, attr_N->data_float3(), sizeof(float3)*numverts); + } + } + } } /* hair motion */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3b3901a9642] custom-manipulators: Fix wm_manipulators.c wrongly include of GL/GLEW.h
Commit: 3b3901a96424dfa4d6919c82fe011909c1c5595c Author: Dalai Felinto Date: Fri Apr 7 12:32:05 2017 +0200 Branches: custom-manipulators https://developer.blender.org/rB3b3901a96424dfa4d6919c82fe011909c1c5595c Fix wm_manipulators.c wrongly include of GL/GLEW.h === M source/blender/windowmanager/manipulators/intern/wm_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c index 923d793941d..d2e748a132c 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c @@ -39,7 +39,7 @@ #include "ED_screen.h" #include "ED_view3d.h" -#include "GL/glew.h" +#include "GPU_glew.h" #include "MEM_guardedalloc.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [08877036168] custom-manipulators: OpenGL: Port wm_manipulator_geometryinfo_draw
Commit: 08877036168737c0d0cbd25fc1fea651231060c7 Author: Dalai Felinto Date: Fri Apr 7 12:33:00 2017 +0200 Branches: custom-manipulators https://developer.blender.org/rB08877036168737c0d0cbd25fc1fea651231060c7 OpenGL: Port wm_manipulator_geometryinfo_draw Thanks to Clément Foucault for the help with the Batch API! === M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c M source/blender/windowmanager/manipulators/intern/wm_manipulator.c M source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c index b013f9f241b..8236d9950a2 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c @@ -145,7 +145,7 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, co } else { #ifdef USE_MANIPULATOR_CUSTOM_ARROWS - wm_manipulator_geometryinfo_draw(_manipulator_geom_data_arrow, select); + wm_manipulator_geometryinfo_draw(_manipulator_geom_data_arrow, select, color); #else unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); @@ -182,7 +182,7 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, co /* draw cube */ immUnbindProgram(); - wm_manipulator_geometryinfo_draw(_manipulator_geom_data_cube, select); + wm_manipulator_geometryinfo_draw(_manipulator_geom_data_cube, select, color); } else { const float len = 0.25f; diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c index d2e748a132c..e059d8f9630 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c @@ -39,6 +39,7 @@ #include "ED_screen.h" #include "ED_view3d.h" +#include "GPU_batch.h" #include "GPU_glew.h" #include "MEM_guardedalloc.h" @@ -57,53 +58,58 @@ /** * Main draw call for ManipulatorGeomInfo data */ -void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool select) +void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool select, const float color[4]) { - GLuint buf[3]; - const bool use_lighting = !select && ((U.manipulator_flag & V3D_SHADED_MANIPULATORS) != 0); + /* TODO store the Batches inside the ManipulatorGeomInfo and updated it when geom changes +* So we don't need to re-created and discard it every time */ - if (use_lighting) - glGenBuffers(3, buf); - else - glGenBuffers(2, buf); + const bool use_lighting = true || (!select && ((U.manipulator_flag & V3D_SHADED_MANIPULATORS) != 0)); + VertexBuffer *vbo; + ElementList *el; + Batch *batch; + ElementListBuilder elb = {0}; - glEnableClientState(GL_VERTEX_ARRAY); - glBindBuffer(GL_ARRAY_BUFFER, buf[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * info->nverts, info->verts, GL_STATIC_DRAW); - glVertexPointer(3, GL_FLOAT, 0, NULL); + VertexFormat format = {0}; + unsigned int pos_id = VertexFormat_add_attrib(, "pos", COMP_F32, 3, KEEP_FLOAT); + unsigned int nor_id; if (use_lighting) { - glEnableClientState(GL_NORMAL_ARRAY); - glBindBuffer(GL_ARRAY_BUFFER, buf[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * info->nverts, info->normals, GL_STATIC_DRAW); - glNormalPointer(GL_FLOAT, 0, NULL); - glShadeModel(GL_SMOOTH); + nor_id = VertexFormat_add_attrib(, "nor", COMP_I16, 3, NORMALIZE_INT_TO_FLOAT); } - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf[1]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short) * (3 * info->ntris), info->indices, GL_STATIC_DRAW); + /* Elements */ + ElementListBuilder_init(, GL_TRIANGLES, info->ntris, info->nverts); + for (int i = 0; i < info->ntris; ++i) { + const unsigned short *idx = >indices[i * 3]; + add_triangle_vertices(, idx[0], idx[1], idx[2]); + } + el = ElementList_build(); + + vbo = VertexBuffer_create_with_format(); + VertexBuffer_allocate_data(vbo, info->nverts); + + VertexBuffer_fill_attrib(vbo, pos_id,
[Bf-blender-cvs] [70391ff991a] custom-manipulators: OpenGL: Port arrow_manipulator.c to gawain
Commit: 70391ff991a8ddae24700ed861e4101b86ff937e Author: Dalai Felinto Date: Fri Apr 7 10:58:18 2017 +0200 Branches: custom-manipulators https://developer.blender.org/rB70391ff991a8ddae24700ed861e4101b86ff937e OpenGL: Port arrow_manipulator.c to gawain The conversion of wm_manipulator_geometryinfo_draw is still pending. === M source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c === diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c index 3fb5059cae5..b013f9f241b 100644 --- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c @@ -101,20 +101,19 @@ static void manipulator_arrow_get_final_pos(wmManipulator *manipulator, float r_ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, const float color[4]) { - /* USE_IMM for other arrow types */ - glColor4fv(color); - if (arrow->style & MANIPULATOR_ARROW_STYLE_CROSS) { - glPushAttrib(GL_ENABLE_BIT); - glDisable(GL_LIGHTING); - glBegin(GL_LINES); - glVertex2f(-1.0, 0.f); - glVertex2f(1.0, 0.f); - glVertex2f(0.f, -1.0); - glVertex2f(0.f, 1.0); - glEnd(); - - glPopAttrib(); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT); + immUniformColor4fv(color); + + immBegin(GL_LINES, 4); + immVertex2f(pos, -1.0, 0.f); + immVertex2f(pos, 1.0, 0.f); + immVertex2f(pos, 0.f, -1.0); + immVertex2f(pos, 0.f, 1.0); + immEnd(); + + immUnbindProgram(); } else if (arrow->style & MANIPULATOR_ARROW_STYLE_CONE) { const float unitx = arrow->aspect[0]; @@ -126,29 +125,48 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, co {-unitx, unity, 0}, }; + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); + immUniformColor4fv(color); + glLineWidth(arrow->manipulator.line_width); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, vec); - glDrawArrays(GL_LINE_LOOP, 0, ARRAY_SIZE(vec)); - glDisableClientState(GL_VERTEX_ARRAY); + + const int vec_size = ARRAY_SIZE(vec); + immBegin(PRIM_LINE_STRIP, vec_size); + for (int i = 0; i < vec_size; i++) { + immVertex3fv(pos, vec[i]); + } + immEnd(); + glLineWidth(1.0); + immUnbindProgram(); + } else { #ifdef USE_MANIPULATOR_CUSTOM_ARROWS wm_manipulator_geometryinfo_draw(_manipulator_geom_data_arrow, select); #else + unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT); + + immBindBuiltinProgram(GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR); + immUniformColor4fv(color); + const float vec[2][3] = { {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, arrow->len}, }; glLineWidth(arrow->manipulator.line_width); - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, vec); - glDrawArrays(GL_LINE_STRIP, 0, ARRAY_SIZE(vec)); - glDisableClientState(GL_VERTEX_ARRAY); - glLineWidth(1.0); + const int vec_size = ARRAY_SIZE(vec); + immBegin(PRIM_LINE_STRIP, vec_size); + for (int i = 0; i < vec_size; i++) { + immVertex3fv(pos, vec[i]); + } + immEnd(); + + glLineWidth(1.0); /* *** draw arrow head *** */ @@ -163,6 +181,7 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, co gpuScale3f(size, size, size); /* draw cube */ + immUnbindProgram(); wm_manipulator_geometryinfo_draw(_manipulator_geom_data_cube, select); } else { @@ -171,12 +190,8 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const
[Bf-blender-cvs] [8f85ee2fc92] master: Cycles: Fix indentation
Commit: 8f85ee2fc920c1ad82b5d465302bdfc3e5790b23 Author: Mai Lavelle Date: Fri Mar 31 02:38:07 2017 -0400 Branches: master https://developer.blender.org/rB8f85ee2fc920c1ad82b5d465302bdfc3e5790b23 Cycles: Fix indentation === M intern/cycles/kernel/kernel_shadow.h === diff --git a/intern/cycles/kernel/kernel_shadow.h b/intern/cycles/kernel/kernel_shadow.h index 0426e0a62c9..db6f839d9ed 100644 --- a/intern/cycles/kernel/kernel_shadow.h +++ b/intern/cycles/kernel/kernel_shadow.h @@ -422,9 +422,9 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, return false; } #ifdef __SHADOW_TRICKS__ -const int skip_object = state->catcher_object; + const int skip_object = state->catcher_object; #else -const int skip_object = OBJECT_NONE; + const int skip_object = OBJECT_NONE; #endif /* Do actual shadow shading. */ /* First of all, we check if integrator requires transparent shadows. ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [91b9db07248] master: Cycles: Change work pool and global size of split CPU for easier debugging
Commit: 91b9db07248c5b7061d8d0907629169e742002f7 Author: Mai Lavelle Date: Thu Apr 6 05:08:35 2017 -0400 Branches: master https://developer.blender.org/rB91b9db07248c5b7061d8d0907629169e742002f7 Cycles: Change work pool and global size of split CPU for easier debugging === M intern/cycles/device/device_cpu.cpp M intern/cycles/device/device_split_kernel.cpp M intern/cycles/kernel/kernel_types.h === diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 2761d9488ca..3c481bb2b39 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -856,7 +856,7 @@ int2 CPUSplitKernel::split_kernel_local_size() } int2 CPUSplitKernel::split_kernel_global_size(device_memory& /*kg*/, device_memory& /*data*/, DeviceTask * /*task*/) { - return make_int2(64, 1); + return make_int2(1, 1); } uint64_t CPUSplitKernel::state_buffer_size(device_memory& kernel_globals, device_memory& /*data*/, size_t num_threads) { diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp index 30e7a58281c..fa641161c05 100644 --- a/intern/cycles/device/device_split_kernel.cpp +++ b/intern/cycles/device/device_split_kernel.cpp @@ -151,7 +151,8 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task, /* Calculate max groups */ /* Denotes the maximum work groups possible w.r.t. current requested tile size. */ - unsigned int max_work_groups = num_global_elements / WORK_POOL_SIZE + 1; + unsigned int work_pool_size = (device->info.type == DEVICE_CPU) ? WORK_POOL_SIZE_CPU : WORK_POOL_SIZE_GPU; + unsigned int max_work_groups = num_global_elements / work_pool_size + 1; /* Allocate work_pool_wgs memory. */ work_pool_wgs.resize(max_work_groups * sizeof(unsigned int)); diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 19c91248922..623f3728c69 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -56,7 +56,13 @@ CCL_NAMESPACE_BEGIN #define VOLUME_STACK_SIZE 16 -#define WORK_POOL_SIZE 64 +#define WORK_POOL_SIZE_GPU 64 +#define WORK_POOL_SIZE_CPU 1 +#ifdef __KERNEL_GPU__ +# define WORK_POOL_SIZE WORK_POOL_SIZE_GPU +#else +# define WORK_POOL_SIZE WORK_POOL_SIZE_CPU +#endif /* device capabilities */ #ifdef __KERNEL_CPU__ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5b45fff1362] master: Cycles: Add missing flush
Commit: 5b45fff13629a4bf4653fbbde2e5bab3542fbfeb Author: Mai Lavelle Date: Fri Mar 31 02:00:27 2017 -0400 Branches: master https://developer.blender.org/rB5b45fff13629a4bf4653fbbde2e5bab3542fbfeb Cycles: Add missing flush === M intern/cycles/device/opencl/opencl_util.cpp === diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp index 8128fcee09b..6dca642f3f3 100644 --- a/intern/cycles/device/opencl/opencl_util.cpp +++ b/intern/cycles/device/opencl/opencl_util.cpp @@ -281,6 +281,7 @@ void OpenCLDeviceBase::OpenCLProgram::add_log(string msg, bool debug) } else if(!debug) { printf("%s\n", msg.c_str()); + fflush(stdout); } else { VLOG(2) << msg; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d66ffaebef9] master: Cycles: Check ray state properly to avoid endless loop
Commit: d66ffaebef924dcfa1e5396852166760c07f0342 Author: Mai Lavelle Date: Tue Mar 28 02:28:36 2017 -0400 Branches: master https://developer.blender.org/rBd66ffaebef924dcfa1e5396852166760c07f0342 Cycles: Check ray state properly to avoid endless loop The state mask wasnt applied before comparison giving false results. It shouldnt really happen that a ray state contains any flags that need to be masked away, but if it does happen its better to not get stuck. === M intern/cycles/device/device_split_kernel.cpp === diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp index ae462a560b7..30e7a58281c 100644 --- a/intern/cycles/device/device_split_kernel.cpp +++ b/intern/cycles/device/device_split_kernel.cpp @@ -256,10 +256,8 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task, activeRaysAvailable = false; for(int rayStateIter = 0; rayStateIter < global_size[0] * global_size[1]; ++rayStateIter) { - int8_t state = ray_state.get_data()[rayStateIter]; - - if(state != RAY_INACTIVE) { - if(state == RAY_INVALID) { + if(!IS_STATE(ray_state.get_data(), rayStateIter, RAY_INACTIVE)) { + if(IS_STATE(ray_state.get_data(), rayStateIter, RAY_INVALID)) { /* Something went wrong, abort to avoid looping endlessly. */ device->set_error("Split kernel error: invalid ray state"); return false; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e8e341b5854] master: Alembic: documented use of CacheReader struct
Commit: e8e341b585430dfca96b85ed540b398bc0af93a1 Author: Sybren A. Stüvel Date: Thu Feb 23 11:58:20 2017 +0100 Branches: master https://developer.blender.org/rBe8e341b585430dfca96b85ed540b398bc0af93a1 Alembic: documented use of CacheReader struct === M source/blender/alembic/intern/abc_util.h === diff --git a/source/blender/alembic/intern/abc_util.h b/source/blender/alembic/intern/abc_util.h index 6be86056e45..5b53c86a859 100644 --- a/source/blender/alembic/intern/abc_util.h +++ b/source/blender/alembic/intern/abc_util.h @@ -32,6 +32,11 @@ # define ABC_INLINE static inline #endif +/** + * @brief The CacheReader struct is only used for anonymous pointers, + * to interface between C and C++ code. This library only creates + * pointers to AbcObjectReader (or subclasses thereof). + */ struct CacheReader { int unused; }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [102966b12ef] master: Fix building alembic gtest with buildinfo...
Commit: 102966b12ef46724af4bd9880e3701512b570af8 Author: Bastien Montagne Date: Fri Apr 7 10:44:13 2017 +0200 Branches: master https://developer.blender.org/rB102966b12ef46724af4bd9880e3701512b570af8 Fix building alembic gtest with buildinfo... === M tests/gtests/alembic/CMakeLists.txt === diff --git a/tests/gtests/alembic/CMakeLists.txt b/tests/gtests/alembic/CMakeLists.txt index d4a1e1f29ad..c1480910d42 100644 --- a/tests/gtests/alembic/CMakeLists.txt +++ b/tests/gtests/alembic/CMakeLists.txt @@ -37,7 +37,15 @@ include_directories(${INC}) setup_libdirs() get_property(BLENDER_SORTED_LIBS GLOBAL PROPERTY BLENDER_SORTED_LIBS_PROP) +if(WITH_BUILDINFO) + set(_buildinfo_src "$") +else() + set(_buildinfo_src "") +endif() + # For motivation on doubling BLENDER_SORTED_LIBS, see ../bmesh/CMakeLists.txt -BLENDER_SRC_GTEST(abc_matrix "abc_matrix_test.cc" "${BLENDER_SORTED_LIBS};${BLENDER_SORTED_LIBS}") +BLENDER_SRC_GTEST(abc_matrix "abc_matrix_test.cc;${_buildinfo_src}" "${BLENDER_SORTED_LIBS};${BLENDER_SORTED_LIBS}") + +unset(_buildinfo_src) setup_liblinks(abc_matrix_test) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d649f268580] blender2.8: Fix compilation error after recent changes
Commit: d649f26858030e88e52c993a41c1f28fb4decd40 Author: Sergey Sharybin Date: Fri Apr 7 09:58:32 2017 +0200 Branches: blender2.8 https://developer.blender.org/rBd649f26858030e88e52c993a41c1f28fb4decd40 Fix compilation error after recent changes === M source/gameengine/GamePlayer/ghost/CMakeLists.txt M source/gameengine/GamePlayer/ghost/GPG_ghost.cpp === diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index 577e25d6198..6d6d53b1e17 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -43,6 +43,7 @@ set(INC ../../../blender/blenlib ../../../blender/blenloader ../../../blender/blentranslation + ../../../blender/depsgraph ../../../blender/gpu ../../../blender/imbuf ../../../blender/makesdna diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 51ea5446896..72ab06009b6 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -1202,7 +1202,7 @@ int main( IMB_exit(); BKE_images_exit(); - DAG_exit(); + DEG_free_node_types(); IMB_moviecache_destruct(); SYS_DeleteSystem(syshandle); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9c01aaa3dd7] blender2.8: OpenGL: disable rotate manipulator clipping on Mac
Commit: 9c01aaa3dd7456d6811bad4f37190833fa5a04a0 Author: Mike Erwin Date: Fri Apr 7 03:08:00 2017 -0400 Branches: blender2.8 https://developer.blender.org/rB9c01aaa3dd7456d6811bad4f37190833fa5a04a0 OpenGL: disable rotate manipulator clipping on Mac This fixes T51143. gl_ClipDistance is part of GLSL version 1.3 but Mac is stuck on 1.2 for now. This workaround uses GPU_SHADER_3D_UNIFORM_COLOR for the entire rotation widget, ignoring any clipping plane. The CLIPPING shader only works on GLSL 1.3+ so I removed its 1.2 cruft. A legacy implementation using gl_ClipVertex might be possible, but is not worth the effort. This problem (and workaround) goes away when all platforms move to 3.3 core profile. === M source/blender/editors/transform/transform_manipulator.c M source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl === diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 384bdb3b258..624cd7db679 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1133,18 +1133,24 @@ static void draw_manipulator_rotate( // donut arcs if (arcs) { float axis_model_mat[4][4]; + +#if !APPLE_LEGACY float clip_plane[4]; copy_v3_v3(clip_plane, rv3d->viewinv[2]); clip_plane[3] = -dot_v3v3(rv3d->viewinv[2], rv3d->twmat[3]); clip_plane[3] -= 0.02f * size; /* clip just a bit more so view aligned arcs are not visible */ +#endif gpuPopMatrix(); /* we setup our own matrix, pop previously set twmat */ + +#if !APPLE_LEGACY immUnbindProgram(); immBindBuiltinProgram(GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR); immUniform4fv("ClipPlane", clip_plane); glEnable(GL_CLIP_DISTANCE0); +#endif /* Z circle */ if (drawflags & MAN_ROT_Z) { @@ -1152,7 +1158,9 @@ static void draw_manipulator_rotate( else manipulator_setcolor(v3d, 'Z', colcode, 255); twmat_to_rotation_axis_mat(rv3d->twmat, 2, ortho, axis_model_mat); +#if !APPLE_LEGACY immUniformMatrix4fv("ModelMatrix", axis_model_mat); +#endif gpuPushMatrix(); gpuMultMatrix3D(axis_model_mat); @@ -1165,7 +1173,9 @@ static void draw_manipulator_rotate( else manipulator_setcolor(v3d, 'X', colcode, 255); twmat_to_rotation_axis_mat(rv3d->twmat, 0, ortho, axis_model_mat); +#if !APPLE_LEGACY immUniformMatrix4fv("ModelMatrix", axis_model_mat); +#endif gpuPushMatrix(); gpuMultMatrix3D(axis_model_mat); @@ -1178,7 +1188,9 @@ static void draw_manipulator_rotate( else manipulator_setcolor(v3d, 'Y', colcode, 255); twmat_to_rotation_axis_mat(rv3d->twmat, 1, ortho, axis_model_mat); +#if !APPLE_LEGACY immUniformMatrix4fv("ModelMatrix", axis_model_mat); +#endif gpuPushMatrix(); gpuMultMatrix3D(axis_model_mat); @@ -1186,7 +1198,10 @@ static void draw_manipulator_rotate( gpuPopMatrix(); } +#if !APPLE_LEGACY glDisable(GL_CLIP_DISTANCE0); +#endif + gpuPushMatrix(); /* to balance final pop at end of function */ } else { diff --git a/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl index 2988bb3b682..84e44837264 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl @@ -3,11 +3,7 @@ uniform mat4 ModelViewProjectionMatrix; uniform mat4 ModelMatrix; uniform vec4 ClipPlane; -#if __VERSION__ == 120 - attribute vec3 pos; -#else - in vec3 pos; -#endif +in vec3 pos; void main() { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c986a2c7aa3] blender2.8: fix rotation manipulator's Push/PopMatrix balance
Commit: c986a2c7aa33423cfdda575d8ed2b50caf053495 Author: Mike Erwin Date: Fri Apr 7 03:51:10 2017 -0400 Branches: blender2.8 https://developer.blender.org/rBc986a2c7aa33423cfdda575d8ed2b50caf053495 fix rotation manipulator's Push/PopMatrix balance Was popping out the bottom of the stack. === M source/blender/editors/transform/transform_manipulator.c === diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index ffa22e1326b..384bdb3b258 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1187,6 +1187,7 @@ static void draw_manipulator_rotate( } glDisable(GL_CLIP_DISTANCE0); + gpuPushMatrix(); /* to balance final pop at end of function */ } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs