1/*
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
17// auto generated by generate_caller_cpp.py
18// implement declarations in caller.h
19
20#include "header.h"
21
22namespace android {
23
24static const int * GenerateCall_glCompressedTexImage2D(DbgContext * const dbg,
25    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
26static const int * GenerateCall_glCompressedTexSubImage2D(DbgContext * const dbg,
27    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
28static const int * GenerateCall_glDrawElements(DbgContext * const dbg,
29    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
30static const int * GenerateCall_glGenBuffers(DbgContext * const dbg,
31    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
32static const int * GenerateCall_glGenFramebuffers(DbgContext * const dbg,
33    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
34static const int * GenerateCall_glGenRenderbuffers(DbgContext * const dbg,
35    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
36static const int * GenerateCall_glGenTextures(DbgContext * const dbg,
37    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
38static const int * GenerateCall_glGetActiveAttrib(DbgContext * const dbg,
39    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
40static const int * GenerateCall_glGetActiveUniform(DbgContext * const dbg,
41    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
42static const int * GenerateCall_glGetAttachedShaders(DbgContext * const dbg,
43    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
44static const int * GenerateCall_glGetBooleanv(DbgContext * const dbg,
45    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
46static const int * GenerateCall_glGetBufferParameteriv(DbgContext * const dbg,
47    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
48static const int * GenerateCall_glGetFloatv(DbgContext * const dbg,
49    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
50static const int * GenerateCall_glGetFramebufferAttachmentParameteriv(DbgContext * const dbg,
51    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
52static const int * GenerateCall_glGetIntegerv(DbgContext * const dbg,
53    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
54static const int * GenerateCall_glGetProgramiv(DbgContext * const dbg,
55    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
56static const int * GenerateCall_glGetProgramInfoLog(DbgContext * const dbg,
57    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
58static const int * GenerateCall_glGetRenderbufferParameteriv(DbgContext * const dbg,
59    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
60static const int * GenerateCall_glGetShaderiv(DbgContext * const dbg,
61    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
62static const int * GenerateCall_glGetShaderInfoLog(DbgContext * const dbg,
63    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
64static const int * GenerateCall_glGetShaderPrecisionFormat(DbgContext * const dbg,
65    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
66static const int * GenerateCall_glGetShaderSource(DbgContext * const dbg,
67    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
68static const int * GenerateCall_glGetString(DbgContext * const dbg,
69    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
70static const int * GenerateCall_glGetTexParameterfv(DbgContext * const dbg,
71    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
72static const int * GenerateCall_glGetTexParameteriv(DbgContext * const dbg,
73    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
74static const int * GenerateCall_glGetUniformfv(DbgContext * const dbg,
75    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
76static const int * GenerateCall_glGetUniformiv(DbgContext * const dbg,
77    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
78static const int * GenerateCall_glGetVertexAttribfv(DbgContext * const dbg,
79    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
80static const int * GenerateCall_glGetVertexAttribiv(DbgContext * const dbg,
81    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
82static const int * GenerateCall_glGetVertexAttribPointerv(DbgContext * const dbg,
83    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
84static const int * GenerateCall_glReadPixels(DbgContext * const dbg,
85    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
86static const int * GenerateCall_glShaderBinary(DbgContext * const dbg,
87    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
88static const int * GenerateCall_glShaderSource(DbgContext * const dbg,
89    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
90static const int * GenerateCall_glTexImage2D(DbgContext * const dbg,
91    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
92static const int * GenerateCall_glTexParameterfv(DbgContext * const dbg,
93    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
94static const int * GenerateCall_glTexParameteriv(DbgContext * const dbg,
95    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
96static const int * GenerateCall_glTexSubImage2D(DbgContext * const dbg,
97    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
98static const int * GenerateCall_glVertexAttribPointer(DbgContext * const dbg,
99    const glesv2debugger::Message & cmd, glesv2debugger::Message & msg, const int * const prevRet);
100
101#include "caller.h"
102
103const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & cmd,
104                  glesv2debugger::Message & msg, const int * const prevRet)
105{
106    LOGD("GenerateCall function=%u", cmd.function());
107    const int * ret = prevRet; // only some functions have return value
108    nsecs_t c0 = systemTime(timeMode);
109    switch (cmd.function()) {    case glesv2debugger::Message_Function_glActiveTexture:
110        dbg->hooks->gl.glActiveTexture(
111            static_cast<GLenum>(cmd.arg0()));
112        break;
113    case glesv2debugger::Message_Function_glAttachShader:
114        dbg->hooks->gl.glAttachShader(
115            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
116            );
117        break;
118    case glesv2debugger::Message_Function_glBindAttribLocation:
119        dbg->hooks->gl.glBindAttribLocation(
120            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1()),
121            reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
122            );
123        break;
124    case glesv2debugger::Message_Function_glBindBuffer:
125        dbg->hooks->gl.glBindBuffer(
126            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
127            );
128        break;
129    case glesv2debugger::Message_Function_glBindFramebuffer:
130        dbg->hooks->gl.glBindFramebuffer(
131            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
132            );
133        break;
134    case glesv2debugger::Message_Function_glBindRenderbuffer:
135        dbg->hooks->gl.glBindRenderbuffer(
136            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
137            );
138        break;
139    case glesv2debugger::Message_Function_glBindTexture:
140        dbg->hooks->gl.glBindTexture(
141            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
142            );
143        break;
144    case glesv2debugger::Message_Function_glBlendColor:
145        dbg->hooks->gl.glBlendColor(
146            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1()),
147            static_cast<GLclampf>(cmd.arg2()), static_cast<GLclampf>(cmd.arg3())
148            );
149        break;
150    case glesv2debugger::Message_Function_glBlendEquation:
151        dbg->hooks->gl.glBlendEquation(
152            static_cast<GLenum>(cmd.arg0()));
153        break;
154    case glesv2debugger::Message_Function_glBlendEquationSeparate:
155        dbg->hooks->gl.glBlendEquationSeparate(
156            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
157            );
158        break;
159    case glesv2debugger::Message_Function_glBlendFunc:
160        dbg->hooks->gl.glBlendFunc(
161            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
162            );
163        break;
164    case glesv2debugger::Message_Function_glBlendFuncSeparate:
165        dbg->hooks->gl.glBlendFuncSeparate(
166            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
167            static_cast<GLenum>(cmd.arg2()), static_cast<GLenum>(cmd.arg3())
168            );
169        break;
170    case glesv2debugger::Message_Function_glBufferData:
171        dbg->hooks->gl.glBufferData(
172            static_cast<GLenum>(cmd.arg0()), static_cast<GLsizeiptr>(cmd.arg1()),
173            reinterpret_cast<GLvoid*>(const_cast<char *>(cmd.data().data())),
174            static_cast<GLenum>(cmd.arg3()));
175        break;
176    case glesv2debugger::Message_Function_glBufferSubData:
177        dbg->hooks->gl.glBufferSubData(
178            static_cast<GLenum>(cmd.arg0()), static_cast<GLintptr>(cmd.arg1()),
179            static_cast<GLsizeiptr>(cmd.arg2()), reinterpret_cast<GLvoid*>(const_cast<char *>(cmd.data().data()))
180            );
181        break;
182    case glesv2debugger::Message_Function_glCheckFramebufferStatus:
183        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCheckFramebufferStatus(
184            static_cast<GLenum>(cmd.arg0()))));
185        if (cmd.has_ret())
186            ret = reinterpret_cast<int *>(msg.ret());
187        break;
188    case glesv2debugger::Message_Function_glClear:
189        dbg->hooks->gl.glClear(
190            static_cast<GLbitfield>(cmd.arg0()));
191        break;
192    case glesv2debugger::Message_Function_glClearColor:
193        dbg->hooks->gl.glClearColor(
194            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1()),
195            static_cast<GLclampf>(cmd.arg2()), static_cast<GLclampf>(cmd.arg3())
196            );
197        break;
198    case glesv2debugger::Message_Function_glClearDepthf:
199        dbg->hooks->gl.glClearDepthf(
200            static_cast<GLclampf>(cmd.arg0()));
201        break;
202    case glesv2debugger::Message_Function_glClearStencil:
203        dbg->hooks->gl.glClearStencil(
204            static_cast<GLint>(cmd.arg0()));
205        break;
206    case glesv2debugger::Message_Function_glColorMask:
207        dbg->hooks->gl.glColorMask(
208            GLboolean(cmd.arg0()), GLboolean(cmd.arg1()), GLboolean(cmd.arg2()),
209            GLboolean(cmd.arg3()));
210        break;
211    case glesv2debugger::Message_Function_glCompileShader:
212        dbg->hooks->gl.glCompileShader(
213            static_cast<GLuint>(cmd.arg0()));
214        break;
215    case glesv2debugger::Message_Function_glCompressedTexImage2D:
216        ret = GenerateCall_glCompressedTexImage2D(dbg, cmd, msg, prevRet);
217        break;
218    case glesv2debugger::Message_Function_glCompressedTexSubImage2D:
219        ret = GenerateCall_glCompressedTexSubImage2D(dbg, cmd, msg, prevRet);
220        break;
221    case glesv2debugger::Message_Function_glCopyTexImage2D:
222        dbg->hooks->gl.glCopyTexImage2D(
223            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
224            static_cast<GLenum>(cmd.arg2()), static_cast<GLint>(cmd.arg3()),
225            static_cast<GLint>(cmd.arg4()), static_cast<GLsizei>(cmd.arg5()),
226            static_cast<GLsizei>(cmd.arg6()), static_cast<GLint>(cmd.arg7())
227            );
228        break;
229    case glesv2debugger::Message_Function_glCopyTexSubImage2D:
230        dbg->hooks->gl.glCopyTexSubImage2D(
231            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
232            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3()),
233            static_cast<GLint>(cmd.arg4()), static_cast<GLint>(cmd.arg5()),
234            static_cast<GLsizei>(cmd.arg6()), static_cast<GLsizei>(cmd.arg7())
235            );
236        break;
237    case glesv2debugger::Message_Function_glCreateProgram:
238        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCreateProgram(
239            )));
240        if (cmd.has_ret())
241            ret = reinterpret_cast<int *>(msg.ret());
242        break;
243    case glesv2debugger::Message_Function_glCreateShader:
244        msg.set_ret(static_cast<int>(dbg->hooks->gl.glCreateShader(
245            static_cast<GLenum>(cmd.arg0()))));
246        if (cmd.has_ret())
247            ret = reinterpret_cast<int *>(msg.ret());
248        break;
249    case glesv2debugger::Message_Function_glCullFace:
250        dbg->hooks->gl.glCullFace(
251            static_cast<GLenum>(cmd.arg0()));
252        break;
253    case glesv2debugger::Message_Function_glDeleteBuffers:
254        dbg->hooks->gl.glDeleteBuffers(
255            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
256            );
257        break;
258    case glesv2debugger::Message_Function_glDeleteFramebuffers:
259        dbg->hooks->gl.glDeleteFramebuffers(
260            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
261            );
262        break;
263    case glesv2debugger::Message_Function_glDeleteProgram:
264        dbg->hooks->gl.glDeleteProgram(
265            static_cast<GLuint>(cmd.arg0()));
266        break;
267    case glesv2debugger::Message_Function_glDeleteRenderbuffers:
268        dbg->hooks->gl.glDeleteRenderbuffers(
269            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
270            );
271        break;
272    case glesv2debugger::Message_Function_glDeleteShader:
273        dbg->hooks->gl.glDeleteShader(
274            static_cast<GLuint>(cmd.arg0()));
275        break;
276    case glesv2debugger::Message_Function_glDeleteTextures:
277        dbg->hooks->gl.glDeleteTextures(
278            static_cast<GLsizei>(cmd.arg0()), reinterpret_cast<GLuint*>(const_cast<char *>(cmd.data().data()))
279            );
280        break;
281    case glesv2debugger::Message_Function_glDepthFunc:
282        dbg->hooks->gl.glDepthFunc(
283            static_cast<GLenum>(cmd.arg0()));
284        break;
285    case glesv2debugger::Message_Function_glDepthMask:
286        dbg->hooks->gl.glDepthMask(
287            GLboolean(cmd.arg0()));
288        break;
289    case glesv2debugger::Message_Function_glDepthRangef:
290        dbg->hooks->gl.glDepthRangef(
291            static_cast<GLclampf>(cmd.arg0()), static_cast<GLclampf>(cmd.arg1())
292            );
293        break;
294    case glesv2debugger::Message_Function_glDetachShader:
295        dbg->hooks->gl.glDetachShader(
296            static_cast<GLuint>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
297            );
298        break;
299    case glesv2debugger::Message_Function_glDisable:
300        dbg->hooks->gl.glDisable(
301            static_cast<GLenum>(cmd.arg0()));
302        break;
303    case glesv2debugger::Message_Function_glDisableVertexAttribArray:
304        dbg->hooks->gl.glDisableVertexAttribArray(
305            static_cast<GLuint>(cmd.arg0()));
306        break;
307    case glesv2debugger::Message_Function_glDrawArrays:
308        dbg->hooks->gl.glDrawArrays(
309            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
310            static_cast<GLsizei>(cmd.arg2()));
311        break;
312    case glesv2debugger::Message_Function_glDrawElements:
313        ret = GenerateCall_glDrawElements(dbg, cmd, msg, prevRet);
314        break;
315    case glesv2debugger::Message_Function_glEnable:
316        dbg->hooks->gl.glEnable(
317            static_cast<GLenum>(cmd.arg0()));
318        break;
319    case glesv2debugger::Message_Function_glEnableVertexAttribArray:
320        dbg->hooks->gl.glEnableVertexAttribArray(
321            static_cast<GLuint>(cmd.arg0()));
322        break;
323    case glesv2debugger::Message_Function_glFinish:
324        dbg->hooks->gl.glFinish(
325            );
326        break;
327    case glesv2debugger::Message_Function_glFlush:
328        dbg->hooks->gl.glFlush(
329            );
330        break;
331    case glesv2debugger::Message_Function_glFramebufferRenderbuffer:
332        dbg->hooks->gl.glFramebufferRenderbuffer(
333            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
334            static_cast<GLenum>(cmd.arg2()), static_cast<GLuint>(cmd.arg3())
335            );
336        break;
337    case glesv2debugger::Message_Function_glFramebufferTexture2D:
338        dbg->hooks->gl.glFramebufferTexture2D(
339            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
340            static_cast<GLenum>(cmd.arg2()), static_cast<GLuint>(cmd.arg3()),
341            static_cast<GLint>(cmd.arg4()));
342        break;
343    case glesv2debugger::Message_Function_glFrontFace:
344        dbg->hooks->gl.glFrontFace(
345            static_cast<GLenum>(cmd.arg0()));
346        break;
347    case glesv2debugger::Message_Function_glGenBuffers:
348        ret = GenerateCall_glGenBuffers(dbg, cmd, msg, prevRet);
349        break; // annotated output pointers
350    case glesv2debugger::Message_Function_glGenerateMipmap:
351        dbg->hooks->gl.glGenerateMipmap(
352            static_cast<GLenum>(cmd.arg0()));
353        break;
354    case glesv2debugger::Message_Function_glGenFramebuffers:
355        ret = GenerateCall_glGenFramebuffers(dbg, cmd, msg, prevRet);
356        break; // annotated output pointers
357    case glesv2debugger::Message_Function_glGenRenderbuffers:
358        ret = GenerateCall_glGenRenderbuffers(dbg, cmd, msg, prevRet);
359        break; // annotated output pointers
360    case glesv2debugger::Message_Function_glGenTextures:
361        ret = GenerateCall_glGenTextures(dbg, cmd, msg, prevRet);
362        break; // annotated output pointers
363    case glesv2debugger::Message_Function_glGetActiveAttrib:
364        ret = GenerateCall_glGetActiveAttrib(dbg, cmd, msg, prevRet);
365        break;
366    case glesv2debugger::Message_Function_glGetActiveUniform:
367        ret = GenerateCall_glGetActiveUniform(dbg, cmd, msg, prevRet);
368        break;
369    case glesv2debugger::Message_Function_glGetAttachedShaders:
370        ret = GenerateCall_glGetAttachedShaders(dbg, cmd, msg, prevRet);
371        break;
372    case glesv2debugger::Message_Function_glGetAttribLocation:
373        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetAttribLocation(
374            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
375            )));
376        if (cmd.has_ret())
377            ret = reinterpret_cast<int *>(msg.ret());
378        break;
379    case glesv2debugger::Message_Function_glGetBooleanv:
380        ret = GenerateCall_glGetBooleanv(dbg, cmd, msg, prevRet);
381        break;
382    case glesv2debugger::Message_Function_glGetBufferParameteriv:
383        ret = GenerateCall_glGetBufferParameteriv(dbg, cmd, msg, prevRet);
384        break;
385    case glesv2debugger::Message_Function_glGetError:
386        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetError(
387            )));
388        if (cmd.has_ret())
389            ret = reinterpret_cast<int *>(msg.ret());
390        break;
391    case glesv2debugger::Message_Function_glGetFloatv:
392        ret = GenerateCall_glGetFloatv(dbg, cmd, msg, prevRet);
393        break;
394    case glesv2debugger::Message_Function_glGetFramebufferAttachmentParameteriv:
395        ret = GenerateCall_glGetFramebufferAttachmentParameteriv(dbg, cmd, msg, prevRet);
396        break;
397    case glesv2debugger::Message_Function_glGetIntegerv:
398        ret = GenerateCall_glGetIntegerv(dbg, cmd, msg, prevRet);
399        break;
400    case glesv2debugger::Message_Function_glGetProgramiv:
401        ret = GenerateCall_glGetProgramiv(dbg, cmd, msg, prevRet);
402        break; // annotated output pointers
403    case glesv2debugger::Message_Function_glGetProgramInfoLog:
404        ret = GenerateCall_glGetProgramInfoLog(dbg, cmd, msg, prevRet);
405        break;
406    case glesv2debugger::Message_Function_glGetRenderbufferParameteriv:
407        ret = GenerateCall_glGetRenderbufferParameteriv(dbg, cmd, msg, prevRet);
408        break;
409    case glesv2debugger::Message_Function_glGetShaderiv:
410        ret = GenerateCall_glGetShaderiv(dbg, cmd, msg, prevRet);
411        break; // annotated output pointers
412    case glesv2debugger::Message_Function_glGetShaderInfoLog:
413        ret = GenerateCall_glGetShaderInfoLog(dbg, cmd, msg, prevRet);
414        break;
415    case glesv2debugger::Message_Function_glGetShaderPrecisionFormat:
416        ret = GenerateCall_glGetShaderPrecisionFormat(dbg, cmd, msg, prevRet);
417        break;
418    case glesv2debugger::Message_Function_glGetShaderSource:
419        ret = GenerateCall_glGetShaderSource(dbg, cmd, msg, prevRet);
420        break;
421    case glesv2debugger::Message_Function_glGetString:
422        ret = GenerateCall_glGetString(dbg, cmd, msg, prevRet);
423        break;
424    case glesv2debugger::Message_Function_glGetTexParameterfv:
425        ret = GenerateCall_glGetTexParameterfv(dbg, cmd, msg, prevRet);
426        break;
427    case glesv2debugger::Message_Function_glGetTexParameteriv:
428        ret = GenerateCall_glGetTexParameteriv(dbg, cmd, msg, prevRet);
429        break;
430    case glesv2debugger::Message_Function_glGetUniformfv:
431        ret = GenerateCall_glGetUniformfv(dbg, cmd, msg, prevRet);
432        break;
433    case glesv2debugger::Message_Function_glGetUniformiv:
434        ret = GenerateCall_glGetUniformiv(dbg, cmd, msg, prevRet);
435        break;
436    case glesv2debugger::Message_Function_glGetUniformLocation:
437        msg.set_ret(static_cast<int>(dbg->hooks->gl.glGetUniformLocation(
438            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLchar*>(const_cast<char *>(cmd.data().data()))
439            )));
440        if (cmd.has_ret())
441            ret = reinterpret_cast<int *>(msg.ret());
442        break;
443    case glesv2debugger::Message_Function_glGetVertexAttribfv:
444        ret = GenerateCall_glGetVertexAttribfv(dbg, cmd, msg, prevRet);
445        break;
446    case glesv2debugger::Message_Function_glGetVertexAttribiv:
447        ret = GenerateCall_glGetVertexAttribiv(dbg, cmd, msg, prevRet);
448        break;
449    case glesv2debugger::Message_Function_glGetVertexAttribPointerv:
450        ret = GenerateCall_glGetVertexAttribPointerv(dbg, cmd, msg, prevRet);
451        break;
452    case glesv2debugger::Message_Function_glHint:
453        dbg->hooks->gl.glHint(
454            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1())
455            );
456        break;
457    case glesv2debugger::Message_Function_glIsBuffer:
458        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsBuffer(
459            static_cast<GLuint>(cmd.arg0()))));
460        if (cmd.has_ret())
461            ret = reinterpret_cast<int *>(msg.ret());
462        break;
463    case glesv2debugger::Message_Function_glIsEnabled:
464        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsEnabled(
465            static_cast<GLenum>(cmd.arg0()))));
466        if (cmd.has_ret())
467            ret = reinterpret_cast<int *>(msg.ret());
468        break;
469    case glesv2debugger::Message_Function_glIsFramebuffer:
470        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsFramebuffer(
471            static_cast<GLuint>(cmd.arg0()))));
472        if (cmd.has_ret())
473            ret = reinterpret_cast<int *>(msg.ret());
474        break;
475    case glesv2debugger::Message_Function_glIsProgram:
476        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsProgram(
477            static_cast<GLuint>(cmd.arg0()))));
478        if (cmd.has_ret())
479            ret = reinterpret_cast<int *>(msg.ret());
480        break;
481    case glesv2debugger::Message_Function_glIsRenderbuffer:
482        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsRenderbuffer(
483            static_cast<GLuint>(cmd.arg0()))));
484        if (cmd.has_ret())
485            ret = reinterpret_cast<int *>(msg.ret());
486        break;
487    case glesv2debugger::Message_Function_glIsShader:
488        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsShader(
489            static_cast<GLuint>(cmd.arg0()))));
490        if (cmd.has_ret())
491            ret = reinterpret_cast<int *>(msg.ret());
492        break;
493    case glesv2debugger::Message_Function_glIsTexture:
494        msg.set_ret(static_cast<int>(dbg->hooks->gl.glIsTexture(
495            static_cast<GLuint>(cmd.arg0()))));
496        if (cmd.has_ret())
497            ret = reinterpret_cast<int *>(msg.ret());
498        break;
499    case glesv2debugger::Message_Function_glLineWidth:
500        dbg->hooks->gl.glLineWidth(
501            static_cast<GLfloat>(cmd.arg0()));
502        break;
503    case glesv2debugger::Message_Function_glLinkProgram:
504        dbg->hooks->gl.glLinkProgram(
505            static_cast<GLuint>(cmd.arg0()));
506        break;
507    case glesv2debugger::Message_Function_glPixelStorei:
508        dbg->hooks->gl.glPixelStorei(
509            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1())
510            );
511        break;
512    case glesv2debugger::Message_Function_glPolygonOffset:
513        dbg->hooks->gl.glPolygonOffset(
514            static_cast<GLfloat>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
515            );
516        break;
517    case glesv2debugger::Message_Function_glReadPixels:
518        ret = GenerateCall_glReadPixels(dbg, cmd, msg, prevRet);
519        break;
520    case glesv2debugger::Message_Function_glReleaseShaderCompiler:
521        dbg->hooks->gl.glReleaseShaderCompiler(
522            );
523        break;
524    case glesv2debugger::Message_Function_glRenderbufferStorage:
525        dbg->hooks->gl.glRenderbufferStorage(
526            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
527            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
528            );
529        break;
530    case glesv2debugger::Message_Function_glSampleCoverage:
531        dbg->hooks->gl.glSampleCoverage(
532            static_cast<GLclampf>(cmd.arg0()), GLboolean(cmd.arg1()));
533        break;
534    case glesv2debugger::Message_Function_glScissor:
535        dbg->hooks->gl.glScissor(
536            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
537            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
538            );
539        break;
540    case glesv2debugger::Message_Function_glShaderBinary:
541        ret = GenerateCall_glShaderBinary(dbg, cmd, msg, prevRet);
542        break;
543    case glesv2debugger::Message_Function_glShaderSource:
544        ret = GenerateCall_glShaderSource(dbg, cmd, msg, prevRet);
545        break;
546    case glesv2debugger::Message_Function_glStencilFunc:
547        dbg->hooks->gl.glStencilFunc(
548            static_cast<GLenum>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
549            static_cast<GLuint>(cmd.arg2()));
550        break;
551    case glesv2debugger::Message_Function_glStencilFuncSeparate:
552        dbg->hooks->gl.glStencilFuncSeparate(
553            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
554            static_cast<GLint>(cmd.arg2()), static_cast<GLuint>(cmd.arg3())
555            );
556        break;
557    case glesv2debugger::Message_Function_glStencilMask:
558        dbg->hooks->gl.glStencilMask(
559            static_cast<GLuint>(cmd.arg0()));
560        break;
561    case glesv2debugger::Message_Function_glStencilMaskSeparate:
562        dbg->hooks->gl.glStencilMaskSeparate(
563            static_cast<GLenum>(cmd.arg0()), static_cast<GLuint>(cmd.arg1())
564            );
565        break;
566    case glesv2debugger::Message_Function_glStencilOp:
567        dbg->hooks->gl.glStencilOp(
568            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
569            static_cast<GLenum>(cmd.arg2()));
570        break;
571    case glesv2debugger::Message_Function_glStencilOpSeparate:
572        dbg->hooks->gl.glStencilOpSeparate(
573            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
574            static_cast<GLenum>(cmd.arg2()), static_cast<GLenum>(cmd.arg3())
575            );
576        break;
577    case glesv2debugger::Message_Function_glTexImage2D:
578        ret = GenerateCall_glTexImage2D(dbg, cmd, msg, prevRet);
579        break;
580    case glesv2debugger::Message_Function_glTexParameterf:
581        dbg->hooks->gl.glTexParameterf(
582            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
583            static_cast<GLfloat>(cmd.arg2()));
584        break;
585    case glesv2debugger::Message_Function_glTexParameterfv:
586        ret = GenerateCall_glTexParameterfv(dbg, cmd, msg, prevRet);
587        break;
588    case glesv2debugger::Message_Function_glTexParameteri:
589        dbg->hooks->gl.glTexParameteri(
590            static_cast<GLenum>(cmd.arg0()), static_cast<GLenum>(cmd.arg1()),
591            static_cast<GLint>(cmd.arg2()));
592        break;
593    case glesv2debugger::Message_Function_glTexParameteriv:
594        ret = GenerateCall_glTexParameteriv(dbg, cmd, msg, prevRet);
595        break;
596    case glesv2debugger::Message_Function_glTexSubImage2D:
597        ret = GenerateCall_glTexSubImage2D(dbg, cmd, msg, prevRet);
598        break;
599    case glesv2debugger::Message_Function_glUniform1f:
600        dbg->hooks->gl.glUniform1f(
601            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
602            );
603        break;
604    case glesv2debugger::Message_Function_glUniform1fv:
605        dbg->hooks->gl.glUniform1fv(
606            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
607            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
608            );
609        break;
610    case glesv2debugger::Message_Function_glUniform1i:
611        dbg->hooks->gl.glUniform1i(
612            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1())
613            );
614        break;
615    case glesv2debugger::Message_Function_glUniform1iv:
616        dbg->hooks->gl.glUniform1iv(
617            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
618            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
619            );
620        break;
621    case glesv2debugger::Message_Function_glUniform2f:
622        dbg->hooks->gl.glUniform2f(
623            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()),
624            static_cast<GLfloat>(cmd.arg2()));
625        break;
626    case glesv2debugger::Message_Function_glUniform2fv:
627        dbg->hooks->gl.glUniform2fv(
628            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
629            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
630            );
631        break;
632    case glesv2debugger::Message_Function_glUniform2i:
633        dbg->hooks->gl.glUniform2i(
634            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
635            static_cast<GLint>(cmd.arg2()));
636        break;
637    case glesv2debugger::Message_Function_glUniform2iv:
638        dbg->hooks->gl.glUniform2iv(
639            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
640            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
641            );
642        break;
643    case glesv2debugger::Message_Function_glUniform3f:
644        dbg->hooks->gl.glUniform3f(
645            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()),
646            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3())
647            );
648        break;
649    case glesv2debugger::Message_Function_glUniform3fv:
650        dbg->hooks->gl.glUniform3fv(
651            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
652            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
653            );
654        break;
655    case glesv2debugger::Message_Function_glUniform3i:
656        dbg->hooks->gl.glUniform3i(
657            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
658            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3())
659            );
660        break;
661    case glesv2debugger::Message_Function_glUniform3iv:
662        dbg->hooks->gl.glUniform3iv(
663            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
664            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
665            );
666        break;
667    case glesv2debugger::Message_Function_glUniform4f:
668        dbg->hooks->gl.glUniform4f(
669            static_cast<GLint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()),
670            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3()),
671            static_cast<GLfloat>(cmd.arg4()));
672        break;
673    case glesv2debugger::Message_Function_glUniform4fv:
674        dbg->hooks->gl.glUniform4fv(
675            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
676            reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
677            );
678        break;
679    case glesv2debugger::Message_Function_glUniform4i:
680        dbg->hooks->gl.glUniform4i(
681            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
682            static_cast<GLint>(cmd.arg2()), static_cast<GLint>(cmd.arg3()),
683            static_cast<GLint>(cmd.arg4()));
684        break;
685    case glesv2debugger::Message_Function_glUniform4iv:
686        dbg->hooks->gl.glUniform4iv(
687            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
688            reinterpret_cast<GLint*>(const_cast<char *>(cmd.data().data()))
689            );
690        break;
691    case glesv2debugger::Message_Function_glUniformMatrix2fv:
692        dbg->hooks->gl.glUniformMatrix2fv(
693            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
694            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
695            );
696        break;
697    case glesv2debugger::Message_Function_glUniformMatrix3fv:
698        dbg->hooks->gl.glUniformMatrix3fv(
699            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
700            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
701            );
702        break;
703    case glesv2debugger::Message_Function_glUniformMatrix4fv:
704        dbg->hooks->gl.glUniformMatrix4fv(
705            static_cast<GLint>(cmd.arg0()), static_cast<GLsizei>(cmd.arg1()),
706            GLboolean(cmd.arg2()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
707            );
708        break;
709    case glesv2debugger::Message_Function_glUseProgram:
710        dbg->hooks->gl.glUseProgram(
711            static_cast<GLuint>(cmd.arg0()));
712        break;
713    case glesv2debugger::Message_Function_glValidateProgram:
714        dbg->hooks->gl.glValidateProgram(
715            static_cast<GLuint>(cmd.arg0()));
716        break;
717    case glesv2debugger::Message_Function_glVertexAttrib1f:
718        dbg->hooks->gl.glVertexAttrib1f(
719            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1())
720            );
721        break;
722    case glesv2debugger::Message_Function_glVertexAttrib1fv:
723        dbg->hooks->gl.glVertexAttrib1fv(
724            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
725            );
726        break;
727    case glesv2debugger::Message_Function_glVertexAttrib2f:
728        dbg->hooks->gl.glVertexAttrib2f(
729            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()),
730            static_cast<GLfloat>(cmd.arg2()));
731        break;
732    case glesv2debugger::Message_Function_glVertexAttrib2fv:
733        dbg->hooks->gl.glVertexAttrib2fv(
734            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
735            );
736        break;
737    case glesv2debugger::Message_Function_glVertexAttrib3f:
738        dbg->hooks->gl.glVertexAttrib3f(
739            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()),
740            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3())
741            );
742        break;
743    case glesv2debugger::Message_Function_glVertexAttrib3fv:
744        dbg->hooks->gl.glVertexAttrib3fv(
745            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
746            );
747        break;
748    case glesv2debugger::Message_Function_glVertexAttrib4f:
749        dbg->hooks->gl.glVertexAttrib4f(
750            static_cast<GLuint>(cmd.arg0()), static_cast<GLfloat>(cmd.arg1()),
751            static_cast<GLfloat>(cmd.arg2()), static_cast<GLfloat>(cmd.arg3()),
752            static_cast<GLfloat>(cmd.arg4()));
753        break;
754    case glesv2debugger::Message_Function_glVertexAttrib4fv:
755        dbg->hooks->gl.glVertexAttrib4fv(
756            static_cast<GLuint>(cmd.arg0()), reinterpret_cast<GLfloat*>(const_cast<char *>(cmd.data().data()))
757            );
758        break;
759    case glesv2debugger::Message_Function_glVertexAttribPointer:
760        ret = GenerateCall_glVertexAttribPointer(dbg, cmd, msg, prevRet);
761        break;
762    case glesv2debugger::Message_Function_glViewport:
763        dbg->hooks->gl.glViewport(
764            static_cast<GLint>(cmd.arg0()), static_cast<GLint>(cmd.arg1()),
765            static_cast<GLsizei>(cmd.arg2()), static_cast<GLsizei>(cmd.arg3())
766            );
767        break;
768    default:
769        assert(0);
770    }
771    msg.set_time((systemTime(timeMode) - c0) * 1e-6f);
772    msg.set_context_id(reinterpret_cast<int>(dbg));
773    msg.set_function(cmd.function());
774    msg.set_type(glesv2debugger::Message_Type_AfterGeneratedCall);
775    return ret;
776}
777
778}; // name space android {
779