st/mesa: add EXT_texture_filter_minmax support
This also trivially adds ARB_texture_filter_minmax, since the EXT variant is a strict superset. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9487>
This commit is contained in:
@@ -110,6 +110,20 @@ get_border_clamp(unsigned wrap, bool clamp_to_border)
|
||||
return wrap;
|
||||
}
|
||||
|
||||
static inline enum pipe_tex_reduction_mode
|
||||
gl_reduction_mode_to_pipe(GLenum reduction_mode)
|
||||
{
|
||||
switch (reduction_mode) {
|
||||
case GL_MIN:
|
||||
return PIPE_TEX_REDUCTION_MIN;
|
||||
case GL_MAX:
|
||||
return PIPE_TEX_REDUCTION_MAX;
|
||||
case GL_WEIGHTED_AVERAGE_EXT:
|
||||
default:
|
||||
return PIPE_TEX_REDUCTION_WEIGHTED_AVERAGE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a gl_sampler_object to a pipe_sampler_state object.
|
||||
*/
|
||||
@@ -243,6 +257,8 @@ st_convert_sampler(const struct st_context *st,
|
||||
* handles, as specified by ARB_bindless_texture.
|
||||
*/
|
||||
sampler->seamless_cube_map = msamp->Attrib.CubeMapSeamless;
|
||||
|
||||
sampler->reduction_mode = gl_reduction_mode_to_pipe(msamp->Attrib.ReductionMode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -792,6 +792,7 @@ void st_init_extensions(struct pipe_screen *screen,
|
||||
{ o(EXT_shader_samples_identical), PIPE_CAP_SHADER_SAMPLES_IDENTICAL },
|
||||
{ o(EXT_texture_array), PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS },
|
||||
{ o(EXT_texture_filter_anisotropic), PIPE_CAP_ANISOTROPIC_FILTER },
|
||||
{ o(EXT_texture_filter_minmax), PIPE_CAP_SAMPLER_REDUCTION_MINMAX },
|
||||
{ o(EXT_texture_mirror_clamp), PIPE_CAP_TEXTURE_MIRROR_CLAMP },
|
||||
{ o(EXT_texture_shadow_lod), PIPE_CAP_TEXTURE_SHADOW_LOD },
|
||||
{ o(EXT_texture_swizzle), PIPE_CAP_TEXTURE_SWIZZLE },
|
||||
|
Reference in New Issue
Block a user