[Mesa-dev] [PATCH 1/2] mesa: Implement ARB_texture_filter_minmax
Ian Romanick
idr at freedesktop.org
Thu Nov 16 19:49:33 UTC 2017
On 11/14/2017 02:54 PM, Scott D Phillips wrote:
> This extension provides a new texture and sampler parameter
> (TEXTURE_REDUCTION_MODE_ARB) which allows applications to produce
> a filtered texel value by computing a component-wise minimum (MIN)
> or maximum (MAX) of the texels that would normally be averaged.
> ---
> CTS tests KHR-GL45.texture_filter_minmax_tests.* need a little TLC to
> pass with this series. Details in VK-GL-CTS issue: 849
>
> src/mesa/main/attrib.c | 4 ++++
> src/mesa/main/extensions_table.h | 1 +
> src/mesa/main/formatquery.c | 10 ++++++++++
> src/mesa/main/mtypes.h | 2 ++
> src/mesa/main/samplerobj.c | 37 +++++++++++++++++++++++++++++++++++++
> src/mesa/main/texobj.c | 2 ++
> src/mesa/main/texobj.h | 2 +-
> src/mesa/main/texparam.c | 33 +++++++++++++++++++++++++++++++++
> 8 files changed, 90 insertions(+), 1 deletion(-)
>
[lots of stuff trimmed]
> diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
> index 5b66e7d30d..c51ad80742 100644
> --- a/src/mesa/main/extensions_table.h
> +++ b/src/mesa/main/extensions_table.h
> @@ -146,6 +146,7 @@ EXT(ARB_texture_env_combine , ARB_texture_env_combine
> EXT(ARB_texture_env_crossbar , ARB_texture_env_crossbar , GLL, x , x , x , 2001)
> EXT(ARB_texture_env_dot3 , ARB_texture_env_dot3 , GLL, x , x , x , 2001)
> EXT(ARB_texture_filter_anisotropic , ARB_texture_filter_anisotropic , GLL, GLC, x , x , 2017)
> +EXT(ARB_texture_filter_minmax , ARB_texture_filter_minmax , GLL, GLC, x , x , 2017)
Is this right? The extension says OpenGL 3.3 is required, and we don't
(until Marek is done) do OpenGL 3.3 compatibility profile.
> EXT(ARB_texture_float , ARB_texture_float , GLL, GLC, x , x , 2004)
> EXT(ARB_texture_gather , ARB_texture_gather , GLL, GLC, x , x , 2009)
> EXT(ARB_texture_mirror_clamp_to_edge , ARB_texture_mirror_clamp_to_edge , GLL, GLC, x , x , 2013)
> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
> index 4a0f61eda8..94883b2210 100644
> --- a/src/mesa/main/texparam.c
> +++ b/src/mesa/main/texparam.c
> @@ -630,6 +630,25 @@ set_tex_parameteri(struct gl_context *ctx,
> }
> goto invalid_pname;
>
> + case GL_TEXTURE_REDUCTION_MODE_ARB:
> + if (ctx->Extensions.ARB_texture_filter_minmax) {
> +
Extra blank line here should be deleted.
> + if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target))
> + goto invalid_enum;
> +
> + if (texObj->Sampler.ReductionMode == params[0])
> + return GL_FALSE;
> + if (params[0] == GL_MIN ||
> + params[0] == GL_MAX ||
> + params[0] == GL_WEIGHTED_AVERAGE_ARB) {
> + flush(ctx);
> + texObj->Sampler.ReductionMode = params[0];
> + return GL_TRUE;
> + }
> + goto invalid_param;
> + }
> + goto invalid_pname;
> +
> default:
> goto invalid_pname;
> }
More information about the mesa-dev
mailing list