Project import generated by Copybara.
GitOrigin-RevId: bb059a0721c92e8154d33ce8057b3915a25b3d7d
This commit is contained in:
@@ -161,15 +161,18 @@ void GlTextureBuffer::Reuse() {
|
||||
// sync fences; with a single-threaded executor, that means switching to
|
||||
// each of those contexts, grabbing its mutex. Let's do that after releasing
|
||||
// our own mutex.
|
||||
// Likewise, if we don't have sync fences and are simulating them, WaitOnGpu
|
||||
// will also require invoking the consumer context, so we should not call it
|
||||
// while holding the mutex.
|
||||
std::unique_ptr<GlMultiSyncPoint> old_consumer_sync;
|
||||
{
|
||||
absl::MutexLock lock(&consumer_sync_mutex_);
|
||||
consumer_multi_sync_->WaitOnGpu();
|
||||
// Reset the sync points.
|
||||
old_consumer_sync = std::move(consumer_multi_sync_);
|
||||
consumer_multi_sync_ = absl::make_unique<GlMultiSyncPoint>();
|
||||
producer_sync_ = nullptr;
|
||||
}
|
||||
old_consumer_sync->WaitOnGpu();
|
||||
}
|
||||
|
||||
void GlTextureBuffer::Updated(std::shared_ptr<GlSyncPoint> prod_token) {
|
||||
|
||||
Reference in New Issue
Block a user