Blender V5.3
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
12
14
16 /* Offsets in the buffers data where the source and destination data start. */
19
20 /* Parameters for the DRWPatchMap. */
25
26 /* Coarse topology information. */
29
30 /* Refined topology information. */
32
33 /* The sculpt mask data layer may be null. */
35
36 /* Masks for the extra coarse face data. */
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. */
47
50 int _pad3;
51 int _pad4;
52};
53
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. */
62 float angle;
63 float uv_angle0;
64 float uv_angle1;
65};
66
68 float x;
69 float y;
70 float z;
71};
72
73struct [[host_shared]] Normal {
74 float x;
75 float y;
76 float z;
77};
78
79/* Structure for #CompressedPatchCoord. */
84
85/* Patch evaluation - F-dots. */
86/* float3 is padded to float4, but the format used for face-dots does not have any padding. */
88 float x;
89 float y;
90 float z;
91};
92
93/* Same here, do not use float3. */
94struct [[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. */
107
108/* This structure is a carbon copy of OpenSubDiv's #PatchCoord. */
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. */
#define host_shared
int32_t bool32_t
VecBase< uint32_t, 4 > uint4