Blender V4.3
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 drawcalls when it reaches `DrawGroup::len`. */
52 /* Counts only visible instance (counting multi-view). Used to issue the drawcalls. */
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;
79# ifdef WITH_METAL_BACKEND
80 GPUShader *gpu_shader;
81# else
83# endif
85#endif
86};
88
89
95 /* Reference to parent DrawGroup to get the gpu::Batch vertex / instance count. */
97 /* Resource handle associated with this call. Also reference visibility. */
99 /* Custom extra value to be used by the engines. */
101 /* Number of instances. */
103};
105
106
108#ifndef GPU_SHADER
109}; // namespace blender::draw::command
110#endif
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition BLI_assert.h:90
unsigned int uint
struct GPUShader GPUShader
unsigned int uint32_t
Definition stdint.h:80
unsigned __int64 uint64_t
Definition stdint.h:90
struct blender::draw::command::DrawGroup::@274 desc