OSDN Git Service

tnl: Add support for GL_FIXED.
authorChia-I Wu <olvaffe@gmail.com>
Tue, 12 Oct 2010 18:22:31 +0000 (14:22 -0400)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 10 Dec 2010 01:01:34 +0000 (20:01 -0500)
src/mesa/tnl/t_draw.c

index 30f1bf3..e2aac64 100644 (file)
@@ -174,6 +174,16 @@ static void _tnl_import_array( struct gl_context *ctx,
       case GL_HALF_FLOAT:
         convert_half_to_float(input, ptr, fptr, count, sz);
         break;
+      case GL_FIXED:
+         {
+            GLuint i, j;
+            for (i = 0; i < count; i++) {
+               const GLint *in = (GLint *) (ptr + i * input->StrideB);
+               for (j = 0; j < sz; j++)
+                  *fptr++ = *in++ / 65536.0f;
+            }
+         }
+         break;
       default:
         assert(0);
         break;