diff --git a/docs/features.txt b/docs/features.txt index 31a8913365a..db67b0babbe 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -315,7 +315,7 @@ Khronos, ARB, and OES extensions that are not part of any OpenGL or OpenGL ES ve GL_ARB_sparse_texture DONE (radeonsi/gfx9+, zink) GL_ARB_sparse_texture2 DONE (radeonsi/gfx9+, zink) GL_ARB_sparse_texture_clamp DONE (radeonsi/gfx9+, zink) - GL_ARB_texture_filter_minmax DONE (nvc0/gm200+, zink) + GL_ARB_texture_filter_minmax DONE (freedreno/a6xx, nvc0/gm200+, zink) GL_ARM_shader_framebuffer_fetch_depth_stencil DONE (llvmpipe) GL_EXT_shader_framebuffer_fetch DONE (freedreno/a6xx, iris/gen9+, llvmpipe, panfrost, virgl, zink, asahi) GL_EXT_shader_framebuffer_fetch_non_coherent DONE (freedreno/a6xx, iris, llvmpipe, panfrost, virgl, zink, asahi) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.cc b/src/gallium/drivers/freedreno/a6xx/fd6_texture.cc index fff9408b130..72a1adf0365 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.cc @@ -91,6 +91,20 @@ tex_filter(unsigned filter, bool aniso) } } +static enum a6xx_reduction_mode +reduction_mode(unsigned reduction_mode) +{ + switch (reduction_mode) { + default: + case PIPE_TEX_REDUCTION_WEIGHTED_AVERAGE: + return A6XX_REDUCTION_MODE_AVERAGE; + case PIPE_TEX_REDUCTION_MIN: + return A6XX_REDUCTION_MODE_MIN; + case PIPE_TEX_REDUCTION_MAX: + return A6XX_REDUCTION_MODE_MAX; + } +} + static void setup_border_color(struct fd_screen *screen, const struct pipe_sampler_state *sampler, @@ -303,6 +317,9 @@ fd6_sampler_state_create(struct pipe_context *pctx, cso->min_img_filter == PIPE_TEX_FILTER_LINEAR) so->texsamp2 |= A6XX_TEX_SAMP_2_CHROMA_LINEAR; + so->texsamp2 |= + A6XX_TEX_SAMP_2_REDUCTION_MODE(reduction_mode(cso->reduction_mode)); + return so; } diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 54dfcbfbba2..fceabe30418 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -322,6 +322,10 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_DEPTH_CLIP_DISABLE_SEPARATE: return is_a6xx(screen); + case PIPE_CAP_SAMPLER_REDUCTION_MINMAX: + case PIPE_CAP_SAMPLER_REDUCTION_MINMAX_ARB: + return is_a6xx(screen) && screen->info->a6xx.has_sampler_minmax; + case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS: return is_a6xx(screen) && screen->info->a6xx.has_sample_locations;