Blender V4.3
eevee_shader.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12#pragma once
13
14#include <array>
15#include <string>
16
17#include "BLI_string_ref.hh"
18#include "DRW_render.hh"
19#include "GPU_material.hh"
20#include "GPU_shader.hh"
21
22#include "eevee_material.hh"
23#include "eevee_sync.hh"
24
25namespace blender::eevee {
26
27/* Keep alphabetical order and clean prefix. */
30
40
49
53
57
75
79
84
91
97
99
104
114
116
122
143
146
152
154
160
162};
163
168 private:
169 std::array<GPUShader *, MAX_SHADER_TYPE> shaders_;
170 BatchHandle compilation_handle_ = 0;
171 SpecializationBatchHandle specialization_handle_ = 0;
172
174 static ShaderModule *g_shader_module;
175
176 public:
177 ShaderModule();
179
180 bool is_ready(bool block = false);
181
182 void precompile_specializations(int render_buffers_shadow_id,
183 int shadow_ray_count,
184 int shadow_ray_step_count);
185
188 eMaterialGeometry geometry_type);
190 bNodeTree *nodetree,
191 eMaterialPipeline pipeline_type,
192 eMaterialGeometry geometry_type,
193 bool deferred_compilation);
194 GPUMaterial *world_shader_get(::World *blender_world,
195 bNodeTree *nodetree,
196 eMaterialPipeline pipeline_type);
197
202 GPUMaterial *material_shader_get(const char *name,
203 ListBase &materials,
204 bNodeTree *nodetree,
205 eMaterialPipeline pipeline_type,
206 eMaterialGeometry geometry_type);
207
209
211 static ShaderModule *module_get();
212 static void module_free();
213
214 private:
215 const char *static_shader_create_info_name_get(eShaderType shader_type);
216};
217
218} // namespace blender::eevee
int64_t BatchHandle
Definition GPU_shader.hh:68
int64_t SpecializationBatchHandle
struct GPUShader GPUShader
bool is_ready(bool block=false)
GPUMaterial * material_shader_get(::Material *blender_mat, bNodeTree *nodetree, eMaterialPipeline pipeline_type, eMaterialGeometry geometry_type, bool deferred_compilation)
GPUMaterial * material_default_shader_get(eMaterialPipeline pipeline_type, eMaterialGeometry geometry_type)
void material_create_info_amend(GPUMaterial *mat, GPUCodegenOutput *codegen)
void precompile_specializations(int render_buffers_shadow_id, int shadow_ray_count, int shadow_ray_step_count)
GPUMaterial * world_shader_get(::World *blender_world, bNodeTree *nodetree, eMaterialPipeline pipeline_type)
static ShaderModule * module_get()
GPUShader * static_shader_get(eShaderType shader_type)
@ SHADOW_TILEMAP_TAG_USAGE_SURFELS
@ SHADOW_TILEMAP_TAG_USAGE_OPAQUE
@ SHADOW_TILEMAP_TAG_USAGE_TRANSPARENT
@ FILM_PASS_CONVERT_CRYPTOMATTE
@ SHADOW_TILEMAP_TAG_USAGE_VOLUME