aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_state_inlines.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-09-24 09:50:48 +1000
committerDave Airlie <[email protected]>2010-09-24 12:34:43 +1000
commitb7ab9ee84e4e4ff48b335c74c110d82e48bee4a5 (patch)
treec432c2d12863b47187218b9eb5a1aea9dae792bc /src/gallium/drivers/r600/r600_state_inlines.h
parent4388087f199f020e15024c908ba840a250cf29e1 (diff)
r600g: add some more vertex format support.
adds the sscaled formats, this passes some more of the draw-vertices tests.
Diffstat (limited to 'src/gallium/drivers/r600/r600_state_inlines.h')
-rw-r--r--src/gallium/drivers/r600/r600_state_inlines.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_state_inlines.h b/src/gallium/drivers/r600/r600_state_inlines.h
index 3a2c08da0bd..1337d8ec815 100644
--- a/src/gallium/drivers/r600/r600_state_inlines.h
+++ b/src/gallium/drivers/r600/r600_state_inlines.h
@@ -400,19 +400,31 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
case PIPE_FORMAT_R32_FLOAT:
return V_0280A0_COLOR_32_FLOAT;
+
case PIPE_FORMAT_R16G16_FLOAT:
- case PIPE_FORMAT_R16G16B16_FLOAT:
- return V_0280A0_COLOR_16_16_16_16_FLOAT;
+ return V_0280A0_COLOR_16_16_FLOAT;
+
+ case PIPE_FORMAT_R16G16_SSCALED:
+ return V_0280A0_COLOR_16_16;
+
/* 64-bit buffers. */
+ case PIPE_FORMAT_R16G16B16_SSCALED:
+ case PIPE_FORMAT_R16G16B16A16_SSCALED:
case PIPE_FORMAT_R16G16B16A16_UNORM:
case PIPE_FORMAT_R16G16B16A16_SNORM:
return V_0280A0_COLOR_16_16_16_16;
+
+ case PIPE_FORMAT_R16G16B16_FLOAT:
case PIPE_FORMAT_R16G16B16A16_FLOAT:
return V_0280A0_COLOR_16_16_16_16_FLOAT;
+
case PIPE_FORMAT_R32G32_FLOAT:
return V_0280A0_COLOR_32_32_FLOAT;
+ case PIPE_FORMAT_R32G32_SSCALED:
+ return V_0280A0_COLOR_32_32;
+
/* 128-bit buffers. */
case PIPE_FORMAT_R32G32B32_FLOAT:
return V_0280A0_COLOR_32_32_32_FLOAT;
@@ -423,11 +435,30 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
case PIPE_FORMAT_UYVY:
case PIPE_FORMAT_YUYV:
default:
- R600_ERR("unsupported color format %d\n", format);
+ R600_ERR("unsupported color format %d %s\n", format, util_format_name(format));
return ~0; /* Unsupported. */
}
}
+static INLINE void r600_translate_vertex_num_format(enum pipe_format format, uint32_t *num_format_p,
+ uint32_t *format_comp_p)
+{
+ uint32_t num_format = 0, format_comp = 0;
+ switch (format) {
+ case PIPE_FORMAT_R16G16B16A16_SSCALED:
+ case PIPE_FORMAT_R16G16B16_SSCALED:
+ case PIPE_FORMAT_R16G16_SSCALED:
+ case PIPE_FORMAT_R32G32_SSCALED:
+ num_format = V_038008_SQ_NUM_FORMAT_SCALED;
+ format_comp = 1;
+ break;
+ default:
+ break;
+ }
+ *num_format_p = num_format;
+ *format_comp_p = format_comp;
+}
+
static INLINE boolean r600_is_sampler_format_supported(enum pipe_format format)
{
return r600_translate_texformat(format, NULL, NULL, NULL) != ~0;