blob: c4835478d2d7c67345afc9fb030278f701f0beac [file] [log] [blame]
David Li55c94cc2011-03-04 17:50:48 -08001/*
2 ** Copyright 2011, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16
David Li28ca2ab2011-03-01 16:08:10 -080017// auto generated by generate_api_cpp.py
18
David Lice30eb82011-03-28 10:39:28 -070019#include <utils/Debug.h>
20
David Li5c425f22011-03-10 16:40:37 -080021#include "src/header.h"
22#include "src/api.h"
David Li28ca2ab2011-03-01 16:08:10 -080023
David Lice30eb82011-03-28 10:39:28 -070024template<typename T> static int ToInt(const T & t)
25{
26 COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int));
27 return (int &)t;
28}
David Li28ca2ab2011-03-01 16:08:10 -080029
30void Debug_glActiveTexture(GLenum texture)
31{
David Li55c94cc2011-03-04 17:50:48 -080032 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -080033 struct : public FunctionCall {
34 GLenum texture;
35
36 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
37 _c->glActiveTexture(texture);
38 return 0;
39 }
40 } caller;
41 caller.texture = texture;
42
43 msg.set_arg0(texture);
44
David Lifbfc7032011-03-21 16:25:58 -070045 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glActiveTexture);
David Li28ca2ab2011-03-01 16:08:10 -080046}
47
48void Debug_glAttachShader(GLuint program, GLuint shader)
49{
David Li55c94cc2011-03-04 17:50:48 -080050 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -080051 struct : public FunctionCall {
52 GLuint program;
53 GLuint shader;
54
55 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
56 _c->glAttachShader(program, shader);
57 return 0;
58 }
59 } caller;
60 caller.program = program;
61 caller.shader = shader;
62
63 msg.set_arg0(program);
64 msg.set_arg1(shader);
65
David Lifbfc7032011-03-21 16:25:58 -070066 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glAttachShader);
David Li28ca2ab2011-03-01 16:08:10 -080067}
68
69void Debug_glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
70{
David Li55c94cc2011-03-04 17:50:48 -080071 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -080072 struct : public FunctionCall {
73 GLuint program;
74 GLuint index;
75 const GLchar* name;
76
77 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
78 _c->glBindAttribLocation(program, index, name);
79 return 0;
80 }
81 } caller;
82 caller.program = program;
83 caller.index = index;
84 caller.name = name;
85
86 msg.set_arg0(program);
87 msg.set_arg1(index);
88 msg.set_arg2(ToInt(name));
89
90 // FIXME: check for pointer usage
91 msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
David Lifbfc7032011-03-21 16:25:58 -070092 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindAttribLocation);
David Li28ca2ab2011-03-01 16:08:10 -080093}
94
95void Debug_glBindBuffer(GLenum target, GLuint buffer)
96{
David Li55c94cc2011-03-04 17:50:48 -080097 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -080098 struct : public FunctionCall {
99 GLenum target;
100 GLuint buffer;
101
102 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
103 _c->glBindBuffer(target, buffer);
David Li5c425f22011-03-10 16:40:37 -0800104 getDbgContextThreadSpecific()->glBindBuffer(target, buffer);
David Li55c94cc2011-03-04 17:50:48 -0800105 return 0;
106 }
107 } caller;
108 caller.target = target;
109 caller.buffer = buffer;
110
111 msg.set_arg0(target);
112 msg.set_arg1(buffer);
113
David Lifbfc7032011-03-21 16:25:58 -0700114 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindBuffer);
David Li28ca2ab2011-03-01 16:08:10 -0800115}
116
117void Debug_glBindFramebuffer(GLenum target, GLuint framebuffer)
118{
David Li55c94cc2011-03-04 17:50:48 -0800119 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800120 struct : public FunctionCall {
121 GLenum target;
122 GLuint framebuffer;
123
124 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
125 _c->glBindFramebuffer(target, framebuffer);
126 return 0;
127 }
128 } caller;
129 caller.target = target;
130 caller.framebuffer = framebuffer;
131
132 msg.set_arg0(target);
133 msg.set_arg1(framebuffer);
134
David Lifbfc7032011-03-21 16:25:58 -0700135 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindFramebuffer);
David Li28ca2ab2011-03-01 16:08:10 -0800136}
137
138void Debug_glBindRenderbuffer(GLenum target, GLuint renderbuffer)
139{
David Li55c94cc2011-03-04 17:50:48 -0800140 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800141 struct : public FunctionCall {
142 GLenum target;
143 GLuint renderbuffer;
144
145 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
146 _c->glBindRenderbuffer(target, renderbuffer);
147 return 0;
148 }
149 } caller;
150 caller.target = target;
151 caller.renderbuffer = renderbuffer;
152
153 msg.set_arg0(target);
154 msg.set_arg1(renderbuffer);
155
David Lifbfc7032011-03-21 16:25:58 -0700156 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindRenderbuffer);
David Li28ca2ab2011-03-01 16:08:10 -0800157}
158
159void Debug_glBindTexture(GLenum target, GLuint texture)
160{
David Li55c94cc2011-03-04 17:50:48 -0800161 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800162 struct : public FunctionCall {
163 GLenum target;
164 GLuint texture;
165
166 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
167 _c->glBindTexture(target, texture);
168 return 0;
169 }
170 } caller;
171 caller.target = target;
172 caller.texture = texture;
173
174 msg.set_arg0(target);
175 msg.set_arg1(texture);
176
David Lifbfc7032011-03-21 16:25:58 -0700177 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBindTexture);
David Li28ca2ab2011-03-01 16:08:10 -0800178}
179
180void Debug_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
181{
David Li55c94cc2011-03-04 17:50:48 -0800182 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800183 struct : public FunctionCall {
184 GLclampf red;
185 GLclampf green;
186 GLclampf blue;
187 GLclampf alpha;
188
189 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
190 _c->glBlendColor(red, green, blue, alpha);
191 return 0;
192 }
193 } caller;
194 caller.red = red;
195 caller.green = green;
196 caller.blue = blue;
197 caller.alpha = alpha;
198
199 msg.set_arg0(ToInt(red));
200 msg.set_arg1(ToInt(green));
201 msg.set_arg2(ToInt(blue));
202 msg.set_arg3(ToInt(alpha));
203
David Lifbfc7032011-03-21 16:25:58 -0700204 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendColor);
David Li28ca2ab2011-03-01 16:08:10 -0800205}
206
207void Debug_glBlendEquation( GLenum mode )
208{
David Li55c94cc2011-03-04 17:50:48 -0800209 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800210 struct : public FunctionCall {
211 GLenum mode;
212
213 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
214 _c->glBlendEquation(mode);
215 return 0;
216 }
217 } caller;
218 caller.mode = mode;
219
220 msg.set_arg0(mode);
221
David Lifbfc7032011-03-21 16:25:58 -0700222 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendEquation);
David Li28ca2ab2011-03-01 16:08:10 -0800223}
224
225void Debug_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
226{
David Li55c94cc2011-03-04 17:50:48 -0800227 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800228 struct : public FunctionCall {
229 GLenum modeRGB;
230 GLenum modeAlpha;
231
232 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
233 _c->glBlendEquationSeparate(modeRGB, modeAlpha);
234 return 0;
235 }
236 } caller;
237 caller.modeRGB = modeRGB;
238 caller.modeAlpha = modeAlpha;
239
240 msg.set_arg0(modeRGB);
241 msg.set_arg1(modeAlpha);
242
David Lifbfc7032011-03-21 16:25:58 -0700243 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendEquationSeparate);
David Li28ca2ab2011-03-01 16:08:10 -0800244}
245
246void Debug_glBlendFunc(GLenum sfactor, GLenum dfactor)
247{
David Li55c94cc2011-03-04 17:50:48 -0800248 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800249 struct : public FunctionCall {
250 GLenum sfactor;
251 GLenum dfactor;
252
253 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
254 _c->glBlendFunc(sfactor, dfactor);
255 return 0;
256 }
257 } caller;
258 caller.sfactor = sfactor;
259 caller.dfactor = dfactor;
260
261 msg.set_arg0(sfactor);
262 msg.set_arg1(dfactor);
263
David Lifbfc7032011-03-21 16:25:58 -0700264 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendFunc);
David Li28ca2ab2011-03-01 16:08:10 -0800265}
266
267void Debug_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
268{
David Li55c94cc2011-03-04 17:50:48 -0800269 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800270 struct : public FunctionCall {
271 GLenum srcRGB;
272 GLenum dstRGB;
273 GLenum srcAlpha;
274 GLenum dstAlpha;
275
276 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
277 _c->glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
278 return 0;
279 }
280 } caller;
281 caller.srcRGB = srcRGB;
282 caller.dstRGB = dstRGB;
283 caller.srcAlpha = srcAlpha;
284 caller.dstAlpha = dstAlpha;
285
286 msg.set_arg0(srcRGB);
287 msg.set_arg1(dstRGB);
288 msg.set_arg2(srcAlpha);
289 msg.set_arg3(dstAlpha);
290
David Lifbfc7032011-03-21 16:25:58 -0700291 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBlendFuncSeparate);
David Li28ca2ab2011-03-01 16:08:10 -0800292}
293
David Li28ca2ab2011-03-01 16:08:10 -0800294void Debug_glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
295{
David Li55c94cc2011-03-04 17:50:48 -0800296 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800297 struct : public FunctionCall {
298 GLenum target;
299 GLsizeiptr size;
300 const GLvoid* data;
301 GLenum usage;
302
303 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
304 _c->glBufferData(target, size, data, usage);
David Li5c425f22011-03-10 16:40:37 -0800305 getDbgContextThreadSpecific()->glBufferData(target, size, data, usage);
David Li55c94cc2011-03-04 17:50:48 -0800306 return 0;
307 }
308 } caller;
309 caller.target = target;
310 caller.size = size;
311 caller.data = data;
312 caller.usage = usage;
313
314 msg.set_arg0(target);
315 msg.set_arg1(size);
316 msg.set_arg2(ToInt(data));
317 msg.set_arg3(usage);
318
319 // FIXME: check for pointer usage
320 msg.mutable_data()->assign(reinterpret_cast<const char *>(data), size * sizeof(char));
David Lifbfc7032011-03-21 16:25:58 -0700321 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBufferData);
David Li28ca2ab2011-03-01 16:08:10 -0800322}
323
David Li28ca2ab2011-03-01 16:08:10 -0800324void Debug_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
325{
David Li55c94cc2011-03-04 17:50:48 -0800326 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800327 struct : public FunctionCall {
328 GLenum target;
329 GLintptr offset;
330 GLsizeiptr size;
331 const GLvoid* data;
332
333 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
334 _c->glBufferSubData(target, offset, size, data);
David Li5c425f22011-03-10 16:40:37 -0800335 getDbgContextThreadSpecific()->glBufferSubData(target, offset, size, data);
David Li55c94cc2011-03-04 17:50:48 -0800336 return 0;
337 }
338 } caller;
339 caller.target = target;
340 caller.offset = offset;
341 caller.size = size;
342 caller.data = data;
343
344 msg.set_arg0(target);
345 msg.set_arg1(offset);
346 msg.set_arg2(size);
347 msg.set_arg3(ToInt(data));
348
349 // FIXME: check for pointer usage
350 msg.mutable_data()->assign(reinterpret_cast<const char *>(data), size * sizeof(char));
David Lifbfc7032011-03-21 16:25:58 -0700351 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glBufferSubData);
David Li28ca2ab2011-03-01 16:08:10 -0800352}
353
354GLenum Debug_glCheckFramebufferStatus(GLenum target)
355{
David Li55c94cc2011-03-04 17:50:48 -0800356 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800357 struct : public FunctionCall {
358 GLenum target;
359
360 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
361 const int * ret = reinterpret_cast<const int *>(_c->glCheckFramebufferStatus(target));
362 msg.set_ret(ToInt(ret));
363 return ret;
364 }
365 } caller;
366 caller.target = target;
367
368 msg.set_arg0(target);
369
David Lifbfc7032011-03-21 16:25:58 -0700370 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCheckFramebufferStatus);
David Li55c94cc2011-03-04 17:50:48 -0800371 return reinterpret_cast<GLenum>(ret);
David Li28ca2ab2011-03-01 16:08:10 -0800372}
373
374void Debug_glClear(GLbitfield mask)
375{
David Li55c94cc2011-03-04 17:50:48 -0800376 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800377 struct : public FunctionCall {
378 GLbitfield mask;
379
380 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
381 _c->glClear(mask);
382 return 0;
383 }
384 } caller;
385 caller.mask = mask;
386
387 msg.set_arg0(mask);
388
David Lifbfc7032011-03-21 16:25:58 -0700389 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClear);
David Li28ca2ab2011-03-01 16:08:10 -0800390}
391
392void Debug_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
393{
David Li55c94cc2011-03-04 17:50:48 -0800394 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800395 struct : public FunctionCall {
396 GLclampf red;
397 GLclampf green;
398 GLclampf blue;
399 GLclampf alpha;
400
401 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
402 _c->glClearColor(red, green, blue, alpha);
403 return 0;
404 }
405 } caller;
406 caller.red = red;
407 caller.green = green;
408 caller.blue = blue;
409 caller.alpha = alpha;
410
411 msg.set_arg0(ToInt(red));
412 msg.set_arg1(ToInt(green));
413 msg.set_arg2(ToInt(blue));
414 msg.set_arg3(ToInt(alpha));
415
David Lifbfc7032011-03-21 16:25:58 -0700416 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearColor);
David Li28ca2ab2011-03-01 16:08:10 -0800417}
418
419void Debug_glClearDepthf(GLclampf depth)
420{
David Li55c94cc2011-03-04 17:50:48 -0800421 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800422 struct : public FunctionCall {
423 GLclampf depth;
424
425 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
426 _c->glClearDepthf(depth);
427 return 0;
428 }
429 } caller;
430 caller.depth = depth;
431
432 msg.set_arg0(ToInt(depth));
433
David Lifbfc7032011-03-21 16:25:58 -0700434 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearDepthf);
David Li28ca2ab2011-03-01 16:08:10 -0800435}
436
437void Debug_glClearStencil(GLint s)
438{
David Li55c94cc2011-03-04 17:50:48 -0800439 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800440 struct : public FunctionCall {
441 GLint s;
442
443 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
444 _c->glClearStencil(s);
445 return 0;
446 }
447 } caller;
448 caller.s = s;
449
450 msg.set_arg0(s);
451
David Lifbfc7032011-03-21 16:25:58 -0700452 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glClearStencil);
David Li28ca2ab2011-03-01 16:08:10 -0800453}
454
455void Debug_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
456{
David Li55c94cc2011-03-04 17:50:48 -0800457 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800458 struct : public FunctionCall {
459 GLboolean red;
460 GLboolean green;
461 GLboolean blue;
462 GLboolean alpha;
463
464 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
465 _c->glColorMask(red, green, blue, alpha);
466 return 0;
467 }
468 } caller;
469 caller.red = red;
470 caller.green = green;
471 caller.blue = blue;
472 caller.alpha = alpha;
473
474 msg.set_arg0(red);
475 msg.set_arg1(green);
476 msg.set_arg2(blue);
477 msg.set_arg3(alpha);
478
David Lifbfc7032011-03-21 16:25:58 -0700479 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glColorMask);
David Li28ca2ab2011-03-01 16:08:10 -0800480}
481
482void Debug_glCompileShader(GLuint shader)
483{
David Li55c94cc2011-03-04 17:50:48 -0800484 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800485 struct : public FunctionCall {
486 GLuint shader;
487
488 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
489 _c->glCompileShader(shader);
490 return 0;
491 }
492 } caller;
493 caller.shader = shader;
494
495 msg.set_arg0(shader);
496
David Lifbfc7032011-03-21 16:25:58 -0700497 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompileShader);
David Li28ca2ab2011-03-01 16:08:10 -0800498}
499
500// FIXME: this function has pointers, it should be hand written
501void Debug_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
502{
David Li55c94cc2011-03-04 17:50:48 -0800503 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800504 struct : public FunctionCall {
505 GLenum target;
506 GLint level;
507 GLenum internalformat;
508 GLsizei width;
509 GLsizei height;
510 GLint border;
511 GLsizei imageSize;
512 const GLvoid* data;
513
514 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
515 _c->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
516 return 0;
517 }
518 } caller;
519 caller.target = target;
520 caller.level = level;
521 caller.internalformat = internalformat;
522 caller.width = width;
523 caller.height = height;
524 caller.border = border;
525 caller.imageSize = imageSize;
526 caller.data = data;
527
528 msg.set_arg0(target);
529 msg.set_arg1(level);
530 msg.set_arg2(internalformat);
531 msg.set_arg3(width);
532 msg.set_arg4(height);
533 msg.set_arg5(border);
534 msg.set_arg6(imageSize);
535 msg.set_arg7(ToInt(data));
536
537 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -0700538 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompressedTexImage2D);
David Li28ca2ab2011-03-01 16:08:10 -0800539}
540
541// FIXME: this function has pointers, it should be hand written
542void Debug_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
543{
David Li55c94cc2011-03-04 17:50:48 -0800544 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800545 struct : public FunctionCall {
546 GLenum target;
547 GLint level;
548 GLint xoffset;
549 GLint yoffset;
550 GLsizei width;
551 GLsizei height;
552 GLenum format;
553 GLsizei imageSize;
554 const GLvoid* data;
555
556 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
557 _c->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
558 return 0;
559 }
560 } caller;
561 caller.target = target;
562 caller.level = level;
563 caller.xoffset = xoffset;
564 caller.yoffset = yoffset;
565 caller.width = width;
566 caller.height = height;
567 caller.format = format;
568 caller.imageSize = imageSize;
569 caller.data = data;
570
571 msg.set_arg0(target);
572 msg.set_arg1(level);
573 msg.set_arg2(xoffset);
574 msg.set_arg3(yoffset);
575 msg.set_arg4(width);
576 msg.set_arg5(height);
577 msg.set_arg6(format);
578 msg.set_arg7(imageSize);
579 msg.set_arg8(ToInt(data));
580
581 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -0700582 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCompressedTexSubImage2D);
David Li28ca2ab2011-03-01 16:08:10 -0800583}
584
585void Debug_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
586{
David Li55c94cc2011-03-04 17:50:48 -0800587 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800588 struct : public FunctionCall {
589 GLenum target;
590 GLint level;
591 GLenum internalformat;
592 GLint x;
593 GLint y;
594 GLsizei width;
595 GLsizei height;
596 GLint border;
597
598 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
599 _c->glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
David Lie2ad4d02011-04-08 18:41:00 -0700600#ifdef EXTEND_AFTER_CALL_Debug_glCopyTexImage2D
601 EXTEND_AFTER_CALL_Debug_glCopyTexImage2D;
602#endif
David Li55c94cc2011-03-04 17:50:48 -0800603 return 0;
604 }
605 } caller;
606 caller.target = target;
607 caller.level = level;
608 caller.internalformat = internalformat;
609 caller.x = x;
610 caller.y = y;
611 caller.width = width;
612 caller.height = height;
613 caller.border = border;
614
615 msg.set_arg0(target);
616 msg.set_arg1(level);
617 msg.set_arg2(internalformat);
618 msg.set_arg3(x);
619 msg.set_arg4(y);
620 msg.set_arg5(width);
621 msg.set_arg6(height);
622 msg.set_arg7(border);
623
David Lie2ad4d02011-04-08 18:41:00 -0700624#ifdef EXTEND_Debug_glCopyTexImage2D
David Li5c425f22011-03-10 16:40:37 -0800625 EXTEND_Debug_glCopyTexImage2D;
David Lie2ad4d02011-04-08 18:41:00 -0700626#endif
David Lifbfc7032011-03-21 16:25:58 -0700627 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCopyTexImage2D);
David Li28ca2ab2011-03-01 16:08:10 -0800628}
629
630void Debug_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
631{
David Li55c94cc2011-03-04 17:50:48 -0800632 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800633 struct : public FunctionCall {
634 GLenum target;
635 GLint level;
636 GLint xoffset;
637 GLint yoffset;
638 GLint x;
639 GLint y;
640 GLsizei width;
641 GLsizei height;
642
643 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
644 _c->glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
David Lie2ad4d02011-04-08 18:41:00 -0700645#ifdef EXTEND_AFTER_CALL_Debug_glCopyTexSubImage2D
646 EXTEND_AFTER_CALL_Debug_glCopyTexSubImage2D;
647#endif
David Li55c94cc2011-03-04 17:50:48 -0800648 return 0;
649 }
650 } caller;
651 caller.target = target;
652 caller.level = level;
653 caller.xoffset = xoffset;
654 caller.yoffset = yoffset;
655 caller.x = x;
656 caller.y = y;
657 caller.width = width;
658 caller.height = height;
659
660 msg.set_arg0(target);
661 msg.set_arg1(level);
662 msg.set_arg2(xoffset);
663 msg.set_arg3(yoffset);
664 msg.set_arg4(x);
665 msg.set_arg5(y);
666 msg.set_arg6(width);
667 msg.set_arg7(height);
668
David Lie2ad4d02011-04-08 18:41:00 -0700669#ifdef EXTEND_Debug_glCopyTexSubImage2D
David Li5c425f22011-03-10 16:40:37 -0800670 EXTEND_Debug_glCopyTexSubImage2D;
David Lie2ad4d02011-04-08 18:41:00 -0700671#endif
David Lifbfc7032011-03-21 16:25:58 -0700672 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCopyTexSubImage2D);
David Li28ca2ab2011-03-01 16:08:10 -0800673}
674
675GLuint Debug_glCreateProgram(void)
676{
David Li55c94cc2011-03-04 17:50:48 -0800677 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800678 struct : public FunctionCall {
679
680 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
681 const int * ret = reinterpret_cast<const int *>(_c->glCreateProgram());
682 msg.set_ret(ToInt(ret));
683 return ret;
684 }
685 } caller;
686
687
David Lifbfc7032011-03-21 16:25:58 -0700688 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCreateProgram);
David Li55c94cc2011-03-04 17:50:48 -0800689 return reinterpret_cast<GLuint>(ret);
David Li28ca2ab2011-03-01 16:08:10 -0800690}
691
692GLuint Debug_glCreateShader(GLenum type)
693{
David Li55c94cc2011-03-04 17:50:48 -0800694 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800695 struct : public FunctionCall {
696 GLenum type;
697
698 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
699 const int * ret = reinterpret_cast<const int *>(_c->glCreateShader(type));
700 msg.set_ret(ToInt(ret));
701 return ret;
702 }
703 } caller;
704 caller.type = type;
705
706 msg.set_arg0(type);
707
David Lifbfc7032011-03-21 16:25:58 -0700708 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCreateShader);
David Li55c94cc2011-03-04 17:50:48 -0800709 return reinterpret_cast<GLuint>(ret);
David Li28ca2ab2011-03-01 16:08:10 -0800710}
711
712void Debug_glCullFace(GLenum mode)
713{
David Li55c94cc2011-03-04 17:50:48 -0800714 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800715 struct : public FunctionCall {
716 GLenum mode;
717
718 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
719 _c->glCullFace(mode);
720 return 0;
721 }
722 } caller;
723 caller.mode = mode;
724
725 msg.set_arg0(mode);
726
David Lifbfc7032011-03-21 16:25:58 -0700727 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glCullFace);
David Li28ca2ab2011-03-01 16:08:10 -0800728}
729
730void Debug_glDeleteBuffers(GLsizei n, const GLuint* buffers)
731{
David Li55c94cc2011-03-04 17:50:48 -0800732 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800733 struct : public FunctionCall {
734 GLsizei n;
735 const GLuint* buffers;
736
737 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
738 _c->glDeleteBuffers(n, buffers);
David Li5c425f22011-03-10 16:40:37 -0800739 getDbgContextThreadSpecific()->glDeleteBuffers(n, buffers);
David Li55c94cc2011-03-04 17:50:48 -0800740 return 0;
741 }
742 } caller;
743 caller.n = n;
744 caller.buffers = buffers;
745
746 msg.set_arg0(n);
747 msg.set_arg1(ToInt(buffers));
748
749 // FIXME: check for pointer usage
750 msg.mutable_data()->assign(reinterpret_cast<const char *>(buffers), n * sizeof(GLuint));
David Lifbfc7032011-03-21 16:25:58 -0700751 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteBuffers);
David Li28ca2ab2011-03-01 16:08:10 -0800752}
753
754void Debug_glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
755{
David Li55c94cc2011-03-04 17:50:48 -0800756 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800757 struct : public FunctionCall {
758 GLsizei n;
759 const GLuint* framebuffers;
760
761 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
762 _c->glDeleteFramebuffers(n, framebuffers);
763 return 0;
764 }
765 } caller;
766 caller.n = n;
767 caller.framebuffers = framebuffers;
768
769 msg.set_arg0(n);
770 msg.set_arg1(ToInt(framebuffers));
771
772 // FIXME: check for pointer usage
773 msg.mutable_data()->assign(reinterpret_cast<const char *>(framebuffers), n * sizeof(GLuint));
David Lifbfc7032011-03-21 16:25:58 -0700774 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteFramebuffers);
David Li28ca2ab2011-03-01 16:08:10 -0800775}
776
777void Debug_glDeleteProgram(GLuint program)
778{
David Li55c94cc2011-03-04 17:50:48 -0800779 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800780 struct : public FunctionCall {
781 GLuint program;
782
783 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
784 _c->glDeleteProgram(program);
785 return 0;
786 }
787 } caller;
788 caller.program = program;
789
790 msg.set_arg0(program);
791
David Lifbfc7032011-03-21 16:25:58 -0700792 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteProgram);
David Li28ca2ab2011-03-01 16:08:10 -0800793}
794
795void Debug_glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
796{
David Li55c94cc2011-03-04 17:50:48 -0800797 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800798 struct : public FunctionCall {
799 GLsizei n;
800 const GLuint* renderbuffers;
801
802 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
803 _c->glDeleteRenderbuffers(n, renderbuffers);
804 return 0;
805 }
806 } caller;
807 caller.n = n;
808 caller.renderbuffers = renderbuffers;
809
810 msg.set_arg0(n);
811 msg.set_arg1(ToInt(renderbuffers));
812
813 // FIXME: check for pointer usage
814 msg.mutable_data()->assign(reinterpret_cast<const char *>(renderbuffers), n * sizeof(GLuint));
David Lifbfc7032011-03-21 16:25:58 -0700815 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteRenderbuffers);
David Li28ca2ab2011-03-01 16:08:10 -0800816}
817
818void Debug_glDeleteShader(GLuint shader)
819{
David Li55c94cc2011-03-04 17:50:48 -0800820 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800821 struct : public FunctionCall {
822 GLuint shader;
823
824 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
825 _c->glDeleteShader(shader);
826 return 0;
827 }
828 } caller;
829 caller.shader = shader;
830
831 msg.set_arg0(shader);
832
David Lifbfc7032011-03-21 16:25:58 -0700833 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteShader);
David Li28ca2ab2011-03-01 16:08:10 -0800834}
835
836void Debug_glDeleteTextures(GLsizei n, const GLuint* textures)
837{
David Li55c94cc2011-03-04 17:50:48 -0800838 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800839 struct : public FunctionCall {
840 GLsizei n;
841 const GLuint* textures;
842
843 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
844 _c->glDeleteTextures(n, textures);
845 return 0;
846 }
847 } caller;
848 caller.n = n;
849 caller.textures = textures;
850
851 msg.set_arg0(n);
852 msg.set_arg1(ToInt(textures));
853
854 // FIXME: check for pointer usage
855 msg.mutable_data()->assign(reinterpret_cast<const char *>(textures), n * sizeof(GLuint));
David Lifbfc7032011-03-21 16:25:58 -0700856 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDeleteTextures);
David Li28ca2ab2011-03-01 16:08:10 -0800857}
858
859void Debug_glDepthFunc(GLenum func)
860{
David Li55c94cc2011-03-04 17:50:48 -0800861 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800862 struct : public FunctionCall {
863 GLenum func;
864
865 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
866 _c->glDepthFunc(func);
867 return 0;
868 }
869 } caller;
870 caller.func = func;
871
872 msg.set_arg0(func);
873
David Lifbfc7032011-03-21 16:25:58 -0700874 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthFunc);
David Li28ca2ab2011-03-01 16:08:10 -0800875}
876
877void Debug_glDepthMask(GLboolean flag)
878{
David Li55c94cc2011-03-04 17:50:48 -0800879 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800880 struct : public FunctionCall {
881 GLboolean flag;
882
883 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
884 _c->glDepthMask(flag);
885 return 0;
886 }
887 } caller;
888 caller.flag = flag;
889
890 msg.set_arg0(flag);
891
David Lifbfc7032011-03-21 16:25:58 -0700892 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthMask);
David Li28ca2ab2011-03-01 16:08:10 -0800893}
894
895void Debug_glDepthRangef(GLclampf zNear, GLclampf zFar)
896{
David Li55c94cc2011-03-04 17:50:48 -0800897 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800898 struct : public FunctionCall {
899 GLclampf zNear;
900 GLclampf zFar;
901
902 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
903 _c->glDepthRangef(zNear, zFar);
904 return 0;
905 }
906 } caller;
907 caller.zNear = zNear;
908 caller.zFar = zFar;
909
910 msg.set_arg0(ToInt(zNear));
911 msg.set_arg1(ToInt(zFar));
912
David Lifbfc7032011-03-21 16:25:58 -0700913 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDepthRangef);
David Li28ca2ab2011-03-01 16:08:10 -0800914}
915
916void Debug_glDetachShader(GLuint program, GLuint shader)
917{
David Li55c94cc2011-03-04 17:50:48 -0800918 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800919 struct : public FunctionCall {
920 GLuint program;
921 GLuint shader;
922
923 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
924 _c->glDetachShader(program, shader);
925 return 0;
926 }
927 } caller;
928 caller.program = program;
929 caller.shader = shader;
930
931 msg.set_arg0(program);
932 msg.set_arg1(shader);
933
David Lifbfc7032011-03-21 16:25:58 -0700934 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDetachShader);
David Li28ca2ab2011-03-01 16:08:10 -0800935}
936
937void Debug_glDisable(GLenum cap)
938{
David Li55c94cc2011-03-04 17:50:48 -0800939 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800940 struct : public FunctionCall {
941 GLenum cap;
942
943 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
944 _c->glDisable(cap);
945 return 0;
946 }
947 } caller;
948 caller.cap = cap;
949
950 msg.set_arg0(cap);
951
David Lifbfc7032011-03-21 16:25:58 -0700952 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDisable);
David Li28ca2ab2011-03-01 16:08:10 -0800953}
954
955void Debug_glDisableVertexAttribArray(GLuint index)
956{
David Li55c94cc2011-03-04 17:50:48 -0800957 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800958 struct : public FunctionCall {
959 GLuint index;
David Li28ca2ab2011-03-01 16:08:10 -0800960
David Li55c94cc2011-03-04 17:50:48 -0800961 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
962 _c->glDisableVertexAttribArray(index);
David Li5c425f22011-03-10 16:40:37 -0800963 getDbgContextThreadSpecific()->glDisableVertexAttribArray(index);
David Li55c94cc2011-03-04 17:50:48 -0800964 return 0;
965 }
966 } caller;
967 caller.index = index;
David Li28ca2ab2011-03-01 16:08:10 -0800968
David Li55c94cc2011-03-04 17:50:48 -0800969 msg.set_arg0(index);
970
David Lifbfc7032011-03-21 16:25:58 -0700971 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glDisableVertexAttribArray);
David Li28ca2ab2011-03-01 16:08:10 -0800972}
973
974void Debug_glEnable(GLenum cap)
975{
David Li55c94cc2011-03-04 17:50:48 -0800976 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800977 struct : public FunctionCall {
978 GLenum cap;
979
980 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
981 _c->glEnable(cap);
982 return 0;
983 }
984 } caller;
985 caller.cap = cap;
986
987 msg.set_arg0(cap);
988
David Lifbfc7032011-03-21 16:25:58 -0700989 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glEnable);
David Li28ca2ab2011-03-01 16:08:10 -0800990}
991
992void Debug_glEnableVertexAttribArray(GLuint index)
993{
David Li55c94cc2011-03-04 17:50:48 -0800994 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -0800995 struct : public FunctionCall {
996 GLuint index;
997
998 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
999 _c->glEnableVertexAttribArray(index);
David Li5c425f22011-03-10 16:40:37 -08001000 getDbgContextThreadSpecific()->glEnableVertexAttribArray(index);
David Li55c94cc2011-03-04 17:50:48 -08001001 return 0;
1002 }
1003 } caller;
1004 caller.index = index;
1005
1006 msg.set_arg0(index);
1007
David Lifbfc7032011-03-21 16:25:58 -07001008 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glEnableVertexAttribArray);
David Li28ca2ab2011-03-01 16:08:10 -08001009}
1010
1011void Debug_glFinish(void)
1012{
David Li55c94cc2011-03-04 17:50:48 -08001013 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001014 struct : public FunctionCall {
1015
1016 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1017 _c->glFinish();
1018 return 0;
1019 }
1020 } caller;
1021
1022
David Lifbfc7032011-03-21 16:25:58 -07001023 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFinish);
David Li28ca2ab2011-03-01 16:08:10 -08001024}
1025
1026void Debug_glFlush(void)
1027{
David Li55c94cc2011-03-04 17:50:48 -08001028 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001029 struct : public FunctionCall {
1030
1031 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1032 _c->glFlush();
1033 return 0;
1034 }
1035 } caller;
1036
1037
David Lifbfc7032011-03-21 16:25:58 -07001038 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFlush);
David Li28ca2ab2011-03-01 16:08:10 -08001039}
1040
1041void Debug_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
1042{
David Li55c94cc2011-03-04 17:50:48 -08001043 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001044 struct : public FunctionCall {
1045 GLenum target;
1046 GLenum attachment;
1047 GLenum renderbuffertarget;
1048 GLuint renderbuffer;
1049
1050 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1051 _c->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
1052 return 0;
1053 }
1054 } caller;
1055 caller.target = target;
1056 caller.attachment = attachment;
1057 caller.renderbuffertarget = renderbuffertarget;
1058 caller.renderbuffer = renderbuffer;
1059
1060 msg.set_arg0(target);
1061 msg.set_arg1(attachment);
1062 msg.set_arg2(renderbuffertarget);
1063 msg.set_arg3(renderbuffer);
1064
David Lifbfc7032011-03-21 16:25:58 -07001065 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFramebufferRenderbuffer);
David Li28ca2ab2011-03-01 16:08:10 -08001066}
1067
1068void Debug_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
1069{
David Li55c94cc2011-03-04 17:50:48 -08001070 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001071 struct : public FunctionCall {
1072 GLenum target;
1073 GLenum attachment;
1074 GLenum textarget;
1075 GLuint texture;
1076 GLint level;
1077
1078 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1079 _c->glFramebufferTexture2D(target, attachment, textarget, texture, level);
1080 return 0;
1081 }
1082 } caller;
1083 caller.target = target;
1084 caller.attachment = attachment;
1085 caller.textarget = textarget;
1086 caller.texture = texture;
1087 caller.level = level;
1088
1089 msg.set_arg0(target);
1090 msg.set_arg1(attachment);
1091 msg.set_arg2(textarget);
1092 msg.set_arg3(texture);
1093 msg.set_arg4(level);
1094
David Lifbfc7032011-03-21 16:25:58 -07001095 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFramebufferTexture2D);
David Li28ca2ab2011-03-01 16:08:10 -08001096}
1097
1098void Debug_glFrontFace(GLenum mode)
1099{
David Li55c94cc2011-03-04 17:50:48 -08001100 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001101 struct : public FunctionCall {
1102 GLenum mode;
1103
1104 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1105 _c->glFrontFace(mode);
1106 return 0;
1107 }
1108 } caller;
1109 caller.mode = mode;
1110
1111 msg.set_arg0(mode);
1112
David Lifbfc7032011-03-21 16:25:58 -07001113 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glFrontFace);
David Li28ca2ab2011-03-01 16:08:10 -08001114}
1115
1116void Debug_glGenBuffers(GLsizei n, GLuint* buffers)
1117{
David Li55c94cc2011-03-04 17:50:48 -08001118 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001119 struct : public FunctionCall {
1120 GLsizei n;
1121 GLuint* buffers;
1122
1123 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1124 nsecs_t c0 = systemTime(timeMode);
1125 _c->glGenBuffers(n, buffers);
1126 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1127 msg.mutable_data()->assign(reinterpret_cast<const char *>(buffers), n * sizeof(GLuint));
1128 return 0;
1129 }
1130 } caller;
1131 caller.n = n;
1132 caller.buffers = buffers;
1133
1134 msg.set_arg0(n);
1135 msg.set_arg1(ToInt(buffers));
1136
1137 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001138 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenBuffers);
David Li28ca2ab2011-03-01 16:08:10 -08001139}
1140
1141void Debug_glGenerateMipmap(GLenum target)
1142{
David Li55c94cc2011-03-04 17:50:48 -08001143 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001144 struct : public FunctionCall {
1145 GLenum target;
1146
1147 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1148 _c->glGenerateMipmap(target);
1149 return 0;
1150 }
1151 } caller;
1152 caller.target = target;
1153
1154 msg.set_arg0(target);
1155
David Lifbfc7032011-03-21 16:25:58 -07001156 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenerateMipmap);
David Li28ca2ab2011-03-01 16:08:10 -08001157}
1158
1159void Debug_glGenFramebuffers(GLsizei n, GLuint* framebuffers)
1160{
David Li55c94cc2011-03-04 17:50:48 -08001161 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001162 struct : public FunctionCall {
1163 GLsizei n;
1164 GLuint* framebuffers;
1165
1166 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1167 nsecs_t c0 = systemTime(timeMode);
1168 _c->glGenFramebuffers(n, framebuffers);
1169 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1170 msg.mutable_data()->assign(reinterpret_cast<const char *>(framebuffers), n * sizeof(GLuint));
1171 return 0;
1172 }
1173 } caller;
1174 caller.n = n;
1175 caller.framebuffers = framebuffers;
1176
1177 msg.set_arg0(n);
1178 msg.set_arg1(ToInt(framebuffers));
1179
1180 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001181 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenFramebuffers);
David Li28ca2ab2011-03-01 16:08:10 -08001182}
1183
1184void Debug_glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
1185{
David Li55c94cc2011-03-04 17:50:48 -08001186 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001187 struct : public FunctionCall {
1188 GLsizei n;
1189 GLuint* renderbuffers;
1190
1191 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1192 nsecs_t c0 = systemTime(timeMode);
1193 _c->glGenRenderbuffers(n, renderbuffers);
1194 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1195 msg.mutable_data()->assign(reinterpret_cast<const char *>(renderbuffers), n * sizeof(GLuint));
1196 return 0;
1197 }
1198 } caller;
1199 caller.n = n;
1200 caller.renderbuffers = renderbuffers;
1201
1202 msg.set_arg0(n);
1203 msg.set_arg1(ToInt(renderbuffers));
1204
1205 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001206 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenRenderbuffers);
David Li28ca2ab2011-03-01 16:08:10 -08001207}
1208
1209void Debug_glGenTextures(GLsizei n, GLuint* textures)
1210{
David Li55c94cc2011-03-04 17:50:48 -08001211 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001212 struct : public FunctionCall {
1213 GLsizei n;
1214 GLuint* textures;
1215
1216 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1217 nsecs_t c0 = systemTime(timeMode);
1218 _c->glGenTextures(n, textures);
1219 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1220 msg.mutable_data()->assign(reinterpret_cast<const char *>(textures), n * sizeof(GLuint));
1221 return 0;
1222 }
1223 } caller;
1224 caller.n = n;
1225 caller.textures = textures;
1226
1227 msg.set_arg0(n);
1228 msg.set_arg1(ToInt(textures));
1229
1230 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001231 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGenTextures);
David Li28ca2ab2011-03-01 16:08:10 -08001232}
1233
1234// FIXME: this function has pointers, it should be hand written
1235void Debug_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
1236{
David Li55c94cc2011-03-04 17:50:48 -08001237 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001238 struct : public FunctionCall {
1239 GLuint program;
1240 GLuint index;
1241 GLsizei bufsize;
1242 GLsizei* length;
1243 GLint* size;
1244 GLenum* type;
1245 GLchar* name;
1246
1247 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1248 _c->glGetActiveAttrib(program, index, bufsize, length, size, type, name);
1249 return 0;
1250 }
1251 } caller;
1252 caller.program = program;
1253 caller.index = index;
1254 caller.bufsize = bufsize;
1255 caller.length = length;
1256 caller.size = size;
1257 caller.type = type;
1258 caller.name = name;
1259
1260 msg.set_arg0(program);
1261 msg.set_arg1(index);
1262 msg.set_arg2(bufsize);
1263 msg.set_arg3(ToInt(length));
1264 msg.set_arg4(ToInt(size));
1265 msg.set_arg5(ToInt(type));
1266 msg.set_arg6(ToInt(name));
1267
1268 // FIXME: check for pointer usage
1269 msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
David Lifbfc7032011-03-21 16:25:58 -07001270 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetActiveAttrib);
David Li28ca2ab2011-03-01 16:08:10 -08001271}
1272
1273// FIXME: this function has pointers, it should be hand written
1274void Debug_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
1275{
David Li55c94cc2011-03-04 17:50:48 -08001276 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001277 struct : public FunctionCall {
1278 GLuint program;
1279 GLuint index;
1280 GLsizei bufsize;
1281 GLsizei* length;
1282 GLint* size;
1283 GLenum* type;
1284 GLchar* name;
1285
1286 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1287 _c->glGetActiveUniform(program, index, bufsize, length, size, type, name);
1288 return 0;
1289 }
1290 } caller;
1291 caller.program = program;
1292 caller.index = index;
1293 caller.bufsize = bufsize;
1294 caller.length = length;
1295 caller.size = size;
1296 caller.type = type;
1297 caller.name = name;
1298
1299 msg.set_arg0(program);
1300 msg.set_arg1(index);
1301 msg.set_arg2(bufsize);
1302 msg.set_arg3(ToInt(length));
1303 msg.set_arg4(ToInt(size));
1304 msg.set_arg5(ToInt(type));
1305 msg.set_arg6(ToInt(name));
1306
1307 // FIXME: check for pointer usage
1308 msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
David Lifbfc7032011-03-21 16:25:58 -07001309 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetActiveUniform);
David Li28ca2ab2011-03-01 16:08:10 -08001310}
1311
1312// FIXME: this function has pointers, it should be hand written
1313void Debug_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
1314{
David Li55c94cc2011-03-04 17:50:48 -08001315 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001316 struct : public FunctionCall {
1317 GLuint program;
1318 GLsizei maxcount;
1319 GLsizei* count;
1320 GLuint* shaders;
1321
1322 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1323 _c->glGetAttachedShaders(program, maxcount, count, shaders);
1324 return 0;
1325 }
1326 } caller;
1327 caller.program = program;
1328 caller.maxcount = maxcount;
1329 caller.count = count;
1330 caller.shaders = shaders;
1331
1332 msg.set_arg0(program);
1333 msg.set_arg1(maxcount);
1334 msg.set_arg2(ToInt(count));
1335 msg.set_arg3(ToInt(shaders));
1336
1337 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001338 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetAttachedShaders);
David Li28ca2ab2011-03-01 16:08:10 -08001339}
1340
1341int Debug_glGetAttribLocation(GLuint program, const GLchar* name)
1342{
David Li55c94cc2011-03-04 17:50:48 -08001343 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001344 struct : public FunctionCall {
1345 GLuint program;
1346 const GLchar* name;
1347
1348 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1349 const int * ret = reinterpret_cast<const int *>(_c->glGetAttribLocation(program, name));
1350 msg.set_ret(ToInt(ret));
1351 return ret;
1352 }
1353 } caller;
1354 caller.program = program;
1355 caller.name = name;
1356
1357 msg.set_arg0(program);
1358 msg.set_arg1(ToInt(name));
1359
1360 // FIXME: check for pointer usage
1361 msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
David Lifbfc7032011-03-21 16:25:58 -07001362 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetAttribLocation);
David Li55c94cc2011-03-04 17:50:48 -08001363 return reinterpret_cast<int>(ret);
David Li28ca2ab2011-03-01 16:08:10 -08001364}
1365
1366// FIXME: this function has pointers, it should be hand written
1367void Debug_glGetBooleanv(GLenum pname, GLboolean* params)
1368{
David Li55c94cc2011-03-04 17:50:48 -08001369 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001370 struct : public FunctionCall {
1371 GLenum pname;
1372 GLboolean* params;
1373
1374 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1375 _c->glGetBooleanv(pname, params);
1376 return 0;
1377 }
1378 } caller;
1379 caller.pname = pname;
1380 caller.params = params;
1381
1382 msg.set_arg0(pname);
1383 msg.set_arg1(ToInt(params));
1384
1385 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001386 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetBooleanv);
David Li28ca2ab2011-03-01 16:08:10 -08001387}
1388
1389// FIXME: this function has pointers, it should be hand written
1390void Debug_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
1391{
David Li55c94cc2011-03-04 17:50:48 -08001392 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001393 struct : public FunctionCall {
1394 GLenum target;
1395 GLenum pname;
1396 GLint* params;
1397
1398 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1399 _c->glGetBufferParameteriv(target, pname, params);
1400 return 0;
1401 }
1402 } caller;
1403 caller.target = target;
1404 caller.pname = pname;
1405 caller.params = params;
1406
1407 msg.set_arg0(target);
1408 msg.set_arg1(pname);
1409 msg.set_arg2(ToInt(params));
1410
1411 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001412 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetBufferParameteriv);
David Li28ca2ab2011-03-01 16:08:10 -08001413}
1414
1415GLenum Debug_glGetError(void)
1416{
David Li55c94cc2011-03-04 17:50:48 -08001417 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001418 struct : public FunctionCall {
1419
1420 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1421 const int * ret = reinterpret_cast<const int *>(_c->glGetError());
1422 msg.set_ret(ToInt(ret));
1423 return ret;
1424 }
1425 } caller;
1426
1427
David Lifbfc7032011-03-21 16:25:58 -07001428 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetError);
David Li55c94cc2011-03-04 17:50:48 -08001429 return reinterpret_cast<GLenum>(ret);
David Li28ca2ab2011-03-01 16:08:10 -08001430}
1431
1432// FIXME: this function has pointers, it should be hand written
1433void Debug_glGetFloatv(GLenum pname, GLfloat* params)
1434{
David Li55c94cc2011-03-04 17:50:48 -08001435 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001436 struct : public FunctionCall {
1437 GLenum pname;
1438 GLfloat* params;
1439
1440 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1441 _c->glGetFloatv(pname, params);
1442 return 0;
1443 }
1444 } caller;
1445 caller.pname = pname;
1446 caller.params = params;
1447
1448 msg.set_arg0(pname);
1449 msg.set_arg1(ToInt(params));
1450
1451 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001452 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetFloatv);
David Li28ca2ab2011-03-01 16:08:10 -08001453}
1454
1455// FIXME: this function has pointers, it should be hand written
1456void Debug_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
1457{
David Li55c94cc2011-03-04 17:50:48 -08001458 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001459 struct : public FunctionCall {
1460 GLenum target;
1461 GLenum attachment;
1462 GLenum pname;
1463 GLint* params;
1464
1465 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1466 _c->glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
1467 return 0;
1468 }
1469 } caller;
1470 caller.target = target;
1471 caller.attachment = attachment;
1472 caller.pname = pname;
1473 caller.params = params;
1474
1475 msg.set_arg0(target);
1476 msg.set_arg1(attachment);
1477 msg.set_arg2(pname);
1478 msg.set_arg3(ToInt(params));
1479
1480 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001481 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetFramebufferAttachmentParameteriv);
David Li28ca2ab2011-03-01 16:08:10 -08001482}
1483
1484// FIXME: this function has pointers, it should be hand written
1485void Debug_glGetIntegerv(GLenum pname, GLint* params)
1486{
David Li55c94cc2011-03-04 17:50:48 -08001487 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001488 struct : public FunctionCall {
1489 GLenum pname;
1490 GLint* params;
1491
1492 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1493 _c->glGetIntegerv(pname, params);
1494 return 0;
1495 }
1496 } caller;
1497 caller.pname = pname;
1498 caller.params = params;
1499
1500 msg.set_arg0(pname);
1501 msg.set_arg1(ToInt(params));
1502
1503 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001504 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetIntegerv);
David Li28ca2ab2011-03-01 16:08:10 -08001505}
1506
1507void Debug_glGetProgramiv(GLuint program, GLenum pname, GLint* params)
1508{
David Li55c94cc2011-03-04 17:50:48 -08001509 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001510 struct : public FunctionCall {
1511 GLuint program;
1512 GLenum pname;
1513 GLint* params;
1514
1515 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1516 nsecs_t c0 = systemTime(timeMode);
1517 _c->glGetProgramiv(program, pname, params);
1518 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1519 msg.mutable_data()->assign(reinterpret_cast<const char *>(params), 1 * sizeof(GLint));
1520 return 0;
1521 }
1522 } caller;
1523 caller.program = program;
1524 caller.pname = pname;
1525 caller.params = params;
1526
1527 msg.set_arg0(program);
1528 msg.set_arg1(pname);
1529 msg.set_arg2(ToInt(params));
1530
1531 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001532 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetProgramiv);
David Li28ca2ab2011-03-01 16:08:10 -08001533}
1534
1535// FIXME: this function has pointers, it should be hand written
1536void Debug_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
1537{
David Li55c94cc2011-03-04 17:50:48 -08001538 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001539 struct : public FunctionCall {
1540 GLuint program;
1541 GLsizei bufsize;
1542 GLsizei* length;
1543 GLchar* infolog;
1544
1545 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1546 nsecs_t c0 = systemTime(timeMode);
1547 _c->glGetProgramInfoLog(program, bufsize, length, infolog);
1548 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1549 msg.mutable_data()->assign(reinterpret_cast<const char *>(infolog), strlen(infolog) * sizeof(GLchar));
1550 return 0;
1551 }
1552 } caller;
1553 caller.program = program;
1554 caller.bufsize = bufsize;
1555 caller.length = length;
1556 caller.infolog = infolog;
1557
1558 msg.set_arg0(program);
1559 msg.set_arg1(bufsize);
1560 msg.set_arg2(ToInt(length));
1561 msg.set_arg3(ToInt(infolog));
1562
1563 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001564 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetProgramInfoLog);
David Li28ca2ab2011-03-01 16:08:10 -08001565}
1566
1567// FIXME: this function has pointers, it should be hand written
1568void Debug_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
1569{
David Li55c94cc2011-03-04 17:50:48 -08001570 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001571 struct : public FunctionCall {
1572 GLenum target;
1573 GLenum pname;
1574 GLint* params;
1575
1576 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1577 _c->glGetRenderbufferParameteriv(target, pname, params);
1578 return 0;
1579 }
1580 } caller;
1581 caller.target = target;
1582 caller.pname = pname;
1583 caller.params = params;
1584
1585 msg.set_arg0(target);
1586 msg.set_arg1(pname);
1587 msg.set_arg2(ToInt(params));
1588
1589 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001590 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetRenderbufferParameteriv);
David Li28ca2ab2011-03-01 16:08:10 -08001591}
1592
1593void Debug_glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
1594{
David Li55c94cc2011-03-04 17:50:48 -08001595 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001596 struct : public FunctionCall {
1597 GLuint shader;
1598 GLenum pname;
1599 GLint* params;
1600
1601 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1602 nsecs_t c0 = systemTime(timeMode);
1603 _c->glGetShaderiv(shader, pname, params);
1604 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1605 msg.mutable_data()->assign(reinterpret_cast<const char *>(params), 1 * sizeof(GLint));
1606 return 0;
1607 }
1608 } caller;
1609 caller.shader = shader;
1610 caller.pname = pname;
1611 caller.params = params;
1612
1613 msg.set_arg0(shader);
1614 msg.set_arg1(pname);
1615 msg.set_arg2(ToInt(params));
1616
1617 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001618 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderiv);
David Li28ca2ab2011-03-01 16:08:10 -08001619}
1620
1621// FIXME: this function has pointers, it should be hand written
1622void Debug_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
1623{
David Li55c94cc2011-03-04 17:50:48 -08001624 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001625 struct : public FunctionCall {
1626 GLuint shader;
1627 GLsizei bufsize;
1628 GLsizei* length;
1629 GLchar* infolog;
1630
1631 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1632 nsecs_t c0 = systemTime(timeMode);
1633 _c->glGetShaderInfoLog(shader, bufsize, length, infolog);
1634 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1635 msg.mutable_data()->assign(reinterpret_cast<const char *>(infolog), strlen(infolog) * sizeof(GLchar));
1636 return 0;
1637 }
1638 } caller;
1639 caller.shader = shader;
1640 caller.bufsize = bufsize;
1641 caller.length = length;
1642 caller.infolog = infolog;
1643
1644 msg.set_arg0(shader);
1645 msg.set_arg1(bufsize);
1646 msg.set_arg2(ToInt(length));
1647 msg.set_arg3(ToInt(infolog));
1648
1649 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001650 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderInfoLog);
David Li28ca2ab2011-03-01 16:08:10 -08001651}
1652
1653// FIXME: this function has pointers, it should be hand written
1654void Debug_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
1655{
David Li55c94cc2011-03-04 17:50:48 -08001656 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001657 struct : public FunctionCall {
1658 GLenum shadertype;
1659 GLenum precisiontype;
1660 GLint* range;
1661 GLint* precision;
1662
1663 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1664 _c->glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
1665 return 0;
1666 }
1667 } caller;
1668 caller.shadertype = shadertype;
1669 caller.precisiontype = precisiontype;
1670 caller.range = range;
1671 caller.precision = precision;
1672
1673 msg.set_arg0(shadertype);
1674 msg.set_arg1(precisiontype);
1675 msg.set_arg2(ToInt(range));
1676 msg.set_arg3(ToInt(precision));
1677
1678 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001679 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderPrecisionFormat);
David Li28ca2ab2011-03-01 16:08:10 -08001680}
1681
1682// FIXME: this function has pointers, it should be hand written
1683void Debug_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
1684{
David Li55c94cc2011-03-04 17:50:48 -08001685 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001686 struct : public FunctionCall {
1687 GLuint shader;
1688 GLsizei bufsize;
1689 GLsizei* length;
1690 GLchar* source;
1691
1692 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1693 nsecs_t c0 = systemTime(timeMode);
1694 _c->glGetShaderSource(shader, bufsize, length, source);
1695 msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
1696 msg.mutable_data()->assign(reinterpret_cast<const char *>(source), strlen(source) * sizeof(GLchar));
1697 return 0;
1698 }
1699 } caller;
1700 caller.shader = shader;
1701 caller.bufsize = bufsize;
1702 caller.length = length;
1703 caller.source = source;
1704
1705 msg.set_arg0(shader);
1706 msg.set_arg1(bufsize);
1707 msg.set_arg2(ToInt(length));
1708 msg.set_arg3(ToInt(source));
1709
1710 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001711 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetShaderSource);
David Li28ca2ab2011-03-01 16:08:10 -08001712}
1713
1714// FIXME: this function has pointers, it should be hand written
1715const GLubyte* Debug_glGetString(GLenum name)
1716{
David Li55c94cc2011-03-04 17:50:48 -08001717 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001718 struct : public FunctionCall {
1719 GLenum name;
1720
1721 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1722 const int * ret = reinterpret_cast<const int *>(_c->glGetString(name));
1723 msg.set_ret(ToInt(ret));
1724 return ret;
1725 }
1726 } caller;
1727 caller.name = name;
1728
1729 msg.set_arg0(name);
1730
1731 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001732 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetString);
David Li55c94cc2011-03-04 17:50:48 -08001733 return reinterpret_cast<const GLubyte*>(ret);
David Li28ca2ab2011-03-01 16:08:10 -08001734}
1735
1736// FIXME: this function has pointers, it should be hand written
1737void Debug_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
1738{
David Li55c94cc2011-03-04 17:50:48 -08001739 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001740 struct : public FunctionCall {
1741 GLenum target;
1742 GLenum pname;
1743 GLfloat* params;
1744
1745 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1746 _c->glGetTexParameterfv(target, pname, params);
1747 return 0;
1748 }
1749 } caller;
1750 caller.target = target;
1751 caller.pname = pname;
1752 caller.params = params;
1753
1754 msg.set_arg0(target);
1755 msg.set_arg1(pname);
1756 msg.set_arg2(ToInt(params));
1757
1758 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001759 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetTexParameterfv);
David Li28ca2ab2011-03-01 16:08:10 -08001760}
1761
1762// FIXME: this function has pointers, it should be hand written
1763void Debug_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
1764{
David Li55c94cc2011-03-04 17:50:48 -08001765 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001766 struct : public FunctionCall {
1767 GLenum target;
1768 GLenum pname;
1769 GLint* params;
1770
1771 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1772 _c->glGetTexParameteriv(target, pname, params);
1773 return 0;
1774 }
1775 } caller;
1776 caller.target = target;
1777 caller.pname = pname;
1778 caller.params = params;
1779
1780 msg.set_arg0(target);
1781 msg.set_arg1(pname);
1782 msg.set_arg2(ToInt(params));
1783
1784 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001785 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetTexParameteriv);
David Li28ca2ab2011-03-01 16:08:10 -08001786}
1787
1788// FIXME: this function has pointers, it should be hand written
1789void Debug_glGetUniformfv(GLuint program, GLint location, GLfloat* params)
1790{
David Li55c94cc2011-03-04 17:50:48 -08001791 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001792 struct : public FunctionCall {
1793 GLuint program;
1794 GLint location;
1795 GLfloat* params;
1796
1797 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1798 _c->glGetUniformfv(program, location, params);
1799 return 0;
1800 }
1801 } caller;
1802 caller.program = program;
1803 caller.location = location;
1804 caller.params = params;
1805
1806 msg.set_arg0(program);
1807 msg.set_arg1(location);
1808 msg.set_arg2(ToInt(params));
1809
1810 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001811 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformfv);
David Li28ca2ab2011-03-01 16:08:10 -08001812}
1813
1814// FIXME: this function has pointers, it should be hand written
1815void Debug_glGetUniformiv(GLuint program, GLint location, GLint* params)
1816{
David Li55c94cc2011-03-04 17:50:48 -08001817 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001818 struct : public FunctionCall {
1819 GLuint program;
1820 GLint location;
1821 GLint* params;
1822
1823 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1824 _c->glGetUniformiv(program, location, params);
1825 return 0;
1826 }
1827 } caller;
1828 caller.program = program;
1829 caller.location = location;
1830 caller.params = params;
1831
1832 msg.set_arg0(program);
1833 msg.set_arg1(location);
1834 msg.set_arg2(ToInt(params));
1835
1836 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001837 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformiv);
David Li28ca2ab2011-03-01 16:08:10 -08001838}
1839
1840int Debug_glGetUniformLocation(GLuint program, const GLchar* name)
1841{
David Li55c94cc2011-03-04 17:50:48 -08001842 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001843 struct : public FunctionCall {
1844 GLuint program;
1845 const GLchar* name;
1846
1847 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1848 const int * ret = reinterpret_cast<const int *>(_c->glGetUniformLocation(program, name));
1849 msg.set_ret(ToInt(ret));
1850 return ret;
1851 }
1852 } caller;
1853 caller.program = program;
1854 caller.name = name;
1855
1856 msg.set_arg0(program);
1857 msg.set_arg1(ToInt(name));
1858
1859 // FIXME: check for pointer usage
1860 msg.mutable_data()->assign(reinterpret_cast<const char *>(name), strlen(name) * sizeof(GLchar));
David Lifbfc7032011-03-21 16:25:58 -07001861 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetUniformLocation);
David Li55c94cc2011-03-04 17:50:48 -08001862 return reinterpret_cast<int>(ret);
David Li28ca2ab2011-03-01 16:08:10 -08001863}
1864
1865// FIXME: this function has pointers, it should be hand written
1866void Debug_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
1867{
David Li55c94cc2011-03-04 17:50:48 -08001868 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001869 struct : public FunctionCall {
1870 GLuint index;
1871 GLenum pname;
1872 GLfloat* params;
1873
1874 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1875 _c->glGetVertexAttribfv(index, pname, params);
1876 return 0;
1877 }
1878 } caller;
1879 caller.index = index;
1880 caller.pname = pname;
1881 caller.params = params;
1882
1883 msg.set_arg0(index);
1884 msg.set_arg1(pname);
1885 msg.set_arg2(ToInt(params));
1886
1887 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001888 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribfv);
David Li28ca2ab2011-03-01 16:08:10 -08001889}
1890
1891// FIXME: this function has pointers, it should be hand written
1892void Debug_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
1893{
David Li55c94cc2011-03-04 17:50:48 -08001894 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001895 struct : public FunctionCall {
1896 GLuint index;
1897 GLenum pname;
1898 GLint* params;
1899
1900 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1901 _c->glGetVertexAttribiv(index, pname, params);
1902 return 0;
1903 }
1904 } caller;
1905 caller.index = index;
1906 caller.pname = pname;
1907 caller.params = params;
1908
1909 msg.set_arg0(index);
1910 msg.set_arg1(pname);
1911 msg.set_arg2(ToInt(params));
1912
1913 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001914 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribiv);
David Li28ca2ab2011-03-01 16:08:10 -08001915}
1916
1917// FIXME: this function has pointers, it should be hand written
1918void Debug_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
1919{
David Li55c94cc2011-03-04 17:50:48 -08001920 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001921 struct : public FunctionCall {
1922 GLuint index;
1923 GLenum pname;
1924 GLvoid** pointer;
1925
1926 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1927 _c->glGetVertexAttribPointerv(index, pname, pointer);
1928 return 0;
1929 }
1930 } caller;
1931 caller.index = index;
1932 caller.pname = pname;
1933 caller.pointer = pointer;
1934
1935 msg.set_arg0(index);
1936 msg.set_arg1(pname);
1937 msg.set_arg2(ToInt(pointer));
1938
1939 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07001940 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glGetVertexAttribPointerv);
David Li28ca2ab2011-03-01 16:08:10 -08001941}
1942
1943void Debug_glHint(GLenum target, GLenum mode)
1944{
David Li55c94cc2011-03-04 17:50:48 -08001945 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001946 struct : public FunctionCall {
1947 GLenum target;
1948 GLenum mode;
1949
1950 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1951 _c->glHint(target, mode);
1952 return 0;
1953 }
1954 } caller;
1955 caller.target = target;
1956 caller.mode = mode;
1957
1958 msg.set_arg0(target);
1959 msg.set_arg1(mode);
1960
David Lifbfc7032011-03-21 16:25:58 -07001961 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glHint);
David Li28ca2ab2011-03-01 16:08:10 -08001962}
1963
1964GLboolean Debug_glIsBuffer(GLuint buffer)
1965{
David Li55c94cc2011-03-04 17:50:48 -08001966 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001967 struct : public FunctionCall {
1968 GLuint buffer;
1969
1970 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1971 const int * ret = reinterpret_cast<const int *>(_c->glIsBuffer(buffer));
1972 msg.set_ret(ToInt(ret));
1973 return ret;
1974 }
1975 } caller;
1976 caller.buffer = buffer;
1977
1978 msg.set_arg0(buffer);
1979
David Lifbfc7032011-03-21 16:25:58 -07001980 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsBuffer);
David Li55c94cc2011-03-04 17:50:48 -08001981 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08001982}
1983
1984GLboolean Debug_glIsEnabled(GLenum cap)
1985{
David Li55c94cc2011-03-04 17:50:48 -08001986 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08001987 struct : public FunctionCall {
1988 GLenum cap;
1989
1990 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
1991 const int * ret = reinterpret_cast<const int *>(_c->glIsEnabled(cap));
1992 msg.set_ret(ToInt(ret));
1993 return ret;
1994 }
1995 } caller;
1996 caller.cap = cap;
1997
1998 msg.set_arg0(cap);
1999
David Lifbfc7032011-03-21 16:25:58 -07002000 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsEnabled);
David Li55c94cc2011-03-04 17:50:48 -08002001 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08002002}
2003
2004GLboolean Debug_glIsFramebuffer(GLuint framebuffer)
2005{
David Li55c94cc2011-03-04 17:50:48 -08002006 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002007 struct : public FunctionCall {
2008 GLuint framebuffer;
2009
2010 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2011 const int * ret = reinterpret_cast<const int *>(_c->glIsFramebuffer(framebuffer));
2012 msg.set_ret(ToInt(ret));
2013 return ret;
2014 }
2015 } caller;
2016 caller.framebuffer = framebuffer;
2017
2018 msg.set_arg0(framebuffer);
2019
David Lifbfc7032011-03-21 16:25:58 -07002020 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsFramebuffer);
David Li55c94cc2011-03-04 17:50:48 -08002021 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08002022}
2023
2024GLboolean Debug_glIsProgram(GLuint program)
2025{
David Li55c94cc2011-03-04 17:50:48 -08002026 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002027 struct : public FunctionCall {
2028 GLuint program;
2029
2030 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2031 const int * ret = reinterpret_cast<const int *>(_c->glIsProgram(program));
2032 msg.set_ret(ToInt(ret));
2033 return ret;
2034 }
2035 } caller;
2036 caller.program = program;
2037
2038 msg.set_arg0(program);
2039
David Lifbfc7032011-03-21 16:25:58 -07002040 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsProgram);
David Li55c94cc2011-03-04 17:50:48 -08002041 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08002042}
2043
2044GLboolean Debug_glIsRenderbuffer(GLuint renderbuffer)
2045{
David Li55c94cc2011-03-04 17:50:48 -08002046 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002047 struct : public FunctionCall {
2048 GLuint renderbuffer;
2049
2050 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2051 const int * ret = reinterpret_cast<const int *>(_c->glIsRenderbuffer(renderbuffer));
2052 msg.set_ret(ToInt(ret));
2053 return ret;
2054 }
2055 } caller;
2056 caller.renderbuffer = renderbuffer;
2057
2058 msg.set_arg0(renderbuffer);
2059
David Lifbfc7032011-03-21 16:25:58 -07002060 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsRenderbuffer);
David Li55c94cc2011-03-04 17:50:48 -08002061 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08002062}
2063
2064GLboolean Debug_glIsShader(GLuint shader)
2065{
David Li55c94cc2011-03-04 17:50:48 -08002066 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002067 struct : public FunctionCall {
2068 GLuint shader;
2069
2070 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2071 const int * ret = reinterpret_cast<const int *>(_c->glIsShader(shader));
2072 msg.set_ret(ToInt(ret));
2073 return ret;
2074 }
2075 } caller;
2076 caller.shader = shader;
2077
2078 msg.set_arg0(shader);
2079
David Lifbfc7032011-03-21 16:25:58 -07002080 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsShader);
David Li55c94cc2011-03-04 17:50:48 -08002081 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08002082}
2083
2084GLboolean Debug_glIsTexture(GLuint texture)
2085{
David Li55c94cc2011-03-04 17:50:48 -08002086 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002087 struct : public FunctionCall {
2088 GLuint texture;
2089
2090 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2091 const int * ret = reinterpret_cast<const int *>(_c->glIsTexture(texture));
2092 msg.set_ret(ToInt(ret));
2093 return ret;
2094 }
2095 } caller;
2096 caller.texture = texture;
2097
2098 msg.set_arg0(texture);
2099
David Lifbfc7032011-03-21 16:25:58 -07002100 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glIsTexture);
David Li55c94cc2011-03-04 17:50:48 -08002101 return static_cast<GLboolean>(reinterpret_cast<int>(ret));
David Li28ca2ab2011-03-01 16:08:10 -08002102}
2103
2104void Debug_glLineWidth(GLfloat width)
2105{
David Li55c94cc2011-03-04 17:50:48 -08002106 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002107 struct : public FunctionCall {
2108 GLfloat width;
2109
2110 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2111 _c->glLineWidth(width);
2112 return 0;
2113 }
2114 } caller;
2115 caller.width = width;
2116
2117 msg.set_arg0(ToInt(width));
2118
David Lifbfc7032011-03-21 16:25:58 -07002119 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glLineWidth);
David Li28ca2ab2011-03-01 16:08:10 -08002120}
2121
2122void Debug_glLinkProgram(GLuint program)
2123{
David Li55c94cc2011-03-04 17:50:48 -08002124 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002125 struct : public FunctionCall {
2126 GLuint program;
2127
2128 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2129 _c->glLinkProgram(program);
2130 return 0;
2131 }
2132 } caller;
2133 caller.program = program;
2134
2135 msg.set_arg0(program);
2136
David Lifbfc7032011-03-21 16:25:58 -07002137 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glLinkProgram);
David Li28ca2ab2011-03-01 16:08:10 -08002138}
2139
2140void Debug_glPixelStorei(GLenum pname, GLint param)
2141{
David Li55c94cc2011-03-04 17:50:48 -08002142 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002143 struct : public FunctionCall {
2144 GLenum pname;
2145 GLint param;
2146
2147 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2148 _c->glPixelStorei(pname, param);
2149 return 0;
2150 }
2151 } caller;
2152 caller.pname = pname;
2153 caller.param = param;
2154
2155 msg.set_arg0(pname);
2156 msg.set_arg1(param);
2157
David Lifbfc7032011-03-21 16:25:58 -07002158 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glPixelStorei);
David Li28ca2ab2011-03-01 16:08:10 -08002159}
2160
2161void Debug_glPolygonOffset(GLfloat factor, GLfloat units)
2162{
David Li55c94cc2011-03-04 17:50:48 -08002163 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002164 struct : public FunctionCall {
2165 GLfloat factor;
2166 GLfloat units;
David Li28ca2ab2011-03-01 16:08:10 -08002167
David Li55c94cc2011-03-04 17:50:48 -08002168 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2169 _c->glPolygonOffset(factor, units);
2170 return 0;
2171 }
2172 } caller;
2173 caller.factor = factor;
2174 caller.units = units;
2175
2176 msg.set_arg0(ToInt(factor));
2177 msg.set_arg1(ToInt(units));
2178
David Lifbfc7032011-03-21 16:25:58 -07002179 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glPolygonOffset);
David Li28ca2ab2011-03-01 16:08:10 -08002180}
2181
David Lie2ad4d02011-04-08 18:41:00 -07002182void Debug_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
2183{
2184 glesv2debugger::Message msg;
2185 struct : public FunctionCall {
2186 GLint x;
2187 GLint y;
2188 GLsizei width;
2189 GLsizei height;
2190 GLenum format;
2191 GLenum type;
2192 GLvoid* pixels;
2193
2194 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2195 _c->glReadPixels(x, y, width, height, format, type, pixels);
2196#ifdef EXTEND_AFTER_CALL_Debug_glReadPixels
2197 EXTEND_AFTER_CALL_Debug_glReadPixels;
2198#endif
2199 return 0;
2200 }
2201 } caller;
2202 caller.x = x;
2203 caller.y = y;
2204 caller.width = width;
2205 caller.height = height;
2206 caller.format = format;
2207 caller.type = type;
2208 caller.pixels = pixels;
2209
2210 msg.set_arg0(x);
2211 msg.set_arg1(y);
2212 msg.set_arg2(width);
2213 msg.set_arg3(height);
2214 msg.set_arg4(format);
2215 msg.set_arg5(type);
2216 msg.set_arg6(ToInt(pixels));
2217
2218 // FIXME: check for pointer usage
2219#ifdef EXTEND_Debug_glReadPixels
2220 EXTEND_Debug_glReadPixels;
2221#endif
2222 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glReadPixels);
2223}
2224
David Li28ca2ab2011-03-01 16:08:10 -08002225void Debug_glReleaseShaderCompiler(void)
2226{
David Li55c94cc2011-03-04 17:50:48 -08002227 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002228 struct : public FunctionCall {
2229
2230 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2231 _c->glReleaseShaderCompiler();
2232 return 0;
2233 }
2234 } caller;
2235
2236
David Lifbfc7032011-03-21 16:25:58 -07002237 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glReleaseShaderCompiler);
David Li28ca2ab2011-03-01 16:08:10 -08002238}
2239
2240void Debug_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
2241{
David Li55c94cc2011-03-04 17:50:48 -08002242 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002243 struct : public FunctionCall {
2244 GLenum target;
2245 GLenum internalformat;
2246 GLsizei width;
2247 GLsizei height;
2248
2249 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2250 _c->glRenderbufferStorage(target, internalformat, width, height);
2251 return 0;
2252 }
2253 } caller;
2254 caller.target = target;
2255 caller.internalformat = internalformat;
2256 caller.width = width;
2257 caller.height = height;
2258
2259 msg.set_arg0(target);
2260 msg.set_arg1(internalformat);
2261 msg.set_arg2(width);
2262 msg.set_arg3(height);
2263
David Lifbfc7032011-03-21 16:25:58 -07002264 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glRenderbufferStorage);
David Li28ca2ab2011-03-01 16:08:10 -08002265}
2266
2267void Debug_glSampleCoverage(GLclampf value, GLboolean invert)
2268{
David Li55c94cc2011-03-04 17:50:48 -08002269 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002270 struct : public FunctionCall {
2271 GLclampf value;
2272 GLboolean invert;
2273
2274 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2275 _c->glSampleCoverage(value, invert);
2276 return 0;
2277 }
2278 } caller;
2279 caller.value = value;
2280 caller.invert = invert;
2281
2282 msg.set_arg0(ToInt(value));
2283 msg.set_arg1(invert);
2284
David Lifbfc7032011-03-21 16:25:58 -07002285 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glSampleCoverage);
David Li28ca2ab2011-03-01 16:08:10 -08002286}
2287
2288void Debug_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
2289{
David Li55c94cc2011-03-04 17:50:48 -08002290 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002291 struct : public FunctionCall {
2292 GLint x;
2293 GLint y;
2294 GLsizei width;
2295 GLsizei height;
2296
2297 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2298 _c->glScissor(x, y, width, height);
2299 return 0;
2300 }
2301 } caller;
2302 caller.x = x;
2303 caller.y = y;
2304 caller.width = width;
2305 caller.height = height;
2306
2307 msg.set_arg0(x);
2308 msg.set_arg1(y);
2309 msg.set_arg2(width);
2310 msg.set_arg3(height);
2311
David Lifbfc7032011-03-21 16:25:58 -07002312 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glScissor);
David Li28ca2ab2011-03-01 16:08:10 -08002313}
2314
2315// FIXME: this function has pointers, it should be hand written
2316void Debug_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
2317{
David Li55c94cc2011-03-04 17:50:48 -08002318 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002319 struct : public FunctionCall {
2320 GLsizei n;
2321 const GLuint* shaders;
2322 GLenum binaryformat;
2323 const GLvoid* binary;
2324 GLsizei length;
2325
2326 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2327 _c->glShaderBinary(n, shaders, binaryformat, binary, length);
2328 return 0;
2329 }
2330 } caller;
2331 caller.n = n;
2332 caller.shaders = shaders;
2333 caller.binaryformat = binaryformat;
2334 caller.binary = binary;
2335 caller.length = length;
2336
2337 msg.set_arg0(n);
2338 msg.set_arg1(ToInt(shaders));
2339 msg.set_arg2(binaryformat);
2340 msg.set_arg3(ToInt(binary));
2341 msg.set_arg4(length);
2342
2343 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07002344 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glShaderBinary);
David Li28ca2ab2011-03-01 16:08:10 -08002345}
2346
David Li5c425f22011-03-10 16:40:37 -08002347void Debug_glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
2348{
2349 glesv2debugger::Message msg;
David Li5c425f22011-03-10 16:40:37 -08002350 struct : public FunctionCall {
2351 GLuint shader;
2352 GLsizei count;
2353 const GLchar** string;
2354 const GLint* length;
2355
2356 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2357 _c->glShaderSource(shader, count, string, length);
David Lie2ad4d02011-04-08 18:41:00 -07002358#ifdef EXTEND_AFTER_CALL_Debug_glShaderSource
2359 EXTEND_AFTER_CALL_Debug_glShaderSource;
2360#endif
David Li5c425f22011-03-10 16:40:37 -08002361 return 0;
2362 }
2363 } caller;
2364 caller.shader = shader;
2365 caller.count = count;
2366 caller.string = string;
2367 caller.length = length;
2368
2369 msg.set_arg0(shader);
2370 msg.set_arg1(count);
2371 msg.set_arg2(ToInt(string));
2372 msg.set_arg3(ToInt(length));
2373
2374 // FIXME: check for pointer usage
David Lie2ad4d02011-04-08 18:41:00 -07002375#ifdef EXTEND_Debug_glShaderSource
David Li5c425f22011-03-10 16:40:37 -08002376 EXTEND_Debug_glShaderSource;
David Lie2ad4d02011-04-08 18:41:00 -07002377#endif
David Lifbfc7032011-03-21 16:25:58 -07002378 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glShaderSource);
David Li5c425f22011-03-10 16:40:37 -08002379}
2380
David Li28ca2ab2011-03-01 16:08:10 -08002381void Debug_glStencilFunc(GLenum func, GLint ref, GLuint mask)
2382{
David Li55c94cc2011-03-04 17:50:48 -08002383 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002384 struct : public FunctionCall {
2385 GLenum func;
2386 GLint ref;
2387 GLuint mask;
2388
2389 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2390 _c->glStencilFunc(func, ref, mask);
2391 return 0;
2392 }
2393 } caller;
2394 caller.func = func;
2395 caller.ref = ref;
2396 caller.mask = mask;
2397
2398 msg.set_arg0(func);
2399 msg.set_arg1(ref);
2400 msg.set_arg2(mask);
2401
David Lifbfc7032011-03-21 16:25:58 -07002402 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilFunc);
David Li28ca2ab2011-03-01 16:08:10 -08002403}
2404
2405void Debug_glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2406{
David Li55c94cc2011-03-04 17:50:48 -08002407 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002408 struct : public FunctionCall {
2409 GLenum face;
2410 GLenum func;
2411 GLint ref;
2412 GLuint mask;
2413
2414 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2415 _c->glStencilFuncSeparate(face, func, ref, mask);
2416 return 0;
2417 }
2418 } caller;
2419 caller.face = face;
2420 caller.func = func;
2421 caller.ref = ref;
2422 caller.mask = mask;
2423
2424 msg.set_arg0(face);
2425 msg.set_arg1(func);
2426 msg.set_arg2(ref);
2427 msg.set_arg3(mask);
2428
David Lifbfc7032011-03-21 16:25:58 -07002429 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilFuncSeparate);
David Li28ca2ab2011-03-01 16:08:10 -08002430}
2431
2432void Debug_glStencilMask(GLuint mask)
2433{
David Li55c94cc2011-03-04 17:50:48 -08002434 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002435 struct : public FunctionCall {
2436 GLuint mask;
2437
2438 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2439 _c->glStencilMask(mask);
2440 return 0;
2441 }
2442 } caller;
2443 caller.mask = mask;
2444
2445 msg.set_arg0(mask);
2446
David Lifbfc7032011-03-21 16:25:58 -07002447 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilMask);
David Li28ca2ab2011-03-01 16:08:10 -08002448}
2449
2450void Debug_glStencilMaskSeparate(GLenum face, GLuint mask)
2451{
David Li55c94cc2011-03-04 17:50:48 -08002452 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002453 struct : public FunctionCall {
2454 GLenum face;
2455 GLuint mask;
2456
2457 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2458 _c->glStencilMaskSeparate(face, mask);
2459 return 0;
2460 }
2461 } caller;
2462 caller.face = face;
2463 caller.mask = mask;
2464
2465 msg.set_arg0(face);
2466 msg.set_arg1(mask);
2467
David Lifbfc7032011-03-21 16:25:58 -07002468 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilMaskSeparate);
David Li28ca2ab2011-03-01 16:08:10 -08002469}
2470
2471void Debug_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
2472{
David Li55c94cc2011-03-04 17:50:48 -08002473 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002474 struct : public FunctionCall {
2475 GLenum fail;
2476 GLenum zfail;
2477 GLenum zpass;
2478
2479 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2480 _c->glStencilOp(fail, zfail, zpass);
2481 return 0;
2482 }
2483 } caller;
2484 caller.fail = fail;
2485 caller.zfail = zfail;
2486 caller.zpass = zpass;
2487
2488 msg.set_arg0(fail);
2489 msg.set_arg1(zfail);
2490 msg.set_arg2(zpass);
2491
David Lifbfc7032011-03-21 16:25:58 -07002492 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilOp);
David Li28ca2ab2011-03-01 16:08:10 -08002493}
2494
2495void Debug_glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2496{
David Li55c94cc2011-03-04 17:50:48 -08002497 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002498 struct : public FunctionCall {
2499 GLenum face;
2500 GLenum fail;
2501 GLenum zfail;
2502 GLenum zpass;
2503
2504 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2505 _c->glStencilOpSeparate(face, fail, zfail, zpass);
2506 return 0;
2507 }
2508 } caller;
2509 caller.face = face;
2510 caller.fail = fail;
2511 caller.zfail = zfail;
2512 caller.zpass = zpass;
2513
2514 msg.set_arg0(face);
2515 msg.set_arg1(fail);
2516 msg.set_arg2(zfail);
2517 msg.set_arg3(zpass);
2518
David Lifbfc7032011-03-21 16:25:58 -07002519 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glStencilOpSeparate);
2520}
2521
2522void Debug_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
2523{
2524 glesv2debugger::Message msg;
2525 struct : public FunctionCall {
2526 GLenum target;
2527 GLint level;
2528 GLint internalformat;
2529 GLsizei width;
2530 GLsizei height;
2531 GLint border;
2532 GLenum format;
2533 GLenum type;
2534 const GLvoid* pixels;
2535
2536 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2537 _c->glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
David Lie2ad4d02011-04-08 18:41:00 -07002538#ifdef EXTEND_AFTER_CALL_Debug_glTexImage2D
2539 EXTEND_AFTER_CALL_Debug_glTexImage2D;
2540#endif
David Lifbfc7032011-03-21 16:25:58 -07002541 return 0;
2542 }
2543 } caller;
2544 caller.target = target;
2545 caller.level = level;
2546 caller.internalformat = internalformat;
2547 caller.width = width;
2548 caller.height = height;
2549 caller.border = border;
2550 caller.format = format;
2551 caller.type = type;
2552 caller.pixels = pixels;
2553
2554 msg.set_arg0(target);
2555 msg.set_arg1(level);
2556 msg.set_arg2(internalformat);
2557 msg.set_arg3(width);
2558 msg.set_arg4(height);
2559 msg.set_arg5(border);
2560 msg.set_arg6(format);
2561 msg.set_arg7(type);
2562 msg.set_arg8(ToInt(pixels));
2563
2564 // FIXME: check for pointer usage
David Lie2ad4d02011-04-08 18:41:00 -07002565#ifdef EXTEND_Debug_glTexImage2D
David Lifbfc7032011-03-21 16:25:58 -07002566 EXTEND_Debug_glTexImage2D;
David Lie2ad4d02011-04-08 18:41:00 -07002567#endif
David Lifbfc7032011-03-21 16:25:58 -07002568 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexImage2D);
David Li28ca2ab2011-03-01 16:08:10 -08002569}
2570
2571void Debug_glTexParameterf(GLenum target, GLenum pname, GLfloat param)
2572{
David Li55c94cc2011-03-04 17:50:48 -08002573 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002574 struct : public FunctionCall {
2575 GLenum target;
2576 GLenum pname;
2577 GLfloat param;
2578
2579 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2580 _c->glTexParameterf(target, pname, param);
2581 return 0;
2582 }
2583 } caller;
2584 caller.target = target;
2585 caller.pname = pname;
2586 caller.param = param;
2587
2588 msg.set_arg0(target);
2589 msg.set_arg1(pname);
2590 msg.set_arg2(ToInt(param));
2591
David Lifbfc7032011-03-21 16:25:58 -07002592 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameterf);
David Li28ca2ab2011-03-01 16:08:10 -08002593}
2594
2595// FIXME: this function has pointers, it should be hand written
2596void Debug_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
2597{
David Li55c94cc2011-03-04 17:50:48 -08002598 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002599 struct : public FunctionCall {
2600 GLenum target;
2601 GLenum pname;
2602 const GLfloat* params;
2603
2604 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2605 _c->glTexParameterfv(target, pname, params);
2606 return 0;
2607 }
2608 } caller;
2609 caller.target = target;
2610 caller.pname = pname;
2611 caller.params = params;
2612
2613 msg.set_arg0(target);
2614 msg.set_arg1(pname);
2615 msg.set_arg2(ToInt(params));
2616
2617 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07002618 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameterfv);
David Li28ca2ab2011-03-01 16:08:10 -08002619}
2620
2621void Debug_glTexParameteri(GLenum target, GLenum pname, GLint param)
2622{
David Li55c94cc2011-03-04 17:50:48 -08002623 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002624 struct : public FunctionCall {
2625 GLenum target;
2626 GLenum pname;
2627 GLint param;
2628
2629 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2630 _c->glTexParameteri(target, pname, param);
2631 return 0;
2632 }
2633 } caller;
2634 caller.target = target;
2635 caller.pname = pname;
2636 caller.param = param;
2637
2638 msg.set_arg0(target);
2639 msg.set_arg1(pname);
2640 msg.set_arg2(param);
2641
David Lifbfc7032011-03-21 16:25:58 -07002642 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameteri);
David Li28ca2ab2011-03-01 16:08:10 -08002643}
2644
2645// FIXME: this function has pointers, it should be hand written
2646void Debug_glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
2647{
David Li55c94cc2011-03-04 17:50:48 -08002648 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002649 struct : public FunctionCall {
2650 GLenum target;
2651 GLenum pname;
2652 const GLint* params;
2653
2654 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2655 _c->glTexParameteriv(target, pname, params);
2656 return 0;
2657 }
2658 } caller;
2659 caller.target = target;
2660 caller.pname = pname;
2661 caller.params = params;
2662
2663 msg.set_arg0(target);
2664 msg.set_arg1(pname);
2665 msg.set_arg2(ToInt(params));
2666
2667 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07002668 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexParameteriv);
2669}
2670
2671void Debug_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
2672{
2673 glesv2debugger::Message msg;
2674 struct : public FunctionCall {
2675 GLenum target;
2676 GLint level;
2677 GLint xoffset;
2678 GLint yoffset;
2679 GLsizei width;
2680 GLsizei height;
2681 GLenum format;
2682 GLenum type;
2683 const GLvoid* pixels;
2684
2685 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2686 _c->glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
David Lie2ad4d02011-04-08 18:41:00 -07002687#ifdef EXTEND_AFTER_CALL_Debug_glTexSubImage2D
2688 EXTEND_AFTER_CALL_Debug_glTexSubImage2D;
2689#endif
David Lifbfc7032011-03-21 16:25:58 -07002690 return 0;
2691 }
2692 } caller;
2693 caller.target = target;
2694 caller.level = level;
2695 caller.xoffset = xoffset;
2696 caller.yoffset = yoffset;
2697 caller.width = width;
2698 caller.height = height;
2699 caller.format = format;
2700 caller.type = type;
2701 caller.pixels = pixels;
2702
2703 msg.set_arg0(target);
2704 msg.set_arg1(level);
2705 msg.set_arg2(xoffset);
2706 msg.set_arg3(yoffset);
2707 msg.set_arg4(width);
2708 msg.set_arg5(height);
2709 msg.set_arg6(format);
2710 msg.set_arg7(type);
2711 msg.set_arg8(ToInt(pixels));
2712
2713 // FIXME: check for pointer usage
David Lie2ad4d02011-04-08 18:41:00 -07002714#ifdef EXTEND_Debug_glTexSubImage2D
David Lifbfc7032011-03-21 16:25:58 -07002715 EXTEND_Debug_glTexSubImage2D;
David Lie2ad4d02011-04-08 18:41:00 -07002716#endif
David Lifbfc7032011-03-21 16:25:58 -07002717 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glTexSubImage2D);
David Li28ca2ab2011-03-01 16:08:10 -08002718}
2719
2720void Debug_glUniform1f(GLint location, GLfloat x)
2721{
David Li55c94cc2011-03-04 17:50:48 -08002722 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002723 struct : public FunctionCall {
2724 GLint location;
2725 GLfloat x;
2726
2727 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2728 _c->glUniform1f(location, x);
2729 return 0;
2730 }
2731 } caller;
2732 caller.location = location;
2733 caller.x = x;
2734
2735 msg.set_arg0(location);
2736 msg.set_arg1(ToInt(x));
2737
David Lifbfc7032011-03-21 16:25:58 -07002738 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1f);
David Li28ca2ab2011-03-01 16:08:10 -08002739}
2740
2741void Debug_glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
2742{
David Li55c94cc2011-03-04 17:50:48 -08002743 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002744 struct : public FunctionCall {
2745 GLint location;
2746 GLsizei count;
2747 const GLfloat* v;
2748
2749 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2750 _c->glUniform1fv(location, count, v);
2751 return 0;
2752 }
2753 } caller;
2754 caller.location = location;
2755 caller.count = count;
2756 caller.v = v;
2757
2758 msg.set_arg0(location);
2759 msg.set_arg1(count);
2760 msg.set_arg2(ToInt(v));
2761
2762 // FIXME: check for pointer usage
2763 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 1*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07002764 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1fv);
David Li28ca2ab2011-03-01 16:08:10 -08002765}
2766
2767void Debug_glUniform1i(GLint location, GLint x)
2768{
David Li55c94cc2011-03-04 17:50:48 -08002769 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002770 struct : public FunctionCall {
2771 GLint location;
2772 GLint x;
2773
2774 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2775 _c->glUniform1i(location, x);
2776 return 0;
2777 }
2778 } caller;
2779 caller.location = location;
2780 caller.x = x;
2781
2782 msg.set_arg0(location);
2783 msg.set_arg1(x);
2784
David Lifbfc7032011-03-21 16:25:58 -07002785 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1i);
David Li28ca2ab2011-03-01 16:08:10 -08002786}
2787
2788void Debug_glUniform1iv(GLint location, GLsizei count, const GLint* v)
2789{
David Li55c94cc2011-03-04 17:50:48 -08002790 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002791 struct : public FunctionCall {
2792 GLint location;
2793 GLsizei count;
2794 const GLint* v;
2795
2796 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2797 _c->glUniform1iv(location, count, v);
2798 return 0;
2799 }
2800 } caller;
2801 caller.location = location;
2802 caller.count = count;
2803 caller.v = v;
2804
2805 msg.set_arg0(location);
2806 msg.set_arg1(count);
2807 msg.set_arg2(ToInt(v));
2808
2809 // FIXME: check for pointer usage
2810 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 1*count * sizeof(GLint));
David Lifbfc7032011-03-21 16:25:58 -07002811 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform1iv);
David Li28ca2ab2011-03-01 16:08:10 -08002812}
2813
2814void Debug_glUniform2f(GLint location, GLfloat x, GLfloat y)
2815{
David Li55c94cc2011-03-04 17:50:48 -08002816 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002817 struct : public FunctionCall {
2818 GLint location;
2819 GLfloat x;
2820 GLfloat y;
2821
2822 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2823 _c->glUniform2f(location, x, y);
2824 return 0;
2825 }
2826 } caller;
2827 caller.location = location;
2828 caller.x = x;
2829 caller.y = y;
2830
2831 msg.set_arg0(location);
2832 msg.set_arg1(ToInt(x));
2833 msg.set_arg2(ToInt(y));
2834
David Lifbfc7032011-03-21 16:25:58 -07002835 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2f);
David Li28ca2ab2011-03-01 16:08:10 -08002836}
2837
2838void Debug_glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
2839{
David Li55c94cc2011-03-04 17:50:48 -08002840 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002841 struct : public FunctionCall {
2842 GLint location;
2843 GLsizei count;
2844 const GLfloat* v;
2845
2846 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2847 _c->glUniform2fv(location, count, v);
2848 return 0;
2849 }
2850 } caller;
2851 caller.location = location;
2852 caller.count = count;
2853 caller.v = v;
2854
2855 msg.set_arg0(location);
2856 msg.set_arg1(count);
2857 msg.set_arg2(ToInt(v));
2858
2859 // FIXME: check for pointer usage
2860 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 2*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07002861 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2fv);
David Li28ca2ab2011-03-01 16:08:10 -08002862}
2863
2864void Debug_glUniform2i(GLint location, GLint x, GLint y)
2865{
David Li55c94cc2011-03-04 17:50:48 -08002866 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002867 struct : public FunctionCall {
2868 GLint location;
2869 GLint x;
2870 GLint y;
2871
2872 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2873 _c->glUniform2i(location, x, y);
2874 return 0;
2875 }
2876 } caller;
2877 caller.location = location;
2878 caller.x = x;
2879 caller.y = y;
2880
2881 msg.set_arg0(location);
2882 msg.set_arg1(x);
2883 msg.set_arg2(y);
2884
David Lifbfc7032011-03-21 16:25:58 -07002885 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2i);
David Li28ca2ab2011-03-01 16:08:10 -08002886}
2887
2888void Debug_glUniform2iv(GLint location, GLsizei count, const GLint* v)
2889{
David Li55c94cc2011-03-04 17:50:48 -08002890 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002891 struct : public FunctionCall {
2892 GLint location;
2893 GLsizei count;
2894 const GLint* v;
2895
2896 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2897 _c->glUniform2iv(location, count, v);
2898 return 0;
2899 }
2900 } caller;
2901 caller.location = location;
2902 caller.count = count;
2903 caller.v = v;
2904
2905 msg.set_arg0(location);
2906 msg.set_arg1(count);
2907 msg.set_arg2(ToInt(v));
2908
2909 // FIXME: check for pointer usage
2910 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 2*count * sizeof(GLint));
David Lifbfc7032011-03-21 16:25:58 -07002911 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform2iv);
David Li28ca2ab2011-03-01 16:08:10 -08002912}
2913
2914void Debug_glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
2915{
David Li55c94cc2011-03-04 17:50:48 -08002916 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002917 struct : public FunctionCall {
2918 GLint location;
2919 GLfloat x;
2920 GLfloat y;
2921 GLfloat z;
2922
2923 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2924 _c->glUniform3f(location, x, y, z);
2925 return 0;
2926 }
2927 } caller;
2928 caller.location = location;
2929 caller.x = x;
2930 caller.y = y;
2931 caller.z = z;
2932
2933 msg.set_arg0(location);
2934 msg.set_arg1(ToInt(x));
2935 msg.set_arg2(ToInt(y));
2936 msg.set_arg3(ToInt(z));
2937
David Lifbfc7032011-03-21 16:25:58 -07002938 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3f);
David Li28ca2ab2011-03-01 16:08:10 -08002939}
2940
2941void Debug_glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
2942{
David Li55c94cc2011-03-04 17:50:48 -08002943 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002944 struct : public FunctionCall {
2945 GLint location;
2946 GLsizei count;
2947 const GLfloat* v;
2948
2949 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2950 _c->glUniform3fv(location, count, v);
2951 return 0;
2952 }
2953 } caller;
2954 caller.location = location;
2955 caller.count = count;
2956 caller.v = v;
2957
2958 msg.set_arg0(location);
2959 msg.set_arg1(count);
2960 msg.set_arg2(ToInt(v));
2961
2962 // FIXME: check for pointer usage
2963 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 3*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07002964 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3fv);
David Li28ca2ab2011-03-01 16:08:10 -08002965}
2966
2967void Debug_glUniform3i(GLint location, GLint x, GLint y, GLint z)
2968{
David Li55c94cc2011-03-04 17:50:48 -08002969 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002970 struct : public FunctionCall {
2971 GLint location;
2972 GLint x;
2973 GLint y;
2974 GLint z;
2975
2976 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
2977 _c->glUniform3i(location, x, y, z);
2978 return 0;
2979 }
2980 } caller;
2981 caller.location = location;
2982 caller.x = x;
2983 caller.y = y;
2984 caller.z = z;
2985
2986 msg.set_arg0(location);
2987 msg.set_arg1(x);
2988 msg.set_arg2(y);
2989 msg.set_arg3(z);
2990
David Lifbfc7032011-03-21 16:25:58 -07002991 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3i);
David Li28ca2ab2011-03-01 16:08:10 -08002992}
2993
2994void Debug_glUniform3iv(GLint location, GLsizei count, const GLint* v)
2995{
David Li55c94cc2011-03-04 17:50:48 -08002996 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08002997 struct : public FunctionCall {
2998 GLint location;
2999 GLsizei count;
3000 const GLint* v;
3001
3002 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3003 _c->glUniform3iv(location, count, v);
3004 return 0;
3005 }
3006 } caller;
3007 caller.location = location;
3008 caller.count = count;
3009 caller.v = v;
3010
3011 msg.set_arg0(location);
3012 msg.set_arg1(count);
3013 msg.set_arg2(ToInt(v));
3014
3015 // FIXME: check for pointer usage
3016 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 3*count * sizeof(GLint));
David Lifbfc7032011-03-21 16:25:58 -07003017 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform3iv);
David Li28ca2ab2011-03-01 16:08:10 -08003018}
3019
3020void Debug_glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3021{
David Li55c94cc2011-03-04 17:50:48 -08003022 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003023 struct : public FunctionCall {
3024 GLint location;
3025 GLfloat x;
3026 GLfloat y;
3027 GLfloat z;
3028 GLfloat w;
3029
3030 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3031 _c->glUniform4f(location, x, y, z, w);
3032 return 0;
3033 }
3034 } caller;
3035 caller.location = location;
3036 caller.x = x;
3037 caller.y = y;
3038 caller.z = z;
3039 caller.w = w;
3040
3041 msg.set_arg0(location);
3042 msg.set_arg1(ToInt(x));
3043 msg.set_arg2(ToInt(y));
3044 msg.set_arg3(ToInt(z));
3045 msg.set_arg4(ToInt(w));
3046
David Lifbfc7032011-03-21 16:25:58 -07003047 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4f);
David Li28ca2ab2011-03-01 16:08:10 -08003048}
3049
3050void Debug_glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
3051{
David Li55c94cc2011-03-04 17:50:48 -08003052 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003053 struct : public FunctionCall {
3054 GLint location;
3055 GLsizei count;
3056 const GLfloat* v;
3057
3058 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3059 _c->glUniform4fv(location, count, v);
3060 return 0;
3061 }
3062 } caller;
3063 caller.location = location;
3064 caller.count = count;
3065 caller.v = v;
3066
3067 msg.set_arg0(location);
3068 msg.set_arg1(count);
3069 msg.set_arg2(ToInt(v));
3070
3071 // FIXME: check for pointer usage
3072 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 4*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003073 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4fv);
David Li28ca2ab2011-03-01 16:08:10 -08003074}
3075
3076void Debug_glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
3077{
David Li55c94cc2011-03-04 17:50:48 -08003078 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003079 struct : public FunctionCall {
3080 GLint location;
3081 GLint x;
3082 GLint y;
3083 GLint z;
3084 GLint w;
3085
3086 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3087 _c->glUniform4i(location, x, y, z, w);
3088 return 0;
3089 }
3090 } caller;
3091 caller.location = location;
3092 caller.x = x;
3093 caller.y = y;
3094 caller.z = z;
3095 caller.w = w;
3096
3097 msg.set_arg0(location);
3098 msg.set_arg1(x);
3099 msg.set_arg2(y);
3100 msg.set_arg3(z);
3101 msg.set_arg4(w);
3102
David Lifbfc7032011-03-21 16:25:58 -07003103 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4i);
David Li28ca2ab2011-03-01 16:08:10 -08003104}
3105
3106void Debug_glUniform4iv(GLint location, GLsizei count, const GLint* v)
3107{
David Li55c94cc2011-03-04 17:50:48 -08003108 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003109 struct : public FunctionCall {
3110 GLint location;
3111 GLsizei count;
3112 const GLint* v;
3113
3114 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3115 _c->glUniform4iv(location, count, v);
3116 return 0;
3117 }
3118 } caller;
3119 caller.location = location;
3120 caller.count = count;
3121 caller.v = v;
3122
3123 msg.set_arg0(location);
3124 msg.set_arg1(count);
3125 msg.set_arg2(ToInt(v));
3126
3127 // FIXME: check for pointer usage
3128 msg.mutable_data()->assign(reinterpret_cast<const char *>(v), 4*count * sizeof(GLint));
David Lifbfc7032011-03-21 16:25:58 -07003129 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniform4iv);
David Li28ca2ab2011-03-01 16:08:10 -08003130}
3131
3132void Debug_glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3133{
David Li55c94cc2011-03-04 17:50:48 -08003134 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003135 struct : public FunctionCall {
3136 GLint location;
3137 GLsizei count;
3138 GLboolean transpose;
3139 const GLfloat* value;
3140
3141 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3142 _c->glUniformMatrix2fv(location, count, transpose, value);
3143 return 0;
3144 }
3145 } caller;
3146 caller.location = location;
3147 caller.count = count;
3148 caller.transpose = transpose;
3149 caller.value = value;
3150
3151 msg.set_arg0(location);
3152 msg.set_arg1(count);
3153 msg.set_arg2(transpose);
3154 msg.set_arg3(ToInt(value));
3155
3156 // FIXME: check for pointer usage
3157 msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 4*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003158 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix2fv);
David Li28ca2ab2011-03-01 16:08:10 -08003159}
3160
3161void Debug_glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3162{
David Li55c94cc2011-03-04 17:50:48 -08003163 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003164 struct : public FunctionCall {
3165 GLint location;
3166 GLsizei count;
3167 GLboolean transpose;
3168 const GLfloat* value;
3169
3170 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3171 _c->glUniformMatrix3fv(location, count, transpose, value);
3172 return 0;
3173 }
3174 } caller;
3175 caller.location = location;
3176 caller.count = count;
3177 caller.transpose = transpose;
3178 caller.value = value;
3179
3180 msg.set_arg0(location);
3181 msg.set_arg1(count);
3182 msg.set_arg2(transpose);
3183 msg.set_arg3(ToInt(value));
3184
3185 // FIXME: check for pointer usage
3186 msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 9*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003187 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix3fv);
David Li28ca2ab2011-03-01 16:08:10 -08003188}
3189
3190void Debug_glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
3191{
David Li55c94cc2011-03-04 17:50:48 -08003192 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003193 struct : public FunctionCall {
3194 GLint location;
3195 GLsizei count;
3196 GLboolean transpose;
3197 const GLfloat* value;
3198
3199 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3200 _c->glUniformMatrix4fv(location, count, transpose, value);
3201 return 0;
3202 }
3203 } caller;
3204 caller.location = location;
3205 caller.count = count;
3206 caller.transpose = transpose;
3207 caller.value = value;
3208
3209 msg.set_arg0(location);
3210 msg.set_arg1(count);
3211 msg.set_arg2(transpose);
3212 msg.set_arg3(ToInt(value));
3213
3214 // FIXME: check for pointer usage
3215 msg.mutable_data()->assign(reinterpret_cast<const char *>(value), 16*count * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003216 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUniformMatrix4fv);
David Li28ca2ab2011-03-01 16:08:10 -08003217}
3218
3219void Debug_glUseProgram(GLuint program)
3220{
David Li55c94cc2011-03-04 17:50:48 -08003221 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003222 struct : public FunctionCall {
3223 GLuint program;
3224
3225 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3226 _c->glUseProgram(program);
David Li5c425f22011-03-10 16:40:37 -08003227 getDbgContextThreadSpecific()->glUseProgram(program);
David Li55c94cc2011-03-04 17:50:48 -08003228 return 0;
3229 }
3230 } caller;
3231 caller.program = program;
3232
3233 msg.set_arg0(program);
3234
David Lifbfc7032011-03-21 16:25:58 -07003235 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glUseProgram);
David Li28ca2ab2011-03-01 16:08:10 -08003236}
3237
3238void Debug_glValidateProgram(GLuint program)
3239{
David Li55c94cc2011-03-04 17:50:48 -08003240 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003241 struct : public FunctionCall {
3242 GLuint program;
3243
3244 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3245 _c->glValidateProgram(program);
3246 return 0;
3247 }
3248 } caller;
3249 caller.program = program;
3250
3251 msg.set_arg0(program);
3252
David Lifbfc7032011-03-21 16:25:58 -07003253 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glValidateProgram);
David Li28ca2ab2011-03-01 16:08:10 -08003254}
3255
3256void Debug_glVertexAttrib1f(GLuint indx, GLfloat x)
3257{
David Li55c94cc2011-03-04 17:50:48 -08003258 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003259 struct : public FunctionCall {
3260 GLuint indx;
3261 GLfloat x;
3262
3263 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3264 _c->glVertexAttrib1f(indx, x);
3265 return 0;
3266 }
3267 } caller;
3268 caller.indx = indx;
3269 caller.x = x;
3270
3271 msg.set_arg0(indx);
3272 msg.set_arg1(ToInt(x));
3273
David Lifbfc7032011-03-21 16:25:58 -07003274 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib1f);
David Li28ca2ab2011-03-01 16:08:10 -08003275}
3276
3277void Debug_glVertexAttrib1fv(GLuint indx, const GLfloat* values)
3278{
David Li55c94cc2011-03-04 17:50:48 -08003279 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003280 struct : public FunctionCall {
3281 GLuint indx;
3282 const GLfloat* values;
3283
3284 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3285 _c->glVertexAttrib1fv(indx, values);
3286 return 0;
3287 }
3288 } caller;
3289 caller.indx = indx;
3290 caller.values = values;
3291
3292 msg.set_arg0(indx);
3293 msg.set_arg1(ToInt(values));
3294
3295 // FIXME: check for pointer usage
3296 msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 1 * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003297 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib1fv);
David Li28ca2ab2011-03-01 16:08:10 -08003298}
3299
3300void Debug_glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
3301{
David Li55c94cc2011-03-04 17:50:48 -08003302 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003303 struct : public FunctionCall {
3304 GLuint indx;
3305 GLfloat x;
3306 GLfloat y;
3307
3308 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3309 _c->glVertexAttrib2f(indx, x, y);
3310 return 0;
3311 }
3312 } caller;
3313 caller.indx = indx;
3314 caller.x = x;
3315 caller.y = y;
3316
3317 msg.set_arg0(indx);
3318 msg.set_arg1(ToInt(x));
3319 msg.set_arg2(ToInt(y));
3320
David Lifbfc7032011-03-21 16:25:58 -07003321 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib2f);
David Li28ca2ab2011-03-01 16:08:10 -08003322}
3323
3324void Debug_glVertexAttrib2fv(GLuint indx, const GLfloat* values)
3325{
David Li55c94cc2011-03-04 17:50:48 -08003326 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003327 struct : public FunctionCall {
3328 GLuint indx;
3329 const GLfloat* values;
3330
3331 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3332 _c->glVertexAttrib2fv(indx, values);
3333 return 0;
3334 }
3335 } caller;
3336 caller.indx = indx;
3337 caller.values = values;
3338
3339 msg.set_arg0(indx);
3340 msg.set_arg1(ToInt(values));
3341
3342 // FIXME: check for pointer usage
3343 msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 2 * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003344 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib2fv);
David Li28ca2ab2011-03-01 16:08:10 -08003345}
3346
3347void Debug_glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
3348{
David Li55c94cc2011-03-04 17:50:48 -08003349 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003350 struct : public FunctionCall {
3351 GLuint indx;
3352 GLfloat x;
3353 GLfloat y;
3354 GLfloat z;
3355
3356 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3357 _c->glVertexAttrib3f(indx, x, y, z);
3358 return 0;
3359 }
3360 } caller;
3361 caller.indx = indx;
3362 caller.x = x;
3363 caller.y = y;
3364 caller.z = z;
3365
3366 msg.set_arg0(indx);
3367 msg.set_arg1(ToInt(x));
3368 msg.set_arg2(ToInt(y));
3369 msg.set_arg3(ToInt(z));
3370
David Lifbfc7032011-03-21 16:25:58 -07003371 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib3f);
David Li28ca2ab2011-03-01 16:08:10 -08003372}
3373
3374void Debug_glVertexAttrib3fv(GLuint indx, const GLfloat* values)
3375{
David Li55c94cc2011-03-04 17:50:48 -08003376 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003377 struct : public FunctionCall {
3378 GLuint indx;
3379 const GLfloat* values;
3380
3381 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3382 _c->glVertexAttrib3fv(indx, values);
3383 return 0;
3384 }
3385 } caller;
3386 caller.indx = indx;
3387 caller.values = values;
3388
3389 msg.set_arg0(indx);
3390 msg.set_arg1(ToInt(values));
3391
3392 // FIXME: check for pointer usage
3393 msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 3 * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003394 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib3fv);
David Li28ca2ab2011-03-01 16:08:10 -08003395}
3396
3397void Debug_glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3398{
David Li55c94cc2011-03-04 17:50:48 -08003399 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003400 struct : public FunctionCall {
3401 GLuint indx;
3402 GLfloat x;
3403 GLfloat y;
3404 GLfloat z;
3405 GLfloat w;
3406
3407 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3408 _c->glVertexAttrib4f(indx, x, y, z, w);
3409 return 0;
3410 }
3411 } caller;
3412 caller.indx = indx;
3413 caller.x = x;
3414 caller.y = y;
3415 caller.z = z;
3416 caller.w = w;
3417
3418 msg.set_arg0(indx);
3419 msg.set_arg1(ToInt(x));
3420 msg.set_arg2(ToInt(y));
3421 msg.set_arg3(ToInt(z));
3422 msg.set_arg4(ToInt(w));
3423
David Lifbfc7032011-03-21 16:25:58 -07003424 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib4f);
David Li28ca2ab2011-03-01 16:08:10 -08003425}
3426
3427void Debug_glVertexAttrib4fv(GLuint indx, const GLfloat* values)
3428{
David Li55c94cc2011-03-04 17:50:48 -08003429 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003430 struct : public FunctionCall {
3431 GLuint indx;
3432 const GLfloat* values;
3433
3434 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3435 _c->glVertexAttrib4fv(indx, values);
3436 return 0;
3437 }
3438 } caller;
3439 caller.indx = indx;
3440 caller.values = values;
3441
3442 msg.set_arg0(indx);
3443 msg.set_arg1(ToInt(values));
3444
3445 // FIXME: check for pointer usage
3446 msg.mutable_data()->assign(reinterpret_cast<const char *>(values), 4 * sizeof(GLfloat));
David Lifbfc7032011-03-21 16:25:58 -07003447 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttrib4fv);
David Li28ca2ab2011-03-01 16:08:10 -08003448}
3449
3450// FIXME: this function has pointers, it should be hand written
3451void Debug_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
3452{
David Li55c94cc2011-03-04 17:50:48 -08003453 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003454 struct : public FunctionCall {
3455 GLuint indx;
3456 GLint size;
3457 GLenum type;
3458 GLboolean normalized;
3459 GLsizei stride;
3460 const GLvoid* ptr;
3461
3462 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3463 _c->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
David Li5c425f22011-03-10 16:40:37 -08003464 getDbgContextThreadSpecific()->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
David Li55c94cc2011-03-04 17:50:48 -08003465 return 0;
3466 }
3467 } caller;
3468 caller.indx = indx;
3469 caller.size = size;
3470 caller.type = type;
3471 caller.normalized = normalized;
3472 caller.stride = stride;
3473 caller.ptr = ptr;
3474
3475 msg.set_arg0(indx);
3476 msg.set_arg1(size);
3477 msg.set_arg2(type);
3478 msg.set_arg3(normalized);
3479 msg.set_arg4(stride);
3480 msg.set_arg5(ToInt(ptr));
3481
3482 // FIXME: check for pointer usage
David Lifbfc7032011-03-21 16:25:58 -07003483 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glVertexAttribPointer);
David Li28ca2ab2011-03-01 16:08:10 -08003484}
3485
3486void Debug_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
3487{
David Li55c94cc2011-03-04 17:50:48 -08003488 glesv2debugger::Message msg;
David Li55c94cc2011-03-04 17:50:48 -08003489 struct : public FunctionCall {
3490 GLint x;
3491 GLint y;
3492 GLsizei width;
3493 GLsizei height;
3494
3495 const int * operator()(gl_hooks_t::gl_t const * const _c, glesv2debugger::Message & msg) {
3496 _c->glViewport(x, y, width, height);
3497 return 0;
3498 }
3499 } caller;
3500 caller.x = x;
3501 caller.y = y;
3502 caller.width = width;
3503 caller.height = height;
3504
3505 msg.set_arg0(x);
3506 msg.set_arg1(y);
3507 msg.set_arg2(width);
3508 msg.set_arg3(height);
3509
David Lifbfc7032011-03-21 16:25:58 -07003510 int * ret = MessageLoop(caller, msg, glesv2debugger::Message_Function_glViewport);
David Li28ca2ab2011-03-01 16:08:10 -08003511}
3512
3513// FIXME: the following functions should be written by hand
David Li28ca2ab2011-03-01 16:08:10 -08003514void Debug_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
3515void Debug_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
David Li28ca2ab2011-03-01 16:08:10 -08003516void Debug_glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
3517void Debug_glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
3518void Debug_glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
3519void Debug_glGetBooleanv(GLenum pname, GLboolean* params);
3520void Debug_glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
3521void Debug_glGetFloatv(GLenum pname, GLfloat* params);
3522void Debug_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
3523void Debug_glGetIntegerv(GLenum pname, GLint* params);
3524void Debug_glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
3525void Debug_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
3526void Debug_glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
3527void Debug_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
3528void Debug_glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
3529const GLubyte* Debug_glGetString(GLenum name);
3530void Debug_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
3531void Debug_glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
3532void Debug_glGetUniformfv(GLuint program, GLint location, GLfloat* params);
3533void Debug_glGetUniformiv(GLuint program, GLint location, GLint* params);
3534void Debug_glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
3535void Debug_glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
3536void Debug_glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
David Li28ca2ab2011-03-01 16:08:10 -08003537void Debug_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
3538void Debug_glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
3539void Debug_glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
3540void Debug_glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);