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 "cr_error.h"
|
---|
9 | #include "cr_protocol.h"
|
---|
10 | #include "cr_mem.h"
|
---|
11 | #include "cr_version.h"
|
---|
12 |
|
---|
13 | #if defined( GL_EXT_texture3D )
|
---|
14 | void crUnpackTexImage3DEXT( void )
|
---|
15 | {
|
---|
16 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
17 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
18 | GLenum internalformat = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
19 | GLsizei width = READ_DATA( sizeof( int ) + 12, GLsizei );
|
---|
20 | GLsizei height = READ_DATA( sizeof( int ) + 16, GLsizei );
|
---|
21 | GLsizei depth = READ_DATA( sizeof( int ) + 20, GLsizei );
|
---|
22 | GLint border = READ_DATA( sizeof( int ) + 24, GLint );
|
---|
23 | GLenum format = READ_DATA( sizeof( int ) + 28, GLenum );
|
---|
24 | GLenum type = READ_DATA( sizeof( int ) + 32, GLenum );
|
---|
25 | int noimagedata = READ_DATA( sizeof( int ) + 36, int );
|
---|
26 | GLvoid *pixels;
|
---|
27 |
|
---|
28 | /*If there's no imagedata send, it's either that passed pointer was NULL or
|
---|
29 | there was GL_PIXEL_UNPACK_BUFFER_ARB bound, in both cases 4bytes of passed
|
---|
30 | pointer would convert to either NULL or offset in the bound buffer.
|
---|
31 | */
|
---|
32 | if ( noimagedata )
|
---|
33 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+40, GLint);
|
---|
34 | else
|
---|
35 | pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );
|
---|
36 |
|
---|
37 | cr_unpackDispatch.TexImage3DEXT(target, level, internalformat, width,
|
---|
38 | height, depth, border, format, type,
|
---|
39 | pixels);
|
---|
40 | INCR_VAR_PTR();
|
---|
41 | }
|
---|
42 | #endif /* GL_EXT_texture3D */
|
---|
43 |
|
---|
44 | #if defined( CR_OPENGL_VERSION_1_2 )
|
---|
45 | void crUnpackTexImage3D( void )
|
---|
46 | {
|
---|
47 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
48 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
49 | GLint internalformat = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
50 | GLsizei width = READ_DATA( sizeof( int ) + 12, GLsizei );
|
---|
51 | GLsizei height = READ_DATA( sizeof( int ) + 16, GLsizei );
|
---|
52 | GLsizei depth = READ_DATA( sizeof( int ) + 20, GLsizei );
|
---|
53 | GLint border = READ_DATA( sizeof( int ) + 24, GLint );
|
---|
54 | GLenum format = READ_DATA( sizeof( int ) + 28, GLenum );
|
---|
55 | GLenum type = READ_DATA( sizeof( int ) + 32, GLenum );
|
---|
56 | int noimagedata = READ_DATA( sizeof( int ) + 36, int );
|
---|
57 | GLvoid *pixels;
|
---|
58 |
|
---|
59 | if ( noimagedata )
|
---|
60 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+40, GLint);
|
---|
61 | else
|
---|
62 | pixels = DATA_POINTER( sizeof( int ) + 44, GLvoid );
|
---|
63 |
|
---|
64 | cr_unpackDispatch.TexImage3D( target, level, internalformat, width, height,
|
---|
65 | depth, border, format, type, pixels );
|
---|
66 | INCR_VAR_PTR();
|
---|
67 | }
|
---|
68 | #endif /* CR_OPENGL_VERSION_1_2 */
|
---|
69 |
|
---|
70 | void crUnpackTexImage2D( void )
|
---|
71 | {
|
---|
72 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
73 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
74 | GLint internalformat = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
75 | GLsizei width = READ_DATA( sizeof( int ) + 12, GLsizei );
|
---|
76 | GLsizei height = READ_DATA( sizeof( int ) + 16, GLsizei );
|
---|
77 | GLint border = READ_DATA( sizeof( int ) + 20, GLint );
|
---|
78 | GLenum format = READ_DATA( sizeof( int ) + 24, GLenum );
|
---|
79 | GLenum type = READ_DATA( sizeof( int ) + 28, GLenum );
|
---|
80 | int noimagedata = READ_DATA( sizeof( int ) + 32, int );
|
---|
81 | GLvoid *pixels;
|
---|
82 |
|
---|
83 | if ( noimagedata )
|
---|
84 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+36, GLint);
|
---|
85 | else
|
---|
86 | pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
|
---|
87 |
|
---|
88 | cr_unpackDispatch.TexImage2D( target, level, internalformat, width, height,
|
---|
89 | border, format, type, pixels );
|
---|
90 | INCR_VAR_PTR();
|
---|
91 | }
|
---|
92 |
|
---|
93 | void crUnpackTexImage1D( void )
|
---|
94 | {
|
---|
95 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
96 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
97 | GLint internalformat = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
98 | GLsizei width = READ_DATA( sizeof( int ) + 12, GLsizei );
|
---|
99 | GLint border = READ_DATA( sizeof( int ) + 16, GLint );
|
---|
100 | GLenum format = READ_DATA( sizeof( int ) + 20, GLenum );
|
---|
101 | GLenum type = READ_DATA( sizeof( int ) + 24, GLenum );
|
---|
102 | int noimagedata = READ_DATA( sizeof( int ) + 28, int );
|
---|
103 | GLvoid *pixels;
|
---|
104 |
|
---|
105 | if ( noimagedata )
|
---|
106 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+32, GLint);
|
---|
107 | else
|
---|
108 | pixels = DATA_POINTER( sizeof( int ) + 36, GLvoid );
|
---|
109 |
|
---|
110 | cr_unpackDispatch.TexImage1D( target, level, internalformat, width, border,
|
---|
111 | format, type, pixels );
|
---|
112 | INCR_VAR_PTR();
|
---|
113 | }
|
---|
114 |
|
---|
115 | void crUnpackDeleteTextures( void )
|
---|
116 | {
|
---|
117 | GLsizei n = READ_DATA( sizeof( int ) + 0, GLsizei );
|
---|
118 | GLuint *textures = DATA_POINTER( sizeof( int ) + 4, GLuint );
|
---|
119 |
|
---|
120 | cr_unpackDispatch.DeleteTextures( n, textures );
|
---|
121 | INCR_VAR_PTR();
|
---|
122 | }
|
---|
123 |
|
---|
124 |
|
---|
125 | void crUnpackPrioritizeTextures( void )
|
---|
126 | {
|
---|
127 | GLsizei n = READ_DATA( sizeof( int ) + 0, GLsizei );
|
---|
128 | GLuint *textures = DATA_POINTER( sizeof( int ) + 4, GLuint );
|
---|
129 | GLclampf *priorities = DATA_POINTER( sizeof( int ) + 4 + n*sizeof( GLuint ),
|
---|
130 | GLclampf );
|
---|
131 |
|
---|
132 | cr_unpackDispatch.PrioritizeTextures( n, textures, priorities );
|
---|
133 | INCR_VAR_PTR();
|
---|
134 | }
|
---|
135 |
|
---|
136 | void crUnpackTexParameterfv( void )
|
---|
137 | {
|
---|
138 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
139 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
140 | GLfloat *params = DATA_POINTER( sizeof( int ) + 8, GLfloat );
|
---|
141 |
|
---|
142 | cr_unpackDispatch.TexParameterfv( target, pname, params );
|
---|
143 | INCR_VAR_PTR();
|
---|
144 | }
|
---|
145 |
|
---|
146 | void crUnpackTexParameteriv( void )
|
---|
147 | {
|
---|
148 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
149 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
150 | GLint *params = DATA_POINTER( sizeof( int ) + 8, GLint );
|
---|
151 |
|
---|
152 | cr_unpackDispatch.TexParameteriv( target, pname, params );
|
---|
153 | INCR_VAR_PTR();
|
---|
154 | }
|
---|
155 |
|
---|
156 | void crUnpackTexParameterf( void )
|
---|
157 | {
|
---|
158 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
159 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
160 | GLfloat param = READ_DATA( sizeof( int ) + 8, GLfloat );
|
---|
161 |
|
---|
162 | cr_unpackDispatch.TexParameterf( target, pname, param );
|
---|
163 | INCR_VAR_PTR();
|
---|
164 | }
|
---|
165 |
|
---|
166 | void crUnpackTexParameteri( void )
|
---|
167 | {
|
---|
168 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
169 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
170 | GLint param = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
171 |
|
---|
172 | cr_unpackDispatch.TexParameteri( target, pname, param );
|
---|
173 | INCR_VAR_PTR();
|
---|
174 | }
|
---|
175 |
|
---|
176 | #if defined(CR_OPENGL_VERSION_1_2)
|
---|
177 | void crUnpackTexSubImage3D( void )
|
---|
178 | {
|
---|
179 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
180 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
181 | GLint xoffset = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
182 | GLint yoffset = READ_DATA( sizeof( int ) + 12, GLint );
|
---|
183 | GLint zoffset = READ_DATA( sizeof( int ) + 16, GLint );
|
---|
184 | GLsizei width = READ_DATA( sizeof( int ) + 20, GLsizei );
|
---|
185 | GLsizei height = READ_DATA( sizeof( int ) + 24, GLsizei );
|
---|
186 | GLsizei depth = READ_DATA( sizeof( int ) + 28, GLsizei );
|
---|
187 | GLenum format = READ_DATA( sizeof( int ) + 32, GLenum );
|
---|
188 | GLenum type = READ_DATA( sizeof( int ) + 36, GLenum );
|
---|
189 | int noimagedata = READ_DATA( sizeof( int ) + 40, int );
|
---|
190 | GLvoid *pixels;
|
---|
191 |
|
---|
192 | if ( noimagedata )
|
---|
193 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+44, GLint);
|
---|
194 | else
|
---|
195 | pixels = DATA_POINTER( sizeof( int ) + 48, GLvoid );
|
---|
196 |
|
---|
197 | cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
|
---|
198 | cr_unpackDispatch.PixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
|
---|
199 | cr_unpackDispatch.PixelStorei( GL_UNPACK_SKIP_ROWS, 0 );
|
---|
200 | cr_unpackDispatch.PixelStorei( GL_UNPACK_ALIGNMENT, 1 );
|
---|
201 |
|
---|
202 | cr_unpackDispatch.TexSubImage3D(target, level, xoffset, yoffset, zoffset,
|
---|
203 | width, height, depth, format, type, pixels);
|
---|
204 | INCR_VAR_PTR();
|
---|
205 | }
|
---|
206 | #endif /* CR_OPENGL_VERSION_1_2 */
|
---|
207 |
|
---|
208 | void crUnpackTexSubImage2D( void )
|
---|
209 | {
|
---|
210 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
211 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
212 | GLint xoffset = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
213 | GLint yoffset = READ_DATA( sizeof( int ) + 12, GLint );
|
---|
214 | GLsizei width = READ_DATA( sizeof( int ) + 16, GLsizei );
|
---|
215 | GLsizei height = READ_DATA( sizeof( int ) + 20, GLsizei );
|
---|
216 | GLenum format = READ_DATA( sizeof( int ) + 24, GLenum );
|
---|
217 | GLenum type = READ_DATA( sizeof( int ) + 28, GLenum );
|
---|
218 | int noimagedata = READ_DATA( sizeof( int ) + 32, int );
|
---|
219 | GLvoid *pixels;
|
---|
220 |
|
---|
221 | if ( noimagedata )
|
---|
222 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+36, GLint);
|
---|
223 | else
|
---|
224 | pixels = DATA_POINTER( sizeof( int ) + 40, GLvoid );
|
---|
225 |
|
---|
226 | cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
|
---|
227 | cr_unpackDispatch.PixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
|
---|
228 | cr_unpackDispatch.PixelStorei( GL_UNPACK_SKIP_ROWS, 0 );
|
---|
229 | cr_unpackDispatch.PixelStorei( GL_UNPACK_ALIGNMENT, 1 );
|
---|
230 |
|
---|
231 | cr_unpackDispatch.TexSubImage2D( target, level, xoffset, yoffset, width,
|
---|
232 | height, format, type, pixels );
|
---|
233 | INCR_VAR_PTR();
|
---|
234 | }
|
---|
235 |
|
---|
236 | void crUnpackTexSubImage1D( void )
|
---|
237 | {
|
---|
238 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
239 | GLint level = READ_DATA( sizeof( int ) + 4, GLint );
|
---|
240 | GLint xoffset = READ_DATA( sizeof( int ) + 8, GLint );
|
---|
241 | GLsizei width = READ_DATA( sizeof( int ) + 12, GLsizei );
|
---|
242 | GLenum format = READ_DATA( sizeof( int ) + 16, GLenum );
|
---|
243 | GLenum type = READ_DATA( sizeof( int ) + 20, GLenum );
|
---|
244 | int noimagedata = READ_DATA( sizeof( int ) + 24, int );
|
---|
245 | GLvoid *pixels;
|
---|
246 |
|
---|
247 | if ( noimagedata )
|
---|
248 | pixels = (void*) (uintptr_t) READ_DATA(sizeof(int)+28, GLint);
|
---|
249 | else
|
---|
250 | pixels = DATA_POINTER( sizeof( int ) + 32, GLvoid );
|
---|
251 |
|
---|
252 | cr_unpackDispatch.PixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
|
---|
253 | cr_unpackDispatch.PixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );
|
---|
254 | cr_unpackDispatch.PixelStorei( GL_UNPACK_SKIP_ROWS, 0 );
|
---|
255 | cr_unpackDispatch.PixelStorei( GL_UNPACK_ALIGNMENT, 1 );
|
---|
256 |
|
---|
257 | cr_unpackDispatch.TexSubImage1D( target, level, xoffset, width, format,
|
---|
258 | type, pixels );
|
---|
259 | INCR_VAR_PTR();
|
---|
260 | }
|
---|
261 |
|
---|
262 |
|
---|
263 | void crUnpackTexEnvfv( void )
|
---|
264 | {
|
---|
265 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
266 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
267 | GLfloat *params = DATA_POINTER( sizeof( int ) + 8, GLfloat );
|
---|
268 |
|
---|
269 | cr_unpackDispatch.TexEnvfv( target, pname, params );
|
---|
270 | INCR_VAR_PTR();
|
---|
271 | }
|
---|
272 |
|
---|
273 | void crUnpackTexEnviv( void )
|
---|
274 | {
|
---|
275 | GLenum target = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
276 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
277 | GLint *params = DATA_POINTER( sizeof( int ) + 8, GLint );
|
---|
278 |
|
---|
279 | cr_unpackDispatch.TexEnviv( target, pname, params );
|
---|
280 | INCR_VAR_PTR();
|
---|
281 | }
|
---|
282 |
|
---|
283 | #define DATA_POINTER_DOUBLE( offset )
|
---|
284 |
|
---|
285 | void crUnpackTexGendv( void )
|
---|
286 | {
|
---|
287 | GLenum coord = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
288 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
289 | GLdouble params[4];
|
---|
290 | unsigned int n_param = READ_DATA( 0, int ) - ( sizeof(int) + 8 );
|
---|
291 |
|
---|
292 | if ( n_param > sizeof(params) )
|
---|
293 | crError( "crUnpackTexGendv: n_param=%d, expected <= %d\n", n_param,
|
---|
294 | (unsigned int)sizeof(params) );
|
---|
295 | crMemcpy( params, DATA_POINTER( sizeof( int ) + 8, GLdouble ), n_param );
|
---|
296 |
|
---|
297 | cr_unpackDispatch.TexGendv( coord, pname, params );
|
---|
298 | INCR_VAR_PTR();
|
---|
299 | }
|
---|
300 |
|
---|
301 | void crUnpackTexGenfv( void )
|
---|
302 | {
|
---|
303 | GLenum coord = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
304 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
305 | GLfloat *params = DATA_POINTER( sizeof( int ) + 8, GLfloat );
|
---|
306 |
|
---|
307 | cr_unpackDispatch.TexGenfv( coord, pname, params );
|
---|
308 | INCR_VAR_PTR();
|
---|
309 | }
|
---|
310 |
|
---|
311 | void crUnpackTexGeniv( void )
|
---|
312 | {
|
---|
313 | GLenum coord = READ_DATA( sizeof( int ) + 0, GLenum );
|
---|
314 | GLenum pname = READ_DATA( sizeof( int ) + 4, GLenum );
|
---|
315 | GLint *params = DATA_POINTER( sizeof( int ) + 8, GLint );
|
---|
316 |
|
---|
317 | cr_unpackDispatch.TexGeniv( coord, pname, params );
|
---|
318 | INCR_VAR_PTR();
|
---|
319 | }
|
---|
320 |
|
---|
321 | void crUnpackExtendAreTexturesResident( void )
|
---|
322 | {
|
---|
323 | GLsizei n = READ_DATA( 8, GLsizei );
|
---|
324 | const GLuint *textures = DATA_POINTER( 12, const GLuint );
|
---|
325 | SET_RETURN_PTR(12 + n * sizeof(GLuint));
|
---|
326 | SET_WRITEBACK_PTR(20 + n * sizeof(GLuint));
|
---|
327 | (void) cr_unpackDispatch.AreTexturesResident( n, textures, NULL );
|
---|
328 | }
|
---|
329 |
|
---|
330 |
|
---|
331 | void crUnpackExtendCompressedTexImage3DARB( void )
|
---|
332 | {
|
---|
333 | GLenum target = READ_DATA( 4 + sizeof(int) + 0, GLenum );
|
---|
334 | GLint level = READ_DATA( 4 + sizeof(int) + 4, GLint );
|
---|
335 | GLenum internalformat = READ_DATA( 4 + sizeof(int) + 8, GLenum );
|
---|
336 | GLsizei width = READ_DATA( 4 + sizeof(int) + 12, GLsizei );
|
---|
337 | GLsizei height = READ_DATA( 4 + sizeof(int) + 16, GLsizei );
|
---|
338 | GLsizei depth = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
|
---|
339 | GLint border = READ_DATA( 4 + sizeof(int) + 24, GLint );
|
---|
340 | GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 28, GLsizei );
|
---|
341 | int noimagedata = READ_DATA( 4 + sizeof(int) + 32, int );
|
---|
342 | GLvoid *pixels;
|
---|
343 |
|
---|
344 | if( noimagedata )
|
---|
345 | pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+36, GLint);
|
---|
346 | else
|
---|
347 | pixels = DATA_POINTER( 4 + sizeof(int) + 40, GLvoid );
|
---|
348 |
|
---|
349 | cr_unpackDispatch.CompressedTexImage3DARB(target, level, internalformat,
|
---|
350 | width, height, depth, border,
|
---|
351 | imagesize, pixels);
|
---|
352 | }
|
---|
353 |
|
---|
354 |
|
---|
355 | void crUnpackExtendCompressedTexImage2DARB( void )
|
---|
356 | {
|
---|
357 | GLenum target = READ_DATA( 4 + sizeof( int ) + 0, GLenum );
|
---|
358 | GLint level = READ_DATA( 4 + sizeof( int ) + 4, GLint );
|
---|
359 | GLenum internalformat = READ_DATA( 4 + sizeof( int ) + 8, GLenum );
|
---|
360 | GLsizei width = READ_DATA( 4 + sizeof( int ) + 12, GLsizei );
|
---|
361 | GLsizei height = READ_DATA( 4 + sizeof( int ) + 16, GLsizei );
|
---|
362 | GLint border = READ_DATA( 4 + sizeof( int ) + 20, GLint );
|
---|
363 | GLsizei imagesize = READ_DATA( 4 + sizeof( int ) + 24, GLsizei );
|
---|
364 | int noimagedata = READ_DATA( 4 + sizeof( int ) + 28, int );
|
---|
365 | GLvoid *pixels;
|
---|
366 |
|
---|
367 | if ( noimagedata )
|
---|
368 | pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+32, GLint);
|
---|
369 | else
|
---|
370 | pixels = DATA_POINTER( 4 + sizeof( int ) + 36, GLvoid );
|
---|
371 |
|
---|
372 | cr_unpackDispatch.CompressedTexImage2DARB( target, level, internalformat,
|
---|
373 | width, height, border, imagesize,
|
---|
374 | pixels );
|
---|
375 | }
|
---|
376 |
|
---|
377 |
|
---|
378 | void crUnpackExtendCompressedTexImage1DARB( void )
|
---|
379 | {
|
---|
380 | GLenum target = READ_DATA( 4 + sizeof(int) + 0, GLenum );
|
---|
381 | GLint level = READ_DATA( 4 + sizeof(int) + 4, GLint );
|
---|
382 | GLenum internalformat = READ_DATA( 4 + sizeof(int) + 8, GLenum );
|
---|
383 | GLsizei width = READ_DATA( 4 + sizeof(int) + 12, GLsizei );
|
---|
384 | GLint border = READ_DATA( 4 + sizeof(int) + 16, GLint );
|
---|
385 | GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
|
---|
386 | int noimagedata = READ_DATA( 4 + sizeof(int) + 24, int );
|
---|
387 | GLvoid *pixels;
|
---|
388 |
|
---|
389 | if( noimagedata )
|
---|
390 | pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+28, GLint);
|
---|
391 | else
|
---|
392 | pixels = DATA_POINTER( 4 + sizeof(int) + 32, GLvoid );
|
---|
393 |
|
---|
394 | cr_unpackDispatch.CompressedTexImage1DARB(target, level, internalformat,
|
---|
395 | width, border, imagesize, pixels);
|
---|
396 | }
|
---|
397 |
|
---|
398 |
|
---|
399 | void crUnpackExtendCompressedTexSubImage3DARB( void )
|
---|
400 | {
|
---|
401 | GLenum target = READ_DATA( 4 + sizeof(int) + 0, GLenum );
|
---|
402 | GLint level = READ_DATA( 4 + sizeof(int) + 4, GLint );
|
---|
403 | GLint xoffset = READ_DATA( 4 + sizeof(int) + 8, GLint );
|
---|
404 | GLint yoffset = READ_DATA( 4 + sizeof(int) + 12, GLint );
|
---|
405 | GLint zoffset = READ_DATA( 4 + sizeof(int) + 16, GLint );
|
---|
406 | GLsizei width = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
|
---|
407 | GLsizei height = READ_DATA( 4 + sizeof(int) + 24, GLsizei );
|
---|
408 | GLsizei depth = READ_DATA( 4 + sizeof(int) + 28, GLsizei );
|
---|
409 | GLenum format = READ_DATA( 4 + sizeof(int) + 32, GLenum );
|
---|
410 | GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 36, GLsizei );
|
---|
411 | int noimagedata = READ_DATA( 4 + sizeof(int) + 40, int );
|
---|
412 | GLvoid *pixels;
|
---|
413 |
|
---|
414 | if( noimagedata )
|
---|
415 | pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+44, GLint);
|
---|
416 | else
|
---|
417 | pixels = DATA_POINTER( 4 + sizeof(int) + 48, GLvoid );
|
---|
418 |
|
---|
419 | cr_unpackDispatch.CompressedTexSubImage3DARB(target, level, xoffset,
|
---|
420 | yoffset, zoffset, width,
|
---|
421 | height, depth, format,
|
---|
422 | imagesize, pixels);
|
---|
423 | }
|
---|
424 |
|
---|
425 |
|
---|
426 | void crUnpackExtendCompressedTexSubImage2DARB( void )
|
---|
427 | {
|
---|
428 | GLenum target = READ_DATA( 4 + sizeof(int) + 0, GLenum );
|
---|
429 | GLint level = READ_DATA( 4 + sizeof(int) + 4, GLint );
|
---|
430 | GLint xoffset = READ_DATA( 4 + sizeof(int) + 8, GLint );
|
---|
431 | GLint yoffset = READ_DATA( 4 + sizeof(int) + 12, GLint );
|
---|
432 | GLsizei width = READ_DATA( 4 + sizeof(int) + 16, GLsizei );
|
---|
433 | GLsizei height = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
|
---|
434 | GLenum format = READ_DATA( 4 + sizeof(int) + 24, GLenum );
|
---|
435 | GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 28, GLsizei );
|
---|
436 | int noimagedata = READ_DATA( 4 + sizeof(int) + 32, int );
|
---|
437 | GLvoid *pixels;
|
---|
438 |
|
---|
439 | if( noimagedata )
|
---|
440 | pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+36, GLint);
|
---|
441 | else
|
---|
442 | pixels = DATA_POINTER( 4 + sizeof(int) + 40, GLvoid );
|
---|
443 |
|
---|
444 | cr_unpackDispatch.CompressedTexSubImage2DARB(target, level, xoffset,
|
---|
445 | yoffset, width, height,
|
---|
446 | format, imagesize, pixels);
|
---|
447 | }
|
---|
448 |
|
---|
449 |
|
---|
450 | void crUnpackExtendCompressedTexSubImage1DARB( void )
|
---|
451 | {
|
---|
452 | GLenum target = READ_DATA( 4 + sizeof(int) + 0, GLenum );
|
---|
453 | GLint level = READ_DATA( 4 + sizeof(int) + 4, GLint );
|
---|
454 | GLint xoffset = READ_DATA( 4 + sizeof(int) + 8, GLint );
|
---|
455 | GLsizei width = READ_DATA( 4 + sizeof(int) + 12, GLsizei );
|
---|
456 | GLenum format = READ_DATA( 4 + sizeof(int) + 16, GLenum );
|
---|
457 | GLsizei imagesize = READ_DATA( 4 + sizeof(int) + 20, GLsizei );
|
---|
458 | int noimagedata = READ_DATA( 4 + sizeof(int) + 24, int );
|
---|
459 | GLvoid *pixels;
|
---|
460 |
|
---|
461 | if( noimagedata )
|
---|
462 | pixels = (void*) (uintptr_t) READ_DATA(4+sizeof(int)+28, GLint);
|
---|
463 | else
|
---|
464 | pixels = DATA_POINTER( 4 + sizeof(int) + 32, GLvoid );
|
---|
465 |
|
---|
466 | cr_unpackDispatch.CompressedTexSubImage1DARB(target, level, xoffset, width,
|
---|
467 | format, imagesize, pixels);
|
---|
468 | }
|
---|
469 |
|
---|
470 | void crUnpackExtendGetTexImage(void)
|
---|
471 | {
|
---|
472 | GLenum target = READ_DATA( 8, GLenum );
|
---|
473 | GLint level = READ_DATA( 12, GLint );
|
---|
474 | GLenum format = READ_DATA( 16, GLenum );
|
---|
475 | GLenum type = READ_DATA( 20, GLenum );
|
---|
476 | GLvoid *pixels;
|
---|
477 |
|
---|
478 | SET_RETURN_PTR(24);
|
---|
479 | SET_WRITEBACK_PTR(32);
|
---|
480 | pixels = DATA_POINTER(24, GLvoid);
|
---|
481 |
|
---|
482 | cr_unpackDispatch.GetTexImage(target, level, format, type, pixels);
|
---|
483 | }
|
---|
484 |
|
---|
485 | void crUnpackExtendGetCompressedTexImageARB(void)
|
---|
486 | {
|
---|
487 | GLenum target = READ_DATA( 8, GLenum );
|
---|
488 | GLint level = READ_DATA( 12, GLint );
|
---|
489 | GLvoid *img;
|
---|
490 |
|
---|
491 | SET_RETURN_PTR( 16 );
|
---|
492 | SET_WRITEBACK_PTR( 24 );
|
---|
493 | img = DATA_POINTER(16, GLvoid);
|
---|
494 |
|
---|
495 | cr_unpackDispatch.GetCompressedTexImageARB( target, level, img );
|
---|
496 | }
|
---|