Cleanup: Rename wrap to repeat in realization options
The wrap member in realization options is no longer used to indicate
wrapping since 8f8ae302ba. So rename it to repeat since the only user is
now repeating in the realization algorithm.
This commit is contained in:
@@ -34,11 +34,11 @@ struct RealizationOptions {
|
||||
/* If true, the result will be repeated infinitely along the horizontal axis when realizing the
|
||||
* result. If false, regions outside of bounds of the result along the horizontal axis will be
|
||||
* filled with zeros. */
|
||||
bool wrap_x = false;
|
||||
bool repeat_x = false;
|
||||
/* If true, the result will be repeated infinitely along the vertical axis when realizing the
|
||||
* result. If false, regions outside of bounds of the result along the vertical axis will be
|
||||
* filled with zeros. */
|
||||
bool wrap_y = false;
|
||||
bool repeat_y = false;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -82,14 +82,16 @@ static void realize_on_domain_gpu(Context &context,
|
||||
realization_options.interpolation, Interpolation::Bilinear, Interpolation::Bicubic);
|
||||
GPU_texture_filter_mode(input, use_bilinear);
|
||||
|
||||
/* If the input wraps, set a repeating wrap mode for out-of-bound texture access. Otherwise,
|
||||
/* If the input repeats, set a repeating extend mode for out-of-bound texture access. Otherwise,
|
||||
* make out-of-bound texture access return zero by setting a clamp to border extend mode. */
|
||||
GPU_texture_extend_mode_x(input,
|
||||
realization_options.wrap_x ? GPU_SAMPLER_EXTEND_MODE_REPEAT :
|
||||
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
|
||||
realization_options.repeat_x ?
|
||||
GPU_SAMPLER_EXTEND_MODE_REPEAT :
|
||||
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
|
||||
GPU_texture_extend_mode_y(input,
|
||||
realization_options.wrap_y ? GPU_SAMPLER_EXTEND_MODE_REPEAT :
|
||||
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
|
||||
realization_options.repeat_y ?
|
||||
GPU_SAMPLER_EXTEND_MODE_REPEAT :
|
||||
GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER);
|
||||
|
||||
input.bind_as_texture(shader, "input_tx");
|
||||
|
||||
@@ -129,15 +131,15 @@ static void realize_on_domain_cpu(Result &input,
|
||||
switch (realization_options.interpolation) {
|
||||
case Interpolation::Nearest:
|
||||
sample = input.sample_nearest_wrap(
|
||||
normalized_coordinates, realization_options.wrap_x, realization_options.wrap_y);
|
||||
normalized_coordinates, realization_options.repeat_x, realization_options.repeat_y);
|
||||
break;
|
||||
case Interpolation::Bilinear:
|
||||
sample = input.sample_bilinear_wrap(
|
||||
normalized_coordinates, realization_options.wrap_x, realization_options.wrap_y);
|
||||
normalized_coordinates, realization_options.repeat_x, realization_options.repeat_y);
|
||||
break;
|
||||
case Interpolation::Bicubic:
|
||||
sample = input.sample_cubic_wrap(
|
||||
normalized_coordinates, realization_options.wrap_x, realization_options.wrap_y);
|
||||
normalized_coordinates, realization_options.repeat_x, realization_options.repeat_y);
|
||||
break;
|
||||
}
|
||||
output.store_pixel_generic_type(texel, sample);
|
||||
|
||||
Reference in New Issue
Block a user