Blender
V5.0
source
blender
draw
intern
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
"
11
# include "
GPU_shader_shared_utils.hh
"
12
13
namespace
blender::draw::command
{
14
15
#endif
16
17
/* -------------------------------------------------------------------- */
20
25
struct
DrawGroup
{
27
uint
next
;
28
34
36
uint
start
;
38
uint
len
;
40
uint
front_facing_len
;
41
43
int
vertex_len
;
44
int
vertex_first
;
45
/* Set to -1 if not an indexed draw. */
46
int
base_index
;
47
49
50
/* Counts visible and invisible instances. Create draw-calls when it reaches `DrawGroup::len`. */
51
uint
total_counter
;
52
/* Counts only visible instance (counting multi-view). Used to issue the draw-calls. */
53
uint
front_facing_counter
;
54
uint
back_facing_counter
;
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
;
79
uint64_t
_cpu_pad0
;
80
}
desc
;
81
#endif
82
};
83
BLI_STATIC_ASSERT_ALIGN
(
DrawGroup
, 16)
84
85
90
struct
DrawPrototype
{
91
/* Reference to parent DrawGroup to get the gpu::Batch vertex / instance count. */
92
uint
group_id
;
93
/* Resource handle associated with this call. Also reference visibility. */
94
uint
res_index
;
95
/* Custom extra value to be used by the engines. */
96
uint
custom_id
;
97
/* Number of instances. */
98
uint
instance_len
;
99
};
100
BLI_STATIC_ASSERT_ALIGN
(
DrawPrototype
, 16)
101
102
103
104
#ifndef GPU_SHADER
105
};
// namespace blender::draw::command
106
#endif
BLI_STATIC_ASSERT_ALIGN
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition
BLI_assert.h:86
BLI_span.hh
uint
unsigned int uint
Definition
BLI_sys_types.h:64
GPU_shader_shared_utils.hh
uint64_t
unsigned long long int uint64_t
Definition
btConvexHullComputer.cpp:33
blender::draw::command
Definition
draw_command.cc:22
blender::draw::command::DrawGroup
Definition
draw_command_shared.hh:25
blender::draw::command::DrawGroup::vertex_first
int vertex_first
Definition
draw_command_shared.hh:44
blender::draw::command::DrawGroup::expand_prim_type
uint32_t expand_prim_type
Definition
draw_command_shared.hh:73
blender::draw::command::DrawGroup::back_facing_counter
uint back_facing_counter
Definition
draw_command_shared.hh:54
blender::draw::command::DrawGroup::gpu_batch
gpu::Batch * gpu_batch
Definition
draw_command_shared.hh:78
blender::draw::command::DrawGroup::desc
struct blender::draw::command::DrawGroup::@065172161005140006364026044166345126204356255202 desc
blender::draw::command::DrawGroup::start
uint start
Definition
draw_command_shared.hh:36
blender::draw::command::DrawGroup::total_counter
uint total_counter
Definition
draw_command_shared.hh:51
blender::draw::command::DrawGroup::vertex_len
int vertex_len
Definition
draw_command_shared.hh:43
blender::draw::command::DrawGroup::front_facing_len
uint front_facing_len
Definition
draw_command_shared.hh:40
blender::draw::command::DrawGroup::base_index
int base_index
Definition
draw_command_shared.hh:46
blender::draw::command::DrawGroup::expand_prim_len
uint32_t expand_prim_len
Definition
draw_command_shared.hh:74
blender::draw::command::DrawGroup::len
uint len
Definition
draw_command_shared.hh:38
blender::draw::command::DrawGroup::front_facing_counter
uint front_facing_counter
Definition
draw_command_shared.hh:53
blender::draw::command::DrawGroup::next
uint next
Definition
draw_command_shared.hh:27
blender::draw::command::DrawGroup::_cpu_pad0
uint64_t _cpu_pad0
Definition
draw_command_shared.hh:79
blender::draw::command::DrawPrototype
Definition
draw_command_shared.hh:90
blender::draw::command::DrawPrototype::custom_id
uint custom_id
Definition
draw_command_shared.hh:96
blender::draw::command::DrawPrototype::instance_len
uint instance_len
Definition
draw_command_shared.hh:98
blender::draw::command::DrawPrototype::group_id
uint group_id
Definition
draw_command_shared.hh:92
blender::draw::command::DrawPrototype::res_index
uint res_index
Definition
draw_command_shared.hh:94
Generated on
for Blender by
doxygen
1.16.1