Blender  V3.3
eevee_shader.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2021 Blender Foundation.
3  */
4 
12 #pragma once
13 
14 #include <array>
15 #include <string>
16 
17 #include "BLI_string_ref.hh"
18 #include "DRW_render.h"
19 #include "GPU_material.h"
20 #include "GPU_shader.h"
21 
22 #include "eevee_material.hh"
23 #include "eevee_sync.hh"
24 
25 namespace blender::eevee {
26 
27 /* Keep alphabetical order and clean prefix. */
29  FILM_FRAG = 0,
31 
33 };
34 
38 class ShaderModule {
39  private:
40  std::array<GPUShader *, MAX_SHADER_TYPE> shaders_;
41 
43  static ShaderModule *g_shader_module;
44 
45  public:
46  ShaderModule();
47  ~ShaderModule();
48 
51  struct bNodeTree *nodetree,
52  eMaterialPipeline pipeline_type,
53  eMaterialGeometry geometry_type,
54  bool deferred_compilation);
55  GPUMaterial *world_shader_get(::World *blender_world, struct bNodeTree *nodetree);
56  GPUMaterial *material_shader_get(const char *name,
58  struct bNodeTree *nodetree,
59  eMaterialPipeline pipeline_type,
60  eMaterialGeometry geometry_type,
61  bool is_lookdev);
62 
64 
66  static ShaderModule *module_get();
67  static void module_free();
68 
69  private:
70  const char *static_shader_create_info_name_get(eShaderType shader_type);
71 };
72 
73 } // namespace blender::eevee
struct GPUShader GPUShader
Definition: GPU_shader.h:20
GPUMaterial * material_shader_get(::Material *blender_mat, struct bNodeTree *nodetree, eMaterialPipeline pipeline_type, eMaterialGeometry geometry_type, bool deferred_compilation)
GPUMaterial * world_shader_get(::World *blender_world, struct bNodeTree *nodetree)
static ShaderModule * module_get()
Definition: eevee_shader.cc:25
void material_create_info_ammend(GPUMaterial *mat, GPUCodegenOutput *codegen)
GPUShader * static_shader_get(eShaderType shader_type)
Definition: eevee_shader.cc:92
smooth(Type::VEC4, "color_mul") .smooth(Type gpFillTexture gpSceneDepthTexture materials[GPENCIL_MATERIAL_BUFFER_LEN]
Definition: gpencil_info.hh:29