1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include "unpacker.h"
|
---|
8 | #include "state/cr_bufferobject.h"
|
---|
9 |
|
---|
10 | void crUnpackPixelMapfv( void )
|
---|
11 | {
|
---|
12 | GLenum map = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
13 | GLsizei mapsize = READ_DATA( sizeof( int ) + 4, GLsizei );
|
---|
14 | int nodata = READ_DATA( sizeof(int) + 8, int);
|
---|
15 | GLfloat *values;
|
---|
16 |
|
---|
17 | if (nodata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
|
---|
18 | return;
|
---|
19 |
|
---|
20 | if (nodata)
|
---|
21 | values = (GLfloat*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
|
---|
22 | else
|
---|
23 | values = DATA_POINTER( sizeof( int ) + 16, GLfloat );
|
---|
24 |
|
---|
25 | cr_unpackDispatch.PixelMapfv( map, mapsize, values );
|
---|
26 | INCR_VAR_PTR();
|
---|
27 | }
|
---|
28 |
|
---|
29 | void crUnpackPixelMapuiv( void )
|
---|
30 | {
|
---|
31 | GLenum map = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
32 | GLsizei mapsize = READ_DATA( sizeof( int ) + 4, GLsizei );
|
---|
33 | int nodata = READ_DATA( sizeof(int) + 8, int);
|
---|
34 | GLuint *values;
|
---|
35 |
|
---|
36 | if (nodata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
|
---|
37 | return;
|
---|
38 |
|
---|
39 | if (nodata)
|
---|
40 | values = (GLuint*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
|
---|
41 | else
|
---|
42 | values = DATA_POINTER( sizeof( int ) + 16, GLuint );
|
---|
43 |
|
---|
44 | cr_unpackDispatch.PixelMapuiv( map, mapsize, values );
|
---|
45 | INCR_VAR_PTR();
|
---|
46 | }
|
---|
47 |
|
---|
48 | void crUnpackPixelMapusv( void )
|
---|
49 | {
|
---|
50 | GLenum map = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
51 | GLsizei mapsize = READ_DATA( sizeof( int ) + 4, GLsizei );
|
---|
52 | int nodata = READ_DATA( sizeof(int) + 8, int);
|
---|
53 | GLushort *values;
|
---|
54 |
|
---|
55 | if (nodata && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
|
---|
56 | return;
|
---|
57 |
|
---|
58 | if (nodata)
|
---|
59 | values = (GLushort*) (uintptr_t) READ_DATA(sizeof(int) + 12, GLint);
|
---|
60 | else
|
---|
61 | values = DATA_POINTER( sizeof( int ) + 16, GLushort );
|
---|
62 |
|
---|
63 | cr_unpackDispatch.PixelMapusv( map, mapsize, values );
|
---|
64 | INCR_VAR_PTR();
|
---|
65 | }
|
---|