intel/isl: Add isl_view::min_lod_clamp for IVB+
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 6 Jul 2021 15:54:28 +0000 (10:54 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 31 May 2022 13:42:28 +0000 (13:42 +0000)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14129>

src/intel/isl/isl.h
src/intel/isl/isl_surface_state.c

index c2db422..9d34852 100644 (file)
@@ -1609,6 +1609,14 @@ struct isl_view {
     */
    uint32_t array_len;
 
+   /**
+    * Minimum LOD
+    *
+    * Similar to sampler minimum LOD, the computed LOD is clamped to be at
+    * least min_lod_clamp.
+    */
+   float min_lod_clamp;
+
    struct isl_swizzle swizzle;
 };
 
index 8a5de4b..4cbcd64 100644 (file)
@@ -446,6 +446,12 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
 #endif
 #endif
 
+#if GFX_VER >= 7
+   s.ResourceMinLOD = info->view->min_lod_clamp;
+#else
+   assert(info->view->min_lod_clamp == 0);
+#endif
+
 #if (GFX_VERx10 >= 75)
    if (info->view->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT)
       assert(isl_swizzle_supports_rendering(dev->info, info->view->swizzle));