Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1 | // |
| 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 Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 12 | #include "libANGLE/Context.h" |
| 13 | #include "libANGLE/ErrorStrings.h" |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 14 | #include "libANGLE/validationES.h" |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 15 | |
| 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 | |
| 23 | namespace |
| 24 | { |
| 25 | |
| 26 | bool ValidateAlphaFuncCommon(gl::Context *context, gl::AlphaTestFunc func) |
| 27 | { |
| 28 | switch (func) |
| 29 | { |
| 30 | case gl::AlphaTestFunc::AlwaysPass: |
| 31 | case gl::AlphaTestFunc::Equal: |
| 32 | case gl::AlphaTestFunc::Gequal: |
| 33 | case gl::AlphaTestFunc::Greater: |
| 34 | case gl::AlphaTestFunc::Lequal: |
| 35 | case gl::AlphaTestFunc::Less: |
| 36 | case gl::AlphaTestFunc::Never: |
| 37 | case gl::AlphaTestFunc::NotEqual: |
| 38 | return true; |
| 39 | default: |
| 40 | context->handleError(gl::InvalidEnum() << gl::kErrorEnumNotSupported); |
| 41 | return false; |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | } // anonymous namespace |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 46 | |
| 47 | namespace gl |
| 48 | { |
| 49 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 50 | bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 51 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 52 | ANGLE_VALIDATE_IS_GLES1(context); |
| 53 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 54 | } |
| 55 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 56 | bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 57 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 58 | ANGLE_VALIDATE_IS_GLES1(context); |
| 59 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 63 | { |
| 64 | UNIMPLEMENTED(); |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | bool ValidateClearDepthx(Context *context, GLfixed depth) |
| 69 | { |
| 70 | UNIMPLEMENTED(); |
| 71 | return true; |
| 72 | } |
| 73 | |
| 74 | bool ValidateClientActiveTexture(Context *context, GLenum texture) |
| 75 | { |
Lingfeng Yang | 96310cd | 2018-03-28 11:56:28 -0700 | [diff] [blame] | 76 | ANGLE_VALIDATE_IS_GLES1(context); |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 77 | return ValidateMultitextureUnit(context, texture); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | bool ValidateClipPlanef(Context *context, GLenum p, const GLfloat *eqn) |
| 81 | { |
| 82 | UNIMPLEMENTED(); |
| 83 | return true; |
| 84 | } |
| 85 | |
| 86 | bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation) |
| 87 | { |
| 88 | UNIMPLEMENTED(); |
| 89 | return true; |
| 90 | } |
| 91 | |
| 92 | bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) |
| 93 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 94 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 95 | return true; |
| 96 | } |
| 97 | |
| 98 | bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) |
| 99 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 100 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 101 | return true; |
| 102 | } |
| 103 | |
| 104 | bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 105 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 106 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 107 | return true; |
| 108 | } |
| 109 | |
| 110 | bool ValidateColorPointer(Context *context, |
| 111 | GLint size, |
| 112 | GLenum type, |
| 113 | GLsizei stride, |
| 114 | const void *pointer) |
| 115 | { |
| 116 | UNIMPLEMENTED(); |
| 117 | return true; |
| 118 | } |
| 119 | |
| 120 | bool ValidateCullFace(Context *context, GLenum mode) |
| 121 | { |
| 122 | UNIMPLEMENTED(); |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f) |
| 127 | { |
| 128 | UNIMPLEMENTED(); |
| 129 | return true; |
| 130 | } |
| 131 | |
| 132 | bool ValidateDisableClientState(Context *context, GLenum array) |
| 133 | { |
| 134 | UNIMPLEMENTED(); |
| 135 | return true; |
| 136 | } |
| 137 | |
| 138 | bool ValidateEnableClientState(Context *context, GLenum array) |
| 139 | { |
| 140 | UNIMPLEMENTED(); |
| 141 | return true; |
| 142 | } |
| 143 | |
| 144 | bool ValidateFogf(Context *context, GLenum pname, GLfloat param) |
| 145 | { |
| 146 | UNIMPLEMENTED(); |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params) |
| 151 | { |
| 152 | UNIMPLEMENTED(); |
| 153 | return true; |
| 154 | } |
| 155 | |
| 156 | bool ValidateFogx(Context *context, GLenum pname, GLfixed param) |
| 157 | { |
| 158 | UNIMPLEMENTED(); |
| 159 | return true; |
| 160 | } |
| 161 | |
| 162 | bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *param) |
| 163 | { |
| 164 | UNIMPLEMENTED(); |
| 165 | return true; |
| 166 | } |
| 167 | |
| 168 | bool ValidateFrustumf(Context *context, |
| 169 | GLfloat l, |
| 170 | GLfloat r, |
| 171 | GLfloat b, |
| 172 | GLfloat t, |
| 173 | GLfloat n, |
| 174 | GLfloat f) |
| 175 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 176 | ANGLE_VALIDATE_IS_GLES1(context); |
| 177 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 178 | { |
| 179 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 180 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 181 | return true; |
| 182 | } |
| 183 | |
| 184 | bool ValidateFrustumx(Context *context, |
| 185 | GLfixed l, |
| 186 | GLfixed r, |
| 187 | GLfixed b, |
| 188 | GLfixed t, |
| 189 | GLfixed n, |
| 190 | GLfixed f) |
| 191 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 192 | ANGLE_VALIDATE_IS_GLES1(context); |
| 193 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 194 | { |
| 195 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 196 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 197 | return true; |
| 198 | } |
| 199 | |
| 200 | bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 201 | { |
| 202 | UNIMPLEMENTED(); |
| 203 | return true; |
| 204 | } |
| 205 | |
| 206 | bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation) |
| 207 | { |
| 208 | UNIMPLEMENTED(); |
| 209 | return true; |
| 210 | } |
| 211 | |
| 212 | bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation) |
| 213 | { |
| 214 | UNIMPLEMENTED(); |
| 215 | return true; |
| 216 | } |
| 217 | |
| 218 | bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params) |
| 219 | { |
| 220 | UNIMPLEMENTED(); |
| 221 | return true; |
| 222 | } |
| 223 | |
| 224 | bool ValidateGetLightfv(Context *context, GLenum light, GLenum pname, GLfloat *params) |
| 225 | { |
| 226 | UNIMPLEMENTED(); |
| 227 | return true; |
| 228 | } |
| 229 | |
| 230 | bool ValidateGetLightxv(Context *context, GLenum light, GLenum pname, GLfixed *params) |
| 231 | { |
| 232 | UNIMPLEMENTED(); |
| 233 | return true; |
| 234 | } |
| 235 | |
| 236 | bool ValidateGetMaterialfv(Context *context, GLenum face, GLenum pname, GLfloat *params) |
| 237 | { |
| 238 | UNIMPLEMENTED(); |
| 239 | return true; |
| 240 | } |
| 241 | |
| 242 | bool ValidateGetMaterialxv(Context *context, GLenum face, GLenum pname, GLfixed *params) |
| 243 | { |
| 244 | UNIMPLEMENTED(); |
| 245 | return true; |
| 246 | } |
| 247 | |
| 248 | bool ValidateGetPointerv(Context *context, GLenum pname, void **params) |
| 249 | { |
| 250 | UNIMPLEMENTED(); |
| 251 | return true; |
| 252 | } |
| 253 | |
| 254 | bool ValidateGetTexEnvfv(Context *context, GLenum target, GLenum pname, GLfloat *params) |
| 255 | { |
| 256 | UNIMPLEMENTED(); |
| 257 | return true; |
| 258 | } |
| 259 | |
| 260 | bool ValidateGetTexEnviv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 261 | { |
| 262 | UNIMPLEMENTED(); |
| 263 | return true; |
| 264 | } |
| 265 | |
| 266 | bool ValidateGetTexEnvxv(Context *context, GLenum target, GLenum pname, GLfixed *params) |
| 267 | { |
| 268 | UNIMPLEMENTED(); |
| 269 | return true; |
| 270 | } |
| 271 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 272 | bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 273 | { |
| 274 | UNIMPLEMENTED(); |
| 275 | return true; |
| 276 | } |
| 277 | |
| 278 | bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param) |
| 279 | { |
| 280 | UNIMPLEMENTED(); |
| 281 | return true; |
| 282 | } |
| 283 | |
| 284 | bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params) |
| 285 | { |
| 286 | UNIMPLEMENTED(); |
| 287 | return true; |
| 288 | } |
| 289 | |
| 290 | bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param) |
| 291 | { |
| 292 | UNIMPLEMENTED(); |
| 293 | return true; |
| 294 | } |
| 295 | |
| 296 | bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param) |
| 297 | { |
| 298 | UNIMPLEMENTED(); |
| 299 | return true; |
| 300 | } |
| 301 | |
| 302 | bool ValidateLightf(Context *context, GLenum light, GLenum pname, GLfloat param) |
| 303 | { |
| 304 | UNIMPLEMENTED(); |
| 305 | return true; |
| 306 | } |
| 307 | |
| 308 | bool ValidateLightfv(Context *context, GLenum light, GLenum pname, const GLfloat *params) |
| 309 | { |
| 310 | UNIMPLEMENTED(); |
| 311 | return true; |
| 312 | } |
| 313 | |
| 314 | bool ValidateLightx(Context *context, GLenum light, GLenum pname, GLfixed param) |
| 315 | { |
| 316 | UNIMPLEMENTED(); |
| 317 | return true; |
| 318 | } |
| 319 | |
| 320 | bool ValidateLightxv(Context *context, GLenum light, GLenum pname, const GLfixed *params) |
| 321 | { |
| 322 | UNIMPLEMENTED(); |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | bool ValidateLineWidthx(Context *context, GLfixed width) |
| 327 | { |
| 328 | UNIMPLEMENTED(); |
| 329 | return true; |
| 330 | } |
| 331 | |
| 332 | bool ValidateLoadIdentity(Context *context) |
| 333 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 334 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 335 | return true; |
| 336 | } |
| 337 | |
| 338 | bool ValidateLoadMatrixf(Context *context, const GLfloat *m) |
| 339 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 340 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 341 | return true; |
| 342 | } |
| 343 | |
| 344 | bool ValidateLoadMatrixx(Context *context, const GLfixed *m) |
| 345 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 346 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 347 | return true; |
| 348 | } |
| 349 | |
| 350 | bool ValidateLogicOp(Context *context, GLenum opcode) |
| 351 | { |
| 352 | UNIMPLEMENTED(); |
| 353 | return true; |
| 354 | } |
| 355 | |
| 356 | bool ValidateMaterialf(Context *context, GLenum face, GLenum pname, GLfloat param) |
| 357 | { |
| 358 | UNIMPLEMENTED(); |
| 359 | return true; |
| 360 | } |
| 361 | |
| 362 | bool ValidateMaterialfv(Context *context, GLenum face, GLenum pname, const GLfloat *params) |
| 363 | { |
| 364 | UNIMPLEMENTED(); |
| 365 | return true; |
| 366 | } |
| 367 | |
| 368 | bool ValidateMaterialx(Context *context, GLenum face, GLenum pname, GLfixed param) |
| 369 | { |
| 370 | UNIMPLEMENTED(); |
| 371 | return true; |
| 372 | } |
| 373 | |
| 374 | bool ValidateMaterialxv(Context *context, GLenum face, GLenum pname, const GLfixed *param) |
| 375 | { |
| 376 | UNIMPLEMENTED(); |
| 377 | return true; |
| 378 | } |
| 379 | |
Lingfeng Yang | 00af463 | 2018-04-02 12:42:24 -0700 | [diff] [blame] | 380 | bool ValidateMatrixMode(Context *context, MatrixType mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 381 | { |
Lingfeng Yang | d2488ab | 2018-04-04 09:25:48 -0700 | [diff] [blame] | 382 | ANGLE_VALIDATE_IS_GLES1(context); |
| 383 | switch (mode) |
| 384 | { |
| 385 | case MatrixType::Projection: |
| 386 | case MatrixType::Modelview: |
| 387 | case MatrixType::Texture: |
| 388 | return true; |
| 389 | default: |
| 390 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode); |
| 391 | return false; |
| 392 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | bool ValidateMultMatrixf(Context *context, const GLfloat *m) |
| 396 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 397 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 398 | return true; |
| 399 | } |
| 400 | |
| 401 | bool ValidateMultMatrixx(Context *context, const GLfixed *m) |
| 402 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 403 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 404 | return true; |
| 405 | } |
| 406 | |
| 407 | bool ValidateMultiTexCoord4f(Context *context, |
| 408 | GLenum target, |
| 409 | GLfloat s, |
| 410 | GLfloat t, |
| 411 | GLfloat r, |
| 412 | GLfloat q) |
| 413 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 414 | ANGLE_VALIDATE_IS_GLES1(context); |
| 415 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 416 | } |
| 417 | |
| 418 | bool ValidateMultiTexCoord4x(Context *context, |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 419 | GLenum target, |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 420 | GLfixed s, |
| 421 | GLfixed t, |
| 422 | GLfixed r, |
| 423 | GLfixed q) |
| 424 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 425 | ANGLE_VALIDATE_IS_GLES1(context); |
| 426 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 427 | } |
| 428 | |
| 429 | bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz) |
| 430 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 431 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 432 | return true; |
| 433 | } |
| 434 | |
| 435 | bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz) |
| 436 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 437 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 438 | return true; |
| 439 | } |
| 440 | |
| 441 | bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 442 | { |
| 443 | UNIMPLEMENTED(); |
| 444 | return true; |
| 445 | } |
| 446 | |
| 447 | bool ValidateOrthof(Context *context, |
| 448 | GLfloat l, |
| 449 | GLfloat r, |
| 450 | GLfloat b, |
| 451 | GLfloat t, |
| 452 | GLfloat n, |
| 453 | GLfloat f) |
| 454 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 455 | ANGLE_VALIDATE_IS_GLES1(context); |
| 456 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 457 | { |
| 458 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 459 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 460 | return true; |
| 461 | } |
| 462 | |
| 463 | bool ValidateOrthox(Context *context, |
| 464 | GLfixed l, |
| 465 | GLfixed r, |
| 466 | GLfixed b, |
| 467 | GLfixed t, |
| 468 | GLfixed n, |
| 469 | GLfixed f) |
| 470 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 471 | ANGLE_VALIDATE_IS_GLES1(context); |
| 472 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 473 | { |
| 474 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 475 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 476 | return true; |
| 477 | } |
| 478 | |
| 479 | bool ValidatePointParameterf(Context *context, GLenum pname, GLfloat param) |
| 480 | { |
| 481 | UNIMPLEMENTED(); |
| 482 | return true; |
| 483 | } |
| 484 | |
| 485 | bool ValidatePointParameterfv(Context *context, GLenum pname, const GLfloat *params) |
| 486 | { |
| 487 | UNIMPLEMENTED(); |
| 488 | return true; |
| 489 | } |
| 490 | |
| 491 | bool ValidatePointParameterx(Context *context, GLenum pname, GLfixed param) |
| 492 | { |
| 493 | UNIMPLEMENTED(); |
| 494 | return true; |
| 495 | } |
| 496 | |
| 497 | bool ValidatePointParameterxv(Context *context, GLenum pname, const GLfixed *params) |
| 498 | { |
| 499 | UNIMPLEMENTED(); |
| 500 | return true; |
| 501 | } |
| 502 | |
| 503 | bool ValidatePointSize(Context *context, GLfloat size) |
| 504 | { |
| 505 | UNIMPLEMENTED(); |
| 506 | return true; |
| 507 | } |
| 508 | |
| 509 | bool ValidatePointSizex(Context *context, GLfixed size) |
| 510 | { |
| 511 | UNIMPLEMENTED(); |
| 512 | return true; |
| 513 | } |
| 514 | |
| 515 | bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units) |
| 516 | { |
| 517 | UNIMPLEMENTED(); |
| 518 | return true; |
| 519 | } |
| 520 | |
| 521 | bool ValidatePopMatrix(Context *context) |
| 522 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 523 | ANGLE_VALIDATE_IS_GLES1(context); |
| 524 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 525 | if (stack.size() == 1) |
| 526 | { |
| 527 | ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow); |
| 528 | return false; |
| 529 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 530 | return true; |
| 531 | } |
| 532 | |
| 533 | bool ValidatePushMatrix(Context *context) |
| 534 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 535 | ANGLE_VALIDATE_IS_GLES1(context); |
| 536 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 537 | if (stack.size() == stack.max_size()) |
| 538 | { |
| 539 | ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow); |
| 540 | return false; |
| 541 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 542 | return true; |
| 543 | } |
| 544 | |
| 545 | bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
| 546 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 547 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 548 | return true; |
| 549 | } |
| 550 | |
| 551 | bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) |
| 552 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 553 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 554 | return true; |
| 555 | } |
| 556 | |
| 557 | bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert) |
| 558 | { |
| 559 | UNIMPLEMENTED(); |
| 560 | return true; |
| 561 | } |
| 562 | |
| 563 | bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 564 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 565 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 566 | return true; |
| 567 | } |
| 568 | |
| 569 | bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 570 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 571 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 572 | return true; |
| 573 | } |
| 574 | |
| 575 | bool ValidateShadeModel(Context *context, GLenum mode) |
| 576 | { |
| 577 | UNIMPLEMENTED(); |
| 578 | return true; |
| 579 | } |
| 580 | |
| 581 | bool ValidateTexCoordPointer(Context *context, |
| 582 | GLint size, |
| 583 | GLenum type, |
| 584 | GLsizei stride, |
| 585 | const void *pointer) |
| 586 | { |
| 587 | UNIMPLEMENTED(); |
| 588 | return true; |
| 589 | } |
| 590 | |
| 591 | bool ValidateTexEnvf(Context *context, GLenum target, GLenum pname, GLfloat param) |
| 592 | { |
| 593 | UNIMPLEMENTED(); |
| 594 | return true; |
| 595 | } |
| 596 | |
| 597 | bool ValidateTexEnvfv(Context *context, GLenum target, GLenum pname, const GLfloat *params) |
| 598 | { |
| 599 | UNIMPLEMENTED(); |
| 600 | return true; |
| 601 | } |
| 602 | |
| 603 | bool ValidateTexEnvi(Context *context, GLenum target, GLenum pname, GLint param) |
| 604 | { |
| 605 | UNIMPLEMENTED(); |
| 606 | return true; |
| 607 | } |
| 608 | |
| 609 | bool ValidateTexEnviv(Context *context, GLenum target, GLenum pname, const GLint *params) |
| 610 | { |
| 611 | UNIMPLEMENTED(); |
| 612 | return true; |
| 613 | } |
| 614 | |
| 615 | bool ValidateTexEnvx(Context *context, GLenum target, GLenum pname, GLfixed param) |
| 616 | { |
| 617 | UNIMPLEMENTED(); |
| 618 | return true; |
| 619 | } |
| 620 | |
| 621 | bool ValidateTexEnvxv(Context *context, GLenum target, GLenum pname, const GLfixed *params) |
| 622 | { |
| 623 | UNIMPLEMENTED(); |
| 624 | return true; |
| 625 | } |
| 626 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 627 | bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 628 | { |
| 629 | UNIMPLEMENTED(); |
| 630 | return true; |
| 631 | } |
| 632 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 633 | bool ValidateTexParameterxv(Context *context, |
| 634 | TextureType target, |
| 635 | GLenum pname, |
| 636 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 637 | { |
| 638 | UNIMPLEMENTED(); |
| 639 | return true; |
| 640 | } |
| 641 | |
| 642 | bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 643 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 644 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 645 | return true; |
| 646 | } |
| 647 | |
| 648 | bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 649 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame^] | 650 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 651 | return true; |
| 652 | } |
| 653 | |
| 654 | bool ValidateVertexPointer(Context *context, |
| 655 | GLint size, |
| 656 | GLenum type, |
| 657 | GLsizei stride, |
| 658 | const void *pointer) |
| 659 | { |
| 660 | UNIMPLEMENTED(); |
| 661 | return true; |
| 662 | } |
| 663 | |
| 664 | bool ValidateDrawTexfOES(Context *context, |
| 665 | GLfloat x, |
| 666 | GLfloat y, |
| 667 | GLfloat z, |
| 668 | GLfloat width, |
| 669 | GLfloat height) |
| 670 | { |
| 671 | UNIMPLEMENTED(); |
| 672 | return true; |
| 673 | } |
| 674 | |
| 675 | bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords) |
| 676 | { |
| 677 | UNIMPLEMENTED(); |
| 678 | return true; |
| 679 | } |
| 680 | |
| 681 | bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height) |
| 682 | { |
| 683 | UNIMPLEMENTED(); |
| 684 | return true; |
| 685 | } |
| 686 | |
| 687 | bool ValidateDrawTexivOES(Context *context, const GLint *coords) |
| 688 | { |
| 689 | UNIMPLEMENTED(); |
| 690 | return true; |
| 691 | } |
| 692 | |
| 693 | bool ValidateDrawTexsOES(Context *context, |
| 694 | GLshort x, |
| 695 | GLshort y, |
| 696 | GLshort z, |
| 697 | GLshort width, |
| 698 | GLshort height) |
| 699 | { |
| 700 | UNIMPLEMENTED(); |
| 701 | return true; |
| 702 | } |
| 703 | |
| 704 | bool ValidateDrawTexsvOES(Context *context, const GLshort *coords) |
| 705 | { |
| 706 | UNIMPLEMENTED(); |
| 707 | return true; |
| 708 | } |
| 709 | |
| 710 | bool ValidateDrawTexxOES(Context *context, |
| 711 | GLfixed x, |
| 712 | GLfixed y, |
| 713 | GLfixed z, |
| 714 | GLfixed width, |
| 715 | GLfixed height) |
| 716 | { |
| 717 | UNIMPLEMENTED(); |
| 718 | return true; |
| 719 | } |
| 720 | |
| 721 | bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords) |
| 722 | { |
| 723 | UNIMPLEMENTED(); |
| 724 | return true; |
| 725 | } |
| 726 | |
| 727 | bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex) |
| 728 | { |
| 729 | UNIMPLEMENTED(); |
| 730 | return true; |
| 731 | } |
| 732 | |
| 733 | bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context) |
| 734 | { |
| 735 | UNIMPLEMENTED(); |
| 736 | return true; |
| 737 | } |
| 738 | |
| 739 | bool ValidateMatrixIndexPointerOES(Context *context, |
| 740 | GLint size, |
| 741 | GLenum type, |
| 742 | GLsizei stride, |
| 743 | const void *pointer) |
| 744 | { |
| 745 | UNIMPLEMENTED(); |
| 746 | return true; |
| 747 | } |
| 748 | |
| 749 | bool ValidateWeightPointerOES(Context *context, |
| 750 | GLint size, |
| 751 | GLenum type, |
| 752 | GLsizei stride, |
| 753 | const void *pointer) |
| 754 | { |
| 755 | UNIMPLEMENTED(); |
| 756 | return true; |
| 757 | } |
| 758 | |
| 759 | bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 760 | { |
| 761 | UNIMPLEMENTED(); |
| 762 | return true; |
| 763 | } |
| 764 | |
| 765 | bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent) |
| 766 | { |
| 767 | UNIMPLEMENTED(); |
| 768 | return true; |
| 769 | } |
Lingfeng Yang | a064878 | 2018-03-12 14:45:25 -0700 | [diff] [blame] | 770 | |
| 771 | bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers) |
| 772 | { |
| 773 | UNIMPLEMENTED(); |
| 774 | return true; |
| 775 | } |
| 776 | |
| 777 | bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers) |
| 778 | { |
| 779 | UNIMPLEMENTED(); |
| 780 | return true; |
| 781 | } |
| 782 | |
| 783 | bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers) |
| 784 | { |
| 785 | UNIMPLEMENTED(); |
| 786 | return true; |
| 787 | } |
| 788 | |
| 789 | bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers) |
| 790 | { |
| 791 | UNIMPLEMENTED(); |
| 792 | return true; |
| 793 | } |
| 794 | |
| 795 | bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer) |
| 796 | { |
| 797 | UNIMPLEMENTED(); |
| 798 | return true; |
| 799 | } |
| 800 | |
| 801 | bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer) |
| 802 | { |
| 803 | UNIMPLEMENTED(); |
| 804 | return true; |
| 805 | } |
| 806 | |
| 807 | bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target) |
| 808 | { |
| 809 | UNIMPLEMENTED(); |
| 810 | return true; |
| 811 | } |
| 812 | |
| 813 | bool ValidateFramebufferRenderbufferOES(Context *context, |
| 814 | GLenum target, |
| 815 | GLenum attachment, |
| 816 | GLenum rbtarget, |
| 817 | GLuint renderbuffer) |
| 818 | { |
| 819 | UNIMPLEMENTED(); |
| 820 | return true; |
| 821 | } |
| 822 | |
| 823 | bool ValidateFramebufferTexture2DOES(Context *context, |
| 824 | GLenum target, |
| 825 | GLenum attachment, |
| 826 | TextureTarget textarget, |
| 827 | GLuint texture, |
| 828 | GLint level) |
| 829 | { |
| 830 | UNIMPLEMENTED(); |
| 831 | return true; |
| 832 | } |
| 833 | |
| 834 | bool ValidateGenerateMipmapOES(Context *context, TextureType target) |
| 835 | { |
| 836 | UNIMPLEMENTED(); |
| 837 | return true; |
| 838 | } |
| 839 | |
| 840 | bool ValidateGetFramebufferAttachmentParameterivOES(Context *context, |
| 841 | GLenum target, |
| 842 | GLenum attachment, |
| 843 | GLenum pname, |
| 844 | GLint *params) |
| 845 | { |
| 846 | UNIMPLEMENTED(); |
| 847 | return true; |
| 848 | } |
| 849 | |
| 850 | bool ValidateGetRenderbufferParameterivOES(Context *context, |
| 851 | GLenum target, |
| 852 | GLenum pname, |
| 853 | GLint *params) |
| 854 | { |
| 855 | UNIMPLEMENTED(); |
| 856 | return true; |
| 857 | } |
| 858 | |
| 859 | bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer) |
| 860 | { |
| 861 | UNIMPLEMENTED(); |
| 862 | return true; |
| 863 | } |
| 864 | |
| 865 | bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer) |
| 866 | { |
| 867 | UNIMPLEMENTED(); |
| 868 | return true; |
| 869 | } |
| 870 | |
| 871 | bool ValidateRenderbufferStorageOES(Context *context, |
| 872 | GLenum target, |
| 873 | GLint internalformat, |
| 874 | GLsizei width, |
| 875 | GLsizei height) |
| 876 | { |
| 877 | UNIMPLEMENTED(); |
| 878 | return true; |
| 879 | } |
| 880 | |
| 881 | // GL_OES_texture_cube_map |
| 882 | |
| 883 | bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params) |
| 884 | { |
| 885 | UNIMPLEMENTED(); |
| 886 | return true; |
| 887 | } |
| 888 | |
| 889 | bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params) |
| 890 | { |
| 891 | UNIMPLEMENTED(); |
| 892 | return true; |
| 893 | } |
| 894 | |
| 895 | bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params) |
| 896 | { |
| 897 | UNIMPLEMENTED(); |
| 898 | return true; |
| 899 | } |
| 900 | |
| 901 | bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params) |
| 902 | { |
| 903 | UNIMPLEMENTED(); |
| 904 | return true; |
| 905 | } |
| 906 | |
| 907 | bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 908 | { |
| 909 | UNIMPLEMENTED(); |
| 910 | return true; |
| 911 | } |
| 912 | |
| 913 | bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 914 | { |
| 915 | UNIMPLEMENTED(); |
| 916 | return true; |
| 917 | } |
| 918 | |
| 919 | bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param) |
| 920 | { |
| 921 | UNIMPLEMENTED(); |
| 922 | return true; |
| 923 | } |
| 924 | |
| 925 | bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param) |
| 926 | { |
| 927 | UNIMPLEMENTED(); |
| 928 | return true; |
| 929 | } |
| 930 | |
| 931 | bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param) |
| 932 | { |
| 933 | UNIMPLEMENTED(); |
| 934 | return true; |
| 935 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 936 | } |