Hash :
68bfa1ed
Author :
Date :
2023-08-22T22:02:15
Support for link to be entirely parallelized
The link job is split as such:
- Front-end link
- Back-end link
- Independent back-end link subtasks (typically native driver compile
jobs)
- Post-link finalization
Each step depends on the previous. These steps are executed as such:
1. Program::link calls into ProgramImpl::link
- ProgramImpl::link runs whatever needs the Context, such as releasing
resources
- ProgramImpl::link returns a LinkTask
2. Program::link implements a closure that calls the front-end link and
passes the results to the backend's LinkTask.
3. The LinkTask potentially returns a set of LinkSubTasks to be
scheduled by the worker pool
4. Once the link is resolved, the post-link finalization is run
In the above, steps 1 and 4 are done under the share group lock. Steps
2 and 3 can be done in threads or without holding the share group lock
if the backend supports it. Step 2 is not yet made independent of the
Context on some backends, and a frontend feature is used to make that
step either run on the main thread or as a worker thread.
Bug: angleproject:8297
Change-Id: I12f1e6bbaf365543dfcac969e166e0b5aa622104
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4808191
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
//
// Copyright 2022 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.
//
// ProgramImpl.cpp: Implements the class methods for ProgramImpl.
#include "libANGLE/renderer/ProgramImpl.h"
namespace rx
{
std::vector<std::shared_ptr<LinkSubTask>> LinkTask::link(
const gl::ProgramLinkedResources &resources,
const gl::ProgramMergedVaryings &mergedVaryings)
{
UNREACHABLE();
return {};
}
std::vector<std::shared_ptr<LinkSubTask>> LinkTask::load()
{
UNREACHABLE();
return {};
}
bool LinkTask::isLinkingInternally()
{
return false;
}
angle::Result ProgramImpl::onLabelUpdate(const gl::Context *context)
{
return angle::Result::Continue;
}
} // namespace rx