Fix T79523 Paint Cursor: Wide line not supported on OSX

This replace the use of GPU_line_width by the specialized
GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR shader.
This commit is contained in:
Clément Foucault 2020-09-16 20:27:10 +02:00
parent 1fb7f36acb
commit 6ade522f27
Notes: blender-bot 2023-02-14 09:48:23 +01:00
Referenced by commit a0f6da0abc, Revert "Fix T79523 Paint Cursor: Wide line not supported on OSX"
Referenced by issue #81215, Crosshair cursor is too small when sculpting on 4k resolution.
Referenced by issue #79523, Weight Paint hard to see red circle too thinner
1 changed files with 12 additions and 6 deletions

View File

@ -1839,22 +1839,28 @@ static void paint_cursor_update_anchored_location(PaintCursorContext *pcontext)
static void paint_cursor_setup_2D_drawing(PaintCursorContext *pcontext)
{
GPU_line_width(2.0f);
GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
pcontext->pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
float viewport[4];
GPU_viewport_size_get_f(viewport);
immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR);
immUniform2fv("viewportSize", &viewport[2]);
immUniform1f("lineWidth", 2.0f * U.pixelsize);
}
static void paint_cursor_setup_3D_drawing(PaintCursorContext *pcontext)
{
GPU_line_width(2.0f);
GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
pcontext->pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
float viewport[4];
GPU_viewport_size_get_f(viewport);
immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR);
immUniform2fv("viewportSize", &viewport[2]);
immUniform1f("lineWidth", 2.0f * U.pixelsize);
}
static void paint_cursor_restore_drawing_state(void)