asahi: Implement anisotropy

Passes KHR-GLES3.texture_filter_anisotropic.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>
This commit is contained in:
Alyssa Rosenzweig 2022-11-23 15:24:21 -05:00 committed by Marge Bot
parent 0347d1c358
commit 3827c465e1
3 changed files with 3 additions and 1 deletions

View file

@ -235,7 +235,7 @@ GL 4.6, GLSL 4.60 -- all DONE: radeonsi, zink
GL_ARB_shader_draw_parameters DONE (i965, llvmpipe, nvc0, d3d12)
GL_ARB_shader_group_vote DONE (freedreno/a6xx, i965, nvc0, llvmpipe)
GL_ARB_spirv_extensions DONE (freedreno, i965/gen7+, llvmpipe)
GL_ARB_texture_filter_anisotropic DONE (etnaviv/HALTI0, freedreno, i965, nv50, nvc0, r600, softpipe, llvmpipe, d3d12, virgl, v3d, panfrost/g72+)
GL_ARB_texture_filter_anisotropic DONE (etnaviv/HALTI0, freedreno, i965, nv50, nvc0, r600, softpipe, llvmpipe, d3d12, virgl, v3d, panfrost/g72+, asahi)
GL_ARB_transform_feedback_overflow_query DONE (i965/gen6+, nvc0, llvmpipe, softpipe, virgl)
GL_KHR_no_error DONE (all drivers)

View file

@ -1249,6 +1249,7 @@ agx_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_OCCLUSION_QUERY:
case PIPE_CAP_PRIMITIVE_RESTART:
case PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX:
case PIPE_CAP_ANISOTROPIC_FILTER:
return true;
case PIPE_CAP_SAMPLER_VIEW_TARGET:

View file

@ -399,6 +399,7 @@ agx_create_sampler_state(struct pipe_context *pctx,
agx_pack(&so->desc, SAMPLER, cfg) {
cfg.minimum_lod = state->min_lod;
cfg.maximum_lod = state->max_lod;
cfg.maximum_anisotropy = util_next_power_of_two(MAX2(state->max_anisotropy, 1));
cfg.magnify_linear = (state->mag_img_filter == PIPE_TEX_FILTER_LINEAR);
cfg.minify_linear = (state->min_img_filter == PIPE_TEX_FILTER_LINEAR);
cfg.mip_filter = agx_mip_filter_from_pipe(state->min_mip_filter);