diff options
author | Dave Airlie <airlied@redhat.com> | 2010-01-23 12:29:33 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-23 12:29:33 +1000 |
commit | 782b6885c2573e1f004d9572eb386d9e1f392254 (patch) | |
tree | a4a148807912c88b6acc99f474ee84da5f38e62b /src/mesa/tnl/t_draw.c | |
parent | 092841892228c7b71dd5d6d463f1e0a37033eae9 (diff) | |
parent | d82b8038fda47e825cbd093b3ae198a85a163b25 (diff) |
Merge branch 'arb_half_float_vertex'
Diffstat (limited to 'src/mesa/tnl/t_draw.c')
-rw-r--r-- | src/mesa/tnl/t_draw.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 38757a0e28..d8c611031d 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; |