summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_draw.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 0ebc462ced4..4f4368ac9e4 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -74,6 +74,13 @@ static GLuint float_types[4] = {
PIPE_FORMAT_R32G32B32A32_FLOAT
};
+static GLuint half_float_types[4] = {
+ PIPE_FORMAT_R16_FLOAT,
+ PIPE_FORMAT_R16G16_FLOAT,
+ PIPE_FORMAT_R16G16B16_FLOAT,
+ PIPE_FORMAT_R16G16B16A16_FLOAT
+};
+
static GLuint uint_types_norm[4] = {
PIPE_FORMAT_R32_UNORM,
PIPE_FORMAT_R32G32_UNORM,
@@ -175,7 +182,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
GLboolean normalized)
{
assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
- type == GL_FIXED);
+ type == GL_FIXED || type == GL_HALF_FLOAT);
assert(size >= 1);
assert(size <= 4);
assert(format == GL_RGBA || format == GL_BGRA);
@@ -191,6 +198,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
switch (type) {
case GL_DOUBLE: return double_types[size-1];
case GL_FLOAT: return float_types[size-1];
+ case GL_HALF_FLOAT: return half_float_types[size-1];
case GL_INT: return int_types_norm[size-1];
case GL_SHORT: return short_types_norm[size-1];
case GL_BYTE: return byte_types_norm[size-1];
@@ -205,6 +213,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
switch (type) {
case GL_DOUBLE: return double_types[size-1];
case GL_FLOAT: return float_types[size-1];
+ case GL_HALF_FLOAT: return half_float_types[size-1];
case GL_INT: return int_types_scale[size-1];
case GL_SHORT: return short_types_scale[size-1];
case GL_BYTE: return byte_types_scale[size-1];