blob: 4ec2c53b539e1ba4c588645ff529374721743f73 [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 Yangd0febe72018-05-17 22:36:52 -070014#include "libANGLE/GLES1State.h"
Lingfeng Yang45b5a872018-06-07 11:33:25 -070015#include "libANGLE/queryconversions.h"
Lingfeng Yangd0febe72018-05-17 22:36:52 -070016#include "libANGLE/queryutils.h"
Lingfeng Yang038dd532018-03-29 17:31:52 -070017#include "libANGLE/validationES.h"
Lingfeng Yang13b708f2018-03-21 12:14:10 -070018
19#define ANGLE_VALIDATE_IS_GLES1(context) \
20 if (context->getClientMajorVersion() > 1) \
21 { \
22 ANGLE_VALIDATION_ERR(context, InvalidOperation(), GLES1Only); \
23 return false; \
24 }
25
Lingfeng Yang01074432018-04-16 10:19:51 -070026namespace gl
Lingfeng Yang13b708f2018-03-21 12:14:10 -070027{
28
Lingfeng Yangabb09f12018-04-16 10:43:53 -070029bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func)
Lingfeng Yang13b708f2018-03-21 12:14:10 -070030{
31 switch (func)
32 {
Lingfeng Yangabb09f12018-04-16 10:43:53 -070033 case AlphaTestFunc::AlwaysPass:
34 case AlphaTestFunc::Equal:
35 case AlphaTestFunc::Gequal:
36 case AlphaTestFunc::Greater:
37 case AlphaTestFunc::Lequal:
38 case AlphaTestFunc::Less:
39 case AlphaTestFunc::Never:
40 case AlphaTestFunc::NotEqual:
Lingfeng Yang13b708f2018-03-21 12:14:10 -070041 return true;
42 default:
Lingfeng Yang01074432018-04-16 10:19:51 -070043 ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
Lingfeng Yang13b708f2018-03-21 12:14:10 -070044 return false;
45 }
46}
47
Lingfeng Yangabb09f12018-04-16 10:43:53 -070048bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType)
Lingfeng Yang01074432018-04-16 10:19:51 -070049{
50 ANGLE_VALIDATE_IS_GLES1(context);
51 switch (arrayType)
52 {
Lingfeng Yangabb09f12018-04-16 10:43:53 -070053 case ClientVertexArrayType::Vertex:
54 case ClientVertexArrayType::Normal:
55 case ClientVertexArrayType::Color:
56 case ClientVertexArrayType::TextureCoord:
Lingfeng Yang01074432018-04-16 10:19:51 -070057 return true;
Lingfeng Yangabb09f12018-04-16 10:43:53 -070058 case ClientVertexArrayType::PointSize:
Lingfeng Yang01074432018-04-16 10:19:51 -070059 if (!context->getExtensions().pointSizeArray)
60 {
61 ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled);
62 return false;
63 }
64 return true;
65 default:
66 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClientState);
67 return false;
68 }
69}
70
Lingfeng Yangabb09f12018-04-16 10:43:53 -070071bool ValidateBuiltinVertexAttributeCommon(Context *context,
72 ClientVertexArrayType arrayType,
73 GLint size,
74 GLenum type,
75 GLsizei stride,
76 const void *pointer)
77{
78 ANGLE_VALIDATE_IS_GLES1(context);
79
80 if (stride < 0)
81 {
82 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerStride);
83 return false;
84 }
85
86 int minSize = 1;
87 int maxSize = 4;
88
89 switch (arrayType)
90 {
91 case ClientVertexArrayType::Vertex:
92 case ClientVertexArrayType::TextureCoord:
93 minSize = 2;
94 maxSize = 4;
95 break;
96 case ClientVertexArrayType::Normal:
97 minSize = 3;
98 maxSize = 3;
99 break;
100 case ClientVertexArrayType::Color:
101 minSize = 4;
102 maxSize = 4;
103 break;
104 case ClientVertexArrayType::PointSize:
105 if (!context->getExtensions().pointSizeArray)
106 {
107 ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled);
108 return false;
109 }
110
111 minSize = 1;
112 maxSize = 1;
113 break;
114 default:
115 UNREACHABLE();
116 return false;
117 }
118
119 if (size < minSize || size > maxSize)
120 {
121 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerSize);
122 return false;
123 }
124
125 switch (type)
126 {
127 case GL_BYTE:
128 if (arrayType == ClientVertexArrayType::PointSize)
129 {
130 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType);
131 return false;
132 }
133 break;
134 case GL_SHORT:
135 if (arrayType == ClientVertexArrayType::PointSize ||
136 arrayType == ClientVertexArrayType::Color)
137 {
138 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType);
139 return false;
140 }
141 break;
142 case GL_FIXED:
143 case GL_FLOAT:
144 break;
145 default:
146 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType);
147 return false;
148 }
149
150 return true;
151}
152
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700153bool ValidateLightCaps(Context *context, GLenum light)
154{
155 if (light < GL_LIGHT0 || light >= GL_LIGHT0 + context->getCaps().maxLights)
156 {
157 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLight);
158 return false;
159 }
160
161 return true;
162}
163
164bool ValidateLightCommon(Context *context,
165 GLenum light,
166 LightParameter pname,
167 const GLfloat *params)
168{
169
170 ANGLE_VALIDATE_IS_GLES1(context);
171
172 if (!ValidateLightCaps(context, light))
173 {
174 return false;
175 }
176
177 switch (pname)
178 {
179 case LightParameter::Ambient:
180 case LightParameter::Diffuse:
181 case LightParameter::Specular:
182 case LightParameter::Position:
183 case LightParameter::SpotDirection:
184 return true;
185 case LightParameter::SpotExponent:
186 if (params[0] < 0.0f || params[0] > 128.0f)
187 {
188 ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange);
189 return false;
190 }
191 return true;
192 case LightParameter::SpotCutoff:
193 if (params[0] == 180.0f)
194 {
195 return true;
196 }
197 if (params[0] < 0.0f || params[0] > 90.0f)
198 {
199 ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange);
200 return false;
201 }
202 return true;
203 case LightParameter::ConstantAttenuation:
204 case LightParameter::LinearAttenuation:
205 case LightParameter::QuadraticAttenuation:
206 if (params[0] < 0.0f)
207 {
208 ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange);
209 return false;
210 }
211 return true;
212 default:
213 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightParameter);
214 return false;
215 }
216}
217
218bool ValidateLightSingleComponent(Context *context,
219 GLenum light,
220 LightParameter pname,
221 GLfloat param)
222{
223 if (!ValidateLightCommon(context, light, pname, &param))
224 {
225 return false;
226 }
227
228 if (GetLightParameterCount(pname) > 1)
229 {
230 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightParameter);
231 return false;
232 }
233
234 return true;
235}
236
237bool ValidateMaterialCommon(Context *context,
238 GLenum face,
239 MaterialParameter pname,
240 const GLfloat *params)
241{
242 ANGLE_VALIDATE_IS_GLES1(context);
243
244 if (face != GL_FRONT_AND_BACK)
245 {
246 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace);
247 return false;
248 }
249
250 switch (pname)
251 {
252 case MaterialParameter::Ambient:
253 case MaterialParameter::Diffuse:
254 case MaterialParameter::Specular:
255 case MaterialParameter::Emission:
256 return true;
257 case MaterialParameter::Shininess:
258 if (params[0] < 0.0f || params[0] > 128.0f)
259 {
260 ANGLE_VALIDATION_ERR(context, InvalidValue(), MaterialParameterOutOfRange);
261 return false;
262 }
263 return true;
264 default:
265 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialParameter);
266 return false;
267 }
268}
269
270bool ValidateMaterialSingleComponent(Context *context,
271 GLenum face,
272 MaterialParameter pname,
273 GLfloat param)
274{
275 if (!ValidateMaterialCommon(context, face, pname, &param))
276 {
277 return false;
278 }
279
280 if (GetMaterialParameterCount(pname) > 1)
281 {
282 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialParameter);
283 return false;
284 }
285
286 return true;
287}
288
289bool ValidateLightModelCommon(Context *context, GLenum pname)
290{
291 ANGLE_VALIDATE_IS_GLES1(context);
292 switch (pname)
293 {
294 case GL_LIGHT_MODEL_AMBIENT:
295 case GL_LIGHT_MODEL_TWO_SIDE:
296 return true;
297 default:
298 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightModelParameter);
299 return false;
300 }
301}
302
303bool ValidateLightModelSingleComponent(Context *context, GLenum pname)
304{
305 if (!ValidateLightModelCommon(context, pname))
306 {
307 return false;
308 }
309
310 switch (pname)
311 {
312 case GL_LIGHT_MODEL_TWO_SIDE:
313 return true;
314 default:
315 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightModelParameter);
316 return false;
317 }
318}
319
Lingfeng Yang060088a2018-05-30 20:40:57 -0700320bool ValidateClipPlaneCommon(Context *context, GLenum plane)
321{
322 ANGLE_VALIDATE_IS_GLES1(context);
323
324 if (plane < GL_CLIP_PLANE0 || plane >= GL_CLIP_PLANE0 + context->getCaps().maxClipPlanes)
325 {
326 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClipPlane);
327 return false;
328 }
329
330 return true;
331}
332
Lingfeng Yang7ba3f422018-06-01 09:43:04 -0700333bool ValidateFogCommon(Context *context, GLenum pname, const GLfloat *params)
334{
335 ANGLE_VALIDATE_IS_GLES1(context);
336
337 switch (pname)
338 {
339 case GL_FOG_MODE:
340 {
341 GLenum modeParam = static_cast<GLenum>(params[0]);
342 switch (modeParam)
343 {
344 case GL_EXP:
345 case GL_EXP2:
346 case GL_LINEAR:
347 return true;
348 default:
349 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidFogMode);
350 return false;
351 }
352 }
353 break;
354 case GL_FOG_START:
355 case GL_FOG_END:
356 case GL_FOG_COLOR:
357 break;
358 case GL_FOG_DENSITY:
359 if (params[0] < 0.0f)
360 {
361 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidFogDensity);
362 return false;
363 }
364 break;
365 default:
366 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFogParameter);
367 return false;
368 }
369 return true;
370}
371
Lingfeng Yang45b5a872018-06-07 11:33:25 -0700372bool ValidateTexEnvCommon(Context *context,
373 TextureEnvTarget target,
374 TextureEnvParameter pname,
375 const GLfloat *params)
376{
377 ANGLE_VALIDATE_IS_GLES1(context);
378
379 if (target != TextureEnvTarget::Env)
380 {
381 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvTarget);
382 return false;
383 }
384
385 switch (pname)
386 {
387 case TextureEnvParameter::Mode:
388 {
389 TextureEnvMode mode = FromGLenum<TextureEnvMode>(ConvertToGLenum(params[0]));
390 switch (mode)
391 {
392 case TextureEnvMode::Add:
393 case TextureEnvMode::Blend:
394 case TextureEnvMode::Combine:
395 case TextureEnvMode::Decal:
396 case TextureEnvMode::Modulate:
397 case TextureEnvMode::Replace:
398 break;
399 default:
400 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureEnvMode);
401 return false;
402 }
403 break;
404 }
405 case TextureEnvParameter::CombineRgb:
406 case TextureEnvParameter::CombineAlpha:
407 {
408 TextureCombine combine = FromGLenum<TextureCombine>(ConvertToGLenum(params[0]));
409 switch (combine)
410 {
411 case TextureCombine::Add:
412 case TextureCombine::AddSigned:
413 case TextureCombine::Interpolate:
414 case TextureCombine::Modulate:
415 case TextureCombine::Replace:
416 case TextureCombine::Subtract:
417 break;
418 case TextureCombine::Dot3Rgb:
419 case TextureCombine::Dot3Rgba:
420 if (pname == TextureEnvParameter::CombineAlpha)
421 {
422 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombine);
423 return false;
424 }
425 break;
426 default:
427 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombine);
428 return false;
429 }
430 break;
431 }
432 case TextureEnvParameter::Src0Rgb:
433 case TextureEnvParameter::Src1Rgb:
434 case TextureEnvParameter::Src2Rgb:
435 case TextureEnvParameter::Src0Alpha:
436 case TextureEnvParameter::Src1Alpha:
437 case TextureEnvParameter::Src2Alpha:
438 {
439 TextureSrc combine = FromGLenum<TextureSrc>(ConvertToGLenum(params[0]));
440 switch (combine)
441 {
442 case TextureSrc::Constant:
443 case TextureSrc::Previous:
444 case TextureSrc::PrimaryColor:
445 case TextureSrc::Texture:
446 break;
447 default:
448 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombineSrc);
449 return false;
450 }
451 break;
452 }
453 case TextureEnvParameter::Op0Rgb:
454 case TextureEnvParameter::Op1Rgb:
455 case TextureEnvParameter::Op2Rgb:
456 case TextureEnvParameter::Op0Alpha:
457 case TextureEnvParameter::Op1Alpha:
458 case TextureEnvParameter::Op2Alpha:
459 {
460 TextureOp operand = FromGLenum<TextureOp>(ConvertToGLenum(params[0]));
461 switch (operand)
462 {
463 case TextureOp::SrcAlpha:
464 case TextureOp::OneMinusSrcAlpha:
465 break;
466 case TextureOp::SrcColor:
467 case TextureOp::OneMinusSrcColor:
468 if (pname == TextureEnvParameter::Op0Alpha ||
469 pname == TextureEnvParameter::Op1Alpha ||
470 pname == TextureEnvParameter::Op2Alpha)
471 {
472 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombine);
473 return false;
474 }
475 break;
476 default:
477 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombineOp);
478 return false;
479 }
480 break;
481 }
482 case TextureEnvParameter::RgbScale:
483 case TextureEnvParameter::AlphaScale:
484 if (params[0] != 1.0f && params[0] != 2.0f && params[0] != 4.0f)
485 {
486 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureEnvScale);
487 return false;
488 }
489 break;
490 case TextureEnvParameter::Color:
491 break;
492 default:
493 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvParameter);
494 return false;
495 }
496 return true;
497}
498
499bool ValidateGetTexEnvCommon(Context *context, TextureEnvTarget target, TextureEnvParameter pname)
500{
501 GLfloat dummy[4] = {};
502 switch (pname)
503 {
504 case TextureEnvParameter::Mode:
505 ConvertPackedEnum(TextureEnvMode::Add, dummy);
506 break;
507 case TextureEnvParameter::CombineRgb:
508 case TextureEnvParameter::CombineAlpha:
509 ConvertPackedEnum(TextureCombine::Add, dummy);
510 break;
511 case TextureEnvParameter::Src0Rgb:
512 case TextureEnvParameter::Src1Rgb:
513 case TextureEnvParameter::Src2Rgb:
514 case TextureEnvParameter::Src0Alpha:
515 case TextureEnvParameter::Src1Alpha:
516 case TextureEnvParameter::Src2Alpha:
517 ConvertPackedEnum(TextureSrc::Constant, dummy);
518 break;
519 case TextureEnvParameter::Op0Rgb:
520 case TextureEnvParameter::Op1Rgb:
521 case TextureEnvParameter::Op2Rgb:
522 case TextureEnvParameter::Op0Alpha:
523 case TextureEnvParameter::Op1Alpha:
524 case TextureEnvParameter::Op2Alpha:
525 ConvertPackedEnum(TextureOp::SrcAlpha, dummy);
526 break;
527 case TextureEnvParameter::RgbScale:
528 case TextureEnvParameter::AlphaScale:
529 dummy[0] = 1.0f;
530 break;
531 default:
532 break;
533 }
534
535 return ValidateTexEnvCommon(context, target, pname, dummy);
536}
537
Lingfeng Yang01074432018-04-16 10:19:51 -0700538} // namespace gl
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500539
540namespace gl
541{
542
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700543bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500544{
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700545 ANGLE_VALIDATE_IS_GLES1(context);
546 return ValidateAlphaFuncCommon(context, func);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500547}
548
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700549bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500550{
Lingfeng Yang13b708f2018-03-21 12:14:10 -0700551 ANGLE_VALIDATE_IS_GLES1(context);
552 return ValidateAlphaFuncCommon(context, func);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500553}
554
555bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
556{
557 UNIMPLEMENTED();
558 return true;
559}
560
561bool ValidateClearDepthx(Context *context, GLfixed depth)
562{
563 UNIMPLEMENTED();
564 return true;
565}
566
567bool ValidateClientActiveTexture(Context *context, GLenum texture)
568{
Lingfeng Yang96310cd2018-03-28 11:56:28 -0700569 ANGLE_VALIDATE_IS_GLES1(context);
Lingfeng Yang038dd532018-03-29 17:31:52 -0700570 return ValidateMultitextureUnit(context, texture);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500571}
572
Lingfeng Yang060088a2018-05-30 20:40:57 -0700573bool ValidateClipPlanef(Context *context, GLenum plane, const GLfloat *eqn)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500574{
Lingfeng Yang060088a2018-05-30 20:40:57 -0700575 return ValidateClipPlaneCommon(context, plane);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500576}
577
578bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation)
579{
Lingfeng Yang060088a2018-05-30 20:40:57 -0700580 return ValidateClipPlaneCommon(context, plane);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500581}
582
583bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
584{
Lingfeng Yanga43994c2018-03-29 07:21:41 -0700585 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500586 return true;
587}
588
589bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
590{
Lingfeng Yanga43994c2018-03-29 07:21:41 -0700591 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500592 return true;
593}
594
595bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
596{
Lingfeng Yanga43994c2018-03-29 07:21:41 -0700597 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500598 return true;
599}
600
601bool ValidateColorPointer(Context *context,
602 GLint size,
603 GLenum type,
604 GLsizei stride,
605 const void *pointer)
606{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700607 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Color, size, type,
608 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500609}
610
611bool ValidateCullFace(Context *context, GLenum mode)
612{
613 UNIMPLEMENTED();
614 return true;
615}
616
617bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f)
618{
619 UNIMPLEMENTED();
620 return true;
621}
622
Lingfeng Yang01074432018-04-16 10:19:51 -0700623bool ValidateDisableClientState(Context *context, ClientVertexArrayType arrayType)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500624{
Lingfeng Yang01074432018-04-16 10:19:51 -0700625 return ValidateClientStateCommon(context, arrayType);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500626}
627
Lingfeng Yang01074432018-04-16 10:19:51 -0700628bool ValidateEnableClientState(Context *context, ClientVertexArrayType arrayType)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500629{
Lingfeng Yang01074432018-04-16 10:19:51 -0700630 return ValidateClientStateCommon(context, arrayType);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500631}
632
633bool ValidateFogf(Context *context, GLenum pname, GLfloat param)
634{
Lingfeng Yang7ba3f422018-06-01 09:43:04 -0700635 return ValidateFogCommon(context, pname, &param);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500636}
637
638bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params)
639{
Lingfeng Yang7ba3f422018-06-01 09:43:04 -0700640 return ValidateFogCommon(context, pname, params);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500641}
642
643bool ValidateFogx(Context *context, GLenum pname, GLfixed param)
644{
Lingfeng Yang7ba3f422018-06-01 09:43:04 -0700645 GLfloat asFloat = FixedToFloat(param);
646 return ValidateFogCommon(context, pname, &asFloat);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500647}
648
Lingfeng Yang7ba3f422018-06-01 09:43:04 -0700649bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500650{
Lingfeng Yang7ba3f422018-06-01 09:43:04 -0700651 unsigned int paramCount = GetFogParameterCount(pname);
652 GLfloat paramsf[4] = {};
653
654 for (unsigned int i = 0; i < paramCount; i++)
655 {
656 paramsf[i] = FixedToFloat(params[i]);
657 }
658
659 return ValidateFogCommon(context, pname, paramsf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500660}
661
662bool ValidateFrustumf(Context *context,
663 GLfloat l,
664 GLfloat r,
665 GLfloat b,
666 GLfloat t,
667 GLfloat n,
668 GLfloat f)
669{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700670 ANGLE_VALIDATE_IS_GLES1(context);
671 if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f)
672 {
673 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
674 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500675 return true;
676}
677
678bool ValidateFrustumx(Context *context,
679 GLfixed l,
680 GLfixed r,
681 GLfixed b,
682 GLfixed t,
683 GLfixed n,
684 GLfixed f)
685{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700686 ANGLE_VALIDATE_IS_GLES1(context);
687 if (l == r || b == t || n == f || n <= 0 || f <= 0)
688 {
689 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
690 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500691 return true;
692}
693
694bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params)
695{
696 UNIMPLEMENTED();
697 return true;
698}
699
700bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation)
701{
Lingfeng Yang060088a2018-05-30 20:40:57 -0700702 return ValidateClipPlaneCommon(context, plane);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500703}
704
705bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation)
706{
Lingfeng Yang060088a2018-05-30 20:40:57 -0700707 return ValidateClipPlaneCommon(context, plane);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500708}
709
710bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params)
711{
712 UNIMPLEMENTED();
713 return true;
714}
715
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700716bool ValidateGetLightfv(Context *context, GLenum light, LightParameter pname, GLfloat *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500717{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700718 GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
719 return ValidateLightCommon(context, light, pname, dummyParams);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500720}
721
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700722bool ValidateGetLightxv(Context *context, GLenum light, LightParameter pname, GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500723{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700724 GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
725 return ValidateLightCommon(context, light, pname, dummyParams);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500726}
727
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700728bool ValidateGetMaterialfv(Context *context, GLenum face, MaterialParameter pname, GLfloat *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500729{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700730 GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
731 return ValidateMaterialCommon(context, face, pname, dummyParams);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500732}
733
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700734bool ValidateGetMaterialxv(Context *context, GLenum face, MaterialParameter pname, GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500735{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700736 GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f};
737 return ValidateMaterialCommon(context, face, pname, dummyParams);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500738}
739
740bool ValidateGetPointerv(Context *context, GLenum pname, void **params)
741{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700742 ANGLE_VALIDATE_IS_GLES1(context);
743 switch (pname)
744 {
745 case GL_VERTEX_ARRAY_POINTER:
746 case GL_NORMAL_ARRAY_POINTER:
747 case GL_COLOR_ARRAY_POINTER:
748 case GL_TEXTURE_COORD_ARRAY_POINTER:
749 case GL_POINT_SIZE_ARRAY_POINTER_OES:
750 return true;
751 default:
752 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointerQuery);
753 return false;
754 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500755}
756
Lingfeng Yang74be2962018-06-07 09:13:38 -0700757bool ValidateGetTexEnvfv(Context *context,
758 TextureEnvTarget target,
759 TextureEnvParameter pname,
760 GLfloat *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500761{
Lingfeng Yang45b5a872018-06-07 11:33:25 -0700762 return ValidateGetTexEnvCommon(context, target, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500763}
764
Lingfeng Yang74be2962018-06-07 09:13:38 -0700765bool ValidateGetTexEnviv(Context *context,
766 TextureEnvTarget target,
767 TextureEnvParameter pname,
768 GLint *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500769{
Lingfeng Yang45b5a872018-06-07 11:33:25 -0700770 return ValidateGetTexEnvCommon(context, target, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500771}
772
Lingfeng Yang74be2962018-06-07 09:13:38 -0700773bool ValidateGetTexEnvxv(Context *context,
774 TextureEnvTarget target,
775 TextureEnvParameter pname,
776 GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500777{
Lingfeng Yang45b5a872018-06-07 11:33:25 -0700778 return ValidateGetTexEnvCommon(context, target, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500779}
780
Corentin Wallezf0e89be2017-11-08 14:00:32 -0800781bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500782{
783 UNIMPLEMENTED();
784 return true;
785}
786
787bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param)
788{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700789 return ValidateLightModelSingleComponent(context, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500790}
791
792bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params)
793{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700794 return ValidateLightModelCommon(context, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500795}
796
797bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param)
798{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700799 return ValidateLightModelSingleComponent(context, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500800}
801
802bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param)
803{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700804 return ValidateLightModelCommon(context, pname);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500805}
806
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700807bool ValidateLightf(Context *context, GLenum light, LightParameter pname, GLfloat param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500808{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700809 return ValidateLightSingleComponent(context, light, pname, param);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500810}
811
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700812bool ValidateLightfv(Context *context, GLenum light, LightParameter pname, const GLfloat *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500813{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700814 return ValidateLightCommon(context, light, pname, params);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500815}
816
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700817bool ValidateLightx(Context *context, GLenum light, LightParameter pname, GLfixed param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500818{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700819 return ValidateLightSingleComponent(context, light, pname, FixedToFloat(param));
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500820}
821
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700822bool ValidateLightxv(Context *context, GLenum light, LightParameter pname, const GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500823{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700824 GLfloat paramsf[4];
825 for (unsigned int i = 0; i < GetLightParameterCount(pname); i++)
826 {
827 paramsf[i] = FixedToFloat(params[i]);
828 }
829
830 return ValidateLightCommon(context, light, pname, paramsf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500831}
832
833bool ValidateLineWidthx(Context *context, GLfixed width)
834{
835 UNIMPLEMENTED();
836 return true;
837}
838
839bool ValidateLoadIdentity(Context *context)
840{
Lingfeng Yang3a41af62018-04-09 07:28:56 -0700841 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500842 return true;
843}
844
845bool ValidateLoadMatrixf(Context *context, const GLfloat *m)
846{
Lingfeng Yang3a41af62018-04-09 07:28:56 -0700847 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500848 return true;
849}
850
851bool ValidateLoadMatrixx(Context *context, const GLfixed *m)
852{
Lingfeng Yang3a41af62018-04-09 07:28:56 -0700853 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500854 return true;
855}
856
857bool ValidateLogicOp(Context *context, GLenum opcode)
858{
859 UNIMPLEMENTED();
860 return true;
861}
862
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700863bool ValidateMaterialf(Context *context, GLenum face, MaterialParameter pname, GLfloat param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500864{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700865 return ValidateMaterialSingleComponent(context, face, pname, param);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500866}
867
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700868bool ValidateMaterialfv(Context *context,
869 GLenum face,
870 MaterialParameter pname,
871 const GLfloat *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500872{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700873 return ValidateMaterialCommon(context, face, pname, params);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500874}
875
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700876bool ValidateMaterialx(Context *context, GLenum face, MaterialParameter pname, GLfixed param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500877{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700878 return ValidateMaterialSingleComponent(context, face, pname, FixedToFloat(param));
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500879}
880
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700881bool ValidateMaterialxv(Context *context,
882 GLenum face,
883 MaterialParameter pname,
884 const GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500885{
Lingfeng Yangd0febe72018-05-17 22:36:52 -0700886 GLfloat paramsf[4];
887
888 for (unsigned int i = 0; i < GetMaterialParameterCount(pname); i++)
889 {
890 paramsf[i] = FixedToFloat(params[i]);
891 }
892
893 return ValidateMaterialCommon(context, face, pname, paramsf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500894}
895
Lingfeng Yang00af4632018-04-02 12:42:24 -0700896bool ValidateMatrixMode(Context *context, MatrixType mode)
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500897{
Lingfeng Yangd2488ab2018-04-04 09:25:48 -0700898 ANGLE_VALIDATE_IS_GLES1(context);
899 switch (mode)
900 {
901 case MatrixType::Projection:
902 case MatrixType::Modelview:
903 case MatrixType::Texture:
904 return true;
905 default:
906 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
907 return false;
908 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500909}
910
911bool ValidateMultMatrixf(Context *context, const GLfloat *m)
912{
Lingfeng Yang568fc392018-04-09 07:57:23 -0700913 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500914 return true;
915}
916
917bool ValidateMultMatrixx(Context *context, const GLfixed *m)
918{
Lingfeng Yang568fc392018-04-09 07:57:23 -0700919 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500920 return true;
921}
922
923bool ValidateMultiTexCoord4f(Context *context,
924 GLenum target,
925 GLfloat s,
926 GLfloat t,
927 GLfloat r,
928 GLfloat q)
929{
Lingfeng Yang038dd532018-03-29 17:31:52 -0700930 ANGLE_VALIDATE_IS_GLES1(context);
931 return ValidateMultitextureUnit(context, target);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500932}
933
934bool ValidateMultiTexCoord4x(Context *context,
Lingfeng Yang038dd532018-03-29 17:31:52 -0700935 GLenum target,
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500936 GLfixed s,
937 GLfixed t,
938 GLfixed r,
939 GLfixed q)
940{
Lingfeng Yang038dd532018-03-29 17:31:52 -0700941 ANGLE_VALIDATE_IS_GLES1(context);
942 return ValidateMultitextureUnit(context, target);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500943}
944
945bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz)
946{
Lingfeng Yang5a7e61b2018-03-29 16:50:32 -0700947 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500948 return true;
949}
950
951bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz)
952{
Lingfeng Yang5a7e61b2018-03-29 16:50:32 -0700953 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500954 return true;
955}
956
957bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer)
958{
Lingfeng Yangabb09f12018-04-16 10:43:53 -0700959 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Normal, 3, type,
960 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500961}
962
963bool ValidateOrthof(Context *context,
964 GLfloat l,
965 GLfloat r,
966 GLfloat b,
967 GLfloat t,
968 GLfloat n,
969 GLfloat f)
970{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700971 ANGLE_VALIDATE_IS_GLES1(context);
972 if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f)
973 {
974 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
975 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500976 return true;
977}
978
979bool ValidateOrthox(Context *context,
980 GLfixed l,
981 GLfixed r,
982 GLfixed b,
983 GLfixed t,
984 GLfixed n,
985 GLfixed f)
986{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -0700987 ANGLE_VALIDATE_IS_GLES1(context);
988 if (l == r || b == t || n == f || n <= 0 || f <= 0)
989 {
990 ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix);
991 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500992 return true;
993}
994
995bool ValidatePointParameterf(Context *context, GLenum pname, GLfloat param)
996{
997 UNIMPLEMENTED();
998 return true;
999}
1000
1001bool ValidatePointParameterfv(Context *context, GLenum pname, const GLfloat *params)
1002{
1003 UNIMPLEMENTED();
1004 return true;
1005}
1006
1007bool ValidatePointParameterx(Context *context, GLenum pname, GLfixed param)
1008{
1009 UNIMPLEMENTED();
1010 return true;
1011}
1012
1013bool ValidatePointParameterxv(Context *context, GLenum pname, const GLfixed *params)
1014{
1015 UNIMPLEMENTED();
1016 return true;
1017}
1018
1019bool ValidatePointSize(Context *context, GLfloat size)
1020{
1021 UNIMPLEMENTED();
1022 return true;
1023}
1024
1025bool ValidatePointSizex(Context *context, GLfixed size)
1026{
1027 UNIMPLEMENTED();
1028 return true;
1029}
1030
1031bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units)
1032{
1033 UNIMPLEMENTED();
1034 return true;
1035}
1036
1037bool ValidatePopMatrix(Context *context)
1038{
Lingfeng Yange547aac2018-04-05 09:39:20 -07001039 ANGLE_VALIDATE_IS_GLES1(context);
1040 const auto &stack = context->getGLState().gles1().currentMatrixStack();
1041 if (stack.size() == 1)
1042 {
1043 ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow);
1044 return false;
1045 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001046 return true;
1047}
1048
1049bool ValidatePushMatrix(Context *context)
1050{
Lingfeng Yange547aac2018-04-05 09:39:20 -07001051 ANGLE_VALIDATE_IS_GLES1(context);
1052 const auto &stack = context->getGLState().gles1().currentMatrixStack();
1053 if (stack.size() == stack.max_size())
1054 {
1055 ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow);
1056 return false;
1057 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001058 return true;
1059}
1060
1061bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
1062{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -07001063 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001064 return true;
1065}
1066
1067bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
1068{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -07001069 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001070 return true;
1071}
1072
1073bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert)
1074{
1075 UNIMPLEMENTED();
1076 return true;
1077}
1078
1079bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z)
1080{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -07001081 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001082 return true;
1083}
1084
1085bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z)
1086{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -07001087 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001088 return true;
1089}
1090
Lingfeng Yanga0cfa872018-05-30 21:12:17 -07001091bool ValidateShadeModel(Context *context, ShadingModel mode)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001092{
Lingfeng Yanga0cfa872018-05-30 21:12:17 -07001093 ANGLE_VALIDATE_IS_GLES1(context);
1094 switch (mode)
1095 {
1096 case ShadingModel::Flat:
1097 case ShadingModel::Smooth:
1098 return true;
1099 default:
1100 ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidShadingModel);
1101 return false;
1102 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001103}
1104
1105bool ValidateTexCoordPointer(Context *context,
1106 GLint size,
1107 GLenum type,
1108 GLsizei stride,
1109 const void *pointer)
1110{
Lingfeng Yangabb09f12018-04-16 10:43:53 -07001111 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::TextureCoord, size,
1112 type, stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001113}
1114
Lingfeng Yang74be2962018-06-07 09:13:38 -07001115bool ValidateTexEnvf(Context *context,
1116 TextureEnvTarget target,
1117 TextureEnvParameter pname,
1118 GLfloat param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001119{
Lingfeng Yang45b5a872018-06-07 11:33:25 -07001120 return ValidateTexEnvCommon(context, target, pname, &param);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001121}
1122
Lingfeng Yang74be2962018-06-07 09:13:38 -07001123bool ValidateTexEnvfv(Context *context,
1124 TextureEnvTarget target,
1125 TextureEnvParameter pname,
1126 const GLfloat *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001127{
Lingfeng Yang45b5a872018-06-07 11:33:25 -07001128 return ValidateTexEnvCommon(context, target, pname, params);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001129}
1130
Lingfeng Yang74be2962018-06-07 09:13:38 -07001131bool ValidateTexEnvi(Context *context,
1132 TextureEnvTarget target,
1133 TextureEnvParameter pname,
1134 GLint param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001135{
Lingfeng Yang45b5a872018-06-07 11:33:25 -07001136 GLfloat paramf = static_cast<GLfloat>(param);
1137 return ValidateTexEnvCommon(context, target, pname, &paramf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001138}
1139
Lingfeng Yang74be2962018-06-07 09:13:38 -07001140bool ValidateTexEnviv(Context *context,
1141 TextureEnvTarget target,
1142 TextureEnvParameter pname,
1143 const GLint *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001144{
Lingfeng Yang45b5a872018-06-07 11:33:25 -07001145 GLfloat paramsf[4];
1146 for (unsigned int i = 0; i < GetTextureEnvParameterCount(pname); i++)
1147 {
1148 paramsf[i] = static_cast<GLfloat>(params[i]);
1149 }
1150 return ValidateTexEnvCommon(context, target, pname, paramsf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001151}
1152
Lingfeng Yang74be2962018-06-07 09:13:38 -07001153bool ValidateTexEnvx(Context *context,
1154 TextureEnvTarget target,
1155 TextureEnvParameter pname,
1156 GLfixed param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001157{
Lingfeng Yang45b5a872018-06-07 11:33:25 -07001158 GLfloat paramf = static_cast<GLfloat>(param);
1159 return ValidateTexEnvCommon(context, target, pname, &paramf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001160}
1161
Lingfeng Yang74be2962018-06-07 09:13:38 -07001162bool ValidateTexEnvxv(Context *context,
1163 TextureEnvTarget target,
1164 TextureEnvParameter pname,
1165 const GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001166{
Lingfeng Yang45b5a872018-06-07 11:33:25 -07001167 GLfloat paramsf[4];
1168 for (unsigned int i = 0; i < GetTextureEnvParameterCount(pname); i++)
1169 {
1170 paramsf[i] = static_cast<GLfloat>(params[i]);
1171 }
1172 return ValidateTexEnvCommon(context, target, pname, paramsf);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001173}
1174
Corentin Wallezf0e89be2017-11-08 14:00:32 -08001175bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001176{
1177 UNIMPLEMENTED();
1178 return true;
1179}
1180
Corentin Wallezf0e89be2017-11-08 14:00:32 -08001181bool ValidateTexParameterxv(Context *context,
1182 TextureType target,
1183 GLenum pname,
1184 const GLfixed *params)
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001185{
1186 UNIMPLEMENTED();
1187 return true;
1188}
1189
1190bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z)
1191{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -07001192 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001193 return true;
1194}
1195
1196bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z)
1197{
Lingfeng Yangbb5ce5c2018-04-09 08:08:46 -07001198 ANGLE_VALIDATE_IS_GLES1(context);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001199 return true;
1200}
1201
1202bool ValidateVertexPointer(Context *context,
1203 GLint size,
1204 GLenum type,
1205 GLsizei stride,
1206 const void *pointer)
1207{
Lingfeng Yangabb09f12018-04-16 10:43:53 -07001208 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Vertex, size, type,
1209 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001210}
1211
1212bool ValidateDrawTexfOES(Context *context,
1213 GLfloat x,
1214 GLfloat y,
1215 GLfloat z,
1216 GLfloat width,
1217 GLfloat height)
1218{
1219 UNIMPLEMENTED();
1220 return true;
1221}
1222
1223bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords)
1224{
1225 UNIMPLEMENTED();
1226 return true;
1227}
1228
1229bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height)
1230{
1231 UNIMPLEMENTED();
1232 return true;
1233}
1234
1235bool ValidateDrawTexivOES(Context *context, const GLint *coords)
1236{
1237 UNIMPLEMENTED();
1238 return true;
1239}
1240
1241bool ValidateDrawTexsOES(Context *context,
1242 GLshort x,
1243 GLshort y,
1244 GLshort z,
1245 GLshort width,
1246 GLshort height)
1247{
1248 UNIMPLEMENTED();
1249 return true;
1250}
1251
1252bool ValidateDrawTexsvOES(Context *context, const GLshort *coords)
1253{
1254 UNIMPLEMENTED();
1255 return true;
1256}
1257
1258bool ValidateDrawTexxOES(Context *context,
1259 GLfixed x,
1260 GLfixed y,
1261 GLfixed z,
1262 GLfixed width,
1263 GLfixed height)
1264{
1265 UNIMPLEMENTED();
1266 return true;
1267}
1268
1269bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords)
1270{
1271 UNIMPLEMENTED();
1272 return true;
1273}
1274
1275bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex)
1276{
1277 UNIMPLEMENTED();
1278 return true;
1279}
1280
1281bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context)
1282{
1283 UNIMPLEMENTED();
1284 return true;
1285}
1286
1287bool ValidateMatrixIndexPointerOES(Context *context,
1288 GLint size,
1289 GLenum type,
1290 GLsizei stride,
1291 const void *pointer)
1292{
1293 UNIMPLEMENTED();
1294 return true;
1295}
1296
1297bool ValidateWeightPointerOES(Context *context,
1298 GLint size,
1299 GLenum type,
1300 GLsizei stride,
1301 const void *pointer)
1302{
1303 UNIMPLEMENTED();
1304 return true;
1305}
1306
1307bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer)
1308{
Lingfeng Yangabb09f12018-04-16 10:43:53 -07001309 return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::PointSize, 1, type,
1310 stride, pointer);
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001311}
1312
1313bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent)
1314{
1315 UNIMPLEMENTED();
1316 return true;
1317}
Lingfeng Yanga0648782018-03-12 14:45:25 -07001318
1319bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers)
1320{
1321 UNIMPLEMENTED();
1322 return true;
1323}
1324
1325bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers)
1326{
1327 UNIMPLEMENTED();
1328 return true;
1329}
1330
1331bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers)
1332{
1333 UNIMPLEMENTED();
1334 return true;
1335}
1336
1337bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers)
1338{
1339 UNIMPLEMENTED();
1340 return true;
1341}
1342
1343bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer)
1344{
1345 UNIMPLEMENTED();
1346 return true;
1347}
1348
1349bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer)
1350{
1351 UNIMPLEMENTED();
1352 return true;
1353}
1354
1355bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target)
1356{
1357 UNIMPLEMENTED();
1358 return true;
1359}
1360
1361bool ValidateFramebufferRenderbufferOES(Context *context,
1362 GLenum target,
1363 GLenum attachment,
1364 GLenum rbtarget,
1365 GLuint renderbuffer)
1366{
1367 UNIMPLEMENTED();
1368 return true;
1369}
1370
1371bool ValidateFramebufferTexture2DOES(Context *context,
1372 GLenum target,
1373 GLenum attachment,
1374 TextureTarget textarget,
1375 GLuint texture,
1376 GLint level)
1377{
1378 UNIMPLEMENTED();
1379 return true;
1380}
1381
1382bool ValidateGenerateMipmapOES(Context *context, TextureType target)
1383{
1384 UNIMPLEMENTED();
1385 return true;
1386}
1387
1388bool ValidateGetFramebufferAttachmentParameterivOES(Context *context,
1389 GLenum target,
1390 GLenum attachment,
1391 GLenum pname,
1392 GLint *params)
1393{
1394 UNIMPLEMENTED();
1395 return true;
1396}
1397
1398bool ValidateGetRenderbufferParameterivOES(Context *context,
1399 GLenum target,
1400 GLenum pname,
1401 GLint *params)
1402{
1403 UNIMPLEMENTED();
1404 return true;
1405}
1406
1407bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer)
1408{
1409 UNIMPLEMENTED();
1410 return true;
1411}
1412
1413bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer)
1414{
1415 UNIMPLEMENTED();
1416 return true;
1417}
1418
1419bool ValidateRenderbufferStorageOES(Context *context,
1420 GLenum target,
1421 GLint internalformat,
1422 GLsizei width,
1423 GLsizei height)
1424{
1425 UNIMPLEMENTED();
1426 return true;
1427}
1428
1429// GL_OES_texture_cube_map
1430
1431bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params)
1432{
1433 UNIMPLEMENTED();
1434 return true;
1435}
1436
1437bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params)
1438{
1439 UNIMPLEMENTED();
1440 return true;
1441}
1442
1443bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params)
1444{
1445 UNIMPLEMENTED();
1446 return true;
1447}
1448
1449bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params)
1450{
1451 UNIMPLEMENTED();
1452 return true;
1453}
1454
1455bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param)
1456{
1457 UNIMPLEMENTED();
1458 return true;
1459}
1460
1461bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param)
1462{
1463 UNIMPLEMENTED();
1464 return true;
1465}
1466
1467bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param)
1468{
1469 UNIMPLEMENTED();
1470 return true;
1471}
1472
1473bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param)
1474{
1475 UNIMPLEMENTED();
1476 return true;
1477}
1478
1479bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param)
1480{
1481 UNIMPLEMENTED();
1482 return true;
1483}
Lingfeng Yang01074432018-04-16 10:19:51 -07001484
1485} // namespace gl