Blender V4.3
gpu_shader_text_info.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022-2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11GPU_SHADER_INTERFACE_INFO(text_iface, "")
12 .flat(Type::VEC4, "color_flat")
13 .no_perspective(Type::VEC2, "texCoord_interp")
14 .flat(Type::INT, "glyph_offset")
15 .flat(Type::UINT, "glyph_flags")
16 .flat(Type::IVEC2, "glyph_dim");
17
18GPU_SHADER_CREATE_INFO(gpu_shader_text)
19 .vertex_in(0, Type::VEC4, "pos")
20 .vertex_in(1, Type::VEC4, "col")
21 .vertex_in(2, Type ::IVEC2, "glyph_size")
22 .vertex_in(3, Type ::INT, "offset")
23 .vertex_in(4, Type ::UINT, "flags")
24 .vertex_out(text_iface)
25 .fragment_out(0, Type::VEC4, "fragColor")
26 .push_constant(Type::MAT4, "ModelViewProjectionMatrix")
27 .push_constant(Type::INT, "glyph_tex_width_mask")
28 .push_constant(Type::INT, "glyph_tex_width_shift")
29 .sampler(0, ImageType::FLOAT_2D, "glyph", Frequency::PASS)
30 .vertex_source("gpu_shader_text_vert.glsl")
31 .fragment_source("gpu_shader_text_frag.glsl")
32 .additional_info("gpu_srgb_to_framebuffer_space")
33 .do_static_compilation(true);
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)