36 GPUTexture *texture_to_reduce =
texture;
40 while (size_to_reduce !=
int2(1)) {
42 GPUTexture *reduced_texture = context.texture_pool().acquire(reduced_size,
format);
58 if (texture_to_reduce != texture) {
59 context.texture_pool().release(texture_to_reduce);
62 texture_to_reduce = reduced_texture;
63 size_to_reduce = reduced_size;
73 if (texture_to_reduce != texture) {
74 context.texture_pool().release(texture_to_reduce);
94 const float sum = *reduced_value;
111 const float sum = *reduced_value;
128 const float sum = *reduced_value;
147 const float sum = *reduced_value;
166 const float sum = *reduced_value;
196 GPUShader *shader = context.get_shader(
"compositor_sum_red_squared_difference",
207 const float sum = *reduced_value;
216 GPUShader *shader = context.get_shader(
"compositor_sum_green_squared_difference",
227 const float sum = *reduced_value;
236 GPUShader *shader = context.get_shader(
"compositor_sum_blue_squared_difference",
247 const float sum = *reduced_value;
256 float3 luminance_coefficients,
259 GPUShader *shader = context.get_shader(
"compositor_sum_luminance_squared_difference",
271 const float sum = *reduced_value;
294 const float maximum = *reduced_value;
311 const float maximum = *reduced_value;
323 GPUShader *shader = context.get_shader(
"compositor_maximum_float_in_range",
335 const float maximum = *reduced_value;
358 const float minimum = *reduced_value;
375 const float minimum = *reduced_value;
387 GPUShader *shader = context.get_shader(
"compositor_minimum_float_in_range",
399 const float minimum = *reduced_value;
void GPU_compute_dispatch(GPUShader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len)
int GPU_shader_get_sampler_binding(GPUShader *shader, const char *name)
void GPU_shader_uniform_1f(GPUShader *sh, const char *name, float value)
void GPU_shader_uniform_3fv(GPUShader *sh, const char *name, const float data[3])
void GPU_shader_bind(GPUShader *shader)
void GPU_shader_uniform_1b(GPUShader *sh, const char *name, bool value)
void GPU_memory_barrier(eGPUBarrier barrier)
@ GPU_BARRIER_TEXTURE_FETCH
@ GPU_BARRIER_TEXTURE_UPDATE
int GPU_texture_height(const GPUTexture *texture)
void GPU_texture_bind(GPUTexture *texture, int unit)
int GPU_texture_width(const GPUTexture *texture)
void * GPU_texture_read(GPUTexture *texture, eGPUDataFormat data_format, int mip_level)
void GPU_texture_unbind(GPUTexture *texture)
void GPU_texture_image_unbind(GPUTexture *texture)
void GPU_texture_image_bind(GPUTexture *texture, int unit)
Read Guarded memory(de)allocation.
struct GPUShader GPUShader
static T sum(const btAlignedObjectArray< T > &items)
static eGPUTextureFormat gpu_texture_format(ResultType type, ResultPrecision precision)
local_group_size(16, 16) .push_constant(Type texture
void MEM_freeN(void *vmemh)
VecBase< T, Size > divide_ceil(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
float sum_log_luminance(Context &context, GPUTexture *texture, float3 luminance_coefficients)
float sum_blue_squared_difference(Context &context, GPUTexture *texture, float subtrahend)
float maximum_float_in_range(Context &context, GPUTexture *texture, float lower_bound, float upper_bound)
float4 sum_color(Context &context, GPUTexture *texture)
float sum_luminance_squared_difference(Context &context, GPUTexture *texture, float3 luminance_coefficients, float subtrahend)
float minimum_float(Context &context, GPUTexture *texture)
float sum_blue(Context &context, GPUTexture *texture)
float sum_red_squared_difference(Context &context, GPUTexture *texture, float subtrahend)
float sum_luminance(Context &context, GPUTexture *texture, float3 luminance_coefficients)
float sum_red(Context &context, GPUTexture *texture)
float minimum_float_in_range(Context &context, GPUTexture *texture, float lower_bound, float upper_bound)
float maximum_luminance(Context &context, GPUTexture *texture, float3 luminance_coefficients)
float sum_green_squared_difference(Context &context, GPUTexture *texture, float subtrahend)
float sum_green(Context &context, GPUTexture *texture)
float minimum_luminance(Context &context, GPUTexture *texture, float3 luminance_coefficients)
static float * parallel_reduction_dispatch(Context &context, GPUTexture *texture, GPUShader *shader, eGPUTextureFormat format)
float maximum_float(Context &context, GPUTexture *texture)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2