radv: add fast color clear for b10g11r11
authorDave Airlie <airlied@redhat.com>
Wed, 15 Feb 2017 02:26:57 +0000 (02:26 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 16 Feb 2017 04:09:15 +0000 (14:09 +1000)
This is used in DOOM, so provide the fast clear path for it.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_formats.c

index 1188ee57b990848029b8003fbc06ff8f6f906300..79025352f3abfce20934fcbcd9e8e502914d4160 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "util/u_half.h"
 #include "util/format_srgb.h"
+#include "util/format_r11g11b10f.h"
 
 uint32_t radv_translate_buffer_dataformat(const struct vk_format_description *desc,
                                          int first_non_void)
@@ -954,6 +955,10 @@ bool radv_format_pack_clear_color(VkFormat format,
                clear_vals[1] = 0;
                clear_vals[0] = fui(value->float32[0]);
                break;
+       case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
+               clear_vals[0] = float3_to_r11g11b10f(value->float32);
+               clear_vals[1] = 0;
+               break;
        default:
                fprintf(stderr, "failed to fast clear %d\n", format);
                return false;