r600g: Add support for PIPE_FORMAT_R11G11B10_FLOAT vertex elements
authorFredrik Höglund <fredrik@kde.org>
Thu, 7 Nov 2013 20:49:43 +0000 (21:49 +0100)
committerFredrik Höglund <fredrik@kde.org>
Thu, 7 Nov 2013 22:51:44 +0000 (23:51 +0100)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_formats.h

index 3cd14fc8291b7fbfd51ae847b887c7cefc4bb808..86f79e209b2f593dfd37141a0afd81ea6afb6e21 100644 (file)
@@ -2134,6 +2134,12 @@ void r600_vertex_data_type(enum pipe_format pformat,
        *format_comp = 0;
        *endian = ENDIAN_NONE;
 
+       if (pformat == PIPE_FORMAT_R11G11B10_FLOAT) {
+               *format = FMT_10_11_11_FLOAT;
+               *endian = r600_endian_swap(32);
+               return;
+       }
+
        desc = util_format_description(pformat);
        if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
                goto out_unknown;
index 6f5722851d436f721a5c2d301190e8313ec4fead..453c2b12c0dde1d180831c520a75f17a7677b382 100644 (file)
@@ -87,6 +87,9 @@ static INLINE bool r600_is_vertex_format_supported(enum pipe_format format)
        const struct util_format_description *desc = util_format_description(format);
        unsigned i;
 
+       if (format == PIPE_FORMAT_R11G11B10_FLOAT)
+               return true;
+
        if (!desc)
                return false;