anv: Only enable EWA LOD algorithm when doing anisotropic filtering.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 17 Dec 2019 05:15:15 +0000 (21:15 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 4 Jan 2020 22:27:22 +0000 (14:27 -0800)
Updated documentation renames "Anisotropic Algorithm" to "LOD Algorithm"
and adds a note for Gen9+ saying "The EWA Algorithm should only be
enabled for Anisotropic Filtering modes." and indicating that the extra
accuracy shouldn't be necessary for other modes, and comes at a cost.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_state.c

index 34c6c6bd142d9beeaa40a3d2a139ea66d7c8b2cf..78e018762cb53d00d9b0fc3d1ed2001db7eaca5d 100644 (file)
@@ -506,7 +506,8 @@ VkResult genX(CreateSampler)(
          .MagModeFilter = vk_to_gen_tex_filter(mag_filter, pCreateInfo->anisotropyEnable),
          .MinModeFilter = vk_to_gen_tex_filter(min_filter, pCreateInfo->anisotropyEnable),
          .TextureLODBias = anv_clamp_f(pCreateInfo->mipLodBias, -16, 15.996),
-         .AnisotropicAlgorithm = EWAApproximation,
+         .AnisotropicAlgorithm =
+            pCreateInfo->anisotropyEnable ? EWAApproximation : LEGACY,
          .MinLOD = anv_clamp_f(pCreateInfo->minLod, 0, 14),
          .MaxLOD = anv_clamp_f(pCreateInfo->maxLod, 0, 14),
          .ChromaKeyEnable = 0,