Blender V5.0
draw_command_shared.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#ifndef GPU_SHADER
10# include "BLI_span.hh"
12
13namespace blender::draw::command {
14
15#endif
16
17/* -------------------------------------------------------------------- */
20
25struct DrawGroup {
28
34
41
45 /* Set to -1 if not an indexed draw. */
47
49
50 /* Counts visible and invisible instances. Create draw-calls when it reaches `DrawGroup::len`. */
52 /* Counts only visible instance (counting multi-view). Used to issue the draw-calls. */
55
56 /* CPU specific region of the struct. Should be kept constant after recording.
57 * Can be used by GPU but needs to be initialized by GPU before usage. */
58#ifdef GPU_SHADER
59 uint _cpu_reserved_1;
60 uint _cpu_reserved_2;
61
62 uint _cpu_reserved_3;
63 uint _cpu_reserved_4;
64 uint _cpu_reserved_5;
65 uint _cpu_reserved_6;
66
67#else
68 struct {
69 /* Specific range of vertex to draw from the #gpu::Batch. */
70 uint32_t vertex_first;
71 /* Ugly packing to support expanded draws without inflating the struct.
72 * Makes vertex range restricted to smaller range for expanded draw. */
73 uint32_t expand_prim_type : 4;
74 uint32_t expand_prim_len : 3;
75 uint32_t vertex_len : 25;
76
78 gpu::Batch *gpu_batch;
81#endif
82};
84
85
91 /* Reference to parent DrawGroup to get the gpu::Batch vertex / instance count. */
93 /* Resource handle associated with this call. Also reference visibility. */
95 /* Custom extra value to be used by the engines. */
97 /* Number of instances. */
99};
101
102
103
104#ifndef GPU_SHADER
105}; // namespace blender::draw::command
106#endif
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition BLI_assert.h:86
unsigned int uint
unsigned long long int uint64_t
struct blender::draw::command::DrawGroup::@065172161005140006364026044166345126204356255202 desc