Blender
V5.3
source
blender
draw
intern
draw_subdiv_shader_shared.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2025 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#pragma once
10
11
#include "
draw_subdiv_defines.hh
"
12
13
#include "
GPU_shader_shared_utils.hh
"
14
15
struct
[[
host_shared
]]
DRWSubdivUboStorage
{
16
/* Offsets in the buffers data where the source and destination data start. */
17
int
src_offset
;
18
int
dst_offset
;
19
20
/* Parameters for the DRWPatchMap. */
21
int
min_patch_face
;
22
int
max_patch_face
;
23
int
max_depth
;
24
bool32_t
patches_are_triangular
;
25
26
/* Coarse topology information. */
27
int
coarse_face_count
;
28
uint
edge_loose_offset
;
29
30
/* Refined topology information. */
31
uint
num_subdiv_loops
;
32
33
/* The sculpt mask data layer may be null. */
34
bool32_t
has_sculpt_mask
;
35
36
/* Masks for the extra coarse face data. */
37
uint
coarse_face_select_mask
;
38
uint
coarse_face_smooth_mask
;
39
uint
coarse_face_active_mask
;
40
uint
coarse_face_hidden_mask
;
41
uint
coarse_face_loopstart_mask
;
42
43
/* Number of elements to process in the compute shader (can be the coarse quad count, or the
44
* final vertex count, depending on which compute pass we do). This is used to early out in case
45
* of out of bond accesses as compute dispatch are of fixed size. */
46
uint
total_dispatch_size
;
47
48
bool32_t
is_edit_mode
;
49
bool32_t
use_hide
;
50
int
_pad3
;
51
int
_pad4
;
52
};
53
54
struct
[[
host_shared
]]
SculptData
{
55
uint
face_set_color
;
56
float
mask
;
57
};
58
59
/* Mirror of #UVStretchAngle in the C++ code, but using floats until proper data compression
60
* is implemented for all subdivision data. */
61
struct
[[
host_shared
]]
UVStretchAngle
{
62
float
angle
;
63
float
uv_angle0
;
64
float
uv_angle1
;
65
};
66
67
struct
[[
host_shared
]]
Position
{
68
float
x
;
69
float
y
;
70
float
z
;
71
};
72
73
struct
[[
host_shared
]]
Normal
{
74
float
x
;
75
float
y
;
76
float
z
;
77
};
78
79
/* Structure for #CompressedPatchCoord. */
80
struct
[[
host_shared
]]
BlenderPatchCoord
{
81
int
patch_index
;
82
uint
encoded_uv
;
83
};
84
85
/* Patch evaluation - F-dots. */
86
/* float3 is padded to float4, but the format used for face-dots does not have any padding. */
87
struct
[[
host_shared
]]
FDotVert
{
88
float
x
;
89
float
y
;
90
float
z
;
91
};
92
93
/* Same here, do not use float3. */
94
struct
[[
host_shared
]]
FDotNor
{
95
float
x
;
96
float
y
;
97
float
z
;
98
float
flag
;
99
};
100
101
/* This structure is a carbon copy of OpenSubDiv's #PatchTable::PatchHandle. */
102
struct
[[
host_shared
]]
PatchHandle
{
103
int
array_index
;
104
int
patch_index
;
105
int
vertex_index
;
106
};
107
108
/* This structure is a carbon copy of OpenSubDiv's #PatchCoord. */
109
struct
[[
host_shared
]]
PatchCoord
{
110
int
array_index
;
111
int
patch_index
;
112
int
vertex_index
;
113
float
u
;
114
float
v
;
115
};
116
117
/* This structure is a carbon copy of OpenSubDiv's #PatchCoord.QuadNode.
118
* Each child is a bit-field. */
119
struct
[[
host_shared
]]
QuadNode
{
120
uint4
child
;
121
};
GPU_shader_shared_utils.hh
host_shared
#define host_shared
Definition
GPU_shader_shared_utils.hh:144
bool32_t
int32_t bool32_t
Definition
GPU_shader_shared_utils.hh:87
draw_subdiv_defines.hh
blender::uint4
VecBase< uint32_t, 4 > uint4
Definition
BLI_math_vector_types.hh:787
BlenderPatchCoord
Definition
draw_subdiv_shader_shared.hh:80
BlenderPatchCoord::patch_index
int patch_index
Definition
draw_subdiv_shader_shared.hh:81
BlenderPatchCoord::encoded_uv
uint encoded_uv
Definition
draw_subdiv_shader_shared.hh:82
DRWSubdivUboStorage
Definition
draw_subdiv_shader_shared.hh:15
DRWSubdivUboStorage::has_sculpt_mask
bool32_t has_sculpt_mask
Definition
draw_subdiv_shader_shared.hh:34
DRWSubdivUboStorage::coarse_face_active_mask
uint coarse_face_active_mask
Definition
draw_subdiv_shader_shared.hh:39
DRWSubdivUboStorage::src_offset
int src_offset
Definition
draw_subdiv_shader_shared.hh:17
DRWSubdivUboStorage::is_edit_mode
bool32_t is_edit_mode
Definition
draw_subdiv_shader_shared.hh:48
DRWSubdivUboStorage::coarse_face_loopstart_mask
uint coarse_face_loopstart_mask
Definition
draw_subdiv_shader_shared.hh:41
DRWSubdivUboStorage::patches_are_triangular
bool32_t patches_are_triangular
Definition
draw_subdiv_shader_shared.hh:24
DRWSubdivUboStorage::num_subdiv_loops
uint num_subdiv_loops
Definition
draw_subdiv_shader_shared.hh:31
DRWSubdivUboStorage::edge_loose_offset
uint edge_loose_offset
Definition
draw_subdiv_shader_shared.hh:28
DRWSubdivUboStorage::coarse_face_select_mask
uint coarse_face_select_mask
Definition
draw_subdiv_shader_shared.hh:37
DRWSubdivUboStorage::coarse_face_smooth_mask
uint coarse_face_smooth_mask
Definition
draw_subdiv_shader_shared.hh:38
DRWSubdivUboStorage::max_depth
int max_depth
Definition
draw_subdiv_shader_shared.hh:23
DRWSubdivUboStorage::coarse_face_hidden_mask
uint coarse_face_hidden_mask
Definition
draw_subdiv_shader_shared.hh:40
DRWSubdivUboStorage::min_patch_face
int min_patch_face
Definition
draw_subdiv_shader_shared.hh:21
DRWSubdivUboStorage::_pad4
int _pad4
Definition
draw_subdiv_shader_shared.hh:51
DRWSubdivUboStorage::_pad3
int _pad3
Definition
draw_subdiv_shader_shared.hh:50
DRWSubdivUboStorage::max_patch_face
int max_patch_face
Definition
draw_subdiv_shader_shared.hh:22
DRWSubdivUboStorage::use_hide
bool32_t use_hide
Definition
draw_subdiv_shader_shared.hh:49
DRWSubdivUboStorage::dst_offset
int dst_offset
Definition
draw_subdiv_shader_shared.hh:18
DRWSubdivUboStorage::total_dispatch_size
uint total_dispatch_size
Definition
draw_subdiv_shader_shared.hh:46
DRWSubdivUboStorage::coarse_face_count
int coarse_face_count
Definition
draw_subdiv_shader_shared.hh:27
FDotNor
Definition
draw_subdiv_shader_shared.hh:94
FDotNor::x
float x
Definition
draw_subdiv_shader_shared.hh:95
FDotNor::z
float z
Definition
draw_subdiv_shader_shared.hh:97
FDotNor::y
float y
Definition
draw_subdiv_shader_shared.hh:96
FDotNor::flag
float flag
Definition
draw_subdiv_shader_shared.hh:98
FDotVert
Definition
draw_subdiv_shader_shared.hh:87
FDotVert::y
float y
Definition
draw_subdiv_shader_shared.hh:89
FDotVert::x
float x
Definition
draw_subdiv_shader_shared.hh:88
FDotVert::z
float z
Definition
draw_subdiv_shader_shared.hh:90
Normal
Definition
draw_subdiv_shader_shared.hh:73
Normal::x
float x
Definition
draw_subdiv_shader_shared.hh:74
Normal::y
float y
Definition
draw_subdiv_shader_shared.hh:75
Normal::z
float z
Definition
draw_subdiv_shader_shared.hh:76
PatchCoord
Definition
draw_subdiv_shader_shared.hh:109
PatchCoord::vertex_index
int vertex_index
Definition
draw_subdiv_shader_shared.hh:112
PatchCoord::patch_index
int patch_index
Definition
draw_subdiv_shader_shared.hh:111
PatchCoord::u
float u
Definition
draw_subdiv_shader_shared.hh:113
PatchCoord::v
float v
Definition
draw_subdiv_shader_shared.hh:114
PatchCoord::array_index
int array_index
Definition
draw_subdiv_shader_shared.hh:110
PatchHandle
Definition
draw_subdiv_shader_shared.hh:102
PatchHandle::patch_index
int patch_index
Definition
draw_subdiv_shader_shared.hh:104
PatchHandle::vertex_index
int vertex_index
Definition
draw_subdiv_shader_shared.hh:105
PatchHandle::array_index
int array_index
Definition
draw_subdiv_shader_shared.hh:103
Position
Definition
draw_subdiv_shader_shared.hh:67
Position::y
float y
Definition
draw_subdiv_shader_shared.hh:69
Position::z
float z
Definition
draw_subdiv_shader_shared.hh:70
Position::x
float x
Definition
draw_subdiv_shader_shared.hh:68
QuadNode
Definition
draw_subdiv_shader_shared.hh:119
QuadNode::child
uint4 child
Definition
draw_subdiv_shader_shared.hh:120
SculptData
Definition
draw_subdiv_shader_shared.hh:54
SculptData::mask
float mask
Definition
draw_subdiv_shader_shared.hh:56
SculptData::face_set_color
uint face_set_color
Definition
draw_subdiv_shader_shared.hh:55
UVStretchAngle
Definition
draw_subdiv_shader_shared.hh:61
UVStretchAngle::uv_angle1
float uv_angle1
Definition
draw_subdiv_shader_shared.hh:64
UVStretchAngle::angle
float angle
Definition
draw_subdiv_shader_shared.hh:62
UVStretchAngle::uv_angle0
float uv_angle0
Definition
draw_subdiv_shader_shared.hh:63
Generated on
for Blender by
doxygen
1.18.0