///////////////////////////////////////////////////////
| 503 | |
| 504 | //////////////////////////////////////////////////////////// |
| 505 | void GlContext::acquireTransientContext() |
| 506 | { |
| 507 | auto& currentContext = GlContextImpl::CurrentContext::get(); |
| 508 | |
| 509 | // Fast path if we already have a context active on this thread |
| 510 | if (currentContext.id) |
| 511 | { |
| 512 | ++currentContext.transientCount; |
| 513 | return; |
| 514 | } |
| 515 | |
| 516 | // If we don't already have a context active on this thread the count should be 0 |
| 517 | assert(!currentContext.transientCount && "Transient count cannot be non-zero"); |
| 518 | |
| 519 | // If currentContextId is not set, this must be the first |
| 520 | // TransientContextLock on this thread, construct the state object |
| 521 | TransientContext::get().emplace(); |
| 522 | |
| 523 | // Make sure a context is active at this point |
| 524 | assert(currentContext.id && "Current context ID cannot be zero"); |
| 525 | } |
| 526 | |
| 527 | |
| 528 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no outgoing calls
no test coverage detected