27 return "compositor_symmetric_separable_blur_variable_size_float";
29 return "compositor_symmetric_separable_blur_variable_size_float2";
32 return "compositor_symmetric_separable_blur_variable_size_float4";
53 input.bind_as_texture(shader,
"input_tx");
56 context.cache_manager().symmetric_separable_blur_weights.get(
57 context, filter_type, weights_resolution);
60 radius.bind_as_texture(shader,
"radius_tx");
70 Domain domain = input.domain();
71 const int2 transposed_domain =
int2(domain.size.y, domain.size.x);
73 Result output = context.create_result(input.type());
75 output.bind_as_image(shader,
"output_img");
80 input.unbind_as_texture();
82 radius.unbind_as_texture();
83 output.unbind_as_image();
90 Result &horizontal_pass_result,
94 int weights_resolution)
104 context.cache_manager().symmetric_separable_blur_weights.get(
105 context, filter_type, weights_resolution);
108 radius.bind_as_texture(shader,
"radius_tx");
111 output.allocate_texture(domain);
112 output.bind_as_image(shader,
"output_img");
120 output.unbind_as_image();
122 radius.unbind_as_texture();
130 int weights_resolution)
133 context, input, radius, filter_type, weights_resolution);
135 context, input, horizontal_pass_result, output, radius, filter_type, weights_resolution);
136 horizontal_pass_result.
release();
#define BLI_assert_unreachable()
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value)
struct GPUShader GPUShader
void unbind_as_texture() const
const Domain & domain() const
void allocate_texture(Domain domain, bool from_pool=true)
static ResultType type(eGPUTextureFormat format)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
void unbind_as_texture() const
void bind_as_texture(GPUShader *shader, const char *texture_name) const
static const char * get_blur_shader(ResultType type)
void symmetric_separable_blur_variable_size(Context &context, Result &input, Result &output, Result &radius, int filter_type=R_FILTER_GAUSS, int weights_resolution=128)
static void vertical_pass(Context &context, Result &original_input, Result &horizontal_pass_result, Result &output, int distance, int falloff_type)
static Result horizontal_pass(Context &context, Result &input, int distance, int falloff_type)
void compute_dispatch_threads_at_least(GPUShader *shader, int2 threads_range, int2 local_size=int2(16))
VecBase< int32_t, 2 > int2