Differential D16279 Diff 56892 source/blender/gpu/shaders/compositor/infos/compositor_parallel_reduction_info.hh
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/compositor/infos/compositor_parallel_reduction_info.hh
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | GPU_SHADER_CREATE_INFO(compositor_sum_blue_squared_difference) | ||||
| .define("INITIALIZE(value)", "pow(value.b - subtrahend, 2.0)") | .define("INITIALIZE(value)", "pow(value.b - subtrahend, 2.0)") | ||||
| .do_static_compilation(true); | .do_static_compilation(true); | ||||
| GPU_SHADER_CREATE_INFO(compositor_sum_luminance_squared_difference) | GPU_SHADER_CREATE_INFO(compositor_sum_luminance_squared_difference) | ||||
| .additional_info("compositor_sum_squared_difference_float_shared") | .additional_info("compositor_sum_squared_difference_float_shared") | ||||
| .push_constant(Type::VEC3, "luminance_coefficients") | .push_constant(Type::VEC3, "luminance_coefficients") | ||||
| .define("INITIALIZE(value)", "pow(dot(value.rgb, luminance_coefficients) - subtrahend, 2.0)") | .define("INITIALIZE(value)", "pow(dot(value.rgb, luminance_coefficients) - subtrahend, 2.0)") | ||||
| .do_static_compilation(true); | .do_static_compilation(true); | ||||
| /* -------------------------------------------------------------------- | |||||
| * Maximum Reductions. | |||||
| */ | |||||
| GPU_SHADER_CREATE_INFO(compositor_maximum_float_in_range) | |||||
| .additional_info("compositor_parallel_reduction_shared") | |||||
| .image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img") | |||||
| .push_constant(Type::FLOAT, "lower_bound") | |||||
| .push_constant(Type::FLOAT, "upper_bound") | |||||
| .define("TYPE", "float") | |||||
| .define("IDENTITY", "vec4(lower_bound)") | |||||
| .define("INITIALIZE(v)", "((v.x <= upper_bound) && (v.x >= lower_bound)) ? v.x : lower_bound") | |||||
| .define("LOAD(value)", "value.x") | |||||
| .define("REDUCE(lhs, rhs)", "((rhs > lhs) && (rhs <= upper_bound)) ? rhs : lhs") | |||||
| .do_static_compilation(true); | |||||
| /* -------------------------------------------------------------------- | |||||
| * Minimum Reductions. | |||||
| */ | |||||
| GPU_SHADER_CREATE_INFO(compositor_minimum_float_in_range) | |||||
| .additional_info("compositor_parallel_reduction_shared") | |||||
| .image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img") | |||||
| .push_constant(Type::FLOAT, "lower_bound") | |||||
| .push_constant(Type::FLOAT, "upper_bound") | |||||
| .define("TYPE", "float") | |||||
| .define("IDENTITY", "vec4(upper_bound)") | |||||
| .define("INITIALIZE(v)", "((v.x <= upper_bound) && (v.x >= lower_bound)) ? v.x : upper_bound") | |||||
| .define("LOAD(value)", "value.x") | |||||
| .define("REDUCE(lhs, rhs)", "((rhs < lhs) && (rhs >= lower_bound)) ? rhs : lhs") | |||||
| .do_static_compilation(true); | |||||