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