• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml.
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // capture_gles_2_0_autogen.cpp:
9 //   Capture functions for the OpenGL ES 2.0 entry points.
10 
11 #include "libANGLE/capture/capture_gles_2_0_autogen.h"
12 
13 #include "libANGLE/Context.h"
14 #include "libANGLE/capture/FrameCapture.h"
15 #include "libANGLE/capture/gl_enum_utils.h"
16 #include "libANGLE/validationES2.h"
17 
18 using namespace angle;
19 
20 namespace gl
21 {
22 
CaptureActiveTexture(const State & glState,bool isCallValid,GLenum texture)23 CallCapture CaptureActiveTexture(const State &glState, bool isCallValid, GLenum texture)
24 {
25     ParamBuffer paramBuffer;
26 
27     paramBuffer.addEnumParam("texture", GLenumGroup::TextureUnit, ParamType::TGLenum, texture);
28 
29     return CallCapture(angle::EntryPoint::GLActiveTexture, std::move(paramBuffer));
30 }
31 
CaptureAttachShader(const State & glState,bool isCallValid,ShaderProgramID programPacked,ShaderProgramID shaderPacked)32 CallCapture CaptureAttachShader(const State &glState,
33                                 bool isCallValid,
34                                 ShaderProgramID programPacked,
35                                 ShaderProgramID shaderPacked)
36 {
37     ParamBuffer paramBuffer;
38 
39     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
40     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
41 
42     return CallCapture(angle::EntryPoint::GLAttachShader, std::move(paramBuffer));
43 }
44 
CaptureBindAttribLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,const GLchar * name)45 CallCapture CaptureBindAttribLocation(const State &glState,
46                                       bool isCallValid,
47                                       ShaderProgramID programPacked,
48                                       GLuint index,
49                                       const GLchar *name)
50 {
51     ParamBuffer paramBuffer;
52 
53     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
54     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
55 
56     if (isCallValid)
57     {
58         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
59         InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
60         CaptureBindAttribLocation_name(glState, isCallValid, programPacked, index, name,
61                                        &nameParam);
62         paramBuffer.addParam(std::move(nameParam));
63     }
64     else
65     {
66         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
67         InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
68                        &nameParam.value);
69         paramBuffer.addParam(std::move(nameParam));
70     }
71 
72     return CallCapture(angle::EntryPoint::GLBindAttribLocation, std::move(paramBuffer));
73 }
74 
CaptureBindBuffer(const State & glState,bool isCallValid,BufferBinding targetPacked,BufferID bufferPacked)75 CallCapture CaptureBindBuffer(const State &glState,
76                               bool isCallValid,
77                               BufferBinding targetPacked,
78                               BufferID bufferPacked)
79 {
80     ParamBuffer paramBuffer;
81 
82     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
83     paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
84 
85     return CallCapture(angle::EntryPoint::GLBindBuffer, std::move(paramBuffer));
86 }
87 
CaptureBindFramebuffer(const State & glState,bool isCallValid,GLenum target,FramebufferID framebufferPacked)88 CallCapture CaptureBindFramebuffer(const State &glState,
89                                    bool isCallValid,
90                                    GLenum target,
91                                    FramebufferID framebufferPacked)
92 {
93     ParamBuffer paramBuffer;
94 
95     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
96     paramBuffer.addValueParam("framebufferPacked", ParamType::TFramebufferID, framebufferPacked);
97 
98     return CallCapture(angle::EntryPoint::GLBindFramebuffer, std::move(paramBuffer));
99 }
100 
CaptureBindRenderbuffer(const State & glState,bool isCallValid,GLenum target,RenderbufferID renderbufferPacked)101 CallCapture CaptureBindRenderbuffer(const State &glState,
102                                     bool isCallValid,
103                                     GLenum target,
104                                     RenderbufferID renderbufferPacked)
105 {
106     ParamBuffer paramBuffer;
107 
108     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
109     paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
110 
111     return CallCapture(angle::EntryPoint::GLBindRenderbuffer, std::move(paramBuffer));
112 }
113 
CaptureBindTexture(const State & glState,bool isCallValid,TextureType targetPacked,TextureID texturePacked)114 CallCapture CaptureBindTexture(const State &glState,
115                                bool isCallValid,
116                                TextureType targetPacked,
117                                TextureID texturePacked)
118 {
119     ParamBuffer paramBuffer;
120 
121     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
122     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
123 
124     return CallCapture(angle::EntryPoint::GLBindTexture, std::move(paramBuffer));
125 }
126 
CaptureBlendColor(const State & glState,bool isCallValid,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)127 CallCapture CaptureBlendColor(const State &glState,
128                               bool isCallValid,
129                               GLfloat red,
130                               GLfloat green,
131                               GLfloat blue,
132                               GLfloat alpha)
133 {
134     ParamBuffer paramBuffer;
135 
136     paramBuffer.addValueParam("red", ParamType::TGLfloat, red);
137     paramBuffer.addValueParam("green", ParamType::TGLfloat, green);
138     paramBuffer.addValueParam("blue", ParamType::TGLfloat, blue);
139     paramBuffer.addValueParam("alpha", ParamType::TGLfloat, alpha);
140 
141     return CallCapture(angle::EntryPoint::GLBlendColor, std::move(paramBuffer));
142 }
143 
CaptureBlendEquation(const State & glState,bool isCallValid,GLenum mode)144 CallCapture CaptureBlendEquation(const State &glState, bool isCallValid, GLenum mode)
145 {
146     ParamBuffer paramBuffer;
147 
148     paramBuffer.addEnumParam("mode", GLenumGroup::BlendEquationModeEXT, ParamType::TGLenum, mode);
149 
150     return CallCapture(angle::EntryPoint::GLBlendEquation, std::move(paramBuffer));
151 }
152 
CaptureBlendEquationSeparate(const State & glState,bool isCallValid,GLenum modeRGB,GLenum modeAlpha)153 CallCapture CaptureBlendEquationSeparate(const State &glState,
154                                          bool isCallValid,
155                                          GLenum modeRGB,
156                                          GLenum modeAlpha)
157 {
158     ParamBuffer paramBuffer;
159 
160     paramBuffer.addEnumParam("modeRGB", GLenumGroup::BlendEquationModeEXT, ParamType::TGLenum,
161                              modeRGB);
162     paramBuffer.addEnumParam("modeAlpha", GLenumGroup::BlendEquationModeEXT, ParamType::TGLenum,
163                              modeAlpha);
164 
165     return CallCapture(angle::EntryPoint::GLBlendEquationSeparate, std::move(paramBuffer));
166 }
167 
CaptureBlendFunc(const State & glState,bool isCallValid,GLenum sfactor,GLenum dfactor)168 CallCapture CaptureBlendFunc(const State &glState, bool isCallValid, GLenum sfactor, GLenum dfactor)
169 {
170     ParamBuffer paramBuffer;
171 
172     paramBuffer.addEnumParam("sfactor", GLenumGroup::BlendingFactor, ParamType::TGLenum, sfactor);
173     paramBuffer.addEnumParam("dfactor", GLenumGroup::BlendingFactor, ParamType::TGLenum, dfactor);
174 
175     return CallCapture(angle::EntryPoint::GLBlendFunc, std::move(paramBuffer));
176 }
177 
CaptureBlendFuncSeparate(const State & glState,bool isCallValid,GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorAlpha,GLenum dfactorAlpha)178 CallCapture CaptureBlendFuncSeparate(const State &glState,
179                                      bool isCallValid,
180                                      GLenum sfactorRGB,
181                                      GLenum dfactorRGB,
182                                      GLenum sfactorAlpha,
183                                      GLenum dfactorAlpha)
184 {
185     ParamBuffer paramBuffer;
186 
187     paramBuffer.addEnumParam("sfactorRGB", GLenumGroup::BlendingFactor, ParamType::TGLenum,
188                              sfactorRGB);
189     paramBuffer.addEnumParam("dfactorRGB", GLenumGroup::BlendingFactor, ParamType::TGLenum,
190                              dfactorRGB);
191     paramBuffer.addEnumParam("sfactorAlpha", GLenumGroup::BlendingFactor, ParamType::TGLenum,
192                              sfactorAlpha);
193     paramBuffer.addEnumParam("dfactorAlpha", GLenumGroup::BlendingFactor, ParamType::TGLenum,
194                              dfactorAlpha);
195 
196     return CallCapture(angle::EntryPoint::GLBlendFuncSeparate, std::move(paramBuffer));
197 }
198 
CaptureBufferData(const State & glState,bool isCallValid,BufferBinding targetPacked,GLsizeiptr size,const void * data,BufferUsage usagePacked)199 CallCapture CaptureBufferData(const State &glState,
200                               bool isCallValid,
201                               BufferBinding targetPacked,
202                               GLsizeiptr size,
203                               const void *data,
204                               BufferUsage usagePacked)
205 {
206     ParamBuffer paramBuffer;
207 
208     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
209     paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
210 
211     if (isCallValid)
212     {
213         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
214         InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
215         CaptureBufferData_data(glState, isCallValid, targetPacked, size, data, usagePacked,
216                                &dataParam);
217         paramBuffer.addParam(std::move(dataParam));
218     }
219     else
220     {
221         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
222         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
223                        &dataParam.value);
224         paramBuffer.addParam(std::move(dataParam));
225     }
226 
227     paramBuffer.addValueParam("usagePacked", ParamType::TBufferUsage, usagePacked);
228 
229     return CallCapture(angle::EntryPoint::GLBufferData, std::move(paramBuffer));
230 }
231 
CaptureBufferSubData(const State & glState,bool isCallValid,BufferBinding targetPacked,GLintptr offset,GLsizeiptr size,const void * data)232 CallCapture CaptureBufferSubData(const State &glState,
233                                  bool isCallValid,
234                                  BufferBinding targetPacked,
235                                  GLintptr offset,
236                                  GLsizeiptr size,
237                                  const void *data)
238 {
239     ParamBuffer paramBuffer;
240 
241     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
242     paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
243     paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
244 
245     if (isCallValid)
246     {
247         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
248         InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
249         CaptureBufferSubData_data(glState, isCallValid, targetPacked, offset, size, data,
250                                   &dataParam);
251         paramBuffer.addParam(std::move(dataParam));
252     }
253     else
254     {
255         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
256         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
257                        &dataParam.value);
258         paramBuffer.addParam(std::move(dataParam));
259     }
260 
261     return CallCapture(angle::EntryPoint::GLBufferSubData, std::move(paramBuffer));
262 }
263 
CaptureCheckFramebufferStatus(const State & glState,bool isCallValid,GLenum target,GLenum returnValue)264 CallCapture CaptureCheckFramebufferStatus(const State &glState,
265                                           bool isCallValid,
266                                           GLenum target,
267                                           GLenum returnValue)
268 {
269     ParamBuffer paramBuffer;
270 
271     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
272 
273     ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
274     InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
275     paramBuffer.addReturnValue(std::move(returnValueCapture));
276 
277     return CallCapture(angle::EntryPoint::GLCheckFramebufferStatus, std::move(paramBuffer));
278 }
279 
CaptureClear(const State & glState,bool isCallValid,GLbitfield mask)280 CallCapture CaptureClear(const State &glState, bool isCallValid, GLbitfield mask)
281 {
282     ParamBuffer paramBuffer;
283 
284     paramBuffer.addEnumParam("mask", GLenumGroup::ClearBufferMask, ParamType::TGLbitfield, mask);
285 
286     return CallCapture(angle::EntryPoint::GLClear, std::move(paramBuffer));
287 }
288 
CaptureClearColor(const State & glState,bool isCallValid,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)289 CallCapture CaptureClearColor(const State &glState,
290                               bool isCallValid,
291                               GLfloat red,
292                               GLfloat green,
293                               GLfloat blue,
294                               GLfloat alpha)
295 {
296     ParamBuffer paramBuffer;
297 
298     paramBuffer.addValueParam("red", ParamType::TGLfloat, red);
299     paramBuffer.addValueParam("green", ParamType::TGLfloat, green);
300     paramBuffer.addValueParam("blue", ParamType::TGLfloat, blue);
301     paramBuffer.addValueParam("alpha", ParamType::TGLfloat, alpha);
302 
303     return CallCapture(angle::EntryPoint::GLClearColor, std::move(paramBuffer));
304 }
305 
CaptureClearDepthf(const State & glState,bool isCallValid,GLfloat d)306 CallCapture CaptureClearDepthf(const State &glState, bool isCallValid, GLfloat d)
307 {
308     ParamBuffer paramBuffer;
309 
310     paramBuffer.addValueParam("d", ParamType::TGLfloat, d);
311 
312     return CallCapture(angle::EntryPoint::GLClearDepthf, std::move(paramBuffer));
313 }
314 
CaptureClearStencil(const State & glState,bool isCallValid,GLint s)315 CallCapture CaptureClearStencil(const State &glState, bool isCallValid, GLint s)
316 {
317     ParamBuffer paramBuffer;
318 
319     paramBuffer.addValueParam("s", ParamType::TGLint, s);
320 
321     return CallCapture(angle::EntryPoint::GLClearStencil, std::move(paramBuffer));
322 }
323 
CaptureColorMask(const State & glState,bool isCallValid,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)324 CallCapture CaptureColorMask(const State &glState,
325                              bool isCallValid,
326                              GLboolean red,
327                              GLboolean green,
328                              GLboolean blue,
329                              GLboolean alpha)
330 {
331     ParamBuffer paramBuffer;
332 
333     paramBuffer.addValueParam("red", ParamType::TGLboolean, red);
334     paramBuffer.addValueParam("green", ParamType::TGLboolean, green);
335     paramBuffer.addValueParam("blue", ParamType::TGLboolean, blue);
336     paramBuffer.addValueParam("alpha", ParamType::TGLboolean, alpha);
337 
338     return CallCapture(angle::EntryPoint::GLColorMask, std::move(paramBuffer));
339 }
340 
CaptureCompileShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked)341 CallCapture CaptureCompileShader(const State &glState,
342                                  bool isCallValid,
343                                  ShaderProgramID shaderPacked)
344 {
345     ParamBuffer paramBuffer;
346 
347     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
348 
349     return CallCapture(angle::EntryPoint::GLCompileShader, std::move(paramBuffer));
350 }
351 
CaptureCompressedTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const void * data)352 CallCapture CaptureCompressedTexImage2D(const State &glState,
353                                         bool isCallValid,
354                                         TextureTarget targetPacked,
355                                         GLint level,
356                                         GLenum internalformat,
357                                         GLsizei width,
358                                         GLsizei height,
359                                         GLint border,
360                                         GLsizei imageSize,
361                                         const void *data)
362 {
363     ParamBuffer paramBuffer;
364 
365     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
366     paramBuffer.addValueParam("level", ParamType::TGLint, level);
367     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
368                              internalformat);
369     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
370     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
371     paramBuffer.addValueParam("border", ParamType::TGLint, border);
372     paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
373 
374     if (isCallValid)
375     {
376         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
377         InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
378         CaptureCompressedTexImage2D_data(glState, isCallValid, targetPacked, level, internalformat,
379                                          width, height, border, imageSize, data, &dataParam);
380         paramBuffer.addParam(std::move(dataParam));
381     }
382     else
383     {
384         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
385         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
386                        &dataParam.value);
387         paramBuffer.addParam(std::move(dataParam));
388     }
389 
390     return CallCapture(angle::EntryPoint::GLCompressedTexImage2D, std::move(paramBuffer));
391 }
392 
CaptureCompressedTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const void * data)393 CallCapture CaptureCompressedTexSubImage2D(const State &glState,
394                                            bool isCallValid,
395                                            TextureTarget targetPacked,
396                                            GLint level,
397                                            GLint xoffset,
398                                            GLint yoffset,
399                                            GLsizei width,
400                                            GLsizei height,
401                                            GLenum format,
402                                            GLsizei imageSize,
403                                            const void *data)
404 {
405     ParamBuffer paramBuffer;
406 
407     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
408     paramBuffer.addValueParam("level", ParamType::TGLint, level);
409     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
410     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
411     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
412     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
413     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
414     paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
415 
416     if (isCallValid)
417     {
418         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
419         InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
420         CaptureCompressedTexSubImage2D_data(glState, isCallValid, targetPacked, level, xoffset,
421                                             yoffset, width, height, format, imageSize, data,
422                                             &dataParam);
423         paramBuffer.addParam(std::move(dataParam));
424     }
425     else
426     {
427         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
428         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
429                        &dataParam.value);
430         paramBuffer.addParam(std::move(dataParam));
431     }
432 
433     return CallCapture(angle::EntryPoint::GLCompressedTexSubImage2D, std::move(paramBuffer));
434 }
435 
CaptureCopyTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)436 CallCapture CaptureCopyTexImage2D(const State &glState,
437                                   bool isCallValid,
438                                   TextureTarget targetPacked,
439                                   GLint level,
440                                   GLenum internalformat,
441                                   GLint x,
442                                   GLint y,
443                                   GLsizei width,
444                                   GLsizei height,
445                                   GLint border)
446 {
447     ParamBuffer paramBuffer;
448 
449     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
450     paramBuffer.addValueParam("level", ParamType::TGLint, level);
451     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
452                              internalformat);
453     paramBuffer.addValueParam("x", ParamType::TGLint, x);
454     paramBuffer.addValueParam("y", ParamType::TGLint, y);
455     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
456     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
457     paramBuffer.addValueParam("border", ParamType::TGLint, border);
458 
459     return CallCapture(angle::EntryPoint::GLCopyTexImage2D, std::move(paramBuffer));
460 }
461 
CaptureCopyTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)462 CallCapture CaptureCopyTexSubImage2D(const State &glState,
463                                      bool isCallValid,
464                                      TextureTarget targetPacked,
465                                      GLint level,
466                                      GLint xoffset,
467                                      GLint yoffset,
468                                      GLint x,
469                                      GLint y,
470                                      GLsizei width,
471                                      GLsizei height)
472 {
473     ParamBuffer paramBuffer;
474 
475     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
476     paramBuffer.addValueParam("level", ParamType::TGLint, level);
477     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
478     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
479     paramBuffer.addValueParam("x", ParamType::TGLint, x);
480     paramBuffer.addValueParam("y", ParamType::TGLint, y);
481     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
482     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
483 
484     return CallCapture(angle::EntryPoint::GLCopyTexSubImage2D, std::move(paramBuffer));
485 }
486 
CaptureCreateProgram(const State & glState,bool isCallValid,GLuint returnValue)487 CallCapture CaptureCreateProgram(const State &glState, bool isCallValid, GLuint returnValue)
488 {
489     ParamBuffer paramBuffer;
490 
491     ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
492     InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
493     paramBuffer.addReturnValue(std::move(returnValueCapture));
494 
495     return CallCapture(angle::EntryPoint::GLCreateProgram, std::move(paramBuffer));
496 }
497 
CaptureCreateShader(const State & glState,bool isCallValid,ShaderType typePacked,GLuint returnValue)498 CallCapture CaptureCreateShader(const State &glState,
499                                 bool isCallValid,
500                                 ShaderType typePacked,
501                                 GLuint returnValue)
502 {
503     ParamBuffer paramBuffer;
504 
505     paramBuffer.addValueParam("typePacked", ParamType::TShaderType, typePacked);
506 
507     ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
508     InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
509     paramBuffer.addReturnValue(std::move(returnValueCapture));
510 
511     return CallCapture(angle::EntryPoint::GLCreateShader, std::move(paramBuffer));
512 }
513 
CaptureCullFace(const State & glState,bool isCallValid,CullFaceMode modePacked)514 CallCapture CaptureCullFace(const State &glState, bool isCallValid, CullFaceMode modePacked)
515 {
516     ParamBuffer paramBuffer;
517 
518     paramBuffer.addValueParam("modePacked", ParamType::TCullFaceMode, modePacked);
519 
520     return CallCapture(angle::EntryPoint::GLCullFace, std::move(paramBuffer));
521 }
522 
CaptureDeleteBuffers(const State & glState,bool isCallValid,GLsizei n,const BufferID * buffersPacked)523 CallCapture CaptureDeleteBuffers(const State &glState,
524                                  bool isCallValid,
525                                  GLsizei n,
526                                  const BufferID *buffersPacked)
527 {
528     ParamBuffer paramBuffer;
529 
530     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
531 
532     if (isCallValid)
533     {
534         ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDConstPointer);
535         InitParamValue(ParamType::TBufferIDConstPointer, buffersPacked, &buffersPackedParam.value);
536         CaptureDeleteBuffers_buffersPacked(glState, isCallValid, n, buffersPacked,
537                                            &buffersPackedParam);
538         paramBuffer.addParam(std::move(buffersPackedParam));
539     }
540     else
541     {
542         ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDConstPointer);
543         InitParamValue(ParamType::TBufferIDConstPointer, static_cast<const BufferID *>(nullptr),
544                        &buffersPackedParam.value);
545         paramBuffer.addParam(std::move(buffersPackedParam));
546     }
547 
548     return CallCapture(angle::EntryPoint::GLDeleteBuffers, std::move(paramBuffer));
549 }
550 
CaptureDeleteFramebuffers(const State & glState,bool isCallValid,GLsizei n,const FramebufferID * framebuffersPacked)551 CallCapture CaptureDeleteFramebuffers(const State &glState,
552                                       bool isCallValid,
553                                       GLsizei n,
554                                       const FramebufferID *framebuffersPacked)
555 {
556     ParamBuffer paramBuffer;
557 
558     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
559 
560     if (isCallValid)
561     {
562         ParamCapture framebuffersPackedParam("framebuffersPacked",
563                                              ParamType::TFramebufferIDConstPointer);
564         InitParamValue(ParamType::TFramebufferIDConstPointer, framebuffersPacked,
565                        &framebuffersPackedParam.value);
566         CaptureDeleteFramebuffers_framebuffersPacked(glState, isCallValid, n, framebuffersPacked,
567                                                      &framebuffersPackedParam);
568         paramBuffer.addParam(std::move(framebuffersPackedParam));
569     }
570     else
571     {
572         ParamCapture framebuffersPackedParam("framebuffersPacked",
573                                              ParamType::TFramebufferIDConstPointer);
574         InitParamValue(ParamType::TFramebufferIDConstPointer,
575                        static_cast<const FramebufferID *>(nullptr), &framebuffersPackedParam.value);
576         paramBuffer.addParam(std::move(framebuffersPackedParam));
577     }
578 
579     return CallCapture(angle::EntryPoint::GLDeleteFramebuffers, std::move(paramBuffer));
580 }
581 
CaptureDeleteProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)582 CallCapture CaptureDeleteProgram(const State &glState,
583                                  bool isCallValid,
584                                  ShaderProgramID programPacked)
585 {
586     ParamBuffer paramBuffer;
587 
588     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
589 
590     return CallCapture(angle::EntryPoint::GLDeleteProgram, std::move(paramBuffer));
591 }
592 
CaptureDeleteRenderbuffers(const State & glState,bool isCallValid,GLsizei n,const RenderbufferID * renderbuffersPacked)593 CallCapture CaptureDeleteRenderbuffers(const State &glState,
594                                        bool isCallValid,
595                                        GLsizei n,
596                                        const RenderbufferID *renderbuffersPacked)
597 {
598     ParamBuffer paramBuffer;
599 
600     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
601 
602     if (isCallValid)
603     {
604         ParamCapture renderbuffersPackedParam("renderbuffersPacked",
605                                               ParamType::TRenderbufferIDConstPointer);
606         InitParamValue(ParamType::TRenderbufferIDConstPointer, renderbuffersPacked,
607                        &renderbuffersPackedParam.value);
608         CaptureDeleteRenderbuffers_renderbuffersPacked(glState, isCallValid, n, renderbuffersPacked,
609                                                        &renderbuffersPackedParam);
610         paramBuffer.addParam(std::move(renderbuffersPackedParam));
611     }
612     else
613     {
614         ParamCapture renderbuffersPackedParam("renderbuffersPacked",
615                                               ParamType::TRenderbufferIDConstPointer);
616         InitParamValue(ParamType::TRenderbufferIDConstPointer,
617                        static_cast<const RenderbufferID *>(nullptr),
618                        &renderbuffersPackedParam.value);
619         paramBuffer.addParam(std::move(renderbuffersPackedParam));
620     }
621 
622     return CallCapture(angle::EntryPoint::GLDeleteRenderbuffers, std::move(paramBuffer));
623 }
624 
CaptureDeleteShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked)625 CallCapture CaptureDeleteShader(const State &glState,
626                                 bool isCallValid,
627                                 ShaderProgramID shaderPacked)
628 {
629     ParamBuffer paramBuffer;
630 
631     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
632 
633     return CallCapture(angle::EntryPoint::GLDeleteShader, std::move(paramBuffer));
634 }
635 
CaptureDeleteTextures(const State & glState,bool isCallValid,GLsizei n,const TextureID * texturesPacked)636 CallCapture CaptureDeleteTextures(const State &glState,
637                                   bool isCallValid,
638                                   GLsizei n,
639                                   const TextureID *texturesPacked)
640 {
641     ParamBuffer paramBuffer;
642 
643     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
644 
645     if (isCallValid)
646     {
647         ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDConstPointer);
648         InitParamValue(ParamType::TTextureIDConstPointer, texturesPacked,
649                        &texturesPackedParam.value);
650         CaptureDeleteTextures_texturesPacked(glState, isCallValid, n, texturesPacked,
651                                              &texturesPackedParam);
652         paramBuffer.addParam(std::move(texturesPackedParam));
653     }
654     else
655     {
656         ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDConstPointer);
657         InitParamValue(ParamType::TTextureIDConstPointer, static_cast<const TextureID *>(nullptr),
658                        &texturesPackedParam.value);
659         paramBuffer.addParam(std::move(texturesPackedParam));
660     }
661 
662     return CallCapture(angle::EntryPoint::GLDeleteTextures, std::move(paramBuffer));
663 }
664 
CaptureDepthFunc(const State & glState,bool isCallValid,GLenum func)665 CallCapture CaptureDepthFunc(const State &glState, bool isCallValid, GLenum func)
666 {
667     ParamBuffer paramBuffer;
668 
669     paramBuffer.addEnumParam("func", GLenumGroup::DepthFunction, ParamType::TGLenum, func);
670 
671     return CallCapture(angle::EntryPoint::GLDepthFunc, std::move(paramBuffer));
672 }
673 
CaptureDepthMask(const State & glState,bool isCallValid,GLboolean flag)674 CallCapture CaptureDepthMask(const State &glState, bool isCallValid, GLboolean flag)
675 {
676     ParamBuffer paramBuffer;
677 
678     paramBuffer.addValueParam("flag", ParamType::TGLboolean, flag);
679 
680     return CallCapture(angle::EntryPoint::GLDepthMask, std::move(paramBuffer));
681 }
682 
CaptureDepthRangef(const State & glState,bool isCallValid,GLfloat n,GLfloat f)683 CallCapture CaptureDepthRangef(const State &glState, bool isCallValid, GLfloat n, GLfloat f)
684 {
685     ParamBuffer paramBuffer;
686 
687     paramBuffer.addValueParam("n", ParamType::TGLfloat, n);
688     paramBuffer.addValueParam("f", ParamType::TGLfloat, f);
689 
690     return CallCapture(angle::EntryPoint::GLDepthRangef, std::move(paramBuffer));
691 }
692 
CaptureDetachShader(const State & glState,bool isCallValid,ShaderProgramID programPacked,ShaderProgramID shaderPacked)693 CallCapture CaptureDetachShader(const State &glState,
694                                 bool isCallValid,
695                                 ShaderProgramID programPacked,
696                                 ShaderProgramID shaderPacked)
697 {
698     ParamBuffer paramBuffer;
699 
700     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
701     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
702 
703     return CallCapture(angle::EntryPoint::GLDetachShader, std::move(paramBuffer));
704 }
705 
CaptureDisable(const State & glState,bool isCallValid,GLenum cap)706 CallCapture CaptureDisable(const State &glState, bool isCallValid, GLenum cap)
707 {
708     ParamBuffer paramBuffer;
709 
710     paramBuffer.addEnumParam("cap", GLenumGroup::EnableCap, ParamType::TGLenum, cap);
711 
712     return CallCapture(angle::EntryPoint::GLDisable, std::move(paramBuffer));
713 }
714 
CaptureDisableVertexAttribArray(const State & glState,bool isCallValid,GLuint index)715 CallCapture CaptureDisableVertexAttribArray(const State &glState, bool isCallValid, GLuint index)
716 {
717     ParamBuffer paramBuffer;
718 
719     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
720 
721     return CallCapture(angle::EntryPoint::GLDisableVertexAttribArray, std::move(paramBuffer));
722 }
723 
CaptureDrawArrays(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLint first,GLsizei count)724 CallCapture CaptureDrawArrays(const State &glState,
725                               bool isCallValid,
726                               PrimitiveMode modePacked,
727                               GLint first,
728                               GLsizei count)
729 {
730     ParamBuffer paramBuffer;
731 
732     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
733     paramBuffer.addValueParam("first", ParamType::TGLint, first);
734     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
735 
736     return CallCapture(angle::EntryPoint::GLDrawArrays, std::move(paramBuffer));
737 }
738 
CaptureDrawElements(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLsizei count,DrawElementsType typePacked,const void * indices)739 CallCapture CaptureDrawElements(const State &glState,
740                                 bool isCallValid,
741                                 PrimitiveMode modePacked,
742                                 GLsizei count,
743                                 DrawElementsType typePacked,
744                                 const void *indices)
745 {
746     ParamBuffer paramBuffer;
747 
748     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
749     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
750     paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);
751 
752     if (isCallValid)
753     {
754         ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
755         InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
756         CaptureDrawElements_indices(glState, isCallValid, modePacked, count, typePacked, indices,
757                                     &indicesParam);
758         paramBuffer.addParam(std::move(indicesParam));
759     }
760     else
761     {
762         ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
763         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
764                        &indicesParam.value);
765         paramBuffer.addParam(std::move(indicesParam));
766     }
767 
768     return CallCapture(angle::EntryPoint::GLDrawElements, std::move(paramBuffer));
769 }
770 
CaptureEnable(const State & glState,bool isCallValid,GLenum cap)771 CallCapture CaptureEnable(const State &glState, bool isCallValid, GLenum cap)
772 {
773     ParamBuffer paramBuffer;
774 
775     paramBuffer.addEnumParam("cap", GLenumGroup::EnableCap, ParamType::TGLenum, cap);
776 
777     return CallCapture(angle::EntryPoint::GLEnable, std::move(paramBuffer));
778 }
779 
CaptureEnableVertexAttribArray(const State & glState,bool isCallValid,GLuint index)780 CallCapture CaptureEnableVertexAttribArray(const State &glState, bool isCallValid, GLuint index)
781 {
782     ParamBuffer paramBuffer;
783 
784     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
785 
786     return CallCapture(angle::EntryPoint::GLEnableVertexAttribArray, std::move(paramBuffer));
787 }
788 
CaptureFinish(const State & glState,bool isCallValid)789 CallCapture CaptureFinish(const State &glState, bool isCallValid)
790 {
791     ParamBuffer paramBuffer;
792 
793     return CallCapture(angle::EntryPoint::GLFinish, std::move(paramBuffer));
794 }
795 
CaptureFlush(const State & glState,bool isCallValid)796 CallCapture CaptureFlush(const State &glState, bool isCallValid)
797 {
798     ParamBuffer paramBuffer;
799 
800     return CallCapture(angle::EntryPoint::GLFlush, std::move(paramBuffer));
801 }
802 
CaptureFramebufferRenderbuffer(const State & glState,bool isCallValid,GLenum target,GLenum attachment,GLenum renderbuffertarget,RenderbufferID renderbufferPacked)803 CallCapture CaptureFramebufferRenderbuffer(const State &glState,
804                                            bool isCallValid,
805                                            GLenum target,
806                                            GLenum attachment,
807                                            GLenum renderbuffertarget,
808                                            RenderbufferID renderbufferPacked)
809 {
810     ParamBuffer paramBuffer;
811 
812     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
813     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
814                              attachment);
815     paramBuffer.addEnumParam("renderbuffertarget", GLenumGroup::RenderbufferTarget,
816                              ParamType::TGLenum, renderbuffertarget);
817     paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
818 
819     return CallCapture(angle::EntryPoint::GLFramebufferRenderbuffer, std::move(paramBuffer));
820 }
821 
CaptureFramebufferTexture2D(const State & glState,bool isCallValid,GLenum target,GLenum attachment,TextureTarget textargetPacked,TextureID texturePacked,GLint level)822 CallCapture CaptureFramebufferTexture2D(const State &glState,
823                                         bool isCallValid,
824                                         GLenum target,
825                                         GLenum attachment,
826                                         TextureTarget textargetPacked,
827                                         TextureID texturePacked,
828                                         GLint level)
829 {
830     ParamBuffer paramBuffer;
831 
832     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
833     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
834                              attachment);
835     paramBuffer.addValueParam("textargetPacked", ParamType::TTextureTarget, textargetPacked);
836     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
837     paramBuffer.addValueParam("level", ParamType::TGLint, level);
838 
839     return CallCapture(angle::EntryPoint::GLFramebufferTexture2D, std::move(paramBuffer));
840 }
841 
CaptureFrontFace(const State & glState,bool isCallValid,GLenum mode)842 CallCapture CaptureFrontFace(const State &glState, bool isCallValid, GLenum mode)
843 {
844     ParamBuffer paramBuffer;
845 
846     paramBuffer.addEnumParam("mode", GLenumGroup::FrontFaceDirection, ParamType::TGLenum, mode);
847 
848     return CallCapture(angle::EntryPoint::GLFrontFace, std::move(paramBuffer));
849 }
850 
CaptureGenBuffers(const State & glState,bool isCallValid,GLsizei n,BufferID * buffersPacked)851 CallCapture CaptureGenBuffers(const State &glState,
852                               bool isCallValid,
853                               GLsizei n,
854                               BufferID *buffersPacked)
855 {
856     ParamBuffer paramBuffer;
857 
858     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
859 
860     if (isCallValid)
861     {
862         ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDPointer);
863         InitParamValue(ParamType::TBufferIDPointer, buffersPacked, &buffersPackedParam.value);
864         CaptureGenBuffers_buffersPacked(glState, isCallValid, n, buffersPacked,
865                                         &buffersPackedParam);
866         paramBuffer.addParam(std::move(buffersPackedParam));
867     }
868     else
869     {
870         ParamCapture buffersPackedParam("buffersPacked", ParamType::TBufferIDPointer);
871         InitParamValue(ParamType::TBufferIDPointer, static_cast<BufferID *>(nullptr),
872                        &buffersPackedParam.value);
873         paramBuffer.addParam(std::move(buffersPackedParam));
874     }
875 
876     return CallCapture(angle::EntryPoint::GLGenBuffers, std::move(paramBuffer));
877 }
878 
CaptureGenFramebuffers(const State & glState,bool isCallValid,GLsizei n,FramebufferID * framebuffersPacked)879 CallCapture CaptureGenFramebuffers(const State &glState,
880                                    bool isCallValid,
881                                    GLsizei n,
882                                    FramebufferID *framebuffersPacked)
883 {
884     ParamBuffer paramBuffer;
885 
886     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
887 
888     if (isCallValid)
889     {
890         ParamCapture framebuffersPackedParam("framebuffersPacked",
891                                              ParamType::TFramebufferIDPointer);
892         InitParamValue(ParamType::TFramebufferIDPointer, framebuffersPacked,
893                        &framebuffersPackedParam.value);
894         CaptureGenFramebuffers_framebuffersPacked(glState, isCallValid, n, framebuffersPacked,
895                                                   &framebuffersPackedParam);
896         paramBuffer.addParam(std::move(framebuffersPackedParam));
897     }
898     else
899     {
900         ParamCapture framebuffersPackedParam("framebuffersPacked",
901                                              ParamType::TFramebufferIDPointer);
902         InitParamValue(ParamType::TFramebufferIDPointer, static_cast<FramebufferID *>(nullptr),
903                        &framebuffersPackedParam.value);
904         paramBuffer.addParam(std::move(framebuffersPackedParam));
905     }
906 
907     return CallCapture(angle::EntryPoint::GLGenFramebuffers, std::move(paramBuffer));
908 }
909 
CaptureGenRenderbuffers(const State & glState,bool isCallValid,GLsizei n,RenderbufferID * renderbuffersPacked)910 CallCapture CaptureGenRenderbuffers(const State &glState,
911                                     bool isCallValid,
912                                     GLsizei n,
913                                     RenderbufferID *renderbuffersPacked)
914 {
915     ParamBuffer paramBuffer;
916 
917     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
918 
919     if (isCallValid)
920     {
921         ParamCapture renderbuffersPackedParam("renderbuffersPacked",
922                                               ParamType::TRenderbufferIDPointer);
923         InitParamValue(ParamType::TRenderbufferIDPointer, renderbuffersPacked,
924                        &renderbuffersPackedParam.value);
925         CaptureGenRenderbuffers_renderbuffersPacked(glState, isCallValid, n, renderbuffersPacked,
926                                                     &renderbuffersPackedParam);
927         paramBuffer.addParam(std::move(renderbuffersPackedParam));
928     }
929     else
930     {
931         ParamCapture renderbuffersPackedParam("renderbuffersPacked",
932                                               ParamType::TRenderbufferIDPointer);
933         InitParamValue(ParamType::TRenderbufferIDPointer, static_cast<RenderbufferID *>(nullptr),
934                        &renderbuffersPackedParam.value);
935         paramBuffer.addParam(std::move(renderbuffersPackedParam));
936     }
937 
938     return CallCapture(angle::EntryPoint::GLGenRenderbuffers, std::move(paramBuffer));
939 }
940 
CaptureGenTextures(const State & glState,bool isCallValid,GLsizei n,TextureID * texturesPacked)941 CallCapture CaptureGenTextures(const State &glState,
942                                bool isCallValid,
943                                GLsizei n,
944                                TextureID *texturesPacked)
945 {
946     ParamBuffer paramBuffer;
947 
948     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
949 
950     if (isCallValid)
951     {
952         ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDPointer);
953         InitParamValue(ParamType::TTextureIDPointer, texturesPacked, &texturesPackedParam.value);
954         CaptureGenTextures_texturesPacked(glState, isCallValid, n, texturesPacked,
955                                           &texturesPackedParam);
956         paramBuffer.addParam(std::move(texturesPackedParam));
957     }
958     else
959     {
960         ParamCapture texturesPackedParam("texturesPacked", ParamType::TTextureIDPointer);
961         InitParamValue(ParamType::TTextureIDPointer, static_cast<TextureID *>(nullptr),
962                        &texturesPackedParam.value);
963         paramBuffer.addParam(std::move(texturesPackedParam));
964     }
965 
966     return CallCapture(angle::EntryPoint::GLGenTextures, std::move(paramBuffer));
967 }
968 
CaptureGenerateMipmap(const State & glState,bool isCallValid,TextureType targetPacked)969 CallCapture CaptureGenerateMipmap(const State &glState, bool isCallValid, TextureType targetPacked)
970 {
971     ParamBuffer paramBuffer;
972 
973     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
974 
975     return CallCapture(angle::EntryPoint::GLGenerateMipmap, std::move(paramBuffer));
976 }
977 
CaptureGetActiveAttrib(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)978 CallCapture CaptureGetActiveAttrib(const State &glState,
979                                    bool isCallValid,
980                                    ShaderProgramID programPacked,
981                                    GLuint index,
982                                    GLsizei bufSize,
983                                    GLsizei *length,
984                                    GLint *size,
985                                    GLenum *type,
986                                    GLchar *name)
987 {
988     ParamBuffer paramBuffer;
989 
990     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
991     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
992     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
993 
994     if (isCallValid)
995     {
996         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
997         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
998         CaptureGetActiveAttrib_length(glState, isCallValid, programPacked, index, bufSize, length,
999                                       size, type, name, &lengthParam);
1000         paramBuffer.addParam(std::move(lengthParam));
1001     }
1002     else
1003     {
1004         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1005         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1006                        &lengthParam.value);
1007         paramBuffer.addParam(std::move(lengthParam));
1008     }
1009 
1010     if (isCallValid)
1011     {
1012         ParamCapture sizeParam("size", ParamType::TGLintPointer);
1013         InitParamValue(ParamType::TGLintPointer, size, &sizeParam.value);
1014         CaptureGetActiveAttrib_size(glState, isCallValid, programPacked, index, bufSize, length,
1015                                     size, type, name, &sizeParam);
1016         paramBuffer.addParam(std::move(sizeParam));
1017     }
1018     else
1019     {
1020         ParamCapture sizeParam("size", ParamType::TGLintPointer);
1021         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &sizeParam.value);
1022         paramBuffer.addParam(std::move(sizeParam));
1023     }
1024 
1025     if (isCallValid)
1026     {
1027         ParamCapture typeParam("type", ParamType::TGLenumPointer);
1028         InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
1029         CaptureGetActiveAttrib_type(glState, isCallValid, programPacked, index, bufSize, length,
1030                                     size, type, name, &typeParam);
1031         paramBuffer.addParam(std::move(typeParam));
1032     }
1033     else
1034     {
1035         ParamCapture typeParam("type", ParamType::TGLenumPointer);
1036         InitParamValue(ParamType::TGLenumPointer, static_cast<GLenum *>(nullptr), &typeParam.value);
1037         paramBuffer.addParam(std::move(typeParam));
1038     }
1039 
1040     if (isCallValid)
1041     {
1042         ParamCapture nameParam("name", ParamType::TGLcharPointer);
1043         InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
1044         CaptureGetActiveAttrib_name(glState, isCallValid, programPacked, index, bufSize, length,
1045                                     size, type, name, &nameParam);
1046         paramBuffer.addParam(std::move(nameParam));
1047     }
1048     else
1049     {
1050         ParamCapture nameParam("name", ParamType::TGLcharPointer);
1051         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr), &nameParam.value);
1052         paramBuffer.addParam(std::move(nameParam));
1053     }
1054 
1055     return CallCapture(angle::EntryPoint::GLGetActiveAttrib, std::move(paramBuffer));
1056 }
1057 
CaptureGetActiveUniform(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)1058 CallCapture CaptureGetActiveUniform(const State &glState,
1059                                     bool isCallValid,
1060                                     ShaderProgramID programPacked,
1061                                     GLuint index,
1062                                     GLsizei bufSize,
1063                                     GLsizei *length,
1064                                     GLint *size,
1065                                     GLenum *type,
1066                                     GLchar *name)
1067 {
1068     ParamBuffer paramBuffer;
1069 
1070     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1071     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1072     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1073 
1074     if (isCallValid)
1075     {
1076         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1077         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1078         CaptureGetActiveUniform_length(glState, isCallValid, programPacked, index, bufSize, length,
1079                                        size, type, name, &lengthParam);
1080         paramBuffer.addParam(std::move(lengthParam));
1081     }
1082     else
1083     {
1084         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1085         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1086                        &lengthParam.value);
1087         paramBuffer.addParam(std::move(lengthParam));
1088     }
1089 
1090     if (isCallValid)
1091     {
1092         ParamCapture sizeParam("size", ParamType::TGLintPointer);
1093         InitParamValue(ParamType::TGLintPointer, size, &sizeParam.value);
1094         CaptureGetActiveUniform_size(glState, isCallValid, programPacked, index, bufSize, length,
1095                                      size, type, name, &sizeParam);
1096         paramBuffer.addParam(std::move(sizeParam));
1097     }
1098     else
1099     {
1100         ParamCapture sizeParam("size", ParamType::TGLintPointer);
1101         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &sizeParam.value);
1102         paramBuffer.addParam(std::move(sizeParam));
1103     }
1104 
1105     if (isCallValid)
1106     {
1107         ParamCapture typeParam("type", ParamType::TGLenumPointer);
1108         InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
1109         CaptureGetActiveUniform_type(glState, isCallValid, programPacked, index, bufSize, length,
1110                                      size, type, name, &typeParam);
1111         paramBuffer.addParam(std::move(typeParam));
1112     }
1113     else
1114     {
1115         ParamCapture typeParam("type", ParamType::TGLenumPointer);
1116         InitParamValue(ParamType::TGLenumPointer, static_cast<GLenum *>(nullptr), &typeParam.value);
1117         paramBuffer.addParam(std::move(typeParam));
1118     }
1119 
1120     if (isCallValid)
1121     {
1122         ParamCapture nameParam("name", ParamType::TGLcharPointer);
1123         InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
1124         CaptureGetActiveUniform_name(glState, isCallValid, programPacked, index, bufSize, length,
1125                                      size, type, name, &nameParam);
1126         paramBuffer.addParam(std::move(nameParam));
1127     }
1128     else
1129     {
1130         ParamCapture nameParam("name", ParamType::TGLcharPointer);
1131         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr), &nameParam.value);
1132         paramBuffer.addParam(std::move(nameParam));
1133     }
1134 
1135     return CallCapture(angle::EntryPoint::GLGetActiveUniform, std::move(paramBuffer));
1136 }
1137 
CaptureGetAttachedShaders(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei maxCount,GLsizei * count,ShaderProgramID * shadersPacked)1138 CallCapture CaptureGetAttachedShaders(const State &glState,
1139                                       bool isCallValid,
1140                                       ShaderProgramID programPacked,
1141                                       GLsizei maxCount,
1142                                       GLsizei *count,
1143                                       ShaderProgramID *shadersPacked)
1144 {
1145     ParamBuffer paramBuffer;
1146 
1147     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1148     paramBuffer.addValueParam("maxCount", ParamType::TGLsizei, maxCount);
1149 
1150     if (isCallValid)
1151     {
1152         ParamCapture countParam("count", ParamType::TGLsizeiPointer);
1153         InitParamValue(ParamType::TGLsizeiPointer, count, &countParam.value);
1154         CaptureGetAttachedShaders_count(glState, isCallValid, programPacked, maxCount, count,
1155                                         shadersPacked, &countParam);
1156         paramBuffer.addParam(std::move(countParam));
1157     }
1158     else
1159     {
1160         ParamCapture countParam("count", ParamType::TGLsizeiPointer);
1161         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1162                        &countParam.value);
1163         paramBuffer.addParam(std::move(countParam));
1164     }
1165 
1166     if (isCallValid)
1167     {
1168         ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDPointer);
1169         InitParamValue(ParamType::TShaderProgramIDPointer, shadersPacked,
1170                        &shadersPackedParam.value);
1171         CaptureGetAttachedShaders_shadersPacked(glState, isCallValid, programPacked, maxCount,
1172                                                 count, shadersPacked, &shadersPackedParam);
1173         paramBuffer.addParam(std::move(shadersPackedParam));
1174     }
1175     else
1176     {
1177         ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDPointer);
1178         InitParamValue(ParamType::TShaderProgramIDPointer, static_cast<ShaderProgramID *>(nullptr),
1179                        &shadersPackedParam.value);
1180         paramBuffer.addParam(std::move(shadersPackedParam));
1181     }
1182 
1183     return CallCapture(angle::EntryPoint::GLGetAttachedShaders, std::move(paramBuffer));
1184 }
1185 
CaptureGetAttribLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)1186 CallCapture CaptureGetAttribLocation(const State &glState,
1187                                      bool isCallValid,
1188                                      ShaderProgramID programPacked,
1189                                      const GLchar *name,
1190                                      GLint returnValue)
1191 {
1192     ParamBuffer paramBuffer;
1193 
1194     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1195 
1196     if (isCallValid)
1197     {
1198         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1199         InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
1200         CaptureGetAttribLocation_name(glState, isCallValid, programPacked, name, &nameParam);
1201         paramBuffer.addParam(std::move(nameParam));
1202     }
1203     else
1204     {
1205         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1206         InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
1207                        &nameParam.value);
1208         paramBuffer.addParam(std::move(nameParam));
1209     }
1210 
1211     ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
1212     InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
1213     paramBuffer.addReturnValue(std::move(returnValueCapture));
1214 
1215     return CallCapture(angle::EntryPoint::GLGetAttribLocation, std::move(paramBuffer));
1216 }
1217 
CaptureGetBooleanv(const State & glState,bool isCallValid,GLenum pname,GLboolean * data)1218 CallCapture CaptureGetBooleanv(const State &glState,
1219                                bool isCallValid,
1220                                GLenum pname,
1221                                GLboolean *data)
1222 {
1223     ParamBuffer paramBuffer;
1224 
1225     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
1226 
1227     if (isCallValid)
1228     {
1229         ParamCapture dataParam("data", ParamType::TGLbooleanPointer);
1230         InitParamValue(ParamType::TGLbooleanPointer, data, &dataParam.value);
1231         CaptureGetBooleanv_data(glState, isCallValid, pname, data, &dataParam);
1232         paramBuffer.addParam(std::move(dataParam));
1233     }
1234     else
1235     {
1236         ParamCapture dataParam("data", ParamType::TGLbooleanPointer);
1237         InitParamValue(ParamType::TGLbooleanPointer, static_cast<GLboolean *>(nullptr),
1238                        &dataParam.value);
1239         paramBuffer.addParam(std::move(dataParam));
1240     }
1241 
1242     return CallCapture(angle::EntryPoint::GLGetBooleanv, std::move(paramBuffer));
1243 }
1244 
CaptureGetBufferParameteriv(const State & glState,bool isCallValid,BufferBinding targetPacked,GLenum pname,GLint * params)1245 CallCapture CaptureGetBufferParameteriv(const State &glState,
1246                                         bool isCallValid,
1247                                         BufferBinding targetPacked,
1248                                         GLenum pname,
1249                                         GLint *params)
1250 {
1251     ParamBuffer paramBuffer;
1252 
1253     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
1254     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1255 
1256     if (isCallValid)
1257     {
1258         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1259         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1260         CaptureGetBufferParameteriv_params(glState, isCallValid, targetPacked, pname, params,
1261                                            &paramsParam);
1262         paramBuffer.addParam(std::move(paramsParam));
1263     }
1264     else
1265     {
1266         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1267         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1268         paramBuffer.addParam(std::move(paramsParam));
1269     }
1270 
1271     return CallCapture(angle::EntryPoint::GLGetBufferParameteriv, std::move(paramBuffer));
1272 }
1273 
CaptureGetError(const State & glState,bool isCallValid,GLenum returnValue)1274 CallCapture CaptureGetError(const State &glState, bool isCallValid, GLenum returnValue)
1275 {
1276     ParamBuffer paramBuffer;
1277 
1278     ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
1279     InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
1280     paramBuffer.addReturnValue(std::move(returnValueCapture));
1281 
1282     return CallCapture(angle::EntryPoint::GLGetError, std::move(paramBuffer));
1283 }
1284 
CaptureGetFloatv(const State & glState,bool isCallValid,GLenum pname,GLfloat * data)1285 CallCapture CaptureGetFloatv(const State &glState, bool isCallValid, GLenum pname, GLfloat *data)
1286 {
1287     ParamBuffer paramBuffer;
1288 
1289     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
1290 
1291     if (isCallValid)
1292     {
1293         ParamCapture dataParam("data", ParamType::TGLfloatPointer);
1294         InitParamValue(ParamType::TGLfloatPointer, data, &dataParam.value);
1295         CaptureGetFloatv_data(glState, isCallValid, pname, data, &dataParam);
1296         paramBuffer.addParam(std::move(dataParam));
1297     }
1298     else
1299     {
1300         ParamCapture dataParam("data", ParamType::TGLfloatPointer);
1301         InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1302                        &dataParam.value);
1303         paramBuffer.addParam(std::move(dataParam));
1304     }
1305 
1306     return CallCapture(angle::EntryPoint::GLGetFloatv, std::move(paramBuffer));
1307 }
1308 
CaptureGetFramebufferAttachmentParameteriv(const State & glState,bool isCallValid,GLenum target,GLenum attachment,GLenum pname,GLint * params)1309 CallCapture CaptureGetFramebufferAttachmentParameteriv(const State &glState,
1310                                                        bool isCallValid,
1311                                                        GLenum target,
1312                                                        GLenum attachment,
1313                                                        GLenum pname,
1314                                                        GLint *params)
1315 {
1316     ParamBuffer paramBuffer;
1317 
1318     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
1319     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
1320                              attachment);
1321     paramBuffer.addEnumParam("pname", GLenumGroup::FramebufferAttachmentParameterName,
1322                              ParamType::TGLenum, pname);
1323 
1324     if (isCallValid)
1325     {
1326         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1327         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1328         CaptureGetFramebufferAttachmentParameteriv_params(glState, isCallValid, target, attachment,
1329                                                           pname, params, &paramsParam);
1330         paramBuffer.addParam(std::move(paramsParam));
1331     }
1332     else
1333     {
1334         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1335         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1336         paramBuffer.addParam(std::move(paramsParam));
1337     }
1338 
1339     return CallCapture(angle::EntryPoint::GLGetFramebufferAttachmentParameteriv,
1340                        std::move(paramBuffer));
1341 }
1342 
CaptureGetIntegerv(const State & glState,bool isCallValid,GLenum pname,GLint * data)1343 CallCapture CaptureGetIntegerv(const State &glState, bool isCallValid, GLenum pname, GLint *data)
1344 {
1345     ParamBuffer paramBuffer;
1346 
1347     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
1348 
1349     if (isCallValid)
1350     {
1351         ParamCapture dataParam("data", ParamType::TGLintPointer);
1352         InitParamValue(ParamType::TGLintPointer, data, &dataParam.value);
1353         CaptureGetIntegerv_data(glState, isCallValid, pname, data, &dataParam);
1354         paramBuffer.addParam(std::move(dataParam));
1355     }
1356     else
1357     {
1358         ParamCapture dataParam("data", ParamType::TGLintPointer);
1359         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &dataParam.value);
1360         paramBuffer.addParam(std::move(dataParam));
1361     }
1362 
1363     return CallCapture(angle::EntryPoint::GLGetIntegerv, std::move(paramBuffer));
1364 }
1365 
CaptureGetProgramInfoLog(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1366 CallCapture CaptureGetProgramInfoLog(const State &glState,
1367                                      bool isCallValid,
1368                                      ShaderProgramID programPacked,
1369                                      GLsizei bufSize,
1370                                      GLsizei *length,
1371                                      GLchar *infoLog)
1372 {
1373     ParamBuffer paramBuffer;
1374 
1375     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1376     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1377 
1378     if (isCallValid)
1379     {
1380         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1381         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1382         CaptureGetProgramInfoLog_length(glState, isCallValid, programPacked, bufSize, length,
1383                                         infoLog, &lengthParam);
1384         paramBuffer.addParam(std::move(lengthParam));
1385     }
1386     else
1387     {
1388         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1389         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1390                        &lengthParam.value);
1391         paramBuffer.addParam(std::move(lengthParam));
1392     }
1393 
1394     if (isCallValid)
1395     {
1396         ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1397         InitParamValue(ParamType::TGLcharPointer, infoLog, &infoLogParam.value);
1398         CaptureGetProgramInfoLog_infoLog(glState, isCallValid, programPacked, bufSize, length,
1399                                          infoLog, &infoLogParam);
1400         paramBuffer.addParam(std::move(infoLogParam));
1401     }
1402     else
1403     {
1404         ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1405         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
1406                        &infoLogParam.value);
1407         paramBuffer.addParam(std::move(infoLogParam));
1408     }
1409 
1410     return CallCapture(angle::EntryPoint::GLGetProgramInfoLog, std::move(paramBuffer));
1411 }
1412 
CaptureGetProgramiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLenum pname,GLint * params)1413 CallCapture CaptureGetProgramiv(const State &glState,
1414                                 bool isCallValid,
1415                                 ShaderProgramID programPacked,
1416                                 GLenum pname,
1417                                 GLint *params)
1418 {
1419     ParamBuffer paramBuffer;
1420 
1421     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1422     paramBuffer.addEnumParam("pname", GLenumGroup::ProgramPropertyARB, ParamType::TGLenum, pname);
1423 
1424     if (isCallValid)
1425     {
1426         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1427         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1428         CaptureGetProgramiv_params(glState, isCallValid, programPacked, pname, params,
1429                                    &paramsParam);
1430         paramBuffer.addParam(std::move(paramsParam));
1431     }
1432     else
1433     {
1434         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1435         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1436         paramBuffer.addParam(std::move(paramsParam));
1437     }
1438 
1439     return CallCapture(angle::EntryPoint::GLGetProgramiv, std::move(paramBuffer));
1440 }
1441 
CaptureGetRenderbufferParameteriv(const State & glState,bool isCallValid,GLenum target,GLenum pname,GLint * params)1442 CallCapture CaptureGetRenderbufferParameteriv(const State &glState,
1443                                               bool isCallValid,
1444                                               GLenum target,
1445                                               GLenum pname,
1446                                               GLint *params)
1447 {
1448     ParamBuffer paramBuffer;
1449 
1450     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
1451     paramBuffer.addEnumParam("pname", GLenumGroup::RenderbufferParameterName, ParamType::TGLenum,
1452                              pname);
1453 
1454     if (isCallValid)
1455     {
1456         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1457         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1458         CaptureGetRenderbufferParameteriv_params(glState, isCallValid, target, pname, params,
1459                                                  &paramsParam);
1460         paramBuffer.addParam(std::move(paramsParam));
1461     }
1462     else
1463     {
1464         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1465         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1466         paramBuffer.addParam(std::move(paramsParam));
1467     }
1468 
1469     return CallCapture(angle::EntryPoint::GLGetRenderbufferParameteriv, std::move(paramBuffer));
1470 }
1471 
CaptureGetShaderInfoLog(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei bufSize,GLsizei * length,GLchar * infoLog)1472 CallCapture CaptureGetShaderInfoLog(const State &glState,
1473                                     bool isCallValid,
1474                                     ShaderProgramID shaderPacked,
1475                                     GLsizei bufSize,
1476                                     GLsizei *length,
1477                                     GLchar *infoLog)
1478 {
1479     ParamBuffer paramBuffer;
1480 
1481     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1482     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1483 
1484     if (isCallValid)
1485     {
1486         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1487         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1488         CaptureGetShaderInfoLog_length(glState, isCallValid, shaderPacked, bufSize, length, infoLog,
1489                                        &lengthParam);
1490         paramBuffer.addParam(std::move(lengthParam));
1491     }
1492     else
1493     {
1494         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1495         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1496                        &lengthParam.value);
1497         paramBuffer.addParam(std::move(lengthParam));
1498     }
1499 
1500     if (isCallValid)
1501     {
1502         ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1503         InitParamValue(ParamType::TGLcharPointer, infoLog, &infoLogParam.value);
1504         CaptureGetShaderInfoLog_infoLog(glState, isCallValid, shaderPacked, bufSize, length,
1505                                         infoLog, &infoLogParam);
1506         paramBuffer.addParam(std::move(infoLogParam));
1507     }
1508     else
1509     {
1510         ParamCapture infoLogParam("infoLog", ParamType::TGLcharPointer);
1511         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
1512                        &infoLogParam.value);
1513         paramBuffer.addParam(std::move(infoLogParam));
1514     }
1515 
1516     return CallCapture(angle::EntryPoint::GLGetShaderInfoLog, std::move(paramBuffer));
1517 }
1518 
CaptureGetShaderPrecisionFormat(const State & glState,bool isCallValid,GLenum shadertype,GLenum precisiontype,GLint * range,GLint * precision)1519 CallCapture CaptureGetShaderPrecisionFormat(const State &glState,
1520                                             bool isCallValid,
1521                                             GLenum shadertype,
1522                                             GLenum precisiontype,
1523                                             GLint *range,
1524                                             GLint *precision)
1525 {
1526     ParamBuffer paramBuffer;
1527 
1528     paramBuffer.addEnumParam("shadertype", GLenumGroup::ShaderType, ParamType::TGLenum, shadertype);
1529     paramBuffer.addEnumParam("precisiontype", GLenumGroup::PrecisionType, ParamType::TGLenum,
1530                              precisiontype);
1531 
1532     if (isCallValid)
1533     {
1534         ParamCapture rangeParam("range", ParamType::TGLintPointer);
1535         InitParamValue(ParamType::TGLintPointer, range, &rangeParam.value);
1536         CaptureGetShaderPrecisionFormat_range(glState, isCallValid, shadertype, precisiontype,
1537                                               range, precision, &rangeParam);
1538         paramBuffer.addParam(std::move(rangeParam));
1539     }
1540     else
1541     {
1542         ParamCapture rangeParam("range", ParamType::TGLintPointer);
1543         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &rangeParam.value);
1544         paramBuffer.addParam(std::move(rangeParam));
1545     }
1546 
1547     if (isCallValid)
1548     {
1549         ParamCapture precisionParam("precision", ParamType::TGLintPointer);
1550         InitParamValue(ParamType::TGLintPointer, precision, &precisionParam.value);
1551         CaptureGetShaderPrecisionFormat_precision(glState, isCallValid, shadertype, precisiontype,
1552                                                   range, precision, &precisionParam);
1553         paramBuffer.addParam(std::move(precisionParam));
1554     }
1555     else
1556     {
1557         ParamCapture precisionParam("precision", ParamType::TGLintPointer);
1558         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr),
1559                        &precisionParam.value);
1560         paramBuffer.addParam(std::move(precisionParam));
1561     }
1562 
1563     return CallCapture(angle::EntryPoint::GLGetShaderPrecisionFormat, std::move(paramBuffer));
1564 }
1565 
CaptureGetShaderSource(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei bufSize,GLsizei * length,GLchar * source)1566 CallCapture CaptureGetShaderSource(const State &glState,
1567                                    bool isCallValid,
1568                                    ShaderProgramID shaderPacked,
1569                                    GLsizei bufSize,
1570                                    GLsizei *length,
1571                                    GLchar *source)
1572 {
1573     ParamBuffer paramBuffer;
1574 
1575     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1576     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1577 
1578     if (isCallValid)
1579     {
1580         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1581         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1582         CaptureGetShaderSource_length(glState, isCallValid, shaderPacked, bufSize, length, source,
1583                                       &lengthParam);
1584         paramBuffer.addParam(std::move(lengthParam));
1585     }
1586     else
1587     {
1588         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1589         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1590                        &lengthParam.value);
1591         paramBuffer.addParam(std::move(lengthParam));
1592     }
1593 
1594     if (isCallValid)
1595     {
1596         ParamCapture sourceParam("source", ParamType::TGLcharPointer);
1597         InitParamValue(ParamType::TGLcharPointer, source, &sourceParam.value);
1598         CaptureGetShaderSource_source(glState, isCallValid, shaderPacked, bufSize, length, source,
1599                                       &sourceParam);
1600         paramBuffer.addParam(std::move(sourceParam));
1601     }
1602     else
1603     {
1604         ParamCapture sourceParam("source", ParamType::TGLcharPointer);
1605         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
1606                        &sourceParam.value);
1607         paramBuffer.addParam(std::move(sourceParam));
1608     }
1609 
1610     return CallCapture(angle::EntryPoint::GLGetShaderSource, std::move(paramBuffer));
1611 }
1612 
CaptureGetShaderiv(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLenum pname,GLint * params)1613 CallCapture CaptureGetShaderiv(const State &glState,
1614                                bool isCallValid,
1615                                ShaderProgramID shaderPacked,
1616                                GLenum pname,
1617                                GLint *params)
1618 {
1619     ParamBuffer paramBuffer;
1620 
1621     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1622     paramBuffer.addEnumParam("pname", GLenumGroup::ShaderParameterName, ParamType::TGLenum, pname);
1623 
1624     if (isCallValid)
1625     {
1626         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1627         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1628         CaptureGetShaderiv_params(glState, isCallValid, shaderPacked, pname, params, &paramsParam);
1629         paramBuffer.addParam(std::move(paramsParam));
1630     }
1631     else
1632     {
1633         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1634         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1635         paramBuffer.addParam(std::move(paramsParam));
1636     }
1637 
1638     return CallCapture(angle::EntryPoint::GLGetShaderiv, std::move(paramBuffer));
1639 }
1640 
CaptureGetString(const State & glState,bool isCallValid,GLenum name,const GLubyte * returnValue)1641 CallCapture CaptureGetString(const State &glState,
1642                              bool isCallValid,
1643                              GLenum name,
1644                              const GLubyte *returnValue)
1645 {
1646     ParamBuffer paramBuffer;
1647 
1648     paramBuffer.addEnumParam("name", GLenumGroup::StringName, ParamType::TGLenum, name);
1649 
1650     ParamCapture returnValueCapture("returnValue", ParamType::TGLubyteConstPointer);
1651     InitParamValue(ParamType::TGLubyteConstPointer, returnValue, &returnValueCapture.value);
1652     paramBuffer.addReturnValue(std::move(returnValueCapture));
1653 
1654     return CallCapture(angle::EntryPoint::GLGetString, std::move(paramBuffer));
1655 }
1656 
CaptureGetTexParameterfv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLfloat * params)1657 CallCapture CaptureGetTexParameterfv(const State &glState,
1658                                      bool isCallValid,
1659                                      TextureType targetPacked,
1660                                      GLenum pname,
1661                                      GLfloat *params)
1662 {
1663     ParamBuffer paramBuffer;
1664 
1665     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1666     paramBuffer.addEnumParam("pname", GLenumGroup::GetTextureParameter, ParamType::TGLenum, pname);
1667 
1668     if (isCallValid)
1669     {
1670         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1671         InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1672         CaptureGetTexParameterfv_params(glState, isCallValid, targetPacked, pname, params,
1673                                         &paramsParam);
1674         paramBuffer.addParam(std::move(paramsParam));
1675     }
1676     else
1677     {
1678         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1679         InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1680                        &paramsParam.value);
1681         paramBuffer.addParam(std::move(paramsParam));
1682     }
1683 
1684     return CallCapture(angle::EntryPoint::GLGetTexParameterfv, std::move(paramBuffer));
1685 }
1686 
CaptureGetTexParameteriv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLint * params)1687 CallCapture CaptureGetTexParameteriv(const State &glState,
1688                                      bool isCallValid,
1689                                      TextureType targetPacked,
1690                                      GLenum pname,
1691                                      GLint *params)
1692 {
1693     ParamBuffer paramBuffer;
1694 
1695     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
1696     paramBuffer.addEnumParam("pname", GLenumGroup::GetTextureParameter, ParamType::TGLenum, pname);
1697 
1698     if (isCallValid)
1699     {
1700         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1701         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1702         CaptureGetTexParameteriv_params(glState, isCallValid, targetPacked, pname, params,
1703                                         &paramsParam);
1704         paramBuffer.addParam(std::move(paramsParam));
1705     }
1706     else
1707     {
1708         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1709         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1710         paramBuffer.addParam(std::move(paramsParam));
1711     }
1712 
1713     return CallCapture(angle::EntryPoint::GLGetTexParameteriv, std::move(paramBuffer));
1714 }
1715 
CaptureGetUniformLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)1716 CallCapture CaptureGetUniformLocation(const State &glState,
1717                                       bool isCallValid,
1718                                       ShaderProgramID programPacked,
1719                                       const GLchar *name,
1720                                       GLint returnValue)
1721 {
1722     ParamBuffer paramBuffer;
1723 
1724     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1725 
1726     if (isCallValid)
1727     {
1728         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1729         InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
1730         CaptureGetUniformLocation_name(glState, isCallValid, programPacked, name, &nameParam);
1731         paramBuffer.addParam(std::move(nameParam));
1732     }
1733     else
1734     {
1735         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1736         InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
1737                        &nameParam.value);
1738         paramBuffer.addParam(std::move(nameParam));
1739     }
1740 
1741     ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
1742     InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
1743     paramBuffer.addReturnValue(std::move(returnValueCapture));
1744 
1745     return CallCapture(angle::EntryPoint::GLGetUniformLocation, std::move(paramBuffer));
1746 }
1747 
CaptureGetUniformfv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLfloat * params)1748 CallCapture CaptureGetUniformfv(const State &glState,
1749                                 bool isCallValid,
1750                                 ShaderProgramID programPacked,
1751                                 UniformLocation locationPacked,
1752                                 GLfloat *params)
1753 {
1754     ParamBuffer paramBuffer;
1755 
1756     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1757     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1758 
1759     if (isCallValid)
1760     {
1761         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1762         InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1763         CaptureGetUniformfv_params(glState, isCallValid, programPacked, locationPacked, params,
1764                                    &paramsParam);
1765         paramBuffer.addParam(std::move(paramsParam));
1766     }
1767     else
1768     {
1769         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1770         InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1771                        &paramsParam.value);
1772         paramBuffer.addParam(std::move(paramsParam));
1773     }
1774 
1775     return CallCapture(angle::EntryPoint::GLGetUniformfv, std::move(paramBuffer));
1776 }
1777 
CaptureGetUniformiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLint * params)1778 CallCapture CaptureGetUniformiv(const State &glState,
1779                                 bool isCallValid,
1780                                 ShaderProgramID programPacked,
1781                                 UniformLocation locationPacked,
1782                                 GLint *params)
1783 {
1784     ParamBuffer paramBuffer;
1785 
1786     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1787     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1788 
1789     if (isCallValid)
1790     {
1791         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1792         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1793         CaptureGetUniformiv_params(glState, isCallValid, programPacked, locationPacked, params,
1794                                    &paramsParam);
1795         paramBuffer.addParam(std::move(paramsParam));
1796     }
1797     else
1798     {
1799         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1800         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1801         paramBuffer.addParam(std::move(paramsParam));
1802     }
1803 
1804     return CallCapture(angle::EntryPoint::GLGetUniformiv, std::move(paramBuffer));
1805 }
1806 
CaptureGetVertexAttribPointerv(const State & glState,bool isCallValid,GLuint index,GLenum pname,void ** pointer)1807 CallCapture CaptureGetVertexAttribPointerv(const State &glState,
1808                                            bool isCallValid,
1809                                            GLuint index,
1810                                            GLenum pname,
1811                                            void **pointer)
1812 {
1813     ParamBuffer paramBuffer;
1814 
1815     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1816     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1817 
1818     if (isCallValid)
1819     {
1820         ParamCapture pointerParam("pointer", ParamType::TvoidPointerPointer);
1821         InitParamValue(ParamType::TvoidPointerPointer, pointer, &pointerParam.value);
1822         CaptureGetVertexAttribPointerv_pointer(glState, isCallValid, index, pname, pointer,
1823                                                &pointerParam);
1824         paramBuffer.addParam(std::move(pointerParam));
1825     }
1826     else
1827     {
1828         ParamCapture pointerParam("pointer", ParamType::TvoidPointerPointer);
1829         InitParamValue(ParamType::TvoidPointerPointer, static_cast<void **>(nullptr),
1830                        &pointerParam.value);
1831         paramBuffer.addParam(std::move(pointerParam));
1832     }
1833 
1834     return CallCapture(angle::EntryPoint::GLGetVertexAttribPointerv, std::move(paramBuffer));
1835 }
1836 
CaptureGetVertexAttribfv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLfloat * params)1837 CallCapture CaptureGetVertexAttribfv(const State &glState,
1838                                      bool isCallValid,
1839                                      GLuint index,
1840                                      GLenum pname,
1841                                      GLfloat *params)
1842 {
1843     ParamBuffer paramBuffer;
1844 
1845     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1846     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1847 
1848     if (isCallValid)
1849     {
1850         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1851         InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1852         CaptureGetVertexAttribfv_params(glState, isCallValid, index, pname, params, &paramsParam);
1853         paramBuffer.addParam(std::move(paramsParam));
1854     }
1855     else
1856     {
1857         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1858         InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1859                        &paramsParam.value);
1860         paramBuffer.addParam(std::move(paramsParam));
1861     }
1862 
1863     return CallCapture(angle::EntryPoint::GLGetVertexAttribfv, std::move(paramBuffer));
1864 }
1865 
CaptureGetVertexAttribiv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLint * params)1866 CallCapture CaptureGetVertexAttribiv(const State &glState,
1867                                      bool isCallValid,
1868                                      GLuint index,
1869                                      GLenum pname,
1870                                      GLint *params)
1871 {
1872     ParamBuffer paramBuffer;
1873 
1874     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1875     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
1876 
1877     if (isCallValid)
1878     {
1879         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1880         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1881         CaptureGetVertexAttribiv_params(glState, isCallValid, index, pname, params, &paramsParam);
1882         paramBuffer.addParam(std::move(paramsParam));
1883     }
1884     else
1885     {
1886         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1887         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1888         paramBuffer.addParam(std::move(paramsParam));
1889     }
1890 
1891     return CallCapture(angle::EntryPoint::GLGetVertexAttribiv, std::move(paramBuffer));
1892 }
1893 
CaptureHint(const State & glState,bool isCallValid,GLenum target,GLenum mode)1894 CallCapture CaptureHint(const State &glState, bool isCallValid, GLenum target, GLenum mode)
1895 {
1896     ParamBuffer paramBuffer;
1897 
1898     paramBuffer.addEnumParam("target", GLenumGroup::HintTarget, ParamType::TGLenum, target);
1899     paramBuffer.addEnumParam("mode", GLenumGroup::HintMode, ParamType::TGLenum, mode);
1900 
1901     return CallCapture(angle::EntryPoint::GLHint, std::move(paramBuffer));
1902 }
1903 
CaptureIsBuffer(const State & glState,bool isCallValid,BufferID bufferPacked,GLboolean returnValue)1904 CallCapture CaptureIsBuffer(const State &glState,
1905                             bool isCallValid,
1906                             BufferID bufferPacked,
1907                             GLboolean returnValue)
1908 {
1909     ParamBuffer paramBuffer;
1910 
1911     paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
1912 
1913     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1914     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1915     paramBuffer.addReturnValue(std::move(returnValueCapture));
1916 
1917     return CallCapture(angle::EntryPoint::GLIsBuffer, std::move(paramBuffer));
1918 }
1919 
CaptureIsEnabled(const State & glState,bool isCallValid,GLenum cap,GLboolean returnValue)1920 CallCapture CaptureIsEnabled(const State &glState,
1921                              bool isCallValid,
1922                              GLenum cap,
1923                              GLboolean returnValue)
1924 {
1925     ParamBuffer paramBuffer;
1926 
1927     paramBuffer.addEnumParam("cap", GLenumGroup::EnableCap, ParamType::TGLenum, cap);
1928 
1929     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1930     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1931     paramBuffer.addReturnValue(std::move(returnValueCapture));
1932 
1933     return CallCapture(angle::EntryPoint::GLIsEnabled, std::move(paramBuffer));
1934 }
1935 
CaptureIsFramebuffer(const State & glState,bool isCallValid,FramebufferID framebufferPacked,GLboolean returnValue)1936 CallCapture CaptureIsFramebuffer(const State &glState,
1937                                  bool isCallValid,
1938                                  FramebufferID framebufferPacked,
1939                                  GLboolean returnValue)
1940 {
1941     ParamBuffer paramBuffer;
1942 
1943     paramBuffer.addValueParam("framebufferPacked", ParamType::TFramebufferID, framebufferPacked);
1944 
1945     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1946     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1947     paramBuffer.addReturnValue(std::move(returnValueCapture));
1948 
1949     return CallCapture(angle::EntryPoint::GLIsFramebuffer, std::move(paramBuffer));
1950 }
1951 
CaptureIsProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLboolean returnValue)1952 CallCapture CaptureIsProgram(const State &glState,
1953                              bool isCallValid,
1954                              ShaderProgramID programPacked,
1955                              GLboolean returnValue)
1956 {
1957     ParamBuffer paramBuffer;
1958 
1959     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1960 
1961     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1962     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1963     paramBuffer.addReturnValue(std::move(returnValueCapture));
1964 
1965     return CallCapture(angle::EntryPoint::GLIsProgram, std::move(paramBuffer));
1966 }
1967 
CaptureIsRenderbuffer(const State & glState,bool isCallValid,RenderbufferID renderbufferPacked,GLboolean returnValue)1968 CallCapture CaptureIsRenderbuffer(const State &glState,
1969                                   bool isCallValid,
1970                                   RenderbufferID renderbufferPacked,
1971                                   GLboolean returnValue)
1972 {
1973     ParamBuffer paramBuffer;
1974 
1975     paramBuffer.addValueParam("renderbufferPacked", ParamType::TRenderbufferID, renderbufferPacked);
1976 
1977     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1978     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1979     paramBuffer.addReturnValue(std::move(returnValueCapture));
1980 
1981     return CallCapture(angle::EntryPoint::GLIsRenderbuffer, std::move(paramBuffer));
1982 }
1983 
CaptureIsShader(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLboolean returnValue)1984 CallCapture CaptureIsShader(const State &glState,
1985                             bool isCallValid,
1986                             ShaderProgramID shaderPacked,
1987                             GLboolean returnValue)
1988 {
1989     ParamBuffer paramBuffer;
1990 
1991     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
1992 
1993     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1994     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1995     paramBuffer.addReturnValue(std::move(returnValueCapture));
1996 
1997     return CallCapture(angle::EntryPoint::GLIsShader, std::move(paramBuffer));
1998 }
1999 
CaptureIsTexture(const State & glState,bool isCallValid,TextureID texturePacked,GLboolean returnValue)2000 CallCapture CaptureIsTexture(const State &glState,
2001                              bool isCallValid,
2002                              TextureID texturePacked,
2003                              GLboolean returnValue)
2004 {
2005     ParamBuffer paramBuffer;
2006 
2007     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
2008 
2009     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
2010     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
2011     paramBuffer.addReturnValue(std::move(returnValueCapture));
2012 
2013     return CallCapture(angle::EntryPoint::GLIsTexture, std::move(paramBuffer));
2014 }
2015 
CaptureLineWidth(const State & glState,bool isCallValid,GLfloat width)2016 CallCapture CaptureLineWidth(const State &glState, bool isCallValid, GLfloat width)
2017 {
2018     ParamBuffer paramBuffer;
2019 
2020     paramBuffer.addValueParam("width", ParamType::TGLfloat, width);
2021 
2022     return CallCapture(angle::EntryPoint::GLLineWidth, std::move(paramBuffer));
2023 }
2024 
CaptureLinkProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2025 CallCapture CaptureLinkProgram(const State &glState,
2026                                bool isCallValid,
2027                                ShaderProgramID programPacked)
2028 {
2029     ParamBuffer paramBuffer;
2030 
2031     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2032 
2033     return CallCapture(angle::EntryPoint::GLLinkProgram, std::move(paramBuffer));
2034 }
2035 
CapturePixelStorei(const State & glState,bool isCallValid,GLenum pname,GLint param)2036 CallCapture CapturePixelStorei(const State &glState, bool isCallValid, GLenum pname, GLint param)
2037 {
2038     ParamBuffer paramBuffer;
2039 
2040     paramBuffer.addEnumParam("pname", GLenumGroup::PixelStoreParameter, ParamType::TGLenum, pname);
2041     paramBuffer.addValueParam("param", ParamType::TGLint, param);
2042 
2043     return CallCapture(angle::EntryPoint::GLPixelStorei, std::move(paramBuffer));
2044 }
2045 
CapturePolygonOffset(const State & glState,bool isCallValid,GLfloat factor,GLfloat units)2046 CallCapture CapturePolygonOffset(const State &glState,
2047                                  bool isCallValid,
2048                                  GLfloat factor,
2049                                  GLfloat units)
2050 {
2051     ParamBuffer paramBuffer;
2052 
2053     paramBuffer.addValueParam("factor", ParamType::TGLfloat, factor);
2054     paramBuffer.addValueParam("units", ParamType::TGLfloat, units);
2055 
2056     return CallCapture(angle::EntryPoint::GLPolygonOffset, std::move(paramBuffer));
2057 }
2058 
CaptureReadPixels(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,void * pixels)2059 CallCapture CaptureReadPixels(const State &glState,
2060                               bool isCallValid,
2061                               GLint x,
2062                               GLint y,
2063                               GLsizei width,
2064                               GLsizei height,
2065                               GLenum format,
2066                               GLenum type,
2067                               void *pixels)
2068 {
2069     ParamBuffer paramBuffer;
2070 
2071     paramBuffer.addValueParam("x", ParamType::TGLint, x);
2072     paramBuffer.addValueParam("y", ParamType::TGLint, y);
2073     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2074     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2075     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
2076     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
2077 
2078     if (isCallValid)
2079     {
2080         ParamCapture pixelsParam("pixels", ParamType::TvoidPointer);
2081         InitParamValue(ParamType::TvoidPointer, pixels, &pixelsParam.value);
2082         CaptureReadPixels_pixels(glState, isCallValid, x, y, width, height, format, type, pixels,
2083                                  &pixelsParam);
2084         paramBuffer.addParam(std::move(pixelsParam));
2085     }
2086     else
2087     {
2088         ParamCapture pixelsParam("pixels", ParamType::TvoidPointer);
2089         InitParamValue(ParamType::TvoidPointer, static_cast<void *>(nullptr), &pixelsParam.value);
2090         paramBuffer.addParam(std::move(pixelsParam));
2091     }
2092 
2093     return CallCapture(angle::EntryPoint::GLReadPixels, std::move(paramBuffer));
2094 }
2095 
CaptureReleaseShaderCompiler(const State & glState,bool isCallValid)2096 CallCapture CaptureReleaseShaderCompiler(const State &glState, bool isCallValid)
2097 {
2098     ParamBuffer paramBuffer;
2099 
2100     return CallCapture(angle::EntryPoint::GLReleaseShaderCompiler, std::move(paramBuffer));
2101 }
2102 
CaptureRenderbufferStorage(const State & glState,bool isCallValid,GLenum target,GLenum internalformat,GLsizei width,GLsizei height)2103 CallCapture CaptureRenderbufferStorage(const State &glState,
2104                                        bool isCallValid,
2105                                        GLenum target,
2106                                        GLenum internalformat,
2107                                        GLsizei width,
2108                                        GLsizei height)
2109 {
2110     ParamBuffer paramBuffer;
2111 
2112     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
2113     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
2114                              internalformat);
2115     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2116     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2117 
2118     return CallCapture(angle::EntryPoint::GLRenderbufferStorage, std::move(paramBuffer));
2119 }
2120 
CaptureSampleCoverage(const State & glState,bool isCallValid,GLfloat value,GLboolean invert)2121 CallCapture CaptureSampleCoverage(const State &glState,
2122                                   bool isCallValid,
2123                                   GLfloat value,
2124                                   GLboolean invert)
2125 {
2126     ParamBuffer paramBuffer;
2127 
2128     paramBuffer.addValueParam("value", ParamType::TGLfloat, value);
2129     paramBuffer.addValueParam("invert", ParamType::TGLboolean, invert);
2130 
2131     return CallCapture(angle::EntryPoint::GLSampleCoverage, std::move(paramBuffer));
2132 }
2133 
CaptureScissor(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height)2134 CallCapture CaptureScissor(const State &glState,
2135                            bool isCallValid,
2136                            GLint x,
2137                            GLint y,
2138                            GLsizei width,
2139                            GLsizei height)
2140 {
2141     ParamBuffer paramBuffer;
2142 
2143     paramBuffer.addValueParam("x", ParamType::TGLint, x);
2144     paramBuffer.addValueParam("y", ParamType::TGLint, y);
2145     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2146     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2147 
2148     return CallCapture(angle::EntryPoint::GLScissor, std::move(paramBuffer));
2149 }
2150 
CaptureShaderBinary(const State & glState,bool isCallValid,GLsizei count,const ShaderProgramID * shadersPacked,GLenum binaryformat,const void * binary,GLsizei length)2151 CallCapture CaptureShaderBinary(const State &glState,
2152                                 bool isCallValid,
2153                                 GLsizei count,
2154                                 const ShaderProgramID *shadersPacked,
2155                                 GLenum binaryformat,
2156                                 const void *binary,
2157                                 GLsizei length)
2158 {
2159     ParamBuffer paramBuffer;
2160 
2161     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2162 
2163     if (isCallValid)
2164     {
2165         ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDConstPointer);
2166         InitParamValue(ParamType::TShaderProgramIDConstPointer, shadersPacked,
2167                        &shadersPackedParam.value);
2168         CaptureShaderBinary_shadersPacked(glState, isCallValid, count, shadersPacked, binaryformat,
2169                                           binary, length, &shadersPackedParam);
2170         paramBuffer.addParam(std::move(shadersPackedParam));
2171     }
2172     else
2173     {
2174         ParamCapture shadersPackedParam("shadersPacked", ParamType::TShaderProgramIDConstPointer);
2175         InitParamValue(ParamType::TShaderProgramIDConstPointer,
2176                        static_cast<const ShaderProgramID *>(nullptr), &shadersPackedParam.value);
2177         paramBuffer.addParam(std::move(shadersPackedParam));
2178     }
2179 
2180     paramBuffer.addEnumParam("binaryformat", GLenumGroup::DefaultGroup, ParamType::TGLenum,
2181                              binaryformat);
2182 
2183     if (isCallValid)
2184     {
2185         ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
2186         InitParamValue(ParamType::TvoidConstPointer, binary, &binaryParam.value);
2187         CaptureShaderBinary_binary(glState, isCallValid, count, shadersPacked, binaryformat, binary,
2188                                    length, &binaryParam);
2189         paramBuffer.addParam(std::move(binaryParam));
2190     }
2191     else
2192     {
2193         ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
2194         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2195                        &binaryParam.value);
2196         paramBuffer.addParam(std::move(binaryParam));
2197     }
2198 
2199     paramBuffer.addValueParam("length", ParamType::TGLsizei, length);
2200 
2201     return CallCapture(angle::EntryPoint::GLShaderBinary, std::move(paramBuffer));
2202 }
2203 
CaptureShaderSource(const State & glState,bool isCallValid,ShaderProgramID shaderPacked,GLsizei count,const GLchar * const * string,const GLint * length)2204 CallCapture CaptureShaderSource(const State &glState,
2205                                 bool isCallValid,
2206                                 ShaderProgramID shaderPacked,
2207                                 GLsizei count,
2208                                 const GLchar *const *string,
2209                                 const GLint *length)
2210 {
2211     ParamBuffer paramBuffer;
2212 
2213     paramBuffer.addValueParam("shaderPacked", ParamType::TShaderProgramID, shaderPacked);
2214     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2215 
2216     if (isCallValid)
2217     {
2218         ParamCapture stringParam("string", ParamType::TGLcharConstPointerPointer);
2219         InitParamValue(ParamType::TGLcharConstPointerPointer, string, &stringParam.value);
2220         CaptureShaderSource_string(glState, isCallValid, shaderPacked, count, string, length,
2221                                    &stringParam);
2222         paramBuffer.addParam(std::move(stringParam));
2223     }
2224     else
2225     {
2226         ParamCapture stringParam("string", ParamType::TGLcharConstPointerPointer);
2227         InitParamValue(ParamType::TGLcharConstPointerPointer,
2228                        static_cast<const GLchar *const *>(nullptr), &stringParam.value);
2229         paramBuffer.addParam(std::move(stringParam));
2230     }
2231 
2232     if (isCallValid)
2233     {
2234         ParamCapture lengthParam("length", ParamType::TGLintConstPointer);
2235         InitParamValue(ParamType::TGLintConstPointer, length, &lengthParam.value);
2236         CaptureShaderSource_length(glState, isCallValid, shaderPacked, count, string, length,
2237                                    &lengthParam);
2238         paramBuffer.addParam(std::move(lengthParam));
2239     }
2240     else
2241     {
2242         ParamCapture lengthParam("length", ParamType::TGLintConstPointer);
2243         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2244                        &lengthParam.value);
2245         paramBuffer.addParam(std::move(lengthParam));
2246     }
2247 
2248     return CallCapture(angle::EntryPoint::GLShaderSource, std::move(paramBuffer));
2249 }
2250 
CaptureStencilFunc(const State & glState,bool isCallValid,GLenum func,GLint ref,GLuint mask)2251 CallCapture CaptureStencilFunc(const State &glState,
2252                                bool isCallValid,
2253                                GLenum func,
2254                                GLint ref,
2255                                GLuint mask)
2256 {
2257     ParamBuffer paramBuffer;
2258 
2259     paramBuffer.addEnumParam("func", GLenumGroup::StencilFunction, ParamType::TGLenum, func);
2260     paramBuffer.addValueParam("ref", ParamType::TGLint, ref);
2261     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2262 
2263     return CallCapture(angle::EntryPoint::GLStencilFunc, std::move(paramBuffer));
2264 }
2265 
CaptureStencilFuncSeparate(const State & glState,bool isCallValid,GLenum face,GLenum func,GLint ref,GLuint mask)2266 CallCapture CaptureStencilFuncSeparate(const State &glState,
2267                                        bool isCallValid,
2268                                        GLenum face,
2269                                        GLenum func,
2270                                        GLint ref,
2271                                        GLuint mask)
2272 {
2273     ParamBuffer paramBuffer;
2274 
2275     paramBuffer.addEnumParam("face", GLenumGroup::StencilFaceDirection, ParamType::TGLenum, face);
2276     paramBuffer.addEnumParam("func", GLenumGroup::StencilFunction, ParamType::TGLenum, func);
2277     paramBuffer.addValueParam("ref", ParamType::TGLint, ref);
2278     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2279 
2280     return CallCapture(angle::EntryPoint::GLStencilFuncSeparate, std::move(paramBuffer));
2281 }
2282 
CaptureStencilMask(const State & glState,bool isCallValid,GLuint mask)2283 CallCapture CaptureStencilMask(const State &glState, bool isCallValid, GLuint mask)
2284 {
2285     ParamBuffer paramBuffer;
2286 
2287     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2288 
2289     return CallCapture(angle::EntryPoint::GLStencilMask, std::move(paramBuffer));
2290 }
2291 
CaptureStencilMaskSeparate(const State & glState,bool isCallValid,GLenum face,GLuint mask)2292 CallCapture CaptureStencilMaskSeparate(const State &glState,
2293                                        bool isCallValid,
2294                                        GLenum face,
2295                                        GLuint mask)
2296 {
2297     ParamBuffer paramBuffer;
2298 
2299     paramBuffer.addEnumParam("face", GLenumGroup::StencilFaceDirection, ParamType::TGLenum, face);
2300     paramBuffer.addValueParam("mask", ParamType::TGLuint, mask);
2301 
2302     return CallCapture(angle::EntryPoint::GLStencilMaskSeparate, std::move(paramBuffer));
2303 }
2304 
CaptureStencilOp(const State & glState,bool isCallValid,GLenum fail,GLenum zfail,GLenum zpass)2305 CallCapture CaptureStencilOp(const State &glState,
2306                              bool isCallValid,
2307                              GLenum fail,
2308                              GLenum zfail,
2309                              GLenum zpass)
2310 {
2311     ParamBuffer paramBuffer;
2312 
2313     paramBuffer.addEnumParam("fail", GLenumGroup::StencilOp, ParamType::TGLenum, fail);
2314     paramBuffer.addEnumParam("zfail", GLenumGroup::StencilOp, ParamType::TGLenum, zfail);
2315     paramBuffer.addEnumParam("zpass", GLenumGroup::StencilOp, ParamType::TGLenum, zpass);
2316 
2317     return CallCapture(angle::EntryPoint::GLStencilOp, std::move(paramBuffer));
2318 }
2319 
CaptureStencilOpSeparate(const State & glState,bool isCallValid,GLenum face,GLenum sfail,GLenum dpfail,GLenum dppass)2320 CallCapture CaptureStencilOpSeparate(const State &glState,
2321                                      bool isCallValid,
2322                                      GLenum face,
2323                                      GLenum sfail,
2324                                      GLenum dpfail,
2325                                      GLenum dppass)
2326 {
2327     ParamBuffer paramBuffer;
2328 
2329     paramBuffer.addEnumParam("face", GLenumGroup::StencilFaceDirection, ParamType::TGLenum, face);
2330     paramBuffer.addEnumParam("sfail", GLenumGroup::StencilOp, ParamType::TGLenum, sfail);
2331     paramBuffer.addEnumParam("dpfail", GLenumGroup::StencilOp, ParamType::TGLenum, dpfail);
2332     paramBuffer.addEnumParam("dppass", GLenumGroup::StencilOp, ParamType::TGLenum, dppass);
2333 
2334     return CallCapture(angle::EntryPoint::GLStencilOpSeparate, std::move(paramBuffer));
2335 }
2336 
CaptureTexImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const void * pixels)2337 CallCapture CaptureTexImage2D(const State &glState,
2338                               bool isCallValid,
2339                               TextureTarget targetPacked,
2340                               GLint level,
2341                               GLint internalformat,
2342                               GLsizei width,
2343                               GLsizei height,
2344                               GLint border,
2345                               GLenum format,
2346                               GLenum type,
2347                               const void *pixels)
2348 {
2349     ParamBuffer paramBuffer;
2350 
2351     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
2352     paramBuffer.addValueParam("level", ParamType::TGLint, level);
2353     paramBuffer.addValueParam("internalformat", ParamType::TGLint, internalformat);
2354     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2355     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2356     paramBuffer.addValueParam("border", ParamType::TGLint, border);
2357     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
2358     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
2359 
2360     if (isCallValid)
2361     {
2362         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2363         InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
2364         CaptureTexImage2D_pixels(glState, isCallValid, targetPacked, level, internalformat, width,
2365                                  height, border, format, type, pixels, &pixelsParam);
2366         paramBuffer.addParam(std::move(pixelsParam));
2367     }
2368     else
2369     {
2370         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2371         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2372                        &pixelsParam.value);
2373         paramBuffer.addParam(std::move(pixelsParam));
2374     }
2375 
2376     return CallCapture(angle::EntryPoint::GLTexImage2D, std::move(paramBuffer));
2377 }
2378 
CaptureTexParameterf(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLfloat param)2379 CallCapture CaptureTexParameterf(const State &glState,
2380                                  bool isCallValid,
2381                                  TextureType targetPacked,
2382                                  GLenum pname,
2383                                  GLfloat param)
2384 {
2385     ParamBuffer paramBuffer;
2386 
2387     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2388     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
2389     paramBuffer.addValueParam("param", ParamType::TGLfloat, param);
2390 
2391     return CallCapture(angle::EntryPoint::GLTexParameterf, std::move(paramBuffer));
2392 }
2393 
CaptureTexParameterfv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,const GLfloat * params)2394 CallCapture CaptureTexParameterfv(const State &glState,
2395                                   bool isCallValid,
2396                                   TextureType targetPacked,
2397                                   GLenum pname,
2398                                   const GLfloat *params)
2399 {
2400     ParamBuffer paramBuffer;
2401 
2402     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2403     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
2404 
2405     if (isCallValid)
2406     {
2407         ParamCapture paramsParam("params", ParamType::TGLfloatConstPointer);
2408         InitParamValue(ParamType::TGLfloatConstPointer, params, &paramsParam.value);
2409         CaptureTexParameterfv_params(glState, isCallValid, targetPacked, pname, params,
2410                                      &paramsParam);
2411         paramBuffer.addParam(std::move(paramsParam));
2412     }
2413     else
2414     {
2415         ParamCapture paramsParam("params", ParamType::TGLfloatConstPointer);
2416         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2417                        &paramsParam.value);
2418         paramBuffer.addParam(std::move(paramsParam));
2419     }
2420 
2421     return CallCapture(angle::EntryPoint::GLTexParameterfv, std::move(paramBuffer));
2422 }
2423 
CaptureTexParameteri(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,GLint param)2424 CallCapture CaptureTexParameteri(const State &glState,
2425                                  bool isCallValid,
2426                                  TextureType targetPacked,
2427                                  GLenum pname,
2428                                  GLint param)
2429 {
2430     ParamBuffer paramBuffer;
2431 
2432     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2433     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
2434     paramBuffer.addValueParam("param", ParamType::TGLint, param);
2435 
2436     return CallCapture(angle::EntryPoint::GLTexParameteri, std::move(paramBuffer));
2437 }
2438 
CaptureTexParameteriv(const State & glState,bool isCallValid,TextureType targetPacked,GLenum pname,const GLint * params)2439 CallCapture CaptureTexParameteriv(const State &glState,
2440                                   bool isCallValid,
2441                                   TextureType targetPacked,
2442                                   GLenum pname,
2443                                   const GLint *params)
2444 {
2445     ParamBuffer paramBuffer;
2446 
2447     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2448     paramBuffer.addEnumParam("pname", GLenumGroup::TextureParameterName, ParamType::TGLenum, pname);
2449 
2450     if (isCallValid)
2451     {
2452         ParamCapture paramsParam("params", ParamType::TGLintConstPointer);
2453         InitParamValue(ParamType::TGLintConstPointer, params, &paramsParam.value);
2454         CaptureTexParameteriv_params(glState, isCallValid, targetPacked, pname, params,
2455                                      &paramsParam);
2456         paramBuffer.addParam(std::move(paramsParam));
2457     }
2458     else
2459     {
2460         ParamCapture paramsParam("params", ParamType::TGLintConstPointer);
2461         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2462                        &paramsParam.value);
2463         paramBuffer.addParam(std::move(paramsParam));
2464     }
2465 
2466     return CallCapture(angle::EntryPoint::GLTexParameteriv, std::move(paramBuffer));
2467 }
2468 
CaptureTexSubImage2D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const void * pixels)2469 CallCapture CaptureTexSubImage2D(const State &glState,
2470                                  bool isCallValid,
2471                                  TextureTarget targetPacked,
2472                                  GLint level,
2473                                  GLint xoffset,
2474                                  GLint yoffset,
2475                                  GLsizei width,
2476                                  GLsizei height,
2477                                  GLenum format,
2478                                  GLenum type,
2479                                  const void *pixels)
2480 {
2481     ParamBuffer paramBuffer;
2482 
2483     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
2484     paramBuffer.addValueParam("level", ParamType::TGLint, level);
2485     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
2486     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
2487     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2488     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2489     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
2490     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
2491 
2492     if (isCallValid)
2493     {
2494         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2495         InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
2496         CaptureTexSubImage2D_pixels(glState, isCallValid, targetPacked, level, xoffset, yoffset,
2497                                     width, height, format, type, pixels, &pixelsParam);
2498         paramBuffer.addParam(std::move(pixelsParam));
2499     }
2500     else
2501     {
2502         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2503         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2504                        &pixelsParam.value);
2505         paramBuffer.addParam(std::move(pixelsParam));
2506     }
2507 
2508     return CallCapture(angle::EntryPoint::GLTexSubImage2D, std::move(paramBuffer));
2509 }
2510 
CaptureUniform1f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0)2511 CallCapture CaptureUniform1f(const State &glState,
2512                              bool isCallValid,
2513                              UniformLocation locationPacked,
2514                              GLfloat v0)
2515 {
2516     ParamBuffer paramBuffer;
2517 
2518     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2519     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2520 
2521     return CallCapture(angle::EntryPoint::GLUniform1f, std::move(paramBuffer));
2522 }
2523 
CaptureUniform1fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2524 CallCapture CaptureUniform1fv(const State &glState,
2525                               bool isCallValid,
2526                               UniformLocation locationPacked,
2527                               GLsizei count,
2528                               const GLfloat *value)
2529 {
2530     ParamBuffer paramBuffer;
2531 
2532     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2533     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2534 
2535     if (isCallValid)
2536     {
2537         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2538         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2539         CaptureUniform1fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2540         paramBuffer.addParam(std::move(valueParam));
2541     }
2542     else
2543     {
2544         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2545         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2546                        &valueParam.value);
2547         paramBuffer.addParam(std::move(valueParam));
2548     }
2549 
2550     return CallCapture(angle::EntryPoint::GLUniform1fv, std::move(paramBuffer));
2551 }
2552 
CaptureUniform1i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0)2553 CallCapture CaptureUniform1i(const State &glState,
2554                              bool isCallValid,
2555                              UniformLocation locationPacked,
2556                              GLint v0)
2557 {
2558     ParamBuffer paramBuffer;
2559 
2560     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2561     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2562 
2563     return CallCapture(angle::EntryPoint::GLUniform1i, std::move(paramBuffer));
2564 }
2565 
CaptureUniform1iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2566 CallCapture CaptureUniform1iv(const State &glState,
2567                               bool isCallValid,
2568                               UniformLocation locationPacked,
2569                               GLsizei count,
2570                               const GLint *value)
2571 {
2572     ParamBuffer paramBuffer;
2573 
2574     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2575     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2576 
2577     if (isCallValid)
2578     {
2579         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2580         InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2581         CaptureUniform1iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2582         paramBuffer.addParam(std::move(valueParam));
2583     }
2584     else
2585     {
2586         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2587         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2588                        &valueParam.value);
2589         paramBuffer.addParam(std::move(valueParam));
2590     }
2591 
2592     return CallCapture(angle::EntryPoint::GLUniform1iv, std::move(paramBuffer));
2593 }
2594 
CaptureUniform2f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1)2595 CallCapture CaptureUniform2f(const State &glState,
2596                              bool isCallValid,
2597                              UniformLocation locationPacked,
2598                              GLfloat v0,
2599                              GLfloat v1)
2600 {
2601     ParamBuffer paramBuffer;
2602 
2603     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2604     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2605     paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2606 
2607     return CallCapture(angle::EntryPoint::GLUniform2f, std::move(paramBuffer));
2608 }
2609 
CaptureUniform2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2610 CallCapture CaptureUniform2fv(const State &glState,
2611                               bool isCallValid,
2612                               UniformLocation locationPacked,
2613                               GLsizei count,
2614                               const GLfloat *value)
2615 {
2616     ParamBuffer paramBuffer;
2617 
2618     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2619     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2620 
2621     if (isCallValid)
2622     {
2623         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2624         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2625         CaptureUniform2fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2626         paramBuffer.addParam(std::move(valueParam));
2627     }
2628     else
2629     {
2630         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2631         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2632                        &valueParam.value);
2633         paramBuffer.addParam(std::move(valueParam));
2634     }
2635 
2636     return CallCapture(angle::EntryPoint::GLUniform2fv, std::move(paramBuffer));
2637 }
2638 
CaptureUniform2i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1)2639 CallCapture CaptureUniform2i(const State &glState,
2640                              bool isCallValid,
2641                              UniformLocation locationPacked,
2642                              GLint v0,
2643                              GLint v1)
2644 {
2645     ParamBuffer paramBuffer;
2646 
2647     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2648     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2649     paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2650 
2651     return CallCapture(angle::EntryPoint::GLUniform2i, std::move(paramBuffer));
2652 }
2653 
CaptureUniform2iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2654 CallCapture CaptureUniform2iv(const State &glState,
2655                               bool isCallValid,
2656                               UniformLocation locationPacked,
2657                               GLsizei count,
2658                               const GLint *value)
2659 {
2660     ParamBuffer paramBuffer;
2661 
2662     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2663     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2664 
2665     if (isCallValid)
2666     {
2667         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2668         InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2669         CaptureUniform2iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2670         paramBuffer.addParam(std::move(valueParam));
2671     }
2672     else
2673     {
2674         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2675         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2676                        &valueParam.value);
2677         paramBuffer.addParam(std::move(valueParam));
2678     }
2679 
2680     return CallCapture(angle::EntryPoint::GLUniform2iv, std::move(paramBuffer));
2681 }
2682 
CaptureUniform3f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1,GLfloat v2)2683 CallCapture CaptureUniform3f(const State &glState,
2684                              bool isCallValid,
2685                              UniformLocation locationPacked,
2686                              GLfloat v0,
2687                              GLfloat v1,
2688                              GLfloat v2)
2689 {
2690     ParamBuffer paramBuffer;
2691 
2692     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2693     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2694     paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2695     paramBuffer.addValueParam("v2", ParamType::TGLfloat, v2);
2696 
2697     return CallCapture(angle::EntryPoint::GLUniform3f, std::move(paramBuffer));
2698 }
2699 
CaptureUniform3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2700 CallCapture CaptureUniform3fv(const State &glState,
2701                               bool isCallValid,
2702                               UniformLocation locationPacked,
2703                               GLsizei count,
2704                               const GLfloat *value)
2705 {
2706     ParamBuffer paramBuffer;
2707 
2708     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2709     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2710 
2711     if (isCallValid)
2712     {
2713         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2714         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2715         CaptureUniform3fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2716         paramBuffer.addParam(std::move(valueParam));
2717     }
2718     else
2719     {
2720         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2721         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2722                        &valueParam.value);
2723         paramBuffer.addParam(std::move(valueParam));
2724     }
2725 
2726     return CallCapture(angle::EntryPoint::GLUniform3fv, std::move(paramBuffer));
2727 }
2728 
CaptureUniform3i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1,GLint v2)2729 CallCapture CaptureUniform3i(const State &glState,
2730                              bool isCallValid,
2731                              UniformLocation locationPacked,
2732                              GLint v0,
2733                              GLint v1,
2734                              GLint v2)
2735 {
2736     ParamBuffer paramBuffer;
2737 
2738     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2739     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2740     paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2741     paramBuffer.addValueParam("v2", ParamType::TGLint, v2);
2742 
2743     return CallCapture(angle::EntryPoint::GLUniform3i, std::move(paramBuffer));
2744 }
2745 
CaptureUniform3iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2746 CallCapture CaptureUniform3iv(const State &glState,
2747                               bool isCallValid,
2748                               UniformLocation locationPacked,
2749                               GLsizei count,
2750                               const GLint *value)
2751 {
2752     ParamBuffer paramBuffer;
2753 
2754     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2755     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2756 
2757     if (isCallValid)
2758     {
2759         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2760         InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2761         CaptureUniform3iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2762         paramBuffer.addParam(std::move(valueParam));
2763     }
2764     else
2765     {
2766         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2767         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2768                        &valueParam.value);
2769         paramBuffer.addParam(std::move(valueParam));
2770     }
2771 
2772     return CallCapture(angle::EntryPoint::GLUniform3iv, std::move(paramBuffer));
2773 }
2774 
CaptureUniform4f(const State & glState,bool isCallValid,UniformLocation locationPacked,GLfloat v0,GLfloat v1,GLfloat v2,GLfloat v3)2775 CallCapture CaptureUniform4f(const State &glState,
2776                              bool isCallValid,
2777                              UniformLocation locationPacked,
2778                              GLfloat v0,
2779                              GLfloat v1,
2780                              GLfloat v2,
2781                              GLfloat v3)
2782 {
2783     ParamBuffer paramBuffer;
2784 
2785     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2786     paramBuffer.addValueParam("v0", ParamType::TGLfloat, v0);
2787     paramBuffer.addValueParam("v1", ParamType::TGLfloat, v1);
2788     paramBuffer.addValueParam("v2", ParamType::TGLfloat, v2);
2789     paramBuffer.addValueParam("v3", ParamType::TGLfloat, v3);
2790 
2791     return CallCapture(angle::EntryPoint::GLUniform4f, std::move(paramBuffer));
2792 }
2793 
CaptureUniform4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLfloat * value)2794 CallCapture CaptureUniform4fv(const State &glState,
2795                               bool isCallValid,
2796                               UniformLocation locationPacked,
2797                               GLsizei count,
2798                               const GLfloat *value)
2799 {
2800     ParamBuffer paramBuffer;
2801 
2802     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2803     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2804 
2805     if (isCallValid)
2806     {
2807         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2808         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2809         CaptureUniform4fv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2810         paramBuffer.addParam(std::move(valueParam));
2811     }
2812     else
2813     {
2814         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2815         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2816                        &valueParam.value);
2817         paramBuffer.addParam(std::move(valueParam));
2818     }
2819 
2820     return CallCapture(angle::EntryPoint::GLUniform4fv, std::move(paramBuffer));
2821 }
2822 
CaptureUniform4i(const State & glState,bool isCallValid,UniformLocation locationPacked,GLint v0,GLint v1,GLint v2,GLint v3)2823 CallCapture CaptureUniform4i(const State &glState,
2824                              bool isCallValid,
2825                              UniformLocation locationPacked,
2826                              GLint v0,
2827                              GLint v1,
2828                              GLint v2,
2829                              GLint v3)
2830 {
2831     ParamBuffer paramBuffer;
2832 
2833     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2834     paramBuffer.addValueParam("v0", ParamType::TGLint, v0);
2835     paramBuffer.addValueParam("v1", ParamType::TGLint, v1);
2836     paramBuffer.addValueParam("v2", ParamType::TGLint, v2);
2837     paramBuffer.addValueParam("v3", ParamType::TGLint, v3);
2838 
2839     return CallCapture(angle::EntryPoint::GLUniform4i, std::move(paramBuffer));
2840 }
2841 
CaptureUniform4iv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLint * value)2842 CallCapture CaptureUniform4iv(const State &glState,
2843                               bool isCallValid,
2844                               UniformLocation locationPacked,
2845                               GLsizei count,
2846                               const GLint *value)
2847 {
2848     ParamBuffer paramBuffer;
2849 
2850     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2851     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2852 
2853     if (isCallValid)
2854     {
2855         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2856         InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
2857         CaptureUniform4iv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2858         paramBuffer.addParam(std::move(valueParam));
2859     }
2860     else
2861     {
2862         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
2863         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2864                        &valueParam.value);
2865         paramBuffer.addParam(std::move(valueParam));
2866     }
2867 
2868     return CallCapture(angle::EntryPoint::GLUniform4iv, std::move(paramBuffer));
2869 }
2870 
CaptureUniformMatrix2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2871 CallCapture CaptureUniformMatrix2fv(const State &glState,
2872                                     bool isCallValid,
2873                                     UniformLocation locationPacked,
2874                                     GLsizei count,
2875                                     GLboolean transpose,
2876                                     const GLfloat *value)
2877 {
2878     ParamBuffer paramBuffer;
2879 
2880     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2881     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2882     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2883 
2884     if (isCallValid)
2885     {
2886         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2887         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2888         CaptureUniformMatrix2fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2889                                       &valueParam);
2890         paramBuffer.addParam(std::move(valueParam));
2891     }
2892     else
2893     {
2894         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2895         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2896                        &valueParam.value);
2897         paramBuffer.addParam(std::move(valueParam));
2898     }
2899 
2900     return CallCapture(angle::EntryPoint::GLUniformMatrix2fv, std::move(paramBuffer));
2901 }
2902 
CaptureUniformMatrix3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2903 CallCapture CaptureUniformMatrix3fv(const State &glState,
2904                                     bool isCallValid,
2905                                     UniformLocation locationPacked,
2906                                     GLsizei count,
2907                                     GLboolean transpose,
2908                                     const GLfloat *value)
2909 {
2910     ParamBuffer paramBuffer;
2911 
2912     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2913     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2914     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2915 
2916     if (isCallValid)
2917     {
2918         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2919         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2920         CaptureUniformMatrix3fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2921                                       &valueParam);
2922         paramBuffer.addParam(std::move(valueParam));
2923     }
2924     else
2925     {
2926         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2927         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2928                        &valueParam.value);
2929         paramBuffer.addParam(std::move(valueParam));
2930     }
2931 
2932     return CallCapture(angle::EntryPoint::GLUniformMatrix3fv, std::move(paramBuffer));
2933 }
2934 
CaptureUniformMatrix4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2935 CallCapture CaptureUniformMatrix4fv(const State &glState,
2936                                     bool isCallValid,
2937                                     UniformLocation locationPacked,
2938                                     GLsizei count,
2939                                     GLboolean transpose,
2940                                     const GLfloat *value)
2941 {
2942     ParamBuffer paramBuffer;
2943 
2944     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2945     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2946     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2947 
2948     if (isCallValid)
2949     {
2950         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2951         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2952         CaptureUniformMatrix4fv_value(glState, isCallValid, locationPacked, count, transpose, value,
2953                                       &valueParam);
2954         paramBuffer.addParam(std::move(valueParam));
2955     }
2956     else
2957     {
2958         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2959         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2960                        &valueParam.value);
2961         paramBuffer.addParam(std::move(valueParam));
2962     }
2963 
2964     return CallCapture(angle::EntryPoint::GLUniformMatrix4fv, std::move(paramBuffer));
2965 }
2966 
CaptureUseProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2967 CallCapture CaptureUseProgram(const State &glState, bool isCallValid, ShaderProgramID programPacked)
2968 {
2969     ParamBuffer paramBuffer;
2970 
2971     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2972 
2973     return CallCapture(angle::EntryPoint::GLUseProgram, std::move(paramBuffer));
2974 }
2975 
CaptureValidateProgram(const State & glState,bool isCallValid,ShaderProgramID programPacked)2976 CallCapture CaptureValidateProgram(const State &glState,
2977                                    bool isCallValid,
2978                                    ShaderProgramID programPacked)
2979 {
2980     ParamBuffer paramBuffer;
2981 
2982     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2983 
2984     return CallCapture(angle::EntryPoint::GLValidateProgram, std::move(paramBuffer));
2985 }
2986 
CaptureVertexAttrib1f(const State & glState,bool isCallValid,GLuint index,GLfloat x)2987 CallCapture CaptureVertexAttrib1f(const State &glState, bool isCallValid, GLuint index, GLfloat x)
2988 {
2989     ParamBuffer paramBuffer;
2990 
2991     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2992     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
2993 
2994     return CallCapture(angle::EntryPoint::GLVertexAttrib1f, std::move(paramBuffer));
2995 }
2996 
CaptureVertexAttrib1fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)2997 CallCapture CaptureVertexAttrib1fv(const State &glState,
2998                                    bool isCallValid,
2999                                    GLuint index,
3000                                    const GLfloat *v)
3001 {
3002     ParamBuffer paramBuffer;
3003 
3004     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3005 
3006     if (isCallValid)
3007     {
3008         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3009         InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3010         CaptureVertexAttrib1fv_v(glState, isCallValid, index, v, &vParam);
3011         paramBuffer.addParam(std::move(vParam));
3012     }
3013     else
3014     {
3015         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3016         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3017                        &vParam.value);
3018         paramBuffer.addParam(std::move(vParam));
3019     }
3020 
3021     return CallCapture(angle::EntryPoint::GLVertexAttrib1fv, std::move(paramBuffer));
3022 }
3023 
CaptureVertexAttrib2f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y)3024 CallCapture CaptureVertexAttrib2f(const State &glState,
3025                                   bool isCallValid,
3026                                   GLuint index,
3027                                   GLfloat x,
3028                                   GLfloat y)
3029 {
3030     ParamBuffer paramBuffer;
3031 
3032     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3033     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
3034     paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
3035 
3036     return CallCapture(angle::EntryPoint::GLVertexAttrib2f, std::move(paramBuffer));
3037 }
3038 
CaptureVertexAttrib2fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)3039 CallCapture CaptureVertexAttrib2fv(const State &glState,
3040                                    bool isCallValid,
3041                                    GLuint index,
3042                                    const GLfloat *v)
3043 {
3044     ParamBuffer paramBuffer;
3045 
3046     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3047 
3048     if (isCallValid)
3049     {
3050         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3051         InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3052         CaptureVertexAttrib2fv_v(glState, isCallValid, index, v, &vParam);
3053         paramBuffer.addParam(std::move(vParam));
3054     }
3055     else
3056     {
3057         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3058         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3059                        &vParam.value);
3060         paramBuffer.addParam(std::move(vParam));
3061     }
3062 
3063     return CallCapture(angle::EntryPoint::GLVertexAttrib2fv, std::move(paramBuffer));
3064 }
3065 
CaptureVertexAttrib3f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y,GLfloat z)3066 CallCapture CaptureVertexAttrib3f(const State &glState,
3067                                   bool isCallValid,
3068                                   GLuint index,
3069                                   GLfloat x,
3070                                   GLfloat y,
3071                                   GLfloat z)
3072 {
3073     ParamBuffer paramBuffer;
3074 
3075     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3076     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
3077     paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
3078     paramBuffer.addValueParam("z", ParamType::TGLfloat, z);
3079 
3080     return CallCapture(angle::EntryPoint::GLVertexAttrib3f, std::move(paramBuffer));
3081 }
3082 
CaptureVertexAttrib3fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)3083 CallCapture CaptureVertexAttrib3fv(const State &glState,
3084                                    bool isCallValid,
3085                                    GLuint index,
3086                                    const GLfloat *v)
3087 {
3088     ParamBuffer paramBuffer;
3089 
3090     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3091 
3092     if (isCallValid)
3093     {
3094         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3095         InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3096         CaptureVertexAttrib3fv_v(glState, isCallValid, index, v, &vParam);
3097         paramBuffer.addParam(std::move(vParam));
3098     }
3099     else
3100     {
3101         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3102         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3103                        &vParam.value);
3104         paramBuffer.addParam(std::move(vParam));
3105     }
3106 
3107     return CallCapture(angle::EntryPoint::GLVertexAttrib3fv, std::move(paramBuffer));
3108 }
3109 
CaptureVertexAttrib4f(const State & glState,bool isCallValid,GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)3110 CallCapture CaptureVertexAttrib4f(const State &glState,
3111                                   bool isCallValid,
3112                                   GLuint index,
3113                                   GLfloat x,
3114                                   GLfloat y,
3115                                   GLfloat z,
3116                                   GLfloat w)
3117 {
3118     ParamBuffer paramBuffer;
3119 
3120     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3121     paramBuffer.addValueParam("x", ParamType::TGLfloat, x);
3122     paramBuffer.addValueParam("y", ParamType::TGLfloat, y);
3123     paramBuffer.addValueParam("z", ParamType::TGLfloat, z);
3124     paramBuffer.addValueParam("w", ParamType::TGLfloat, w);
3125 
3126     return CallCapture(angle::EntryPoint::GLVertexAttrib4f, std::move(paramBuffer));
3127 }
3128 
CaptureVertexAttrib4fv(const State & glState,bool isCallValid,GLuint index,const GLfloat * v)3129 CallCapture CaptureVertexAttrib4fv(const State &glState,
3130                                    bool isCallValid,
3131                                    GLuint index,
3132                                    const GLfloat *v)
3133 {
3134     ParamBuffer paramBuffer;
3135 
3136     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3137 
3138     if (isCallValid)
3139     {
3140         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3141         InitParamValue(ParamType::TGLfloatConstPointer, v, &vParam.value);
3142         CaptureVertexAttrib4fv_v(glState, isCallValid, index, v, &vParam);
3143         paramBuffer.addParam(std::move(vParam));
3144     }
3145     else
3146     {
3147         ParamCapture vParam("v", ParamType::TGLfloatConstPointer);
3148         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
3149                        &vParam.value);
3150         paramBuffer.addParam(std::move(vParam));
3151     }
3152 
3153     return CallCapture(angle::EntryPoint::GLVertexAttrib4fv, std::move(paramBuffer));
3154 }
3155 
CaptureVertexAttribPointer(const State & glState,bool isCallValid,GLuint index,GLint size,VertexAttribType typePacked,GLboolean normalized,GLsizei stride,const void * pointer)3156 CallCapture CaptureVertexAttribPointer(const State &glState,
3157                                        bool isCallValid,
3158                                        GLuint index,
3159                                        GLint size,
3160                                        VertexAttribType typePacked,
3161                                        GLboolean normalized,
3162                                        GLsizei stride,
3163                                        const void *pointer)
3164 {
3165     ParamBuffer paramBuffer;
3166 
3167     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
3168     paramBuffer.addValueParam("size", ParamType::TGLint, size);
3169     paramBuffer.addValueParam("typePacked", ParamType::TVertexAttribType, typePacked);
3170     paramBuffer.addValueParam("normalized", ParamType::TGLboolean, normalized);
3171     paramBuffer.addValueParam("stride", ParamType::TGLsizei, stride);
3172 
3173     if (isCallValid)
3174     {
3175         ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
3176         InitParamValue(ParamType::TvoidConstPointer, pointer, &pointerParam.value);
3177         CaptureVertexAttribPointer_pointer(glState, isCallValid, index, size, typePacked,
3178                                            normalized, stride, pointer, &pointerParam);
3179         paramBuffer.addParam(std::move(pointerParam));
3180     }
3181     else
3182     {
3183         ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
3184         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
3185                        &pointerParam.value);
3186         paramBuffer.addParam(std::move(pointerParam));
3187     }
3188 
3189     return CallCapture(angle::EntryPoint::GLVertexAttribPointer, std::move(paramBuffer));
3190 }
3191 
CaptureViewport(const State & glState,bool isCallValid,GLint x,GLint y,GLsizei width,GLsizei height)3192 CallCapture CaptureViewport(const State &glState,
3193                             bool isCallValid,
3194                             GLint x,
3195                             GLint y,
3196                             GLsizei width,
3197                             GLsizei height)
3198 {
3199     ParamBuffer paramBuffer;
3200 
3201     paramBuffer.addValueParam("x", ParamType::TGLint, x);
3202     paramBuffer.addValueParam("y", ParamType::TGLint, y);
3203     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
3204     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
3205 
3206     return CallCapture(angle::EntryPoint::GLViewport, std::move(paramBuffer));
3207 }
3208 
3209 }  // namespace gl
3210