radv: don't decompress HTILE for 16-bit depth surfaces on GFX8

Submitted by Samuel Pitoiset on Dec. 11, 2018, 9:05 p.m.

Details

Message ID 20181211210522.9642-1-samuel.pitoiset@gmail.com
State New
Headers show
Series "radv: don't decompress HTILE for 16-bit depth surfaces on GFX8" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset Dec. 11, 2018, 9:05 p.m.
GFX8 only natively supports TC-compatible HTILE for 32-bit surfaces,
while GFX9 also supports 16-bit surfaces. Though, it's possible
to enable it for 16-bit depth surfaces if no Z planes are
compressed and the driver does that.

However, it appears that trying to decompress such a surface
ends up by reporting VM faults. This is probably because the
hardware uses 32-bit instead of 16-bit. Anyways, decompressing
a surface when no Z planes are compressed is just dumb.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107563
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/vulkan/radv_meta_decompress.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
index fe8e114e91b..952765b16db 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -330,8 +330,15 @@  static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
 	struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state;
 	VkPipeline pipeline_h;
 
-	if (!radv_image_has_htile(image))
+	if (!radv_image_has_htile(image) ||
+	    /* Don't decompress HTILE for 16-bit depth surfaces that are
+	     * TC-compatible because no Z planes are compressed on GFX8.
+	     */
+	    (cmd_buffer->device->physical_device->rad_info.chip_class == VI &&
+	     radv_image_is_tc_compat_htile(image) &&
+	     image->vk_format == VK_FORMAT_D16_UNORM)) {
 		return;
+	}
 
 	if (!meta_state->depth_decomp[samples_log2].decompress_pipeline) {
 		VkResult ret = create_pipeline(cmd_buffer->device, VK_NULL_HANDLE, samples,