2017-09-08 09:42:56 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-09-08 09:42:56 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <d3d11.h>
|
|
|
|
#include <memory>
|
2021-12-10 02:22:16 +00:00
|
|
|
|
|
|
|
#include "VideoBackends/D3D/D3DBase.h"
|
2017-09-08 09:42:56 +00:00
|
|
|
#include "VideoCommon/AbstractPipeline.h"
|
|
|
|
|
|
|
|
namespace DX11
|
|
|
|
{
|
|
|
|
class DXPipeline final : public AbstractPipeline
|
|
|
|
{
|
|
|
|
public:
|
2023-01-28 00:28:52 +00:00
|
|
|
DXPipeline(const AbstractPipelineConfig& config, ID3D11InputLayout* input_layout,
|
|
|
|
ID3D11VertexShader* vertex_shader, ID3D11GeometryShader* geometry_shader,
|
|
|
|
ID3D11PixelShader* pixel_shader, ID3D11RasterizerState* rasterizer_state,
|
|
|
|
ID3D11DepthStencilState* depth_state, ID3D11BlendState* blend_state,
|
|
|
|
D3D11_PRIMITIVE_TOPOLOGY primitive_topology, bool use_logic_op);
|
2017-09-08 09:42:56 +00:00
|
|
|
~DXPipeline() override;
|
|
|
|
|
2019-03-09 13:31:37 +00:00
|
|
|
ID3D11InputLayout* GetInputLayout() const { return m_input_layout.Get(); }
|
|
|
|
ID3D11VertexShader* GetVertexShader() const { return m_vertex_shader.Get(); }
|
|
|
|
ID3D11GeometryShader* GetGeometryShader() const { return m_geometry_shader.Get(); }
|
|
|
|
ID3D11PixelShader* GetPixelShader() const { return m_pixel_shader.Get(); }
|
|
|
|
ID3D11RasterizerState* GetRasterizerState() const { return m_rasterizer_state.Get(); }
|
|
|
|
ID3D11DepthStencilState* GetDepthState() const { return m_depth_state.Get(); }
|
|
|
|
ID3D11BlendState* GetBlendState() const { return m_blend_state.Get(); }
|
2017-09-08 09:42:56 +00:00
|
|
|
D3D11_PRIMITIVE_TOPOLOGY GetPrimitiveTopology() const { return m_primitive_topology; }
|
|
|
|
bool HasGeometryShader() const { return m_geometry_shader != nullptr; }
|
2019-02-15 01:59:50 +00:00
|
|
|
bool UseLogicOp() const { return m_use_logic_op; }
|
|
|
|
|
2017-09-08 09:42:56 +00:00
|
|
|
static std::unique_ptr<DXPipeline> Create(const AbstractPipelineConfig& config);
|
|
|
|
|
|
|
|
private:
|
2019-03-09 13:31:37 +00:00
|
|
|
ComPtr<ID3D11InputLayout> m_input_layout;
|
|
|
|
ComPtr<ID3D11VertexShader> m_vertex_shader;
|
|
|
|
ComPtr<ID3D11GeometryShader> m_geometry_shader;
|
|
|
|
ComPtr<ID3D11PixelShader> m_pixel_shader;
|
|
|
|
ComPtr<ID3D11RasterizerState> m_rasterizer_state;
|
|
|
|
ComPtr<ID3D11DepthStencilState> m_depth_state;
|
|
|
|
ComPtr<ID3D11BlendState> m_blend_state;
|
2017-09-08 09:42:56 +00:00
|
|
|
D3D11_PRIMITIVE_TOPOLOGY m_primitive_topology;
|
2019-02-15 01:59:50 +00:00
|
|
|
bool m_use_logic_op;
|
2017-09-08 09:42:56 +00:00
|
|
|
};
|
|
|
|
} // namespace DX11
|