chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h

//
// Copyright 2014 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.h: Defines the abstract rx::ProgramImpl class.

#ifndef LIBANGLE_RENDERER_PROGRAMIMPL_H_
#define LIBANGLE_RENDERER_PROGRAMIMPL_H_

#include "common/BinaryStream.h"
#include "common/WorkerThread.h"
#include "common/angleutils.h"
#include "libANGLE/Constants.h"
#include "libANGLE/Program.h"
#include "libANGLE/Shader.h"

#include <functional>
#include <map>

namespace gl
{
class Context;
struct ProgramLinkedResources;
}  // namespace gl

namespace sh
{
struct BlockMemberInfo;
}

namespace rx
{
// 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.
class LinkSubTask : public angle::Closure
{};
class LinkTask
{};

class ProgramImpl : angle::NonCopyable
{};

}  // namespace rx

#endif  // LIBANGLE_RENDERER_PROGRAMIMPL_H_