aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-06 15:24:01 +0200
committermarha <marha@users.sourceforge.net>2011-09-06 15:24:01 +0200
commit53da0b7e7c183ea15692234332b3e337b3fb0cc0 (patch)
treefea01c12ceadaeaa091bab7867fa599e55c9fa62 /mesalib/src/mesa/state_tracker/st_draw.c
parent6eaea4464631b5d8c1f44a46016163e351028afc (diff)
downloadvcxsrv-53da0b7e7c183ea15692234332b3e337b3fb0cc0.tar.gz
vcxsrv-53da0b7e7c183ea15692234332b3e337b3fb0cc0.tar.bz2
vcxsrv-53da0b7e7c183ea15692234332b3e337b3fb0cc0.zip
mesa git update 6 sep 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_draw.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index 5040c6fa5..39a947df7 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/src/mesa/state_tracker/st_draw.c
@@ -187,11 +187,44 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
GLboolean normalized)
{
assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
- type == GL_FIXED || type == GL_HALF_FLOAT);
+ type == GL_FIXED || type == GL_HALF_FLOAT ||
+ type == GL_INT_2_10_10_10_REV ||
+ type == GL_UNSIGNED_INT_2_10_10_10_REV);
assert(size >= 1);
assert(size <= 4);
assert(format == GL_RGBA || format == GL_BGRA);
+ if (type == GL_INT_2_10_10_10_REV ||
+ type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+ assert(size == 4);
+
+ if (format == GL_BGRA) {
+ if (type == GL_INT_2_10_10_10_REV) {
+ if (normalized)
+ return PIPE_FORMAT_B10G10R10A2_SNORM;
+ else
+ return PIPE_FORMAT_B10G10R10A2_SSCALED;
+ } else {
+ if (normalized)
+ return PIPE_FORMAT_B10G10R10A2_UNORM;
+ else
+ return PIPE_FORMAT_B10G10R10A2_USCALED;
+ }
+ } else {
+ if (type == GL_INT_2_10_10_10_REV) {
+ if (normalized)
+ return PIPE_FORMAT_R10G10B10A2_SNORM;
+ else
+ return PIPE_FORMAT_R10G10B10A2_SSCALED;
+ } else {
+ if (normalized)
+ return PIPE_FORMAT_R10G10B10A2_UNORM;
+ else
+ return PIPE_FORMAT_R10G10B10A2_USCALED;
+ }
+ }
+ }
+
if (format == GL_BGRA) {
/* this is an odd-ball case */
assert(type == GL_UNSIGNED_BYTE);