blob: 7b0a80bc7a6cd3ceb29dfd83fdea8fabdc0fd1c5 [file] [log] [blame]
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001//
2// Copyright (c) 2018 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// validationES1.cpp: Validation functions for OpenGL ES 1.0 entry point parameters
8
9#include "libANGLE/validationES1.h"
10
11#include "common/debug.h"
Lingfeng Yang13b708f2018-03-21 12:14:10 -070012#include "libANGLE/Context.h"
13#include "libANGLE/ErrorStrings.h"
Lingfeng Yang038dd532018-03-29 17:31:52 -070014#include "libANGLE/validationES.h"
Lingfeng Yang13b708f2018-03-21 12:14:10 -070015
16#define ANGLE_VALIDATE_IS_GLES1(context) \
17 if (context->getClientMajorVersion() > 1) \
18 { \
19 ANGLE_VALIDATION_ERR(context, InvalidOperation(), GLES1Only); \
20 return false; \
21 }
22
Lingfeng Yang01074432018-04-16 10:19:51 -070023namespace gl
Lingfeng Yang13b708f2018-03-21 12:14:10 -070024{
25
Lingfeng Yangabb09f12018-04-16 10:43:53 -070026bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func)
Lingfeng Yang13b708f2018-03-21 12:14:10 -070027{
28 switch (func)
29 {
Lingfeng Yangabb09f12018-04-16 10:43:53 -070030 case AlphaTestFunc::AlwaysPass:
31 case AlphaTestFunc::Equal:
32 case AlphaTestFunc::Gequal:
33 case AlphaTestFunc::Greater:
34 case AlphaTestFunc::Lequal:
35 case AlphaTestFunc::Less:
36 case AlphaTestFunc::Never:
37 case AlphaTestFunc::NotEqual:
Lingfeng Yang13b708f2018-03-21 12:14:10 -070038 return true;
39 default:
Lingfeng Yang01074432018-04-16 10:19:51 -070040 ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
Lingfeng Yang13b708f2018-03-21 12:14:10 -070041 return false;
42 }
43}
44
Lingfeng Yangabb09f12018-04-16 10:43:53 -070045bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType)
Lingfeng Yang01074432018-04-16 10:19:51 -070046{
47 ANGLE_VALIDATE_IS_GLES1(context);
48 switch (arrayType)
49 {
Lingfeng Yangabb09f12018-04-16 10:43:53 -070050 case ClientVertexArrayType::Vertex:
51 case ClientVertexArrayType::Normal:
52 case ClientVertexArrayType::Color:
53 case ClientVertexArrayType::TextureCoord:
Lingfeng Yang01074432018-04-16 10:19:51 -070054 return true;
Lingfeng Yangabb09f12018-04-16 10:43:53 -070055 case ClientVertexArrayType::PointSize:
Lingfeng Yang01074432018-04-16 10:19:51 -070056 if (!context->getExtensions().pointSizeArray)
57 {
58 ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled);
59 return false;
60 }
61 return true;
62 default:
63 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClientState);
64 return false;
65 }
66}
67
Lingfeng Yangabb09f12018-04-16 10:43:53 -070068bool ValidateBuiltinVertexAttributeCommon(Context *context,
69 ClientVertexArrayType arrayType,
70 GLint size,
71 GLenum type,
72 GLsizei stride,
73 const void *pointer)
74{
75 ANGLE_VALIDATE_IS_GLES1(context);
76
77 if (stride < 0)
78 {
79 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerStride);
80 return false;
81 }
82
83 int minSize = 1;
84 int maxSize = 4;
85
86 switch (arrayType)
87 {
88 case ClientVertexArrayType::Vertex:
89 case ClientVertexArrayType::TextureCoord:
90 minSize = 2;
91 maxSize = 4;
92 break;
93 case ClientVertexArrayType::Normal:
94 minSize = 3;
95 maxSize = 3;
96 break;
97 case ClientVertexArrayType::Color:
98 minSize = 4;
99 maxSize = 4;
100 break;
101 case ClientVertexArrayType::PointSize:
102 if (!context->getExtensions().pointSizeArray)
103 {
104 ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled);
105 return false;
106 }
107
108 minSize = 1;
109 maxSize = 1;
110 break;
111 default:
112 UNREACHABLE();
113 return false;
114 }
115
116 if (size < minSize || size > maxSize)
117 {
118 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerSize);
119 return false;
120 }
121
122 switch (type)
123 {
124 case GL_BYTE:
125 if (arrayType == ClientVertexArrayType::PointSize)
126 {
127 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType);
128 return false;
129 }
130 break;
131 case GL_SHORT:
132 if (arrayType == ClientVertexArrayType::PointSize ||
133 arrayType == ClientVertexArrayType::Color)
134 {
135 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType);
136 return false;
137 }
138 break;
139 case GL_FIXED:
140 case GL_FLOAT:
141 break;
142 default:
143 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType);
144 return false;
145 }
146
147 return true;
148}
149
Lingfeng Yang01074432018-04-16 10:19:51 -0700150} // namespace gl
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500151
152namespace gl
153{
154
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700155bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500156{
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700157 ANGLE_VALIDATE_IS_GLES1(context);
158 return ValidateAlphaFuncCommon(context, func);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500159}
160
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700161bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500162{
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700163 ANGLE_VALIDATE_IS_GLES1(context);
164 return ValidateAlphaFuncCommon(context, func);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500165}
166
167bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
168{
169 UNIMPLEMENTED();
170 return true;
171}
172
173bool ValidateClearDepthx(Context *context, GLfixed depth)
174{
175 UNIMPLEMENTED();
176 return true;
177}
178
179bool ValidateClientActiveTexture(Context *context, GLenum texture)
180{
Lingfeng Yang96310cd2018-03-28 11:56:28 -0700181 ANGLE_VALIDATE_IS_GLES1(context);
Lingfeng Yang038dd532018-03-29 17:31:52 -0700182 return ValidateMultitextureUnit(context, texture);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500183}
184
185bool ValidateClipPlanef(Context *context, GLenum p, const GLfloat *eqn)
186{
187 UNIMPLEMENTED();
188 return true;
189}
190
191bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation)
192{
193 UNIMPLEMENTED();
194 return true;
195}
196
197bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
198{
Lingfeng Yanga43994c2018-03-29 07:21:41 -0700199 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500200 return true;
201}
202
203bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
204{
Lingfeng Yanga43994c2018-03-29 07:21:41 -0700205 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500206 return true;
207}
208
209bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
210{
Lingfeng Yanga43994c2018-03-29 07:21:41 -0700211 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500212 return true;
213}
214
215bool ValidateColorPointer(Context *context,
216 GLint size,
217 GLenum type,
218 GLsizei stride,
219 const void *pointer)
220{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700221 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Color, size, type,
222 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500223}
224
225bool ValidateCullFace(Context *context, GLenum mode)
226{
227 UNIMPLEMENTED();
228 return true;
229}
230
231bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f)
232{
233 UNIMPLEMENTED();
234 return true;
235}
236
Lingfeng Yang01074432018-04-16 10:19:51 -0700237bool ValidateDisableClientState(Context *context, ClientVertexArrayType arrayType)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500238{
Lingfeng Yang01074432018-04-16 10:19:51 -0700239 return ValidateClientStateCommon(context, arrayType);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500240}
241
Lingfeng Yang01074432018-04-16 10:19:51 -0700242bool ValidateEnableClientState(Context *context, ClientVertexArrayType arrayType)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500243{
Lingfeng Yang01074432018-04-16 10:19:51 -0700244 return ValidateClientStateCommon(context, arrayType);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500245}
246
247bool ValidateFogf(Context *context, GLenum pname, GLfloat param)
248{
249 UNIMPLEMENTED();
250 return true;
251}
252
253bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params)
254{
255 UNIMPLEMENTED();
256 return true;
257}
258
259bool ValidateFogx(Context *context, GLenum pname, GLfixed param)
260{
261 UNIMPLEMENTED();
262 return true;
263}
264
265bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *param)
266{
267 UNIMPLEMENTED();
268 return true;
269}
270
271bool ValidateFrustumf(Context *context,
272 GLfloat l,
273 GLfloat r,
274 GLfloat b,
275 GLfloat t,
276 GLfloat n,
277 GLfloat f)
278{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700279 ANGLE_VALIDATE_IS_GLES1(context);
280 if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f)
281 {
282 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
283 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500284 return true;
285}
286
287bool ValidateFrustumx(Context *context,
288 GLfixed l,
289 GLfixed r,
290 GLfixed b,
291 GLfixed t,
292 GLfixed n,
293 GLfixed f)
294{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700295 ANGLE_VALIDATE_IS_GLES1(context);
296 if (l == r || b == t || n == f || n <= 0 || f <= 0)
297 {
298 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
299 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500300 return true;
301}
302
303bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params)
304{
305 UNIMPLEMENTED();
306 return true;
307}
308
309bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation)
310{
311 UNIMPLEMENTED();
312 return true;
313}
314
315bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation)
316{
317 UNIMPLEMENTED();
318 return true;
319}
320
321bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params)
322{
323 UNIMPLEMENTED();
324 return true;
325}
326
327bool ValidateGetLightfv(Context *context, GLenum light, GLenum pname, GLfloat *params)
328{
329 UNIMPLEMENTED();
330 return true;
331}
332
333bool ValidateGetLightxv(Context *context, GLenum light, GLenum pname, GLfixed *params)
334{
335 UNIMPLEMENTED();
336 return true;
337}
338
339bool ValidateGetMaterialfv(Context *context, GLenum face, GLenum pname, GLfloat *params)
340{
341 UNIMPLEMENTED();
342 return true;
343}
344
345bool ValidateGetMaterialxv(Context *context, GLenum face, GLenum pname, GLfixed *params)
346{
347 UNIMPLEMENTED();
348 return true;
349}
350
351bool ValidateGetPointerv(Context *context, GLenum pname, void **params)
352{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700353 ANGLE_VALIDATE_IS_GLES1(context);
354 switch (pname)
355 {
356 case GL_VERTEX_ARRAY_POINTER:
357 case GL_NORMAL_ARRAY_POINTER:
358 case GL_COLOR_ARRAY_POINTER:
359 case GL_TEXTURE_COORD_ARRAY_POINTER:
360 case GL_POINT_SIZE_ARRAY_POINTER_OES:
361 return true;
362 default:
363 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointerQuery);
364 return false;
365 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500366}
367
368bool ValidateGetTexEnvfv(Context *context, GLenum target, GLenum pname, GLfloat *params)
369{
370 UNIMPLEMENTED();
371 return true;
372}
373
374bool ValidateGetTexEnviv(Context *context, GLenum target, GLenum pname, GLint *params)
375{
376 UNIMPLEMENTED();
377 return true;
378}
379
380bool ValidateGetTexEnvxv(Context *context, GLenum target, GLenum pname, GLfixed *params)
381{
382 UNIMPLEMENTED();
383 return true;
384}
385
Corentin Wallezf0e89be2017-11-08 14:00:32 -0800386bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500387{
388 UNIMPLEMENTED();
389 return true;
390}
391
392bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param)
393{
394 UNIMPLEMENTED();
395 return true;
396}
397
398bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params)
399{
400 UNIMPLEMENTED();
401 return true;
402}
403
404bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param)
405{
406 UNIMPLEMENTED();
407 return true;
408}
409
410bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param)
411{
412 UNIMPLEMENTED();
413 return true;
414}
415
416bool ValidateLightf(Context *context, GLenum light, GLenum pname, GLfloat param)
417{
418 UNIMPLEMENTED();
419 return true;
420}
421
422bool ValidateLightfv(Context *context, GLenum light, GLenum pname, const GLfloat *params)
423{
424 UNIMPLEMENTED();
425 return true;
426}
427
428bool ValidateLightx(Context *context, GLenum light, GLenum pname, GLfixed param)
429{
430 UNIMPLEMENTED();
431 return true;
432}
433
434bool ValidateLightxv(Context *context, GLenum light, GLenum pname, const GLfixed *params)
435{
436 UNIMPLEMENTED();
437 return true;
438}
439
440bool ValidateLineWidthx(Context *context, GLfixed width)
441{
442 UNIMPLEMENTED();
443 return true;
444}
445
446bool ValidateLoadIdentity(Context *context)
447{
Lingfeng Yang3a41af62018-04-09 07:28:56 -0700448 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500449 return true;
450}
451
452bool ValidateLoadMatrixf(Context *context, const GLfloat *m)
453{
Lingfeng Yang3a41af62018-04-09 07:28:56 -0700454 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500455 return true;
456}
457
458bool ValidateLoadMatrixx(Context *context, const GLfixed *m)
459{
Lingfeng Yang3a41af62018-04-09 07:28:56 -0700460 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500461 return true;
462}
463
464bool ValidateLogicOp(Context *context, GLenum opcode)
465{
466 UNIMPLEMENTED();
467 return true;
468}
469
470bool ValidateMaterialf(Context *context, GLenum face, GLenum pname, GLfloat param)
471{
472 UNIMPLEMENTED();
473 return true;
474}
475
476bool ValidateMaterialfv(Context *context, GLenum face, GLenum pname, const GLfloat *params)
477{
478 UNIMPLEMENTED();
479 return true;
480}
481
482bool ValidateMaterialx(Context *context, GLenum face, GLenum pname, GLfixed param)
483{
484 UNIMPLEMENTED();
485 return true;
486}
487
488bool ValidateMaterialxv(Context *context, GLenum face, GLenum pname, const GLfixed *param)
489{
490 UNIMPLEMENTED();
491 return true;
492}
493
Lingfeng Yang00af4632018-04-02 12:42:24 -0700494bool ValidateMatrixMode(Context *context, MatrixType mode)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500495{
Lingfeng Yangd2488ab2018-04-04 09:25:48 -0700496 ANGLE_VALIDATE_IS_GLES1(context);
497 switch (mode)
498 {
499 case MatrixType::Projection:
500 case MatrixType::Modelview:
501 case MatrixType::Texture:
502 return true;
503 default:
504 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
505 return false;
506 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500507}
508
509bool ValidateMultMatrixf(Context *context, const GLfloat *m)
510{
Lingfeng Yang568fc392018-04-09 07:57:23 -0700511 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500512 return true;
513}
514
515bool ValidateMultMatrixx(Context *context, const GLfixed *m)
516{
Lingfeng Yang568fc392018-04-09 07:57:23 -0700517 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500518 return true;
519}
520
521bool ValidateMultiTexCoord4f(Context *context,
522 GLenum target,
523 GLfloat s,
524 GLfloat t,
525 GLfloat r,
526 GLfloat q)
527{
Lingfeng Yang038dd532018-03-29 17:31:52 -0700528 ANGLE_VALIDATE_IS_GLES1(context);
529 return ValidateMultitextureUnit(context, target);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500530}
531
532bool ValidateMultiTexCoord4x(Context *context,
Lingfeng Yang038dd532018-03-29 17:31:52 -0700533 GLenum target,
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500534 GLfixed s,
535 GLfixed t,
536 GLfixed r,
537 GLfixed q)
538{
Lingfeng Yang038dd532018-03-29 17:31:52 -0700539 ANGLE_VALIDATE_IS_GLES1(context);
540 return ValidateMultitextureUnit(context, target);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500541}
542
543bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz)
544{
Lingfeng Yang5a7e61b2018-03-29 16:50:32 -0700545 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500546 return true;
547}
548
549bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz)
550{
Lingfeng Yang5a7e61b2018-03-29 16:50:32 -0700551 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500552 return true;
553}
554
555bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer)
556{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700557 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Normal, 3, type,
558 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500559}
560
561bool ValidateOrthof(Context *context,
562 GLfloat l,
563 GLfloat r,
564 GLfloat b,
565 GLfloat t,
566 GLfloat n,
567 GLfloat f)
568{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700569 ANGLE_VALIDATE_IS_GLES1(context);
570 if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f)
571 {
572 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
573 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500574 return true;
575}
576
577bool ValidateOrthox(Context *context,
578 GLfixed l,
579 GLfixed r,
580 GLfixed b,
581 GLfixed t,
582 GLfixed n,
583 GLfixed f)
584{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700585 ANGLE_VALIDATE_IS_GLES1(context);
586 if (l == r || b == t || n == f || n <= 0 || f <= 0)
587 {
588 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
589 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500590 return true;
591}
592
593bool ValidatePointParameterf(Context *context, GLenum pname, GLfloat param)
594{
595 UNIMPLEMENTED();
596 return true;
597}
598
599bool ValidatePointParameterfv(Context *context, GLenum pname, const GLfloat *params)
600{
601 UNIMPLEMENTED();
602 return true;
603}
604
605bool ValidatePointParameterx(Context *context, GLenum pname, GLfixed param)
606{
607 UNIMPLEMENTED();
608 return true;
609}
610
611bool ValidatePointParameterxv(Context *context, GLenum pname, const GLfixed *params)
612{
613 UNIMPLEMENTED();
614 return true;
615}
616
617bool ValidatePointSize(Context *context, GLfloat size)
618{
619 UNIMPLEMENTED();
620 return true;
621}
622
623bool ValidatePointSizex(Context *context, GLfixed size)
624{
625 UNIMPLEMENTED();
626 return true;
627}
628
629bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units)
630{
631 UNIMPLEMENTED();
632 return true;
633}
634
635bool ValidatePopMatrix(Context *context)
636{
Lingfeng Yange547aac2018-04-05 09:39:20 -0700637 ANGLE_VALIDATE_IS_GLES1(context);
638 const auto &stack = context->getGLState().gles1().currentMatrixStack();
639 if (stack.size() == 1)
640 {
641 ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow);
642 return false;
643 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500644 return true;
645}
646
647bool ValidatePushMatrix(Context *context)
648{
Lingfeng Yange547aac2018-04-05 09:39:20 -0700649 ANGLE_VALIDATE_IS_GLES1(context);
650 const auto &stack = context->getGLState().gles1().currentMatrixStack();
651 if (stack.size() == stack.max_size())
652 {
653 ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow);
654 return false;
655 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500656 return true;
657}
658
659bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
660{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700661 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500662 return true;
663}
664
665bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
666{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700667 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500668 return true;
669}
670
671bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert)
672{
673 UNIMPLEMENTED();
674 return true;
675}
676
677bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z)
678{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700679 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500680 return true;
681}
682
683bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z)
684{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700685 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500686 return true;
687}
688
689bool ValidateShadeModel(Context *context, GLenum mode)
690{
691 UNIMPLEMENTED();
692 return true;
693}
694
695bool ValidateTexCoordPointer(Context *context,
696 GLint size,
697 GLenum type,
698 GLsizei stride,
699 const void *pointer)
700{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700701 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::TextureCoord, size,
702 type, stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500703}
704
705bool ValidateTexEnvf(Context *context, GLenum target, GLenum pname, GLfloat param)
706{
707 UNIMPLEMENTED();
708 return true;
709}
710
711bool ValidateTexEnvfv(Context *context, GLenum target, GLenum pname, const GLfloat *params)
712{
713 UNIMPLEMENTED();
714 return true;
715}
716
717bool ValidateTexEnvi(Context *context, GLenum target, GLenum pname, GLint param)
718{
719 UNIMPLEMENTED();
720 return true;
721}
722
723bool ValidateTexEnviv(Context *context, GLenum target, GLenum pname, const GLint *params)
724{
725 UNIMPLEMENTED();
726 return true;
727}
728
729bool ValidateTexEnvx(Context *context, GLenum target, GLenum pname, GLfixed param)
730{
731 UNIMPLEMENTED();
732 return true;
733}
734
735bool ValidateTexEnvxv(Context *context, GLenum target, GLenum pname, const GLfixed *params)
736{
737 UNIMPLEMENTED();
738 return true;
739}
740
Corentin Wallezf0e89be2017-11-08 14:00:32 -0800741bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500742{
743 UNIMPLEMENTED();
744 return true;
745}
746
Corentin Wallezf0e89be2017-11-08 14:00:32 -0800747bool ValidateTexParameterxv(Context *context,
748 TextureType target,
749 GLenum pname,
750 const GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500751{
752 UNIMPLEMENTED();
753 return true;
754}
755
756bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z)
757{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700758 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500759 return true;
760}
761
762bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z)
763{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700764 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500765 return true;
766}
767
768bool ValidateVertexPointer(Context *context,
769 GLint size,
770 GLenum type,
771 GLsizei stride,
772 const void *pointer)
773{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700774 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Vertex, size, type,
775 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500776}
777
778bool ValidateDrawTexfOES(Context *context,
779 GLfloat x,
780 GLfloat y,
781 GLfloat z,
782 GLfloat width,
783 GLfloat height)
784{
785 UNIMPLEMENTED();
786 return true;
787}
788
789bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords)
790{
791 UNIMPLEMENTED();
792 return true;
793}
794
795bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height)
796{
797 UNIMPLEMENTED();
798 return true;
799}
800
801bool ValidateDrawTexivOES(Context *context, const GLint *coords)
802{
803 UNIMPLEMENTED();
804 return true;
805}
806
807bool ValidateDrawTexsOES(Context *context,
808 GLshort x,
809 GLshort y,
810 GLshort z,
811 GLshort width,
812 GLshort height)
813{
814 UNIMPLEMENTED();
815 return true;
816}
817
818bool ValidateDrawTexsvOES(Context *context, const GLshort *coords)
819{
820 UNIMPLEMENTED();
821 return true;
822}
823
824bool ValidateDrawTexxOES(Context *context,
825 GLfixed x,
826 GLfixed y,
827 GLfixed z,
828 GLfixed width,
829 GLfixed height)
830{
831 UNIMPLEMENTED();
832 return true;
833}
834
835bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords)
836{
837 UNIMPLEMENTED();
838 return true;
839}
840
841bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex)
842{
843 UNIMPLEMENTED();
844 return true;
845}
846
847bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context)
848{
849 UNIMPLEMENTED();
850 return true;
851}
852
853bool ValidateMatrixIndexPointerOES(Context *context,
854 GLint size,
855 GLenum type,
856 GLsizei stride,
857 const void *pointer)
858{
859 UNIMPLEMENTED();
860 return true;
861}
862
863bool ValidateWeightPointerOES(Context *context,
864 GLint size,
865 GLenum type,
866 GLsizei stride,
867 const void *pointer)
868{
869 UNIMPLEMENTED();
870 return true;
871}
872
873bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer)
874{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700875 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::PointSize, 1, type,
876 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500877}
878
879bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent)
880{
881 UNIMPLEMENTED();
882 return true;
883}
Lingfeng Yanga0648782018-03-12 14:45:25 -0700884
885bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers)
886{
887 UNIMPLEMENTED();
888 return true;
889}
890
891bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers)
892{
893 UNIMPLEMENTED();
894 return true;
895}
896
897bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers)
898{
899 UNIMPLEMENTED();
900 return true;
901}
902
903bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers)
904{
905 UNIMPLEMENTED();
906 return true;
907}
908
909bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer)
910{
911 UNIMPLEMENTED();
912 return true;
913}
914
915bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer)
916{
917 UNIMPLEMENTED();
918 return true;
919}
920
921bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target)
922{
923 UNIMPLEMENTED();
924 return true;
925}
926
927bool ValidateFramebufferRenderbufferOES(Context *context,
928 GLenum target,
929 GLenum attachment,
930 GLenum rbtarget,
931 GLuint renderbuffer)
932{
933 UNIMPLEMENTED();
934 return true;
935}
936
937bool ValidateFramebufferTexture2DOES(Context *context,
938 GLenum target,
939 GLenum attachment,
940 TextureTarget textarget,
941 GLuint texture,
942 GLint level)
943{
944 UNIMPLEMENTED();
945 return true;
946}
947
948bool ValidateGenerateMipmapOES(Context *context, TextureType target)
949{
950 UNIMPLEMENTED();
951 return true;
952}
953
954bool ValidateGetFramebufferAttachmentParameterivOES(Context *context,
955 GLenum target,
956 GLenum attachment,
957 GLenum pname,
958 GLint *params)
959{
960 UNIMPLEMENTED();
961 return true;
962}
963
964bool ValidateGetRenderbufferParameterivOES(Context *context,
965 GLenum target,
966 GLenum pname,
967 GLint *params)
968{
969 UNIMPLEMENTED();
970 return true;
971}
972
973bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer)
974{
975 UNIMPLEMENTED();
976 return true;
977}
978
979bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer)
980{
981 UNIMPLEMENTED();
982 return true;
983}
984
985bool ValidateRenderbufferStorageOES(Context *context,
986 GLenum target,
987 GLint internalformat,
988 GLsizei width,
989 GLsizei height)
990{
991 UNIMPLEMENTED();
992 return true;
993}
994
995// GL_OES_texture_cube_map
996
997bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params)
998{
999 UNIMPLEMENTED();
1000 return true;
1001}
1002
1003bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params)
1004{
1005 UNIMPLEMENTED();
1006 return true;
1007}
1008
1009bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params)
1010{
1011 UNIMPLEMENTED();
1012 return true;
1013}
1014
1015bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params)
1016{
1017 UNIMPLEMENTED();
1018 return true;
1019}
1020
1021bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param)
1022{
1023 UNIMPLEMENTED();
1024 return true;
1025}
1026
1027bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param)
1028{
1029 UNIMPLEMENTED();
1030 return true;
1031}
1032
1033bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param)
1034{
1035 UNIMPLEMENTED();
1036 return true;
1037}
1038
1039bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param)
1040{
1041 UNIMPLEMENTED();
1042 return true;
1043}
1044
1045bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param)
1046{
1047 UNIMPLEMENTED();
1048 return true;
1049}
Lingfeng Yang01074432018-04-16 10:19:51 -07001050
1051} // namespace gl