Blender V5.3
compositor_smaa_infos.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
5#ifdef GPU_SHADER
6# pragma once
7# include "gpu_shader_compat.hh"
8#endif
9
10#ifdef GLSL_CPP_STUBS
11# undef SMAA_RT_METRICS
12# define SMAA_GLSL_3
13# define SMAA_RT_METRICS float4(1.0f)
14# define SMAA_PRESET_LOW
15#endif
16
18
19GPU_SHADER_CREATE_INFO(compositor_smaa_edge_detection)
20LOCAL_GROUP_SIZE(16, 16)
21DEFINE("SMAA_GLSL_3")
22DEFINE_VALUE("SMAA_RT_METRICS",
23 "vec4(1.0f / vec2(textureSize(input_tx, 0)), vec2(textureSize(input_tx, 0)))")
24DEFINE_VALUE("SMAA_LUMA_WEIGHT", "vec4(luminance_coefficients, 0.0f)")
25DEFINE_VALUE("SMAA_THRESHOLD", "smaa_threshold")
26DEFINE_VALUE("SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR", "smaa_local_contrast_adaptation_factor")
27PUSH_CONSTANT(float3, luminance_coefficients)
28PUSH_CONSTANT(float, smaa_threshold)
29PUSH_CONSTANT(float, smaa_local_contrast_adaptation_factor)
30SAMPLER(0, sampler2D, input_tx)
31IMAGE(0, SFLOAT_16_16_16_16, write, image2D, edges_img)
32COMPUTE_SOURCE("compositor_smaa_edge_detection.glsl")
35
36GPU_SHADER_CREATE_INFO(compositor_smaa_blending_weight_calculation)
37LOCAL_GROUP_SIZE(16, 16)
38DEFINE("SMAA_GLSL_3")
39DEFINE_VALUE("SMAA_RT_METRICS",
40 "vec4(1.0f / vec2(textureSize(edges_tx, 0)), vec2(textureSize(edges_tx, 0)))")
41DEFINE_VALUE("SMAA_CORNER_ROUNDING", "smaa_corner_rounding")
42PUSH_CONSTANT(int, smaa_corner_rounding)
43SAMPLER(0, sampler2D, edges_tx)
44SAMPLER(1, sampler2D, area_tx)
45SAMPLER(2, sampler2D, search_tx)
46IMAGE(0, SFLOAT_16_16_16_16, write, image2D, weights_img)
47COMPUTE_SOURCE("compositor_smaa_blending_weight_calculation.glsl")
50
51GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_shared)
52LOCAL_GROUP_SIZE(16, 16)
53DEFINE("SMAA_GLSL_3")
54DEFINE_VALUE("SMAA_RT_METRICS",
55 "vec4(1.0f / vec2(textureSize(input_tx, 0)), vec2(textureSize(input_tx, 0)))")
56SAMPLER(0, sampler2D, input_tx)
57SAMPLER(1, sampler2D, weights_tx)
58COMPUTE_SOURCE("compositor_smaa_neighborhood_blending.glsl")
60
61GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_float4)
62ADDITIONAL_INFO(compositor_smaa_neighborhood_blending_shared)
63IMAGE(0, SFLOAT_16_16_16_16, write, image2D, output_img)
66
67GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_float)
68ADDITIONAL_INFO(compositor_smaa_neighborhood_blending_shared)
69IMAGE(0, SFLOAT_16, write, image2D, output_img)
@ SFLOAT_16_16_16_16
#define GPU_SHADER_CREATE_INFO(_info)
#define GPU_SHADER_CREATE_END()
#define SAMPLER(slot, type, name)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define DEFINE(name)
#define LOCAL_GROUP_SIZE(...)
#define IMAGE(slot, format, qualifiers, type, name)
#define COMPUTE_SOURCE(filename)
#define DO_STATIC_COMPILATION()
#define DEFINE_VALUE(name, value)
ImageBase< float, 2 > image2D
SamplerBase< float, 2 > sampler2D