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" |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 15 | #include "libANGLE/queryconversions.h" |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 16 | #include "libANGLE/queryutils.h" |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 17 | #include "libANGLE/validationES.h" |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 18 | |
| 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 Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 26 | namespace gl |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 27 | { |
| 28 | |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 29 | bool ValidateAlphaFuncCommon(Context *context, AlphaTestFunc func) |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 30 | { |
| 31 | switch (func) |
| 32 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 33 | 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 Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 41 | return true; |
| 42 | default: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 43 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported); |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 44 | return false; |
| 45 | } |
| 46 | } |
| 47 | |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 48 | bool ValidateClientStateCommon(Context *context, ClientVertexArrayType arrayType) |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 49 | { |
| 50 | ANGLE_VALIDATE_IS_GLES1(context); |
| 51 | switch (arrayType) |
| 52 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 53 | case ClientVertexArrayType::Vertex: |
| 54 | case ClientVertexArrayType::Normal: |
| 55 | case ClientVertexArrayType::Color: |
| 56 | case ClientVertexArrayType::TextureCoord: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 57 | return true; |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 58 | case ClientVertexArrayType::PointSize: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 59 | 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 Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 71 | bool 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 Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 153 | bool 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 | |
| 164 | bool 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 | |
| 218 | bool ValidateLightSingleComponent(Context *context, |
| 219 | GLenum light, |
| 220 | LightParameter pname, |
| 221 | GLfloat param) |
| 222 | { |
| 223 | if (!ValidateLightCommon(context, light, pname, ¶m)) |
| 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 | |
| 237 | bool 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 | |
| 270 | bool ValidateMaterialSingleComponent(Context *context, |
| 271 | GLenum face, |
| 272 | MaterialParameter pname, |
| 273 | GLfloat param) |
| 274 | { |
| 275 | if (!ValidateMaterialCommon(context, face, pname, ¶m)) |
| 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 | |
| 289 | bool 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 | |
| 303 | bool 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 Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 320 | bool 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 Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 333 | bool 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 Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 372 | bool 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 | |
| 499 | bool 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 Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 538 | } // namespace gl |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 539 | |
| 540 | namespace gl |
| 541 | { |
| 542 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 543 | bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 544 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 545 | ANGLE_VALIDATE_IS_GLES1(context); |
| 546 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 547 | } |
| 548 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 549 | bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 550 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 551 | ANGLE_VALIDATE_IS_GLES1(context); |
| 552 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 553 | } |
| 554 | |
| 555 | bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 556 | { |
| 557 | UNIMPLEMENTED(); |
| 558 | return true; |
| 559 | } |
| 560 | |
| 561 | bool ValidateClearDepthx(Context *context, GLfixed depth) |
| 562 | { |
| 563 | UNIMPLEMENTED(); |
| 564 | return true; |
| 565 | } |
| 566 | |
| 567 | bool ValidateClientActiveTexture(Context *context, GLenum texture) |
| 568 | { |
Lingfeng Yang | 96310cd | 2018-03-28 11:56:28 -0700 | [diff] [blame] | 569 | ANGLE_VALIDATE_IS_GLES1(context); |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 570 | return ValidateMultitextureUnit(context, texture); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 571 | } |
| 572 | |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 573 | bool ValidateClipPlanef(Context *context, GLenum plane, const GLfloat *eqn) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 574 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 575 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation) |
| 579 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 580 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) |
| 584 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 585 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 586 | return true; |
| 587 | } |
| 588 | |
| 589 | bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) |
| 590 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 591 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 592 | return true; |
| 593 | } |
| 594 | |
| 595 | bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 596 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 597 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 598 | return true; |
| 599 | } |
| 600 | |
| 601 | bool ValidateColorPointer(Context *context, |
| 602 | GLint size, |
| 603 | GLenum type, |
| 604 | GLsizei stride, |
| 605 | const void *pointer) |
| 606 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 607 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Color, size, type, |
| 608 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 609 | } |
| 610 | |
| 611 | bool ValidateCullFace(Context *context, GLenum mode) |
| 612 | { |
| 613 | UNIMPLEMENTED(); |
| 614 | return true; |
| 615 | } |
| 616 | |
| 617 | bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f) |
| 618 | { |
| 619 | UNIMPLEMENTED(); |
| 620 | return true; |
| 621 | } |
| 622 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 623 | bool ValidateDisableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 624 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 625 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 626 | } |
| 627 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 628 | bool ValidateEnableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 629 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 630 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | bool ValidateFogf(Context *context, GLenum pname, GLfloat param) |
| 634 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 635 | return ValidateFogCommon(context, pname, ¶m); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 636 | } |
| 637 | |
| 638 | bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params) |
| 639 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 640 | return ValidateFogCommon(context, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 641 | } |
| 642 | |
| 643 | bool ValidateFogx(Context *context, GLenum pname, GLfixed param) |
| 644 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 645 | GLfloat asFloat = FixedToFloat(param); |
| 646 | return ValidateFogCommon(context, pname, &asFloat); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 647 | } |
| 648 | |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 649 | bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 650 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 651 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 660 | } |
| 661 | |
| 662 | bool ValidateFrustumf(Context *context, |
| 663 | GLfloat l, |
| 664 | GLfloat r, |
| 665 | GLfloat b, |
| 666 | GLfloat t, |
| 667 | GLfloat n, |
| 668 | GLfloat f) |
| 669 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 670 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 675 | return true; |
| 676 | } |
| 677 | |
| 678 | bool ValidateFrustumx(Context *context, |
| 679 | GLfixed l, |
| 680 | GLfixed r, |
| 681 | GLfixed b, |
| 682 | GLfixed t, |
| 683 | GLfixed n, |
| 684 | GLfixed f) |
| 685 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 686 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 691 | return true; |
| 692 | } |
| 693 | |
| 694 | bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 695 | { |
| 696 | UNIMPLEMENTED(); |
| 697 | return true; |
| 698 | } |
| 699 | |
| 700 | bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation) |
| 701 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 702 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation) |
| 706 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 707 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params) |
| 711 | { |
| 712 | UNIMPLEMENTED(); |
| 713 | return true; |
| 714 | } |
| 715 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 716 | bool ValidateGetLightfv(Context *context, GLenum light, LightParameter pname, GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 717 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 718 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 719 | return ValidateLightCommon(context, light, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 720 | } |
| 721 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 722 | bool ValidateGetLightxv(Context *context, GLenum light, LightParameter pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 723 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 724 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 725 | return ValidateLightCommon(context, light, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 726 | } |
| 727 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 728 | bool ValidateGetMaterialfv(Context *context, GLenum face, MaterialParameter pname, GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 729 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 730 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 731 | return ValidateMaterialCommon(context, face, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 732 | } |
| 733 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 734 | bool ValidateGetMaterialxv(Context *context, GLenum face, MaterialParameter pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 735 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 736 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 737 | return ValidateMaterialCommon(context, face, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 738 | } |
| 739 | |
| 740 | bool ValidateGetPointerv(Context *context, GLenum pname, void **params) |
| 741 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 742 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 755 | } |
| 756 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 757 | bool ValidateGetTexEnvfv(Context *context, |
| 758 | TextureEnvTarget target, |
| 759 | TextureEnvParameter pname, |
| 760 | GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 761 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 762 | return ValidateGetTexEnvCommon(context, target, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 763 | } |
| 764 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 765 | bool ValidateGetTexEnviv(Context *context, |
| 766 | TextureEnvTarget target, |
| 767 | TextureEnvParameter pname, |
| 768 | GLint *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 769 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 770 | return ValidateGetTexEnvCommon(context, target, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 771 | } |
| 772 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 773 | bool ValidateGetTexEnvxv(Context *context, |
| 774 | TextureEnvTarget target, |
| 775 | TextureEnvParameter pname, |
| 776 | GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 777 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 778 | return ValidateGetTexEnvCommon(context, target, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 779 | } |
| 780 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 781 | bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 782 | { |
| 783 | UNIMPLEMENTED(); |
| 784 | return true; |
| 785 | } |
| 786 | |
| 787 | bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param) |
| 788 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 789 | return ValidateLightModelSingleComponent(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 790 | } |
| 791 | |
| 792 | bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params) |
| 793 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 794 | return ValidateLightModelCommon(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 795 | } |
| 796 | |
| 797 | bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param) |
| 798 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 799 | return ValidateLightModelSingleComponent(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param) |
| 803 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 804 | return ValidateLightModelCommon(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 805 | } |
| 806 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 807 | bool ValidateLightf(Context *context, GLenum light, LightParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 808 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 809 | return ValidateLightSingleComponent(context, light, pname, param); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 810 | } |
| 811 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 812 | bool ValidateLightfv(Context *context, GLenum light, LightParameter pname, const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 813 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 814 | return ValidateLightCommon(context, light, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 815 | } |
| 816 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 817 | bool ValidateLightx(Context *context, GLenum light, LightParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 818 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 819 | return ValidateLightSingleComponent(context, light, pname, FixedToFloat(param)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 820 | } |
| 821 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 822 | bool ValidateLightxv(Context *context, GLenum light, LightParameter pname, const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 823 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 824 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 831 | } |
| 832 | |
| 833 | bool ValidateLineWidthx(Context *context, GLfixed width) |
| 834 | { |
| 835 | UNIMPLEMENTED(); |
| 836 | return true; |
| 837 | } |
| 838 | |
| 839 | bool ValidateLoadIdentity(Context *context) |
| 840 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 841 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 842 | return true; |
| 843 | } |
| 844 | |
| 845 | bool ValidateLoadMatrixf(Context *context, const GLfloat *m) |
| 846 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 847 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 848 | return true; |
| 849 | } |
| 850 | |
| 851 | bool ValidateLoadMatrixx(Context *context, const GLfixed *m) |
| 852 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 853 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 854 | return true; |
| 855 | } |
| 856 | |
| 857 | bool ValidateLogicOp(Context *context, GLenum opcode) |
| 858 | { |
| 859 | UNIMPLEMENTED(); |
| 860 | return true; |
| 861 | } |
| 862 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 863 | bool ValidateMaterialf(Context *context, GLenum face, MaterialParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 864 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 865 | return ValidateMaterialSingleComponent(context, face, pname, param); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 866 | } |
| 867 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 868 | bool ValidateMaterialfv(Context *context, |
| 869 | GLenum face, |
| 870 | MaterialParameter pname, |
| 871 | const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 872 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 873 | return ValidateMaterialCommon(context, face, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 874 | } |
| 875 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 876 | bool ValidateMaterialx(Context *context, GLenum face, MaterialParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 877 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 878 | return ValidateMaterialSingleComponent(context, face, pname, FixedToFloat(param)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 879 | } |
| 880 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 881 | bool ValidateMaterialxv(Context *context, |
| 882 | GLenum face, |
| 883 | MaterialParameter pname, |
| 884 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 885 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 886 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 894 | } |
| 895 | |
Lingfeng Yang | 00af463 | 2018-04-02 12:42:24 -0700 | [diff] [blame] | 896 | bool ValidateMatrixMode(Context *context, MatrixType mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 897 | { |
Lingfeng Yang | d2488ab | 2018-04-04 09:25:48 -0700 | [diff] [blame] | 898 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 909 | } |
| 910 | |
| 911 | bool ValidateMultMatrixf(Context *context, const GLfloat *m) |
| 912 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 913 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 914 | return true; |
| 915 | } |
| 916 | |
| 917 | bool ValidateMultMatrixx(Context *context, const GLfixed *m) |
| 918 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 919 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 920 | return true; |
| 921 | } |
| 922 | |
| 923 | bool ValidateMultiTexCoord4f(Context *context, |
| 924 | GLenum target, |
| 925 | GLfloat s, |
| 926 | GLfloat t, |
| 927 | GLfloat r, |
| 928 | GLfloat q) |
| 929 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 930 | ANGLE_VALIDATE_IS_GLES1(context); |
| 931 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 932 | } |
| 933 | |
| 934 | bool ValidateMultiTexCoord4x(Context *context, |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 935 | GLenum target, |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 936 | GLfixed s, |
| 937 | GLfixed t, |
| 938 | GLfixed r, |
| 939 | GLfixed q) |
| 940 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 941 | ANGLE_VALIDATE_IS_GLES1(context); |
| 942 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 943 | } |
| 944 | |
| 945 | bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz) |
| 946 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 947 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 948 | return true; |
| 949 | } |
| 950 | |
| 951 | bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz) |
| 952 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 953 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 954 | return true; |
| 955 | } |
| 956 | |
| 957 | bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 958 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 959 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Normal, 3, type, |
| 960 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 961 | } |
| 962 | |
| 963 | bool ValidateOrthof(Context *context, |
| 964 | GLfloat l, |
| 965 | GLfloat r, |
| 966 | GLfloat b, |
| 967 | GLfloat t, |
| 968 | GLfloat n, |
| 969 | GLfloat f) |
| 970 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 971 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 976 | return true; |
| 977 | } |
| 978 | |
| 979 | bool ValidateOrthox(Context *context, |
| 980 | GLfixed l, |
| 981 | GLfixed r, |
| 982 | GLfixed b, |
| 983 | GLfixed t, |
| 984 | GLfixed n, |
| 985 | GLfixed f) |
| 986 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 987 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 992 | return true; |
| 993 | } |
| 994 | |
| 995 | bool ValidatePointParameterf(Context *context, GLenum pname, GLfloat param) |
| 996 | { |
| 997 | UNIMPLEMENTED(); |
| 998 | return true; |
| 999 | } |
| 1000 | |
| 1001 | bool ValidatePointParameterfv(Context *context, GLenum pname, const GLfloat *params) |
| 1002 | { |
| 1003 | UNIMPLEMENTED(); |
| 1004 | return true; |
| 1005 | } |
| 1006 | |
| 1007 | bool ValidatePointParameterx(Context *context, GLenum pname, GLfixed param) |
| 1008 | { |
| 1009 | UNIMPLEMENTED(); |
| 1010 | return true; |
| 1011 | } |
| 1012 | |
| 1013 | bool ValidatePointParameterxv(Context *context, GLenum pname, const GLfixed *params) |
| 1014 | { |
| 1015 | UNIMPLEMENTED(); |
| 1016 | return true; |
| 1017 | } |
| 1018 | |
| 1019 | bool ValidatePointSize(Context *context, GLfloat size) |
| 1020 | { |
| 1021 | UNIMPLEMENTED(); |
| 1022 | return true; |
| 1023 | } |
| 1024 | |
| 1025 | bool ValidatePointSizex(Context *context, GLfixed size) |
| 1026 | { |
| 1027 | UNIMPLEMENTED(); |
| 1028 | return true; |
| 1029 | } |
| 1030 | |
| 1031 | bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units) |
| 1032 | { |
| 1033 | UNIMPLEMENTED(); |
| 1034 | return true; |
| 1035 | } |
| 1036 | |
| 1037 | bool ValidatePopMatrix(Context *context) |
| 1038 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 1039 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1046 | return true; |
| 1047 | } |
| 1048 | |
| 1049 | bool ValidatePushMatrix(Context *context) |
| 1050 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 1051 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1058 | return true; |
| 1059 | } |
| 1060 | |
| 1061 | bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
| 1062 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1063 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1064 | return true; |
| 1065 | } |
| 1066 | |
| 1067 | bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) |
| 1068 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1069 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1070 | return true; |
| 1071 | } |
| 1072 | |
| 1073 | bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert) |
| 1074 | { |
| 1075 | UNIMPLEMENTED(); |
| 1076 | return true; |
| 1077 | } |
| 1078 | |
| 1079 | bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 1080 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1081 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1082 | return true; |
| 1083 | } |
| 1084 | |
| 1085 | bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 1086 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1087 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1088 | return true; |
| 1089 | } |
| 1090 | |
Lingfeng Yang | a0cfa87 | 2018-05-30 21:12:17 -0700 | [diff] [blame] | 1091 | bool ValidateShadeModel(Context *context, ShadingModel mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1092 | { |
Lingfeng Yang | a0cfa87 | 2018-05-30 21:12:17 -0700 | [diff] [blame] | 1093 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1103 | } |
| 1104 | |
| 1105 | bool ValidateTexCoordPointer(Context *context, |
| 1106 | GLint size, |
| 1107 | GLenum type, |
| 1108 | GLsizei stride, |
| 1109 | const void *pointer) |
| 1110 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1111 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::TextureCoord, size, |
| 1112 | type, stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1113 | } |
| 1114 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1115 | bool ValidateTexEnvf(Context *context, |
| 1116 | TextureEnvTarget target, |
| 1117 | TextureEnvParameter pname, |
| 1118 | GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1119 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1120 | return ValidateTexEnvCommon(context, target, pname, ¶m); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1121 | } |
| 1122 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1123 | bool ValidateTexEnvfv(Context *context, |
| 1124 | TextureEnvTarget target, |
| 1125 | TextureEnvParameter pname, |
| 1126 | const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1127 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1128 | return ValidateTexEnvCommon(context, target, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1129 | } |
| 1130 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1131 | bool ValidateTexEnvi(Context *context, |
| 1132 | TextureEnvTarget target, |
| 1133 | TextureEnvParameter pname, |
| 1134 | GLint param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1135 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1136 | GLfloat paramf = static_cast<GLfloat>(param); |
| 1137 | return ValidateTexEnvCommon(context, target, pname, ¶mf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1138 | } |
| 1139 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1140 | bool ValidateTexEnviv(Context *context, |
| 1141 | TextureEnvTarget target, |
| 1142 | TextureEnvParameter pname, |
| 1143 | const GLint *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1144 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1145 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1151 | } |
| 1152 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1153 | bool ValidateTexEnvx(Context *context, |
| 1154 | TextureEnvTarget target, |
| 1155 | TextureEnvParameter pname, |
| 1156 | GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1157 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1158 | GLfloat paramf = static_cast<GLfloat>(param); |
| 1159 | return ValidateTexEnvCommon(context, target, pname, ¶mf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1160 | } |
| 1161 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1162 | bool ValidateTexEnvxv(Context *context, |
| 1163 | TextureEnvTarget target, |
| 1164 | TextureEnvParameter pname, |
| 1165 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1166 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1167 | 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 Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1173 | } |
| 1174 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 1175 | bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1176 | { |
| 1177 | UNIMPLEMENTED(); |
| 1178 | return true; |
| 1179 | } |
| 1180 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 1181 | bool ValidateTexParameterxv(Context *context, |
| 1182 | TextureType target, |
| 1183 | GLenum pname, |
| 1184 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1185 | { |
| 1186 | UNIMPLEMENTED(); |
| 1187 | return true; |
| 1188 | } |
| 1189 | |
| 1190 | bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 1191 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1192 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1193 | return true; |
| 1194 | } |
| 1195 | |
| 1196 | bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 1197 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1198 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1199 | return true; |
| 1200 | } |
| 1201 | |
| 1202 | bool ValidateVertexPointer(Context *context, |
| 1203 | GLint size, |
| 1204 | GLenum type, |
| 1205 | GLsizei stride, |
| 1206 | const void *pointer) |
| 1207 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1208 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Vertex, size, type, |
| 1209 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1210 | } |
| 1211 | |
| 1212 | bool 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 | |
| 1223 | bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords) |
| 1224 | { |
| 1225 | UNIMPLEMENTED(); |
| 1226 | return true; |
| 1227 | } |
| 1228 | |
| 1229 | bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height) |
| 1230 | { |
| 1231 | UNIMPLEMENTED(); |
| 1232 | return true; |
| 1233 | } |
| 1234 | |
| 1235 | bool ValidateDrawTexivOES(Context *context, const GLint *coords) |
| 1236 | { |
| 1237 | UNIMPLEMENTED(); |
| 1238 | return true; |
| 1239 | } |
| 1240 | |
| 1241 | bool 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 | |
| 1252 | bool ValidateDrawTexsvOES(Context *context, const GLshort *coords) |
| 1253 | { |
| 1254 | UNIMPLEMENTED(); |
| 1255 | return true; |
| 1256 | } |
| 1257 | |
| 1258 | bool 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 | |
| 1269 | bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords) |
| 1270 | { |
| 1271 | UNIMPLEMENTED(); |
| 1272 | return true; |
| 1273 | } |
| 1274 | |
| 1275 | bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex) |
| 1276 | { |
| 1277 | UNIMPLEMENTED(); |
| 1278 | return true; |
| 1279 | } |
| 1280 | |
| 1281 | bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context) |
| 1282 | { |
| 1283 | UNIMPLEMENTED(); |
| 1284 | return true; |
| 1285 | } |
| 1286 | |
| 1287 | bool ValidateMatrixIndexPointerOES(Context *context, |
| 1288 | GLint size, |
| 1289 | GLenum type, |
| 1290 | GLsizei stride, |
| 1291 | const void *pointer) |
| 1292 | { |
| 1293 | UNIMPLEMENTED(); |
| 1294 | return true; |
| 1295 | } |
| 1296 | |
| 1297 | bool ValidateWeightPointerOES(Context *context, |
| 1298 | GLint size, |
| 1299 | GLenum type, |
| 1300 | GLsizei stride, |
| 1301 | const void *pointer) |
| 1302 | { |
| 1303 | UNIMPLEMENTED(); |
| 1304 | return true; |
| 1305 | } |
| 1306 | |
| 1307 | bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 1308 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1309 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::PointSize, 1, type, |
| 1310 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1311 | } |
| 1312 | |
| 1313 | bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent) |
| 1314 | { |
| 1315 | UNIMPLEMENTED(); |
| 1316 | return true; |
| 1317 | } |
Lingfeng Yang | a064878 | 2018-03-12 14:45:25 -0700 | [diff] [blame] | 1318 | |
| 1319 | bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers) |
| 1320 | { |
| 1321 | UNIMPLEMENTED(); |
| 1322 | return true; |
| 1323 | } |
| 1324 | |
| 1325 | bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers) |
| 1326 | { |
| 1327 | UNIMPLEMENTED(); |
| 1328 | return true; |
| 1329 | } |
| 1330 | |
| 1331 | bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers) |
| 1332 | { |
| 1333 | UNIMPLEMENTED(); |
| 1334 | return true; |
| 1335 | } |
| 1336 | |
| 1337 | bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers) |
| 1338 | { |
| 1339 | UNIMPLEMENTED(); |
| 1340 | return true; |
| 1341 | } |
| 1342 | |
| 1343 | bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer) |
| 1344 | { |
| 1345 | UNIMPLEMENTED(); |
| 1346 | return true; |
| 1347 | } |
| 1348 | |
| 1349 | bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer) |
| 1350 | { |
| 1351 | UNIMPLEMENTED(); |
| 1352 | return true; |
| 1353 | } |
| 1354 | |
| 1355 | bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target) |
| 1356 | { |
| 1357 | UNIMPLEMENTED(); |
| 1358 | return true; |
| 1359 | } |
| 1360 | |
| 1361 | bool ValidateFramebufferRenderbufferOES(Context *context, |
| 1362 | GLenum target, |
| 1363 | GLenum attachment, |
| 1364 | GLenum rbtarget, |
| 1365 | GLuint renderbuffer) |
| 1366 | { |
| 1367 | UNIMPLEMENTED(); |
| 1368 | return true; |
| 1369 | } |
| 1370 | |
| 1371 | bool 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 | |
| 1382 | bool ValidateGenerateMipmapOES(Context *context, TextureType target) |
| 1383 | { |
| 1384 | UNIMPLEMENTED(); |
| 1385 | return true; |
| 1386 | } |
| 1387 | |
| 1388 | bool ValidateGetFramebufferAttachmentParameterivOES(Context *context, |
| 1389 | GLenum target, |
| 1390 | GLenum attachment, |
| 1391 | GLenum pname, |
| 1392 | GLint *params) |
| 1393 | { |
| 1394 | UNIMPLEMENTED(); |
| 1395 | return true; |
| 1396 | } |
| 1397 | |
| 1398 | bool ValidateGetRenderbufferParameterivOES(Context *context, |
| 1399 | GLenum target, |
| 1400 | GLenum pname, |
| 1401 | GLint *params) |
| 1402 | { |
| 1403 | UNIMPLEMENTED(); |
| 1404 | return true; |
| 1405 | } |
| 1406 | |
| 1407 | bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer) |
| 1408 | { |
| 1409 | UNIMPLEMENTED(); |
| 1410 | return true; |
| 1411 | } |
| 1412 | |
| 1413 | bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer) |
| 1414 | { |
| 1415 | UNIMPLEMENTED(); |
| 1416 | return true; |
| 1417 | } |
| 1418 | |
| 1419 | bool 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 | |
| 1431 | bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params) |
| 1432 | { |
| 1433 | UNIMPLEMENTED(); |
| 1434 | return true; |
| 1435 | } |
| 1436 | |
| 1437 | bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params) |
| 1438 | { |
| 1439 | UNIMPLEMENTED(); |
| 1440 | return true; |
| 1441 | } |
| 1442 | |
| 1443 | bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params) |
| 1444 | { |
| 1445 | UNIMPLEMENTED(); |
| 1446 | return true; |
| 1447 | } |
| 1448 | |
| 1449 | bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params) |
| 1450 | { |
| 1451 | UNIMPLEMENTED(); |
| 1452 | return true; |
| 1453 | } |
| 1454 | |
| 1455 | bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 1456 | { |
| 1457 | UNIMPLEMENTED(); |
| 1458 | return true; |
| 1459 | } |
| 1460 | |
| 1461 | bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 1462 | { |
| 1463 | UNIMPLEMENTED(); |
| 1464 | return true; |
| 1465 | } |
| 1466 | |
| 1467 | bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param) |
| 1468 | { |
| 1469 | UNIMPLEMENTED(); |
| 1470 | return true; |
| 1471 | } |
| 1472 | |
| 1473 | bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param) |
| 1474 | { |
| 1475 | UNIMPLEMENTED(); |
| 1476 | return true; |
| 1477 | } |
| 1478 | |
| 1479 | bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param) |
| 1480 | { |
| 1481 | UNIMPLEMENTED(); |
| 1482 | return true; |
| 1483 | } |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 1484 | |
| 1485 | } // namespace gl |