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 | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 14 | #include "libANGLE/validationES.h" |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 15 | |
| 16 | #define ANGLE_VALIDATE_IS_GLES1(context) \ |
| 17 | if (context->getClientMajorVersion() > 1) \ |
| 18 | { \ |
| 19 | ANGLE_VALIDATION_ERR(context, InvalidOperation(), GLES1Only); \ |
| 20 | return false; \ |
| 21 | } |
| 22 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 23 | namespace gl |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 24 | { |
| 25 | |
| 26 | bool ValidateAlphaFuncCommon(gl::Context *context, gl::AlphaTestFunc func) |
| 27 | { |
| 28 | switch (func) |
| 29 | { |
| 30 | case gl::AlphaTestFunc::AlwaysPass: |
| 31 | case gl::AlphaTestFunc::Equal: |
| 32 | case gl::AlphaTestFunc::Gequal: |
| 33 | case gl::AlphaTestFunc::Greater: |
| 34 | case gl::AlphaTestFunc::Lequal: |
| 35 | case gl::AlphaTestFunc::Less: |
| 36 | case gl::AlphaTestFunc::Never: |
| 37 | case gl::AlphaTestFunc::NotEqual: |
| 38 | return true; |
| 39 | default: |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 40 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported); |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 41 | return false; |
| 42 | } |
| 43 | } |
| 44 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 45 | bool ValidateClientStateCommon(gl::Context *context, gl::ClientVertexArrayType arrayType) |
| 46 | { |
| 47 | ANGLE_VALIDATE_IS_GLES1(context); |
| 48 | switch (arrayType) |
| 49 | { |
| 50 | case gl::ClientVertexArrayType::Vertex: |
| 51 | case gl::ClientVertexArrayType::Normal: |
| 52 | case gl::ClientVertexArrayType::Color: |
| 53 | case gl::ClientVertexArrayType::TextureCoord: |
| 54 | return true; |
| 55 | case gl::ClientVertexArrayType::PointSize: |
| 56 | if (!context->getExtensions().pointSizeArray) |
| 57 | { |
| 58 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), PointSizeArrayExtensionNotEnabled); |
| 59 | return false; |
| 60 | } |
| 61 | return true; |
| 62 | default: |
| 63 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidClientState); |
| 64 | return false; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | } // namespace gl |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 69 | |
| 70 | namespace gl |
| 71 | { |
| 72 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 73 | bool ValidateAlphaFunc(Context *context, AlphaTestFunc func, GLfloat ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 74 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 75 | ANGLE_VALIDATE_IS_GLES1(context); |
| 76 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 77 | } |
| 78 | |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 79 | bool ValidateAlphaFuncx(Context *context, AlphaTestFunc func, GLfixed ref) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 80 | { |
Lingfeng Yang | 13b708f | 2018-03-21 12:14:10 -0700 | [diff] [blame] | 81 | ANGLE_VALIDATE_IS_GLES1(context); |
| 82 | return ValidateAlphaFuncCommon(context, func); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | bool ValidateClearColorx(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 86 | { |
| 87 | UNIMPLEMENTED(); |
| 88 | return true; |
| 89 | } |
| 90 | |
| 91 | bool ValidateClearDepthx(Context *context, GLfixed depth) |
| 92 | { |
| 93 | UNIMPLEMENTED(); |
| 94 | return true; |
| 95 | } |
| 96 | |
| 97 | bool ValidateClientActiveTexture(Context *context, GLenum texture) |
| 98 | { |
Lingfeng Yang | 96310cd | 2018-03-28 11:56:28 -0700 | [diff] [blame] | 99 | ANGLE_VALIDATE_IS_GLES1(context); |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 100 | return ValidateMultitextureUnit(context, texture); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | bool ValidateClipPlanef(Context *context, GLenum p, const GLfloat *eqn) |
| 104 | { |
| 105 | UNIMPLEMENTED(); |
| 106 | return true; |
| 107 | } |
| 108 | |
| 109 | bool ValidateClipPlanex(Context *context, GLenum plane, const GLfixed *equation) |
| 110 | { |
| 111 | UNIMPLEMENTED(); |
| 112 | return true; |
| 113 | } |
| 114 | |
| 115 | bool ValidateColor4f(Context *context, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) |
| 116 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 117 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 118 | return true; |
| 119 | } |
| 120 | |
| 121 | bool ValidateColor4ub(Context *context, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) |
| 122 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 123 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 124 | return true; |
| 125 | } |
| 126 | |
| 127 | bool ValidateColor4x(Context *context, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) |
| 128 | { |
Lingfeng Yang | a43994c | 2018-03-29 07:21:41 -0700 | [diff] [blame] | 129 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 130 | return true; |
| 131 | } |
| 132 | |
| 133 | bool ValidateColorPointer(Context *context, |
| 134 | GLint size, |
| 135 | GLenum type, |
| 136 | GLsizei stride, |
| 137 | const void *pointer) |
| 138 | { |
| 139 | UNIMPLEMENTED(); |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | bool ValidateCullFace(Context *context, GLenum mode) |
| 144 | { |
| 145 | UNIMPLEMENTED(); |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | bool ValidateDepthRangex(Context *context, GLfixed n, GLfixed f) |
| 150 | { |
| 151 | UNIMPLEMENTED(); |
| 152 | return true; |
| 153 | } |
| 154 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 155 | bool ValidateDisableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 156 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 157 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 158 | } |
| 159 | |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 160 | bool ValidateEnableClientState(Context *context, ClientVertexArrayType arrayType) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 161 | { |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 162 | return ValidateClientStateCommon(context, arrayType); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | bool ValidateFogf(Context *context, GLenum pname, GLfloat param) |
| 166 | { |
| 167 | UNIMPLEMENTED(); |
| 168 | return true; |
| 169 | } |
| 170 | |
| 171 | bool ValidateFogfv(Context *context, GLenum pname, const GLfloat *params) |
| 172 | { |
| 173 | UNIMPLEMENTED(); |
| 174 | return true; |
| 175 | } |
| 176 | |
| 177 | bool ValidateFogx(Context *context, GLenum pname, GLfixed param) |
| 178 | { |
| 179 | UNIMPLEMENTED(); |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | bool ValidateFogxv(Context *context, GLenum pname, const GLfixed *param) |
| 184 | { |
| 185 | UNIMPLEMENTED(); |
| 186 | return true; |
| 187 | } |
| 188 | |
| 189 | bool ValidateFrustumf(Context *context, |
| 190 | GLfloat l, |
| 191 | GLfloat r, |
| 192 | GLfloat b, |
| 193 | GLfloat t, |
| 194 | GLfloat n, |
| 195 | GLfloat f) |
| 196 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 197 | ANGLE_VALIDATE_IS_GLES1(context); |
| 198 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 199 | { |
| 200 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 201 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 202 | return true; |
| 203 | } |
| 204 | |
| 205 | bool ValidateFrustumx(Context *context, |
| 206 | GLfixed l, |
| 207 | GLfixed r, |
| 208 | GLfixed b, |
| 209 | GLfixed t, |
| 210 | GLfixed n, |
| 211 | GLfixed f) |
| 212 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 213 | ANGLE_VALIDATE_IS_GLES1(context); |
| 214 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 215 | { |
| 216 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 217 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 218 | return true; |
| 219 | } |
| 220 | |
| 221 | bool ValidateGetBufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 222 | { |
| 223 | UNIMPLEMENTED(); |
| 224 | return true; |
| 225 | } |
| 226 | |
| 227 | bool ValidateGetClipPlanef(Context *context, GLenum plane, GLfloat *equation) |
| 228 | { |
| 229 | UNIMPLEMENTED(); |
| 230 | return true; |
| 231 | } |
| 232 | |
| 233 | bool ValidateGetClipPlanex(Context *context, GLenum plane, GLfixed *equation) |
| 234 | { |
| 235 | UNIMPLEMENTED(); |
| 236 | return true; |
| 237 | } |
| 238 | |
| 239 | bool ValidateGetFixedv(Context *context, GLenum pname, GLfixed *params) |
| 240 | { |
| 241 | UNIMPLEMENTED(); |
| 242 | return true; |
| 243 | } |
| 244 | |
| 245 | bool ValidateGetLightfv(Context *context, GLenum light, GLenum pname, GLfloat *params) |
| 246 | { |
| 247 | UNIMPLEMENTED(); |
| 248 | return true; |
| 249 | } |
| 250 | |
| 251 | bool ValidateGetLightxv(Context *context, GLenum light, GLenum pname, GLfixed *params) |
| 252 | { |
| 253 | UNIMPLEMENTED(); |
| 254 | return true; |
| 255 | } |
| 256 | |
| 257 | bool ValidateGetMaterialfv(Context *context, GLenum face, GLenum pname, GLfloat *params) |
| 258 | { |
| 259 | UNIMPLEMENTED(); |
| 260 | return true; |
| 261 | } |
| 262 | |
| 263 | bool ValidateGetMaterialxv(Context *context, GLenum face, GLenum pname, GLfixed *params) |
| 264 | { |
| 265 | UNIMPLEMENTED(); |
| 266 | return true; |
| 267 | } |
| 268 | |
| 269 | bool ValidateGetPointerv(Context *context, GLenum pname, void **params) |
| 270 | { |
| 271 | UNIMPLEMENTED(); |
| 272 | return true; |
| 273 | } |
| 274 | |
| 275 | bool ValidateGetTexEnvfv(Context *context, GLenum target, GLenum pname, GLfloat *params) |
| 276 | { |
| 277 | UNIMPLEMENTED(); |
| 278 | return true; |
| 279 | } |
| 280 | |
| 281 | bool ValidateGetTexEnviv(Context *context, GLenum target, GLenum pname, GLint *params) |
| 282 | { |
| 283 | UNIMPLEMENTED(); |
| 284 | return true; |
| 285 | } |
| 286 | |
| 287 | bool ValidateGetTexEnvxv(Context *context, GLenum target, GLenum pname, GLfixed *params) |
| 288 | { |
| 289 | UNIMPLEMENTED(); |
| 290 | return true; |
| 291 | } |
| 292 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 293 | bool ValidateGetTexParameterxv(Context *context, TextureType target, GLenum pname, GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 294 | { |
| 295 | UNIMPLEMENTED(); |
| 296 | return true; |
| 297 | } |
| 298 | |
| 299 | bool ValidateLightModelf(Context *context, GLenum pname, GLfloat param) |
| 300 | { |
| 301 | UNIMPLEMENTED(); |
| 302 | return true; |
| 303 | } |
| 304 | |
| 305 | bool ValidateLightModelfv(Context *context, GLenum pname, const GLfloat *params) |
| 306 | { |
| 307 | UNIMPLEMENTED(); |
| 308 | return true; |
| 309 | } |
| 310 | |
| 311 | bool ValidateLightModelx(Context *context, GLenum pname, GLfixed param) |
| 312 | { |
| 313 | UNIMPLEMENTED(); |
| 314 | return true; |
| 315 | } |
| 316 | |
| 317 | bool ValidateLightModelxv(Context *context, GLenum pname, const GLfixed *param) |
| 318 | { |
| 319 | UNIMPLEMENTED(); |
| 320 | return true; |
| 321 | } |
| 322 | |
| 323 | bool ValidateLightf(Context *context, GLenum light, GLenum pname, GLfloat param) |
| 324 | { |
| 325 | UNIMPLEMENTED(); |
| 326 | return true; |
| 327 | } |
| 328 | |
| 329 | bool ValidateLightfv(Context *context, GLenum light, GLenum pname, const GLfloat *params) |
| 330 | { |
| 331 | UNIMPLEMENTED(); |
| 332 | return true; |
| 333 | } |
| 334 | |
| 335 | bool ValidateLightx(Context *context, GLenum light, GLenum pname, GLfixed param) |
| 336 | { |
| 337 | UNIMPLEMENTED(); |
| 338 | return true; |
| 339 | } |
| 340 | |
| 341 | bool ValidateLightxv(Context *context, GLenum light, GLenum pname, const GLfixed *params) |
| 342 | { |
| 343 | UNIMPLEMENTED(); |
| 344 | return true; |
| 345 | } |
| 346 | |
| 347 | bool ValidateLineWidthx(Context *context, GLfixed width) |
| 348 | { |
| 349 | UNIMPLEMENTED(); |
| 350 | return true; |
| 351 | } |
| 352 | |
| 353 | bool ValidateLoadIdentity(Context *context) |
| 354 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 355 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 356 | return true; |
| 357 | } |
| 358 | |
| 359 | bool ValidateLoadMatrixf(Context *context, const GLfloat *m) |
| 360 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 361 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 362 | return true; |
| 363 | } |
| 364 | |
| 365 | bool ValidateLoadMatrixx(Context *context, const GLfixed *m) |
| 366 | { |
Lingfeng Yang | 3a41af6 | 2018-04-09 07:28:56 -0700 | [diff] [blame] | 367 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 368 | return true; |
| 369 | } |
| 370 | |
| 371 | bool ValidateLogicOp(Context *context, GLenum opcode) |
| 372 | { |
| 373 | UNIMPLEMENTED(); |
| 374 | return true; |
| 375 | } |
| 376 | |
| 377 | bool ValidateMaterialf(Context *context, GLenum face, GLenum pname, GLfloat param) |
| 378 | { |
| 379 | UNIMPLEMENTED(); |
| 380 | return true; |
| 381 | } |
| 382 | |
| 383 | bool ValidateMaterialfv(Context *context, GLenum face, GLenum pname, const GLfloat *params) |
| 384 | { |
| 385 | UNIMPLEMENTED(); |
| 386 | return true; |
| 387 | } |
| 388 | |
| 389 | bool ValidateMaterialx(Context *context, GLenum face, GLenum pname, GLfixed param) |
| 390 | { |
| 391 | UNIMPLEMENTED(); |
| 392 | return true; |
| 393 | } |
| 394 | |
| 395 | bool ValidateMaterialxv(Context *context, GLenum face, GLenum pname, const GLfixed *param) |
| 396 | { |
| 397 | UNIMPLEMENTED(); |
| 398 | return true; |
| 399 | } |
| 400 | |
Lingfeng Yang | 00af463 | 2018-04-02 12:42:24 -0700 | [diff] [blame] | 401 | bool ValidateMatrixMode(Context *context, MatrixType mode) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 402 | { |
Lingfeng Yang | d2488ab | 2018-04-04 09:25:48 -0700 | [diff] [blame] | 403 | ANGLE_VALIDATE_IS_GLES1(context); |
| 404 | switch (mode) |
| 405 | { |
| 406 | case MatrixType::Projection: |
| 407 | case MatrixType::Modelview: |
| 408 | case MatrixType::Texture: |
| 409 | return true; |
| 410 | default: |
| 411 | ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode); |
| 412 | return false; |
| 413 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 414 | } |
| 415 | |
| 416 | bool ValidateMultMatrixf(Context *context, const GLfloat *m) |
| 417 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 418 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 419 | return true; |
| 420 | } |
| 421 | |
| 422 | bool ValidateMultMatrixx(Context *context, const GLfixed *m) |
| 423 | { |
Lingfeng Yang | 568fc39 | 2018-04-09 07:57:23 -0700 | [diff] [blame] | 424 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 425 | return true; |
| 426 | } |
| 427 | |
| 428 | bool ValidateMultiTexCoord4f(Context *context, |
| 429 | GLenum target, |
| 430 | GLfloat s, |
| 431 | GLfloat t, |
| 432 | GLfloat r, |
| 433 | GLfloat q) |
| 434 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 435 | ANGLE_VALIDATE_IS_GLES1(context); |
| 436 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 437 | } |
| 438 | |
| 439 | bool ValidateMultiTexCoord4x(Context *context, |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 440 | GLenum target, |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 441 | GLfixed s, |
| 442 | GLfixed t, |
| 443 | GLfixed r, |
| 444 | GLfixed q) |
| 445 | { |
Lingfeng Yang | 038dd53 | 2018-03-29 17:31:52 -0700 | [diff] [blame] | 446 | ANGLE_VALIDATE_IS_GLES1(context); |
| 447 | return ValidateMultitextureUnit(context, target); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | bool ValidateNormal3f(Context *context, GLfloat nx, GLfloat ny, GLfloat nz) |
| 451 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 452 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 453 | return true; |
| 454 | } |
| 455 | |
| 456 | bool ValidateNormal3x(Context *context, GLfixed nx, GLfixed ny, GLfixed nz) |
| 457 | { |
Lingfeng Yang | 5a7e61b | 2018-03-29 16:50:32 -0700 | [diff] [blame] | 458 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 459 | return true; |
| 460 | } |
| 461 | |
| 462 | bool ValidateNormalPointer(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 463 | { |
| 464 | UNIMPLEMENTED(); |
| 465 | return true; |
| 466 | } |
| 467 | |
| 468 | bool ValidateOrthof(Context *context, |
| 469 | GLfloat l, |
| 470 | GLfloat r, |
| 471 | GLfloat b, |
| 472 | GLfloat t, |
| 473 | GLfloat n, |
| 474 | GLfloat f) |
| 475 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 476 | ANGLE_VALIDATE_IS_GLES1(context); |
| 477 | if (l == r || b == t || n == f || n <= 0.0f || f <= 0.0f) |
| 478 | { |
| 479 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 480 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 481 | return true; |
| 482 | } |
| 483 | |
| 484 | bool ValidateOrthox(Context *context, |
| 485 | GLfixed l, |
| 486 | GLfixed r, |
| 487 | GLfixed b, |
| 488 | GLfixed t, |
| 489 | GLfixed n, |
| 490 | GLfixed f) |
| 491 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 492 | ANGLE_VALIDATE_IS_GLES1(context); |
| 493 | if (l == r || b == t || n == f || n <= 0 || f <= 0) |
| 494 | { |
| 495 | ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidProjectionMatrix); |
| 496 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 497 | return true; |
| 498 | } |
| 499 | |
| 500 | bool ValidatePointParameterf(Context *context, GLenum pname, GLfloat param) |
| 501 | { |
| 502 | UNIMPLEMENTED(); |
| 503 | return true; |
| 504 | } |
| 505 | |
| 506 | bool ValidatePointParameterfv(Context *context, GLenum pname, const GLfloat *params) |
| 507 | { |
| 508 | UNIMPLEMENTED(); |
| 509 | return true; |
| 510 | } |
| 511 | |
| 512 | bool ValidatePointParameterx(Context *context, GLenum pname, GLfixed param) |
| 513 | { |
| 514 | UNIMPLEMENTED(); |
| 515 | return true; |
| 516 | } |
| 517 | |
| 518 | bool ValidatePointParameterxv(Context *context, GLenum pname, const GLfixed *params) |
| 519 | { |
| 520 | UNIMPLEMENTED(); |
| 521 | return true; |
| 522 | } |
| 523 | |
| 524 | bool ValidatePointSize(Context *context, GLfloat size) |
| 525 | { |
| 526 | UNIMPLEMENTED(); |
| 527 | return true; |
| 528 | } |
| 529 | |
| 530 | bool ValidatePointSizex(Context *context, GLfixed size) |
| 531 | { |
| 532 | UNIMPLEMENTED(); |
| 533 | return true; |
| 534 | } |
| 535 | |
| 536 | bool ValidatePolygonOffsetx(Context *context, GLfixed factor, GLfixed units) |
| 537 | { |
| 538 | UNIMPLEMENTED(); |
| 539 | return true; |
| 540 | } |
| 541 | |
| 542 | bool ValidatePopMatrix(Context *context) |
| 543 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 544 | ANGLE_VALIDATE_IS_GLES1(context); |
| 545 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 546 | if (stack.size() == 1) |
| 547 | { |
| 548 | ANGLE_VALIDATION_ERR(context, StackUnderflow(), MatrixStackUnderflow); |
| 549 | return false; |
| 550 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 551 | return true; |
| 552 | } |
| 553 | |
| 554 | bool ValidatePushMatrix(Context *context) |
| 555 | { |
Lingfeng Yang | e547aac | 2018-04-05 09:39:20 -0700 | [diff] [blame] | 556 | ANGLE_VALIDATE_IS_GLES1(context); |
| 557 | const auto &stack = context->getGLState().gles1().currentMatrixStack(); |
| 558 | if (stack.size() == stack.max_size()) |
| 559 | { |
| 560 | ANGLE_VALIDATION_ERR(context, StackOverflow(), MatrixStackOverflow); |
| 561 | return false; |
| 562 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 563 | return true; |
| 564 | } |
| 565 | |
| 566 | bool ValidateRotatef(Context *context, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
| 567 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 568 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 569 | return true; |
| 570 | } |
| 571 | |
| 572 | bool ValidateRotatex(Context *context, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) |
| 573 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 574 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 575 | return true; |
| 576 | } |
| 577 | |
| 578 | bool ValidateSampleCoveragex(Context *context, GLclampx value, GLboolean invert) |
| 579 | { |
| 580 | UNIMPLEMENTED(); |
| 581 | return true; |
| 582 | } |
| 583 | |
| 584 | bool ValidateScalef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 585 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 586 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 587 | return true; |
| 588 | } |
| 589 | |
| 590 | bool ValidateScalex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 591 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 592 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 593 | return true; |
| 594 | } |
| 595 | |
| 596 | bool ValidateShadeModel(Context *context, GLenum mode) |
| 597 | { |
| 598 | UNIMPLEMENTED(); |
| 599 | return true; |
| 600 | } |
| 601 | |
| 602 | bool ValidateTexCoordPointer(Context *context, |
| 603 | GLint size, |
| 604 | GLenum type, |
| 605 | GLsizei stride, |
| 606 | const void *pointer) |
| 607 | { |
| 608 | UNIMPLEMENTED(); |
| 609 | return true; |
| 610 | } |
| 611 | |
| 612 | bool ValidateTexEnvf(Context *context, GLenum target, GLenum pname, GLfloat param) |
| 613 | { |
| 614 | UNIMPLEMENTED(); |
| 615 | return true; |
| 616 | } |
| 617 | |
| 618 | bool ValidateTexEnvfv(Context *context, GLenum target, GLenum pname, const GLfloat *params) |
| 619 | { |
| 620 | UNIMPLEMENTED(); |
| 621 | return true; |
| 622 | } |
| 623 | |
| 624 | bool ValidateTexEnvi(Context *context, GLenum target, GLenum pname, GLint param) |
| 625 | { |
| 626 | UNIMPLEMENTED(); |
| 627 | return true; |
| 628 | } |
| 629 | |
| 630 | bool ValidateTexEnviv(Context *context, GLenum target, GLenum pname, const GLint *params) |
| 631 | { |
| 632 | UNIMPLEMENTED(); |
| 633 | return true; |
| 634 | } |
| 635 | |
| 636 | bool ValidateTexEnvx(Context *context, GLenum target, GLenum pname, GLfixed param) |
| 637 | { |
| 638 | UNIMPLEMENTED(); |
| 639 | return true; |
| 640 | } |
| 641 | |
| 642 | bool ValidateTexEnvxv(Context *context, GLenum target, GLenum pname, const GLfixed *params) |
| 643 | { |
| 644 | UNIMPLEMENTED(); |
| 645 | return true; |
| 646 | } |
| 647 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 648 | bool ValidateTexParameterx(Context *context, TextureType target, GLenum pname, GLfixed param) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 649 | { |
| 650 | UNIMPLEMENTED(); |
| 651 | return true; |
| 652 | } |
| 653 | |
Corentin Wallez | f0e89be | 2017-11-08 14:00:32 -0800 | [diff] [blame] | 654 | bool ValidateTexParameterxv(Context *context, |
| 655 | TextureType target, |
| 656 | GLenum pname, |
| 657 | const GLfixed *params) |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 658 | { |
| 659 | UNIMPLEMENTED(); |
| 660 | return true; |
| 661 | } |
| 662 | |
| 663 | bool ValidateTranslatef(Context *context, GLfloat x, GLfloat y, GLfloat z) |
| 664 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 665 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 666 | return true; |
| 667 | } |
| 668 | |
| 669 | bool ValidateTranslatex(Context *context, GLfixed x, GLfixed y, GLfixed z) |
| 670 | { |
Lingfeng Yang | bb5ce5c | 2018-04-09 08:08:46 -0700 | [diff] [blame] | 671 | ANGLE_VALIDATE_IS_GLES1(context); |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 672 | return true; |
| 673 | } |
| 674 | |
| 675 | bool ValidateVertexPointer(Context *context, |
| 676 | GLint size, |
| 677 | GLenum type, |
| 678 | GLsizei stride, |
| 679 | const void *pointer) |
| 680 | { |
| 681 | UNIMPLEMENTED(); |
| 682 | return true; |
| 683 | } |
| 684 | |
| 685 | bool ValidateDrawTexfOES(Context *context, |
| 686 | GLfloat x, |
| 687 | GLfloat y, |
| 688 | GLfloat z, |
| 689 | GLfloat width, |
| 690 | GLfloat height) |
| 691 | { |
| 692 | UNIMPLEMENTED(); |
| 693 | return true; |
| 694 | } |
| 695 | |
| 696 | bool ValidateDrawTexfvOES(Context *context, const GLfloat *coords) |
| 697 | { |
| 698 | UNIMPLEMENTED(); |
| 699 | return true; |
| 700 | } |
| 701 | |
| 702 | bool ValidateDrawTexiOES(Context *context, GLint x, GLint y, GLint z, GLint width, GLint height) |
| 703 | { |
| 704 | UNIMPLEMENTED(); |
| 705 | return true; |
| 706 | } |
| 707 | |
| 708 | bool ValidateDrawTexivOES(Context *context, const GLint *coords) |
| 709 | { |
| 710 | UNIMPLEMENTED(); |
| 711 | return true; |
| 712 | } |
| 713 | |
| 714 | bool ValidateDrawTexsOES(Context *context, |
| 715 | GLshort x, |
| 716 | GLshort y, |
| 717 | GLshort z, |
| 718 | GLshort width, |
| 719 | GLshort height) |
| 720 | { |
| 721 | UNIMPLEMENTED(); |
| 722 | return true; |
| 723 | } |
| 724 | |
| 725 | bool ValidateDrawTexsvOES(Context *context, const GLshort *coords) |
| 726 | { |
| 727 | UNIMPLEMENTED(); |
| 728 | return true; |
| 729 | } |
| 730 | |
| 731 | bool ValidateDrawTexxOES(Context *context, |
| 732 | GLfixed x, |
| 733 | GLfixed y, |
| 734 | GLfixed z, |
| 735 | GLfixed width, |
| 736 | GLfixed height) |
| 737 | { |
| 738 | UNIMPLEMENTED(); |
| 739 | return true; |
| 740 | } |
| 741 | |
| 742 | bool ValidateDrawTexxvOES(Context *context, const GLfixed *coords) |
| 743 | { |
| 744 | UNIMPLEMENTED(); |
| 745 | return true; |
| 746 | } |
| 747 | |
| 748 | bool ValidateCurrentPaletteMatrixOES(Context *context, GLuint matrixpaletteindex) |
| 749 | { |
| 750 | UNIMPLEMENTED(); |
| 751 | return true; |
| 752 | } |
| 753 | |
| 754 | bool ValidateLoadPaletteFromModelViewMatrixOES(Context *context) |
| 755 | { |
| 756 | UNIMPLEMENTED(); |
| 757 | return true; |
| 758 | } |
| 759 | |
| 760 | bool ValidateMatrixIndexPointerOES(Context *context, |
| 761 | GLint size, |
| 762 | GLenum type, |
| 763 | GLsizei stride, |
| 764 | const void *pointer) |
| 765 | { |
| 766 | UNIMPLEMENTED(); |
| 767 | return true; |
| 768 | } |
| 769 | |
| 770 | bool ValidateWeightPointerOES(Context *context, |
| 771 | GLint size, |
| 772 | GLenum type, |
| 773 | GLsizei stride, |
| 774 | const void *pointer) |
| 775 | { |
| 776 | UNIMPLEMENTED(); |
| 777 | return true; |
| 778 | } |
| 779 | |
| 780 | bool ValidatePointSizePointerOES(Context *context, GLenum type, GLsizei stride, const void *pointer) |
| 781 | { |
| 782 | UNIMPLEMENTED(); |
| 783 | return true; |
| 784 | } |
| 785 | |
| 786 | bool ValidateQueryMatrixxOES(Context *context, GLfixed *mantissa, GLint *exponent) |
| 787 | { |
| 788 | UNIMPLEMENTED(); |
| 789 | return true; |
| 790 | } |
Lingfeng Yang | a064878 | 2018-03-12 14:45:25 -0700 | [diff] [blame] | 791 | |
| 792 | bool ValidateGenFramebuffersOES(Context *context, GLsizei n, GLuint *framebuffers) |
| 793 | { |
| 794 | UNIMPLEMENTED(); |
| 795 | return true; |
| 796 | } |
| 797 | |
| 798 | bool ValidateDeleteFramebuffersOES(Context *context, GLsizei n, const GLuint *framebuffers) |
| 799 | { |
| 800 | UNIMPLEMENTED(); |
| 801 | return true; |
| 802 | } |
| 803 | |
| 804 | bool ValidateGenRenderbuffersOES(Context *context, GLsizei n, GLuint *renderbuffers) |
| 805 | { |
| 806 | UNIMPLEMENTED(); |
| 807 | return true; |
| 808 | } |
| 809 | |
| 810 | bool ValidateDeleteRenderbuffersOES(Context *context, GLsizei n, const GLuint *renderbuffers) |
| 811 | { |
| 812 | UNIMPLEMENTED(); |
| 813 | return true; |
| 814 | } |
| 815 | |
| 816 | bool ValidateBindFramebufferOES(Context *context, GLenum target, GLuint framebuffer) |
| 817 | { |
| 818 | UNIMPLEMENTED(); |
| 819 | return true; |
| 820 | } |
| 821 | |
| 822 | bool ValidateBindRenderbufferOES(Context *context, GLenum target, GLuint renderbuffer) |
| 823 | { |
| 824 | UNIMPLEMENTED(); |
| 825 | return true; |
| 826 | } |
| 827 | |
| 828 | bool ValidateCheckFramebufferStatusOES(Context *context, GLenum target) |
| 829 | { |
| 830 | UNIMPLEMENTED(); |
| 831 | return true; |
| 832 | } |
| 833 | |
| 834 | bool ValidateFramebufferRenderbufferOES(Context *context, |
| 835 | GLenum target, |
| 836 | GLenum attachment, |
| 837 | GLenum rbtarget, |
| 838 | GLuint renderbuffer) |
| 839 | { |
| 840 | UNIMPLEMENTED(); |
| 841 | return true; |
| 842 | } |
| 843 | |
| 844 | bool ValidateFramebufferTexture2DOES(Context *context, |
| 845 | GLenum target, |
| 846 | GLenum attachment, |
| 847 | TextureTarget textarget, |
| 848 | GLuint texture, |
| 849 | GLint level) |
| 850 | { |
| 851 | UNIMPLEMENTED(); |
| 852 | return true; |
| 853 | } |
| 854 | |
| 855 | bool ValidateGenerateMipmapOES(Context *context, TextureType target) |
| 856 | { |
| 857 | UNIMPLEMENTED(); |
| 858 | return true; |
| 859 | } |
| 860 | |
| 861 | bool ValidateGetFramebufferAttachmentParameterivOES(Context *context, |
| 862 | GLenum target, |
| 863 | GLenum attachment, |
| 864 | GLenum pname, |
| 865 | GLint *params) |
| 866 | { |
| 867 | UNIMPLEMENTED(); |
| 868 | return true; |
| 869 | } |
| 870 | |
| 871 | bool ValidateGetRenderbufferParameterivOES(Context *context, |
| 872 | GLenum target, |
| 873 | GLenum pname, |
| 874 | GLint *params) |
| 875 | { |
| 876 | UNIMPLEMENTED(); |
| 877 | return true; |
| 878 | } |
| 879 | |
| 880 | bool ValidateIsFramebufferOES(Context *context, GLuint framebuffer) |
| 881 | { |
| 882 | UNIMPLEMENTED(); |
| 883 | return true; |
| 884 | } |
| 885 | |
| 886 | bool ValidateIsRenderbufferOES(Context *context, GLuint renderbuffer) |
| 887 | { |
| 888 | UNIMPLEMENTED(); |
| 889 | return true; |
| 890 | } |
| 891 | |
| 892 | bool ValidateRenderbufferStorageOES(Context *context, |
| 893 | GLenum target, |
| 894 | GLint internalformat, |
| 895 | GLsizei width, |
| 896 | GLsizei height) |
| 897 | { |
| 898 | UNIMPLEMENTED(); |
| 899 | return true; |
| 900 | } |
| 901 | |
| 902 | // GL_OES_texture_cube_map |
| 903 | |
| 904 | bool ValidateGetTexGenfvOES(Context *context, GLenum coord, GLenum pname, GLfloat *params) |
| 905 | { |
| 906 | UNIMPLEMENTED(); |
| 907 | return true; |
| 908 | } |
| 909 | |
| 910 | bool ValidateGetTexGenivOES(Context *context, GLenum coord, GLenum pname, int *params) |
| 911 | { |
| 912 | UNIMPLEMENTED(); |
| 913 | return true; |
| 914 | } |
| 915 | |
| 916 | bool ValidateGetTexGenxvOES(Context *context, GLenum coord, GLenum pname, GLfixed *params) |
| 917 | { |
| 918 | UNIMPLEMENTED(); |
| 919 | return true; |
| 920 | } |
| 921 | |
| 922 | bool ValidateTexGenfvOES(Context *context, GLenum coord, GLenum pname, const GLfloat *params) |
| 923 | { |
| 924 | UNIMPLEMENTED(); |
| 925 | return true; |
| 926 | } |
| 927 | |
| 928 | bool ValidateTexGenivOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 929 | { |
| 930 | UNIMPLEMENTED(); |
| 931 | return true; |
| 932 | } |
| 933 | |
| 934 | bool ValidateTexGenxvOES(Context *context, GLenum coord, GLenum pname, const GLint *param) |
| 935 | { |
| 936 | UNIMPLEMENTED(); |
| 937 | return true; |
| 938 | } |
| 939 | |
| 940 | bool ValidateTexGenfOES(Context *context, GLenum coord, GLenum pname, GLfloat param) |
| 941 | { |
| 942 | UNIMPLEMENTED(); |
| 943 | return true; |
| 944 | } |
| 945 | |
| 946 | bool ValidateTexGeniOES(Context *context, GLenum coord, GLenum pname, GLint param) |
| 947 | { |
| 948 | UNIMPLEMENTED(); |
| 949 | return true; |
| 950 | } |
| 951 | |
| 952 | bool ValidateTexGenxOES(Context *context, GLenum coord, GLenum pname, GLfixed param) |
| 953 | { |
| 954 | UNIMPLEMENTED(); |
| 955 | return true; |
| 956 | } |
Lingfeng Yang | 0107443 | 2018-04-16 10:19:51 -0700 | [diff] [blame^] | 957 | |
| 958 | } // namespace gl |