aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2010-01-18 16:29:31 +1000
committerDave Airlie <[email protected]>2010-01-23 12:28:32 +1000
commitcfe884e2030466df673881da8e830c300dda40db (patch)
treedbab66e31a8bfa8739ef0e7053b4686d32595e2e /src/mesa/tnl
parent1ac5fd594a00d83f9b103ac6261bedabdb7e6b32 (diff)
mesa: add core support for ARB_half_float_vertex.
Adds the extension to the list + support to the APIs. also add t_draw.c support to convert for sw rast. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_draw.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 38757a0e288..d8c611031d2 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -108,6 +108,22 @@ convert_bgra_to_float(const struct gl_client_array *input,
}
}
+static void
+convert_half_to_float(const struct gl_client_array *input,
+ const GLubyte *ptr, GLfloat *fptr,
+ GLuint count, GLuint sz)
+{
+ GLuint i, j;
+
+ for (i = 0; i < count; i++) {
+ GLhalfARB *in = (GLhalfARB *)ptr;
+
+ for (j = 0; j < sz; j++) {
+ *fptr++ = _mesa_half_to_float(in[j]);
+ }
+ ptr += input->StrideB;
+ }
+}
/* Adjust pointer to point at first requested element, convert to
* floating point, populate VB->AttribPtr[].
@@ -155,6 +171,9 @@ static void _tnl_import_array( GLcontext *ctx,
case GL_DOUBLE:
CONVERT(GLdouble, (GLfloat));
break;
+ case GL_HALF_FLOAT:
+ convert_half_to_float(input, ptr, fptr, count, sz);
+ break;
default:
assert(0);
break;