chromium/third_party/angle/src/libANGLE/renderer/vulkan/CommandProcessor.h

//
// 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.
//
// CommandProcessor.h:
//    A class to process and submit Vulkan command buffers that can be
//    used in an asynchronous worker thread.
//

#ifndef LIBANGLE_RENDERER_VULKAN_COMMAND_PROCESSOR_H_
#define LIBANGLE_RENDERER_VULKAN_COMMAND_PROCESSOR_H_

#include <condition_variable>
#include <mutex>
#include <queue>
#include <thread>

#include "common/FixedQueue.h"
#include "common/SimpleMutex.h"
#include "common/vulkan/vk_headers.h"
#include "libANGLE/renderer/vulkan/PersistentCommandPool.h"
#include "libANGLE/renderer/vulkan/vk_helpers.h"

namespace rx
{
class CommandProcessor;

namespace vk
{
class ExternalFence;
SharedExternalFence;

constexpr size_t kMaxCommandProcessorTasksLimit =;
constexpr size_t kInFlightCommandsLimit         =;
constexpr size_t kMaxFinishedCommandsLimit      =;

enum class SubmitPolicy
{};

struct Error
{};

class FenceRecycler;
// This is a RAII class manages refcounted vkfence object with auto-release and recycling.
class SharedFence final
{};

class FenceRecycler
{};

struct SwapchainStatus
{};

enum class CustomTask
{};

// CommandProcessorTask interface
class CommandProcessorTask
{};
CommandProcessorTaskQueue;

struct CommandBatch final : angle::NonCopyable
{};
CommandBatchQueue;

class DeviceQueueMap;

class QueueFamily final : angle::NonCopyable
{};

class DeviceQueueMap final
{};

// Note all public APIs of CommandQueue class must be thread safe.
class CommandQueue : angle::NonCopyable
{};

// CommandProcessor is used to dispatch work to the GPU when the asyncCommandQueue feature is
// enabled. Issuing the |destroy| command will cause the worker thread to clean up it's resources
// and shut down. This command is sent when the renderer instance shuts down. Tasks are defined by
// the CommandQueue interface.

class CommandProcessor : public Context
{};
}  // namespace vk

}  // namespace rx

#endif  // LIBANGLE_RENDERER_VULKAN_COMMAND_PROCESSOR_H_