anv/formats: Don't use an RGBX format if it isn't renderable
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 26 Jul 2016 18:33:45 +0000 (11:33 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 23 Aug 2016 18:45:24 +0000 (11:45 -0700)
The whole point of using RGBX is so that we can render to it so if it isn't
renderable, that kind-of defeats the purpose.  Some formats (one example is
R32G32B32X32_SFLOAT) exist in the format table but aren't actually
renderable.  Eventually, we'd like to get away from RGBX entirely, but this
fixes hangs on BDW today.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_formats.c

index b06e29baaf8e46178ce953686547474ea78ed6e3..bbfb2925d772b397921edcd45f7efafcd08ceffa 100644 (file)
@@ -278,7 +278,8 @@ anv_get_format(const struct brw_device_info *devinfo, VkFormat vk_format,
        * hood.
        */
       enum isl_format rgbx = isl_format_rgb_to_rgbx(format.isl_format);
-      if (rgbx != ISL_FORMAT_UNSUPPORTED) {
+      if (rgbx != ISL_FORMAT_UNSUPPORTED &&
+          isl_format_supports_rendering(devinfo, rgbx)) {
          format.isl_format = rgbx;
       } else {
          format.isl_format = isl_format_rgb_to_rgba(format.isl_format);