anv/format: handle unsupported formats earlier
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 15 Nov 2016 07:48:46 +0000 (08:48 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 15 Nov 2016 07:50:48 +0000 (08:50 +0100)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_formats.c

index 2adde8b347ad4c7c82e0cccb4652729c211037fa..9ef998cfff2a22d860ab1f0cc6b9030f34eec565 100644 (file)
@@ -467,6 +467,9 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
    uint32_t maxArraySize;
    VkSampleCountFlags sampleCounts = VK_SAMPLE_COUNT_1_BIT;
 
+   if (anv_formats[format].isl_format == ISL_FORMAT_UNSUPPORTED)
+      goto unsupported;
+
    anv_physical_device_get_format_properties(physical_device, format,
                                              &format_props);
 
@@ -511,9 +514,6 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
       break;
    }
 
-   if (anv_formats[format].isl_format == ISL_FORMAT_UNSUPPORTED)
-      goto unsupported;
-
    /* Our hardware doesn't support 1D compressed textures.
     *    From the SKL PRM, RENDER_SURFACE_STATE::SurfaceFormat:
     *    * This field cannot be a compressed (BC*, DXT*, FXT*, ETC*, EAC*) format