Blender  V3.3
workbench_effect_dof_info.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
4 
5 GPU_SHADER_CREATE_INFO(workbench_effect_dof)
6  /* TODO(fclem): Split resources per stage. */
7  .sampler(0, ImageType::FLOAT_2D, "inputCocTex")
8  .sampler(1, ImageType::FLOAT_2D, "maxCocTilesTex")
9  .sampler(2, ImageType::FLOAT_2D, "sceneColorTex")
10  .sampler(3, ImageType::FLOAT_2D, "sceneDepthTex")
11  .sampler(4, ImageType::FLOAT_2D, "backgroundTex")
12  .sampler(5, ImageType::FLOAT_2D, "halfResColorTex")
13  .sampler(6, ImageType::FLOAT_2D, "blurTex")
14  .sampler(7, ImageType::FLOAT_2D, "noiseTex")
15  .push_constant(Type::VEC2, "invertedViewportSize")
16  .push_constant(Type::VEC2, "nearFar")
17  .push_constant(Type::VEC3, "dofParams")
18  .push_constant(Type::FLOAT, "noiseOffset")
19  .fragment_source("workbench_effect_dof_frag.glsl")
20  .additional_info("draw_fullscreen")
21  .additional_info("draw_view");
22 
23 GPU_SHADER_CREATE_INFO(workbench_effect_dof_prepare)
24  .define("PREPARE")
25  .fragment_out(0, Type::VEC4, "halfResColor")
26  .fragment_out(1, Type::VEC2, "normalizedCoc")
27  .additional_info("workbench_effect_dof")
28  .do_static_compilation(true);
29 
30 GPU_SHADER_CREATE_INFO(workbench_effect_dof_downsample)
31  .define("DOWNSAMPLE")
32  .fragment_out(0, Type::VEC4, "outColor")
33  .fragment_out(1, Type::VEC2, "outCocs")
34  .additional_info("workbench_effect_dof")
35  .do_static_compilation(true);
36 
37 GPU_SHADER_CREATE_INFO(workbench_effect_dof_blur1)
38  .define("BLUR1")
39  .define("NUM_SAMPLES", "49")
40  .uniform_buf(1, "vec4", "samples[49]")
41  .fragment_out(0, Type::VEC4, "blurColor")
42  .additional_info("workbench_effect_dof")
43  .do_static_compilation(true);
44 
45 GPU_SHADER_CREATE_INFO(workbench_effect_dof_blur2)
46  .define("BLUR2")
47  .fragment_out(0, Type::VEC4, "finalColor")
48  .additional_info("workbench_effect_dof")
49  .do_static_compilation(true);
50 
51 GPU_SHADER_CREATE_INFO(workbench_effect_dof_resolve)
52  .define("RESOLVE")
53  .fragment_out(0, Type::VEC4, "finalColorAdd", DualBlend::SRC_0)
54  .fragment_out(0, Type::VEC4, "finalColorMul", DualBlend::SRC_1)
55  .additional_info("workbench_effect_dof")
56  .do_static_compilation(true);
#define GPU_SHADER_CREATE_INFO(_info)
@ FLOAT