2019-03-28 10:35:46 +00:00
|
|
|
// Copyright 2019 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2019-03-28 10:35:46 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <d3d12.h>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "VideoCommon/AbstractPipeline.h"
|
|
|
|
|
|
|
|
namespace DX12
|
|
|
|
{
|
|
|
|
class DXPipeline final : public AbstractPipeline
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DXPipeline(ID3D12PipelineState* pipeline, ID3D12RootSignature* root_signature,
|
|
|
|
AbstractPipelineUsage usage, D3D12_PRIMITIVE_TOPOLOGY primitive_topology,
|
|
|
|
bool use_integer_rtv);
|
|
|
|
~DXPipeline() override;
|
|
|
|
|
2019-04-15 11:59:07 +00:00
|
|
|
static std::unique_ptr<DXPipeline> Create(const AbstractPipelineConfig& config,
|
|
|
|
const void* cache_data, size_t cache_data_size);
|
2019-03-28 10:35:46 +00:00
|
|
|
|
|
|
|
ID3D12PipelineState* GetPipeline() const { return m_pipeline; }
|
|
|
|
ID3D12RootSignature* GetRootSignature() const { return m_root_signature; }
|
|
|
|
AbstractPipelineUsage GetUsage() const { return m_usage; }
|
|
|
|
D3D12_PRIMITIVE_TOPOLOGY GetPrimitiveTopology() const { return m_primitive_topology; }
|
|
|
|
bool UseIntegerRTV() const { return m_use_integer_rtv; }
|
|
|
|
|
2019-04-15 11:59:07 +00:00
|
|
|
CacheData GetCacheData() const override;
|
|
|
|
|
2019-03-28 10:35:46 +00:00
|
|
|
private:
|
|
|
|
ID3D12PipelineState* m_pipeline;
|
|
|
|
ID3D12RootSignature* m_root_signature;
|
|
|
|
AbstractPipelineUsage m_usage;
|
|
|
|
D3D12_PRIMITIVE_TOPOLOGY m_primitive_topology;
|
|
|
|
bool m_use_integer_rtv;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DX12
|