Mesa (master): r600g: implement EXT_packed_float

Marek Olšák mareko at kemper.freedesktop.org
Fri Apr 29 02:36:29 PDT 2011


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Apr 27 16:30:28 2011 +0200

r600g: implement EXT_packed_float

---

 src/gallium/drivers/r600/eg_state_inlines.h   |    4 ++++
 src/gallium/drivers/r600/r600_state_inlines.h |    3 +++
 src/gallium/drivers/r600/r600_texture.c       |    3 +++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/eg_state_inlines.h b/src/gallium/drivers/r600/eg_state_inlines.h
index 586b7cf..b780dba 100644
--- a/src/gallium/drivers/r600/eg_state_inlines.h
+++ b/src/gallium/drivers/r600/eg_state_inlines.h
@@ -367,6 +367,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
 	case PIPE_FORMAT_B10G10R10A2_UNORM:
 		return V_028C70_SWAP_ALT;
 
+	case PIPE_FORMAT_R11G11B10_FLOAT:
 	case PIPE_FORMAT_R32_FLOAT:
 	case PIPE_FORMAT_R16G16_FLOAT:
 	case PIPE_FORMAT_R16G16_UNORM:
@@ -468,6 +469,9 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
 	case PIPE_FORMAT_R16G16_UNORM:
 		return V_028C70_COLOR_16_16;
 
+	case PIPE_FORMAT_R11G11B10_FLOAT:
+		return V_028C70_COLOR_10_11_11_FLOAT;
+
 		/* 64-bit buffers. */
 	case PIPE_FORMAT_R16G16B16_USCALED:
 	case PIPE_FORMAT_R16G16B16A16_USCALED:
diff --git a/src/gallium/drivers/r600/r600_state_inlines.h b/src/gallium/drivers/r600/r600_state_inlines.h
index 09d07f7..53a649c 100644
--- a/src/gallium/drivers/r600/r600_state_inlines.h
+++ b/src/gallium/drivers/r600/r600_state_inlines.h
@@ -361,6 +361,7 @@ static inline uint32_t r600_translate_colorswap(enum pipe_format format)
 	case PIPE_FORMAT_B10G10R10A2_UNORM:
 		return V_0280A0_SWAP_ALT;
 
+	case PIPE_FORMAT_R11G11B10_FLOAT:
 	case PIPE_FORMAT_R16G16_UNORM:
 	case PIPE_FORMAT_R16G16_FLOAT:
 	case PIPE_FORMAT_R32_FLOAT:
@@ -462,6 +463,8 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
 	case PIPE_FORMAT_R16G16_UNORM:
 		return V_0280A0_COLOR_16_16;
 
+	case PIPE_FORMAT_R11G11B10_FLOAT:
+		return V_0280A0_COLOR_10_11_11_FLOAT;
 
 		/* 64-bit buffers. */
 	case PIPE_FORMAT_R16G16B16_USCALED:
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index b22eb7b..7ffea69 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -933,6 +933,9 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
 	if (format == PIPE_FORMAT_R9G9B9E5_FLOAT) {
 		result = FMT_5_9_9_9_SHAREDEXP;
 		goto out_word4;
+	} else if (format == PIPE_FORMAT_R11G11B10_FLOAT) {
+		result = FMT_10_11_11_FLOAT;
+		goto out_word4;
 	}
 
 



More information about the mesa-commit mailing list