• 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_3_0_autogen.cpp:
9 //   Capture functions for the OpenGL ES 3.0 entry points.
10 
11 #include "libANGLE/capture/capture_gles_3_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/validationES3.h"
17 
18 using namespace angle;
19 
20 namespace gl
21 {
22 
CaptureBeginQuery(const State & glState,bool isCallValid,QueryType targetPacked,QueryID idPacked)23 CallCapture CaptureBeginQuery(const State &glState,
24                               bool isCallValid,
25                               QueryType targetPacked,
26                               QueryID idPacked)
27 {
28     ParamBuffer paramBuffer;
29 
30     paramBuffer.addValueParam("targetPacked", ParamType::TQueryType, targetPacked);
31     paramBuffer.addValueParam("idPacked", ParamType::TQueryID, idPacked);
32 
33     return CallCapture(angle::EntryPoint::GLBeginQuery, std::move(paramBuffer));
34 }
35 
CaptureBeginTransformFeedback(const State & glState,bool isCallValid,PrimitiveMode primitiveModePacked)36 CallCapture CaptureBeginTransformFeedback(const State &glState,
37                                           bool isCallValid,
38                                           PrimitiveMode primitiveModePacked)
39 {
40     ParamBuffer paramBuffer;
41 
42     paramBuffer.addValueParam("primitiveModePacked", ParamType::TPrimitiveMode,
43                               primitiveModePacked);
44 
45     return CallCapture(angle::EntryPoint::GLBeginTransformFeedback, std::move(paramBuffer));
46 }
47 
CaptureBindBufferBase(const State & glState,bool isCallValid,BufferBinding targetPacked,GLuint index,BufferID bufferPacked)48 CallCapture CaptureBindBufferBase(const State &glState,
49                                   bool isCallValid,
50                                   BufferBinding targetPacked,
51                                   GLuint index,
52                                   BufferID bufferPacked)
53 {
54     ParamBuffer paramBuffer;
55 
56     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
57     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
58     paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
59 
60     return CallCapture(angle::EntryPoint::GLBindBufferBase, std::move(paramBuffer));
61 }
62 
CaptureBindBufferRange(const State & glState,bool isCallValid,BufferBinding targetPacked,GLuint index,BufferID bufferPacked,GLintptr offset,GLsizeiptr size)63 CallCapture CaptureBindBufferRange(const State &glState,
64                                    bool isCallValid,
65                                    BufferBinding targetPacked,
66                                    GLuint index,
67                                    BufferID bufferPacked,
68                                    GLintptr offset,
69                                    GLsizeiptr size)
70 {
71     ParamBuffer paramBuffer;
72 
73     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
74     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
75     paramBuffer.addValueParam("bufferPacked", ParamType::TBufferID, bufferPacked);
76     paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
77     paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
78 
79     return CallCapture(angle::EntryPoint::GLBindBufferRange, std::move(paramBuffer));
80 }
81 
CaptureBindSampler(const State & glState,bool isCallValid,GLuint unit,SamplerID samplerPacked)82 CallCapture CaptureBindSampler(const State &glState,
83                                bool isCallValid,
84                                GLuint unit,
85                                SamplerID samplerPacked)
86 {
87     ParamBuffer paramBuffer;
88 
89     paramBuffer.addValueParam("unit", ParamType::TGLuint, unit);
90     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
91 
92     return CallCapture(angle::EntryPoint::GLBindSampler, std::move(paramBuffer));
93 }
94 
CaptureBindTransformFeedback(const State & glState,bool isCallValid,GLenum target,TransformFeedbackID idPacked)95 CallCapture CaptureBindTransformFeedback(const State &glState,
96                                          bool isCallValid,
97                                          GLenum target,
98                                          TransformFeedbackID idPacked)
99 {
100     ParamBuffer paramBuffer;
101 
102     paramBuffer.addEnumParam("target", GLenumGroup::BindTransformFeedbackTarget, ParamType::TGLenum,
103                              target);
104     paramBuffer.addValueParam("idPacked", ParamType::TTransformFeedbackID, idPacked);
105 
106     return CallCapture(angle::EntryPoint::GLBindTransformFeedback, std::move(paramBuffer));
107 }
108 
CaptureBindVertexArray(const State & glState,bool isCallValid,VertexArrayID arrayPacked)109 CallCapture CaptureBindVertexArray(const State &glState,
110                                    bool isCallValid,
111                                    VertexArrayID arrayPacked)
112 {
113     ParamBuffer paramBuffer;
114 
115     paramBuffer.addValueParam("arrayPacked", ParamType::TVertexArrayID, arrayPacked);
116 
117     return CallCapture(angle::EntryPoint::GLBindVertexArray, std::move(paramBuffer));
118 }
119 
CaptureBlitFramebuffer(const State & glState,bool isCallValid,GLint srcX0,GLint srcY0,GLint srcX1,GLint srcY1,GLint dstX0,GLint dstY0,GLint dstX1,GLint dstY1,GLbitfield mask,GLenum filter)120 CallCapture CaptureBlitFramebuffer(const State &glState,
121                                    bool isCallValid,
122                                    GLint srcX0,
123                                    GLint srcY0,
124                                    GLint srcX1,
125                                    GLint srcY1,
126                                    GLint dstX0,
127                                    GLint dstY0,
128                                    GLint dstX1,
129                                    GLint dstY1,
130                                    GLbitfield mask,
131                                    GLenum filter)
132 {
133     ParamBuffer paramBuffer;
134 
135     paramBuffer.addValueParam("srcX0", ParamType::TGLint, srcX0);
136     paramBuffer.addValueParam("srcY0", ParamType::TGLint, srcY0);
137     paramBuffer.addValueParam("srcX1", ParamType::TGLint, srcX1);
138     paramBuffer.addValueParam("srcY1", ParamType::TGLint, srcY1);
139     paramBuffer.addValueParam("dstX0", ParamType::TGLint, dstX0);
140     paramBuffer.addValueParam("dstY0", ParamType::TGLint, dstY0);
141     paramBuffer.addValueParam("dstX1", ParamType::TGLint, dstX1);
142     paramBuffer.addValueParam("dstY1", ParamType::TGLint, dstY1);
143     paramBuffer.addEnumParam("mask", GLenumGroup::ClearBufferMask, ParamType::TGLbitfield, mask);
144     paramBuffer.addEnumParam("filter", GLenumGroup::BlitFramebufferFilter, ParamType::TGLenum,
145                              filter);
146 
147     return CallCapture(angle::EntryPoint::GLBlitFramebuffer, std::move(paramBuffer));
148 }
149 
CaptureClearBufferfi(const State & glState,bool isCallValid,GLenum buffer,GLint drawbuffer,GLfloat depth,GLint stencil)150 CallCapture CaptureClearBufferfi(const State &glState,
151                                  bool isCallValid,
152                                  GLenum buffer,
153                                  GLint drawbuffer,
154                                  GLfloat depth,
155                                  GLint stencil)
156 {
157     ParamBuffer paramBuffer;
158 
159     paramBuffer.addEnumParam("buffer", GLenumGroup::Buffer, ParamType::TGLenum, buffer);
160     paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);
161     paramBuffer.addValueParam("depth", ParamType::TGLfloat, depth);
162     paramBuffer.addValueParam("stencil", ParamType::TGLint, stencil);
163 
164     return CallCapture(angle::EntryPoint::GLClearBufferfi, std::move(paramBuffer));
165 }
166 
CaptureClearBufferfv(const State & glState,bool isCallValid,GLenum buffer,GLint drawbuffer,const GLfloat * value)167 CallCapture CaptureClearBufferfv(const State &glState,
168                                  bool isCallValid,
169                                  GLenum buffer,
170                                  GLint drawbuffer,
171                                  const GLfloat *value)
172 {
173     ParamBuffer paramBuffer;
174 
175     paramBuffer.addEnumParam("buffer", GLenumGroup::Buffer, ParamType::TGLenum, buffer);
176     paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);
177 
178     if (isCallValid)
179     {
180         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
181         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
182         CaptureClearBufferfv_value(glState, isCallValid, buffer, drawbuffer, value, &valueParam);
183         paramBuffer.addParam(std::move(valueParam));
184     }
185     else
186     {
187         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
188         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
189                        &valueParam.value);
190         paramBuffer.addParam(std::move(valueParam));
191     }
192 
193     return CallCapture(angle::EntryPoint::GLClearBufferfv, std::move(paramBuffer));
194 }
195 
CaptureClearBufferiv(const State & glState,bool isCallValid,GLenum buffer,GLint drawbuffer,const GLint * value)196 CallCapture CaptureClearBufferiv(const State &glState,
197                                  bool isCallValid,
198                                  GLenum buffer,
199                                  GLint drawbuffer,
200                                  const GLint *value)
201 {
202     ParamBuffer paramBuffer;
203 
204     paramBuffer.addEnumParam("buffer", GLenumGroup::Buffer, ParamType::TGLenum, buffer);
205     paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);
206 
207     if (isCallValid)
208     {
209         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
210         InitParamValue(ParamType::TGLintConstPointer, value, &valueParam.value);
211         CaptureClearBufferiv_value(glState, isCallValid, buffer, drawbuffer, value, &valueParam);
212         paramBuffer.addParam(std::move(valueParam));
213     }
214     else
215     {
216         ParamCapture valueParam("value", ParamType::TGLintConstPointer);
217         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
218                        &valueParam.value);
219         paramBuffer.addParam(std::move(valueParam));
220     }
221 
222     return CallCapture(angle::EntryPoint::GLClearBufferiv, std::move(paramBuffer));
223 }
224 
CaptureClearBufferuiv(const State & glState,bool isCallValid,GLenum buffer,GLint drawbuffer,const GLuint * value)225 CallCapture CaptureClearBufferuiv(const State &glState,
226                                   bool isCallValid,
227                                   GLenum buffer,
228                                   GLint drawbuffer,
229                                   const GLuint *value)
230 {
231     ParamBuffer paramBuffer;
232 
233     paramBuffer.addEnumParam("buffer", GLenumGroup::Buffer, ParamType::TGLenum, buffer);
234     paramBuffer.addValueParam("drawbuffer", ParamType::TGLint, drawbuffer);
235 
236     if (isCallValid)
237     {
238         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
239         InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
240         CaptureClearBufferuiv_value(glState, isCallValid, buffer, drawbuffer, value, &valueParam);
241         paramBuffer.addParam(std::move(valueParam));
242     }
243     else
244     {
245         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
246         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
247                        &valueParam.value);
248         paramBuffer.addParam(std::move(valueParam));
249     }
250 
251     return CallCapture(angle::EntryPoint::GLClearBufferuiv, std::move(paramBuffer));
252 }
253 
CaptureClientWaitSync(const State & glState,bool isCallValid,GLsync sync,GLbitfield flags,GLuint64 timeout,GLenum returnValue)254 CallCapture CaptureClientWaitSync(const State &glState,
255                                   bool isCallValid,
256                                   GLsync sync,
257                                   GLbitfield flags,
258                                   GLuint64 timeout,
259                                   GLenum returnValue)
260 {
261     ParamBuffer paramBuffer;
262 
263     paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
264     paramBuffer.addEnumParam("flags", GLenumGroup::SyncObjectMask, ParamType::TGLbitfield, flags);
265     paramBuffer.addValueParam("timeout", ParamType::TGLuint64, timeout);
266 
267     ParamCapture returnValueCapture("returnValue", ParamType::TGLenum);
268     InitParamValue(ParamType::TGLenum, returnValue, &returnValueCapture.value);
269     paramBuffer.addReturnValue(std::move(returnValueCapture));
270 
271     return CallCapture(angle::EntryPoint::GLClientWaitSync, std::move(paramBuffer));
272 }
273 
CaptureCompressedTexImage3D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const void * data)274 CallCapture CaptureCompressedTexImage3D(const State &glState,
275                                         bool isCallValid,
276                                         TextureTarget targetPacked,
277                                         GLint level,
278                                         GLenum internalformat,
279                                         GLsizei width,
280                                         GLsizei height,
281                                         GLsizei depth,
282                                         GLint border,
283                                         GLsizei imageSize,
284                                         const void *data)
285 {
286     ParamBuffer paramBuffer;
287 
288     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
289     paramBuffer.addValueParam("level", ParamType::TGLint, level);
290     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
291                              internalformat);
292     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
293     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
294     paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
295     paramBuffer.addValueParam("border", ParamType::TGLint, border);
296     paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
297 
298     if (isCallValid)
299     {
300         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
301         InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
302         CaptureCompressedTexImage3D_data(glState, isCallValid, targetPacked, level, internalformat,
303                                          width, height, depth, border, imageSize, data, &dataParam);
304         paramBuffer.addParam(std::move(dataParam));
305     }
306     else
307     {
308         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
309         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
310                        &dataParam.value);
311         paramBuffer.addParam(std::move(dataParam));
312     }
313 
314     return CallCapture(angle::EntryPoint::GLCompressedTexImage3D, std::move(paramBuffer));
315 }
316 
CaptureCompressedTexSubImage3D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const void * data)317 CallCapture CaptureCompressedTexSubImage3D(const State &glState,
318                                            bool isCallValid,
319                                            TextureTarget targetPacked,
320                                            GLint level,
321                                            GLint xoffset,
322                                            GLint yoffset,
323                                            GLint zoffset,
324                                            GLsizei width,
325                                            GLsizei height,
326                                            GLsizei depth,
327                                            GLenum format,
328                                            GLsizei imageSize,
329                                            const void *data)
330 {
331     ParamBuffer paramBuffer;
332 
333     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
334     paramBuffer.addValueParam("level", ParamType::TGLint, level);
335     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
336     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
337     paramBuffer.addValueParam("zoffset", ParamType::TGLint, zoffset);
338     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
339     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
340     paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
341     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
342     paramBuffer.addValueParam("imageSize", ParamType::TGLsizei, imageSize);
343 
344     if (isCallValid)
345     {
346         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
347         InitParamValue(ParamType::TvoidConstPointer, data, &dataParam.value);
348         CaptureCompressedTexSubImage3D_data(glState, isCallValid, targetPacked, level, xoffset,
349                                             yoffset, zoffset, width, height, depth, format,
350                                             imageSize, data, &dataParam);
351         paramBuffer.addParam(std::move(dataParam));
352     }
353     else
354     {
355         ParamCapture dataParam("data", ParamType::TvoidConstPointer);
356         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
357                        &dataParam.value);
358         paramBuffer.addParam(std::move(dataParam));
359     }
360 
361     return CallCapture(angle::EntryPoint::GLCompressedTexSubImage3D, std::move(paramBuffer));
362 }
363 
CaptureCopyBufferSubData(const State & glState,bool isCallValid,BufferBinding readTargetPacked,BufferBinding writeTargetPacked,GLintptr readOffset,GLintptr writeOffset,GLsizeiptr size)364 CallCapture CaptureCopyBufferSubData(const State &glState,
365                                      bool isCallValid,
366                                      BufferBinding readTargetPacked,
367                                      BufferBinding writeTargetPacked,
368                                      GLintptr readOffset,
369                                      GLintptr writeOffset,
370                                      GLsizeiptr size)
371 {
372     ParamBuffer paramBuffer;
373 
374     paramBuffer.addValueParam("readTargetPacked", ParamType::TBufferBinding, readTargetPacked);
375     paramBuffer.addValueParam("writeTargetPacked", ParamType::TBufferBinding, writeTargetPacked);
376     paramBuffer.addValueParam("readOffset", ParamType::TGLintptr, readOffset);
377     paramBuffer.addValueParam("writeOffset", ParamType::TGLintptr, writeOffset);
378     paramBuffer.addValueParam("size", ParamType::TGLsizeiptr, size);
379 
380     return CallCapture(angle::EntryPoint::GLCopyBufferSubData, std::move(paramBuffer));
381 }
382 
CaptureCopyTexSubImage3D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLsizei height)383 CallCapture CaptureCopyTexSubImage3D(const State &glState,
384                                      bool isCallValid,
385                                      TextureTarget targetPacked,
386                                      GLint level,
387                                      GLint xoffset,
388                                      GLint yoffset,
389                                      GLint zoffset,
390                                      GLint x,
391                                      GLint y,
392                                      GLsizei width,
393                                      GLsizei height)
394 {
395     ParamBuffer paramBuffer;
396 
397     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
398     paramBuffer.addValueParam("level", ParamType::TGLint, level);
399     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
400     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
401     paramBuffer.addValueParam("zoffset", ParamType::TGLint, zoffset);
402     paramBuffer.addValueParam("x", ParamType::TGLint, x);
403     paramBuffer.addValueParam("y", ParamType::TGLint, y);
404     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
405     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
406 
407     return CallCapture(angle::EntryPoint::GLCopyTexSubImage3D, std::move(paramBuffer));
408 }
409 
CaptureDeleteQueries(const State & glState,bool isCallValid,GLsizei n,const QueryID * idsPacked)410 CallCapture CaptureDeleteQueries(const State &glState,
411                                  bool isCallValid,
412                                  GLsizei n,
413                                  const QueryID *idsPacked)
414 {
415     ParamBuffer paramBuffer;
416 
417     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
418 
419     if (isCallValid)
420     {
421         ParamCapture idsPackedParam("idsPacked", ParamType::TQueryIDConstPointer);
422         InitParamValue(ParamType::TQueryIDConstPointer, idsPacked, &idsPackedParam.value);
423         CaptureDeleteQueries_idsPacked(glState, isCallValid, n, idsPacked, &idsPackedParam);
424         paramBuffer.addParam(std::move(idsPackedParam));
425     }
426     else
427     {
428         ParamCapture idsPackedParam("idsPacked", ParamType::TQueryIDConstPointer);
429         InitParamValue(ParamType::TQueryIDConstPointer, static_cast<const QueryID *>(nullptr),
430                        &idsPackedParam.value);
431         paramBuffer.addParam(std::move(idsPackedParam));
432     }
433 
434     return CallCapture(angle::EntryPoint::GLDeleteQueries, std::move(paramBuffer));
435 }
436 
CaptureDeleteSamplers(const State & glState,bool isCallValid,GLsizei count,const SamplerID * samplersPacked)437 CallCapture CaptureDeleteSamplers(const State &glState,
438                                   bool isCallValid,
439                                   GLsizei count,
440                                   const SamplerID *samplersPacked)
441 {
442     ParamBuffer paramBuffer;
443 
444     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
445 
446     if (isCallValid)
447     {
448         ParamCapture samplersPackedParam("samplersPacked", ParamType::TSamplerIDConstPointer);
449         InitParamValue(ParamType::TSamplerIDConstPointer, samplersPacked,
450                        &samplersPackedParam.value);
451         CaptureDeleteSamplers_samplersPacked(glState, isCallValid, count, samplersPacked,
452                                              &samplersPackedParam);
453         paramBuffer.addParam(std::move(samplersPackedParam));
454     }
455     else
456     {
457         ParamCapture samplersPackedParam("samplersPacked", ParamType::TSamplerIDConstPointer);
458         InitParamValue(ParamType::TSamplerIDConstPointer, static_cast<const SamplerID *>(nullptr),
459                        &samplersPackedParam.value);
460         paramBuffer.addParam(std::move(samplersPackedParam));
461     }
462 
463     return CallCapture(angle::EntryPoint::GLDeleteSamplers, std::move(paramBuffer));
464 }
465 
CaptureDeleteSync(const State & glState,bool isCallValid,GLsync sync)466 CallCapture CaptureDeleteSync(const State &glState, bool isCallValid, GLsync sync)
467 {
468     ParamBuffer paramBuffer;
469 
470     paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
471 
472     return CallCapture(angle::EntryPoint::GLDeleteSync, std::move(paramBuffer));
473 }
474 
CaptureDeleteTransformFeedbacks(const State & glState,bool isCallValid,GLsizei n,const TransformFeedbackID * idsPacked)475 CallCapture CaptureDeleteTransformFeedbacks(const State &glState,
476                                             bool isCallValid,
477                                             GLsizei n,
478                                             const TransformFeedbackID *idsPacked)
479 {
480     ParamBuffer paramBuffer;
481 
482     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
483 
484     if (isCallValid)
485     {
486         ParamCapture idsPackedParam("idsPacked", ParamType::TTransformFeedbackIDConstPointer);
487         InitParamValue(ParamType::TTransformFeedbackIDConstPointer, idsPacked,
488                        &idsPackedParam.value);
489         CaptureDeleteTransformFeedbacks_idsPacked(glState, isCallValid, n, idsPacked,
490                                                   &idsPackedParam);
491         paramBuffer.addParam(std::move(idsPackedParam));
492     }
493     else
494     {
495         ParamCapture idsPackedParam("idsPacked", ParamType::TTransformFeedbackIDConstPointer);
496         InitParamValue(ParamType::TTransformFeedbackIDConstPointer,
497                        static_cast<const TransformFeedbackID *>(nullptr), &idsPackedParam.value);
498         paramBuffer.addParam(std::move(idsPackedParam));
499     }
500 
501     return CallCapture(angle::EntryPoint::GLDeleteTransformFeedbacks, std::move(paramBuffer));
502 }
503 
CaptureDeleteVertexArrays(const State & glState,bool isCallValid,GLsizei n,const VertexArrayID * arraysPacked)504 CallCapture CaptureDeleteVertexArrays(const State &glState,
505                                       bool isCallValid,
506                                       GLsizei n,
507                                       const VertexArrayID *arraysPacked)
508 {
509     ParamBuffer paramBuffer;
510 
511     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
512 
513     if (isCallValid)
514     {
515         ParamCapture arraysPackedParam("arraysPacked", ParamType::TVertexArrayIDConstPointer);
516         InitParamValue(ParamType::TVertexArrayIDConstPointer, arraysPacked,
517                        &arraysPackedParam.value);
518         CaptureDeleteVertexArrays_arraysPacked(glState, isCallValid, n, arraysPacked,
519                                                &arraysPackedParam);
520         paramBuffer.addParam(std::move(arraysPackedParam));
521     }
522     else
523     {
524         ParamCapture arraysPackedParam("arraysPacked", ParamType::TVertexArrayIDConstPointer);
525         InitParamValue(ParamType::TVertexArrayIDConstPointer,
526                        static_cast<const VertexArrayID *>(nullptr), &arraysPackedParam.value);
527         paramBuffer.addParam(std::move(arraysPackedParam));
528     }
529 
530     return CallCapture(angle::EntryPoint::GLDeleteVertexArrays, std::move(paramBuffer));
531 }
532 
CaptureDrawArraysInstanced(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLint first,GLsizei count,GLsizei instancecount)533 CallCapture CaptureDrawArraysInstanced(const State &glState,
534                                        bool isCallValid,
535                                        PrimitiveMode modePacked,
536                                        GLint first,
537                                        GLsizei count,
538                                        GLsizei instancecount)
539 {
540     ParamBuffer paramBuffer;
541 
542     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
543     paramBuffer.addValueParam("first", ParamType::TGLint, first);
544     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
545     paramBuffer.addValueParam("instancecount", ParamType::TGLsizei, instancecount);
546 
547     return CallCapture(angle::EntryPoint::GLDrawArraysInstanced, std::move(paramBuffer));
548 }
549 
CaptureDrawBuffers(const State & glState,bool isCallValid,GLsizei n,const GLenum * bufs)550 CallCapture CaptureDrawBuffers(const State &glState,
551                                bool isCallValid,
552                                GLsizei n,
553                                const GLenum *bufs)
554 {
555     ParamBuffer paramBuffer;
556 
557     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
558 
559     if (isCallValid)
560     {
561         ParamCapture bufsParam("bufs", ParamType::TGLenumConstPointer);
562         InitParamValue(ParamType::TGLenumConstPointer, bufs, &bufsParam.value);
563         CaptureDrawBuffers_bufs(glState, isCallValid, n, bufs, &bufsParam);
564         paramBuffer.addParam(std::move(bufsParam));
565     }
566     else
567     {
568         ParamCapture bufsParam("bufs", ParamType::TGLenumConstPointer);
569         InitParamValue(ParamType::TGLenumConstPointer, static_cast<const GLenum *>(nullptr),
570                        &bufsParam.value);
571         paramBuffer.addParam(std::move(bufsParam));
572     }
573 
574     return CallCapture(angle::EntryPoint::GLDrawBuffers, std::move(paramBuffer));
575 }
576 
CaptureDrawElementsInstanced(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLsizei count,DrawElementsType typePacked,const void * indices,GLsizei instancecount)577 CallCapture CaptureDrawElementsInstanced(const State &glState,
578                                          bool isCallValid,
579                                          PrimitiveMode modePacked,
580                                          GLsizei count,
581                                          DrawElementsType typePacked,
582                                          const void *indices,
583                                          GLsizei instancecount)
584 {
585     ParamBuffer paramBuffer;
586 
587     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
588     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
589     paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);
590 
591     if (isCallValid)
592     {
593         ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
594         InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
595         CaptureDrawElementsInstanced_indices(glState, isCallValid, modePacked, count, typePacked,
596                                              indices, instancecount, &indicesParam);
597         paramBuffer.addParam(std::move(indicesParam));
598     }
599     else
600     {
601         ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
602         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
603                        &indicesParam.value);
604         paramBuffer.addParam(std::move(indicesParam));
605     }
606 
607     paramBuffer.addValueParam("instancecount", ParamType::TGLsizei, instancecount);
608 
609     return CallCapture(angle::EntryPoint::GLDrawElementsInstanced, std::move(paramBuffer));
610 }
611 
CaptureDrawRangeElements(const State & glState,bool isCallValid,PrimitiveMode modePacked,GLuint start,GLuint end,GLsizei count,DrawElementsType typePacked,const void * indices)612 CallCapture CaptureDrawRangeElements(const State &glState,
613                                      bool isCallValid,
614                                      PrimitiveMode modePacked,
615                                      GLuint start,
616                                      GLuint end,
617                                      GLsizei count,
618                                      DrawElementsType typePacked,
619                                      const void *indices)
620 {
621     ParamBuffer paramBuffer;
622 
623     paramBuffer.addValueParam("modePacked", ParamType::TPrimitiveMode, modePacked);
624     paramBuffer.addValueParam("start", ParamType::TGLuint, start);
625     paramBuffer.addValueParam("end", ParamType::TGLuint, end);
626     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
627     paramBuffer.addValueParam("typePacked", ParamType::TDrawElementsType, typePacked);
628 
629     if (isCallValid)
630     {
631         ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
632         InitParamValue(ParamType::TvoidConstPointer, indices, &indicesParam.value);
633         CaptureDrawRangeElements_indices(glState, isCallValid, modePacked, start, end, count,
634                                          typePacked, indices, &indicesParam);
635         paramBuffer.addParam(std::move(indicesParam));
636     }
637     else
638     {
639         ParamCapture indicesParam("indices", ParamType::TvoidConstPointer);
640         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
641                        &indicesParam.value);
642         paramBuffer.addParam(std::move(indicesParam));
643     }
644 
645     return CallCapture(angle::EntryPoint::GLDrawRangeElements, std::move(paramBuffer));
646 }
647 
CaptureEndQuery(const State & glState,bool isCallValid,QueryType targetPacked)648 CallCapture CaptureEndQuery(const State &glState, bool isCallValid, QueryType targetPacked)
649 {
650     ParamBuffer paramBuffer;
651 
652     paramBuffer.addValueParam("targetPacked", ParamType::TQueryType, targetPacked);
653 
654     return CallCapture(angle::EntryPoint::GLEndQuery, std::move(paramBuffer));
655 }
656 
CaptureEndTransformFeedback(const State & glState,bool isCallValid)657 CallCapture CaptureEndTransformFeedback(const State &glState, bool isCallValid)
658 {
659     ParamBuffer paramBuffer;
660 
661     return CallCapture(angle::EntryPoint::GLEndTransformFeedback, std::move(paramBuffer));
662 }
663 
CaptureFenceSync(const State & glState,bool isCallValid,GLenum condition,GLbitfield flags,GLsync returnValue)664 CallCapture CaptureFenceSync(const State &glState,
665                              bool isCallValid,
666                              GLenum condition,
667                              GLbitfield flags,
668                              GLsync returnValue)
669 {
670     ParamBuffer paramBuffer;
671 
672     paramBuffer.addEnumParam("condition", GLenumGroup::SyncCondition, ParamType::TGLenum,
673                              condition);
674     paramBuffer.addEnumParam("flags", GLenumGroup::DefaultGroup, ParamType::TGLbitfield, flags);
675 
676     ParamCapture returnValueCapture("returnValue", ParamType::TGLsync);
677     InitParamValue(ParamType::TGLsync, returnValue, &returnValueCapture.value);
678     paramBuffer.addReturnValue(std::move(returnValueCapture));
679 
680     return CallCapture(angle::EntryPoint::GLFenceSync, std::move(paramBuffer));
681 }
682 
CaptureFlushMappedBufferRange(const State & glState,bool isCallValid,BufferBinding targetPacked,GLintptr offset,GLsizeiptr length)683 CallCapture CaptureFlushMappedBufferRange(const State &glState,
684                                           bool isCallValid,
685                                           BufferBinding targetPacked,
686                                           GLintptr offset,
687                                           GLsizeiptr length)
688 {
689     ParamBuffer paramBuffer;
690 
691     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
692     paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
693     paramBuffer.addValueParam("length", ParamType::TGLsizeiptr, length);
694 
695     return CallCapture(angle::EntryPoint::GLFlushMappedBufferRange, std::move(paramBuffer));
696 }
697 
CaptureFramebufferTextureLayer(const State & glState,bool isCallValid,GLenum target,GLenum attachment,TextureID texturePacked,GLint level,GLint layer)698 CallCapture CaptureFramebufferTextureLayer(const State &glState,
699                                            bool isCallValid,
700                                            GLenum target,
701                                            GLenum attachment,
702                                            TextureID texturePacked,
703                                            GLint level,
704                                            GLint layer)
705 {
706     ParamBuffer paramBuffer;
707 
708     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
709     paramBuffer.addEnumParam("attachment", GLenumGroup::FramebufferAttachment, ParamType::TGLenum,
710                              attachment);
711     paramBuffer.addValueParam("texturePacked", ParamType::TTextureID, texturePacked);
712     paramBuffer.addValueParam("level", ParamType::TGLint, level);
713     paramBuffer.addValueParam("layer", ParamType::TGLint, layer);
714 
715     return CallCapture(angle::EntryPoint::GLFramebufferTextureLayer, std::move(paramBuffer));
716 }
717 
CaptureGenQueries(const State & glState,bool isCallValid,GLsizei n,QueryID * idsPacked)718 CallCapture CaptureGenQueries(const State &glState, bool isCallValid, GLsizei n, QueryID *idsPacked)
719 {
720     ParamBuffer paramBuffer;
721 
722     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
723 
724     if (isCallValid)
725     {
726         ParamCapture idsPackedParam("idsPacked", ParamType::TQueryIDPointer);
727         InitParamValue(ParamType::TQueryIDPointer, idsPacked, &idsPackedParam.value);
728         CaptureGenQueries_idsPacked(glState, isCallValid, n, idsPacked, &idsPackedParam);
729         paramBuffer.addParam(std::move(idsPackedParam));
730     }
731     else
732     {
733         ParamCapture idsPackedParam("idsPacked", ParamType::TQueryIDPointer);
734         InitParamValue(ParamType::TQueryIDPointer, static_cast<QueryID *>(nullptr),
735                        &idsPackedParam.value);
736         paramBuffer.addParam(std::move(idsPackedParam));
737     }
738 
739     return CallCapture(angle::EntryPoint::GLGenQueries, std::move(paramBuffer));
740 }
741 
CaptureGenSamplers(const State & glState,bool isCallValid,GLsizei count,SamplerID * samplersPacked)742 CallCapture CaptureGenSamplers(const State &glState,
743                                bool isCallValid,
744                                GLsizei count,
745                                SamplerID *samplersPacked)
746 {
747     ParamBuffer paramBuffer;
748 
749     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
750 
751     if (isCallValid)
752     {
753         ParamCapture samplersPackedParam("samplersPacked", ParamType::TSamplerIDPointer);
754         InitParamValue(ParamType::TSamplerIDPointer, samplersPacked, &samplersPackedParam.value);
755         CaptureGenSamplers_samplersPacked(glState, isCallValid, count, samplersPacked,
756                                           &samplersPackedParam);
757         paramBuffer.addParam(std::move(samplersPackedParam));
758     }
759     else
760     {
761         ParamCapture samplersPackedParam("samplersPacked", ParamType::TSamplerIDPointer);
762         InitParamValue(ParamType::TSamplerIDPointer, static_cast<SamplerID *>(nullptr),
763                        &samplersPackedParam.value);
764         paramBuffer.addParam(std::move(samplersPackedParam));
765     }
766 
767     return CallCapture(angle::EntryPoint::GLGenSamplers, std::move(paramBuffer));
768 }
769 
CaptureGenTransformFeedbacks(const State & glState,bool isCallValid,GLsizei n,TransformFeedbackID * idsPacked)770 CallCapture CaptureGenTransformFeedbacks(const State &glState,
771                                          bool isCallValid,
772                                          GLsizei n,
773                                          TransformFeedbackID *idsPacked)
774 {
775     ParamBuffer paramBuffer;
776 
777     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
778 
779     if (isCallValid)
780     {
781         ParamCapture idsPackedParam("idsPacked", ParamType::TTransformFeedbackIDPointer);
782         InitParamValue(ParamType::TTransformFeedbackIDPointer, idsPacked, &idsPackedParam.value);
783         CaptureGenTransformFeedbacks_idsPacked(glState, isCallValid, n, idsPacked, &idsPackedParam);
784         paramBuffer.addParam(std::move(idsPackedParam));
785     }
786     else
787     {
788         ParamCapture idsPackedParam("idsPacked", ParamType::TTransformFeedbackIDPointer);
789         InitParamValue(ParamType::TTransformFeedbackIDPointer,
790                        static_cast<TransformFeedbackID *>(nullptr), &idsPackedParam.value);
791         paramBuffer.addParam(std::move(idsPackedParam));
792     }
793 
794     return CallCapture(angle::EntryPoint::GLGenTransformFeedbacks, std::move(paramBuffer));
795 }
796 
CaptureGenVertexArrays(const State & glState,bool isCallValid,GLsizei n,VertexArrayID * arraysPacked)797 CallCapture CaptureGenVertexArrays(const State &glState,
798                                    bool isCallValid,
799                                    GLsizei n,
800                                    VertexArrayID *arraysPacked)
801 {
802     ParamBuffer paramBuffer;
803 
804     paramBuffer.addValueParam("n", ParamType::TGLsizei, n);
805 
806     if (isCallValid)
807     {
808         ParamCapture arraysPackedParam("arraysPacked", ParamType::TVertexArrayIDPointer);
809         InitParamValue(ParamType::TVertexArrayIDPointer, arraysPacked, &arraysPackedParam.value);
810         CaptureGenVertexArrays_arraysPacked(glState, isCallValid, n, arraysPacked,
811                                             &arraysPackedParam);
812         paramBuffer.addParam(std::move(arraysPackedParam));
813     }
814     else
815     {
816         ParamCapture arraysPackedParam("arraysPacked", ParamType::TVertexArrayIDPointer);
817         InitParamValue(ParamType::TVertexArrayIDPointer, static_cast<VertexArrayID *>(nullptr),
818                        &arraysPackedParam.value);
819         paramBuffer.addParam(std::move(arraysPackedParam));
820     }
821 
822     return CallCapture(angle::EntryPoint::GLGenVertexArrays, std::move(paramBuffer));
823 }
824 
CaptureGetActiveUniformBlockName(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformBlockIndex uniformBlockIndexPacked,GLsizei bufSize,GLsizei * length,GLchar * uniformBlockName)825 CallCapture CaptureGetActiveUniformBlockName(const State &glState,
826                                              bool isCallValid,
827                                              ShaderProgramID programPacked,
828                                              UniformBlockIndex uniformBlockIndexPacked,
829                                              GLsizei bufSize,
830                                              GLsizei *length,
831                                              GLchar *uniformBlockName)
832 {
833     ParamBuffer paramBuffer;
834 
835     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
836     paramBuffer.addValueParam("uniformBlockIndexPacked", ParamType::TUniformBlockIndex,
837                               uniformBlockIndexPacked);
838     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
839 
840     if (isCallValid)
841     {
842         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
843         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
844         CaptureGetActiveUniformBlockName_length(glState, isCallValid, programPacked,
845                                                 uniformBlockIndexPacked, bufSize, length,
846                                                 uniformBlockName, &lengthParam);
847         paramBuffer.addParam(std::move(lengthParam));
848     }
849     else
850     {
851         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
852         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
853                        &lengthParam.value);
854         paramBuffer.addParam(std::move(lengthParam));
855     }
856 
857     if (isCallValid)
858     {
859         ParamCapture uniformBlockNameParam("uniformBlockName", ParamType::TGLcharPointer);
860         InitParamValue(ParamType::TGLcharPointer, uniformBlockName, &uniformBlockNameParam.value);
861         CaptureGetActiveUniformBlockName_uniformBlockName(glState, isCallValid, programPacked,
862                                                           uniformBlockIndexPacked, bufSize, length,
863                                                           uniformBlockName, &uniformBlockNameParam);
864         paramBuffer.addParam(std::move(uniformBlockNameParam));
865     }
866     else
867     {
868         ParamCapture uniformBlockNameParam("uniformBlockName", ParamType::TGLcharPointer);
869         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr),
870                        &uniformBlockNameParam.value);
871         paramBuffer.addParam(std::move(uniformBlockNameParam));
872     }
873 
874     return CallCapture(angle::EntryPoint::GLGetActiveUniformBlockName, std::move(paramBuffer));
875 }
876 
CaptureGetActiveUniformBlockiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformBlockIndex uniformBlockIndexPacked,GLenum pname,GLint * params)877 CallCapture CaptureGetActiveUniformBlockiv(const State &glState,
878                                            bool isCallValid,
879                                            ShaderProgramID programPacked,
880                                            UniformBlockIndex uniformBlockIndexPacked,
881                                            GLenum pname,
882                                            GLint *params)
883 {
884     ParamBuffer paramBuffer;
885 
886     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
887     paramBuffer.addValueParam("uniformBlockIndexPacked", ParamType::TUniformBlockIndex,
888                               uniformBlockIndexPacked);
889     paramBuffer.addEnumParam("pname", GLenumGroup::UniformBlockPName, ParamType::TGLenum, pname);
890 
891     if (isCallValid)
892     {
893         ParamCapture paramsParam("params", ParamType::TGLintPointer);
894         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
895         CaptureGetActiveUniformBlockiv_params(glState, isCallValid, programPacked,
896                                               uniformBlockIndexPacked, pname, params, &paramsParam);
897         paramBuffer.addParam(std::move(paramsParam));
898     }
899     else
900     {
901         ParamCapture paramsParam("params", ParamType::TGLintPointer);
902         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
903         paramBuffer.addParam(std::move(paramsParam));
904     }
905 
906     return CallCapture(angle::EntryPoint::GLGetActiveUniformBlockiv, std::move(paramBuffer));
907 }
908 
CaptureGetActiveUniformsiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei uniformCount,const GLuint * uniformIndices,GLenum pname,GLint * params)909 CallCapture CaptureGetActiveUniformsiv(const State &glState,
910                                        bool isCallValid,
911                                        ShaderProgramID programPacked,
912                                        GLsizei uniformCount,
913                                        const GLuint *uniformIndices,
914                                        GLenum pname,
915                                        GLint *params)
916 {
917     ParamBuffer paramBuffer;
918 
919     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
920     paramBuffer.addValueParam("uniformCount", ParamType::TGLsizei, uniformCount);
921 
922     if (isCallValid)
923     {
924         ParamCapture uniformIndicesParam("uniformIndices", ParamType::TGLuintConstPointer);
925         InitParamValue(ParamType::TGLuintConstPointer, uniformIndices, &uniformIndicesParam.value);
926         CaptureGetActiveUniformsiv_uniformIndices(glState, isCallValid, programPacked, uniformCount,
927                                                   uniformIndices, pname, params,
928                                                   &uniformIndicesParam);
929         paramBuffer.addParam(std::move(uniformIndicesParam));
930     }
931     else
932     {
933         ParamCapture uniformIndicesParam("uniformIndices", ParamType::TGLuintConstPointer);
934         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
935                        &uniformIndicesParam.value);
936         paramBuffer.addParam(std::move(uniformIndicesParam));
937     }
938 
939     paramBuffer.addEnumParam("pname", GLenumGroup::UniformPName, ParamType::TGLenum, pname);
940 
941     if (isCallValid)
942     {
943         ParamCapture paramsParam("params", ParamType::TGLintPointer);
944         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
945         CaptureGetActiveUniformsiv_params(glState, isCallValid, programPacked, uniformCount,
946                                           uniformIndices, pname, params, &paramsParam);
947         paramBuffer.addParam(std::move(paramsParam));
948     }
949     else
950     {
951         ParamCapture paramsParam("params", ParamType::TGLintPointer);
952         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
953         paramBuffer.addParam(std::move(paramsParam));
954     }
955 
956     return CallCapture(angle::EntryPoint::GLGetActiveUniformsiv, std::move(paramBuffer));
957 }
958 
CaptureGetBufferParameteri64v(const State & glState,bool isCallValid,BufferBinding targetPacked,GLenum pname,GLint64 * params)959 CallCapture CaptureGetBufferParameteri64v(const State &glState,
960                                           bool isCallValid,
961                                           BufferBinding targetPacked,
962                                           GLenum pname,
963                                           GLint64 *params)
964 {
965     ParamBuffer paramBuffer;
966 
967     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
968     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
969 
970     if (isCallValid)
971     {
972         ParamCapture paramsParam("params", ParamType::TGLint64Pointer);
973         InitParamValue(ParamType::TGLint64Pointer, params, &paramsParam.value);
974         CaptureGetBufferParameteri64v_params(glState, isCallValid, targetPacked, pname, params,
975                                              &paramsParam);
976         paramBuffer.addParam(std::move(paramsParam));
977     }
978     else
979     {
980         ParamCapture paramsParam("params", ParamType::TGLint64Pointer);
981         InitParamValue(ParamType::TGLint64Pointer, static_cast<GLint64 *>(nullptr),
982                        &paramsParam.value);
983         paramBuffer.addParam(std::move(paramsParam));
984     }
985 
986     return CallCapture(angle::EntryPoint::GLGetBufferParameteri64v, std::move(paramBuffer));
987 }
988 
CaptureGetBufferPointerv(const State & glState,bool isCallValid,BufferBinding targetPacked,GLenum pname,void ** params)989 CallCapture CaptureGetBufferPointerv(const State &glState,
990                                      bool isCallValid,
991                                      BufferBinding targetPacked,
992                                      GLenum pname,
993                                      void **params)
994 {
995     ParamBuffer paramBuffer;
996 
997     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
998     paramBuffer.addEnumParam("pname", GLenumGroup::DefaultGroup, ParamType::TGLenum, pname);
999 
1000     if (isCallValid)
1001     {
1002         ParamCapture paramsParam("params", ParamType::TvoidPointerPointer);
1003         InitParamValue(ParamType::TvoidPointerPointer, params, &paramsParam.value);
1004         CaptureGetBufferPointerv_params(glState, isCallValid, targetPacked, pname, params,
1005                                         &paramsParam);
1006         paramBuffer.addParam(std::move(paramsParam));
1007     }
1008     else
1009     {
1010         ParamCapture paramsParam("params", ParamType::TvoidPointerPointer);
1011         InitParamValue(ParamType::TvoidPointerPointer, static_cast<void **>(nullptr),
1012                        &paramsParam.value);
1013         paramBuffer.addParam(std::move(paramsParam));
1014     }
1015 
1016     return CallCapture(angle::EntryPoint::GLGetBufferPointerv, std::move(paramBuffer));
1017 }
1018 
CaptureGetFragDataLocation(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * name,GLint returnValue)1019 CallCapture CaptureGetFragDataLocation(const State &glState,
1020                                        bool isCallValid,
1021                                        ShaderProgramID programPacked,
1022                                        const GLchar *name,
1023                                        GLint returnValue)
1024 {
1025     ParamBuffer paramBuffer;
1026 
1027     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1028 
1029     if (isCallValid)
1030     {
1031         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1032         InitParamValue(ParamType::TGLcharConstPointer, name, &nameParam.value);
1033         CaptureGetFragDataLocation_name(glState, isCallValid, programPacked, name, &nameParam);
1034         paramBuffer.addParam(std::move(nameParam));
1035     }
1036     else
1037     {
1038         ParamCapture nameParam("name", ParamType::TGLcharConstPointer);
1039         InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
1040                        &nameParam.value);
1041         paramBuffer.addParam(std::move(nameParam));
1042     }
1043 
1044     ParamCapture returnValueCapture("returnValue", ParamType::TGLint);
1045     InitParamValue(ParamType::TGLint, returnValue, &returnValueCapture.value);
1046     paramBuffer.addReturnValue(std::move(returnValueCapture));
1047 
1048     return CallCapture(angle::EntryPoint::GLGetFragDataLocation, std::move(paramBuffer));
1049 }
1050 
CaptureGetInteger64i_v(const State & glState,bool isCallValid,GLenum target,GLuint index,GLint64 * data)1051 CallCapture CaptureGetInteger64i_v(const State &glState,
1052                                    bool isCallValid,
1053                                    GLenum target,
1054                                    GLuint index,
1055                                    GLint64 *data)
1056 {
1057     ParamBuffer paramBuffer;
1058 
1059     paramBuffer.addEnumParam("target", GLenumGroup::TypeEnum, ParamType::TGLenum, target);
1060     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1061 
1062     if (isCallValid)
1063     {
1064         ParamCapture dataParam("data", ParamType::TGLint64Pointer);
1065         InitParamValue(ParamType::TGLint64Pointer, data, &dataParam.value);
1066         CaptureGetInteger64i_v_data(glState, isCallValid, target, index, data, &dataParam);
1067         paramBuffer.addParam(std::move(dataParam));
1068     }
1069     else
1070     {
1071         ParamCapture dataParam("data", ParamType::TGLint64Pointer);
1072         InitParamValue(ParamType::TGLint64Pointer, static_cast<GLint64 *>(nullptr),
1073                        &dataParam.value);
1074         paramBuffer.addParam(std::move(dataParam));
1075     }
1076 
1077     return CallCapture(angle::EntryPoint::GLGetInteger64i_v, std::move(paramBuffer));
1078 }
1079 
CaptureGetInteger64v(const State & glState,bool isCallValid,GLenum pname,GLint64 * data)1080 CallCapture CaptureGetInteger64v(const State &glState,
1081                                  bool isCallValid,
1082                                  GLenum pname,
1083                                  GLint64 *data)
1084 {
1085     ParamBuffer paramBuffer;
1086 
1087     paramBuffer.addEnumParam("pname", GLenumGroup::GetPName, ParamType::TGLenum, pname);
1088 
1089     if (isCallValid)
1090     {
1091         ParamCapture dataParam("data", ParamType::TGLint64Pointer);
1092         InitParamValue(ParamType::TGLint64Pointer, data, &dataParam.value);
1093         CaptureGetInteger64v_data(glState, isCallValid, pname, data, &dataParam);
1094         paramBuffer.addParam(std::move(dataParam));
1095     }
1096     else
1097     {
1098         ParamCapture dataParam("data", ParamType::TGLint64Pointer);
1099         InitParamValue(ParamType::TGLint64Pointer, static_cast<GLint64 *>(nullptr),
1100                        &dataParam.value);
1101         paramBuffer.addParam(std::move(dataParam));
1102     }
1103 
1104     return CallCapture(angle::EntryPoint::GLGetInteger64v, std::move(paramBuffer));
1105 }
1106 
CaptureGetIntegeri_v(const State & glState,bool isCallValid,GLenum target,GLuint index,GLint * data)1107 CallCapture CaptureGetIntegeri_v(const State &glState,
1108                                  bool isCallValid,
1109                                  GLenum target,
1110                                  GLuint index,
1111                                  GLint *data)
1112 {
1113     ParamBuffer paramBuffer;
1114 
1115     paramBuffer.addEnumParam("target", GLenumGroup::TypeEnum, ParamType::TGLenum, target);
1116     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1117 
1118     if (isCallValid)
1119     {
1120         ParamCapture dataParam("data", ParamType::TGLintPointer);
1121         InitParamValue(ParamType::TGLintPointer, data, &dataParam.value);
1122         CaptureGetIntegeri_v_data(glState, isCallValid, target, index, data, &dataParam);
1123         paramBuffer.addParam(std::move(dataParam));
1124     }
1125     else
1126     {
1127         ParamCapture dataParam("data", ParamType::TGLintPointer);
1128         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &dataParam.value);
1129         paramBuffer.addParam(std::move(dataParam));
1130     }
1131 
1132     return CallCapture(angle::EntryPoint::GLGetIntegeri_v, std::move(paramBuffer));
1133 }
1134 
CaptureGetInternalformativ(const State & glState,bool isCallValid,GLenum target,GLenum internalformat,GLenum pname,GLsizei bufSize,GLint * params)1135 CallCapture CaptureGetInternalformativ(const State &glState,
1136                                        bool isCallValid,
1137                                        GLenum target,
1138                                        GLenum internalformat,
1139                                        GLenum pname,
1140                                        GLsizei bufSize,
1141                                        GLint *params)
1142 {
1143     ParamBuffer paramBuffer;
1144 
1145     paramBuffer.addEnumParam("target", GLenumGroup::TextureTarget, ParamType::TGLenum, target);
1146     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
1147                              internalformat);
1148     paramBuffer.addEnumParam("pname", GLenumGroup::InternalFormatPName, ParamType::TGLenum, pname);
1149     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1150 
1151     if (isCallValid)
1152     {
1153         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1154         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1155         CaptureGetInternalformativ_params(glState, isCallValid, target, internalformat, pname,
1156                                           bufSize, params, &paramsParam);
1157         paramBuffer.addParam(std::move(paramsParam));
1158     }
1159     else
1160     {
1161         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1162         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1163         paramBuffer.addParam(std::move(paramsParam));
1164     }
1165 
1166     return CallCapture(angle::EntryPoint::GLGetInternalformativ, std::move(paramBuffer));
1167 }
1168 
CaptureGetProgramBinary(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei bufSize,GLsizei * length,GLenum * binaryFormat,void * binary)1169 CallCapture CaptureGetProgramBinary(const State &glState,
1170                                     bool isCallValid,
1171                                     ShaderProgramID programPacked,
1172                                     GLsizei bufSize,
1173                                     GLsizei *length,
1174                                     GLenum *binaryFormat,
1175                                     void *binary)
1176 {
1177     ParamBuffer paramBuffer;
1178 
1179     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1180     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1181 
1182     if (isCallValid)
1183     {
1184         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1185         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1186         CaptureGetProgramBinary_length(glState, isCallValid, programPacked, bufSize, length,
1187                                        binaryFormat, binary, &lengthParam);
1188         paramBuffer.addParam(std::move(lengthParam));
1189     }
1190     else
1191     {
1192         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1193         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1194                        &lengthParam.value);
1195         paramBuffer.addParam(std::move(lengthParam));
1196     }
1197 
1198     if (isCallValid)
1199     {
1200         ParamCapture binaryFormatParam("binaryFormat", ParamType::TGLenumPointer);
1201         InitParamValue(ParamType::TGLenumPointer, binaryFormat, &binaryFormatParam.value);
1202         CaptureGetProgramBinary_binaryFormat(glState, isCallValid, programPacked, bufSize, length,
1203                                              binaryFormat, binary, &binaryFormatParam);
1204         paramBuffer.addParam(std::move(binaryFormatParam));
1205     }
1206     else
1207     {
1208         ParamCapture binaryFormatParam("binaryFormat", ParamType::TGLenumPointer);
1209         InitParamValue(ParamType::TGLenumPointer, static_cast<GLenum *>(nullptr),
1210                        &binaryFormatParam.value);
1211         paramBuffer.addParam(std::move(binaryFormatParam));
1212     }
1213 
1214     if (isCallValid)
1215     {
1216         ParamCapture binaryParam("binary", ParamType::TvoidPointer);
1217         InitParamValue(ParamType::TvoidPointer, binary, &binaryParam.value);
1218         CaptureGetProgramBinary_binary(glState, isCallValid, programPacked, bufSize, length,
1219                                        binaryFormat, binary, &binaryParam);
1220         paramBuffer.addParam(std::move(binaryParam));
1221     }
1222     else
1223     {
1224         ParamCapture binaryParam("binary", ParamType::TvoidPointer);
1225         InitParamValue(ParamType::TvoidPointer, static_cast<void *>(nullptr), &binaryParam.value);
1226         paramBuffer.addParam(std::move(binaryParam));
1227     }
1228 
1229     return CallCapture(angle::EntryPoint::GLGetProgramBinary, std::move(paramBuffer));
1230 }
1231 
CaptureGetQueryObjectuiv(const State & glState,bool isCallValid,QueryID idPacked,GLenum pname,GLuint * params)1232 CallCapture CaptureGetQueryObjectuiv(const State &glState,
1233                                      bool isCallValid,
1234                                      QueryID idPacked,
1235                                      GLenum pname,
1236                                      GLuint *params)
1237 {
1238     ParamBuffer paramBuffer;
1239 
1240     paramBuffer.addValueParam("idPacked", ParamType::TQueryID, idPacked);
1241     paramBuffer.addEnumParam("pname", GLenumGroup::QueryObjectParameterName, ParamType::TGLenum,
1242                              pname);
1243 
1244     if (isCallValid)
1245     {
1246         ParamCapture paramsParam("params", ParamType::TGLuintPointer);
1247         InitParamValue(ParamType::TGLuintPointer, params, &paramsParam.value);
1248         CaptureGetQueryObjectuiv_params(glState, isCallValid, idPacked, pname, params,
1249                                         &paramsParam);
1250         paramBuffer.addParam(std::move(paramsParam));
1251     }
1252     else
1253     {
1254         ParamCapture paramsParam("params", ParamType::TGLuintPointer);
1255         InitParamValue(ParamType::TGLuintPointer, static_cast<GLuint *>(nullptr),
1256                        &paramsParam.value);
1257         paramBuffer.addParam(std::move(paramsParam));
1258     }
1259 
1260     return CallCapture(angle::EntryPoint::GLGetQueryObjectuiv, std::move(paramBuffer));
1261 }
1262 
CaptureGetQueryiv(const State & glState,bool isCallValid,QueryType targetPacked,GLenum pname,GLint * params)1263 CallCapture CaptureGetQueryiv(const State &glState,
1264                               bool isCallValid,
1265                               QueryType targetPacked,
1266                               GLenum pname,
1267                               GLint *params)
1268 {
1269     ParamBuffer paramBuffer;
1270 
1271     paramBuffer.addValueParam("targetPacked", ParamType::TQueryType, targetPacked);
1272     paramBuffer.addEnumParam("pname", GLenumGroup::QueryParameterName, ParamType::TGLenum, pname);
1273 
1274     if (isCallValid)
1275     {
1276         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1277         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1278         CaptureGetQueryiv_params(glState, isCallValid, targetPacked, pname, params, &paramsParam);
1279         paramBuffer.addParam(std::move(paramsParam));
1280     }
1281     else
1282     {
1283         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1284         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1285         paramBuffer.addParam(std::move(paramsParam));
1286     }
1287 
1288     return CallCapture(angle::EntryPoint::GLGetQueryiv, std::move(paramBuffer));
1289 }
1290 
CaptureGetSamplerParameterfv(const State & glState,bool isCallValid,SamplerID samplerPacked,GLenum pname,GLfloat * params)1291 CallCapture CaptureGetSamplerParameterfv(const State &glState,
1292                                          bool isCallValid,
1293                                          SamplerID samplerPacked,
1294                                          GLenum pname,
1295                                          GLfloat *params)
1296 {
1297     ParamBuffer paramBuffer;
1298 
1299     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
1300     paramBuffer.addEnumParam("pname", GLenumGroup::SamplerParameterName, ParamType::TGLenum, pname);
1301 
1302     if (isCallValid)
1303     {
1304         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1305         InitParamValue(ParamType::TGLfloatPointer, params, &paramsParam.value);
1306         CaptureGetSamplerParameterfv_params(glState, isCallValid, samplerPacked, pname, params,
1307                                             &paramsParam);
1308         paramBuffer.addParam(std::move(paramsParam));
1309     }
1310     else
1311     {
1312         ParamCapture paramsParam("params", ParamType::TGLfloatPointer);
1313         InitParamValue(ParamType::TGLfloatPointer, static_cast<GLfloat *>(nullptr),
1314                        &paramsParam.value);
1315         paramBuffer.addParam(std::move(paramsParam));
1316     }
1317 
1318     return CallCapture(angle::EntryPoint::GLGetSamplerParameterfv, std::move(paramBuffer));
1319 }
1320 
CaptureGetSamplerParameteriv(const State & glState,bool isCallValid,SamplerID samplerPacked,GLenum pname,GLint * params)1321 CallCapture CaptureGetSamplerParameteriv(const State &glState,
1322                                          bool isCallValid,
1323                                          SamplerID samplerPacked,
1324                                          GLenum pname,
1325                                          GLint *params)
1326 {
1327     ParamBuffer paramBuffer;
1328 
1329     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
1330     paramBuffer.addEnumParam("pname", GLenumGroup::SamplerParameterName, ParamType::TGLenum, pname);
1331 
1332     if (isCallValid)
1333     {
1334         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1335         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1336         CaptureGetSamplerParameteriv_params(glState, isCallValid, samplerPacked, pname, params,
1337                                             &paramsParam);
1338         paramBuffer.addParam(std::move(paramsParam));
1339     }
1340     else
1341     {
1342         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1343         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1344         paramBuffer.addParam(std::move(paramsParam));
1345     }
1346 
1347     return CallCapture(angle::EntryPoint::GLGetSamplerParameteriv, std::move(paramBuffer));
1348 }
1349 
CaptureGetStringi(const State & glState,bool isCallValid,GLenum name,GLuint index,const GLubyte * returnValue)1350 CallCapture CaptureGetStringi(const State &glState,
1351                               bool isCallValid,
1352                               GLenum name,
1353                               GLuint index,
1354                               const GLubyte *returnValue)
1355 {
1356     ParamBuffer paramBuffer;
1357 
1358     paramBuffer.addEnumParam("name", GLenumGroup::StringName, ParamType::TGLenum, name);
1359     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1360 
1361     ParamCapture returnValueCapture("returnValue", ParamType::TGLubyteConstPointer);
1362     InitParamValue(ParamType::TGLubyteConstPointer, returnValue, &returnValueCapture.value);
1363     paramBuffer.addReturnValue(std::move(returnValueCapture));
1364 
1365     return CallCapture(angle::EntryPoint::GLGetStringi, std::move(paramBuffer));
1366 }
1367 
CaptureGetSynciv(const State & glState,bool isCallValid,GLsync sync,GLenum pname,GLsizei bufSize,GLsizei * length,GLint * values)1368 CallCapture CaptureGetSynciv(const State &glState,
1369                              bool isCallValid,
1370                              GLsync sync,
1371                              GLenum pname,
1372                              GLsizei bufSize,
1373                              GLsizei *length,
1374                              GLint *values)
1375 {
1376     ParamBuffer paramBuffer;
1377 
1378     paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
1379     paramBuffer.addEnumParam("pname", GLenumGroup::SyncParameterName, ParamType::TGLenum, pname);
1380     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1381 
1382     if (isCallValid)
1383     {
1384         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1385         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1386         CaptureGetSynciv_length(glState, isCallValid, sync, pname, bufSize, length, values,
1387                                 &lengthParam);
1388         paramBuffer.addParam(std::move(lengthParam));
1389     }
1390     else
1391     {
1392         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1393         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1394                        &lengthParam.value);
1395         paramBuffer.addParam(std::move(lengthParam));
1396     }
1397 
1398     if (isCallValid)
1399     {
1400         ParamCapture valuesParam("values", ParamType::TGLintPointer);
1401         InitParamValue(ParamType::TGLintPointer, values, &valuesParam.value);
1402         CaptureGetSynciv_values(glState, isCallValid, sync, pname, bufSize, length, values,
1403                                 &valuesParam);
1404         paramBuffer.addParam(std::move(valuesParam));
1405     }
1406     else
1407     {
1408         ParamCapture valuesParam("values", ParamType::TGLintPointer);
1409         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &valuesParam.value);
1410         paramBuffer.addParam(std::move(valuesParam));
1411     }
1412 
1413     return CallCapture(angle::EntryPoint::GLGetSynciv, std::move(paramBuffer));
1414 }
1415 
CaptureGetTransformFeedbackVarying(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLuint index,GLsizei bufSize,GLsizei * length,GLsizei * size,GLenum * type,GLchar * name)1416 CallCapture CaptureGetTransformFeedbackVarying(const State &glState,
1417                                                bool isCallValid,
1418                                                ShaderProgramID programPacked,
1419                                                GLuint index,
1420                                                GLsizei bufSize,
1421                                                GLsizei *length,
1422                                                GLsizei *size,
1423                                                GLenum *type,
1424                                                GLchar *name)
1425 {
1426     ParamBuffer paramBuffer;
1427 
1428     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1429     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1430     paramBuffer.addValueParam("bufSize", ParamType::TGLsizei, bufSize);
1431 
1432     if (isCallValid)
1433     {
1434         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1435         InitParamValue(ParamType::TGLsizeiPointer, length, &lengthParam.value);
1436         CaptureGetTransformFeedbackVarying_length(glState, isCallValid, programPacked, index,
1437                                                   bufSize, length, size, type, name, &lengthParam);
1438         paramBuffer.addParam(std::move(lengthParam));
1439     }
1440     else
1441     {
1442         ParamCapture lengthParam("length", ParamType::TGLsizeiPointer);
1443         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1444                        &lengthParam.value);
1445         paramBuffer.addParam(std::move(lengthParam));
1446     }
1447 
1448     if (isCallValid)
1449     {
1450         ParamCapture sizeParam("size", ParamType::TGLsizeiPointer);
1451         InitParamValue(ParamType::TGLsizeiPointer, size, &sizeParam.value);
1452         CaptureGetTransformFeedbackVarying_size(glState, isCallValid, programPacked, index, bufSize,
1453                                                 length, size, type, name, &sizeParam);
1454         paramBuffer.addParam(std::move(sizeParam));
1455     }
1456     else
1457     {
1458         ParamCapture sizeParam("size", ParamType::TGLsizeiPointer);
1459         InitParamValue(ParamType::TGLsizeiPointer, static_cast<GLsizei *>(nullptr),
1460                        &sizeParam.value);
1461         paramBuffer.addParam(std::move(sizeParam));
1462     }
1463 
1464     if (isCallValid)
1465     {
1466         ParamCapture typeParam("type", ParamType::TGLenumPointer);
1467         InitParamValue(ParamType::TGLenumPointer, type, &typeParam.value);
1468         CaptureGetTransformFeedbackVarying_type(glState, isCallValid, programPacked, index, bufSize,
1469                                                 length, size, type, name, &typeParam);
1470         paramBuffer.addParam(std::move(typeParam));
1471     }
1472     else
1473     {
1474         ParamCapture typeParam("type", ParamType::TGLenumPointer);
1475         InitParamValue(ParamType::TGLenumPointer, static_cast<GLenum *>(nullptr), &typeParam.value);
1476         paramBuffer.addParam(std::move(typeParam));
1477     }
1478 
1479     if (isCallValid)
1480     {
1481         ParamCapture nameParam("name", ParamType::TGLcharPointer);
1482         InitParamValue(ParamType::TGLcharPointer, name, &nameParam.value);
1483         CaptureGetTransformFeedbackVarying_name(glState, isCallValid, programPacked, index, bufSize,
1484                                                 length, size, type, name, &nameParam);
1485         paramBuffer.addParam(std::move(nameParam));
1486     }
1487     else
1488     {
1489         ParamCapture nameParam("name", ParamType::TGLcharPointer);
1490         InitParamValue(ParamType::TGLcharPointer, static_cast<GLchar *>(nullptr), &nameParam.value);
1491         paramBuffer.addParam(std::move(nameParam));
1492     }
1493 
1494     return CallCapture(angle::EntryPoint::GLGetTransformFeedbackVarying, std::move(paramBuffer));
1495 }
1496 
CaptureGetUniformBlockIndex(const State & glState,bool isCallValid,ShaderProgramID programPacked,const GLchar * uniformBlockName,GLuint returnValue)1497 CallCapture CaptureGetUniformBlockIndex(const State &glState,
1498                                         bool isCallValid,
1499                                         ShaderProgramID programPacked,
1500                                         const GLchar *uniformBlockName,
1501                                         GLuint returnValue)
1502 {
1503     ParamBuffer paramBuffer;
1504 
1505     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1506 
1507     if (isCallValid)
1508     {
1509         ParamCapture uniformBlockNameParam("uniformBlockName", ParamType::TGLcharConstPointer);
1510         InitParamValue(ParamType::TGLcharConstPointer, uniformBlockName,
1511                        &uniformBlockNameParam.value);
1512         CaptureGetUniformBlockIndex_uniformBlockName(glState, isCallValid, programPacked,
1513                                                      uniformBlockName, &uniformBlockNameParam);
1514         paramBuffer.addParam(std::move(uniformBlockNameParam));
1515     }
1516     else
1517     {
1518         ParamCapture uniformBlockNameParam("uniformBlockName", ParamType::TGLcharConstPointer);
1519         InitParamValue(ParamType::TGLcharConstPointer, static_cast<const GLchar *>(nullptr),
1520                        &uniformBlockNameParam.value);
1521         paramBuffer.addParam(std::move(uniformBlockNameParam));
1522     }
1523 
1524     ParamCapture returnValueCapture("returnValue", ParamType::TGLuint);
1525     InitParamValue(ParamType::TGLuint, returnValue, &returnValueCapture.value);
1526     paramBuffer.addReturnValue(std::move(returnValueCapture));
1527 
1528     return CallCapture(angle::EntryPoint::GLGetUniformBlockIndex, std::move(paramBuffer));
1529 }
1530 
CaptureGetUniformIndices(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei uniformCount,const GLchar * const * uniformNames,GLuint * uniformIndices)1531 CallCapture CaptureGetUniformIndices(const State &glState,
1532                                      bool isCallValid,
1533                                      ShaderProgramID programPacked,
1534                                      GLsizei uniformCount,
1535                                      const GLchar *const *uniformNames,
1536                                      GLuint *uniformIndices)
1537 {
1538     ParamBuffer paramBuffer;
1539 
1540     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1541     paramBuffer.addValueParam("uniformCount", ParamType::TGLsizei, uniformCount);
1542 
1543     if (isCallValid)
1544     {
1545         ParamCapture uniformNamesParam("uniformNames", ParamType::TGLcharConstPointerPointer);
1546         InitParamValue(ParamType::TGLcharConstPointerPointer, uniformNames,
1547                        &uniformNamesParam.value);
1548         CaptureGetUniformIndices_uniformNames(glState, isCallValid, programPacked, uniformCount,
1549                                               uniformNames, uniformIndices, &uniformNamesParam);
1550         paramBuffer.addParam(std::move(uniformNamesParam));
1551     }
1552     else
1553     {
1554         ParamCapture uniformNamesParam("uniformNames", ParamType::TGLcharConstPointerPointer);
1555         InitParamValue(ParamType::TGLcharConstPointerPointer,
1556                        static_cast<const GLchar *const *>(nullptr), &uniformNamesParam.value);
1557         paramBuffer.addParam(std::move(uniformNamesParam));
1558     }
1559 
1560     if (isCallValid)
1561     {
1562         ParamCapture uniformIndicesParam("uniformIndices", ParamType::TGLuintPointer);
1563         InitParamValue(ParamType::TGLuintPointer, uniformIndices, &uniformIndicesParam.value);
1564         CaptureGetUniformIndices_uniformIndices(glState, isCallValid, programPacked, uniformCount,
1565                                                 uniformNames, uniformIndices, &uniformIndicesParam);
1566         paramBuffer.addParam(std::move(uniformIndicesParam));
1567     }
1568     else
1569     {
1570         ParamCapture uniformIndicesParam("uniformIndices", ParamType::TGLuintPointer);
1571         InitParamValue(ParamType::TGLuintPointer, static_cast<GLuint *>(nullptr),
1572                        &uniformIndicesParam.value);
1573         paramBuffer.addParam(std::move(uniformIndicesParam));
1574     }
1575 
1576     return CallCapture(angle::EntryPoint::GLGetUniformIndices, std::move(paramBuffer));
1577 }
1578 
CaptureGetUniformuiv(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformLocation locationPacked,GLuint * params)1579 CallCapture CaptureGetUniformuiv(const State &glState,
1580                                  bool isCallValid,
1581                                  ShaderProgramID programPacked,
1582                                  UniformLocation locationPacked,
1583                                  GLuint *params)
1584 {
1585     ParamBuffer paramBuffer;
1586 
1587     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1588     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
1589 
1590     if (isCallValid)
1591     {
1592         ParamCapture paramsParam("params", ParamType::TGLuintPointer);
1593         InitParamValue(ParamType::TGLuintPointer, params, &paramsParam.value);
1594         CaptureGetUniformuiv_params(glState, isCallValid, programPacked, locationPacked, params,
1595                                     &paramsParam);
1596         paramBuffer.addParam(std::move(paramsParam));
1597     }
1598     else
1599     {
1600         ParamCapture paramsParam("params", ParamType::TGLuintPointer);
1601         InitParamValue(ParamType::TGLuintPointer, static_cast<GLuint *>(nullptr),
1602                        &paramsParam.value);
1603         paramBuffer.addParam(std::move(paramsParam));
1604     }
1605 
1606     return CallCapture(angle::EntryPoint::GLGetUniformuiv, std::move(paramBuffer));
1607 }
1608 
CaptureGetVertexAttribIiv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLint * params)1609 CallCapture CaptureGetVertexAttribIiv(const State &glState,
1610                                       bool isCallValid,
1611                                       GLuint index,
1612                                       GLenum pname,
1613                                       GLint *params)
1614 {
1615     ParamBuffer paramBuffer;
1616 
1617     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1618     paramBuffer.addEnumParam("pname", GLenumGroup::VertexAttribEnum, ParamType::TGLenum, pname);
1619 
1620     if (isCallValid)
1621     {
1622         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1623         InitParamValue(ParamType::TGLintPointer, params, &paramsParam.value);
1624         CaptureGetVertexAttribIiv_params(glState, isCallValid, index, pname, params, &paramsParam);
1625         paramBuffer.addParam(std::move(paramsParam));
1626     }
1627     else
1628     {
1629         ParamCapture paramsParam("params", ParamType::TGLintPointer);
1630         InitParamValue(ParamType::TGLintPointer, static_cast<GLint *>(nullptr), &paramsParam.value);
1631         paramBuffer.addParam(std::move(paramsParam));
1632     }
1633 
1634     return CallCapture(angle::EntryPoint::GLGetVertexAttribIiv, std::move(paramBuffer));
1635 }
1636 
CaptureGetVertexAttribIuiv(const State & glState,bool isCallValid,GLuint index,GLenum pname,GLuint * params)1637 CallCapture CaptureGetVertexAttribIuiv(const State &glState,
1638                                        bool isCallValid,
1639                                        GLuint index,
1640                                        GLenum pname,
1641                                        GLuint *params)
1642 {
1643     ParamBuffer paramBuffer;
1644 
1645     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
1646     paramBuffer.addEnumParam("pname", GLenumGroup::VertexAttribEnum, ParamType::TGLenum, pname);
1647 
1648     if (isCallValid)
1649     {
1650         ParamCapture paramsParam("params", ParamType::TGLuintPointer);
1651         InitParamValue(ParamType::TGLuintPointer, params, &paramsParam.value);
1652         CaptureGetVertexAttribIuiv_params(glState, isCallValid, index, pname, params, &paramsParam);
1653         paramBuffer.addParam(std::move(paramsParam));
1654     }
1655     else
1656     {
1657         ParamCapture paramsParam("params", ParamType::TGLuintPointer);
1658         InitParamValue(ParamType::TGLuintPointer, static_cast<GLuint *>(nullptr),
1659                        &paramsParam.value);
1660         paramBuffer.addParam(std::move(paramsParam));
1661     }
1662 
1663     return CallCapture(angle::EntryPoint::GLGetVertexAttribIuiv, std::move(paramBuffer));
1664 }
1665 
CaptureInvalidateFramebuffer(const State & glState,bool isCallValid,GLenum target,GLsizei numAttachments,const GLenum * attachments)1666 CallCapture CaptureInvalidateFramebuffer(const State &glState,
1667                                          bool isCallValid,
1668                                          GLenum target,
1669                                          GLsizei numAttachments,
1670                                          const GLenum *attachments)
1671 {
1672     ParamBuffer paramBuffer;
1673 
1674     paramBuffer.addEnumParam("target", GLenumGroup::FramebufferTarget, ParamType::TGLenum, target);
1675     paramBuffer.addValueParam("numAttachments", ParamType::TGLsizei, numAttachments);
1676 
1677     if (isCallValid)
1678     {
1679         ParamCapture attachmentsParam("attachments", ParamType::TGLenumConstPointer);
1680         InitParamValue(ParamType::TGLenumConstPointer, attachments, &attachmentsParam.value);
1681         CaptureInvalidateFramebuffer_attachments(glState, isCallValid, target, numAttachments,
1682                                                  attachments, &attachmentsParam);
1683         paramBuffer.addParam(std::move(attachmentsParam));
1684     }
1685     else
1686     {
1687         ParamCapture attachmentsParam("attachments", ParamType::TGLenumConstPointer);
1688         InitParamValue(ParamType::TGLenumConstPointer, static_cast<const GLenum *>(nullptr),
1689                        &attachmentsParam.value);
1690         paramBuffer.addParam(std::move(attachmentsParam));
1691     }
1692 
1693     return CallCapture(angle::EntryPoint::GLInvalidateFramebuffer, std::move(paramBuffer));
1694 }
1695 
CaptureInvalidateSubFramebuffer(const State & glState,bool isCallValid,GLenum target,GLsizei numAttachments,const GLenum * attachments,GLint x,GLint y,GLsizei width,GLsizei height)1696 CallCapture CaptureInvalidateSubFramebuffer(const State &glState,
1697                                             bool isCallValid,
1698                                             GLenum target,
1699                                             GLsizei numAttachments,
1700                                             const GLenum *attachments,
1701                                             GLint x,
1702                                             GLint y,
1703                                             GLsizei width,
1704                                             GLsizei height)
1705 {
1706     ParamBuffer paramBuffer;
1707 
1708     paramBuffer.addEnumParam("target", GLenumGroup::DefaultGroup, ParamType::TGLenum, target);
1709     paramBuffer.addValueParam("numAttachments", ParamType::TGLsizei, numAttachments);
1710 
1711     if (isCallValid)
1712     {
1713         ParamCapture attachmentsParam("attachments", ParamType::TGLenumConstPointer);
1714         InitParamValue(ParamType::TGLenumConstPointer, attachments, &attachmentsParam.value);
1715         CaptureInvalidateSubFramebuffer_attachments(glState, isCallValid, target, numAttachments,
1716                                                     attachments, x, y, width, height,
1717                                                     &attachmentsParam);
1718         paramBuffer.addParam(std::move(attachmentsParam));
1719     }
1720     else
1721     {
1722         ParamCapture attachmentsParam("attachments", ParamType::TGLenumConstPointer);
1723         InitParamValue(ParamType::TGLenumConstPointer, static_cast<const GLenum *>(nullptr),
1724                        &attachmentsParam.value);
1725         paramBuffer.addParam(std::move(attachmentsParam));
1726     }
1727 
1728     paramBuffer.addValueParam("x", ParamType::TGLint, x);
1729     paramBuffer.addValueParam("y", ParamType::TGLint, y);
1730     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1731     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1732 
1733     return CallCapture(angle::EntryPoint::GLInvalidateSubFramebuffer, std::move(paramBuffer));
1734 }
1735 
CaptureIsQuery(const State & glState,bool isCallValid,QueryID idPacked,GLboolean returnValue)1736 CallCapture CaptureIsQuery(const State &glState,
1737                            bool isCallValid,
1738                            QueryID idPacked,
1739                            GLboolean returnValue)
1740 {
1741     ParamBuffer paramBuffer;
1742 
1743     paramBuffer.addValueParam("idPacked", ParamType::TQueryID, idPacked);
1744 
1745     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1746     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1747     paramBuffer.addReturnValue(std::move(returnValueCapture));
1748 
1749     return CallCapture(angle::EntryPoint::GLIsQuery, std::move(paramBuffer));
1750 }
1751 
CaptureIsSampler(const State & glState,bool isCallValid,SamplerID samplerPacked,GLboolean returnValue)1752 CallCapture CaptureIsSampler(const State &glState,
1753                              bool isCallValid,
1754                              SamplerID samplerPacked,
1755                              GLboolean returnValue)
1756 {
1757     ParamBuffer paramBuffer;
1758 
1759     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
1760 
1761     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1762     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1763     paramBuffer.addReturnValue(std::move(returnValueCapture));
1764 
1765     return CallCapture(angle::EntryPoint::GLIsSampler, std::move(paramBuffer));
1766 }
1767 
CaptureIsSync(const State & glState,bool isCallValid,GLsync sync,GLboolean returnValue)1768 CallCapture CaptureIsSync(const State &glState,
1769                           bool isCallValid,
1770                           GLsync sync,
1771                           GLboolean returnValue)
1772 {
1773     ParamBuffer paramBuffer;
1774 
1775     paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
1776 
1777     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1778     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1779     paramBuffer.addReturnValue(std::move(returnValueCapture));
1780 
1781     return CallCapture(angle::EntryPoint::GLIsSync, std::move(paramBuffer));
1782 }
1783 
CaptureIsTransformFeedback(const State & glState,bool isCallValid,TransformFeedbackID idPacked,GLboolean returnValue)1784 CallCapture CaptureIsTransformFeedback(const State &glState,
1785                                        bool isCallValid,
1786                                        TransformFeedbackID idPacked,
1787                                        GLboolean returnValue)
1788 {
1789     ParamBuffer paramBuffer;
1790 
1791     paramBuffer.addValueParam("idPacked", ParamType::TTransformFeedbackID, idPacked);
1792 
1793     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1794     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1795     paramBuffer.addReturnValue(std::move(returnValueCapture));
1796 
1797     return CallCapture(angle::EntryPoint::GLIsTransformFeedback, std::move(paramBuffer));
1798 }
1799 
CaptureIsVertexArray(const State & glState,bool isCallValid,VertexArrayID arrayPacked,GLboolean returnValue)1800 CallCapture CaptureIsVertexArray(const State &glState,
1801                                  bool isCallValid,
1802                                  VertexArrayID arrayPacked,
1803                                  GLboolean returnValue)
1804 {
1805     ParamBuffer paramBuffer;
1806 
1807     paramBuffer.addValueParam("arrayPacked", ParamType::TVertexArrayID, arrayPacked);
1808 
1809     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
1810     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
1811     paramBuffer.addReturnValue(std::move(returnValueCapture));
1812 
1813     return CallCapture(angle::EntryPoint::GLIsVertexArray, std::move(paramBuffer));
1814 }
1815 
CaptureMapBufferRange(const State & glState,bool isCallValid,BufferBinding targetPacked,GLintptr offset,GLsizeiptr length,GLbitfield access,void * returnValue)1816 CallCapture CaptureMapBufferRange(const State &glState,
1817                                   bool isCallValid,
1818                                   BufferBinding targetPacked,
1819                                   GLintptr offset,
1820                                   GLsizeiptr length,
1821                                   GLbitfield access,
1822                                   void *returnValue)
1823 {
1824     ParamBuffer paramBuffer;
1825 
1826     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
1827     paramBuffer.addValueParam("offset", ParamType::TGLintptr, offset);
1828     paramBuffer.addValueParam("length", ParamType::TGLsizeiptr, length);
1829     paramBuffer.addEnumParam("access", GLenumGroup::BufferAccessMask, ParamType::TGLbitfield,
1830                              access);
1831 
1832     ParamCapture returnValueCapture("returnValue", ParamType::TvoidPointer);
1833     InitParamValue(ParamType::TvoidPointer, returnValue, &returnValueCapture.value);
1834     paramBuffer.addReturnValue(std::move(returnValueCapture));
1835 
1836     return CallCapture(angle::EntryPoint::GLMapBufferRange, std::move(paramBuffer));
1837 }
1838 
CapturePauseTransformFeedback(const State & glState,bool isCallValid)1839 CallCapture CapturePauseTransformFeedback(const State &glState, bool isCallValid)
1840 {
1841     ParamBuffer paramBuffer;
1842 
1843     return CallCapture(angle::EntryPoint::GLPauseTransformFeedback, std::move(paramBuffer));
1844 }
1845 
CaptureProgramBinary(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLenum binaryFormat,const void * binary,GLsizei length)1846 CallCapture CaptureProgramBinary(const State &glState,
1847                                  bool isCallValid,
1848                                  ShaderProgramID programPacked,
1849                                  GLenum binaryFormat,
1850                                  const void *binary,
1851                                  GLsizei length)
1852 {
1853     ParamBuffer paramBuffer;
1854 
1855     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1856     paramBuffer.addEnumParam("binaryFormat", GLenumGroup::DefaultGroup, ParamType::TGLenum,
1857                              binaryFormat);
1858 
1859     if (isCallValid)
1860     {
1861         ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
1862         InitParamValue(ParamType::TvoidConstPointer, binary, &binaryParam.value);
1863         CaptureProgramBinary_binary(glState, isCallValid, programPacked, binaryFormat, binary,
1864                                     length, &binaryParam);
1865         paramBuffer.addParam(std::move(binaryParam));
1866     }
1867     else
1868     {
1869         ParamCapture binaryParam("binary", ParamType::TvoidConstPointer);
1870         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
1871                        &binaryParam.value);
1872         paramBuffer.addParam(std::move(binaryParam));
1873     }
1874 
1875     paramBuffer.addValueParam("length", ParamType::TGLsizei, length);
1876 
1877     return CallCapture(angle::EntryPoint::GLProgramBinary, std::move(paramBuffer));
1878 }
1879 
CaptureProgramParameteri(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLenum pname,GLint value)1880 CallCapture CaptureProgramParameteri(const State &glState,
1881                                      bool isCallValid,
1882                                      ShaderProgramID programPacked,
1883                                      GLenum pname,
1884                                      GLint value)
1885 {
1886     ParamBuffer paramBuffer;
1887 
1888     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
1889     paramBuffer.addEnumParam("pname", GLenumGroup::ProgramParameterPName, ParamType::TGLenum,
1890                              pname);
1891     paramBuffer.addValueParam("value", ParamType::TGLint, value);
1892 
1893     return CallCapture(angle::EntryPoint::GLProgramParameteri, std::move(paramBuffer));
1894 }
1895 
CaptureReadBuffer(const State & glState,bool isCallValid,GLenum src)1896 CallCapture CaptureReadBuffer(const State &glState, bool isCallValid, GLenum src)
1897 {
1898     ParamBuffer paramBuffer;
1899 
1900     paramBuffer.addEnumParam("src", GLenumGroup::ReadBufferMode, ParamType::TGLenum, src);
1901 
1902     return CallCapture(angle::EntryPoint::GLReadBuffer, std::move(paramBuffer));
1903 }
1904 
CaptureRenderbufferStorageMultisample(const State & glState,bool isCallValid,GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height)1905 CallCapture CaptureRenderbufferStorageMultisample(const State &glState,
1906                                                   bool isCallValid,
1907                                                   GLenum target,
1908                                                   GLsizei samples,
1909                                                   GLenum internalformat,
1910                                                   GLsizei width,
1911                                                   GLsizei height)
1912 {
1913     ParamBuffer paramBuffer;
1914 
1915     paramBuffer.addEnumParam("target", GLenumGroup::RenderbufferTarget, ParamType::TGLenum, target);
1916     paramBuffer.addValueParam("samples", ParamType::TGLsizei, samples);
1917     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
1918                              internalformat);
1919     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
1920     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
1921 
1922     return CallCapture(angle::EntryPoint::GLRenderbufferStorageMultisample, std::move(paramBuffer));
1923 }
1924 
CaptureResumeTransformFeedback(const State & glState,bool isCallValid)1925 CallCapture CaptureResumeTransformFeedback(const State &glState, bool isCallValid)
1926 {
1927     ParamBuffer paramBuffer;
1928 
1929     return CallCapture(angle::EntryPoint::GLResumeTransformFeedback, std::move(paramBuffer));
1930 }
1931 
CaptureSamplerParameterf(const State & glState,bool isCallValid,SamplerID samplerPacked,GLenum pname,GLfloat param)1932 CallCapture CaptureSamplerParameterf(const State &glState,
1933                                      bool isCallValid,
1934                                      SamplerID samplerPacked,
1935                                      GLenum pname,
1936                                      GLfloat param)
1937 {
1938     ParamBuffer paramBuffer;
1939 
1940     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
1941     paramBuffer.addEnumParam("pname", GLenumGroup::SamplerParameterName, ParamType::TGLenum, pname);
1942     paramBuffer.addValueParam("param", ParamType::TGLfloat, param);
1943 
1944     return CallCapture(angle::EntryPoint::GLSamplerParameterf, std::move(paramBuffer));
1945 }
1946 
CaptureSamplerParameterfv(const State & glState,bool isCallValid,SamplerID samplerPacked,GLenum pname,const GLfloat * param)1947 CallCapture CaptureSamplerParameterfv(const State &glState,
1948                                       bool isCallValid,
1949                                       SamplerID samplerPacked,
1950                                       GLenum pname,
1951                                       const GLfloat *param)
1952 {
1953     ParamBuffer paramBuffer;
1954 
1955     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
1956     paramBuffer.addEnumParam("pname", GLenumGroup::SamplerParameterName, ParamType::TGLenum, pname);
1957 
1958     if (isCallValid)
1959     {
1960         ParamCapture paramParam("param", ParamType::TGLfloatConstPointer);
1961         InitParamValue(ParamType::TGLfloatConstPointer, param, &paramParam.value);
1962         CaptureSamplerParameterfv_param(glState, isCallValid, samplerPacked, pname, param,
1963                                         &paramParam);
1964         paramBuffer.addParam(std::move(paramParam));
1965     }
1966     else
1967     {
1968         ParamCapture paramParam("param", ParamType::TGLfloatConstPointer);
1969         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
1970                        &paramParam.value);
1971         paramBuffer.addParam(std::move(paramParam));
1972     }
1973 
1974     return CallCapture(angle::EntryPoint::GLSamplerParameterfv, std::move(paramBuffer));
1975 }
1976 
CaptureSamplerParameteri(const State & glState,bool isCallValid,SamplerID samplerPacked,GLenum pname,GLint param)1977 CallCapture CaptureSamplerParameteri(const State &glState,
1978                                      bool isCallValid,
1979                                      SamplerID samplerPacked,
1980                                      GLenum pname,
1981                                      GLint param)
1982 {
1983     ParamBuffer paramBuffer;
1984 
1985     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
1986     paramBuffer.addEnumParam("pname", GLenumGroup::SamplerParameterName, ParamType::TGLenum, pname);
1987     paramBuffer.addValueParam("param", ParamType::TGLint, param);
1988 
1989     return CallCapture(angle::EntryPoint::GLSamplerParameteri, std::move(paramBuffer));
1990 }
1991 
CaptureSamplerParameteriv(const State & glState,bool isCallValid,SamplerID samplerPacked,GLenum pname,const GLint * param)1992 CallCapture CaptureSamplerParameteriv(const State &glState,
1993                                       bool isCallValid,
1994                                       SamplerID samplerPacked,
1995                                       GLenum pname,
1996                                       const GLint *param)
1997 {
1998     ParamBuffer paramBuffer;
1999 
2000     paramBuffer.addValueParam("samplerPacked", ParamType::TSamplerID, samplerPacked);
2001     paramBuffer.addEnumParam("pname", GLenumGroup::SamplerParameterName, ParamType::TGLenum, pname);
2002 
2003     if (isCallValid)
2004     {
2005         ParamCapture paramParam("param", ParamType::TGLintConstPointer);
2006         InitParamValue(ParamType::TGLintConstPointer, param, &paramParam.value);
2007         CaptureSamplerParameteriv_param(glState, isCallValid, samplerPacked, pname, param,
2008                                         &paramParam);
2009         paramBuffer.addParam(std::move(paramParam));
2010     }
2011     else
2012     {
2013         ParamCapture paramParam("param", ParamType::TGLintConstPointer);
2014         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2015                        &paramParam.value);
2016         paramBuffer.addParam(std::move(paramParam));
2017     }
2018 
2019     return CallCapture(angle::EntryPoint::GLSamplerParameteriv, std::move(paramBuffer));
2020 }
2021 
CaptureTexImage3D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const void * pixels)2022 CallCapture CaptureTexImage3D(const State &glState,
2023                               bool isCallValid,
2024                               TextureTarget targetPacked,
2025                               GLint level,
2026                               GLint internalformat,
2027                               GLsizei width,
2028                               GLsizei height,
2029                               GLsizei depth,
2030                               GLint border,
2031                               GLenum format,
2032                               GLenum type,
2033                               const void *pixels)
2034 {
2035     ParamBuffer paramBuffer;
2036 
2037     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
2038     paramBuffer.addValueParam("level", ParamType::TGLint, level);
2039     paramBuffer.addValueParam("internalformat", ParamType::TGLint, internalformat);
2040     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2041     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2042     paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
2043     paramBuffer.addValueParam("border", ParamType::TGLint, border);
2044     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
2045     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
2046 
2047     if (isCallValid)
2048     {
2049         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2050         InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
2051         CaptureTexImage3D_pixels(glState, isCallValid, targetPacked, level, internalformat, width,
2052                                  height, depth, border, format, type, pixels, &pixelsParam);
2053         paramBuffer.addParam(std::move(pixelsParam));
2054     }
2055     else
2056     {
2057         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2058         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2059                        &pixelsParam.value);
2060         paramBuffer.addParam(std::move(pixelsParam));
2061     }
2062 
2063     return CallCapture(angle::EntryPoint::GLTexImage3D, std::move(paramBuffer));
2064 }
2065 
CaptureTexStorage2D(const State & glState,bool isCallValid,TextureType targetPacked,GLsizei levels,GLenum internalformat,GLsizei width,GLsizei height)2066 CallCapture CaptureTexStorage2D(const State &glState,
2067                                 bool isCallValid,
2068                                 TextureType targetPacked,
2069                                 GLsizei levels,
2070                                 GLenum internalformat,
2071                                 GLsizei width,
2072                                 GLsizei height)
2073 {
2074     ParamBuffer paramBuffer;
2075 
2076     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2077     paramBuffer.addValueParam("levels", ParamType::TGLsizei, levels);
2078     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
2079                              internalformat);
2080     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2081     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2082 
2083     return CallCapture(angle::EntryPoint::GLTexStorage2D, std::move(paramBuffer));
2084 }
2085 
CaptureTexStorage3D(const State & glState,bool isCallValid,TextureType targetPacked,GLsizei levels,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth)2086 CallCapture CaptureTexStorage3D(const State &glState,
2087                                 bool isCallValid,
2088                                 TextureType targetPacked,
2089                                 GLsizei levels,
2090                                 GLenum internalformat,
2091                                 GLsizei width,
2092                                 GLsizei height,
2093                                 GLsizei depth)
2094 {
2095     ParamBuffer paramBuffer;
2096 
2097     paramBuffer.addValueParam("targetPacked", ParamType::TTextureType, targetPacked);
2098     paramBuffer.addValueParam("levels", ParamType::TGLsizei, levels);
2099     paramBuffer.addEnumParam("internalformat", GLenumGroup::InternalFormat, ParamType::TGLenum,
2100                              internalformat);
2101     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2102     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2103     paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
2104 
2105     return CallCapture(angle::EntryPoint::GLTexStorage3D, std::move(paramBuffer));
2106 }
2107 
CaptureTexSubImage3D(const State & glState,bool isCallValid,TextureTarget targetPacked,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const void * pixels)2108 CallCapture CaptureTexSubImage3D(const State &glState,
2109                                  bool isCallValid,
2110                                  TextureTarget targetPacked,
2111                                  GLint level,
2112                                  GLint xoffset,
2113                                  GLint yoffset,
2114                                  GLint zoffset,
2115                                  GLsizei width,
2116                                  GLsizei height,
2117                                  GLsizei depth,
2118                                  GLenum format,
2119                                  GLenum type,
2120                                  const void *pixels)
2121 {
2122     ParamBuffer paramBuffer;
2123 
2124     paramBuffer.addValueParam("targetPacked", ParamType::TTextureTarget, targetPacked);
2125     paramBuffer.addValueParam("level", ParamType::TGLint, level);
2126     paramBuffer.addValueParam("xoffset", ParamType::TGLint, xoffset);
2127     paramBuffer.addValueParam("yoffset", ParamType::TGLint, yoffset);
2128     paramBuffer.addValueParam("zoffset", ParamType::TGLint, zoffset);
2129     paramBuffer.addValueParam("width", ParamType::TGLsizei, width);
2130     paramBuffer.addValueParam("height", ParamType::TGLsizei, height);
2131     paramBuffer.addValueParam("depth", ParamType::TGLsizei, depth);
2132     paramBuffer.addEnumParam("format", GLenumGroup::PixelFormat, ParamType::TGLenum, format);
2133     paramBuffer.addEnumParam("type", GLenumGroup::PixelType, ParamType::TGLenum, type);
2134 
2135     if (isCallValid)
2136     {
2137         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2138         InitParamValue(ParamType::TvoidConstPointer, pixels, &pixelsParam.value);
2139         CaptureTexSubImage3D_pixels(glState, isCallValid, targetPacked, level, xoffset, yoffset,
2140                                     zoffset, width, height, depth, format, type, pixels,
2141                                     &pixelsParam);
2142         paramBuffer.addParam(std::move(pixelsParam));
2143     }
2144     else
2145     {
2146         ParamCapture pixelsParam("pixels", ParamType::TvoidConstPointer);
2147         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2148                        &pixelsParam.value);
2149         paramBuffer.addParam(std::move(pixelsParam));
2150     }
2151 
2152     return CallCapture(angle::EntryPoint::GLTexSubImage3D, std::move(paramBuffer));
2153 }
2154 
CaptureTransformFeedbackVaryings(const State & glState,bool isCallValid,ShaderProgramID programPacked,GLsizei count,const GLchar * const * varyings,GLenum bufferMode)2155 CallCapture CaptureTransformFeedbackVaryings(const State &glState,
2156                                              bool isCallValid,
2157                                              ShaderProgramID programPacked,
2158                                              GLsizei count,
2159                                              const GLchar *const *varyings,
2160                                              GLenum bufferMode)
2161 {
2162     ParamBuffer paramBuffer;
2163 
2164     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2165     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2166 
2167     if (isCallValid)
2168     {
2169         ParamCapture varyingsParam("varyings", ParamType::TGLcharConstPointerPointer);
2170         InitParamValue(ParamType::TGLcharConstPointerPointer, varyings, &varyingsParam.value);
2171         CaptureTransformFeedbackVaryings_varyings(glState, isCallValid, programPacked, count,
2172                                                   varyings, bufferMode, &varyingsParam);
2173         paramBuffer.addParam(std::move(varyingsParam));
2174     }
2175     else
2176     {
2177         ParamCapture varyingsParam("varyings", ParamType::TGLcharConstPointerPointer);
2178         InitParamValue(ParamType::TGLcharConstPointerPointer,
2179                        static_cast<const GLchar *const *>(nullptr), &varyingsParam.value);
2180         paramBuffer.addParam(std::move(varyingsParam));
2181     }
2182 
2183     paramBuffer.addEnumParam("bufferMode", GLenumGroup::DefaultGroup, ParamType::TGLenum,
2184                              bufferMode);
2185 
2186     return CallCapture(angle::EntryPoint::GLTransformFeedbackVaryings, std::move(paramBuffer));
2187 }
2188 
CaptureUniform1ui(const State & glState,bool isCallValid,UniformLocation locationPacked,GLuint v0)2189 CallCapture CaptureUniform1ui(const State &glState,
2190                               bool isCallValid,
2191                               UniformLocation locationPacked,
2192                               GLuint v0)
2193 {
2194     ParamBuffer paramBuffer;
2195 
2196     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2197     paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
2198 
2199     return CallCapture(angle::EntryPoint::GLUniform1ui, std::move(paramBuffer));
2200 }
2201 
CaptureUniform1uiv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLuint * value)2202 CallCapture CaptureUniform1uiv(const State &glState,
2203                                bool isCallValid,
2204                                UniformLocation locationPacked,
2205                                GLsizei count,
2206                                const GLuint *value)
2207 {
2208     ParamBuffer paramBuffer;
2209 
2210     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2211     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2212 
2213     if (isCallValid)
2214     {
2215         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2216         InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
2217         CaptureUniform1uiv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2218         paramBuffer.addParam(std::move(valueParam));
2219     }
2220     else
2221     {
2222         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2223         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
2224                        &valueParam.value);
2225         paramBuffer.addParam(std::move(valueParam));
2226     }
2227 
2228     return CallCapture(angle::EntryPoint::GLUniform1uiv, std::move(paramBuffer));
2229 }
2230 
CaptureUniform2ui(const State & glState,bool isCallValid,UniformLocation locationPacked,GLuint v0,GLuint v1)2231 CallCapture CaptureUniform2ui(const State &glState,
2232                               bool isCallValid,
2233                               UniformLocation locationPacked,
2234                               GLuint v0,
2235                               GLuint v1)
2236 {
2237     ParamBuffer paramBuffer;
2238 
2239     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2240     paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
2241     paramBuffer.addValueParam("v1", ParamType::TGLuint, v1);
2242 
2243     return CallCapture(angle::EntryPoint::GLUniform2ui, std::move(paramBuffer));
2244 }
2245 
CaptureUniform2uiv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLuint * value)2246 CallCapture CaptureUniform2uiv(const State &glState,
2247                                bool isCallValid,
2248                                UniformLocation locationPacked,
2249                                GLsizei count,
2250                                const GLuint *value)
2251 {
2252     ParamBuffer paramBuffer;
2253 
2254     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2255     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2256 
2257     if (isCallValid)
2258     {
2259         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2260         InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
2261         CaptureUniform2uiv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2262         paramBuffer.addParam(std::move(valueParam));
2263     }
2264     else
2265     {
2266         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2267         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
2268                        &valueParam.value);
2269         paramBuffer.addParam(std::move(valueParam));
2270     }
2271 
2272     return CallCapture(angle::EntryPoint::GLUniform2uiv, std::move(paramBuffer));
2273 }
2274 
CaptureUniform3ui(const State & glState,bool isCallValid,UniformLocation locationPacked,GLuint v0,GLuint v1,GLuint v2)2275 CallCapture CaptureUniform3ui(const State &glState,
2276                               bool isCallValid,
2277                               UniformLocation locationPacked,
2278                               GLuint v0,
2279                               GLuint v1,
2280                               GLuint v2)
2281 {
2282     ParamBuffer paramBuffer;
2283 
2284     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2285     paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
2286     paramBuffer.addValueParam("v1", ParamType::TGLuint, v1);
2287     paramBuffer.addValueParam("v2", ParamType::TGLuint, v2);
2288 
2289     return CallCapture(angle::EntryPoint::GLUniform3ui, std::move(paramBuffer));
2290 }
2291 
CaptureUniform3uiv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLuint * value)2292 CallCapture CaptureUniform3uiv(const State &glState,
2293                                bool isCallValid,
2294                                UniformLocation locationPacked,
2295                                GLsizei count,
2296                                const GLuint *value)
2297 {
2298     ParamBuffer paramBuffer;
2299 
2300     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2301     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2302 
2303     if (isCallValid)
2304     {
2305         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2306         InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
2307         CaptureUniform3uiv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2308         paramBuffer.addParam(std::move(valueParam));
2309     }
2310     else
2311     {
2312         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2313         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
2314                        &valueParam.value);
2315         paramBuffer.addParam(std::move(valueParam));
2316     }
2317 
2318     return CallCapture(angle::EntryPoint::GLUniform3uiv, std::move(paramBuffer));
2319 }
2320 
CaptureUniform4ui(const State & glState,bool isCallValid,UniformLocation locationPacked,GLuint v0,GLuint v1,GLuint v2,GLuint v3)2321 CallCapture CaptureUniform4ui(const State &glState,
2322                               bool isCallValid,
2323                               UniformLocation locationPacked,
2324                               GLuint v0,
2325                               GLuint v1,
2326                               GLuint v2,
2327                               GLuint v3)
2328 {
2329     ParamBuffer paramBuffer;
2330 
2331     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2332     paramBuffer.addValueParam("v0", ParamType::TGLuint, v0);
2333     paramBuffer.addValueParam("v1", ParamType::TGLuint, v1);
2334     paramBuffer.addValueParam("v2", ParamType::TGLuint, v2);
2335     paramBuffer.addValueParam("v3", ParamType::TGLuint, v3);
2336 
2337     return CallCapture(angle::EntryPoint::GLUniform4ui, std::move(paramBuffer));
2338 }
2339 
CaptureUniform4uiv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,const GLuint * value)2340 CallCapture CaptureUniform4uiv(const State &glState,
2341                                bool isCallValid,
2342                                UniformLocation locationPacked,
2343                                GLsizei count,
2344                                const GLuint *value)
2345 {
2346     ParamBuffer paramBuffer;
2347 
2348     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2349     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2350 
2351     if (isCallValid)
2352     {
2353         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2354         InitParamValue(ParamType::TGLuintConstPointer, value, &valueParam.value);
2355         CaptureUniform4uiv_value(glState, isCallValid, locationPacked, count, value, &valueParam);
2356         paramBuffer.addParam(std::move(valueParam));
2357     }
2358     else
2359     {
2360         ParamCapture valueParam("value", ParamType::TGLuintConstPointer);
2361         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
2362                        &valueParam.value);
2363         paramBuffer.addParam(std::move(valueParam));
2364     }
2365 
2366     return CallCapture(angle::EntryPoint::GLUniform4uiv, std::move(paramBuffer));
2367 }
2368 
CaptureUniformBlockBinding(const State & glState,bool isCallValid,ShaderProgramID programPacked,UniformBlockIndex uniformBlockIndexPacked,GLuint uniformBlockBinding)2369 CallCapture CaptureUniformBlockBinding(const State &glState,
2370                                        bool isCallValid,
2371                                        ShaderProgramID programPacked,
2372                                        UniformBlockIndex uniformBlockIndexPacked,
2373                                        GLuint uniformBlockBinding)
2374 {
2375     ParamBuffer paramBuffer;
2376 
2377     paramBuffer.addValueParam("programPacked", ParamType::TShaderProgramID, programPacked);
2378     paramBuffer.addValueParam("uniformBlockIndexPacked", ParamType::TUniformBlockIndex,
2379                               uniformBlockIndexPacked);
2380     paramBuffer.addValueParam("uniformBlockBinding", ParamType::TGLuint, uniformBlockBinding);
2381 
2382     return CallCapture(angle::EntryPoint::GLUniformBlockBinding, std::move(paramBuffer));
2383 }
2384 
CaptureUniformMatrix2x3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2385 CallCapture CaptureUniformMatrix2x3fv(const State &glState,
2386                                       bool isCallValid,
2387                                       UniformLocation locationPacked,
2388                                       GLsizei count,
2389                                       GLboolean transpose,
2390                                       const GLfloat *value)
2391 {
2392     ParamBuffer paramBuffer;
2393 
2394     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2395     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2396     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2397 
2398     if (isCallValid)
2399     {
2400         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2401         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2402         CaptureUniformMatrix2x3fv_value(glState, isCallValid, locationPacked, count, transpose,
2403                                         value, &valueParam);
2404         paramBuffer.addParam(std::move(valueParam));
2405     }
2406     else
2407     {
2408         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2409         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2410                        &valueParam.value);
2411         paramBuffer.addParam(std::move(valueParam));
2412     }
2413 
2414     return CallCapture(angle::EntryPoint::GLUniformMatrix2x3fv, std::move(paramBuffer));
2415 }
2416 
CaptureUniformMatrix2x4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2417 CallCapture CaptureUniformMatrix2x4fv(const State &glState,
2418                                       bool isCallValid,
2419                                       UniformLocation locationPacked,
2420                                       GLsizei count,
2421                                       GLboolean transpose,
2422                                       const GLfloat *value)
2423 {
2424     ParamBuffer paramBuffer;
2425 
2426     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2427     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2428     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2429 
2430     if (isCallValid)
2431     {
2432         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2433         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2434         CaptureUniformMatrix2x4fv_value(glState, isCallValid, locationPacked, count, transpose,
2435                                         value, &valueParam);
2436         paramBuffer.addParam(std::move(valueParam));
2437     }
2438     else
2439     {
2440         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2441         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2442                        &valueParam.value);
2443         paramBuffer.addParam(std::move(valueParam));
2444     }
2445 
2446     return CallCapture(angle::EntryPoint::GLUniformMatrix2x4fv, std::move(paramBuffer));
2447 }
2448 
CaptureUniformMatrix3x2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2449 CallCapture CaptureUniformMatrix3x2fv(const State &glState,
2450                                       bool isCallValid,
2451                                       UniformLocation locationPacked,
2452                                       GLsizei count,
2453                                       GLboolean transpose,
2454                                       const GLfloat *value)
2455 {
2456     ParamBuffer paramBuffer;
2457 
2458     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2459     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2460     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2461 
2462     if (isCallValid)
2463     {
2464         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2465         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2466         CaptureUniformMatrix3x2fv_value(glState, isCallValid, locationPacked, count, transpose,
2467                                         value, &valueParam);
2468         paramBuffer.addParam(std::move(valueParam));
2469     }
2470     else
2471     {
2472         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2473         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2474                        &valueParam.value);
2475         paramBuffer.addParam(std::move(valueParam));
2476     }
2477 
2478     return CallCapture(angle::EntryPoint::GLUniformMatrix3x2fv, std::move(paramBuffer));
2479 }
2480 
CaptureUniformMatrix3x4fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2481 CallCapture CaptureUniformMatrix3x4fv(const State &glState,
2482                                       bool isCallValid,
2483                                       UniformLocation locationPacked,
2484                                       GLsizei count,
2485                                       GLboolean transpose,
2486                                       const GLfloat *value)
2487 {
2488     ParamBuffer paramBuffer;
2489 
2490     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2491     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2492     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2493 
2494     if (isCallValid)
2495     {
2496         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2497         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2498         CaptureUniformMatrix3x4fv_value(glState, isCallValid, locationPacked, count, transpose,
2499                                         value, &valueParam);
2500         paramBuffer.addParam(std::move(valueParam));
2501     }
2502     else
2503     {
2504         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2505         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2506                        &valueParam.value);
2507         paramBuffer.addParam(std::move(valueParam));
2508     }
2509 
2510     return CallCapture(angle::EntryPoint::GLUniformMatrix3x4fv, std::move(paramBuffer));
2511 }
2512 
CaptureUniformMatrix4x2fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2513 CallCapture CaptureUniformMatrix4x2fv(const State &glState,
2514                                       bool isCallValid,
2515                                       UniformLocation locationPacked,
2516                                       GLsizei count,
2517                                       GLboolean transpose,
2518                                       const GLfloat *value)
2519 {
2520     ParamBuffer paramBuffer;
2521 
2522     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2523     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2524     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2525 
2526     if (isCallValid)
2527     {
2528         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2529         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2530         CaptureUniformMatrix4x2fv_value(glState, isCallValid, locationPacked, count, transpose,
2531                                         value, &valueParam);
2532         paramBuffer.addParam(std::move(valueParam));
2533     }
2534     else
2535     {
2536         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2537         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2538                        &valueParam.value);
2539         paramBuffer.addParam(std::move(valueParam));
2540     }
2541 
2542     return CallCapture(angle::EntryPoint::GLUniformMatrix4x2fv, std::move(paramBuffer));
2543 }
2544 
CaptureUniformMatrix4x3fv(const State & glState,bool isCallValid,UniformLocation locationPacked,GLsizei count,GLboolean transpose,const GLfloat * value)2545 CallCapture CaptureUniformMatrix4x3fv(const State &glState,
2546                                       bool isCallValid,
2547                                       UniformLocation locationPacked,
2548                                       GLsizei count,
2549                                       GLboolean transpose,
2550                                       const GLfloat *value)
2551 {
2552     ParamBuffer paramBuffer;
2553 
2554     paramBuffer.addValueParam("locationPacked", ParamType::TUniformLocation, locationPacked);
2555     paramBuffer.addValueParam("count", ParamType::TGLsizei, count);
2556     paramBuffer.addValueParam("transpose", ParamType::TGLboolean, transpose);
2557 
2558     if (isCallValid)
2559     {
2560         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2561         InitParamValue(ParamType::TGLfloatConstPointer, value, &valueParam.value);
2562         CaptureUniformMatrix4x3fv_value(glState, isCallValid, locationPacked, count, transpose,
2563                                         value, &valueParam);
2564         paramBuffer.addParam(std::move(valueParam));
2565     }
2566     else
2567     {
2568         ParamCapture valueParam("value", ParamType::TGLfloatConstPointer);
2569         InitParamValue(ParamType::TGLfloatConstPointer, static_cast<const GLfloat *>(nullptr),
2570                        &valueParam.value);
2571         paramBuffer.addParam(std::move(valueParam));
2572     }
2573 
2574     return CallCapture(angle::EntryPoint::GLUniformMatrix4x3fv, std::move(paramBuffer));
2575 }
2576 
CaptureUnmapBuffer(const State & glState,bool isCallValid,BufferBinding targetPacked,GLboolean returnValue)2577 CallCapture CaptureUnmapBuffer(const State &glState,
2578                                bool isCallValid,
2579                                BufferBinding targetPacked,
2580                                GLboolean returnValue)
2581 {
2582     ParamBuffer paramBuffer;
2583 
2584     paramBuffer.addValueParam("targetPacked", ParamType::TBufferBinding, targetPacked);
2585 
2586     ParamCapture returnValueCapture("returnValue", ParamType::TGLboolean);
2587     InitParamValue(ParamType::TGLboolean, returnValue, &returnValueCapture.value);
2588     paramBuffer.addReturnValue(std::move(returnValueCapture));
2589 
2590     return CallCapture(angle::EntryPoint::GLUnmapBuffer, std::move(paramBuffer));
2591 }
2592 
CaptureVertexAttribDivisor(const State & glState,bool isCallValid,GLuint index,GLuint divisor)2593 CallCapture CaptureVertexAttribDivisor(const State &glState,
2594                                        bool isCallValid,
2595                                        GLuint index,
2596                                        GLuint divisor)
2597 {
2598     ParamBuffer paramBuffer;
2599 
2600     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2601     paramBuffer.addValueParam("divisor", ParamType::TGLuint, divisor);
2602 
2603     return CallCapture(angle::EntryPoint::GLVertexAttribDivisor, std::move(paramBuffer));
2604 }
2605 
CaptureVertexAttribI4i(const State & glState,bool isCallValid,GLuint index,GLint x,GLint y,GLint z,GLint w)2606 CallCapture CaptureVertexAttribI4i(const State &glState,
2607                                    bool isCallValid,
2608                                    GLuint index,
2609                                    GLint x,
2610                                    GLint y,
2611                                    GLint z,
2612                                    GLint w)
2613 {
2614     ParamBuffer paramBuffer;
2615 
2616     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2617     paramBuffer.addValueParam("x", ParamType::TGLint, x);
2618     paramBuffer.addValueParam("y", ParamType::TGLint, y);
2619     paramBuffer.addValueParam("z", ParamType::TGLint, z);
2620     paramBuffer.addValueParam("w", ParamType::TGLint, w);
2621 
2622     return CallCapture(angle::EntryPoint::GLVertexAttribI4i, std::move(paramBuffer));
2623 }
2624 
CaptureVertexAttribI4iv(const State & glState,bool isCallValid,GLuint index,const GLint * v)2625 CallCapture CaptureVertexAttribI4iv(const State &glState,
2626                                     bool isCallValid,
2627                                     GLuint index,
2628                                     const GLint *v)
2629 {
2630     ParamBuffer paramBuffer;
2631 
2632     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2633 
2634     if (isCallValid)
2635     {
2636         ParamCapture vParam("v", ParamType::TGLintConstPointer);
2637         InitParamValue(ParamType::TGLintConstPointer, v, &vParam.value);
2638         CaptureVertexAttribI4iv_v(glState, isCallValid, index, v, &vParam);
2639         paramBuffer.addParam(std::move(vParam));
2640     }
2641     else
2642     {
2643         ParamCapture vParam("v", ParamType::TGLintConstPointer);
2644         InitParamValue(ParamType::TGLintConstPointer, static_cast<const GLint *>(nullptr),
2645                        &vParam.value);
2646         paramBuffer.addParam(std::move(vParam));
2647     }
2648 
2649     return CallCapture(angle::EntryPoint::GLVertexAttribI4iv, std::move(paramBuffer));
2650 }
2651 
CaptureVertexAttribI4ui(const State & glState,bool isCallValid,GLuint index,GLuint x,GLuint y,GLuint z,GLuint w)2652 CallCapture CaptureVertexAttribI4ui(const State &glState,
2653                                     bool isCallValid,
2654                                     GLuint index,
2655                                     GLuint x,
2656                                     GLuint y,
2657                                     GLuint z,
2658                                     GLuint w)
2659 {
2660     ParamBuffer paramBuffer;
2661 
2662     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2663     paramBuffer.addValueParam("x", ParamType::TGLuint, x);
2664     paramBuffer.addValueParam("y", ParamType::TGLuint, y);
2665     paramBuffer.addValueParam("z", ParamType::TGLuint, z);
2666     paramBuffer.addValueParam("w", ParamType::TGLuint, w);
2667 
2668     return CallCapture(angle::EntryPoint::GLVertexAttribI4ui, std::move(paramBuffer));
2669 }
2670 
CaptureVertexAttribI4uiv(const State & glState,bool isCallValid,GLuint index,const GLuint * v)2671 CallCapture CaptureVertexAttribI4uiv(const State &glState,
2672                                      bool isCallValid,
2673                                      GLuint index,
2674                                      const GLuint *v)
2675 {
2676     ParamBuffer paramBuffer;
2677 
2678     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2679 
2680     if (isCallValid)
2681     {
2682         ParamCapture vParam("v", ParamType::TGLuintConstPointer);
2683         InitParamValue(ParamType::TGLuintConstPointer, v, &vParam.value);
2684         CaptureVertexAttribI4uiv_v(glState, isCallValid, index, v, &vParam);
2685         paramBuffer.addParam(std::move(vParam));
2686     }
2687     else
2688     {
2689         ParamCapture vParam("v", ParamType::TGLuintConstPointer);
2690         InitParamValue(ParamType::TGLuintConstPointer, static_cast<const GLuint *>(nullptr),
2691                        &vParam.value);
2692         paramBuffer.addParam(std::move(vParam));
2693     }
2694 
2695     return CallCapture(angle::EntryPoint::GLVertexAttribI4uiv, std::move(paramBuffer));
2696 }
2697 
CaptureVertexAttribIPointer(const State & glState,bool isCallValid,GLuint index,GLint size,VertexAttribType typePacked,GLsizei stride,const void * pointer)2698 CallCapture CaptureVertexAttribIPointer(const State &glState,
2699                                         bool isCallValid,
2700                                         GLuint index,
2701                                         GLint size,
2702                                         VertexAttribType typePacked,
2703                                         GLsizei stride,
2704                                         const void *pointer)
2705 {
2706     ParamBuffer paramBuffer;
2707 
2708     paramBuffer.addValueParam("index", ParamType::TGLuint, index);
2709     paramBuffer.addValueParam("size", ParamType::TGLint, size);
2710     paramBuffer.addValueParam("typePacked", ParamType::TVertexAttribType, typePacked);
2711     paramBuffer.addValueParam("stride", ParamType::TGLsizei, stride);
2712 
2713     if (isCallValid)
2714     {
2715         ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
2716         InitParamValue(ParamType::TvoidConstPointer, pointer, &pointerParam.value);
2717         CaptureVertexAttribIPointer_pointer(glState, isCallValid, index, size, typePacked, stride,
2718                                             pointer, &pointerParam);
2719         paramBuffer.addParam(std::move(pointerParam));
2720     }
2721     else
2722     {
2723         ParamCapture pointerParam("pointer", ParamType::TvoidConstPointer);
2724         InitParamValue(ParamType::TvoidConstPointer, static_cast<const void *>(nullptr),
2725                        &pointerParam.value);
2726         paramBuffer.addParam(std::move(pointerParam));
2727     }
2728 
2729     return CallCapture(angle::EntryPoint::GLVertexAttribIPointer, std::move(paramBuffer));
2730 }
2731 
CaptureWaitSync(const State & glState,bool isCallValid,GLsync sync,GLbitfield flags,GLuint64 timeout)2732 CallCapture CaptureWaitSync(const State &glState,
2733                             bool isCallValid,
2734                             GLsync sync,
2735                             GLbitfield flags,
2736                             GLuint64 timeout)
2737 {
2738     ParamBuffer paramBuffer;
2739 
2740     paramBuffer.addValueParam("sync", ParamType::TGLsync, sync);
2741     paramBuffer.addEnumParam("flags", GLenumGroup::DefaultGroup, ParamType::TGLbitfield, flags);
2742     paramBuffer.addValueParam("timeout", ParamType::TGLuint64, timeout);
2743 
2744     return CallCapture(angle::EntryPoint::GLWaitSync, std::move(paramBuffer));
2745 }
2746 
2747 }  // namespace gl
2748