Mesa (master): r600g: Add support for PIPE_FORMAT_R11G11B10_FLOAT vertex elements

Fredrik Höglund fredrik at kemper.freedesktop.org
Thu Nov 7 22:58:52 UTC 2013


Module: Mesa
Branch: master
Commit: e420fb887f26cf275996f8c0f1a6659a4ed1238f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e420fb887f26cf275996f8c0f1a6659a4ed1238f

Author: Fredrik Höglund <fredrik at kde.org>
Date:   Thu Nov  7 21:49:43 2013 +0100

r600g: Add support for PIPE_FORMAT_R11G11B10_FLOAT vertex elements

Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

---

 src/gallium/drivers/r600/r600_asm.c     |    6 ++++++
 src/gallium/drivers/r600/r600_formats.h |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 3cd14fc..86f79e2 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -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;
diff --git a/src/gallium/drivers/r600/r600_formats.h b/src/gallium/drivers/r600/r600_formats.h
index 6f57228..453c2b1 100644
--- a/src/gallium/drivers/r600/r600_formats.h
+++ b/src/gallium/drivers/r600/r600_formats.h
@@ -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;
 




More information about the mesa-commit mailing list