Blender V4.5
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
9#ifndef GPU_SHADER
10# include "BLI_span.hh"
12
13namespace blender::draw::command {
14
15#endif
16
17/* -------------------------------------------------------------------- */
25struct DrawGroup {
28
41
45 /* Set to -1 if not an indexed draw. */
47
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. */
71 /* Ugly packing to support expanded draws without inflating the struct.
72 * Makes vertex range restricted to smaller range for expanded draw. */
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
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 int uint32_t
unsigned __int64 uint64_t
Definition stdint.h:90
struct blender::draw::command::DrawGroup::@220 desc