radv: disable DCC for shareable images on GFX9+

Submitted by Andres Rodriguez on May 10, 2018, 3:46 a.m.

Details

Message ID 20180510034607.22446-1-andresx7@gmail.com
State New
Headers show
Series "radv: disable DCC for shareable images on GFX9+" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andres Rodriguez May 10, 2018, 3:46 a.m.
This seems to be broken at the moment for opengl interop. Which is
used by steamvr opengl applications.

---

Not sure if we want to merge this or not. It fixes steamvr opengl applications
on vega, but the proper solution is probably in some metadata bug.

Mailing it out mostly as an awareness notification in case anyone else runs
into this issue. Or in case we decided to use this as a temporary workaround.

 src/amd/vulkan/radv_image.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index ad480901eed..cc89ea6b290 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -110,11 +110,18 @@  radv_use_dcc_for_image(struct radv_device *device,
 {
 	bool dcc_compatible_formats;
 	bool blendable;
+	bool shareable = vk_find_struct_const(pCreateInfo->pNext,
+	                                      EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR) != NULL;
 
 	/* DCC (Delta Color Compression) is only available for GFX8+. */
 	if (device->physical_device->rad_info.chip_class < VI)
 		return false;
 
+	/* FIXME: DCC is broken for shareable images starting with GFX9 */
+	if (device->physical_device->rad_info.chip_class >= GFX9 &&
+	    shareable)
+		return false;
+
 	if (device->instance->debug_flags & RADV_DEBUG_NO_DCC)
 		return false;
 

Comments

I'm personally fine with this as a temporary solution (correctness vs 
performance).

If Bas and Dave also agree, we would need to backport it I think (note 
that radv_use_dcc_for_image() is pretty recent and this patch probably 
can't be applied to 18.0).

Just one comment below.

On 05/10/2018 05:46 AM, Andres Rodriguez wrote:
> This seems to be broken at the moment for opengl interop. Which is
> used by steamvr opengl applications.
> 
> ---
> 
> Not sure if we want to merge this or not. It fixes steamvr opengl applications
> on vega, but the proper solution is probably in some metadata bug.
> 
> Mailing it out mostly as an awareness notification in case anyone else runs
> into this issue. Or in case we decided to use this as a temporary workaround.
> 
>   src/amd/vulkan/radv_image.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
> index ad480901eed..cc89ea6b290 100644
> --- a/src/amd/vulkan/radv_image.c
> +++ b/src/amd/vulkan/radv_image.c
> @@ -110,11 +110,18 @@ radv_use_dcc_for_image(struct radv_device *device,
>   {
>   	bool dcc_compatible_formats;
>   	bool blendable;
> +	bool shareable = vk_find_struct_const(pCreateInfo->pNext,
> +	                                      EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR) != NULL;
>   
>   	/* DCC (Delta Color Compression) is only available for GFX8+. */
>   	if (device->physical_device->rad_info.chip_class < VI)
>   		return false;
>   
> +	/* FIXME: DCC is broken for shareable images starting with GFX9 */
> +	if (device->physical_device->rad_info.chip_class >= GFX9 &&
> +	    shareable)
> +		return false;
> +

Can you please move this after the NO_DCC check?

With this addressed, patch is:

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

>   	if (device->instance->debug_flags & RADV_DEBUG_NO_DCC)
>   		return false;
>   
>