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