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