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 | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 14 | #include "libANGLE/GLES1State.h" |
| 15 | #include "libANGLE/queryutils.h" |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 16 | #include "libANGLE/validationES.h" |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 17 | |
| 18 | #define ANGLE_VALIDATE_IS_GLES1(context) \ |
| 19 | if (context->getClientMajorVersion() > 1) \ |
| 20 | { \ |
| 21 | ANGLE_VALIDATION_ERR(context, InvalidOperation(), GLES1Only); \ |
| 22 | return false; \ |
| 23 | } |
| 24 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 25 | namespace gl |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 26 | { |
| 27 | |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 28 | bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func) |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 29 | { |
| 30 | switch (func) |
| 31 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 32 | case AlphaTestFunc::AlwaysPass: |
| 33 | case AlphaTestFunc::Equal: |
| 34 | case AlphaTestFunc::Gequal: |
| 35 | case AlphaTestFunc::Greater: |
| 36 | case AlphaTestFunc::Lequal: |
| 37 | case AlphaTestFunc::Less: |
| 38 | case AlphaTestFunc::Never: |
| 39 | case AlphaTestFunc::NotEqual: |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 40 | return true; |
| 41 | default: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 42 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported); |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 43 | return false; |
| 44 | } |
| 45 | } |
| 46 | |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 47 | bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType) |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 48 | { |
| 49 | ANGLE_VALIDATE_IS_GLES1(context); |
| 50 | switch (arrayType) |
| 51 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 52 | case ClientVertexArrayType::Vertex: |
| 53 | case ClientVertexArrayType::Normal: |
| 54 | case ClientVertexArrayType::Color: |
| 55 | case ClientVertexArrayType::TextureCoord: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 56 | return true; |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 57 | case ClientVertexArrayType::PointSize: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 58 | if (!context->getExtensions().pointSizeArray) |
| 59 | { |
| 60 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled); |
| 61 | return false; |
| 62 | } |
| 63 | return true; |
| 64 | default: |
| 65 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClientState); |
| 66 | return false; |
| 67 | } |
| 68 | } |
| 69 | |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 70 | bool ValidateBuiltinVertexAttributeCommon(Context *context, |
| 71 | ClientVertexArrayType arrayType, |
| 72 | GLint size, |
| 73 | GLenum type, |
| 74 | GLsizei stride, |
| 75 | const void *pointer) |
| 76 | { |
| 77 | ANGLE_VALIDATE_IS_GLES1(context); |
| 78 | |
| 79 | if (stride < 0) |
| 80 | { |
| 81 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerStride); |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | int minSize = 1; |
| 86 | int maxSize = 4; |
| 87 | |
| 88 | switch (arrayType) |
| 89 | { |
| 90 | case ClientVertexArrayType::Vertex: |
| 91 | case ClientVertexArrayType::TextureCoord: |
| 92 | minSize = 2; |
| 93 | maxSize = 4; |
| 94 | break; |
| 95 | case ClientVertexArrayType::Normal: |
| 96 | minSize = 3; |
| 97 | maxSize = 3; |
| 98 | break; |
| 99 | case ClientVertexArrayType::Color: |
| 100 | minSize = 4; |
| 101 | maxSize = 4; |
| 102 | break; |
| 103 | case ClientVertexArrayType::PointSize: |
| 104 | if (!context->getExtensions().pointSizeArray) |
| 105 | { |
| 106 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled); |
| 107 | return false; |
| 108 | } |
| 109 | |
| 110 | minSize = 1; |
| 111 | maxSize = 1; |
| 112 | break; |
| 113 | default: |
| 114 | UNREACHABLE(); |
| 115 | return false; |
| 116 | } |
| 117 | |
| 118 | if (size < minSize || size > maxSize) |
| 119 | { |
| 120 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidVertexPointerSize); |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | switch (type) |
| 125 | { |
| 126 | case GL_BYTE: |
| 127 | if (arrayType == ClientVertexArrayType::PointSize) |
| 128 | { |
| 129 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType); |
| 130 | return false; |
| 131 | } |
| 132 | break; |
| 133 | case GL_SHORT: |
| 134 | if (arrayType == ClientVertexArrayType::PointSize || |
| 135 | arrayType == ClientVertexArrayType::Color) |
| 136 | { |
| 137 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType); |
| 138 | return false; |
| 139 | } |
| 140 | break; |
| 141 | case GL_FIXED: |
| 142 | case GL_FLOAT: |
| 143 | break; |
| 144 | default: |
| 145 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidVertexPointerType); |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | return true; |
| 150 | } |
| 151 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 152 | bool ValidateLightCaps(Context *context, GLenum light) |
| 153 | { |
| 154 | if (light < GL_LIGHT0 || light >= GL_LIGHT0 + context->getCaps().maxLights) |
| 155 | { |
| 156 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLight); |
| 157 | return false; |
| 158 | } |
| 159 | |
| 160 | return true; |
| 161 | } |
| 162 | |
| 163 | bool ValidateLightCommon(Context *context, |
| 164 | GLenum light, |
| 165 | LightParameter pname, |
| 166 | const GLfloat *params) |
| 167 | { |
| 168 | |
| 169 | ANGLE_VALIDATE_IS_GLES1(context); |
| 170 | |
| 171 | if (!ValidateLightCaps(context, light)) |
| 172 | { |
| 173 | return false; |
| 174 | } |
| 175 | |
| 176 | switch (pname) |
| 177 | { |
| 178 | case LightParameter::Ambient: |
| 179 | case LightParameter::Diffuse: |
| 180 | case LightParameter::Specular: |
| 181 | case LightParameter::Position: |
| 182 | case LightParameter::SpotDirection: |
| 183 | return true; |
| 184 | case LightParameter::SpotExponent: |
| 185 | if (params[0] < 0.0f || params[0] > 128.0f) |
| 186 | { |
| 187 | ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange); |
| 188 | return false; |
| 189 | } |
| 190 | return true; |
| 191 | case LightParameter::SpotCutoff: |
| 192 | if (params[0] == 180.0f) |
| 193 | { |
| 194 | return true; |
| 195 | } |
| 196 | if (params[0] < 0.0f || params[0] > 90.0f) |
| 197 | { |
| 198 | ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange); |
| 199 | return false; |
| 200 | } |
| 201 | return true; |
| 202 | case LightParameter::ConstantAttenuation: |
| 203 | case LightParameter::LinearAttenuation: |
| 204 | case LightParameter::QuadraticAttenuation: |
| 205 | if (params[0] < 0.0f) |
| 206 | { |
| 207 | ANGLE_VALIDATION_ERR(context, InvalidValue(), LightParameterOutOfRange); |
| 208 | return false; |
| 209 | } |
| 210 | return true; |
| 211 | default: |
| 212 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightParameter); |
| 213 | return false; |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | bool ValidateLightSingleComponent(Context *context, |
| 218 | GLenum light, |
| 219 | LightParameter pname, |
| 220 | GLfloat param) |
| 221 | { |
| 222 | if (!ValidateLightCommon(context, light, pname, ¶m)) |
| 223 | { |
| 224 | return false; |
| 225 | } |
| 226 | |
| 227 | if (GetLightParameterCount(pname) > 1) |
| 228 | { |
| 229 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightParameter); |
| 230 | return false; |
| 231 | } |
| 232 | |
| 233 | return true; |
| 234 | } |
| 235 | |
| 236 | bool ValidateMaterialCommon(Context *context, |
| 237 | GLenum face, |
| 238 | MaterialParameter pname, |
| 239 | const GLfloat *params) |
| 240 | { |
| 241 | ANGLE_VALIDATE_IS_GLES1(context); |
| 242 | |
| 243 | if (face != GL_FRONT_AND_BACK) |
| 244 | { |
| 245 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialFace); |
| 246 | return false; |
| 247 | } |
| 248 | |
| 249 | switch (pname) |
| 250 | { |
| 251 | case MaterialParameter::Ambient: |
| 252 | case MaterialParameter::Diffuse: |
| 253 | case MaterialParameter::Specular: |
| 254 | case MaterialParameter::Emission: |
| 255 | return true; |
| 256 | case MaterialParameter::Shininess: |
| 257 | if (params[0] < 0.0f || params[0] > 128.0f) |
| 258 | { |
| 259 | ANGLE_VALIDATION_ERR(context, InvalidValue(), MaterialParameterOutOfRange); |
| 260 | return false; |
| 261 | } |
| 262 | return true; |
| 263 | default: |
| 264 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialParameter); |
| 265 | return false; |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | bool ValidateMaterialSingleComponent(Context *context, |
| 270 | GLenum face, |
| 271 | MaterialParameter pname, |
| 272 | GLfloat param) |
| 273 | { |
| 274 | if (!ValidateMaterialCommon(context, face, pname, ¶m)) |
| 275 | { |
| 276 | return false; |
| 277 | } |
| 278 | |
| 279 | if (GetMaterialParameterCount(pname) > 1) |
| 280 | { |
| 281 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMaterialParameter); |
| 282 | return false; |
| 283 | } |
| 284 | |
| 285 | return true; |
| 286 | } |
| 287 | |
| 288 | bool ValidateLightModelCommon(Context *context, GLenum pname) |
| 289 | { |
| 290 | ANGLE_VALIDATE_IS_GLES1(context); |
| 291 | switch (pname) |
| 292 | { |
| 293 | case GL_LIGHT_MODEL_AMBIENT: |
| 294 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 295 | return true; |
| 296 | default: |
| 297 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightModelParameter); |
| 298 | return false; |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | bool ValidateLightModelSingleComponent(Context *context, GLenum pname) |
| 303 | { |
| 304 | if (!ValidateLightModelCommon(context, pname)) |
| 305 | { |
| 306 | return false; |
| 307 | } |
| 308 | |
| 309 | switch (pname) |
| 310 | { |
| 311 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 312 | return true; |
| 313 | default: |
| 314 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidLightModelParameter); |
| 315 | return false; |
| 316 | } |
| 317 | } |
| 318 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 319 | } // namespace gl |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 320 | |
| 321 | namespace gl |
| 322 | { |
| 323 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 324 | bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 325 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 326 | ANGLE_VALIDATE_IS_GLES1(context); |
| 327 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 328 | } |
| 329 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 330 | bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 331 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 332 | ANGLE_VALIDATE_IS_GLES1(context); |
| 333 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 334 | } |
| 335 | |
| 336 | bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 337 | { |
| 338 | UNIMPLEMENTED(); |
| 339 | return true; |
| 340 | } |
| 341 | |
| 342 | bool ValidateClearDepthx(Context *context, GLfixed depth) |
| 343 | { |
| 344 | UNIMPLEMENTED(); |
| 345 | return true; |
| 346 | } |
| 347 | |
| 348 | bool ValidateClientActiveTexture(Context *context, GLenum texture) |
| 349 | { |
Lingfeng Yang | 96310cd | 2018-03-28 11:56:28 -0700 | [diff] [blame] | 350 | ANGLE_VALIDATE_IS_GLES1(context); |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 351 | return ValidateMultitextureUnit(context, texture); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | bool ValidateClipPlanef(Context *context, GLenum p, const GLfloat *eqn) |
| 355 | { |
| 356 | UNIMPLEMENTED(); |
| 357 | return true; |
| 358 | } |
| 359 | |
| 360 | bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation) |
| 361 | { |
| 362 | UNIMPLEMENTED(); |
| 363 | return true; |
| 364 | } |
| 365 | |
| 366 | bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) |
| 367 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 368 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 369 | return true; |
| 370 | } |
| 371 | |
| 372 | bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) |
| 373 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 374 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 375 | return true; |
| 376 | } |
| 377 | |
| 378 | bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 379 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 380 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 381 | return true; |
| 382 | } |
| 383 | |
| 384 | bool ValidateColorPointer(Context *context, |
| 385 | GLint size, |
| 386 | GLenum type, |
| 387 | GLsizei stride, |
| 388 | const void *pointer) |
| 389 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 390 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Color, size, type, |
| 391 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | bool ValidateCullFace(Context *context, GLenum mode) |
| 395 | { |
| 396 | UNIMPLEMENTED(); |
| 397 | return true; |
| 398 | } |
| 399 | |
| 400 | bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f) |
| 401 | { |
| 402 | UNIMPLEMENTED(); |
| 403 | return true; |
| 404 | } |
| 405 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 406 | bool ValidateDisableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 407 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 408 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 409 | } |
| 410 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 411 | bool ValidateEnableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 412 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 413 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 414 | } |
| 415 | |
| 416 | bool ValidateFogf(Context *context, GLenum pname, GLfloat param) |
| 417 | { |
| 418 | UNIMPLEMENTED(); |
| 419 | return true; |
| 420 | } |
| 421 | |
| 422 | bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params) |
| 423 | { |
| 424 | UNIMPLEMENTED(); |
| 425 | return true; |
| 426 | } |
| 427 | |
| 428 | bool ValidateFogx(Context *context, GLenum pname, GLfixed param) |
| 429 | { |
| 430 | UNIMPLEMENTED(); |
| 431 | return true; |
| 432 | } |
| 433 | |
| 434 | bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *param) |
| 435 | { |
| 436 | UNIMPLEMENTED(); |
| 437 | return true; |
| 438 | } |
| 439 | |
| 440 | bool ValidateFrustumf(Context *context, |
| 441 | GLfloat l, |
| 442 | GLfloat r, |
| 443 | GLfloat b, |
| 444 | GLfloat t, |
| 445 | GLfloat n, |
| 446 | GLfloat f) |
| 447 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 448 | ANGLE_VALIDATE_IS_GLES1(context); |
| 449 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 450 | { |
| 451 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 452 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 453 | return true; |
| 454 | } |
| 455 | |
| 456 | bool ValidateFrustumx(Context *context, |
| 457 | GLfixed l, |
| 458 | GLfixed r, |
| 459 | GLfixed b, |
| 460 | GLfixed t, |
| 461 | GLfixed n, |
| 462 | GLfixed f) |
| 463 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 464 | ANGLE_VALIDATE_IS_GLES1(context); |
| 465 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 466 | { |
| 467 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 468 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 469 | return true; |
| 470 | } |
| 471 | |
| 472 | bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 473 | { |
| 474 | UNIMPLEMENTED(); |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation) |
| 479 | { |
| 480 | UNIMPLEMENTED(); |
| 481 | return true; |
| 482 | } |
| 483 | |
| 484 | bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation) |
| 485 | { |
| 486 | UNIMPLEMENTED(); |
| 487 | return true; |
| 488 | } |
| 489 | |
| 490 | bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params) |
| 491 | { |
| 492 | UNIMPLEMENTED(); |
| 493 | return true; |
| 494 | } |
| 495 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 496 | bool ValidateGetLightfv(Context *context, GLenum light, LightParameter pname, GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 497 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 498 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 499 | return ValidateLightCommon(context, light, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 500 | } |
| 501 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 502 | bool ValidateGetLightxv(Context *context, GLenum light, LightParameter pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 503 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 504 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 505 | return ValidateLightCommon(context, light, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 506 | } |
| 507 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 508 | bool ValidateGetMaterialfv(Context *context, GLenum face, MaterialParameter pname, GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 509 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 510 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 511 | return ValidateMaterialCommon(context, face, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 512 | } |
| 513 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 514 | bool ValidateGetMaterialxv(Context *context, GLenum face, MaterialParameter pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 515 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 516 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 517 | return ValidateMaterialCommon(context, face, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 518 | } |
| 519 | |
| 520 | bool ValidateGetPointerv(Context *context, GLenum pname, void **params) |
| 521 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 522 | ANGLE_VALIDATE_IS_GLES1(context); |
| 523 | switch (pname) |
| 524 | { |
| 525 | case GL_VERTEX_ARRAY_POINTER: |
| 526 | case GL_NORMAL_ARRAY_POINTER: |
| 527 | case GL_COLOR_ARRAY_POINTER: |
| 528 | case GL_TEXTURE_COORD_ARRAY_POINTER: |
| 529 | case GL_POINT_SIZE_ARRAY_POINTER_OES: |
| 530 | return true; |
| 531 | default: |
| 532 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointerQuery); |
| 533 | return false; |
| 534 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 535 | } |
| 536 | |
| 537 | bool ValidateGetTexEnvfv(Context *context, GLenum target, GLenum pname, GLfloat *params) |
| 538 | { |
| 539 | UNIMPLEMENTED(); |
| 540 | return true; |
| 541 | } |
| 542 | |
| 543 | bool ValidateGetTexEnviv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 544 | { |
| 545 | UNIMPLEMENTED(); |
| 546 | return true; |
| 547 | } |
| 548 | |
| 549 | bool ValidateGetTexEnvxv(Context *context, GLenum target, GLenum pname, GLfixed *params) |
| 550 | { |
| 551 | UNIMPLEMENTED(); |
| 552 | return true; |
| 553 | } |
| 554 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 555 | bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 556 | { |
| 557 | UNIMPLEMENTED(); |
| 558 | return true; |
| 559 | } |
| 560 | |
| 561 | bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param) |
| 562 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 563 | return ValidateLightModelSingleComponent(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 564 | } |
| 565 | |
| 566 | bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params) |
| 567 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 568 | return ValidateLightModelCommon(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param) |
| 572 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 573 | return ValidateLightModelSingleComponent(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param) |
| 577 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 578 | return ValidateLightModelCommon(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 579 | } |
| 580 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 581 | bool ValidateLightf(Context *context, GLenum light, LightParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 582 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 583 | return ValidateLightSingleComponent(context, light, pname, param); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 584 | } |
| 585 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 586 | bool ValidateLightfv(Context *context, GLenum light, LightParameter pname, const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 587 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 588 | return ValidateLightCommon(context, light, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 589 | } |
| 590 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 591 | bool ValidateLightx(Context *context, GLenum light, LightParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 592 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 593 | return ValidateLightSingleComponent(context, light, pname, FixedToFloat(param)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 594 | } |
| 595 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 596 | bool ValidateLightxv(Context *context, GLenum light, LightParameter pname, const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 597 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 598 | GLfloat paramsf[4]; |
| 599 | for (unsigned int i = 0; i < GetLightParameterCount(pname); i++) |
| 600 | { |
| 601 | paramsf[i] = FixedToFloat(params[i]); |
| 602 | } |
| 603 | |
| 604 | return ValidateLightCommon(context, light, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 605 | } |
| 606 | |
| 607 | bool ValidateLineWidthx(Context *context, GLfixed width) |
| 608 | { |
| 609 | UNIMPLEMENTED(); |
| 610 | return true; |
| 611 | } |
| 612 | |
| 613 | bool ValidateLoadIdentity(Context *context) |
| 614 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 615 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 616 | return true; |
| 617 | } |
| 618 | |
| 619 | bool ValidateLoadMatrixf(Context *context, const GLfloat *m) |
| 620 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 621 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 622 | return true; |
| 623 | } |
| 624 | |
| 625 | bool ValidateLoadMatrixx(Context *context, const GLfixed *m) |
| 626 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 627 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 628 | return true; |
| 629 | } |
| 630 | |
| 631 | bool ValidateLogicOp(Context *context, GLenum opcode) |
| 632 | { |
| 633 | UNIMPLEMENTED(); |
| 634 | return true; |
| 635 | } |
| 636 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 637 | bool ValidateMaterialf(Context *context, GLenum face, MaterialParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 638 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 639 | return ValidateMaterialSingleComponent(context, face, pname, param); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 640 | } |
| 641 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 642 | bool ValidateMaterialfv(Context *context, |
| 643 | GLenum face, |
| 644 | MaterialParameter pname, |
| 645 | const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 646 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 647 | return ValidateMaterialCommon(context, face, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 648 | } |
| 649 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 650 | bool ValidateMaterialx(Context *context, GLenum face, MaterialParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 651 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 652 | return ValidateMaterialSingleComponent(context, face, pname, FixedToFloat(param)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 653 | } |
| 654 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 655 | bool ValidateMaterialxv(Context *context, |
| 656 | GLenum face, |
| 657 | MaterialParameter pname, |
| 658 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 659 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame^] | 660 | GLfloat paramsf[4]; |
| 661 | |
| 662 | for (unsigned int i = 0; i < GetMaterialParameterCount(pname); i++) |
| 663 | { |
| 664 | paramsf[i] = FixedToFloat(params[i]); |
| 665 | } |
| 666 | |
| 667 | return ValidateMaterialCommon(context, face, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 668 | } |
| 669 | |
Lingfeng Yang | 00af463 | 2018-04-02 12:42:24 -0700 | [diff] [blame] | 670 | bool ValidateMatrixMode(Context *context, MatrixType mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 671 | { |
Lingfeng Yang | d2488ab | 2018-04-04 09:25:48 -0700 | [diff] [blame] | 672 | ANGLE_VALIDATE_IS_GLES1(context); |
| 673 | switch (mode) |
| 674 | { |
| 675 | case MatrixType::Projection: |
| 676 | case MatrixType::Modelview: |
| 677 | case MatrixType::Texture: |
| 678 | return true; |
| 679 | default: |
| 680 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode); |
| 681 | return false; |
| 682 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 683 | } |
| 684 | |
| 685 | bool ValidateMultMatrixf(Context *context, const GLfloat *m) |
| 686 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 687 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 688 | return true; |
| 689 | } |
| 690 | |
| 691 | bool ValidateMultMatrixx(Context *context, const GLfixed *m) |
| 692 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 693 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 694 | return true; |
| 695 | } |
| 696 | |
| 697 | bool ValidateMultiTexCoord4f(Context *context, |
| 698 | GLenum target, |
| 699 | GLfloat s, |
| 700 | GLfloat t, |
| 701 | GLfloat r, |
| 702 | GLfloat q) |
| 703 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 704 | ANGLE_VALIDATE_IS_GLES1(context); |
| 705 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 706 | } |
| 707 | |
| 708 | bool ValidateMultiTexCoord4x(Context *context, |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 709 | GLenum target, |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 710 | GLfixed s, |
| 711 | GLfixed t, |
| 712 | GLfixed r, |
| 713 | GLfixed q) |
| 714 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 715 | ANGLE_VALIDATE_IS_GLES1(context); |
| 716 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 717 | } |
| 718 | |
| 719 | bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz) |
| 720 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 721 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 722 | return true; |
| 723 | } |
| 724 | |
| 725 | bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz) |
| 726 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 727 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 728 | return true; |
| 729 | } |
| 730 | |
| 731 | bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 732 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 733 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Normal, 3, type, |
| 734 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 735 | } |
| 736 | |
| 737 | bool ValidateOrthof(Context *context, |
| 738 | GLfloat l, |
| 739 | GLfloat r, |
| 740 | GLfloat b, |
| 741 | GLfloat t, |
| 742 | GLfloat n, |
| 743 | GLfloat f) |
| 744 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 745 | ANGLE_VALIDATE_IS_GLES1(context); |
| 746 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 747 | { |
| 748 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 749 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 750 | return true; |
| 751 | } |
| 752 | |
| 753 | bool ValidateOrthox(Context *context, |
| 754 | GLfixed l, |
| 755 | GLfixed r, |
| 756 | GLfixed b, |
| 757 | GLfixed t, |
| 758 | GLfixed n, |
| 759 | GLfixed f) |
| 760 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 761 | ANGLE_VALIDATE_IS_GLES1(context); |
| 762 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 763 | { |
| 764 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 765 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 766 | return true; |
| 767 | } |
| 768 | |
| 769 | bool ValidatePointParameterf(Context *context, GLenum pname, GLfloat param) |
| 770 | { |
| 771 | UNIMPLEMENTED(); |
| 772 | return true; |
| 773 | } |
| 774 | |
| 775 | bool ValidatePointParameterfv(Context *context, GLenum pname, const GLfloat *params) |
| 776 | { |
| 777 | UNIMPLEMENTED(); |
| 778 | return true; |
| 779 | } |
| 780 | |
| 781 | bool ValidatePointParameterx(Context *context, GLenum pname, GLfixed param) |
| 782 | { |
| 783 | UNIMPLEMENTED(); |
| 784 | return true; |
| 785 | } |
| 786 | |
| 787 | bool ValidatePointParameterxv(Context *context, GLenum pname, const GLfixed *params) |
| 788 | { |
| 789 | UNIMPLEMENTED(); |
| 790 | return true; |
| 791 | } |
| 792 | |
| 793 | bool ValidatePointSize(Context *context, GLfloat size) |
| 794 | { |
| 795 | UNIMPLEMENTED(); |
| 796 | return true; |
| 797 | } |
| 798 | |
| 799 | bool ValidatePointSizex(Context *context, GLfixed size) |
| 800 | { |
| 801 | UNIMPLEMENTED(); |
| 802 | return true; |
| 803 | } |
| 804 | |
| 805 | bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units) |
| 806 | { |
| 807 | UNIMPLEMENTED(); |
| 808 | return true; |
| 809 | } |
| 810 | |
| 811 | bool ValidatePopMatrix(Context *context) |
| 812 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 813 | ANGLE_VALIDATE_IS_GLES1(context); |
| 814 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 815 | if (stack.size() == 1) |
| 816 | { |
| 817 | ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow); |
| 818 | return false; |
| 819 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 820 | return true; |
| 821 | } |
| 822 | |
| 823 | bool ValidatePushMatrix(Context *context) |
| 824 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 825 | ANGLE_VALIDATE_IS_GLES1(context); |
| 826 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 827 | if (stack.size() == stack.max_size()) |
| 828 | { |
| 829 | ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow); |
| 830 | return false; |
| 831 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 832 | return true; |
| 833 | } |
| 834 | |
| 835 | bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
| 836 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 837 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 838 | return true; |
| 839 | } |
| 840 | |
| 841 | bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) |
| 842 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 843 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 844 | return true; |
| 845 | } |
| 846 | |
| 847 | bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert) |
| 848 | { |
| 849 | UNIMPLEMENTED(); |
| 850 | return true; |
| 851 | } |
| 852 | |
| 853 | bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 854 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 855 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 856 | return true; |
| 857 | } |
| 858 | |
| 859 | bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 860 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 861 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 862 | return true; |
| 863 | } |
| 864 | |
| 865 | bool ValidateShadeModel(Context *context, GLenum mode) |
| 866 | { |
| 867 | UNIMPLEMENTED(); |
| 868 | return true; |
| 869 | } |
| 870 | |
| 871 | bool ValidateTexCoordPointer(Context *context, |
| 872 | GLint size, |
| 873 | GLenum type, |
| 874 | GLsizei stride, |
| 875 | const void *pointer) |
| 876 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 877 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::TextureCoord, size, |
| 878 | type, stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 879 | } |
| 880 | |
| 881 | bool ValidateTexEnvf(Context *context, GLenum target, GLenum pname, GLfloat param) |
| 882 | { |
| 883 | UNIMPLEMENTED(); |
| 884 | return true; |
| 885 | } |
| 886 | |
| 887 | bool ValidateTexEnvfv(Context *context, GLenum target, GLenum pname, const GLfloat *params) |
| 888 | { |
| 889 | UNIMPLEMENTED(); |
| 890 | return true; |
| 891 | } |
| 892 | |
| 893 | bool ValidateTexEnvi(Context *context, GLenum target, GLenum pname, GLint param) |
| 894 | { |
| 895 | UNIMPLEMENTED(); |
| 896 | return true; |
| 897 | } |
| 898 | |
| 899 | bool ValidateTexEnviv(Context *context, GLenum target, GLenum pname, const GLint *params) |
| 900 | { |
| 901 | UNIMPLEMENTED(); |
| 902 | return true; |
| 903 | } |
| 904 | |
| 905 | bool ValidateTexEnvx(Context *context, GLenum target, GLenum pname, GLfixed param) |
| 906 | { |
| 907 | UNIMPLEMENTED(); |
| 908 | return true; |
| 909 | } |
| 910 | |
| 911 | bool ValidateTexEnvxv(Context *context, GLenum target, GLenum pname, const GLfixed *params) |
| 912 | { |
| 913 | UNIMPLEMENTED(); |
| 914 | return true; |
| 915 | } |
| 916 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 917 | bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 918 | { |
| 919 | UNIMPLEMENTED(); |
| 920 | return true; |
| 921 | } |
| 922 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 923 | bool ValidateTexParameterxv(Context *context, |
| 924 | TextureType target, |
| 925 | GLenum pname, |
| 926 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 927 | { |
| 928 | UNIMPLEMENTED(); |
| 929 | return true; |
| 930 | } |
| 931 | |
| 932 | bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 933 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 934 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 935 | return true; |
| 936 | } |
| 937 | |
| 938 | bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 939 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 940 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 941 | return true; |
| 942 | } |
| 943 | |
| 944 | bool ValidateVertexPointer(Context *context, |
| 945 | GLint size, |
| 946 | GLenum type, |
| 947 | GLsizei stride, |
| 948 | const void *pointer) |
| 949 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 950 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Vertex, size, type, |
| 951 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 952 | } |
| 953 | |
| 954 | bool ValidateDrawTexfOES(Context *context, |
| 955 | GLfloat x, |
| 956 | GLfloat y, |
| 957 | GLfloat z, |
| 958 | GLfloat width, |
| 959 | GLfloat height) |
| 960 | { |
| 961 | UNIMPLEMENTED(); |
| 962 | return true; |
| 963 | } |
| 964 | |
| 965 | bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords) |
| 966 | { |
| 967 | UNIMPLEMENTED(); |
| 968 | return true; |
| 969 | } |
| 970 | |
| 971 | bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height) |
| 972 | { |
| 973 | UNIMPLEMENTED(); |
| 974 | return true; |
| 975 | } |
| 976 | |
| 977 | bool ValidateDrawTexivOES(Context *context, const GLint *coords) |
| 978 | { |
| 979 | UNIMPLEMENTED(); |
| 980 | return true; |
| 981 | } |
| 982 | |
| 983 | bool ValidateDrawTexsOES(Context *context, |
| 984 | GLshort x, |
| 985 | GLshort y, |
| 986 | GLshort z, |
| 987 | GLshort width, |
| 988 | GLshort height) |
| 989 | { |
| 990 | UNIMPLEMENTED(); |
| 991 | return true; |
| 992 | } |
| 993 | |
| 994 | bool ValidateDrawTexsvOES(Context *context, const GLshort *coords) |
| 995 | { |
| 996 | UNIMPLEMENTED(); |
| 997 | return true; |
| 998 | } |
| 999 | |
| 1000 | bool ValidateDrawTexxOES(Context *context, |
| 1001 | GLfixed x, |
| 1002 | GLfixed y, |
| 1003 | GLfixed z, |
| 1004 | GLfixed width, |
| 1005 | GLfixed height) |
| 1006 | { |
| 1007 | UNIMPLEMENTED(); |
| 1008 | return true; |
| 1009 | } |
| 1010 | |
| 1011 | bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords) |
| 1012 | { |
| 1013 | UNIMPLEMENTED(); |
| 1014 | return true; |
| 1015 | } |
| 1016 | |
| 1017 | bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex) |
| 1018 | { |
| 1019 | UNIMPLEMENTED(); |
| 1020 | return true; |
| 1021 | } |
| 1022 | |
| 1023 | bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context) |
| 1024 | { |
| 1025 | UNIMPLEMENTED(); |
| 1026 | return true; |
| 1027 | } |
| 1028 | |
| 1029 | bool ValidateMatrixIndexPointerOES(Context *context, |
| 1030 | GLint size, |
| 1031 | GLenum type, |
| 1032 | GLsizei stride, |
| 1033 | const void *pointer) |
| 1034 | { |
| 1035 | UNIMPLEMENTED(); |
| 1036 | return true; |
| 1037 | } |
| 1038 | |
| 1039 | bool ValidateWeightPointerOES(Context *context, |
| 1040 | GLint size, |
| 1041 | GLenum type, |
| 1042 | GLsizei stride, |
| 1043 | const void *pointer) |
| 1044 | { |
| 1045 | UNIMPLEMENTED(); |
| 1046 | return true; |
| 1047 | } |
| 1048 | |
| 1049 | bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 1050 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1051 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::PointSize, 1, type, |
| 1052 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1053 | } |
| 1054 | |
| 1055 | bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent) |
| 1056 | { |
| 1057 | UNIMPLEMENTED(); |
| 1058 | return true; |
| 1059 | } |
Lingfeng Yang | a064878 | 2018-03-12 14:45:25 -0700 | [diff] [blame] | 1060 | |
| 1061 | bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers) |
| 1062 | { |
| 1063 | UNIMPLEMENTED(); |
| 1064 | return true; |
| 1065 | } |
| 1066 | |
| 1067 | bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers) |
| 1068 | { |
| 1069 | UNIMPLEMENTED(); |
| 1070 | return true; |
| 1071 | } |
| 1072 | |
| 1073 | bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers) |
| 1074 | { |
| 1075 | UNIMPLEMENTED(); |
| 1076 | return true; |
| 1077 | } |
| 1078 | |
| 1079 | bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers) |
| 1080 | { |
| 1081 | UNIMPLEMENTED(); |
| 1082 | return true; |
| 1083 | } |
| 1084 | |
| 1085 | bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer) |
| 1086 | { |
| 1087 | UNIMPLEMENTED(); |
| 1088 | return true; |
| 1089 | } |
| 1090 | |
| 1091 | bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer) |
| 1092 | { |
| 1093 | UNIMPLEMENTED(); |
| 1094 | return true; |
| 1095 | } |
| 1096 | |
| 1097 | bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target) |
| 1098 | { |
| 1099 | UNIMPLEMENTED(); |
| 1100 | return true; |
| 1101 | } |
| 1102 | |
| 1103 | bool ValidateFramebufferRenderbufferOES(Context *context, |
| 1104 | GLenum target, |
| 1105 | GLenum attachment, |
| 1106 | GLenum rbtarget, |
| 1107 | GLuint renderbuffer) |
| 1108 | { |
| 1109 | UNIMPLEMENTED(); |
| 1110 | return true; |
| 1111 | } |
| 1112 | |
| 1113 | bool ValidateFramebufferTexture2DOES(Context *context, |
| 1114 | GLenum target, |
| 1115 | GLenum attachment, |
| 1116 | TextureTarget textarget, |
| 1117 | GLuint texture, |
| 1118 | GLint level) |
| 1119 | { |
| 1120 | UNIMPLEMENTED(); |
| 1121 | return true; |
| 1122 | } |
| 1123 | |
| 1124 | bool ValidateGenerateMipmapOES(Context *context, TextureType target) |
| 1125 | { |
| 1126 | UNIMPLEMENTED(); |
| 1127 | return true; |
| 1128 | } |
| 1129 | |
| 1130 | bool ValidateGetFramebufferAttachmentParameterivOES(Context *context, |
| 1131 | GLenum target, |
| 1132 | GLenum attachment, |
| 1133 | GLenum pname, |
| 1134 | GLint *params) |
| 1135 | { |
| 1136 | UNIMPLEMENTED(); |
| 1137 | return true; |
| 1138 | } |
| 1139 | |
| 1140 | bool ValidateGetRenderbufferParameterivOES(Context *context, |
| 1141 | GLenum target, |
| 1142 | GLenum pname, |
| 1143 | GLint *params) |
| 1144 | { |
| 1145 | UNIMPLEMENTED(); |
| 1146 | return true; |
| 1147 | } |
| 1148 | |
| 1149 | bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer) |
| 1150 | { |
| 1151 | UNIMPLEMENTED(); |
| 1152 | return true; |
| 1153 | } |
| 1154 | |
| 1155 | bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer) |
| 1156 | { |
| 1157 | UNIMPLEMENTED(); |
| 1158 | return true; |
| 1159 | } |
| 1160 | |
| 1161 | bool ValidateRenderbufferStorageOES(Context *context, |
| 1162 | GLenum target, |
| 1163 | GLint internalformat, |
| 1164 | GLsizei width, |
| 1165 | GLsizei height) |
| 1166 | { |
| 1167 | UNIMPLEMENTED(); |
| 1168 | return true; |
| 1169 | } |
| 1170 | |
| 1171 | // GL_OES_texture_cube_map |
| 1172 | |
| 1173 | bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params) |
| 1174 | { |
| 1175 | UNIMPLEMENTED(); |
| 1176 | return true; |
| 1177 | } |
| 1178 | |
| 1179 | bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params) |
| 1180 | { |
| 1181 | UNIMPLEMENTED(); |
| 1182 | return true; |
| 1183 | } |
| 1184 | |
| 1185 | bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params) |
| 1186 | { |
| 1187 | UNIMPLEMENTED(); |
| 1188 | return true; |
| 1189 | } |
| 1190 | |
| 1191 | bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params) |
| 1192 | { |
| 1193 | UNIMPLEMENTED(); |
| 1194 | return true; |
| 1195 | } |
| 1196 | |
| 1197 | bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 1198 | { |
| 1199 | UNIMPLEMENTED(); |
| 1200 | return true; |
| 1201 | } |
| 1202 | |
| 1203 | bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 1204 | { |
| 1205 | UNIMPLEMENTED(); |
| 1206 | return true; |
| 1207 | } |
| 1208 | |
| 1209 | bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param) |
| 1210 | { |
| 1211 | UNIMPLEMENTED(); |
| 1212 | return true; |
| 1213 | } |
| 1214 | |
| 1215 | bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param) |
| 1216 | { |
| 1217 | UNIMPLEMENTED(); |
| 1218 | return true; |
| 1219 | } |
| 1220 | |
| 1221 | bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param) |
| 1222 | { |
| 1223 | UNIMPLEMENTED(); |
| 1224 | return true; |
| 1225 | } |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 1226 | |
| 1227 | } // namespace gl |