GPU: Shader Create Info GLSL-C++ stubs #3

Closed
Clément Foucault wants to merge 90 commits from create-info-cpp-macros into glsl-include

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
59 changed files with 1229 additions and 1043 deletions
Showing only changes of commit d0f7c26cf1 - Show all commits

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_alpha_crop)
.local_group_size(16, 16)
.push_constant(Type::IVEC2, "lower_bound")
.push_constant(Type::IVEC2, "upper_bound")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_alpha_crop.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(IVEC2, lower_bound)
PUSH_CONSTANT(IVEC2, upper_bound)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_alpha_crop.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_bilateral_blur)
.local_group_size(16, 16)
.push_constant(Type::INT, "radius")
.push_constant(Type::FLOAT, "threshold")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "determinator_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_bilateral_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, radius)
PUSH_CONSTANT(FLOAT, threshold)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, determinator_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_bilateral_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,12 +5,13 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_bokeh_blur)
.local_group_size(16, 16)
.push_constant(Type::INT, "radius")
.push_constant(Type::BOOL, "extend_bounds")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "weights_tx")
.sampler(2, ImageType::FLOAT_2D, "mask_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_bokeh_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, radius)
PUSH_CONSTANT(BOOL, extend_bounds)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, weights_tx)
SAMPLER(2, FLOAT_2D, mask_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_bokeh_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,13 +5,14 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_bokeh_blur_variable_size)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "base_size")
.push_constant(Type::INT, "search_radius")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "weights_tx")
.sampler(2, ImageType::FLOAT_2D, "size_tx")
.sampler(3, ImageType::FLOAT_2D, "mask_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_bokeh_blur_variable_size.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, base_size)
PUSH_CONSTANT(INT, search_radius)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, weights_tx)
SAMPLER(2, FLOAT_2D, size_tx)
SAMPLER(3, FLOAT_2D, mask_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_bokeh_blur_variable_size.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,12 +5,13 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_bokeh_image)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "exterior_angle")
.push_constant(Type::FLOAT, "rotation")
.push_constant(Type::FLOAT, "roundness")
.push_constant(Type::FLOAT, "catadioptric")
.push_constant(Type::FLOAT, "lens_shift")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_bokeh_image.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, exterior_angle)
PUSH_CONSTANT(FLOAT, rotation)
PUSH_CONSTANT(FLOAT, roundness)
PUSH_CONSTANT(FLOAT, catadioptric)
PUSH_CONSTANT(FLOAT, lens_shift)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_bokeh_image.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,33 +5,38 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_box_mask_shared)
.local_group_size(16, 16)
.push_constant(Type::IVEC2, "domain_size")
.push_constant(Type::VEC2, "location")
.push_constant(Type::VEC2, "size")
.push_constant(Type::FLOAT, "cos_angle")
.push_constant(Type::FLOAT, "sin_angle")
.sampler(0, ImageType::FLOAT_2D, "base_mask_tx")
.sampler(1, ImageType::FLOAT_2D, "mask_value_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_mask_img")
.compute_source("compositor_box_mask.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(IVEC2, domain_size)
PUSH_CONSTANT(VEC2, location)
PUSH_CONSTANT(VEC2, size)
PUSH_CONSTANT(FLOAT, cos_angle)
PUSH_CONSTANT(FLOAT, sin_angle)
SAMPLER(0, FLOAT_2D, base_mask_tx)
SAMPLER(1, FLOAT_2D, mask_value_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_mask_img)
COMPUTE_SOURCE("compositor_box_mask.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_box_mask_add)
.additional_info("compositor_box_mask_shared")
.define("CMP_NODE_MASKTYPE_ADD")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_box_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_ADD")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_box_mask_subtract)
.additional_info("compositor_box_mask_shared")
.define("CMP_NODE_MASKTYPE_SUBTRACT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_box_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_SUBTRACT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_box_mask_multiply)
.additional_info("compositor_box_mask_shared")
.define("CMP_NODE_MASKTYPE_MULTIPLY")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_box_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_MULTIPLY")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_box_mask_not)
.additional_info("compositor_box_mask_shared")
.define("CMP_NODE_MASKTYPE_NOT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_box_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_NOT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,8 +5,9 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_compute_preview)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img")
.compute_source("compositor_compute_preview.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, preview_img)
COMPUTE_SOURCE("compositor_compute_preview.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,67 +5,78 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_convert_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.typedef_source("gpu_shader_compositor_type_conversion.glsl")
.compute_source("compositor_convert.glsl");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
TYPEDEF_SOURCE("gpu_shader_compositor_type_conversion.glsl")
COMPUTE_SOURCE("compositor_convert.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_float_to_float)
.additional_info("compositor_convert_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_float_to_vector)
.additional_info("compositor_convert_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "vec4(vec3_from_float(value.x), 1.0)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "vec4(vec3_from_float(value.x), 1.0)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_float_to_color)
.additional_info("compositor_convert_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "vec4_from_float(value.x)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "vec4_from_float(value.x)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_color_to_float)
.additional_info("compositor_convert_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "vec4(float_from_vec4(value), vec3(0.0))")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "vec4(float_from_vec4(value), vec3(0.0))")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_color_to_vector)
.additional_info("compositor_convert_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_color_to_color)
.additional_info("compositor_convert_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_vector_to_float)
.additional_info("compositor_convert_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "vec4(float_from_vec3(value.xyz), vec3(0.0))")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "vec4(float_from_vec3(value.xyz), vec3(0.0))")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_vector_to_vector)
.additional_info("compositor_convert_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_vector_to_color)
.additional_info("compositor_convert_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "vec4_from_vec3(value.xyz)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "vec4_from_vec3(value.xyz)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_convert_color_to_alpha)
.additional_info("compositor_convert_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("CONVERT_EXPRESSION(value)", "vec4(value.a)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_convert_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("CONVERT_EXPRESSION(value)", "vec4(value.a)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,25 +5,28 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_cryptomatte_pick)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "first_layer_tx")
.image(0, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_cryptomatte_pick.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, first_layer_tx)
IMAGE(0, GPU_RGBA32F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_cryptomatte_pick.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_cryptomatte_matte)
.local_group_size(16, 16)
.push_constant(Type::INT, "identifiers_count")
.push_constant(Type::FLOAT, "identifiers", 32)
.sampler(0, ImageType::FLOAT_2D, "layer_tx")
.image(0, GPU_R16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "matte_img")
.compute_source("compositor_cryptomatte_matte.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, identifiers_count)
PUSH_CONSTANT_ARRAY(FLOAT, identifiers, 32)
SAMPLER(0, FLOAT_2D, layer_tx)
IMAGE(0, GPU_R16F, READ_WRITE, FLOAT_2D, matte_img)
COMPUTE_SOURCE("compositor_cryptomatte_matte.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_cryptomatte_image)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "matte_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_cryptomatte_image.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, matte_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_cryptomatte_image.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,33 +5,36 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_defocus_radius_from_scale)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "scale")
.push_constant(Type::FLOAT, "max_radius")
.sampler(0, ImageType::FLOAT_2D, "radius_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "radius_img")
.compute_source("compositor_defocus_radius_from_scale.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, scale)
PUSH_CONSTANT(FLOAT, max_radius)
SAMPLER(0, FLOAT_2D, radius_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, radius_img)
COMPUTE_SOURCE("compositor_defocus_radius_from_scale.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_defocus_radius_from_depth)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "f_stop")
.push_constant(Type::FLOAT, "max_radius")
.push_constant(Type::FLOAT, "focal_length")
.push_constant(Type::FLOAT, "pixels_per_meter")
.push_constant(Type::FLOAT, "distance_to_image_of_focus")
.sampler(0, ImageType::FLOAT_2D, "depth_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "radius_img")
.compute_source("compositor_defocus_radius_from_depth.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, f_stop)
PUSH_CONSTANT(FLOAT, max_radius)
PUSH_CONSTANT(FLOAT, focal_length)
PUSH_CONSTANT(FLOAT, pixels_per_meter)
PUSH_CONSTANT(FLOAT, distance_to_image_of_focus)
SAMPLER(0, FLOAT_2D, depth_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, radius_img)
COMPUTE_SOURCE("compositor_defocus_radius_from_depth.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_defocus_blur)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "gamma_correct")
.push_constant(Type::INT, "search_radius")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "weights_tx")
.sampler(2, ImageType::FLOAT_2D, "radius_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_defocus_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, gamma_correct)
PUSH_CONSTANT(INT, search_radius)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, weights_tx)
SAMPLER(2, FLOAT_2D, radius_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_defocus_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,22 +5,24 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_deriche_gaussian_blur)
.local_group_size(128, 2)
.push_constant(Type::VEC4, "causal_feedforward_coefficients")
.push_constant(Type::VEC4, "non_causal_feedforward_coefficients")
.push_constant(Type::VEC4, "feedback_coefficients")
.push_constant(Type::FLOAT, "causal_boundary_coefficient")
.push_constant(Type::FLOAT, "non_causal_boundary_coefficient")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "causal_output_img")
.image(1, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "non_causal_output_img")
.compute_source("compositor_deriche_gaussian_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(128, 2)
PUSH_CONSTANT(VEC4, causal_feedforward_coefficients)
PUSH_CONSTANT(VEC4, non_causal_feedforward_coefficients)
PUSH_CONSTANT(VEC4, feedback_coefficients)
PUSH_CONSTANT(FLOAT, causal_boundary_coefficient)
PUSH_CONSTANT(FLOAT, non_causal_boundary_coefficient)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, causal_output_img)
IMAGE(1, GPU_RGBA16F, WRITE, FLOAT_2D, non_causal_output_img)
COMPUTE_SOURCE("compositor_deriche_gaussian_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_deriche_gaussian_blur_sum)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "causal_input_tx")
.sampler(1, ImageType::FLOAT_2D, "non_causal_input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_deriche_gaussian_blur_sum.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, causal_input_tx)
SAMPLER(1, FLOAT_2D, non_causal_input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_deriche_gaussian_blur_sum.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_despeckle)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "threshold")
.push_constant(Type::FLOAT, "neighbor_threshold")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "factor_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_despeckle.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, threshold)
PUSH_CONSTANT(FLOAT, neighbor_threshold)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, factor_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_despeckle.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,14 +5,15 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_directional_blur)
.local_group_size(16, 16)
.push_constant(Type::INT, "iterations")
.push_constant(Type::VEC2, "origin")
.push_constant(Type::VEC2, "translation")
.push_constant(Type::FLOAT, "rotation_sin")
.push_constant(Type::FLOAT, "rotation_cos")
.push_constant(Type::FLOAT, "scale")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_directional_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, iterations)
PUSH_CONSTANT(VEC2, origin)
PUSH_CONSTANT(VEC2, translation)
PUSH_CONSTANT(FLOAT, rotation_sin)
PUSH_CONSTANT(FLOAT, rotation_cos)
PUSH_CONSTANT(FLOAT, scale)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_directional_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_displace)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "displacement_tx")
.sampler(2, ImageType::FLOAT_2D, "x_scale_tx")
.sampler(3, ImageType::FLOAT_2D, "y_scale_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_displace.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, displacement_tx)
SAMPLER(2, FLOAT_2D, x_scale_tx)
SAMPLER(3, FLOAT_2D, y_scale_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_displace.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,22 +5,24 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_double_edge_mask_compute_boundary)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "include_all_inner_edges")
.push_constant(Type::BOOL, "include_edges_of_image")
.sampler(0, ImageType::FLOAT_2D, "inner_mask_tx")
.sampler(1, ImageType::FLOAT_2D, "outer_mask_tx")
.image(0, GPU_RG16I, Qualifier::WRITE, ImageType::INT_2D, "inner_boundary_img")
.image(1, GPU_RG16I, Qualifier::WRITE, ImageType::INT_2D, "outer_boundary_img")
.compute_source("compositor_double_edge_mask_compute_boundary.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, include_all_inner_edges)
PUSH_CONSTANT(BOOL, include_edges_of_image)
SAMPLER(0, FLOAT_2D, inner_mask_tx)
SAMPLER(1, FLOAT_2D, outer_mask_tx)
IMAGE(0, GPU_RG16I, WRITE, INT_2D, inner_boundary_img)
IMAGE(1, GPU_RG16I, WRITE, INT_2D, outer_boundary_img)
COMPUTE_SOURCE("compositor_double_edge_mask_compute_boundary.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_double_edge_mask_compute_gradient)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "inner_mask_tx")
.sampler(1, ImageType::FLOAT_2D, "outer_mask_tx")
.sampler(2, ImageType::INT_2D, "flooded_inner_boundary_tx")
.sampler(3, ImageType::INT_2D, "flooded_outer_boundary_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_double_edge_mask_compute_gradient.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, inner_mask_tx)
SAMPLER(1, FLOAT_2D, outer_mask_tx)
SAMPLER(2, INT_2D, flooded_inner_boundary_tx)
SAMPLER(3, INT_2D, flooded_outer_boundary_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_double_edge_mask_compute_gradient.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_edge_filter)
.local_group_size(16, 16)
.push_constant(Type::MAT4, "ukernel")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "factor_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_edge_filter.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(MAT4, ukernel)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, factor_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_edge_filter.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,33 +5,38 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_ellipse_mask_shared)
.local_group_size(16, 16)
.push_constant(Type::IVEC2, "domain_size")
.push_constant(Type::VEC2, "location")
.push_constant(Type::VEC2, "radius")
.push_constant(Type::FLOAT, "cos_angle")
.push_constant(Type::FLOAT, "sin_angle")
.sampler(0, ImageType::FLOAT_2D, "base_mask_tx")
.sampler(1, ImageType::FLOAT_2D, "mask_value_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_mask_img")
.compute_source("compositor_ellipse_mask.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(IVEC2, domain_size)
PUSH_CONSTANT(VEC2, location)
PUSH_CONSTANT(VEC2, radius)
PUSH_CONSTANT(FLOAT, cos_angle)
PUSH_CONSTANT(FLOAT, sin_angle)
SAMPLER(0, FLOAT_2D, base_mask_tx)
SAMPLER(1, FLOAT_2D, mask_value_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_mask_img)
COMPUTE_SOURCE("compositor_ellipse_mask.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_ellipse_mask_add)
.additional_info("compositor_ellipse_mask_shared")
.define("CMP_NODE_MASKTYPE_ADD")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_ellipse_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_ADD")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_ellipse_mask_subtract)
.additional_info("compositor_ellipse_mask_shared")
.define("CMP_NODE_MASKTYPE_SUBTRACT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_ellipse_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_SUBTRACT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_ellipse_mask_multiply)
.additional_info("compositor_ellipse_mask_shared")
.define("CMP_NODE_MASKTYPE_MULTIPLY")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_ellipse_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_MULTIPLY")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_ellipse_mask_not)
.additional_info("compositor_ellipse_mask_shared")
.define("CMP_NODE_MASKTYPE_NOT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_ellipse_mask_shared)
DEFINE("CMP_NODE_MASKTYPE_NOT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_filter)
.local_group_size(16, 16)
.push_constant(Type::MAT4, "ukernel")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "factor_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_filter.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(MAT4, ukernel)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, factor_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_filter.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_flip)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "flip_x")
.push_constant(Type::BOOL, "flip_y")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_flip.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, flip_x)
PUSH_CONSTANT(BOOL, flip_y)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_flip.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -9,126 +9,140 @@
* ------- */
GPU_SHADER_CREATE_INFO(compositor_glare_highlights)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "threshold")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_glare_highlights.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, threshold)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_glare_highlights.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_mix)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "mix_factor")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "glare_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_glare_mix.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, mix_factor)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, glare_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_glare_mix.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* ------------
* Ghost Glare.
* ------------ */
GPU_SHADER_CREATE_INFO(compositor_glare_ghost_base)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "small_ghost_tx")
.sampler(1, ImageType::FLOAT_2D, "big_ghost_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "combined_ghost_img")
.compute_source("compositor_glare_ghost_base.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, small_ghost_tx)
SAMPLER(1, FLOAT_2D, big_ghost_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, combined_ghost_img)
COMPUTE_SOURCE("compositor_glare_ghost_base.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_ghost_accumulate)
.local_group_size(16, 16)
.push_constant(Type::VEC4, "scales")
.push_constant(Type::VEC4, "color_modulators", 4)
.sampler(0, ImageType::FLOAT_2D, "input_ghost_tx")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "accumulated_ghost_img")
.compute_source("compositor_glare_ghost_accumulate.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(VEC4, scales)
PUSH_CONSTANT_ARRAY(VEC4, color_modulators, 4)
SAMPLER(0, FLOAT_2D, input_ghost_tx)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, accumulated_ghost_img)
COMPUTE_SOURCE("compositor_glare_ghost_accumulate.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* -----------
* Simple Star
* ----------- */
GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_horizontal_pass)
.local_group_size(16)
.push_constant(Type::INT, "iterations")
.push_constant(Type::FLOAT, "fade_factor")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "horizontal_img")
.compute_source("compositor_glare_simple_star_horizontal_pass.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16)
PUSH_CONSTANT(INT, iterations)
PUSH_CONSTANT(FLOAT, fade_factor)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, horizontal_img)
COMPUTE_SOURCE("compositor_glare_simple_star_horizontal_pass.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_vertical_pass)
.local_group_size(16)
.push_constant(Type::INT, "iterations")
.push_constant(Type::FLOAT, "fade_factor")
.sampler(0, ImageType::FLOAT_2D, "horizontal_tx")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "vertical_img")
.compute_source("compositor_glare_simple_star_vertical_pass.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16)
PUSH_CONSTANT(INT, iterations)
PUSH_CONSTANT(FLOAT, fade_factor)
SAMPLER(0, FLOAT_2D, horizontal_tx)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, vertical_img)
COMPUTE_SOURCE("compositor_glare_simple_star_vertical_pass.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_diagonal_pass)
.local_group_size(16)
.push_constant(Type::INT, "iterations")
.push_constant(Type::FLOAT, "fade_factor")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "diagonal_img")
.compute_source("compositor_glare_simple_star_diagonal_pass.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16)
PUSH_CONSTANT(INT, iterations)
PUSH_CONSTANT(FLOAT, fade_factor)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, diagonal_img)
COMPUTE_SOURCE("compositor_glare_simple_star_diagonal_pass.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_anti_diagonal_pass)
.local_group_size(16)
.push_constant(Type::INT, "iterations")
.push_constant(Type::FLOAT, "fade_factor")
.sampler(0, ImageType::FLOAT_2D, "diagonal_tx")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "anti_diagonal_img")
.compute_source("compositor_glare_simple_star_anti_diagonal_pass.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16)
PUSH_CONSTANT(INT, iterations)
PUSH_CONSTANT(FLOAT, fade_factor)
SAMPLER(0, FLOAT_2D, diagonal_tx)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, anti_diagonal_img)
COMPUTE_SOURCE("compositor_glare_simple_star_anti_diagonal_pass.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* -------
* Streaks
* ------- */
GPU_SHADER_CREATE_INFO(compositor_glare_streaks_filter)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "color_modulator")
.push_constant(Type::VEC3, "fade_factors")
.push_constant(Type::VEC2, "streak_vector")
.sampler(0, ImageType::FLOAT_2D, "input_streak_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_streak_img")
.compute_source("compositor_glare_streaks_filter.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, color_modulator)
PUSH_CONSTANT(VEC3, fade_factors)
PUSH_CONSTANT(VEC2, streak_vector)
SAMPLER(0, FLOAT_2D, input_streak_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_streak_img)
COMPUTE_SOURCE("compositor_glare_streaks_filter.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_streaks_accumulate)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "attenuation_factor")
.sampler(0, ImageType::FLOAT_2D, "streak_tx")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "accumulated_streaks_img")
.compute_source("compositor_glare_streaks_accumulate.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, attenuation_factor)
SAMPLER(0, FLOAT_2D, streak_tx)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, accumulated_streaks_img)
COMPUTE_SOURCE("compositor_glare_streaks_accumulate.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* -----
* Bloom
* ----- */
GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_glare_bloom_downsample.glsl");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_glare_bloom_downsample.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_simple_average)
.define("SIMPLE_AVERAGE")
.additional_info("compositor_glare_bloom_downsample_shared")
.do_static_compilation(true);
DEFINE("SIMPLE_AVERAGE")
ADDITIONAL_INFO(compositor_glare_bloom_downsample_shared)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_karis_average)
.define("KARIS_AVERAGE")
.additional_info("compositor_glare_bloom_downsample_shared")
.do_static_compilation(true);
DEFINE("KARIS_AVERAGE")
ADDITIONAL_INFO(compositor_glare_bloom_downsample_shared)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_glare_bloom_upsample)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_glare_bloom_upsample.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, READ_WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_glare_bloom_upsample.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,9 +5,10 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_id_mask)
.local_group_size(16, 16)
.push_constant(Type::INT, "index")
.sampler(0, ImageType::FLOAT_2D, "input_mask_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_mask_img")
.compute_source("compositor_id_mask.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, index)
SAMPLER(0, FLOAT_2D, input_mask_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_mask_img)
COMPUTE_SOURCE("compositor_id_mask.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,9 +5,10 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_image_crop)
.local_group_size(16, 16)
.push_constant(Type::IVEC2, "lower_bound")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_image_crop.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(IVEC2, lower_bound)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_image_crop.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,29 +5,32 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_inpaint_compute_boundary)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RG16I, Qualifier::WRITE, ImageType::INT_2D, "boundary_img")
.compute_source("compositor_inpaint_compute_boundary.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RG16I, WRITE, INT_2D, boundary_img)
COMPUTE_SOURCE("compositor_inpaint_compute_boundary.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_inpaint_fill_region)
.local_group_size(16, 16)
.push_constant(Type::INT, "max_distance")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::INT_2D, "flooded_boundary_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "filled_region_img")
.image(1, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "distance_to_boundary_img")
.image(2, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "smoothing_radius_img")
.compute_source("compositor_inpaint_fill_region.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, max_distance)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, INT_2D, flooded_boundary_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, filled_region_img)
IMAGE(1, GPU_R16F, WRITE, FLOAT_2D, distance_to_boundary_img)
IMAGE(2, GPU_R16F, WRITE, FLOAT_2D, smoothing_radius_img)
COMPUTE_SOURCE("compositor_inpaint_fill_region.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_inpaint_compute_region)
.local_group_size(16, 16)
.push_constant(Type::INT, "max_distance")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "inpainted_region_tx")
.sampler(2, ImageType::FLOAT_2D, "distance_to_boundary_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_inpaint_compute_region.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, max_distance)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, inpainted_region_tx)
SAMPLER(2, FLOAT_2D, distance_to_boundary_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_inpaint_compute_region.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,9 +5,10 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_jump_flooding)
.local_group_size(16, 16)
.push_constant(Type::INT, "step_size")
.sampler(0, ImageType::INT_2D, "input_tx")
.image(0, GPU_RG16I, Qualifier::WRITE, ImageType::INT_2D, "output_img")
.compute_source("compositor_jump_flooding.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, step_size)
SAMPLER(0, INT_2D, input_tx)
IMAGE(0, GPU_RG16I, WRITE, INT_2D, output_img)
COMPUTE_SOURCE("compositor_jump_flooding.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,53 +5,58 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_keying_extract_chroma)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_keying_extract_chroma.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_keying_extract_chroma.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_keying_replace_chroma)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "new_chroma_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_keying_replace_chroma.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, new_chroma_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_keying_replace_chroma.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_keying_compute_matte)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "key_balance")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "key_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_keying_compute_matte.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, key_balance)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, key_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_keying_compute_matte.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_keying_tweak_matte)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "compute_edges")
.push_constant(Type::BOOL, "apply_core_matte")
.push_constant(Type::BOOL, "apply_garbage_matte")
.push_constant(Type::INT, "edge_search_radius")
.push_constant(Type::FLOAT, "edge_tolerance")
.push_constant(Type::FLOAT, "black_level")
.push_constant(Type::FLOAT, "white_level")
.sampler(0, ImageType::FLOAT_2D, "input_matte_tx")
.sampler(1, ImageType::FLOAT_2D, "garbage_matte_tx")
.sampler(2, ImageType::FLOAT_2D, "core_matte_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_matte_img")
.image(1, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_edges_img")
.compute_source("compositor_keying_tweak_matte.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, compute_edges)
PUSH_CONSTANT(BOOL, apply_core_matte)
PUSH_CONSTANT(BOOL, apply_garbage_matte)
PUSH_CONSTANT(INT, edge_search_radius)
PUSH_CONSTANT(FLOAT, edge_tolerance)
PUSH_CONSTANT(FLOAT, black_level)
PUSH_CONSTANT(FLOAT, white_level)
SAMPLER(0, FLOAT_2D, input_matte_tx)
SAMPLER(1, FLOAT_2D, garbage_matte_tx)
SAMPLER(2, FLOAT_2D, core_matte_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_matte_img)
IMAGE(1, GPU_R16F, WRITE, FLOAT_2D, output_edges_img)
COMPUTE_SOURCE("compositor_keying_tweak_matte.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_keying_compute_image)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "despill_factor")
.push_constant(Type::FLOAT, "despill_balance")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "matte_tx")
.sampler(2, ImageType::FLOAT_2D, "key_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_keying_compute_image.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, despill_factor)
PUSH_CONSTANT(FLOAT, despill_balance)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, matte_tx)
SAMPLER(2, FLOAT_2D, key_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_keying_compute_image.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_keying_screen)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "smoothness")
.push_constant(Type::INT, "number_of_markers")
.storage_buf(0, Qualifier::READ, "vec2", "marker_positions[]")
.storage_buf(1, Qualifier::READ, "vec4", "marker_colors[]")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_keying_screen.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, smoothness)
PUSH_CONSTANT(INT, number_of_markers)
STORAGE_BUF(0, READ, vec2, marker_positions[])
STORAGE_BUF(1, READ, vec4, marker_colors[])
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_keying_screen.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,68 +5,79 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_shared)
.local_group_size(16, 16)
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_kuwahara_classic.glsl");
LOCAL_GROUP_SIZE(16, 16)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_kuwahara_classic.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_convolution_shared)
.additional_info("compositor_kuwahara_classic_shared")
.sampler(0, ImageType::FLOAT_2D, "input_tx");
ADDITIONAL_INFO(compositor_kuwahara_classic_shared)
SAMPLER(0, FLOAT_2D, input_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_convolution_constant_size)
.additional_info("compositor_kuwahara_classic_convolution_shared")
.push_constant(Type::INT, "size")
.define("CONSTANT_SIZE")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_kuwahara_classic_convolution_shared)
PUSH_CONSTANT(INT, size)
DEFINE("CONSTANT_SIZE")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_convolution_variable_size)
.additional_info("compositor_kuwahara_classic_convolution_shared")
.sampler(1, ImageType::FLOAT_2D, "size_tx")
.define("VARIABLE_SIZE")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_kuwahara_classic_convolution_shared)
SAMPLER(1, FLOAT_2D, size_tx)
DEFINE("VARIABLE_SIZE")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_summed_area_table_shared)
.additional_info("compositor_kuwahara_classic_shared")
.define("SUMMED_AREA_TABLE")
.sampler(0, ImageType::FLOAT_2D, "table_tx")
.sampler(1, ImageType::FLOAT_2D, "squared_table_tx");
ADDITIONAL_INFO(compositor_kuwahara_classic_shared)
DEFINE("SUMMED_AREA_TABLE")
SAMPLER(0, FLOAT_2D, table_tx)
SAMPLER(1, FLOAT_2D, squared_table_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_summed_area_table_constant_size)
.additional_info("compositor_kuwahara_classic_summed_area_table_shared")
.push_constant(Type::INT, "size")
.define("CONSTANT_SIZE")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_kuwahara_classic_summed_area_table_shared)
PUSH_CONSTANT(INT, size)
DEFINE("CONSTANT_SIZE")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_classic_summed_area_table_variable_size)
.additional_info("compositor_kuwahara_classic_summed_area_table_shared")
.sampler(2, ImageType::FLOAT_2D, "size_tx")
.define("VARIABLE_SIZE")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_kuwahara_classic_summed_area_table_shared)
SAMPLER(2, FLOAT_2D, size_tx)
DEFINE("VARIABLE_SIZE")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_anisotropic_compute_structure_tensor)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "structure_tensor_img")
.compute_source("compositor_kuwahara_anisotropic_compute_structure_tensor.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, structure_tensor_img)
COMPUTE_SOURCE("compositor_kuwahara_anisotropic_compute_structure_tensor.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_anisotropic_shared)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "eccentricity")
.push_constant(Type::FLOAT, "sharpness")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "structure_tensor_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_kuwahara_anisotropic.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, eccentricity)
PUSH_CONSTANT(FLOAT, sharpness)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, structure_tensor_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_kuwahara_anisotropic.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_anisotropic_constant_size)
.additional_info("compositor_kuwahara_anisotropic_shared")
.define("CONSTANT_SIZE")
.push_constant(Type::FLOAT, "size")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_kuwahara_anisotropic_shared)
DEFINE("CONSTANT_SIZE")
PUSH_CONSTANT(FLOAT, size)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_kuwahara_anisotropic_variable_size)
.additional_info("compositor_kuwahara_anisotropic_shared")
.define("VARIABLE_SIZE")
.sampler(2, ImageType::FLOAT_2D, "size_tx")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_kuwahara_anisotropic_shared)
DEFINE("VARIABLE_SIZE")
SAMPLER(2, FLOAT_2D, size_tx)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,18 +5,21 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_map_uv_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "uv_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, uv_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_map_uv_anisotropic)
.additional_info("compositor_map_uv_shared")
.push_constant(Type::FLOAT, "gradient_attenuation_factor")
.compute_source("compositor_map_uv_anisotropic.glsl")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_map_uv_shared)
PUSH_CONSTANT(FLOAT, gradient_attenuation_factor)
COMPUTE_SOURCE("compositor_map_uv_anisotropic.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_map_uv_nearest_neighbour)
.additional_info("compositor_map_uv_shared")
.compute_source("compositor_map_uv_nearest_neighbour.glsl")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_map_uv_shared)
COMPUTE_SOURCE("compositor_map_uv_nearest_neighbour.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,17 +5,20 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_morphological_blur_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_R16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "blurred_input_img")
.compute_source("compositor_morphological_blur.glsl");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_R16F, READ_WRITE, FLOAT_2D, blurred_input_img)
COMPUTE_SOURCE("compositor_morphological_blur.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_blur_dilate)
.additional_info("compositor_morphological_blur_shared")
.define("OPERATOR(x, y)", "max(x, y)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_blur_shared)
DEFINE_VALUE("OPERATOR(x, y)", "max(x, y)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_blur_erode)
.additional_info("compositor_morphological_blur_shared")
.define("OPERATOR(x, y)", "min(x, y)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_blur_shared)
DEFINE_VALUE("OPERATOR(x, y)", "min(x, y)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,19 +5,22 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_feather_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_1D, "weights_tx")
.sampler(2, ImageType::FLOAT_1D, "falloffs_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_morphological_distance_feather.glsl");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_1D, weights_tx)
SAMPLER(2, FLOAT_1D, falloffs_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_morphological_distance_feather.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_feather_dilate)
.additional_info("compositor_morphological_distance_feather_shared")
.define("FUNCTION(x)", "x")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_distance_feather_shared)
DEFINE_VALUE("FUNCTION(x)", "x")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_feather_erode)
.additional_info("compositor_morphological_distance_feather_shared")
.define("FUNCTION(x)", "1.0 - x")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_distance_feather_shared)
DEFINE_VALUE("FUNCTION(x)", "1.0 - x")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,20 +5,23 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_shared)
.local_group_size(16, 16)
.push_constant(Type::INT, "radius")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_morphological_distance.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, radius)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_morphological_distance.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_dilate)
.additional_info("compositor_morphological_distance_shared")
.define("OPERATOR(a, b)", "max(a, b)")
.define("LIMIT", "FLT_MIN")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_distance_shared)
DEFINE_VALUE("OPERATOR(a, b)", "max(a, b)")
DEFINE_VALUE("LIMIT", "FLT_MIN")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_erode)
.additional_info("compositor_morphological_distance_shared")
.define("OPERATOR(a, b)", "min(a, b)")
.define("LIMIT", "FLT_MAX")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_distance_shared)
DEFINE_VALUE("OPERATOR(a, b)", "min(a, b)")
DEFINE_VALUE("LIMIT", "FLT_MAX")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_threshold)
.local_group_size(16, 16)
.push_constant(Type::INT, "radius")
.push_constant(Type::INT, "distance")
.push_constant(Type::FLOAT, "inset")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_morphological_distance_threshold.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, radius)
PUSH_CONSTANT(INT, distance)
PUSH_CONSTANT(FLOAT, inset)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_morphological_distance_threshold.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,20 +5,23 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_morphological_step_shared)
.local_group_size(16, 16)
.push_constant(Type::INT, "radius")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_morphological_step.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, radius)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_morphological_step.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_step_dilate)
.additional_info("compositor_morphological_step_shared")
.define("OPERATOR(a, b)", "max(a, b)")
.define("LIMIT", "FLT_MIN")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_step_shared)
DEFINE_VALUE("OPERATOR(a, b)", "max(a, b)")
DEFINE_VALUE("LIMIT", "FLT_MIN")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_morphological_step_erode)
.additional_info("compositor_morphological_step_shared")
.define("OPERATOR(a, b)", "min(a, b)")
.define("LIMIT", "FLT_MAX")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_morphological_step_shared)
DEFINE_VALUE("OPERATOR(a, b)", "min(a, b)")
DEFINE_VALUE("LIMIT", "FLT_MAX")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,22 +5,24 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_motion_blur_max_velocity_dilate)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "shutter_speed")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.storage_buf(0, Qualifier::READ_WRITE, "uint", "tile_indirection_buf[]")
.compute_source("compositor_motion_blur_max_velocity_dilate.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, shutter_speed)
SAMPLER(0, FLOAT_2D, input_tx)
STORAGE_BUF(0, READ_WRITE, uint, tile_indirection_buf[])
COMPUTE_SOURCE("compositor_motion_blur_max_velocity_dilate.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_motion_blur)
.local_group_size(16, 16)
.push_constant(Type::INT, "samples_count")
.push_constant(Type::FLOAT, "shutter_speed")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "depth_tx")
.sampler(2, ImageType::FLOAT_2D, "velocity_tx")
.sampler(3, ImageType::FLOAT_2D, "max_velocity_tx")
.storage_buf(0, Qualifier::READ, "uint", "tile_indirection_buf[]")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_motion_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, samples_count)
PUSH_CONSTANT(FLOAT, shutter_speed)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, depth_tx)
SAMPLER(2, FLOAT_2D, velocity_tx)
SAMPLER(3, FLOAT_2D, max_velocity_tx)
STORAGE_BUF(0, READ, uint, tile_indirection_buf[])
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_motion_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,9 +5,10 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_movie_distortion)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "distortion_grid_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_movie_distortion.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, distortion_grid_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_movie_distortion.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_normalize)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "minimum")
.push_constant(Type::FLOAT, "scale")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_normalize.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, minimum)
PUSH_CONSTANT(FLOAT, scale)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_normalize.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,189 +5,210 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_parallel_reduction_shared)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "is_initial_reduction")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.compute_source("compositor_parallel_reduction.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, is_initial_reduction)
SAMPLER(0, FLOAT_2D, input_tx)
COMPUTE_SOURCE("compositor_parallel_reduction.glsl")
GPU_SHADER_CREATE_END()
/* --------------------------------------------------------------------
* Sum Reductions.
*/
GPU_SHADER_CREATE_INFO(compositor_sum_shared)
.additional_info("compositor_parallel_reduction_shared")
.define("REDUCE(lhs, rhs)", "lhs + rhs");
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
DEFINE_VALUE("REDUCE(lhs, rhs)", "lhs + rhs")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_float_shared)
.additional_info("compositor_sum_shared")
.image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("TYPE", "float")
.define("IDENTITY", "0.0")
.define("LOAD(value)", "value.x");
ADDITIONAL_INFO(compositor_sum_shared)
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "0.0")
DEFINE_VALUE("LOAD(value)", "value.x")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_red)
.additional_info("compositor_sum_float_shared")
.define("INITIALIZE(value)", "value.r")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_float_shared)
DEFINE_VALUE("INITIALIZE(value)", "value.r")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_green)
.additional_info("compositor_sum_float_shared")
.define("INITIALIZE(value)", "value.g")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_float_shared)
DEFINE_VALUE("INITIALIZE(value)", "value.g")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_blue)
.additional_info("compositor_sum_float_shared")
.define("INITIALIZE(value)", "value.b")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_float_shared)
DEFINE_VALUE("INITIALIZE(value)", "value.b")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_luminance)
.additional_info("compositor_sum_float_shared")
.push_constant(Type::VEC3, "luminance_coefficients")
.define("INITIALIZE(value)", "dot(value.rgb, luminance_coefficients)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_float_shared)
PUSH_CONSTANT(VEC3, luminance_coefficients)
DEFINE_VALUE("INITIALIZE(value)", "dot(value.rgb, luminance_coefficients)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_log_luminance)
.additional_info("compositor_sum_float_shared")
.push_constant(Type::VEC3, "luminance_coefficients")
.define("INITIALIZE(value)", "log(max(dot(value.rgb, luminance_coefficients), 1e-5))")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_float_shared)
PUSH_CONSTANT(VEC3, luminance_coefficients)
DEFINE_VALUE("INITIALIZE(value)", "log(max(dot(value.rgb, luminance_coefficients), 1e-5))")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_color)
.additional_info("compositor_sum_shared")
.image(0, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("TYPE", "vec4")
.define("IDENTITY", "vec4(0.0)")
.define("INITIALIZE(value)", "value")
.define("LOAD(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_shared)
IMAGE(0, GPU_RGBA32F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("TYPE", "vec4")
DEFINE_VALUE("IDENTITY", "vec4(0.0)")
DEFINE_VALUE("INITIALIZE(value)", "value")
DEFINE_VALUE("LOAD(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* --------------------------------------------------------------------
* Sum Of Squared Difference Reductions.
*/
GPU_SHADER_CREATE_INFO(compositor_sum_squared_difference_float_shared)
.additional_info("compositor_parallel_reduction_shared")
.image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.push_constant(Type::FLOAT, "subtrahend")
.define("TYPE", "float")
.define("IDENTITY", "0.0")
.define("LOAD(value)", "value.x")
.define("REDUCE(lhs, rhs)", "lhs + rhs");
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
PUSH_CONSTANT(FLOAT, subtrahend)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "0.0")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "lhs + rhs")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_red_squared_difference)
.additional_info("compositor_sum_squared_difference_float_shared")
.define("INITIALIZE(value)", "pow(value.r - subtrahend, 2.0)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_squared_difference_float_shared)
DEFINE_VALUE("INITIALIZE(value)", "pow(value.r - subtrahend, 2.0)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_green_squared_difference)
.additional_info("compositor_sum_squared_difference_float_shared")
.define("INITIALIZE(value)", "pow(value.g - subtrahend, 2.0)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_squared_difference_float_shared)
DEFINE_VALUE("INITIALIZE(value)", "pow(value.g - subtrahend, 2.0)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_blue_squared_difference)
.additional_info("compositor_sum_squared_difference_float_shared")
.define("INITIALIZE(value)", "pow(value.b - subtrahend, 2.0)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_squared_difference_float_shared)
DEFINE_VALUE("INITIALIZE(value)", "pow(value.b - subtrahend, 2.0)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_sum_luminance_squared_difference)
.additional_info("compositor_sum_squared_difference_float_shared")
.push_constant(Type::VEC3, "luminance_coefficients")
.define("INITIALIZE(value)", "pow(dot(value.rgb, luminance_coefficients) - subtrahend, 2.0)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_sum_squared_difference_float_shared)
PUSH_CONSTANT(VEC3, luminance_coefficients)
DEFINE_VALUE("INITIALIZE(value)", "pow(dot(value.rgb, luminance_coefficients) - subtrahend, 2.0)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* --------------------------------------------------------------------
* Maximum Reductions.
*/
GPU_SHADER_CREATE_INFO(compositor_maximum_luminance)
.additional_info("compositor_parallel_reduction_shared")
.typedef_source("common_math_lib.glsl")
.image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.push_constant(Type::VEC3, "luminance_coefficients")
.define("TYPE", "float")
.define("IDENTITY", "FLT_MIN")
.define("INITIALIZE(value)", "dot(value.rgb, luminance_coefficients)")
.define("LOAD(value)", "value.x")
.define("REDUCE(lhs, rhs)", "max(lhs, rhs)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
TYPEDEF_SOURCE("common_math_lib.glsl")
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
PUSH_CONSTANT(VEC3, luminance_coefficients)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "FLT_MIN")
DEFINE_VALUE("INITIALIZE(value)", "dot(value.rgb, luminance_coefficients)")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "max(lhs, rhs)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_maximum_float)
.additional_info("compositor_parallel_reduction_shared")
.typedef_source("common_math_lib.glsl")
.image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("TYPE", "float")
.define("IDENTITY", "FLT_MIN")
.define("INITIALIZE(value)", "value.x")
.define("LOAD(value)", "value.x")
.define("REDUCE(lhs, rhs)", "max(rhs, lhs)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
TYPEDEF_SOURCE("common_math_lib.glsl")
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "FLT_MIN")
DEFINE_VALUE("INITIALIZE(value)", "value.x")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "max(rhs, lhs)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
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", "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);
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
PUSH_CONSTANT(FLOAT, lower_bound)
PUSH_CONSTANT(FLOAT, upper_bound)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "lower_bound")
DEFINE_VALUE("INITIALIZE(v)", "((v.x <= upper_bound) && (v.x >= lower_bound)) ? v.x : lower_bound")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "((rhs > lhs) && (rhs <= upper_bound)) ? rhs : lhs")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* --------------------------------------------------------------------
* Minimum Reductions.
*/
GPU_SHADER_CREATE_INFO(compositor_minimum_luminance)
.additional_info("compositor_parallel_reduction_shared")
.typedef_source("common_math_lib.glsl")
.image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.push_constant(Type::VEC3, "luminance_coefficients")
.define("TYPE", "float")
.define("IDENTITY", "FLT_MAX")
.define("INITIALIZE(value)", "dot(value.rgb, luminance_coefficients)")
.define("LOAD(value)", "value.x")
.define("REDUCE(lhs, rhs)", "min(lhs, rhs)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
TYPEDEF_SOURCE("common_math_lib.glsl")
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
PUSH_CONSTANT(VEC3, luminance_coefficients)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "FLT_MAX")
DEFINE_VALUE("INITIALIZE(value)", "dot(value.rgb, luminance_coefficients)")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "min(lhs, rhs)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_minimum_float)
.additional_info("compositor_parallel_reduction_shared")
.typedef_source("common_math_lib.glsl")
.image(0, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("TYPE", "float")
.define("IDENTITY", "FLT_MAX")
.define("INITIALIZE(value)", "value.x")
.define("LOAD(value)", "value.x")
.define("REDUCE(lhs, rhs)", "min(rhs, lhs)")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
TYPEDEF_SOURCE("common_math_lib.glsl")
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "FLT_MAX")
DEFINE_VALUE("INITIALIZE(value)", "value.x")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "min(rhs, lhs)")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
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", "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);
ADDITIONAL_INFO(compositor_parallel_reduction_shared)
IMAGE(0, GPU_R32F, WRITE, FLOAT_2D, output_img)
PUSH_CONSTANT(FLOAT, lower_bound)
PUSH_CONSTANT(FLOAT, upper_bound)
DEFINE_VALUE("TYPE", "float")
DEFINE_VALUE("IDENTITY", "upper_bound")
DEFINE_VALUE("INITIALIZE(v)", "((v.x <= upper_bound) && (v.x >= lower_bound)) ? v.x : upper_bound")
DEFINE_VALUE("LOAD(value)", "value.x")
DEFINE_VALUE("REDUCE(lhs, rhs)", "((rhs < lhs) && (rhs >= lower_bound)) ? rhs : lhs")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
/* --------------------------------------------------------------------
* Velocity Reductions.
*/
GPU_SHADER_CREATE_INFO(compositor_max_velocity)
.local_group_size(32, 32)
.push_constant(Type::BOOL, "is_initial_reduction")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("TYPE", "vec4")
.define("IDENTITY", "vec4(0.0)")
.define("INITIALIZE(value)", "value")
.define("LOAD(value)", "value")
.define("REDUCE(lhs, rhs)",
"vec4(dot(lhs.xy, lhs.xy) > dot(rhs.xy, rhs.xy) ? lhs.xy : rhs.xy,"
" dot(lhs.zw, lhs.zw) > dot(rhs.zw, rhs.zw) ? lhs.zw : rhs.zw)")
.compute_source("compositor_parallel_reduction.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(32, 32)
PUSH_CONSTANT(BOOL, is_initial_reduction)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("TYPE", "vec4")
DEFINE_VALUE("IDENTITY", "vec4(0.0)")
DEFINE_VALUE("INITIALIZE(value)", "value")
DEFINE_VALUE("LOAD(value)", "value")
DEFINE_VALUE("REDUCE(lhs, rhs)",
"vec4(dot(lhs.xy, lhs.xy) > dot(rhs.xy, rhs.xy) ? lhs.xy : rhs.xy,"
" dot(lhs.zw, lhs.zw) > dot(rhs.zw, rhs.zw) ? lhs.zw : rhs.zw)")
COMPUTE_SOURCE("compositor_parallel_reduction.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,9 +5,10 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_pixelate)
.local_group_size(16, 16)
.push_constant(Type::INT, "pixel_size")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_pixelate.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, pixel_size)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_pixelate.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,35 +5,39 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_plane_deform_mask)
.local_group_size(16, 16)
.push_constant(Type::MAT4, "homography_matrix")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "mask_img")
.compute_source("compositor_plane_deform_mask.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(MAT4, homography_matrix)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, mask_img)
COMPUTE_SOURCE("compositor_plane_deform_mask.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_plane_deform)
.local_group_size(16, 16)
.push_constant(Type::MAT4, "homography_matrix")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "mask_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_plane_deform.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(MAT4, homography_matrix)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, mask_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_plane_deform.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_plane_deform_motion_blur_mask)
.local_group_size(16, 16)
.push_constant(Type::INT, "number_of_motion_blur_samples")
.uniform_buf(0, "mat4", "homography_matrices[64]")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "mask_img")
.compute_source("compositor_plane_deform_motion_blur_mask.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, number_of_motion_blur_samples)
UNIFORM_BUF(0, mat4, homography_matrices[64])
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, mask_img)
COMPUTE_SOURCE("compositor_plane_deform_motion_blur_mask.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_plane_deform_motion_blur)
.local_group_size(16, 16)
.push_constant(Type::INT, "number_of_motion_blur_samples")
.uniform_buf(0, "mat4", "homography_matrices[64]")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "mask_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_plane_deform_motion_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(INT, number_of_motion_blur_samples)
UNIFORM_BUF(0, mat4, homography_matrices[64])
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, mask_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_plane_deform_motion_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,8 +5,9 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_premultiply_alpha)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_premultiply_alpha.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_premultiply_alpha.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,9 +5,10 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_projector_lens_distortion)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "dispersion")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_projector_lens_distortion.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, dispersion)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_projector_lens_distortion.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,31 +5,36 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_read_input_shared)
.local_group_size(16, 16)
.push_constant(Type::IVEC2, "lower_bound")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.compute_source("compositor_read_input.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(IVEC2, lower_bound)
SAMPLER(0, FLOAT_2D, input_tx)
COMPUTE_SOURCE("compositor_read_input.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_read_input_float)
.additional_info("compositor_read_input_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("READ_EXPRESSION(input_color)", "vec4(input_color.r, vec3(0.0))")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_read_input_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("READ_EXPRESSION(input_color)", "vec4(input_color.r, vec3(0.0))")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_read_input_vector)
.additional_info("compositor_read_input_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("READ_EXPRESSION(input_color)", "input_color")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_read_input_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("READ_EXPRESSION(input_color)", "input_color")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_read_input_color)
.additional_info("compositor_read_input_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("READ_EXPRESSION(input_color)", "input_color")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_read_input_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("READ_EXPRESSION(input_color)", "input_color")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_read_input_alpha)
.additional_info("compositor_read_input_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.define("READ_EXPRESSION(input_color)", "vec4(input_color.a, vec3(0.0))")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_read_input_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DEFINE_VALUE("READ_EXPRESSION(input_color)", "vec4(input_color.a, vec3(0.0))")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,45 +5,54 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_shared)
.local_group_size(16, 16)
.push_constant(Type::MAT4, "inverse_transformation")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.compute_source("compositor_realize_on_domain.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(MAT4, inverse_transformation)
SAMPLER(0, FLOAT_2D, input_tx)
COMPUTE_SOURCE("compositor_realize_on_domain.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_standard_shared)
.additional_info("compositor_realize_on_domain_shared")
.define("SAMPLER_FUNCTION", "texture");
ADDITIONAL_INFO(compositor_realize_on_domain_shared)
DEFINE_VALUE("SAMPLER_FUNCTION", "texture")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_bicubic_shared)
.additional_info("compositor_realize_on_domain_shared")
.define("SAMPLER_FUNCTION", "texture_bicubic");
ADDITIONAL_INFO(compositor_realize_on_domain_shared)
DEFINE_VALUE("SAMPLER_FUNCTION", "texture_bicubic")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_color)
.additional_info("compositor_realize_on_domain_standard_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "domain_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_realize_on_domain_standard_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, domain_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_vector)
.additional_info("compositor_realize_on_domain_standard_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "domain_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_realize_on_domain_standard_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, domain_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_float)
.additional_info("compositor_realize_on_domain_standard_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "domain_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_realize_on_domain_standard_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, domain_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_bicubic_color)
.additional_info("compositor_realize_on_domain_bicubic_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "domain_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_realize_on_domain_bicubic_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, domain_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_bicubic_vector)
.additional_info("compositor_realize_on_domain_bicubic_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "domain_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_realize_on_domain_bicubic_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, domain_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_realize_on_domain_bicubic_float)
.additional_info("compositor_realize_on_domain_bicubic_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "domain_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_realize_on_domain_bicubic_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, domain_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_scale_variable)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "x_scale_tx")
.sampler(2, ImageType::FLOAT_2D, "y_scale_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_scale_variable.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, x_scale_tx)
SAMPLER(2, FLOAT_2D, y_scale_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_scale_variable.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,18 +5,21 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_screen_lens_distortion_shared)
.local_group_size(16, 16)
.push_constant(Type::VEC3, "chromatic_distortion")
.push_constant(Type::FLOAT, "scale")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_screen_lens_distortion.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(VEC3, chromatic_distortion)
PUSH_CONSTANT(FLOAT, scale)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_screen_lens_distortion.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_screen_lens_distortion)
.additional_info("compositor_screen_lens_distortion_shared")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_screen_lens_distortion_shared)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_screen_lens_distortion_jitter)
.additional_info("compositor_screen_lens_distortion_shared")
.define("JITTER")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_screen_lens_distortion_shared)
DEFINE("JITTER")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,55 +5,61 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_smaa_edge_detection)
.local_group_size(16, 16)
.define("SMAA_GLSL_3")
.define("SMAA_RT_METRICS",
"vec4(1.0 / vec2(textureSize(input_tx, 0)), vec2(textureSize(input_tx, 0)))")
.define("SMAA_LUMA_WEIGHT", "vec4(luminance_coefficients, 0.0)")
.define("SMAA_THRESHOLD", "smaa_threshold")
.define("SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR", "smaa_local_contrast_adaptation_factor")
.push_constant(Type::VEC3, "luminance_coefficients")
.push_constant(Type::FLOAT, "smaa_threshold")
.push_constant(Type::FLOAT, "smaa_local_contrast_adaptation_factor")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "edges_img")
.compute_source("compositor_smaa_edge_detection.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
DEFINE("SMAA_GLSL_3")
DEFINE_VALUE("SMAA_RT_METRICS",
"vec4(1.0 / vec2(textureSize(input_tx, 0)), vec2(textureSize(input_tx, 0)))")
DEFINE_VALUE("SMAA_LUMA_WEIGHT", "vec4(luminance_coefficients, 0.0)")
DEFINE_VALUE("SMAA_THRESHOLD", "smaa_threshold")
DEFINE_VALUE("SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR", "smaa_local_contrast_adaptation_factor")
PUSH_CONSTANT(VEC3, luminance_coefficients)
PUSH_CONSTANT(FLOAT, smaa_threshold)
PUSH_CONSTANT(FLOAT, smaa_local_contrast_adaptation_factor)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, edges_img)
COMPUTE_SOURCE("compositor_smaa_edge_detection.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_smaa_blending_weight_calculation)
.local_group_size(16, 16)
.define("SMAA_GLSL_3")
.define("SMAA_RT_METRICS",
"vec4(1.0 / vec2(textureSize(edges_tx, 0)), vec2(textureSize(edges_tx, 0)))")
.define("SMAA_CORNER_ROUNDING", "smaa_corner_rounding")
.push_constant(Type::INT, "smaa_corner_rounding")
.sampler(0, ImageType::FLOAT_2D, "edges_tx")
.sampler(1, ImageType::FLOAT_2D, "area_tx")
.sampler(2, ImageType::FLOAT_2D, "search_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "weights_img")
.compute_source("compositor_smaa_blending_weight_calculation.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
DEFINE("SMAA_GLSL_3")
DEFINE_VALUE("SMAA_RT_METRICS",
"vec4(1.0 / vec2(textureSize(edges_tx, 0)), vec2(textureSize(edges_tx, 0)))")
DEFINE_VALUE("SMAA_CORNER_ROUNDING", "smaa_corner_rounding")
PUSH_CONSTANT(INT, smaa_corner_rounding)
SAMPLER(0, FLOAT_2D, edges_tx)
SAMPLER(1, FLOAT_2D, area_tx)
SAMPLER(2, FLOAT_2D, search_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, weights_img)
COMPUTE_SOURCE("compositor_smaa_blending_weight_calculation.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_shared)
.local_group_size(16, 16)
.define("SMAA_GLSL_3")
.define("SMAA_RT_METRICS",
"vec4(1.0 / vec2(textureSize(input_tx, 0)), vec2(textureSize(input_tx, 0)))")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "weights_tx")
.compute_source("compositor_smaa_neighborhood_blending.glsl");
LOCAL_GROUP_SIZE(16, 16)
DEFINE("SMAA_GLSL_3")
DEFINE_VALUE("SMAA_RT_METRICS",
"vec4(1.0 / vec2(textureSize(input_tx, 0)), vec2(textureSize(input_tx, 0)))")
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, weights_tx)
COMPUTE_SOURCE("compositor_smaa_neighborhood_blending.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_float4)
.additional_info("compositor_smaa_neighborhood_blending_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_smaa_neighborhood_blending_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_float2)
.additional_info("compositor_smaa_neighborhood_blending_shared")
.image(0, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_smaa_neighborhood_blending_shared)
IMAGE(0, GPU_RG16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_smaa_neighborhood_blending_float)
.additional_info("compositor_smaa_neighborhood_blending_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_smaa_neighborhood_blending_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,19 +5,22 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_split_shared)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "split_ratio")
.sampler(0, ImageType::FLOAT_2D, "first_image_tx")
.sampler(1, ImageType::FLOAT_2D, "second_image_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_split.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, split_ratio)
SAMPLER(0, FLOAT_2D, first_image_tx)
SAMPLER(1, FLOAT_2D, second_image_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_split.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_split_horizontal)
.additional_info("compositor_split_shared")
.define("SPLIT_HORIZONTAL")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_split_shared)
DEFINE("SPLIT_HORIZONTAL")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_split_vertical)
.additional_info("compositor_split_shared")
.define("SPLIT_VERTICAL")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_split_shared)
DEFINE("SPLIT_VERTICAL")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,52 +5,60 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_incomplete_prologues_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "incomplete_x_prologues_img")
.image(1, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "incomplete_y_prologues_img")
.compute_source("compositor_summed_area_table_compute_incomplete_prologues.glsl");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA32F, WRITE, FLOAT_2D, incomplete_x_prologues_img)
IMAGE(1, GPU_RGBA32F, WRITE, FLOAT_2D, incomplete_y_prologues_img)
COMPUTE_SOURCE("compositor_summed_area_table_compute_incomplete_prologues.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_incomplete_prologues_identity)
.additional_info("compositor_summed_area_table_compute_incomplete_prologues_shared")
.define("OPERATION(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_summed_area_table_compute_incomplete_prologues_shared)
DEFINE_VALUE("OPERATION(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_incomplete_prologues_square)
.additional_info("compositor_summed_area_table_compute_incomplete_prologues_shared")
.define("OPERATION(value)", "value * value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_summed_area_table_compute_incomplete_prologues_shared)
DEFINE_VALUE("OPERATION(value)", "value * value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_complete_x_prologues)
.local_group_size(16)
.sampler(0, ImageType::FLOAT_2D, "incomplete_x_prologues_tx")
.image(0, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "complete_x_prologues_img")
.image(1, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "complete_x_prologues_sum_img")
.compute_source("compositor_summed_area_table_compute_complete_x_prologues.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16)
SAMPLER(0, FLOAT_2D, incomplete_x_prologues_tx)
IMAGE(0, GPU_RGBA32F, WRITE, FLOAT_2D, complete_x_prologues_img)
IMAGE(1, GPU_RGBA32F, WRITE, FLOAT_2D, complete_x_prologues_sum_img)
COMPUTE_SOURCE("compositor_summed_area_table_compute_complete_x_prologues.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_complete_y_prologues)
.local_group_size(16)
.sampler(0, ImageType::FLOAT_2D, "incomplete_y_prologues_tx")
.sampler(1, ImageType::FLOAT_2D, "complete_x_prologues_sum_tx")
.image(0, GPU_RGBA32F, Qualifier::WRITE, ImageType::FLOAT_2D, "complete_y_prologues_img")
.compute_source("compositor_summed_area_table_compute_complete_y_prologues.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16)
SAMPLER(0, FLOAT_2D, incomplete_y_prologues_tx)
SAMPLER(1, FLOAT_2D, complete_x_prologues_sum_tx)
IMAGE(0, GPU_RGBA32F, WRITE, FLOAT_2D, complete_y_prologues_img)
COMPUTE_SOURCE("compositor_summed_area_table_compute_complete_y_prologues.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_complete_blocks_shared)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "complete_x_prologues_tx")
.sampler(2, ImageType::FLOAT_2D, "complete_y_prologues_tx")
.image(0, GPU_RGBA32F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_summed_area_table_compute_complete_blocks.glsl");
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, complete_x_prologues_tx)
SAMPLER(2, FLOAT_2D, complete_y_prologues_tx)
IMAGE(0, GPU_RGBA32F, READ_WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_summed_area_table_compute_complete_blocks.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_complete_blocks_identity)
.additional_info("compositor_summed_area_table_compute_complete_blocks_shared")
.define("OPERATION(value)", "value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_summed_area_table_compute_complete_blocks_shared)
DEFINE_VALUE("OPERATION(value)", "value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_summed_area_table_compute_complete_blocks_square)
.additional_info("compositor_summed_area_table_compute_complete_blocks_shared")
.define("OPERATION(value)", "value * value")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_summed_area_table_compute_complete_blocks_shared)
DEFINE_VALUE("OPERATION(value)", "value * value")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,10 +5,11 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_sun_beams)
.local_group_size(16, 16)
.push_constant(Type::VEC2, "source")
.push_constant(Type::INT, "max_steps")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_sun_beams.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(VEC2, source)
PUSH_CONSTANT(INT, max_steps)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_sun_beams.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_symmetric_blur)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "extend_bounds")
.push_constant(Type::BOOL, "gamma_correct")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "weights_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_symmetric_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, extend_bounds)
PUSH_CONSTANT(BOOL, gamma_correct)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, weights_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_symmetric_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,12 +5,13 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_symmetric_blur_variable_size)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "extend_bounds")
.push_constant(Type::BOOL, "gamma_correct")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_2D, "weights_tx")
.sampler(2, ImageType::FLOAT_2D, "size_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_symmetric_blur_variable_size.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, extend_bounds)
PUSH_CONSTANT(BOOL, gamma_correct)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_2D, weights_tx)
SAMPLER(2, FLOAT_2D, size_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_symmetric_blur_variable_size.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,25 +5,29 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_shared)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "extend_bounds")
.push_constant(Type::BOOL, "gamma_correct_input")
.push_constant(Type::BOOL, "gamma_uncorrect_output")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_1D, "weights_tx")
.compute_source("compositor_symmetric_separable_blur.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, extend_bounds)
PUSH_CONSTANT(BOOL, gamma_correct_input)
PUSH_CONSTANT(BOOL, gamma_uncorrect_output)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_1D, weights_tx)
COMPUTE_SOURCE("compositor_symmetric_separable_blur.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_float)
.additional_info("compositor_symmetric_separable_blur_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_symmetric_separable_blur_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_float2)
.additional_info("compositor_symmetric_separable_blur_shared")
.image(0, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_symmetric_separable_blur_shared)
IMAGE(0, GPU_RG16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_float4)
.additional_info("compositor_symmetric_separable_blur_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_symmetric_separable_blur_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,24 +5,28 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_variable_size_shared)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "is_vertical_pass")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.sampler(1, ImageType::FLOAT_1D, "weights_tx")
.sampler(2, ImageType::FLOAT_2D, "radius_tx")
.compute_source("compositor_symmetric_separable_blur_variable_size.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, is_vertical_pass)
SAMPLER(0, FLOAT_2D, input_tx)
SAMPLER(1, FLOAT_1D, weights_tx)
SAMPLER(2, FLOAT_2D, radius_tx)
COMPUTE_SOURCE("compositor_symmetric_separable_blur_variable_size.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_variable_size_float)
.additional_info("compositor_symmetric_separable_blur_variable_size_shared")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_symmetric_separable_blur_variable_size_shared)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_variable_size_float2)
.additional_info("compositor_symmetric_separable_blur_variable_size_shared")
.image(0, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_symmetric_separable_blur_variable_size_shared)
IMAGE(0, GPU_RG16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_symmetric_separable_blur_variable_size_float4)
.additional_info("compositor_symmetric_separable_blur_variable_size_shared")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_symmetric_separable_blur_variable_size_shared)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,14 +5,15 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_tone_map_photoreceptor)
.local_group_size(16, 16)
.push_constant(Type::VEC4, "global_adaptation_level")
.push_constant(Type::FLOAT, "contrast")
.push_constant(Type::FLOAT, "intensity")
.push_constant(Type::FLOAT, "chromatic_adaptation")
.push_constant(Type::FLOAT, "light_adaptation")
.push_constant(Type::VEC3, "luminance_coefficients")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_tone_map_photoreceptor.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(VEC4, global_adaptation_level)
PUSH_CONSTANT(FLOAT, contrast)
PUSH_CONSTANT(FLOAT, intensity)
PUSH_CONSTANT(FLOAT, chromatic_adaptation)
PUSH_CONSTANT(FLOAT, light_adaptation)
PUSH_CONSTANT(VEC3, luminance_coefficients)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_tone_map_photoreceptor.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,11 +5,12 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_tone_map_simple)
.local_group_size(16, 16)
.push_constant(Type::FLOAT, "luminance_scale")
.push_constant(Type::FLOAT, "luminance_scale_blend_factor")
.push_constant(Type::FLOAT, "inverse_gamma")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_tone_map_simple.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(FLOAT, luminance_scale)
PUSH_CONSTANT(FLOAT, luminance_scale_blend_factor)
PUSH_CONSTANT(FLOAT, inverse_gamma)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_tone_map_simple.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,31 +5,33 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_van_vliet_gaussian_blur)
.local_group_size(64, 4)
.push_constant(Type::VEC2, "first_feedback_coefficients")
.push_constant(Type::VEC2, "first_causal_feedforward_coefficients")
.push_constant(Type::VEC2, "first_non_causal_feedforward_coefficients")
.push_constant(Type::VEC2, "second_feedback_coefficients")
.push_constant(Type::VEC2, "second_causal_feedforward_coefficients")
.push_constant(Type::VEC2, "second_non_causal_feedforward_coefficients")
.push_constant(Type::FLOAT, "first_causal_boundary_coefficient")
.push_constant(Type::FLOAT, "first_non_causal_boundary_coefficient")
.push_constant(Type::FLOAT, "second_causal_boundary_coefficient")
.push_constant(Type::FLOAT, "second_non_causal_boundary_coefficient")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "first_causal_output_img")
.image(1, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "first_non_causal_output_img")
.image(2, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "second_causal_output_img")
.image(3, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "second_non_causal_output_img")
.compute_source("compositor_van_vliet_gaussian_blur.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(64, 4)
PUSH_CONSTANT(VEC2, first_feedback_coefficients)
PUSH_CONSTANT(VEC2, first_causal_feedforward_coefficients)
PUSH_CONSTANT(VEC2, first_non_causal_feedforward_coefficients)
PUSH_CONSTANT(VEC2, second_feedback_coefficients)
PUSH_CONSTANT(VEC2, second_causal_feedforward_coefficients)
PUSH_CONSTANT(VEC2, second_non_causal_feedforward_coefficients)
PUSH_CONSTANT(FLOAT, first_causal_boundary_coefficient)
PUSH_CONSTANT(FLOAT, first_non_causal_boundary_coefficient)
PUSH_CONSTANT(FLOAT, second_causal_boundary_coefficient)
PUSH_CONSTANT(FLOAT, second_non_causal_boundary_coefficient)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, first_causal_output_img)
IMAGE(1, GPU_RGBA16F, WRITE, FLOAT_2D, first_non_causal_output_img)
IMAGE(2, GPU_RGBA16F, WRITE, FLOAT_2D, second_causal_output_img)
IMAGE(3, GPU_RGBA16F, WRITE, FLOAT_2D, second_non_causal_output_img)
COMPUTE_SOURCE("compositor_van_vliet_gaussian_blur.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_van_vliet_gaussian_blur_sum)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "first_causal_input_tx")
.sampler(1, ImageType::FLOAT_2D, "first_non_causal_input_tx")
.sampler(2, ImageType::FLOAT_2D, "second_causal_input_tx")
.sampler(3, ImageType::FLOAT_2D, "second_non_causal_input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_van_vliet_gaussian_blur_sum.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, first_causal_input_tx)
SAMPLER(1, FLOAT_2D, first_non_causal_input_tx)
SAMPLER(2, FLOAT_2D, second_causal_input_tx)
SAMPLER(3, FLOAT_2D, second_non_causal_input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_van_vliet_gaussian_blur_sum.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,25 +5,29 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_write_output_shared)
.local_group_size(16, 16)
.push_constant(Type::IVEC2, "lower_bound")
.push_constant(Type::IVEC2, "upper_bound")
.sampler(0, ImageType::FLOAT_2D, "input_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
.compute_source("compositor_write_output.glsl");
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(IVEC2, lower_bound)
PUSH_CONSTANT(IVEC2, upper_bound)
SAMPLER(0, FLOAT_2D, input_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, output_img)
COMPUTE_SOURCE("compositor_write_output.glsl")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_write_output)
.additional_info("compositor_write_output_shared")
.define("DIRECT_OUTPUT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_write_output_shared)
DEFINE("DIRECT_OUTPUT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_write_output_opaque)
.additional_info("compositor_write_output_shared")
.define("OPAQUE_OUTPUT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_write_output_shared)
DEFINE("OPAQUE_OUTPUT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_write_output_alpha)
.additional_info("compositor_write_output_shared")
.sampler(1, ImageType::FLOAT_2D, "alpha_tx")
.define("ALPHA_OUTPUT")
.do_static_compilation(true);
ADDITIONAL_INFO(compositor_write_output_shared)
SAMPLER(1, FLOAT_2D, alpha_tx)
DEFINE("ALPHA_OUTPUT")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -5,34 +5,37 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(compositor_z_combine_simple)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "use_alpha")
.sampler(0, ImageType::FLOAT_2D, "first_tx")
.sampler(1, ImageType::FLOAT_2D, "first_z_tx")
.sampler(2, ImageType::FLOAT_2D, "second_tx")
.sampler(3, ImageType::FLOAT_2D, "second_z_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "combined_img")
.image(1, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "combined_z_img")
.compute_source("compositor_z_combine_simple.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, use_alpha)
SAMPLER(0, FLOAT_2D, first_tx)
SAMPLER(1, FLOAT_2D, first_z_tx)
SAMPLER(2, FLOAT_2D, second_tx)
SAMPLER(3, FLOAT_2D, second_z_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, combined_img)
IMAGE(1, GPU_R16F, WRITE, FLOAT_2D, combined_z_img)
COMPUTE_SOURCE("compositor_z_combine_simple.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_z_combine_compute_mask)
.local_group_size(16, 16)
.sampler(0, ImageType::FLOAT_2D, "first_z_tx")
.sampler(1, ImageType::FLOAT_2D, "second_z_tx")
.image(0, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "mask_img")
.compute_source("compositor_z_combine_compute_mask.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
SAMPLER(0, FLOAT_2D, first_z_tx)
SAMPLER(1, FLOAT_2D, second_z_tx)
IMAGE(0, GPU_R16F, WRITE, FLOAT_2D, mask_img)
COMPUTE_SOURCE("compositor_z_combine_compute_mask.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(compositor_z_combine_from_mask)
.local_group_size(16, 16)
.push_constant(Type::BOOL, "use_alpha")
.sampler(0, ImageType::FLOAT_2D, "first_tx")
.sampler(1, ImageType::FLOAT_2D, "first_z_tx")
.sampler(2, ImageType::FLOAT_2D, "second_tx")
.sampler(3, ImageType::FLOAT_2D, "second_z_tx")
.sampler(4, ImageType::FLOAT_2D, "mask_tx")
.image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "combined_img")
.image(1, GPU_R16F, Qualifier::WRITE, ImageType::FLOAT_2D, "combined_z_img")
.compute_source("compositor_z_combine_from_mask.glsl")
.do_static_compilation(true);
LOCAL_GROUP_SIZE(16, 16)
PUSH_CONSTANT(BOOL, use_alpha)
SAMPLER(0, FLOAT_2D, first_tx)
SAMPLER(1, FLOAT_2D, first_z_tx)
SAMPLER(2, FLOAT_2D, second_tx)
SAMPLER(3, FLOAT_2D, second_z_tx)
SAMPLER(4, FLOAT_2D, mask_tx)
IMAGE(0, GPU_RGBA16F, WRITE, FLOAT_2D, combined_img)
IMAGE(1, GPU_R16F, WRITE, FLOAT_2D, combined_z_img)
COMPUTE_SOURCE("compositor_z_combine_from_mask.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()

View File

@ -9,6 +9,7 @@
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(gpu_clip_planes)
.uniform_buf(1, "GPUClipPlanes", "clipPlanes", Frequency::PASS)
.typedef_source("GPU_shader_shared.hh")
.define("USE_WORLD_CLIP_PLANES");
UNIFORM_BUF_FREQ(1, GPUClipPlanes, clipPlanes, PASS)
TYPEDEF_SOURCE("GPU_shader_shared.hh")
DEFINE("USE_WORLD_CLIP_PLANES")
GPU_SHADER_CREATE_END()