Blender V4.3
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
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
19namespace blender::gpu {
20class VKShader;
21class VKShaderModule;
22
30 private:
31 std::mutex mutex_;
32 BatchHandle next_batch_handle_ = 1;
33
34 struct VKBatch {
35 Vector<Shader *> shaders;
36 };
38
39 TaskPool *task_pool_ = nullptr;
40
41 public:
43 virtual ~VKShaderCompiler();
45 bool batch_is_ready(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
int64_t BatchHandle
Definition GPU_shader.hh:68
BatchHandle batch_compile(Span< const shader::ShaderCreateInfo * > &infos) override
Vector< Shader * > batch_finalize(BatchHandle &handle) override
static bool compile_module(VKShader &shader, shaderc_shader_kind stage, VKShaderModule &shader_module)
bool batch_is_ready(BatchHandle handle) override
EvaluationStage stage
Definition deg_eval.cc:83