Blender V5.0
gpu_shader_line_dashed_uniform_color_infos.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#ifdef GPU_SHADER
10# pragma once
11# include "gpu_shader_compat.hh"
12
13# include "GPU_shader_shared.hh"
15#endif
16
19
20/* We leverage hardware interpolation to compute distance along the line. */
21GPU_SHADER_INTERFACE_INFO(gpu_shader_line_dashed_interface)
22NO_PERSPECTIVE(float2, stipple_start) /* In screen space */
23FLAT(float2, stipple_pos)
24GPU_SHADER_INTERFACE_END() /* In screen space */
25
26GPU_SHADER_CREATE_INFO(gpu_shader_3D_line_dashed_uniform_color)
28VERTEX_OUT(flat_color_iface)
29PUSH_CONSTANT(float4x4, ModelViewProjectionMatrix)
30PUSH_CONSTANT(float2, viewport_size)
31PUSH_CONSTANT(float, dash_width)
32PUSH_CONSTANT(float, udash_factor) /* if > 1.0f, solid line. */
33/* TODO(fclem): Remove this. And decide to discard if color2 alpha is 0. */
34PUSH_CONSTANT(int, colors_len) /* Enabled if > 0, 1 for solid line. */
36PUSH_CONSTANT(float4, color2)
37VERTEX_OUT(gpu_shader_line_dashed_interface)
38FRAGMENT_OUT(0, float4, fragColor)
39VERTEX_SOURCE("gpu_shader_3D_line_dashed_uniform_color_vert.glsl")
40FRAGMENT_SOURCE("gpu_shader_2D_line_dashed_frag.glsl")
43
44GPU_SHADER_CREATE_INFO(gpu_shader_3D_line_dashed_uniform_color_clipped)
45PUSH_CONSTANT(float4x4, ModelMatrix)
46ADDITIONAL_INFO(gpu_shader_3D_line_dashed_uniform_color)
47ADDITIONAL_INFO(gpu_clip_planes)
uint pos
#define GPU_SHADER_INTERFACE_END()
#define GPU_SHADER_INTERFACE_INFO(_interface)
#define GPU_SHADER_CREATE_INFO(_info)
#define GPU_SHADER_CREATE_END()
#define VERTEX_OUT(stage_interface)
#define FRAGMENT_SOURCE(filename)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define FLAT(type, name)
#define FRAGMENT_OUT(slot, type, name)
#define NO_PERSPECTIVE(type, name)
#define VERTEX_SOURCE(filename)
#define VERTEX_IN(slot, type, name)
#define DO_STATIC_COMPILATION()
MatBase< 4, 4 > float4x4