radv: fix typo in a2b10g10r10 fast clear calculation.
authorDave Airlie <airlied@redhat.com>
Sun, 19 Feb 2017 06:38:16 +0000 (16:38 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 19 Feb 2017 10:27:28 +0000 (20:27 +1000)
This fixes:
dEQP-VK.renderpass.formats.a2b10g10r10_unorm_pack32*
regressions.

Fixes:
f22836dbdd radv: Add CPU color packing for VK_FORMAT_A2B10G10R10_UNORM_PACK32.

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

index 79025352f3abfce20934fcbcd9e8e502914d4160..30a20db7dd0d6a46f2e7201ea827151254996436 100644 (file)
@@ -944,7 +944,7 @@ bool radv_format_pack_clear_color(VkFormat format,
                clear_vals[0] = ((uint16_t)util_iround(CLAMP(value->float32[0], 0.0f, 1.0f) * 0x3ff)) & 0x3ff;
                clear_vals[0] |= (((uint16_t)util_iround(CLAMP(value->float32[1], 0.0f, 1.0f) * 0x3ff)) & 0x3ff) << 10;
                clear_vals[0] |= (((uint16_t)util_iround(CLAMP(value->float32[2], 0.0f, 1.0f) * 0x3ff)) & 0x3ff) << 20;
-               clear_vals[0] |= (((uint16_t)util_iround(CLAMP(value->float32[1], 0.0f, 1.0f) * 0x3)) & 0x3) << 30;
+               clear_vals[0] |= (((uint16_t)util_iround(CLAMP(value->float32[3], 0.0f, 1.0f) * 0x3)) & 0x3) << 30;
                clear_vals[1] = 0;
                return true;
        case VK_FORMAT_R32G32_SFLOAT: