diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 0401fdfc963..7f8ff54cc12 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -1003,8 +1003,8 @@ static void draw_mouse_position(tGPDfill *tgpf) uint col = GPU_vertformat_attr_add(format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT); /* Draw mouse click position in Blue. */ - immBindBuiltinProgram(GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR); - GPU_point_size(point_size); + immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); + immUniform1f("size", point_size * M_SQRT2); immBegin(GPU_PRIM_POINTS, 1); immAttr4ubv(col, mouse_color); immVertex3fv(pos, &pt->x); diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc index 89f0f9031df..54bef8d2257 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc @@ -966,9 +966,8 @@ static void min_distance_edit_draw(bContext *C, int /*x*/, int /*y*/, void *cust const uint pos3d = GPU_vertformat_attr_add(format3d, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); const uint col3d = GPU_vertformat_attr_add(format3d, "color", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); - immBindBuiltinProgram(GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR); - - GPU_point_size(3.0f); + immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); + immUniform1f("size", 4.0f); immBegin(GPU_PRIM_POINTS, points_wo.size()); float3 brush_origin_wo = math::transform_point(op_data.curves_to_world_mat, op_data.pos_cu); diff --git a/source/blender/editors/space_view3d/view3d_draw.cc b/source/blender/editors/space_view3d/view3d_draw.cc index 7018fa16fe6..b50721a22c5 100644 --- a/source/blender/editors/space_view3d/view3d_draw.cc +++ b/source/blender/editors/space_view3d/view3d_draw.cc @@ -1104,8 +1104,8 @@ static void draw_rotation_guide(const RegionView3D *rv3d) immUnbindProgram(); /* -- draw rotation center -- */ - immBindBuiltinProgram(GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR); - GPU_point_size(5.0f); + immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); + immUniform1f("size", 7.0f); immBegin(GPU_PRIM_POINTS, 1); immAttr4ubv(col, color); immVertex3fv(pos, o); diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 4f207fd7572..2f345ec6a90 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -377,7 +377,6 @@ set(GLSL_SRC shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl shaders/gpu_shader_point_varying_color_frag.glsl - shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index 3cf64edaa6e..48cbc13b530 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -322,14 +322,6 @@ typedef enum eGPUBuiltinShader { * \param pos: in vec2 */ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, - /** - * Draw round points with a hardcoded size. - * Take a single color for all the vertices and a 3D position for each vertex. - * - * \param color: uniform vec4 - * \param pos: in vec3 - */ - GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR, /** * Draw round points with a constant size. * Take a single color for all the vertices and a 3D position for each vertex. diff --git a/source/blender/gpu/intern/gpu_shader_builtin.cc b/source/blender/gpu/intern/gpu_shader_builtin.cc index a2f4addf36d..03c3702c08b 100644 --- a/source/blender/gpu/intern/gpu_shader_builtin.cc +++ b/source/blender/gpu/intern/gpu_shader_builtin.cc @@ -161,11 +161,6 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .name = "GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA", .create_info = "gpu_shader_2D_point_uniform_size_uniform_color_outline_aa", }, - [GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR] = - { - .name = "GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR", - .create_info = "gpu_shader_3D_point_fixed_size_varying_color", - }, [GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR] = { .name = "GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR", diff --git a/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl deleted file mode 100644 index a43c1aa40cf..00000000000 --- a/source/blender/gpu/shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl +++ /dev/null @@ -1,6 +0,0 @@ - -void main() -{ - gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); - finalColor = color; -} diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh index c71d7cf632a..e7a4705761f 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_point_info.hh @@ -7,16 +7,6 @@ #include "gpu_shader_create_info.hh" -GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_fixed_size_varying_color) - .vertex_in(0, Type::VEC3, "pos") - .vertex_in(1, Type::VEC4, "color") - .vertex_out(smooth_color_iface) - .fragment_out(0, Type::VEC4, "fragColor") - .push_constant(Type::MAT4, "ModelViewProjectionMatrix") - .vertex_source("gpu_shader_3D_point_fixed_size_varying_color_vert.glsl") - .fragment_source("gpu_shader_point_varying_color_frag.glsl") - .do_static_compilation(true); - GPU_SHADER_CREATE_INFO(gpu_shader_3D_point_varying_size_varying_color) .vertex_in(0, Type::VEC3, "pos") .vertex_in(1, Type::VEC4, "color") diff --git a/source/blender/gpu/tests/gpu_shader_builtin_test.cc b/source/blender/gpu/tests/gpu_shader_builtin_test.cc index 567f1370f00..bb3f9f1a2ae 100644 --- a/source/blender/gpu/tests/gpu_shader_builtin_test.cc +++ b/source/blender/gpu/tests/gpu_shader_builtin_test.cc @@ -52,8 +52,6 @@ static void test_shader_builtin() GPU_SHADER_CFG_DEFAULT); test_compile_builtin_shader(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, GPU_SHADER_CFG_DEFAULT); - test_compile_builtin_shader(GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR, - GPU_SHADER_CFG_DEFAULT); test_compile_builtin_shader(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR, GPU_SHADER_CFG_DEFAULT); test_compile_builtin_shader(GPU_SHADER_GPENCIL_STROKE, GPU_SHADER_CFG_DEFAULT);