Blender V5.3
gpu_batch.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 by Mike Erwin. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12#include "BLI_math_base_c.hh"
13#include "BLI_utildefines.hh"
14
15#include "GPU_batch.hh"
16#include "GPU_batch_presets.hh"
17#include "GPU_shader.hh"
18
19#include "GPU_index_buffer.hh"
20#include "GPU_vertex_buffer.hh"
21#include "gpu_backend.hh"
23#include "gpu_debug_private.hh"
24#include "gpu_shader_private.hh"
25
26#include <cstring>
27
28namespace blender {
29
30using namespace blender::gpu;
31
32/* -------------------------------------------------------------------- */
35
36void GPU_batch_zero(Batch *batch)
37{
38 std::fill_n(batch->verts, ARRAY_SIZE(batch->verts), nullptr);
39 batch->elem = nullptr;
40 batch->flag = GPUBatchFlag(0);
41 batch->prim_type = GPUPrimType(0);
42 batch->shader = nullptr;
43 batch->procedural_vertices = -1;
44}
45
47{
48 Batch *batch = GPUBackend::get()->batch_alloc();
49 GPU_batch_zero(batch);
50 return batch;
51}
52
53Batch *GPU_batch_create_ex(GPUPrimType primitive_type,
54 VertBuf *vertex_buf,
55 IndexBuf *index_buf,
56 GPUBatchFlag owns_flag)
57{
58 Batch *batch = GPU_batch_calloc();
59 GPU_batch_init_ex(batch, primitive_type, vertex_buf, index_buf, owns_flag);
60 return batch;
61}
62
63void GPU_batch_init_ex(Batch *batch,
64 GPUPrimType primitive_type,
65 VertBuf *vertex_buf,
66 IndexBuf *index_buf,
67 GPUBatchFlag owns_flag)
68{
69 /* Do not pass any other flag */
70 BLI_assert((owns_flag & ~(GPU_BATCH_OWNS_VBO | GPU_BATCH_OWNS_INDEX)) == 0);
71 /* Batch needs to be in cleared state. */
72 BLI_assert((batch->flag & GPU_BATCH_INIT) == 0);
73
74 batch->verts[0] = vertex_buf;
75 for (int v = 1; v < GPU_BATCH_VBO_MAX_LEN; v++) {
76 batch->verts[v] = nullptr;
77 }
78 batch->elem = index_buf;
79 batch->prim_type = primitive_type;
80 batch->flag = owns_flag | GPU_BATCH_INIT | GPU_BATCH_DIRTY;
81 batch->shader = nullptr;
82 batch->procedural_vertices = -1;
83}
84
85Batch *GPU_batch_create_procedural(GPUPrimType primitive_type, int32_t vertex_count)
86{
87 BLI_assert(vertex_count >= 0);
88 Batch *batch = GPU_batch_calloc();
89 for (auto &v : batch->verts) {
90 v = nullptr;
91 }
92 batch->elem = nullptr;
93 batch->prim_type = primitive_type;
94 batch->flag = GPU_BATCH_INIT | GPU_BATCH_DIRTY;
95 batch->shader = nullptr;
96 batch->procedural_vertices = vertex_count;
97 return batch;
98}
99
100void GPU_batch_copy(Batch *batch_dst, Batch *batch_src)
101{
102 GPU_batch_clear(batch_dst);
104 batch_dst, GPU_PRIM_POINTS, batch_src->verts[0], batch_src->elem, GPU_BATCH_INVALID);
105
106 batch_dst->prim_type = batch_src->prim_type;
107 for (int v = 1; v < GPU_BATCH_VBO_MAX_LEN; v++) {
108 batch_dst->verts[v] = batch_src->verts[v];
109 }
110 batch_dst->procedural_vertices = batch_src->procedural_vertices;
111}
112
113void GPU_batch_clear(Batch *batch)
114{
115 if (batch->flag & GPU_BATCH_OWNS_INDEX) {
116 GPU_indexbuf_discard(batch->elem);
117 }
118 if (batch->flag & GPU_BATCH_OWNS_VBO_ANY) {
119 for (int v = 0; (v < GPU_BATCH_VBO_MAX_LEN) && batch->verts[v]; v++) {
120 if (batch->flag & (GPU_BATCH_OWNS_VBO << v)) {
121 GPU_VERTBUF_DISCARD_SAFE(batch->verts[v]);
122 }
123 }
124 }
125 batch->flag = GPU_BATCH_INVALID;
126 batch->procedural_vertices = -1;
127}
128
129void GPU_batch_discard(Batch *batch)
130{
131 GPU_batch_clear(batch);
132 delete batch;
133}
134
136
137/* -------------------------------------------------------------------- */
140
141void GPU_batch_elembuf_set(Batch *batch, gpu::IndexBuf *index_buf, bool own_ibo)
142{
143 BLI_assert(index_buf);
144 batch->flag |= GPU_BATCH_DIRTY;
145
146 if (batch->elem && (batch->flag & GPU_BATCH_OWNS_INDEX)) {
147 GPU_indexbuf_discard(batch->elem);
148 }
149 batch->elem = index_buf;
150
151 SET_FLAG_FROM_TEST(batch->flag, own_ibo, GPU_BATCH_OWNS_INDEX);
152}
153
154int GPU_batch_vertbuf_add(Batch *batch, VertBuf *vertex_buf, bool own_vbo)
155{
156 BLI_assert(vertex_buf);
157 batch->flag |= GPU_BATCH_DIRTY;
158
159 for (uint v = 0; v < GPU_BATCH_VBO_MAX_LEN; v++) {
160 if (batch->verts[v] == nullptr) {
161 /* for now all VertexBuffers must have same vertex_len */
162 if (batch->verts[0] != nullptr) {
163 /* This is an issue for the HACK inside DRW_vbo_request(). */
164 // BLI_assert(verts->vertex_len == batch->verts[0]->vertex_len);
165 }
166 batch->verts[v] = vertex_buf;
167 SET_FLAG_FROM_TEST(batch->flag, own_vbo, (GPUBatchFlag)(GPU_BATCH_OWNS_VBO << v));
168 return v;
169 }
170 }
171 /* we only make it this far if there is no room for another VertBuf */
172 BLI_assert_msg(0, "Not enough VBO slot in batch");
173 return -1;
174}
175
176bool GPU_batch_vertbuf_has(const Batch *batch, const VertBuf *vertex_buf)
177{
178 for (uint v = 0; v < GPU_BATCH_VBO_MAX_LEN; v++) {
179 if (batch->verts[v] == vertex_buf) {
180 return true;
181 }
182 }
183 return false;
184}
185
187
188/* -------------------------------------------------------------------- */
192
193void GPU_batch_set_shader(Batch *batch,
195 const shader::SpecializationConstants *constants_state)
196{
197 batch->shader = shader;
198 GPU_shader_bind(batch->shader, constants_state);
199}
200
203 VertBuf *vbo)
204{
205 const GPUVertFormat *format = &vbo->format;
206
207 /* We need to support GPU OpenSubdiv meshes. This assert can be enabled back after we refactor
208 * our OpenSubdiv implementation to output the same layout as the regular mesh extraction. */
209 // BLI_assert_msg(format->attr_len == 1, "Multi attribute buffers are not supported for now");
210
211 char uniform_name[] = "gpu_attr_0";
212 uint stride = format->stride;
213 uint offset = 0;
214 uint16_t bound_attr = 0u;
215 for (uint a_idx = 0; a_idx < format->attr_len; a_idx++) {
216 const GPUVertAttr *a = &format->attrs[a_idx];
217
218 if (format->deinterleaved) {
219 offset += ((a_idx == 0) ? 0 : format->attrs[a_idx - 1].type.size()) * vbo->vertex_len;
220 stride = a->type.size();
221 }
222 else {
223 offset = a->offset;
224 }
225
226 for (uint n_idx = 0; n_idx < a->name_len; n_idx++) {
227 const char *name = GPU_vertformat_attr_name_get(format, a, n_idx);
228 const ShaderInput *input = interface->ssbo_get(name);
229 if (input == nullptr || input->location == -1) {
230 continue;
231 }
233 bound_attr |= (1 << input->location);
234
235 /* WORKAROUND: This is to support complex format. But ideally this should not be supported.
236 */
237 uniform_name[9] = '0' + input->location;
238
239 /* Only support 4byte aligned attributes. */
240 BLI_assert((stride % 4) == 0);
241 BLI_assert((offset % 4) == 0);
242 int descriptor[2] = {int(stride) / 4, int(offset) / 4};
244 /* WORKAROUND: Fix for polyline workaround. Ideally should be fused with `gpu_attr_0`.
245 * But for now, changes are a bit too invasive. Will need to be revisited later on. */
246 char uniform_name_len[] = "gpu_attr_0_len";
247 uniform_name_len[9] = '0' + input->location;
248 const int loc = GPU_shader_get_uniform(shader, uniform_name_len);
249 if (loc != -1) {
250 int data = a->type.comp_len();
252 }
253 }
254 }
255 return bound_attr;
256}
257
260 const shader::SpecializationConstants *constants)
261{
262 const ShaderInterface *interface = shader->interface;
263 if (interface->ssbo_attr_mask_ == 0) {
264 return;
265 }
266
267 uint16_t ssbo_attributes = interface->ssbo_attr_mask_;
268
269 if (ssbo_attributes & (1 << GPU_SSBO_INDEX_BUF_SLOT)) {
270 /* Ensure binding for setting uniforms. This is required by the OpenGL backend. */
271 GPU_shader_bind(shader, constants);
272 if (batch->elem) {
274 GPU_shader_uniform_1b(shader, "gpu_index_no_buffer", false);
275 GPU_shader_uniform_1b(shader, "gpu_index_16bit", !batch->elem->is_32bit());
276 GPU_shader_uniform_1i(shader, "gpu_index_base_index", batch->elem->index_base_get());
277 }
278 else {
279 /* Still fulfill the binding requirements even if the buffer will not be read. */
281 GPU_shader_uniform_1b(shader, "gpu_index_no_buffer", true);
282 }
283 ssbo_attributes &= ~(1 << GPU_SSBO_INDEX_BUF_SLOT);
284 }
285
286 /* Reverse order so first VBO'S have more prevalence (in term of attribute override). */
287 for (int v = GPU_BATCH_VBO_MAX_LEN - 1; v > -1; v--) {
288 VertBuf *vbo = batch->verts_(v);
289 if (vbo) {
290 ssbo_attributes &= ~bind_attribute_as_ssbo(interface, shader, vbo);
291 }
292 }
293
294 BLI_assert_msg(ssbo_attributes == 0, "Not all attribute storage buffer fulfilled");
295 UNUSED_VARS_NDEBUG(ssbo_attributes);
296}
297
299
300/* -------------------------------------------------------------------- */
303
305 int *r_vertex_count,
306 int *r_vertex_first,
307 int *r_base_index,
308 int *r_instance_count)
309{
310 if (batch->procedural_vertices >= 0) {
311 *r_vertex_count = batch->procedural_vertices;
312 *r_vertex_first = 0;
313 *r_base_index = -1;
314 }
315 else if (batch->elem) {
316 *r_vertex_count = batch->elem_()->index_len_get();
317 *r_vertex_first = batch->elem_()->index_start_get();
318 *r_base_index = batch->elem_()->index_base_get();
319 }
320 else {
321 *r_vertex_count = batch->verts_(0)->vertex_len;
322 *r_vertex_first = 0;
323 *r_base_index = -1;
324 }
325
326 *r_instance_count = 1;
327}
328
330 GPUPrimType output_prim_type,
331 int vertex_count,
332 int vertex_first,
333 int output_primitive_cout)
334{
335 int vert_per_original_primitive = indices_per_primitive(input_prim_type);
336 int vert_per_expanded_primitive = indices_per_primitive(output_prim_type);
337
338 int prim_first = vertex_first / vert_per_original_primitive;
339 int prim_len = vertex_count / vert_per_original_primitive;
340
341 BLI_assert_msg(vert_per_original_primitive != -1,
342 "Primitive expansion only works for primitives with known amount of vertices");
343
344 /* WORKAROUND: Needed for polyline_draw_workaround. */
345 if (input_prim_type == GPU_PRIM_LINE_STRIP) {
346 prim_len = vertex_count - 1;
347 }
348
349 int out_vertex_first = prim_first * vert_per_expanded_primitive * output_primitive_cout;
350 int out_vertex_count = prim_len * vert_per_expanded_primitive * output_primitive_cout;
351
352 return IndexRange(out_vertex_first, out_vertex_count);
353}
354
356 Batch *batch, int vertex_first, int vertex_count, int instance_first, int instance_count)
357{
358 /* Early out as this can cause crashes on some backend (see #136831). */
359 if (vertex_count == 0) {
360 return;
361 }
362 /* Check compatible input primitive. */
364
365 GPU_batch_bind_as_resources(batch, batch->shader);
367 batch->prim_type, GPU_PRIM_TRIS, vertex_count, vertex_first, 2);
368 Batch *tri_batch = Context::get()->procedural_triangles_batch_get();
369 GPU_batch_set_shader(tri_batch, batch->shader);
370
371 int vert_stride_count[3] = {(batch->prim_type == GPU_PRIM_LINES) ? 2 : 1, vertex_count, 0};
372 GPU_shader_uniform_3iv(batch->shader, "gpu_vert_stride_count_offset", vert_stride_count);
373 /* Assume GPU_FETCH_FLOAT for now. A bit cumbersome to assert for this or to find the correct
374 * attribute. */
375 GPU_shader_uniform_1b(batch->shader, "gpu_attr_0_fetch_int", false);
376
377 /* Allow byte color fetch. */
378 const GPUVertFormat *format = GPU_vertbuf_get_format(batch->verts[0]);
379 int id = GPU_vertformat_attr_id_get(format, "color");
380 if (id != -1) {
381 const GPUVertAttr &attr = format->attrs[id];
382 const bool is_unorm8 = attr.type.format == gpu::VertAttrType::UNORM_8_8_8_8;
383 BLI_assert_msg(is_unorm8 || attr.type.fetch_mode() == GPU_FETCH_FLOAT,
384 "color attribute for polylines can only use GPU_FETCH_INT_TO_FLOAT_UNIT or "
385 "GPU_FETCH_FLOAT");
386 GPU_shader_uniform_1b(batch->shader, "gpu_attr_1_fetch_unorm8", is_unorm8);
387 }
388
389 GPU_batch_draw_advanced(tri_batch, range.start(), range.size(), instance_first, instance_count);
390}
391
392void GPU_batch_draw(Batch *batch)
393{
394 BLI_assert(batch != nullptr);
395 GPU_shader_bind(batch->shader);
396 if (batch->shader->is_polyline) {
397 polyline_draw_workaround(batch, 0, batch->vertex_count_get(), 0, 0);
398 }
399 else {
400 GPU_batch_draw_advanced(batch, 0, 0, 0, 0);
401 }
402}
403
404void GPU_batch_draw_range(Batch *batch, int vertex_first, int vertex_count)
405{
406 BLI_assert(batch != nullptr);
407 GPU_shader_bind(batch->shader);
408 if (batch->shader->is_polyline) {
409 polyline_draw_workaround(batch, vertex_first, vertex_count, 0, 0);
410 }
411 else {
412 GPU_batch_draw_advanced(batch, vertex_first, vertex_count, 0, 0);
413 }
414}
415
416void GPU_batch_draw_instance_range(Batch *batch, int instance_first, int instance_count)
417{
418 BLI_assert(batch != nullptr);
419 /* Not polyline shaders support instancing. */
420 BLI_assert(batch->shader->is_polyline == false);
421
422 GPU_shader_bind(batch->shader);
423 GPU_batch_draw_advanced(batch, 0, 0, instance_first, instance_count);
424}
425
427 Batch *batch, int vertex_first, int vertex_count, int instance_first, int instance_count)
428{
429 BLI_assert(batch != nullptr);
430 BLI_assert(Context::get()->shader != nullptr);
432
433 if (vertex_count == 0) {
434 if (batch->procedural_vertices > 0) {
435 vertex_count = batch->procedural_vertices;
436 }
437 else if (batch->elem) {
438 vertex_count = batch->elem_()->index_len_get();
439 }
440 else {
441 vertex_count = batch->verts_(0)->vertex_len;
442 }
443 }
444 if (instance_count == 0) {
445 instance_count = 1;
446 }
447
448 if (vertex_count == 0 || instance_count == 0) {
449 /* Nothing to draw. */
450 return;
451 }
452
453#ifndef NDEBUG
455#endif
456
457 batch->draw(vertex_first, vertex_count, instance_first, instance_count);
458}
459
460void GPU_batch_draw_indirect(Batch *batch, gpu::StorageBuf *indirect_buf, intptr_t offset)
461{
462 BLI_assert(batch != nullptr);
463 BLI_assert(indirect_buf != nullptr);
464 BLI_assert(Context::get()->shader != nullptr);
466
467#ifndef NDEBUG
469#endif
470
471 batch->draw_indirect(indirect_buf, offset);
472}
473
475 Batch *batch, gpu::StorageBuf *indirect_buf, int count, intptr_t offset, intptr_t stride)
476{
477 BLI_assert(batch != nullptr);
478 BLI_assert(indirect_buf != nullptr);
479 BLI_assert(Context::get()->shader != nullptr);
481
482#ifndef NDEBUG
484#endif
485
486 batch->multi_draw_indirect(indirect_buf, count, offset, stride);
487}
488
490
491/* -------------------------------------------------------------------- */
494
502
507
509{
511}
512
517
522
527
532
534
535/* -------------------------------------------------------------------- */
538
543
548
550
551} // namespace blender
#define GPU_VERTBUF_DISCARD_SAFE(verts)
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define ELEM(...)
#define BLI_assert_msg(a, msg)
constexpr int64_t size() const
constexpr IndexRange()=default
constexpr int64_t start() const
static Context * get()
Batch * procedural_triangles_batch_get()
void assert_framebuffer_shader_compatibility(Shader *sh)
Batch * procedural_triangle_strips_batch_get()
Batch * procedural_lines_batch_get()
Batch * procedural_points_batch_get()
virtual Batch * batch_alloc()=0
static GPUBackend * get()
const ShaderInput * ssbo_get(const StringRefNull name) const
#define GPU_SSBO_INDEX_BUF_SLOT
int indices_per_primitive(GPUPrimType prim_type)
void debug_validate_binding_image_format()
Definition gpu_debug.cc:193
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void GPU_batch_draw_indirect(gpu::Batch *batch, gpu::StorageBuf *indirect_buf, intptr_t offset)
void GPU_shader_uniform_2iv(gpu::Shader *sh, const char *name, const int data[2])
gpu::Batch * GPU_batch_create_procedural(GPUPrimType primitive_type, int32_t vertex_count)
Definition gpu_batch.cc:85
gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, gpu::VertBuf *vertex_buf, gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
Definition gpu_batch.cc:53
gpu::Batch * GPU_batch_calloc()
Definition gpu_batch.cc:46
void GPU_batch_bind_as_resources(gpu::Batch *batch, gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants=nullptr)
unsigned int uint
Definition BKE_text.h:55
void GPU_batch_program_set_builtin_with_config(gpu::Batch *batch, GPUBuiltinShader shader_id, GPUShaderConfig sh_cfg)
int GPU_vertformat_attr_id_get(const GPUVertFormat *, StringRef name)
gpu::Batch * GPU_batch_procedural_points_get()
Definition gpu_batch.cc:513
BLI_INLINE const char * GPU_vertformat_attr_name_get(const GPUVertFormat *format, const GPUVertAttr *attr, uint n_idx)
static constexpr int GPU_BATCH_VBO_MAX_LEN
Definition GPU_batch.hh:35
@ GPU_PRIM_LINE_STRIP
@ GPU_PRIM_LINE_LOOP
void GPU_batch_discard(gpu::Batch *batch)
void GPU_shader_uniform_3iv(gpu::Shader *sh, const char *name, const int data[3])
ATTR_WARN_UNUSED_RESULT const BMVert * v
void GPU_batch_set_shader(gpu::Batch *batch, gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
const GPUVertFormat * GPU_vertbuf_get_format(const gpu::VertBuf *verts)
void GPU_shader_uniform_int_ex(gpu::Shader *shader, int location, int length, int array_size, const int *value)
void GPU_shader_uniform_1b(gpu::Shader *sh, const char *name, bool value)
void GPU_vertbuf_bind_as_ssbo(gpu::VertBuf *verts, int binding)
void GPU_batch_draw_range(gpu::Batch *batch, int vertex_first, int vertex_count)
void GPU_indexbuf_bind_as_ssbo(gpu::IndexBuf *elem, int binding)
IndexRange GPU_batch_draw_expanded_parameter_get(GPUPrimType input_prim_type, GPUPrimType output_prim_type, int vertex_count, int vertex_first, int output_primitive_cout)
Definition gpu_batch.cc:329
unsigned short uint16_t
Definition BKE_text.h:80
void GPU_batch_copy(gpu::Batch *batch_dst, gpu::Batch *batch_src)
BMesh const char void * data
void GPU_batch_init_ex(gpu::Batch *batch, GPUPrimType primitive_type, gpu::VertBuf *vertex_buf, gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
gpu::Batch * GPU_batch_procedural_triangle_strips_get()
Definition gpu_batch.cc:528
void GPU_batch_draw_instance_range(gpu::Batch *batch, int instance_first, int instance_count)
void GPU_batch_zero(gpu::Batch *batch)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void gpu_batch_presets_init()
void GPU_batch_program_set_imm_shader(gpu::Batch *batch)
void GPU_batch_draw(gpu::Batch *batch)
void GPU_batch_multi_draw_indirect(gpu::Batch *batch, gpu::StorageBuf *indirect_buf, int count, intptr_t offset, intptr_t stride)
static void polyline_draw_workaround(Batch *batch, int vertex_first, int vertex_count, int instance_first, int instance_count)
Definition gpu_batch.cc:355
@ GPU_BATCH_INVALID
Definition GPU_batch.hh:41
@ GPU_BATCH_DIRTY
Definition GPU_batch.hh:55
@ GPU_BATCH_OWNS_VBO
Definition GPU_batch.hh:44
@ GPU_BATCH_OWNS_INDEX
Definition GPU_batch.hh:48
@ GPU_BATCH_INIT
Definition GPU_batch.hh:51
@ GPU_BATCH_OWNS_VBO_ANY
Definition GPU_batch.hh:46
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_1i(gpu::Shader *sh, const char *name, int value)
void GPU_batch_clear(gpu::Batch *batch)
void GPU_batch_program_set_builtin(gpu::Batch *batch, GPUBuiltinShader shader_id)
int GPU_shader_get_uniform(gpu::Shader *shader, const char *name)
gpu::Batch * GPU_batch_procedural_triangles_get()
Definition gpu_batch.cc:523
gpu::Shader * immGetShader()
bool GPU_batch_vertbuf_has(const gpu::Batch *batch, const gpu::VertBuf *vertex_buf)
void GPU_indexbuf_discard(gpu::IndexBuf *elem)
void gpu_batch_presets_exit()
signed int int32_t
Definition BKE_text.h:78
void GPU_batch_draw_advanced(gpu::Batch *batch, int vertex_first, int vertex_count, int instance_first, int instance_count)
gpu::Shader * GPU_shader_get_builtin_shader_with_config(GPUBuiltinShader shader, GPUShaderConfig sh_cfg)
void gpu_batch_exit()
Definition gpu_batch.cc:544
void GPU_batch_elembuf_set(gpu::Batch *batch, gpu::IndexBuf *index_buf, bool own_ibo)
void gpu_batch_init()
Definition gpu_batch.cc:539
void GPU_batch_draw_parameter_get(gpu::Batch *batch, int *r_vertex_count, int *r_vertex_first, int *r_base_index, int *r_instance_count)
int GPU_batch_vertbuf_add(gpu::Batch *batch, gpu::VertBuf *vertex_buf, bool own_vbo)
gpu::Batch * GPU_batch_procedural_lines_get()
Definition gpu_batch.cc:518
static uint16_t bind_attribute_as_ssbo(const ShaderInterface *interface, gpu::Shader *shader, VertBuf *vbo)
Definition gpu_batch.cc:201
_W64 int intptr_t
Definition BKE_text.h:119
GPUVertFetchMode fetch_mode() const
struct blender::GPUVertAttr::Type type