Blender
V4.3
source
blender
gpu
vulkan
vk_shader_compiler.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
8
9
#pragma once
10
11
#include "
gpu_shader_private.hh
"
12
13
#include "
BLI_map.hh
"
14
#include "
BLI_task.h
"
15
#include "
BLI_vector.hh
"
16
17
#include "shaderc/shaderc.hpp"
18
19
namespace
blender::gpu
{
20
class
VKShader
;
21
class
VKShaderModule
;
22
29
class
VKShaderCompiler
:
public
ShaderCompiler
{
30
private
:
31
std::mutex mutex_;
32
BatchHandle
next_batch_handle_ = 1;
33
34
struct
VKBatch {
35
Vector<Shader *>
shaders;
36
};
37
Map<BatchHandle, VKBatch>
batches_;
38
39
TaskPool
*task_pool_ =
nullptr
;
40
41
public
:
42
VKShaderCompiler
();
43
virtual
~VKShaderCompiler
();
44
BatchHandle
batch_compile
(
Span<const shader::ShaderCreateInfo *>
&infos)
override
;
45
bool
batch_is_ready
(
BatchHandle
handle)
override
;
46
Vector<Shader *>
batch_finalize
(
BatchHandle
&handle)
override
;
47
48
static
bool
compile_module
(
VKShader
&
shader
,
49
shaderc_shader_kind stage,
50
VKShaderModule
&shader_module);
51
52
static
void
cache_dir_clear_old
();
53
54
private
:
55
static
void
run(
TaskPool
*__restrict pool,
void
*task_data);
56
};
57
}
// namespace blender::gpu
BLI_map.hh
BLI_task.h
BLI_vector.hh
BatchHandle
int64_t BatchHandle
Definition
GPU_shader.hh:68
blender::Map
Definition
BLI_map.hh:129
blender::Span
Definition
BLI_span.hh:75
blender::Vector
Definition
BLI_vector.hh:65
blender::gpu::ShaderCompiler
Definition
gpu_shader_private.hh:167
blender::gpu::VKShaderCompiler::batch_compile
BatchHandle batch_compile(Span< const shader::ShaderCreateInfo * > &infos) override
Definition
vk_shader_compiler.cc:159
blender::gpu::VKShaderCompiler::batch_finalize
Vector< Shader * > batch_finalize(BatchHandle &handle) override
Definition
vk_shader_compiler.cc:286
blender::gpu::VKShaderCompiler::compile_module
static bool compile_module(VKShader &shader, shaderc_shader_kind stage, VKShaderModule &shader_module)
Definition
vk_shader_compiler.cc:227
blender::gpu::VKShaderCompiler::batch_is_ready
bool batch_is_ready(BatchHandle handle) override
Definition
vk_shader_compiler.cc:272
blender::gpu::VKShaderCompiler::cache_dir_clear_old
static void cache_dir_clear_old()
Definition
vk_shader_compiler.cc:130
blender::gpu::VKShaderCompiler::VKShaderCompiler
VKShaderCompiler()
Definition
vk_shader_compiler.cc:23
blender::gpu::VKShaderCompiler::~VKShaderCompiler
virtual ~VKShaderCompiler()
Definition
vk_shader_compiler.cc:28
blender::gpu::VKShaderModule
Definition
vk_shader_module.hh:34
blender::gpu::VKShader
Definition
vk_shader.hh:25
gpu_shader_private.hh
blender::gpu::shader
Definition
GPU_common_types.hh:76
blender::gpu
Definition
blf_internal_types.hh:23
TaskPool
Definition
task_pool.cc:148
Generated on Sat Oct 4 2025 05:32:23 for Blender by
doxygen
1.14.0