Any depth buffer can potentially use VRS.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10187>
if (device->physical_device->rad_info.chip_class == GFX9) {
ds->db_htile_surface |= S_028ABC_RB_ALIGNED(1);
}
+
+ if (radv_image_has_vrs_htile(device, iview->image)) {
+ ds->db_htile_surface |= S_028ABC_VRS_HTILE_ENCODING(V_028ABC_VRS_HTILE_4BIT_ENCODING);
+ }
}
} else {
const struct legacy_surf_level *level_info = &surf->u.legacy.level[level];
}
/**
+ * Return whether the image has VRS HTILE metadata for depth surfaces
+ */
+static inline bool
+radv_image_has_vrs_htile(const struct radv_device *device, const struct radv_image *image)
+{
+ /* Any depth buffer can potentially use VRS. */
+ return device->attachment_vrs_enabled && radv_image_has_htile(image) &&
+ (image->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
+}
+
+/**
* Return whether HTILE metadata is enabled for a level.
*/
static inline bool