Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenfont/intern/blf_font.c
| Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Glyph Batching | /** \name Glyph Batching | ||||
| * \{ */ | * \{ */ | ||||
| /** | /** | ||||
| * Drawcalls are precious! make them count! | * Drawcalls are precious! make them count! | ||||
| * Since most of the Text elems are not covered by other UI elements, we can | * Since most of the Text elems are not covered by other UI elements, we can | ||||
| * group some strings together and render them in one drawcall. This behavior | * group some strings together and render them in one drawcall. This behavior | ||||
| * is on demand only, between BLF_batch_start() and BLF_batch_end(). | * is on demand only, between BLF_batch_start() and BLF_batch_end(). | ||||
| **/ | */ | ||||
| static void blf_batch_draw_init(void) | static void blf_batch_draw_init(void) | ||||
| { | { | ||||
| GPUVertFormat format = {0}; | GPUVertFormat format = {0}; | ||||
| g_batch.pos_loc = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); | g_batch.pos_loc = GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); | ||||
| g_batch.tex_loc = GPU_vertformat_attr_add(&format, "tex", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); | g_batch.tex_loc = GPU_vertformat_attr_add(&format, "tex", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); | ||||
| g_batch.col_loc = GPU_vertformat_attr_add(&format, "col", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT); | g_batch.col_loc = GPU_vertformat_attr_add(&format, "col", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT); | ||||
| g_batch.verts = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_STREAM); | g_batch.verts = GPU_vertbuf_create_with_format_ex(&format, GPU_USAGE_STREAM); | ||||
| ▲ Show 20 Lines • Show All 1,115 Lines • Show Last 20 Lines | |||||