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