From 521e1d0275e7b237ee676e0426be1b734f270944 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Nov 2017 12:24:17 -0700 Subject: [PATCH] broadcom/vc5: Add support for anisotropic filtering. --- src/gallium/drivers/vc5/vc5_emit.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c index ea646e7d510..24682d90669 100644 --- a/src/gallium/drivers/vc5/vc5_emit.c +++ b/src/gallium/drivers/vc5/vc5_emit.c @@ -166,6 +166,15 @@ emit_one_texture(struct vc5_context *vc5, struct vc5_texture_stateobj *stage_tex if (mag_img_filter == PIPE_TEX_FILTER_NEAREST) unpacked.filter++; + if (psampler->max_anisotropy > 8) + unpacked.filter = V3D_TMU_FILTER_ANISOTROPIC_16_1; + else if (psampler->max_anisotropy > 4) + unpacked.filter = V3D_TMU_FILTER_ANISOTROPIC_8_1; + else if (psampler->max_anisotropy > 2) + unpacked.filter = V3D_TMU_FILTER_ANISOTROPIC_4_1; + else if (psampler->max_anisotropy) + unpacked.filter = V3D_TMU_FILTER_ANISOTROPIC_2_1; + uint8_t packed[cl_packet_length(TEXTURE_SHADER_STATE)]; cl_packet_pack(TEXTURE_SHADER_STATE)(&job->indirect, packed, &unpacked); -- 2.30.2