From 1769ce34048495eb28d647914c66b90886796dab Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 27 May 2021 17:35:22 -0400 Subject: [PATCH] lavapipe: add support for anisotropic texturing Reviewed-By: Mike Blumenkrantz Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/frontends/lavapipe/lvp_device.c | 2 +- src/gallium/frontends/lavapipe/lvp_execute.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index e3f41939cd3..895ba87a377 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -410,7 +410,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures( .largePoints = true, .alphaToOne = true, .multiViewport = true, - .samplerAnisotropy = false, /* FINISHME */ + .samplerAnisotropy = true, .textureCompressionETC2 = false, .textureCompressionASTC_LDR = false, .textureCompressionBC = true, diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 5f309c382f7..e301f9fb224 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -865,7 +865,10 @@ static void fill_sampler(struct pipe_sampler_state *ss, ss->min_lod = samp->create_info.minLod; ss->max_lod = samp->create_info.maxLod; ss->lod_bias = samp->create_info.mipLodBias; - ss->max_anisotropy = samp->create_info.maxAnisotropy; + if (samp->create_info.anisotropyEnable) + ss->max_anisotropy = samp->create_info.maxAnisotropy; + else + ss->max_anisotropy = 1; ss->normalized_coords = !samp->create_info.unnormalizedCoordinates; ss->compare_mode = samp->create_info.compareEnable ? PIPE_TEX_COMPARE_R_TO_TEXTURE : PIPE_TEX_COMPARE_NONE; ss->compare_func = samp->create_info.compareOp;