Blender V5.0
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
13#ifndef GPU_SHADER
15#endif
16
18 /* Offsets in the buffers data where the source and destination data start. */
21
22 /* Parameters for the DRWPatchMap. */
27
28 /* Coarse topology information. */
31
32 /* Refined topology information. */
34
35 /* The sculpt mask data layer may be null. */
37
38 /* Masks for the extra coarse face data. */
44
45 /* Number of elements to process in the compute shader (can be the coarse quad count, or the
46 * final vertex count, depending on which compute pass we do). This is used to early out in case
47 * of out of bond accesses as compute dispatch are of fixed size. */
49
52 int _pad3;
53 int _pad4;
54};
56
61
62/* Mirror of #UVStretchAngle in the C++ code, but using floats until proper data compression
63 * is implemented for all subdivision data. */
65 float angle;
66 float uv_angle0;
67 float uv_angle1;
68};
69
70struct Position {
71 float x;
72 float y;
73 float z;
74};
75
76struct Normal {
77 float x;
78 float y;
79 float z;
80};
81
82/* Structure for #CompressedPatchCoord. */
87
88/* Patch evaluation - F-dots. */
89/* float3 is padded to float4, but the format used for face-dots does not have any padding. */
90struct FDotVert {
91 float x, y, z;
92};
93
94/* Same here, do not use float3. */
95struct FDotNor {
96 float x, y, z;
97 float flag;
98};
99
100/* This structure is a carbon copy of OpenSubDiv's #PatchTable::PatchHandle. */
106
107/* This structure is a carbon copy of OpenSubDiv's #PatchCoord. */
112 float u;
113 float v;
114};
115
116/* This structure is a carbon copy of OpenSubDiv's #PatchCoord.QuadNode.
117 * Each child is a bit-field. */
118struct QuadNode {
120};
121
122/* When not using OSD we need to defined the structs as they subdiv_info still refer to them. */
123#if !defined(USE_GPU_SHADER_CREATE_INFO) || \
124 (!defined(OSD_PATCH_BASIS_GLSL) && !defined(OSD_PATCH_BASIS_METAL))
125/* This structure is a carbon copy of OpenSubDiv's #Osd::PatchParam. */
130};
131
132/* This structure is a carbon copy of OpenSubDiv's #Osd::PatchArray. */
141
142/* This structure is a carbon copy of OpenSubDiv's #Osd::PatchCoord. */
147 float s;
148 float t;
149};
150
151#endif
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition BLI_assert.h:86
unsigned int uint
int32_t bool32_t
VecBase< uint32_t, 4 > uint4