Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-16 21:27:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-16 21:27:32 +0300
commit6ade522f277fb74d4691973b7bb55840300043a2 (patch)
tree1d09279f04406d74d5611223a72a479832613759 /source/blender
parent1fb7f36acb04cd4e158a376cecffcd1468c24393 (diff)
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.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 55abb269660..7379bdde4ab 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -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)