lima: wire up anisotropic filtering

v2:
- AF seems to be log2 based, so convert accordingly

v3:
- actually expose AF

v4:
- REALLY expose AF
- remove log2 modifier assert
- use log2 modifier
- rename AF field
- advertise AF support in features

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37189>
This commit is contained in:
sarbes 2025-09-22 12:25:22 +02:00 committed by Marge Bot
parent f3ef41ff28
commit 2f99f95288
5 changed files with 5 additions and 4 deletions

View file

@ -236,7 +236,7 @@ GL 4.6, GLSL 4.60 -- all DONE: radeonsi, virgl, zink, iris, crocus/gen7+, d3d12,
GL_ARB_shader_draw_parameters DONE (freedreno/a6xx+, nvc0, crocus/gen6+, r600/evergreen+)
GL_ARB_shader_group_vote DONE (freedreno/a6xx, nvc0, crocus, r600)
GL_ARB_spirv_extensions DONE (freedreno, r600)
GL_ARB_texture_filter_anisotropic DONE (etnaviv/HALTI0, freedreno, nv50, nvc0, r600, softpipe, v3d, panfrost/v6+, crocus)
GL_ARB_texture_filter_anisotropic DONE (etnaviv/HALTI0, freedreno, nv50, nvc0, r600, softpipe, v3d, panfrost/v6+, crocus, lima)
GL_ARB_transform_feedback_overflow_query DONE (freedreno/a6xx+, nvc0, softpipe, crocus/gen6+, r600/evergreen+)
GL_KHR_no_error DONE (all drivers)

View file

@ -170,7 +170,7 @@
<field name="Min Lod" start="1:12" size="8" type="ulod"/>
<field name="Max Lod" start="1:20" size="8" type="ulod"/>
<field name="Lod Bias" start="1:28" size="9" type="slod"/>
<field name="Unknown 3" start="2:5" size="3" type="hex"/>
<field name="Max Anisotropy" start="2:5" size="3" type="uint" modifier="log2"/>
<field name="Has Stride" start="2:8" size="1" type="bool"/>
<field name="Mipfilter" start="2:9" size="2" type="Mipfilter"/>
<field name="Min Img Filter Nearest" start="2:11" size="1" type="bool"/>

View file

@ -262,8 +262,6 @@ class Group(object):
print(f" assert((values->{field.name} & {mask}) == 0);")
elif field.modifier[0] == "minus":
print(f" assert(values->{field.name} >= {field.modifier[1]});")
elif field.modifier[0] == "log2":
print(f" assert(IS_POT_NONZERO(values->{field.name}));")
for index in range(math.ceil(self.length / 4)):
# Handle MBZ words

View file

@ -210,6 +210,7 @@ lima_init_screen_caps(struct pipe_screen *screen)
caps->max_point_size =
caps->max_point_size_aa = 100.0f;
caps->anisotropic_filter = true;
caps->max_texture_anisotropy = 16.0f;
caps->max_texture_lod_bias = 15.0f;

View file

@ -179,6 +179,8 @@ lima_update_tex_desc(struct lima_context *ctx, struct lima_sampler_state *sample
desc.max_lod = max_lod;
desc.lod_bias = sampler->base.lod_bias;
desc.max_anisotropy = sampler->base.max_anisotropy;
switch (sampler->base.min_mip_filter) {
case PIPE_TEX_MIPFILTER_LINEAR:
desc.mipfilter = LIMA_MIPFILTER_LINEAR;