From eccb0b222e3465baa71430223c5ee2f0206a7b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 19 Mar 2022 21:59:29 +0100 Subject: GPencil: Port main object shader to ShaderCreateInfo This is quite a huge cleanup. Making use of the `common_gpencil_lib.glsl` to share more codes and use more consistent codestyle. The gpencil engine specifics are now out of the `gpencil_vertex()` function making it easier to add more features. There should be no regression as all workarounds are kept as is. --- source/blender/draw/intern/draw_cache_impl_gpencil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/draw/intern') diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index 08c33555b71..a4465b9aed4 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -28,6 +28,8 @@ #include "draw_cache.h" #include "draw_cache_impl.h" +#include "../engines/gpencil/gpencil_defines.h" + #define BEZIER_HANDLE (1 << 3) #define COLOR_SHIFT 5 @@ -321,7 +323,7 @@ static void gpencil_buffer_add_point(gpStrokeVert *verts, vert->point_id = v; vert->thickness = max_ff(0.0f, gps->thickness * pt->pressure) * (round_cap1 ? 1.0f : -1.0f); /* Tag endpoint material to -1 so they get discarded by vertex shader. */ - vert->mat = (is_endpoint) ? -1 : (gps->mat_nr % GP_MATERIAL_BUFFER_LEN); + vert->mat = (is_endpoint) ? -1 : (gps->mat_nr % GPENCIL_MATERIAL_BUFFER_LEN); float aspect_ratio = gps->aspect_ratio[0] / max_ff(gps->aspect_ratio[1], 1e-8); -- cgit v1.2.3