summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-06-23 17:13:14 -0600
committerBrian Paul <[email protected]>2008-06-23 17:13:14 -0600
commit89e9d6b6db933c870443714c3d7c9539d117cddf (patch)
tree65593827b5ddc76cab81e5dca227819928eff6e4 /src/mesa/state_tracker/st_draw.c
parentdc73d15a9a1cc830781f8f3ef81507bfff79b7f9 (diff)
gallium: added support for fixed-point formats, drawing
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 5300848ef6a..6867d50c873 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -147,6 +147,14 @@ static GLuint byte_types_scale[4] = {
PIPE_FORMAT_R8G8B8A8_SSCALED
};
+static GLuint fixed_types[4] = {
+ PIPE_FORMAT_R32_FIXED,
+ PIPE_FORMAT_R32G32_FIXED,
+ PIPE_FORMAT_R32G32B32_FIXED,
+ PIPE_FORMAT_R32G32B32A32_FIXED
+};
+
+
/**
* Return a PIPE_FORMAT_x for the given GL datatype and size.
@@ -154,8 +162,8 @@ static GLuint byte_types_scale[4] = {
static GLuint
pipe_vertex_format(GLenum type, GLuint size, GLboolean normalized)
{
- assert(type >= GL_BYTE);
- assert(type <= GL_DOUBLE);
+ assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
+ type == GL_FIXED);
assert(size >= 1);
assert(size <= 4);
@@ -169,6 +177,7 @@ pipe_vertex_format(GLenum type, GLuint size, GLboolean normalized)
case GL_UNSIGNED_INT: return uint_types_norm[size-1];
case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1];
case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
+ case GL_FIXED: return fixed_types[size-1];
default: assert(0); return 0;
}
}
@@ -182,6 +191,7 @@ pipe_vertex_format(GLenum type, GLuint size, GLboolean normalized)
case GL_UNSIGNED_INT: return uint_types_scale[size-1];
case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1];
case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
+ case GL_FIXED: return fixed_types[size-1];
default: assert(0); return 0;
}
}