37 GPUShader *shader = context.get_shader(
"compositor_deriche_gaussian_blur_sum");
44 const int2 transposed_domain =
int2(domain.size.y, domain.size.x);
45 output.allocate_texture(transposed_domain);
46 output.bind_as_image(shader,
"output_img");
53 output.unbind_as_image();
58 GPUShader *shader = context.get_shader(
"compositor_deriche_gaussian_blur");
62 context.cache_manager().deriche_gaussian_coefficients.get(context, sigma);
65 "causal_feedforward_coefficients",
68 "non_causal_feedforward_coefficients",
75 "non_causal_boundary_coefficient",
78 input.bind_as_texture(shader,
"input_tx");
80 const Domain domain = input.domain();
88 non_causal_result.
bind_as_image(shader,
"non_causal_output_img");
95 input.unbind_as_texture();
107 "Deriche filter is slower and less accurate than direct convolution for sigma "
108 "values less 3. Use direct convolution blur instead.");
110 "Deriche filter is not accurate nor numerically stable for sigma values larger "
111 "than 32. Use Van Vliet filter instead.");
114 blur_pass(context, input, horizontal_pass_result, sigma.x);
115 blur_pass(context, horizontal_pass_result, output, sigma.y);
116 horizontal_pass_result.
release();
#define BLI_assert_msg(a, msg)
void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value)
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_uniform_4fv(GPUShader *sh, const char *name, const float data[4])
struct GPUShader GPUShader
double causal_boundary_coefficient() const
const double4 & non_causal_feedforward_coefficients() const
const double4 & causal_feedforward_coefficients() const
const double4 & feedback_coefficients() const
double non_causal_boundary_coefficient() const
void bind_as_image(GPUShader *shader, const char *image_name, bool read=false) const
void unbind_as_texture() const
const Domain & domain() const
void unbind_as_image() const
void allocate_texture(Domain domain, bool from_pool=true)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
T reduce_max(const VecBase< T, Size > &a)
static void blur_pass(Context &context, Result &input, Result &output, float sigma)
static void sum_causal_and_non_causal_results(Context &context, Result &causal_input, Result &non_causal_input, Result &output)
void deriche_gaussian_blur(Context &context, Result &input, Result &output, float2 sigma)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2