Blender V4.3
gl_compilation_subprocess.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9#if BLI_SUBPROCESS_SUPPORT
10
11# include "BLI_sys_types.h"
12
13namespace blender::gpu {
14
15/* The size of the memory pools shared by Blender and the compilation subprocesses. */
16constexpr size_t compilation_subprocess_shared_memory_size = 1024 * 1024 * 5; /* 5 MiB */
17
18struct ShaderSourceHeader {
19 enum Type { COMPUTE, GRAPHICS, GRAPHICS_WITH_GEOMETRY_STAGE };
20 /* The type of program being compiled. */
21 Type type;
22 /* The source code for all the shader stages (Separated by a null terminator).
23 * The stages follows the execution order (eg. vert > geom > frag). */
24 char sources[compilation_subprocess_shared_memory_size - sizeof(type)];
25};
26
27static_assert(sizeof(ShaderSourceHeader) == compilation_subprocess_shared_memory_size,
28 "Size must match the shared memory size");
29
30struct ShaderBinaryHeader {
31 /* Size of the shader binary data. */
33 /* Magic number that identifies the format of this shader binary (Driver-defined).
34 * This (and size) is set to 0 when the shader has failed to compile. */
36 /* The serialized shader binary data. */
37 uint8_t data[compilation_subprocess_shared_memory_size - sizeof(size) - sizeof(format)];
38};
39
40static_assert(sizeof(ShaderBinaryHeader) == compilation_subprocess_shared_memory_size,
41 "Size must match the shared memory size");
42
43void GL_shader_cache_dir_clear_old();
44
45} // namespace blender::gpu
46
47#endif
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
format
unsigned int uint32_t
Definition stdint.h:80
signed int int32_t
Definition stdint.h:77
unsigned char uint8_t
Definition stdint.h:78