Mesa (main): lavapipe: add support for anisotropic texturing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 21 00:40:08 UTC 2021


Module: Mesa
Branch: main
Commit: 1769ce34048495eb28d647914c66b90886796dab
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1769ce34048495eb28d647914c66b90886796dab

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu May 27 17:35:22 2021 -0400

lavapipe: add support for anisotropic texturing

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8804>

---

 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;



More information about the mesa-commit mailing list