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 | |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 379 | switch (target) |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 380 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 381 | case TextureEnvTarget::Env: |
| 382 | switch (pname) |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 383 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 384 | case TextureEnvParameter::Mode: |
| 385 | { |
| 386 | TextureEnvMode mode = FromGLenum<TextureEnvMode>(ConvertToGLenum(params[0])); |
| 387 | switch (mode) |
Lingfeng Yang | 4004ae0 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 388 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 389 | case TextureEnvMode::Add: |
| 390 | case TextureEnvMode::Blend: |
| 391 | case TextureEnvMode::Combine: |
| 392 | case TextureEnvMode::Decal: |
| 393 | case TextureEnvMode::Modulate: |
| 394 | case TextureEnvMode::Replace: |
| 395 | break; |
| 396 | default: |
| 397 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureEnvMode); |
| 398 | return false; |
| 399 | } |
| 400 | break; |
| 401 | } |
| 402 | case TextureEnvParameter::CombineRgb: |
| 403 | case TextureEnvParameter::CombineAlpha: |
| 404 | { |
| 405 | TextureCombine combine = FromGLenum<TextureCombine>(ConvertToGLenum(params[0])); |
| 406 | switch (combine) |
| 407 | { |
| 408 | case TextureCombine::Add: |
| 409 | case TextureCombine::AddSigned: |
| 410 | case TextureCombine::Interpolate: |
| 411 | case TextureCombine::Modulate: |
| 412 | case TextureCombine::Replace: |
| 413 | case TextureCombine::Subtract: |
| 414 | break; |
| 415 | case TextureCombine::Dot3Rgb: |
| 416 | case TextureCombine::Dot3Rgba: |
| 417 | if (pname == TextureEnvParameter::CombineAlpha) |
| 418 | { |
| 419 | ANGLE_VALIDATION_ERR(context, InvalidValue(), |
| 420 | InvalidTextureCombine); |
| 421 | return false; |
| 422 | } |
| 423 | break; |
| 424 | default: |
| 425 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombine); |
| 426 | return false; |
| 427 | } |
| 428 | break; |
| 429 | } |
| 430 | case TextureEnvParameter::Src0Rgb: |
| 431 | case TextureEnvParameter::Src1Rgb: |
| 432 | case TextureEnvParameter::Src2Rgb: |
| 433 | case TextureEnvParameter::Src0Alpha: |
| 434 | case TextureEnvParameter::Src1Alpha: |
| 435 | case TextureEnvParameter::Src2Alpha: |
| 436 | { |
| 437 | TextureSrc combine = FromGLenum<TextureSrc>(ConvertToGLenum(params[0])); |
| 438 | switch (combine) |
| 439 | { |
| 440 | case TextureSrc::Constant: |
| 441 | case TextureSrc::Previous: |
| 442 | case TextureSrc::PrimaryColor: |
| 443 | case TextureSrc::Texture: |
| 444 | break; |
| 445 | default: |
| 446 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombineSrc); |
| 447 | return false; |
| 448 | } |
| 449 | break; |
| 450 | } |
| 451 | case TextureEnvParameter::Op0Rgb: |
| 452 | case TextureEnvParameter::Op1Rgb: |
| 453 | case TextureEnvParameter::Op2Rgb: |
| 454 | case TextureEnvParameter::Op0Alpha: |
| 455 | case TextureEnvParameter::Op1Alpha: |
| 456 | case TextureEnvParameter::Op2Alpha: |
| 457 | { |
| 458 | TextureOp operand = FromGLenum<TextureOp>(ConvertToGLenum(params[0])); |
| 459 | switch (operand) |
| 460 | { |
| 461 | case TextureOp::SrcAlpha: |
| 462 | case TextureOp::OneMinusSrcAlpha: |
| 463 | break; |
| 464 | case TextureOp::SrcColor: |
| 465 | case TextureOp::OneMinusSrcColor: |
| 466 | if (pname == TextureEnvParameter::Op0Alpha || |
| 467 | pname == TextureEnvParameter::Op1Alpha || |
| 468 | pname == TextureEnvParameter::Op2Alpha) |
| 469 | { |
| 470 | ANGLE_VALIDATION_ERR(context, InvalidValue(), |
| 471 | InvalidTextureCombine); |
| 472 | return false; |
| 473 | } |
| 474 | break; |
| 475 | default: |
| 476 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureCombineOp); |
| 477 | return false; |
| 478 | } |
| 479 | break; |
| 480 | } |
| 481 | case TextureEnvParameter::RgbScale: |
| 482 | case TextureEnvParameter::AlphaScale: |
| 483 | if (params[0] != 1.0f && params[0] != 2.0f && params[0] != 4.0f) |
| 484 | { |
| 485 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidTextureEnvScale); |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 486 | return false; |
| 487 | } |
| 488 | break; |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 489 | case TextureEnvParameter::Color: |
| 490 | break; |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 491 | default: |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 492 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvParameter); |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 493 | return false; |
| 494 | } |
| 495 | break; |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 496 | case TextureEnvTarget::PointSprite: |
| 497 | if (!context->getExtensions().pointSprite) |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 498 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 499 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvTarget); |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 500 | return false; |
| 501 | } |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 502 | switch (pname) |
| 503 | { |
| 504 | case TextureEnvParameter::PointCoordReplace: |
| 505 | break; |
| 506 | default: |
| 507 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvParameter); |
| 508 | return false; |
| 509 | } |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 510 | break; |
| 511 | default: |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 512 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureEnvTarget); |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 513 | return false; |
| 514 | } |
| 515 | return true; |
| 516 | } |
| 517 | |
| 518 | bool ValidateGetTexEnvCommon(Context *context, TextureEnvTarget target, TextureEnvParameter pname) |
| 519 | { |
| 520 | GLfloat dummy[4] = {}; |
| 521 | switch (pname) |
| 522 | { |
| 523 | case TextureEnvParameter::Mode: |
| 524 | ConvertPackedEnum(TextureEnvMode::Add, dummy); |
| 525 | break; |
| 526 | case TextureEnvParameter::CombineRgb: |
| 527 | case TextureEnvParameter::CombineAlpha: |
| 528 | ConvertPackedEnum(TextureCombine::Add, dummy); |
| 529 | break; |
| 530 | case TextureEnvParameter::Src0Rgb: |
| 531 | case TextureEnvParameter::Src1Rgb: |
| 532 | case TextureEnvParameter::Src2Rgb: |
| 533 | case TextureEnvParameter::Src0Alpha: |
| 534 | case TextureEnvParameter::Src1Alpha: |
| 535 | case TextureEnvParameter::Src2Alpha: |
| 536 | ConvertPackedEnum(TextureSrc::Constant, dummy); |
| 537 | break; |
| 538 | case TextureEnvParameter::Op0Rgb: |
| 539 | case TextureEnvParameter::Op1Rgb: |
| 540 | case TextureEnvParameter::Op2Rgb: |
| 541 | case TextureEnvParameter::Op0Alpha: |
| 542 | case TextureEnvParameter::Op1Alpha: |
| 543 | case TextureEnvParameter::Op2Alpha: |
| 544 | ConvertPackedEnum(TextureOp::SrcAlpha, dummy); |
| 545 | break; |
| 546 | case TextureEnvParameter::RgbScale: |
| 547 | case TextureEnvParameter::AlphaScale: |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 548 | case TextureEnvParameter::PointCoordReplace: |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 549 | dummy[0] = 1.0f; |
| 550 | break; |
| 551 | default: |
| 552 | break; |
| 553 | } |
| 554 | |
| 555 | return ValidateTexEnvCommon(context, target, pname, dummy); |
| 556 | } |
| 557 | |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 558 | bool ValidatePointParameterCommon(Context *context, PointParameter pname, const GLfloat *params) |
| 559 | { |
| 560 | ANGLE_VALIDATE_IS_GLES1(context); |
| 561 | |
| 562 | switch (pname) |
| 563 | { |
| 564 | case PointParameter::PointSizeMin: |
| 565 | case PointParameter::PointSizeMax: |
| 566 | case PointParameter::PointFadeThresholdSize: |
| 567 | case PointParameter::PointDistanceAttenuation: |
| 568 | for (unsigned int i = 0; i < GetPointParameterCount(pname); i++) |
| 569 | { |
| 570 | if (params[i] < 0.0f) |
| 571 | { |
| 572 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidPointParameterValue); |
| 573 | return false; |
| 574 | } |
| 575 | } |
| 576 | break; |
| 577 | default: |
| 578 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointParameter); |
| 579 | return false; |
| 580 | } |
| 581 | |
| 582 | return true; |
| 583 | } |
| 584 | |
| 585 | bool ValidatePointSizeCommon(Context *context, GLfloat size) |
| 586 | { |
| 587 | ANGLE_VALIDATE_IS_GLES1(context); |
| 588 | |
| 589 | if (size <= 0.0f) |
| 590 | { |
| 591 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidPointSizeValue); |
| 592 | return false; |
| 593 | } |
| 594 | |
| 595 | return true; |
| 596 | } |
| 597 | |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 598 | bool ValidateDrawTexCommon(Context *context, float width, float height) |
| 599 | { |
| 600 | ANGLE_VALIDATE_IS_GLES1(context); |
| 601 | |
| 602 | if (width <= 0.0f || height <= 0.0f) |
| 603 | { |
| 604 | ANGLE_VALIDATION_ERR(context, InvalidValue(), NonPositiveDrawTextureDimension); |
| 605 | return false; |
| 606 | } |
| 607 | |
| 608 | return true; |
| 609 | } |
| 610 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 611 | } // namespace gl |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 612 | |
| 613 | namespace gl |
| 614 | { |
| 615 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 616 | bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 617 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 618 | ANGLE_VALIDATE_IS_GLES1(context); |
| 619 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 620 | } |
| 621 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 622 | bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 623 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 624 | ANGLE_VALIDATE_IS_GLES1(context); |
| 625 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 626 | } |
| 627 | |
| 628 | bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 629 | { |
| 630 | UNIMPLEMENTED(); |
| 631 | return true; |
| 632 | } |
| 633 | |
| 634 | bool ValidateClearDepthx(Context *context, GLfixed depth) |
| 635 | { |
| 636 | UNIMPLEMENTED(); |
| 637 | return true; |
| 638 | } |
| 639 | |
| 640 | bool ValidateClientActiveTexture(Context *context, GLenum texture) |
| 641 | { |
Lingfeng Yang | 96310cd | 2018-03-28 11:56:28 -0700 | [diff] [blame] | 642 | ANGLE_VALIDATE_IS_GLES1(context); |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 643 | return ValidateMultitextureUnit(context, texture); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 644 | } |
| 645 | |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 646 | bool ValidateClipPlanef(Context *context, GLenum plane, const GLfloat *eqn) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 647 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 648 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 649 | } |
| 650 | |
| 651 | bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation) |
| 652 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 653 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 654 | } |
| 655 | |
| 656 | bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) |
| 657 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 658 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 659 | return true; |
| 660 | } |
| 661 | |
| 662 | bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) |
| 663 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 664 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 665 | return true; |
| 666 | } |
| 667 | |
| 668 | bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 669 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 670 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 671 | return true; |
| 672 | } |
| 673 | |
| 674 | bool ValidateColorPointer(Context *context, |
| 675 | GLint size, |
| 676 | GLenum type, |
| 677 | GLsizei stride, |
| 678 | const void *pointer) |
| 679 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 680 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Color, size, type, |
| 681 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | bool ValidateCullFace(Context *context, GLenum mode) |
| 685 | { |
| 686 | UNIMPLEMENTED(); |
| 687 | return true; |
| 688 | } |
| 689 | |
| 690 | bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f) |
| 691 | { |
| 692 | UNIMPLEMENTED(); |
| 693 | return true; |
| 694 | } |
| 695 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 696 | bool ValidateDisableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 697 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 698 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 699 | } |
| 700 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 701 | bool ValidateEnableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 702 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 703 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 704 | } |
| 705 | |
| 706 | bool ValidateFogf(Context *context, GLenum pname, GLfloat param) |
| 707 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 708 | return ValidateFogCommon(context, pname, ¶m); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 709 | } |
| 710 | |
| 711 | bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params) |
| 712 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 713 | return ValidateFogCommon(context, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 714 | } |
| 715 | |
| 716 | bool ValidateFogx(Context *context, GLenum pname, GLfixed param) |
| 717 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 718 | GLfloat asFloat = FixedToFloat(param); |
| 719 | return ValidateFogCommon(context, pname, &asFloat); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 720 | } |
| 721 | |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 722 | bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 723 | { |
Lingfeng Yang | 7ba3f42 | 2018-06-01 09:43:04 -0700 | [diff] [blame] | 724 | unsigned int paramCount = GetFogParameterCount(pname); |
| 725 | GLfloat paramsf[4] = {}; |
| 726 | |
| 727 | for (unsigned int i = 0; i < paramCount; i++) |
| 728 | { |
| 729 | paramsf[i] = FixedToFloat(params[i]); |
| 730 | } |
| 731 | |
| 732 | return ValidateFogCommon(context, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | bool ValidateFrustumf(Context *context, |
| 736 | GLfloat l, |
| 737 | GLfloat r, |
| 738 | GLfloat b, |
| 739 | GLfloat t, |
| 740 | GLfloat n, |
| 741 | GLfloat f) |
| 742 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 743 | ANGLE_VALIDATE_IS_GLES1(context); |
| 744 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 745 | { |
| 746 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 747 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 748 | return true; |
| 749 | } |
| 750 | |
| 751 | bool ValidateFrustumx(Context *context, |
| 752 | GLfixed l, |
| 753 | GLfixed r, |
| 754 | GLfixed b, |
| 755 | GLfixed t, |
| 756 | GLfixed n, |
| 757 | GLfixed f) |
| 758 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 759 | ANGLE_VALIDATE_IS_GLES1(context); |
| 760 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 761 | { |
| 762 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 763 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 764 | return true; |
| 765 | } |
| 766 | |
| 767 | bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 768 | { |
| 769 | UNIMPLEMENTED(); |
| 770 | return true; |
| 771 | } |
| 772 | |
| 773 | bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation) |
| 774 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 775 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 776 | } |
| 777 | |
| 778 | bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation) |
| 779 | { |
Lingfeng Yang | 060088a | 2018-05-30 20:40:57 -0700 | [diff] [blame] | 780 | return ValidateClipPlaneCommon(context, plane); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 781 | } |
| 782 | |
| 783 | bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params) |
| 784 | { |
| 785 | UNIMPLEMENTED(); |
| 786 | return true; |
| 787 | } |
| 788 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 789 | bool ValidateGetLightfv(Context *context, GLenum light, LightParameter pname, GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 790 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 791 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 792 | return ValidateLightCommon(context, light, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 793 | } |
| 794 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 795 | bool ValidateGetLightxv(Context *context, GLenum light, LightParameter pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 796 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 797 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 798 | return ValidateLightCommon(context, light, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 799 | } |
| 800 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 801 | bool ValidateGetMaterialfv(Context *context, GLenum face, MaterialParameter pname, GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 802 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 803 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 804 | return ValidateMaterialCommon(context, face, pname, dummyParams); |
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 ValidateGetMaterialxv(Context *context, GLenum face, MaterialParameter pname, GLfixed *params) |
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 | GLfloat dummyParams[4] = {0.0f, 0.0f, 0.0f, 0.0f}; |
| 810 | return ValidateMaterialCommon(context, face, pname, dummyParams); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 811 | } |
| 812 | |
| 813 | bool ValidateGetPointerv(Context *context, GLenum pname, void **params) |
| 814 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 815 | ANGLE_VALIDATE_IS_GLES1(context); |
| 816 | switch (pname) |
| 817 | { |
| 818 | case GL_VERTEX_ARRAY_POINTER: |
| 819 | case GL_NORMAL_ARRAY_POINTER: |
| 820 | case GL_COLOR_ARRAY_POINTER: |
| 821 | case GL_TEXTURE_COORD_ARRAY_POINTER: |
| 822 | case GL_POINT_SIZE_ARRAY_POINTER_OES: |
| 823 | return true; |
| 824 | default: |
| 825 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointerQuery); |
| 826 | return false; |
| 827 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 828 | } |
| 829 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 830 | bool ValidateGetTexEnvfv(Context *context, |
| 831 | TextureEnvTarget target, |
| 832 | TextureEnvParameter pname, |
| 833 | GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 834 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 835 | return ValidateGetTexEnvCommon(context, target, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 836 | } |
| 837 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 838 | bool ValidateGetTexEnviv(Context *context, |
| 839 | TextureEnvTarget target, |
| 840 | TextureEnvParameter pname, |
| 841 | GLint *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 842 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 843 | return ValidateGetTexEnvCommon(context, target, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 844 | } |
| 845 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 846 | bool ValidateGetTexEnvxv(Context *context, |
| 847 | TextureEnvTarget target, |
| 848 | TextureEnvParameter pname, |
| 849 | GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 850 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 851 | return ValidateGetTexEnvCommon(context, target, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 852 | } |
| 853 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 854 | bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 855 | { |
Lingfeng Yang | f97641c | 2018-06-21 19:22:45 -0700 | [diff] [blame] | 856 | ANGLE_VALIDATE_IS_GLES1(context); |
| 857 | |
| 858 | if (!ValidateGetTexParameterBase(context, target, pname, nullptr)) |
| 859 | { |
| 860 | return false; |
| 861 | } |
| 862 | |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 863 | return true; |
| 864 | } |
| 865 | |
| 866 | bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param) |
| 867 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 868 | return ValidateLightModelSingleComponent(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 869 | } |
| 870 | |
| 871 | bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params) |
| 872 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 873 | return ValidateLightModelCommon(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 874 | } |
| 875 | |
| 876 | bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param) |
| 877 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 878 | return ValidateLightModelSingleComponent(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 879 | } |
| 880 | |
| 881 | bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param) |
| 882 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 883 | return ValidateLightModelCommon(context, pname); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 884 | } |
| 885 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 886 | bool ValidateLightf(Context *context, GLenum light, LightParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 887 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 888 | return ValidateLightSingleComponent(context, light, pname, param); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 889 | } |
| 890 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 891 | bool ValidateLightfv(Context *context, GLenum light, LightParameter pname, const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 892 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 893 | return ValidateLightCommon(context, light, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 894 | } |
| 895 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 896 | bool ValidateLightx(Context *context, GLenum light, LightParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 897 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 898 | return ValidateLightSingleComponent(context, light, pname, FixedToFloat(param)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 899 | } |
| 900 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 901 | bool ValidateLightxv(Context *context, GLenum light, LightParameter pname, const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 902 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 903 | GLfloat paramsf[4]; |
| 904 | for (unsigned int i = 0; i < GetLightParameterCount(pname); i++) |
| 905 | { |
| 906 | paramsf[i] = FixedToFloat(params[i]); |
| 907 | } |
| 908 | |
| 909 | return ValidateLightCommon(context, light, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | bool ValidateLineWidthx(Context *context, GLfixed width) |
| 913 | { |
| 914 | UNIMPLEMENTED(); |
| 915 | return true; |
| 916 | } |
| 917 | |
| 918 | bool ValidateLoadIdentity(Context *context) |
| 919 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 920 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 921 | return true; |
| 922 | } |
| 923 | |
| 924 | bool ValidateLoadMatrixf(Context *context, const GLfloat *m) |
| 925 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 926 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 927 | return true; |
| 928 | } |
| 929 | |
| 930 | bool ValidateLoadMatrixx(Context *context, const GLfixed *m) |
| 931 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 932 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 933 | return true; |
| 934 | } |
| 935 | |
| 936 | bool ValidateLogicOp(Context *context, GLenum opcode) |
| 937 | { |
| 938 | UNIMPLEMENTED(); |
| 939 | return true; |
| 940 | } |
| 941 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 942 | bool ValidateMaterialf(Context *context, GLenum face, MaterialParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 943 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 944 | return ValidateMaterialSingleComponent(context, face, pname, param); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 945 | } |
| 946 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 947 | bool ValidateMaterialfv(Context *context, |
| 948 | GLenum face, |
| 949 | MaterialParameter pname, |
| 950 | const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 951 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 952 | return ValidateMaterialCommon(context, face, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 953 | } |
| 954 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 955 | bool ValidateMaterialx(Context *context, GLenum face, MaterialParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 956 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 957 | return ValidateMaterialSingleComponent(context, face, pname, FixedToFloat(param)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 958 | } |
| 959 | |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 960 | bool ValidateMaterialxv(Context *context, |
| 961 | GLenum face, |
| 962 | MaterialParameter pname, |
| 963 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 964 | { |
Lingfeng Yang | d0febe7 | 2018-05-17 22:36:52 -0700 | [diff] [blame] | 965 | GLfloat paramsf[4]; |
| 966 | |
| 967 | for (unsigned int i = 0; i < GetMaterialParameterCount(pname); i++) |
| 968 | { |
| 969 | paramsf[i] = FixedToFloat(params[i]); |
| 970 | } |
| 971 | |
| 972 | return ValidateMaterialCommon(context, face, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 973 | } |
| 974 | |
Lingfeng Yang | 00af463 | 2018-04-02 12:42:24 -0700 | [diff] [blame] | 975 | bool ValidateMatrixMode(Context *context, MatrixType mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 976 | { |
Lingfeng Yang | d2488ab | 2018-04-04 09:25:48 -0700 | [diff] [blame] | 977 | ANGLE_VALIDATE_IS_GLES1(context); |
| 978 | switch (mode) |
| 979 | { |
| 980 | case MatrixType::Projection: |
| 981 | case MatrixType::Modelview: |
| 982 | case MatrixType::Texture: |
| 983 | return true; |
| 984 | default: |
| 985 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode); |
| 986 | return false; |
| 987 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 988 | } |
| 989 | |
| 990 | bool ValidateMultMatrixf(Context *context, const GLfloat *m) |
| 991 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 992 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 993 | return true; |
| 994 | } |
| 995 | |
| 996 | bool ValidateMultMatrixx(Context *context, const GLfixed *m) |
| 997 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 998 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 999 | return true; |
| 1000 | } |
| 1001 | |
| 1002 | bool ValidateMultiTexCoord4f(Context *context, |
| 1003 | GLenum target, |
| 1004 | GLfloat s, |
| 1005 | GLfloat t, |
| 1006 | GLfloat r, |
| 1007 | GLfloat q) |
| 1008 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 1009 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1010 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1011 | } |
| 1012 | |
| 1013 | bool ValidateMultiTexCoord4x(Context *context, |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 1014 | GLenum target, |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1015 | GLfixed s, |
| 1016 | GLfixed t, |
| 1017 | GLfixed r, |
| 1018 | GLfixed q) |
| 1019 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 1020 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1021 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1022 | } |
| 1023 | |
| 1024 | bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz) |
| 1025 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 1026 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1027 | return true; |
| 1028 | } |
| 1029 | |
| 1030 | bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz) |
| 1031 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 1032 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1033 | return true; |
| 1034 | } |
| 1035 | |
| 1036 | bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 1037 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1038 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Normal, 3, type, |
| 1039 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1040 | } |
| 1041 | |
| 1042 | bool ValidateOrthof(Context *context, |
| 1043 | GLfloat l, |
| 1044 | GLfloat r, |
| 1045 | GLfloat b, |
| 1046 | GLfloat t, |
| 1047 | GLfloat n, |
| 1048 | GLfloat f) |
| 1049 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1050 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1051 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 1052 | { |
| 1053 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 1054 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1055 | return true; |
| 1056 | } |
| 1057 | |
| 1058 | bool ValidateOrthox(Context *context, |
| 1059 | GLfixed l, |
| 1060 | GLfixed r, |
| 1061 | GLfixed b, |
| 1062 | GLfixed t, |
| 1063 | GLfixed n, |
| 1064 | GLfixed f) |
| 1065 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1066 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1067 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 1068 | { |
| 1069 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 1070 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1071 | return true; |
| 1072 | } |
| 1073 | |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1074 | bool ValidatePointParameterf(Context *context, PointParameter pname, GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1075 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1076 | unsigned int paramCount = GetPointParameterCount(pname); |
| 1077 | if (paramCount != 1) |
| 1078 | { |
| 1079 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointParameter); |
| 1080 | return false; |
| 1081 | } |
| 1082 | |
| 1083 | return ValidatePointParameterCommon(context, pname, ¶m); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1084 | } |
| 1085 | |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1086 | bool ValidatePointParameterfv(Context *context, PointParameter pname, const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1087 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1088 | return ValidatePointParameterCommon(context, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1089 | } |
| 1090 | |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1091 | bool ValidatePointParameterx(Context *context, PointParameter pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1092 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1093 | unsigned int paramCount = GetPointParameterCount(pname); |
| 1094 | if (paramCount != 1) |
| 1095 | { |
| 1096 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPointParameter); |
| 1097 | return false; |
| 1098 | } |
| 1099 | |
| 1100 | GLfloat paramf = FixedToFloat(param); |
| 1101 | return ValidatePointParameterCommon(context, pname, ¶mf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1102 | } |
| 1103 | |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1104 | bool ValidatePointParameterxv(Context *context, PointParameter pname, const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1105 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1106 | GLfloat paramsf[4] = {}; |
| 1107 | for (unsigned int i = 0; i < GetPointParameterCount(pname); i++) |
| 1108 | { |
| 1109 | paramsf[i] = FixedToFloat(params[i]); |
| 1110 | } |
| 1111 | return ValidatePointParameterCommon(context, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1112 | } |
| 1113 | |
| 1114 | bool ValidatePointSize(Context *context, GLfloat size) |
| 1115 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1116 | return ValidatePointSizeCommon(context, size); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1117 | } |
| 1118 | |
| 1119 | bool ValidatePointSizex(Context *context, GLfixed size) |
| 1120 | { |
Lingfeng Yang | 9c4c092 | 2018-06-13 09:29:00 -0700 | [diff] [blame] | 1121 | return ValidatePointSizeCommon(context, FixedToFloat(size)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1122 | } |
| 1123 | |
| 1124 | bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units) |
| 1125 | { |
| 1126 | UNIMPLEMENTED(); |
| 1127 | return true; |
| 1128 | } |
| 1129 | |
| 1130 | bool ValidatePopMatrix(Context *context) |
| 1131 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 1132 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1133 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 1134 | if (stack.size() == 1) |
| 1135 | { |
| 1136 | ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow); |
| 1137 | return false; |
| 1138 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1139 | return true; |
| 1140 | } |
| 1141 | |
| 1142 | bool ValidatePushMatrix(Context *context) |
| 1143 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 1144 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1145 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 1146 | if (stack.size() == stack.max_size()) |
| 1147 | { |
| 1148 | ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow); |
| 1149 | return false; |
| 1150 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1151 | return true; |
| 1152 | } |
| 1153 | |
| 1154 | bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
| 1155 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1156 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1157 | return true; |
| 1158 | } |
| 1159 | |
| 1160 | bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) |
| 1161 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1162 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1163 | return true; |
| 1164 | } |
| 1165 | |
| 1166 | bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert) |
| 1167 | { |
| 1168 | UNIMPLEMENTED(); |
| 1169 | return true; |
| 1170 | } |
| 1171 | |
| 1172 | bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 1173 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1174 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1175 | return true; |
| 1176 | } |
| 1177 | |
| 1178 | bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 1179 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1180 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1181 | return true; |
| 1182 | } |
| 1183 | |
Lingfeng Yang | a0cfa87 | 2018-05-30 21:12:17 -0700 | [diff] [blame] | 1184 | bool ValidateShadeModel(Context *context, ShadingModel mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1185 | { |
Lingfeng Yang | a0cfa87 | 2018-05-30 21:12:17 -0700 | [diff] [blame] | 1186 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1187 | switch (mode) |
| 1188 | { |
| 1189 | case ShadingModel::Flat: |
| 1190 | case ShadingModel::Smooth: |
| 1191 | return true; |
| 1192 | default: |
| 1193 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidShadingModel); |
| 1194 | return false; |
| 1195 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1196 | } |
| 1197 | |
| 1198 | bool ValidateTexCoordPointer(Context *context, |
| 1199 | GLint size, |
| 1200 | GLenum type, |
| 1201 | GLsizei stride, |
| 1202 | const void *pointer) |
| 1203 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1204 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::TextureCoord, size, |
| 1205 | type, stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1206 | } |
| 1207 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1208 | bool ValidateTexEnvf(Context *context, |
| 1209 | TextureEnvTarget target, |
| 1210 | TextureEnvParameter pname, |
| 1211 | GLfloat param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1212 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1213 | return ValidateTexEnvCommon(context, target, pname, ¶m); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1214 | } |
| 1215 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1216 | bool ValidateTexEnvfv(Context *context, |
| 1217 | TextureEnvTarget target, |
| 1218 | TextureEnvParameter pname, |
| 1219 | const GLfloat *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1220 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1221 | return ValidateTexEnvCommon(context, target, pname, params); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1222 | } |
| 1223 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1224 | bool ValidateTexEnvi(Context *context, |
| 1225 | TextureEnvTarget target, |
| 1226 | TextureEnvParameter pname, |
| 1227 | GLint param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1228 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1229 | GLfloat paramf = static_cast<GLfloat>(param); |
| 1230 | return ValidateTexEnvCommon(context, target, pname, ¶mf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1231 | } |
| 1232 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1233 | bool ValidateTexEnviv(Context *context, |
| 1234 | TextureEnvTarget target, |
| 1235 | TextureEnvParameter pname, |
| 1236 | const GLint *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1237 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1238 | GLfloat paramsf[4]; |
| 1239 | for (unsigned int i = 0; i < GetTextureEnvParameterCount(pname); i++) |
| 1240 | { |
| 1241 | paramsf[i] = static_cast<GLfloat>(params[i]); |
| 1242 | } |
| 1243 | return ValidateTexEnvCommon(context, target, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1244 | } |
| 1245 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1246 | bool ValidateTexEnvx(Context *context, |
| 1247 | TextureEnvTarget target, |
| 1248 | TextureEnvParameter pname, |
| 1249 | GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1250 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1251 | GLfloat paramf = static_cast<GLfloat>(param); |
| 1252 | return ValidateTexEnvCommon(context, target, pname, ¶mf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1253 | } |
| 1254 | |
Lingfeng Yang | 74be296 | 2018-06-07 09:13:38 -0700 | [diff] [blame] | 1255 | bool ValidateTexEnvxv(Context *context, |
| 1256 | TextureEnvTarget target, |
| 1257 | TextureEnvParameter pname, |
| 1258 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1259 | { |
Lingfeng Yang | 45b5a87 | 2018-06-07 11:33:25 -0700 | [diff] [blame] | 1260 | GLfloat paramsf[4]; |
| 1261 | for (unsigned int i = 0; i < GetTextureEnvParameterCount(pname); i++) |
| 1262 | { |
| 1263 | paramsf[i] = static_cast<GLfloat>(params[i]); |
| 1264 | } |
| 1265 | return ValidateTexEnvCommon(context, target, pname, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1266 | } |
| 1267 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 1268 | bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1269 | { |
Lingfeng Yang | f97641c | 2018-06-21 19:22:45 -0700 | [diff] [blame] | 1270 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1271 | GLfloat paramf = FixedToFloat(param); |
| 1272 | return ValidateTexParameterBase(context, target, pname, 1, ¶mf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1273 | } |
| 1274 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 1275 | bool ValidateTexParameterxv(Context *context, |
| 1276 | TextureType target, |
| 1277 | GLenum pname, |
| 1278 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1279 | { |
Lingfeng Yang | f97641c | 2018-06-21 19:22:45 -0700 | [diff] [blame] | 1280 | ANGLE_VALIDATE_IS_GLES1(context); |
| 1281 | GLfloat paramsf[4] = {}; |
| 1282 | for (unsigned int i = 0; i < GetTexParameterCount(pname); i++) |
| 1283 | { |
| 1284 | paramsf[i] = FixedToFloat(params[i]); |
| 1285 | } |
| 1286 | return ValidateTexParameterBase(context, target, pname, -1, paramsf); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1287 | } |
| 1288 | |
| 1289 | bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 1290 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1291 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1292 | return true; |
| 1293 | } |
| 1294 | |
| 1295 | bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 1296 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 1297 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1298 | return true; |
| 1299 | } |
| 1300 | |
| 1301 | bool ValidateVertexPointer(Context *context, |
| 1302 | GLint size, |
| 1303 | GLenum type, |
| 1304 | GLsizei stride, |
| 1305 | const void *pointer) |
| 1306 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1307 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::Vertex, size, type, |
| 1308 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1309 | } |
| 1310 | |
| 1311 | bool ValidateDrawTexfOES(Context *context, |
| 1312 | GLfloat x, |
| 1313 | GLfloat y, |
| 1314 | GLfloat z, |
| 1315 | GLfloat width, |
| 1316 | GLfloat height) |
| 1317 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1318 | return ValidateDrawTexCommon(context, width, height); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1319 | } |
| 1320 | |
| 1321 | bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords) |
| 1322 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1323 | return ValidateDrawTexCommon(context, coords[3], coords[4]); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1324 | } |
| 1325 | |
| 1326 | bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height) |
| 1327 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1328 | return ValidateDrawTexCommon(context, static_cast<GLfloat>(width), |
| 1329 | static_cast<GLfloat>(height)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1330 | } |
| 1331 | |
| 1332 | bool ValidateDrawTexivOES(Context *context, const GLint *coords) |
| 1333 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1334 | return ValidateDrawTexCommon(context, static_cast<GLfloat>(coords[3]), |
| 1335 | static_cast<GLfloat>(coords[4])); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1336 | } |
| 1337 | |
| 1338 | bool ValidateDrawTexsOES(Context *context, |
| 1339 | GLshort x, |
| 1340 | GLshort y, |
| 1341 | GLshort z, |
| 1342 | GLshort width, |
| 1343 | GLshort height) |
| 1344 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1345 | return ValidateDrawTexCommon(context, static_cast<GLfloat>(width), |
| 1346 | static_cast<GLfloat>(height)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1347 | } |
| 1348 | |
| 1349 | bool ValidateDrawTexsvOES(Context *context, const GLshort *coords) |
| 1350 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1351 | return ValidateDrawTexCommon(context, static_cast<GLfloat>(coords[3]), |
| 1352 | static_cast<GLfloat>(coords[4])); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1353 | } |
| 1354 | |
| 1355 | bool ValidateDrawTexxOES(Context *context, |
| 1356 | GLfixed x, |
| 1357 | GLfixed y, |
| 1358 | GLfixed z, |
| 1359 | GLfixed width, |
| 1360 | GLfixed height) |
| 1361 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1362 | return ValidateDrawTexCommon(context, FixedToFloat(width), FixedToFloat(height)); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1363 | } |
| 1364 | |
| 1365 | bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords) |
| 1366 | { |
Lingfeng Yang | 0df813c | 2018-07-12 12:52:06 -0700 | [diff] [blame^] | 1367 | return ValidateDrawTexCommon(context, FixedToFloat(coords[3]), FixedToFloat(coords[4])); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1368 | } |
| 1369 | |
| 1370 | bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex) |
| 1371 | { |
| 1372 | UNIMPLEMENTED(); |
| 1373 | return true; |
| 1374 | } |
| 1375 | |
| 1376 | bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context) |
| 1377 | { |
| 1378 | UNIMPLEMENTED(); |
| 1379 | return true; |
| 1380 | } |
| 1381 | |
| 1382 | bool ValidateMatrixIndexPointerOES(Context *context, |
| 1383 | GLint size, |
| 1384 | GLenum type, |
| 1385 | GLsizei stride, |
| 1386 | const void *pointer) |
| 1387 | { |
| 1388 | UNIMPLEMENTED(); |
| 1389 | return true; |
| 1390 | } |
| 1391 | |
| 1392 | bool ValidateWeightPointerOES(Context *context, |
| 1393 | GLint size, |
| 1394 | GLenum type, |
| 1395 | GLsizei stride, |
| 1396 | const void *pointer) |
| 1397 | { |
| 1398 | UNIMPLEMENTED(); |
| 1399 | return true; |
| 1400 | } |
| 1401 | |
| 1402 | bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 1403 | { |
Lingfeng Yang | abb09f1 | 2018-04-16 10:43:53 -0700 | [diff] [blame] | 1404 | return ValidateBuiltinVertexAttributeCommon(context, ClientVertexArrayType::PointSize, 1, type, |
| 1405 | stride, pointer); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1406 | } |
| 1407 | |
| 1408 | bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent) |
| 1409 | { |
| 1410 | UNIMPLEMENTED(); |
| 1411 | return true; |
| 1412 | } |
Lingfeng Yang | a064878 | 2018-03-12 14:45:25 -0700 | [diff] [blame] | 1413 | |
| 1414 | bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers) |
| 1415 | { |
| 1416 | UNIMPLEMENTED(); |
| 1417 | return true; |
| 1418 | } |
| 1419 | |
| 1420 | bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers) |
| 1421 | { |
| 1422 | UNIMPLEMENTED(); |
| 1423 | return true; |
| 1424 | } |
| 1425 | |
| 1426 | bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers) |
| 1427 | { |
| 1428 | UNIMPLEMENTED(); |
| 1429 | return true; |
| 1430 | } |
| 1431 | |
| 1432 | bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers) |
| 1433 | { |
| 1434 | UNIMPLEMENTED(); |
| 1435 | return true; |
| 1436 | } |
| 1437 | |
| 1438 | bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer) |
| 1439 | { |
| 1440 | UNIMPLEMENTED(); |
| 1441 | return true; |
| 1442 | } |
| 1443 | |
| 1444 | bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer) |
| 1445 | { |
| 1446 | UNIMPLEMENTED(); |
| 1447 | return true; |
| 1448 | } |
| 1449 | |
| 1450 | bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target) |
| 1451 | { |
| 1452 | UNIMPLEMENTED(); |
| 1453 | return true; |
| 1454 | } |
| 1455 | |
| 1456 | bool ValidateFramebufferRenderbufferOES(Context *context, |
| 1457 | GLenum target, |
| 1458 | GLenum attachment, |
| 1459 | GLenum rbtarget, |
| 1460 | GLuint renderbuffer) |
| 1461 | { |
| 1462 | UNIMPLEMENTED(); |
| 1463 | return true; |
| 1464 | } |
| 1465 | |
| 1466 | bool ValidateFramebufferTexture2DOES(Context *context, |
| 1467 | GLenum target, |
| 1468 | GLenum attachment, |
| 1469 | TextureTarget textarget, |
| 1470 | GLuint texture, |
| 1471 | GLint level) |
| 1472 | { |
| 1473 | UNIMPLEMENTED(); |
| 1474 | return true; |
| 1475 | } |
| 1476 | |
| 1477 | bool ValidateGenerateMipmapOES(Context *context, TextureType target) |
| 1478 | { |
| 1479 | UNIMPLEMENTED(); |
| 1480 | return true; |
| 1481 | } |
| 1482 | |
| 1483 | bool ValidateGetFramebufferAttachmentParameterivOES(Context *context, |
| 1484 | GLenum target, |
| 1485 | GLenum attachment, |
| 1486 | GLenum pname, |
| 1487 | GLint *params) |
| 1488 | { |
| 1489 | UNIMPLEMENTED(); |
| 1490 | return true; |
| 1491 | } |
| 1492 | |
| 1493 | bool ValidateGetRenderbufferParameterivOES(Context *context, |
| 1494 | GLenum target, |
| 1495 | GLenum pname, |
| 1496 | GLint *params) |
| 1497 | { |
| 1498 | UNIMPLEMENTED(); |
| 1499 | return true; |
| 1500 | } |
| 1501 | |
| 1502 | bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer) |
| 1503 | { |
| 1504 | UNIMPLEMENTED(); |
| 1505 | return true; |
| 1506 | } |
| 1507 | |
| 1508 | bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer) |
| 1509 | { |
| 1510 | UNIMPLEMENTED(); |
| 1511 | return true; |
| 1512 | } |
| 1513 | |
| 1514 | bool ValidateRenderbufferStorageOES(Context *context, |
| 1515 | GLenum target, |
| 1516 | GLint internalformat, |
| 1517 | GLsizei width, |
| 1518 | GLsizei height) |
| 1519 | { |
| 1520 | UNIMPLEMENTED(); |
| 1521 | return true; |
| 1522 | } |
| 1523 | |
| 1524 | // GL_OES_texture_cube_map |
| 1525 | |
| 1526 | bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params) |
| 1527 | { |
| 1528 | UNIMPLEMENTED(); |
| 1529 | return true; |
| 1530 | } |
| 1531 | |
| 1532 | bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params) |
| 1533 | { |
| 1534 | UNIMPLEMENTED(); |
| 1535 | return true; |
| 1536 | } |
| 1537 | |
| 1538 | bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params) |
| 1539 | { |
| 1540 | UNIMPLEMENTED(); |
| 1541 | return true; |
| 1542 | } |
| 1543 | |
| 1544 | bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params) |
| 1545 | { |
| 1546 | UNIMPLEMENTED(); |
| 1547 | return true; |
| 1548 | } |
| 1549 | |
| 1550 | bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 1551 | { |
| 1552 | UNIMPLEMENTED(); |
| 1553 | return true; |
| 1554 | } |
| 1555 | |
| 1556 | bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 1557 | { |
| 1558 | UNIMPLEMENTED(); |
| 1559 | return true; |
| 1560 | } |
| 1561 | |
| 1562 | bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param) |
| 1563 | { |
| 1564 | UNIMPLEMENTED(); |
| 1565 | return true; |
| 1566 | } |
| 1567 | |
| 1568 | bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param) |
| 1569 | { |
| 1570 | UNIMPLEMENTED(); |
| 1571 | return true; |
| 1572 | } |
| 1573 | |
| 1574 | bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param) |
| 1575 | { |
| 1576 | UNIMPLEMENTED(); |
| 1577 | return true; |
| 1578 | } |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame] | 1579 | |
| 1580 | } // namespace gl |