Hash :
0a6e118d
Author :
Date :
2020-01-27T13:37:29
Change g_Mutex from std::mutex to std::recursive_mutex When running flatland on android-10.0.0_r21 (Pixel 3), libgui's ~EglImage calls eglTerminate which grabs angle's EGL entry point mutex. The path continues to libvulkan where eventually another egl call happens (eglDestroyImageKHR) and it will attempt to take the mutex at the entry point again. So we try to get the mutex multiple times from the same thread. Change this mutex to a recursive_mutex to allow for this re-entry of EGL calls Tests: android-10.0.0_r21/frameworks/native/cmds/flatland Bug: angleproject:4354 Change-Id: If8a817df45e9f58d5f06884510350e17d7127fa9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2029218 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
// GENERATED FILE - DO NOT EDIT.
// Generated by generate_entry_points.py using data from gl.xml.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// entry_points_gl_1_1_autogen.cpp:
// Defines the GL 1.1 entry points.
#include "libGL/entry_points_gl_1_1_autogen.h"
#include "libANGLE/Context.h"
#include "libANGLE/Context.inl.h"
#include "libANGLE/entry_points_utils.h"
#include "libANGLE/gl_enum_utils.h"
#include "libANGLE/validationEGL.h"
#include "libANGLE/validationES.h"
#include "libANGLE/validationES1.h"
#include "libANGLE/validationES2.h"
#include "libANGLE/validationES3.h"
#include "libANGLE/validationES31.h"
#include "libANGLE/validationES32.h"
#include "libANGLE/validationESEXT.h"
#include "libANGLE/validationGL11_autogen.h"
#include "libGLESv2/global_state.h"
namespace gl
{
GLboolean GL_APIENTRY AreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences)
{
Context *context = GetValidGlobalContext();
EVENT("glAreTexturesResident",
"context = %d, GLsizei n = %d, const GLuint *textures = 0x%016" PRIxPTR
", GLboolean *residences = 0x%016" PRIxPTR "",
CID(context), n, (uintptr_t)textures, (uintptr_t)residences);
GLboolean returnValue;
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateAreTexturesResident(context, n, textures, residences));
if (isCallValid)
{
returnValue = context->areTexturesResident(n, textures, residences);
}
else
{
returnValue = GetDefaultReturnValue<EntryPoint::AreTexturesResident, GLboolean>();
}
ANGLE_CAPTURE(AreTexturesResident, isCallValid, context, n, textures, residences,
returnValue);
}
else
{
returnValue = GetDefaultReturnValue<EntryPoint::AreTexturesResident, GLboolean>();
}
return returnValue;
}
void GL_APIENTRY ArrayElement(GLint i)
{
Context *context = GetValidGlobalContext();
EVENT("glArrayElement", "context = %d, GLint i = %d", CID(context), i);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || ValidateArrayElement(context, i));
if (isCallValid)
{
context->arrayElement(i);
}
ANGLE_CAPTURE(ArrayElement, isCallValid, context, i);
}
}
void GL_APIENTRY BindTexture(GLenum target, GLuint texture)
{
Context *context = GetValidGlobalContext();
EVENT("glBindTexture", "context = %d, GLenum target = %s, GLuint texture = %u", CID(context),
GLenumToString(GLenumGroup::TextureTarget, target), texture);
if (context)
{
TextureType targetPacked = FromGL<TextureType>(target);
TextureID texturePacked = FromGL<TextureID>(texture);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateBindTexture(context, targetPacked, texturePacked));
if (isCallValid)
{
context->bindTexture(targetPacked, texturePacked);
}
ANGLE_CAPTURE(BindTexture, isCallValid, context, targetPacked, texturePacked);
}
}
void GL_APIENTRY ColorPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT("glColorPointer",
"context = %d, GLint size = %d, GLenum type = %s, GLsizei stride = %d, const void "
"*pointer = 0x%016" PRIxPTR "",
CID(context), size, GLenumToString(GLenumGroup::ColorPointerType, type), stride,
(uintptr_t)pointer);
if (context)
{
VertexAttribType typePacked = FromGL<VertexAttribType>(type);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateColorPointer(context, size, typePacked, stride, pointer));
if (isCallValid)
{
context->colorPointer(size, typePacked, stride, pointer);
}
ANGLE_CAPTURE(ColorPointer, isCallValid, context, size, typePacked, stride, pointer);
}
}
void GL_APIENTRY CopyTexImage1D(GLenum target,
GLint level,
GLenum internalformat,
GLint x,
GLint y,
GLsizei width,
GLint border)
{
Context *context = GetValidGlobalContext();
EVENT("glCopyTexImage1D",
"context = %d, GLenum target = %s, GLint level = %d, GLenum internalformat = %s, GLint x "
"= %d, GLint y = %d, GLsizei width = %d, GLint border = %d",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
GLenumToString(GLenumGroup::InternalFormat, internalformat), x, y, width, border);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() ||
ValidateCopyTexImage1D(context, target, level, internalformat, x, y, width, border));
if (isCallValid)
{
context->copyTexImage1D(target, level, internalformat, x, y, width, border);
}
ANGLE_CAPTURE(CopyTexImage1D, isCallValid, context, target, level, internalformat, x, y,
width, border);
}
}
void GL_APIENTRY CopyTexImage2D(GLenum target,
GLint level,
GLenum internalformat,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLint border)
{
Context *context = GetValidGlobalContext();
EVENT("glCopyTexImage2D",
"context = %d, GLenum target = %s, GLint level = %d, GLenum internalformat = %s, GLint x "
"= %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, GLint border = %d",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level,
GLenumToString(GLenumGroup::InternalFormat, internalformat), x, y, width, height, border);
if (context)
{
TextureTarget targetPacked = FromGL<TextureTarget>(target);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateCopyTexImage2D(context, targetPacked, level, internalformat, x,
y, width, height, border));
if (isCallValid)
{
context->copyTexImage2D(targetPacked, level, internalformat, x, y, width, height,
border);
}
ANGLE_CAPTURE(CopyTexImage2D, isCallValid, context, targetPacked, level, internalformat, x,
y, width, height, border);
}
}
void GL_APIENTRY
CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
{
Context *context = GetValidGlobalContext();
EVENT("glCopyTexSubImage1D",
"context = %d, GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint x = %d, "
"GLint y = %d, GLsizei width = %d",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, x, y,
width);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() ||
ValidateCopyTexSubImage1D(context, target, level, xoffset, x, y, width));
if (isCallValid)
{
context->copyTexSubImage1D(target, level, xoffset, x, y, width);
}
ANGLE_CAPTURE(CopyTexSubImage1D, isCallValid, context, target, level, xoffset, x, y, width);
}
}
void GL_APIENTRY CopyTexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height)
{
Context *context = GetValidGlobalContext();
EVENT("glCopyTexSubImage2D",
"context = %d, GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint yoffset = "
"%d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
x, y, width, height);
if (context)
{
TextureTarget targetPacked = FromGL<TextureTarget>(target);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateCopyTexSubImage2D(context, targetPacked, level, xoffset,
yoffset, x, y, width, height));
if (isCallValid)
{
context->copyTexSubImage2D(targetPacked, level, xoffset, yoffset, x, y, width, height);
}
ANGLE_CAPTURE(CopyTexSubImage2D, isCallValid, context, targetPacked, level, xoffset,
yoffset, x, y, width, height);
}
}
void GL_APIENTRY DeleteTextures(GLsizei n, const GLuint *textures)
{
Context *context = GetValidGlobalContext();
EVENT("glDeleteTextures",
"context = %d, GLsizei n = %d, const GLuint *textures = 0x%016" PRIxPTR "", CID(context),
n, (uintptr_t)textures);
if (context)
{
const TextureID *texturesPacked = FromGL<const TextureID *>(textures);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateDeleteTextures(context, n, texturesPacked));
if (isCallValid)
{
context->deleteTextures(n, texturesPacked);
}
ANGLE_CAPTURE(DeleteTextures, isCallValid, context, n, texturesPacked);
}
}
void GL_APIENTRY DisableClientState(GLenum array)
{
Context *context = GetValidGlobalContext();
EVENT("glDisableClientState", "context = %d, GLenum array = %s", CID(context),
GLenumToString(GLenumGroup::EnableCap, array));
if (context)
{
ClientVertexArrayType arrayPacked = FromGL<ClientVertexArrayType>(array);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateDisableClientState(context, arrayPacked));
if (isCallValid)
{
context->disableClientState(arrayPacked);
}
ANGLE_CAPTURE(DisableClientState, isCallValid, context, arrayPacked);
}
}
void GL_APIENTRY DrawArrays(GLenum mode, GLint first, GLsizei count)
{
Context *context = GetValidGlobalContext();
EVENT("glDrawArrays", "context = %d, GLenum mode = %s, GLint first = %d, GLsizei count = %d",
CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), first, count);
if (context)
{
PrimitiveMode modePacked = FromGL<PrimitiveMode>(mode);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateDrawArrays(context, modePacked, first, count));
if (isCallValid)
{
context->drawArrays(modePacked, first, count);
}
ANGLE_CAPTURE(DrawArrays, isCallValid, context, modePacked, first, count);
}
}
void GL_APIENTRY DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
{
Context *context = GetValidGlobalContext();
EVENT("glDrawElements",
"context = %d, GLenum mode = %s, GLsizei count = %d, GLenum type = %s, const void "
"*indices = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), count,
GLenumToString(GLenumGroup::DrawElementsType, type), (uintptr_t)indices);
if (context)
{
PrimitiveMode modePacked = FromGL<PrimitiveMode>(mode);
DrawElementsType typePacked = FromGL<DrawElementsType>(type);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateDrawElements(context, modePacked, count, typePacked, indices));
if (isCallValid)
{
context->drawElements(modePacked, count, typePacked, indices);
}
ANGLE_CAPTURE(DrawElements, isCallValid, context, modePacked, count, typePacked, indices);
}
}
void GL_APIENTRY EdgeFlagPointer(GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT("glEdgeFlagPointer",
"context = %d, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR "",
CID(context), stride, (uintptr_t)pointer);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateEdgeFlagPointer(context, stride, pointer));
if (isCallValid)
{
context->edgeFlagPointer(stride, pointer);
}
ANGLE_CAPTURE(EdgeFlagPointer, isCallValid, context, stride, pointer);
}
}
void GL_APIENTRY EnableClientState(GLenum array)
{
Context *context = GetValidGlobalContext();
EVENT("glEnableClientState", "context = %d, GLenum array = %s", CID(context),
GLenumToString(GLenumGroup::EnableCap, array));
if (context)
{
ClientVertexArrayType arrayPacked = FromGL<ClientVertexArrayType>(array);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateEnableClientState(context, arrayPacked));
if (isCallValid)
{
context->enableClientState(arrayPacked);
}
ANGLE_CAPTURE(EnableClientState, isCallValid, context, arrayPacked);
}
}
void GL_APIENTRY GenTextures(GLsizei n, GLuint *textures)
{
Context *context = GetValidGlobalContext();
EVENT("glGenTextures", "context = %d, GLsizei n = %d, GLuint *textures = 0x%016" PRIxPTR "",
CID(context), n, (uintptr_t)textures);
if (context)
{
TextureID *texturesPacked = FromGL<TextureID *>(textures);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateGenTextures(context, n, texturesPacked));
if (isCallValid)
{
context->genTextures(n, texturesPacked);
}
ANGLE_CAPTURE(GenTextures, isCallValid, context, n, texturesPacked);
}
}
void GL_APIENTRY GetPointerv(GLenum pname, void **params)
{
Context *context = GetValidGlobalContext();
EVENT("glGetPointerv", "context = %d, GLenum pname = %s, void **params = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::GetPointervPName, pname), (uintptr_t)params);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateGetPointerv(context, pname, params));
if (isCallValid)
{
context->getPointerv(pname, params);
}
ANGLE_CAPTURE(GetPointerv, isCallValid, context, pname, params);
}
}
void GL_APIENTRY IndexPointer(GLenum type, GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT(
"glIndexPointer",
"context = %d, GLenum type = %s, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR
"",
CID(context), GLenumToString(GLenumGroup::IndexPointerType, type), stride,
(uintptr_t)pointer);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidateIndexPointer(context, type, stride, pointer));
if (isCallValid)
{
context->indexPointer(type, stride, pointer);
}
ANGLE_CAPTURE(IndexPointer, isCallValid, context, type, stride, pointer);
}
}
void GL_APIENTRY Indexub(GLubyte c)
{
Context *context = GetValidGlobalContext();
EVENT("glIndexub", "context = %d, GLubyte c = %d", CID(context), c);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || ValidateIndexub(context, c));
if (isCallValid)
{
context->indexub(c);
}
ANGLE_CAPTURE(Indexub, isCallValid, context, c);
}
}
void GL_APIENTRY Indexubv(const GLubyte *c)
{
Context *context = GetValidGlobalContext();
EVENT("glIndexubv", "context = %d, const GLubyte *c = 0x%016" PRIxPTR "", CID(context),
(uintptr_t)c);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || ValidateIndexubv(context, c));
if (isCallValid)
{
context->indexubv(c);
}
ANGLE_CAPTURE(Indexubv, isCallValid, context, c);
}
}
void GL_APIENTRY InterleavedArrays(GLenum format, GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT("glInterleavedArrays",
"context = %d, GLenum format = %s, GLsizei stride = %d, const void *pointer = "
"0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::InterleavedArrayFormat, format), stride,
(uintptr_t)pointer);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateInterleavedArrays(context, format, stride, pointer));
if (isCallValid)
{
context->interleavedArrays(format, stride, pointer);
}
ANGLE_CAPTURE(InterleavedArrays, isCallValid, context, format, stride, pointer);
}
}
GLboolean GL_APIENTRY IsTexture(GLuint texture)
{
Context *context = GetValidGlobalContext();
EVENT("glIsTexture", "context = %d, GLuint texture = %u", CID(context), texture);
GLboolean returnValue;
if (context)
{
TextureID texturePacked = FromGL<TextureID>(texture);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || ValidateIsTexture(context, texturePacked));
if (isCallValid)
{
returnValue = context->isTexture(texturePacked);
}
else
{
returnValue = GetDefaultReturnValue<EntryPoint::IsTexture, GLboolean>();
}
ANGLE_CAPTURE(IsTexture, isCallValid, context, texturePacked, returnValue);
}
else
{
returnValue = GetDefaultReturnValue<EntryPoint::IsTexture, GLboolean>();
}
return returnValue;
}
void GL_APIENTRY NormalPointer(GLenum type, GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT(
"glNormalPointer",
"context = %d, GLenum type = %s, GLsizei stride = %d, const void *pointer = 0x%016" PRIxPTR
"",
CID(context), GLenumToString(GLenumGroup::NormalPointerType, type), stride,
(uintptr_t)pointer);
if (context)
{
VertexAttribType typePacked = FromGL<VertexAttribType>(type);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateNormalPointer(context, typePacked, stride, pointer));
if (isCallValid)
{
context->normalPointer(typePacked, stride, pointer);
}
ANGLE_CAPTURE(NormalPointer, isCallValid, context, typePacked, stride, pointer);
}
}
void GL_APIENTRY PolygonOffset(GLfloat factor, GLfloat units)
{
Context *context = GetValidGlobalContext();
EVENT("glPolygonOffset", "context = %d, GLfloat factor = %f, GLfloat units = %f", CID(context),
factor, units);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() || ValidatePolygonOffset(context, factor, units));
if (isCallValid)
{
context->polygonOffset(factor, units);
}
ANGLE_CAPTURE(PolygonOffset, isCallValid, context, factor, units);
}
}
void GL_APIENTRY PopClientAttrib()
{
Context *context = GetValidGlobalContext();
EVENT("glPopClientAttrib", "context = %d", CID(context));
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || ValidatePopClientAttrib(context));
if (isCallValid)
{
context->popClientAttrib();
}
ANGLE_CAPTURE(PopClientAttrib, isCallValid, context);
}
}
void GL_APIENTRY PrioritizeTextures(GLsizei n, const GLuint *textures, const GLfloat *priorities)
{
Context *context = GetValidGlobalContext();
EVENT("glPrioritizeTextures",
"context = %d, GLsizei n = %d, const GLuint *textures = 0x%016" PRIxPTR
", const GLfloat *priorities = 0x%016" PRIxPTR "",
CID(context), n, (uintptr_t)textures, (uintptr_t)priorities);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidatePrioritizeTextures(context, n, textures, priorities));
if (isCallValid)
{
context->prioritizeTextures(n, textures, priorities);
}
ANGLE_CAPTURE(PrioritizeTextures, isCallValid, context, n, textures, priorities);
}
}
void GL_APIENTRY PushClientAttrib(GLbitfield mask)
{
Context *context = GetValidGlobalContext();
EVENT("glPushClientAttrib", "context = %d, GLbitfield mask = %s", CID(context),
GLbitfieldToString(GLenumGroup::ClientAttribMask, mask).c_str());
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() || ValidatePushClientAttrib(context, mask));
if (isCallValid)
{
context->pushClientAttrib(mask);
}
ANGLE_CAPTURE(PushClientAttrib, isCallValid, context, mask);
}
}
void GL_APIENTRY TexCoordPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT("glTexCoordPointer",
"context = %d, GLint size = %d, GLenum type = %s, GLsizei stride = %d, const void "
"*pointer = 0x%016" PRIxPTR "",
CID(context), size, GLenumToString(GLenumGroup::TexCoordPointerType, type), stride,
(uintptr_t)pointer);
if (context)
{
VertexAttribType typePacked = FromGL<VertexAttribType>(type);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateTexCoordPointer(context, size, typePacked, stride, pointer));
if (isCallValid)
{
context->texCoordPointer(size, typePacked, stride, pointer);
}
ANGLE_CAPTURE(TexCoordPointer, isCallValid, context, size, typePacked, stride, pointer);
}
}
void GL_APIENTRY TexSubImage1D(GLenum target,
GLint level,
GLint xoffset,
GLsizei width,
GLenum format,
GLenum type,
const void *pixels)
{
Context *context = GetValidGlobalContext();
EVENT("glTexSubImage1D",
"context = %d, GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLsizei width = "
"%d, GLenum format = %s, GLenum type = %s, const void *pixels = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, width,
GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
if (context)
{
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid =
(context->skipValidation() ||
ValidateTexSubImage1D(context, target, level, xoffset, width, format, type, pixels));
if (isCallValid)
{
context->texSubImage1D(target, level, xoffset, width, format, type, pixels);
}
ANGLE_CAPTURE(TexSubImage1D, isCallValid, context, target, level, xoffset, width, format,
type, pixels);
}
}
void GL_APIENTRY TexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
const void *pixels)
{
Context *context = GetValidGlobalContext();
EVENT("glTexSubImage2D",
"context = %d, GLenum target = %s, GLint level = %d, GLint xoffset = %d, GLint yoffset = "
"%d, GLsizei width = %d, GLsizei height = %d, GLenum format = %s, GLenum type = %s, "
"const void *pixels = 0x%016" PRIxPTR "",
CID(context), GLenumToString(GLenumGroup::TextureTarget, target), level, xoffset, yoffset,
width, height, GLenumToString(GLenumGroup::PixelFormat, format),
GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)pixels);
if (context)
{
TextureTarget targetPacked = FromGL<TextureTarget>(target);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateTexSubImage2D(context, targetPacked, level, xoffset, yoffset,
width, height, format, type, pixels));
if (isCallValid)
{
context->texSubImage2D(targetPacked, level, xoffset, yoffset, width, height, format,
type, pixels);
}
ANGLE_CAPTURE(TexSubImage2D, isCallValid, context, targetPacked, level, xoffset, yoffset,
width, height, format, type, pixels);
}
}
void GL_APIENTRY VertexPointer(GLint size, GLenum type, GLsizei stride, const void *pointer)
{
Context *context = GetValidGlobalContext();
EVENT("glVertexPointer",
"context = %d, GLint size = %d, GLenum type = %s, GLsizei stride = %d, const void "
"*pointer = 0x%016" PRIxPTR "",
CID(context), size, GLenumToString(GLenumGroup::VertexPointerType, type), stride,
(uintptr_t)pointer);
if (context)
{
VertexAttribType typePacked = FromGL<VertexAttribType>(type);
std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
bool isCallValid = (context->skipValidation() ||
ValidateVertexPointer(context, size, typePacked, stride, pointer));
if (isCallValid)
{
context->vertexPointer(size, typePacked, stride, pointer);
}
ANGLE_CAPTURE(VertexPointer, isCallValid, context, size, typePacked, stride, pointer);
}
}
} // namespace gl