Blender V5.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
8
9#pragma once
10
12
13#ifndef GPU_SHADER
14namespace blender::gpu {
15class Batch;
16}
17namespace blender::draw::command {
18#endif
19
20/* -------------------------------------------------------------------- */
23
31
37
44
48 /* Set to -1 if not an indexed draw. */
50
52
53 /* Counts visible and invisible instances. Create draw-calls when it reaches `DrawGroup::len`. */
55 /* Counts only visible instance (counting multi-view). Used to issue the draw-calls. */
58
59 /* CPU specific region of the struct. Should be kept constant after recording.
60 * Can be used by GPU but needs to be initialized by GPU before usage. */
61#ifndef GPU_SHADER
62 struct {
63 /* Specific range of vertex to draw from the #gpu::Batch. */
65 /* Ugly packing to support expanded draws without inflating the struct.
66 * Makes vertex range restricted to smaller range for expanded draw. */
70
72 gpu::Batch *gpu_batch;
74 } desc;
75#else
76 uint _cpu_reserved_1;
77 uint _cpu_reserved_2;
78
79 uint _cpu_reserved_3;
80 uint _cpu_reserved_4;
81 uint _cpu_reserved_5;
82 uint _cpu_reserved_6;
83#endif
84};
85#ifndef GPU_SHADER
87#endif
88
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};
104
106
107#ifndef GPU_SHADER
108}; // namespace blender::draw::command
109
110namespace blender {
111#endif
112
113/* -------------------------------------------------------------------- */
116
117/* Regular draw commands (no index buffer). */
129
130/* Indexed draw commands (with index buffer). */
142
149
156
158
159#if !defined(GPU_SHADER)
160} // namespace blender
161#endif
#define host_shared
#define BLI_STATIC_ASSERT_ALIGN(st, align)
BMesh Iterators.
unsigned __int64 uint64_t
Definition BKE_text.h:91
unsigned int uint
Definition BKE_text.h:55
unsigned int uint32_t
Definition BKE_text.h:81