radv: enable TC-compat HTILE for 16-bit depth surfaces on GFX8
The hardware only supports 32-bit depth surfaces, but we can enable TC-compat HTILE for 16-bit depth surfaces if no Z planes are compressed. The main benefit is to reduce the number of depth decompression passes. Also, we don't need to implement DB->CB copies which is fine. This improves Serious Sam 2017 by +4%. Talos and F12017 are also affected but I don't see a performance difference. This also improves the shadowmapping Vulkan demo by 10-15% (FPS is now similar to AMDVLK). No CTS regressions on Polaris10. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
5ae9772245
commit
ccc64f3133
|
@ -3615,12 +3615,22 @@ radv_calc_decompress_on_z_planes(struct radv_device *device,
|
||||||
|
|
||||||
max_zplanes = max_zplanes + 1;
|
max_zplanes = max_zplanes + 1;
|
||||||
} else {
|
} else {
|
||||||
if (iview->image->info.samples <= 1)
|
if (iview->vk_format == VK_FORMAT_D16_UNORM) {
|
||||||
max_zplanes = 5;
|
/* Do not enable Z plane compression for 16-bit depth
|
||||||
else if (iview->image->info.samples <= 4)
|
* surfaces because isn't supported on GFX8. Only
|
||||||
max_zplanes = 3;
|
* 32-bit depth surfaces are supported by the hardware.
|
||||||
else
|
* This allows to maintain shader compatibility and to
|
||||||
max_zplanes = 2;
|
* reduce the number of depth decompressions.
|
||||||
|
*/
|
||||||
|
max_zplanes = 1;
|
||||||
|
} else {
|
||||||
|
if (iview->image->info.samples <= 1)
|
||||||
|
max_zplanes = 5;
|
||||||
|
else if (iview->image->info.samples <= 4)
|
||||||
|
max_zplanes = 3;
|
||||||
|
else
|
||||||
|
max_zplanes = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return max_zplanes;
|
return max_zplanes;
|
||||||
|
|
|
@ -91,18 +91,14 @@ radv_image_is_tc_compat_htile(struct radv_device *device,
|
||||||
pCreateInfo->format == VK_FORMAT_D32_SFLOAT_S8_UINT)
|
pCreateInfo->format == VK_FORMAT_D32_SFLOAT_S8_UINT)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (device->physical_device->rad_info.chip_class >= GFX9) {
|
/* GFX9 supports both 32-bit and 16-bit depth surfaces, while GFX8 only
|
||||||
/* GFX9 supports both 32-bit and 16-bit depth surfaces. */
|
* supports 32-bit. Though, it's possible to enable TC-compat for
|
||||||
if (pCreateInfo->format != VK_FORMAT_D32_SFLOAT_S8_UINT &&
|
* 16-bit depth surfaces if no Z planes are compressed.
|
||||||
pCreateInfo->format != VK_FORMAT_D32_SFLOAT &&
|
*/
|
||||||
pCreateInfo->format != VK_FORMAT_D16_UNORM)
|
if (pCreateInfo->format != VK_FORMAT_D32_SFLOAT_S8_UINT &&
|
||||||
return false;
|
pCreateInfo->format != VK_FORMAT_D32_SFLOAT &&
|
||||||
} else {
|
pCreateInfo->format != VK_FORMAT_D16_UNORM)
|
||||||
/* GFX8 only supports 32-bit depth surfaces. */
|
return false;
|
||||||
if (pCreateInfo->format != VK_FORMAT_D32_SFLOAT_S8_UINT &&
|
|
||||||
pCreateInfo->format != VK_FORMAT_D32_SFLOAT)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue