0
0
Fork 0

me-main #1

Merged
Nate Rupsis merged 123 commits from me-main into main 2023-02-13 18:39:11 +01:00
9 changed files with 6 additions and 39 deletions
Showing only changes of commit d165d6aa2a - Show all commits

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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.

View File

@ -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",

View File

@ -1,6 +0,0 @@
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
finalColor = color;
}

View File

@ -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")

View File

@ -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);