summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2012-09-05 18:24:14 +0200
committerMichel Dänzer <[email protected]>2012-09-06 16:48:16 +0200
commit694617a5b4222aa1fb40e5e16addd7a3120de6a5 (patch)
treeb18d23deb86d9804933c422ad9a0e138c0e5eaa2 /src/gallium/drivers/radeonsi/si_state.c
parentcfebaf9dbd4839075786eb340a247f41bdcf9fa6 (diff)
radeonsi: Handle more L/I/A format cases.
Fixes piglit fbo-generatemipmap-formats. Signed-off-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 762887d224e..e3e4f0e4f35 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -715,6 +715,9 @@ static uint32_t si_translate_colorformat(enum pipe_format format)
case PIPE_FORMAT_R16_SINT:
case PIPE_FORMAT_R16_FLOAT:
case PIPE_FORMAT_R16G16_FLOAT:
+ case PIPE_FORMAT_L16_UNORM:
+ case PIPE_FORMAT_I16_UNORM:
+ case PIPE_FORMAT_A16_UNORM:
return V_028C70_COLOR_16;
/* 32-bit buffers. */
@@ -759,6 +762,7 @@ static uint32_t si_translate_colorformat(enum pipe_format format)
case PIPE_FORMAT_Z32_FLOAT:
return V_028C70_COLOR_32;
+ case PIPE_FORMAT_L16A16_UNORM:
case PIPE_FORMAT_R16G16_SSCALED:
case PIPE_FORMAT_R16G16_UNORM:
case PIPE_FORMAT_R16G16_UINT:
@@ -863,12 +867,17 @@ static uint32_t si_translate_colorswap(enum pipe_format format)
case PIPE_FORMAT_R8G8_SINT:
return V_028C70_SWAP_STD;
+ case PIPE_FORMAT_I16_UNORM:
+ case PIPE_FORMAT_L16_UNORM:
case PIPE_FORMAT_R16_UNORM:
case PIPE_FORMAT_R16_UINT:
case PIPE_FORMAT_R16_SINT:
case PIPE_FORMAT_R16_FLOAT:
return V_028C70_SWAP_STD;
+ case PIPE_FORMAT_A16_UNORM:
+ return V_028C70_SWAP_ALT_REV;
+
/* 32-bit buffers. */
case PIPE_FORMAT_A8B8G8R8_SRGB:
return V_028C70_SWAP_STD_REV;
@@ -924,6 +933,9 @@ static uint32_t si_translate_colorswap(enum pipe_format format)
case PIPE_FORMAT_R16G16_SINT:
return V_028C70_SWAP_STD;
+ case PIPE_FORMAT_L16A16_UNORM:
+ return V_028C70_SWAP_ALT;
+
/* 64-bit buffers. */
case PIPE_FORMAT_R32G32_FLOAT:
case PIPE_FORMAT_R32G32_UINT:
@@ -1155,8 +1167,10 @@ static uint32_t si_translate_texformat(struct pipe_screen *screen,
switch (desc->channel[first_non_void].size) {
case 4:
switch (desc->nr_channels) {
+#if 0 /* Not supported for render targets */
case 2:
return V_008F14_IMG_DATA_FORMAT_4_4;
+#endif
case 4:
return V_008F14_IMG_DATA_FORMAT_4_4_4_4;
}