Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Thu, 9 Mar 2017 05:47:31 +0000 (16:47 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 9 Mar 2017 05:47:31 +0000 (16:47 +1100)
1  2 
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/include/ED_view3d.h
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/gpu/CMakeLists.txt
source/blender/makesdna/DNA_userdef_types.h

index a6f2fa40f4612b68b25199b69a1ef305d9d35678,d19862cb4b08d438d66db1627a3deedfb190febf..1b2b70cd60d600c2d9c368043a08fcf89a3338ba
@@@ -177,10 -179,10 +179,10 @@@ void *get_nearest_bone(bContext *C, con
        rect.xmin = rect.xmax = xy[0];
        rect.ymin = rect.ymax = xy[1];
        
-       hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect, true);
+       hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect, VIEW3D_SELECT_PICK_NEAREST);
  
        if (hits > 0)
 -              return get_bone_from_selectbuffer(vc.scene, vc.scene->basact, buffer, hits, findunsel, true);
 +              return get_bone_from_selectbuffer(vc.scene, vc.sl->basact, buffer, hits, findunsel, true);
        
        return NULL;
  }
index 3f6afb2634df8a5c4a621fd16e5fe8abfca0824f,0c0a7df8f8411222a1a4e4af73c4ca73445d2825..6d2208bee539b2cb5b649dbe63c3b19c75eb298a
@@@ -1063,11 -1095,10 +1067,11 @@@ static Base *object_mouse_select_menu
          bContext *C, ViewContext *vc, unsigned int *buffer, int hits,
          const int mval[2], bool toggle)
  {
-       int baseCount = 0;
+       short baseCount = 0;
        bool ok;
        LinkNode *linklist = NULL;
 -      
 +
 +      /* handle base->selcol */
        CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
        {
                ok = false;
index 637479f9ee3850613f56c160308bba943e2b2f77,9d1a3633786c935ea6b4ee9aa58dd312c365d3eb..3a28b875f008c2ef362cc3f0df7992e933a932fe
@@@ -1164,10 -1170,11 +1164,12 @@@ static void view3d_select_loop(ViewCont
   *
   * \note (vc->obedit == NULL) can be set to explicitly skip edit-object selection.
   */
- short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const rcti *input, bool do_nearest)
+ int view3d_opengl_select(
+         ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const rcti *input,
+         int select_mode)
  {
        Scene *scene = vc->scene;
 +      SceneLayer *sl = vc->sl;
        View3D *v3d = vc->v3d;
        ARegion *ar = vc->ar;
        rcti rect;
        if (vc->rv3d->rflag & RV3D_CLIPPING)
                ED_view3d_clipping_set(vc->rv3d);
        
-       if (do_passes)
-               GPU_select_begin(buffer, bufsize, &rect, GPU_SELECT_NEAREST_FIRST_PASS, 0);
-       else
-               GPU_select_begin(buffer, bufsize, &rect, GPU_SELECT_ALL, 0);
+       GPU_select_begin(buffer, bufsize, &rect, gpu_select_mode, 0);
  
 -      view3d_select_loop(vc, scene, v3d, ar, use_obedit_skip);
 +      view3d_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip);
  
        hits = GPU_select_end();
        
index 5d26d6854180ad5d7c4108af00c4f95fc3c0f39b,885ff2ff159c4c70d3e62ffea9eb0ca5df28a2e6..5049f8e3eda99b2581af438c5193eea55c7efe8a
@@@ -58,37 -54,13 +58,39 @@@ set(SR
        intern/gpu_draw.c
        intern/gpu_extensions.c
        intern/gpu_framebuffer.c
 +      intern/gpu_immediate.c
        intern/gpu_init_exit.c
        intern/gpu_material.c
 +      intern/gpu_matrix.c
        intern/gpu_select.c
+       intern/gpu_select_pick.c
+       intern/gpu_select_sample_query.c
        intern/gpu_shader.c
        intern/gpu_texture.c
 +      intern/gpu_uniformbuffer.c
 +      intern/gpu_viewport.c
 +
 +      gawain/attrib_binding.c
 +      gawain/attrib_binding.h
 +      gawain/batch.c
 +      gawain/batch.h
 +      gawain/buffer_id.h
 +      gawain/buffer_id.cpp
 +      gawain/common.h
 +      gawain/element.c
 +      gawain/element.h
 +      gawain/immediate.c
 +      gawain/immediate.h
 +      gawain/imm_util.c
 +      gawain/imm_util.h
 +      gawain/primitive.h
 +      gawain/primitive.c
 +      gawain/shader_interface.c
 +      gawain/shader_interface.h
 +      gawain/vertex_buffer.c
 +      gawain/vertex_buffer.h
 +      gawain/vertex_format.c
 +      gawain/vertex_format.h
  
        shaders/gpu_shader_fx_lib.glsl
        shaders/gpu_shader_fx_ssao_frag.glsl
        GPU_select.h
        GPU_shader.h
        GPU_texture.h
 +      GPU_uniformbuffer.h
 +      GPU_viewport.h
 +
        intern/gpu_codegen.h
        intern/gpu_private.h
+       intern/gpu_select_private.h
  )
  
 +data_to_c_simple(shaders/gpu_shader_depth_only_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_uniform_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_checker_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_diag_stripes_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_simple_lighting_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_flat_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_line_dashed_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_line_dashed_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_smooth_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_smooth_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_image_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_shuffle_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_mask_uniform_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_modulate_alpha_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_rect_modulate_alpha_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_depth_linear_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_image_interlace_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_image_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_passthrough_vert.glsl SRC)
 +
 +data_to_c_simple(shaders/gpu_shader_instance_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_screenspace_variying_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_screen_aligned_axis_name_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_camera_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_distance_line_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_geom.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_vert.glsl SRC)
 +
 +data_to_c_simple(shaders/gpu_shader_3D_groundline_geom.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_groundpoint_vert.glsl SRC)
 +
 +data_to_c_simple(shaders/gpu_shader_point_uniform_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_point_uniform_color_aa_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_point_varying_color_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl SRC)
 +
 +data_to_c_simple(shaders/gpu_shader_edges_front_back_persp_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_front_back_persp_geom.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_front_back_persp_legacy_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_front_back_ortho_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_overlay_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_overlay_geom.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_overlay_simple_geom.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_edges_overlay_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_text_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_text_frag.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_keyframe_diamond_vert.glsl SRC)
 +data_to_c_simple(shaders/gpu_shader_keyframe_diamond_frag.glsl SRC)
 +
  data_to_c_simple(shaders/gpu_shader_geometry.glsl SRC)
  data_to_c_simple(shaders/gpu_shader_fire_frag.glsl SRC)
  data_to_c_simple(shaders/gpu_shader_smoke_frag.glsl SRC)