2017-09-08 03:42:56 -06:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <d3d11.h>
|
|
|
|
#include <memory>
|
|
|
|
#include "VideoCommon/AbstractPipeline.h"
|
|
|
|
|
|
|
|
namespace DX11
|
|
|
|
{
|
|
|
|
class DXPipeline final : public AbstractPipeline
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DXPipeline(ID3D11InputLayout* input_layout, ID3D11VertexShader* vertex_shader,
|
|
|
|
ID3D11GeometryShader* geometry_shader, ID3D11PixelShader* pixel_shader,
|
|
|
|
ID3D11RasterizerState* rasterizer_state, ID3D11DepthStencilState* depth_state,
|
2019-02-14 18:59:50 -07:00
|
|
|
ID3D11BlendState* blend_state, D3D11_PRIMITIVE_TOPOLOGY primitive_topology,
|
|
|
|
bool use_logic_op);
|
2017-09-08 03:42:56 -06:00
|
|
|
~DXPipeline() override;
|
|
|
|
|
2019-03-09 06:31:37 -07: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 03:42:56 -06:00
|
|
|
D3D11_PRIMITIVE_TOPOLOGY GetPrimitiveTopology() const { return m_primitive_topology; }
|
|
|
|
bool HasGeometryShader() const { return m_geometry_shader != nullptr; }
|
2019-02-14 18:59:50 -07:00
|
|
|
bool UseLogicOp() const { return m_use_logic_op; }
|
|
|
|
|
2017-09-08 03:42:56 -06:00
|
|
|
static std::unique_ptr<DXPipeline> Create(const AbstractPipelineConfig& config);
|
|
|
|
|
|
|
|
private:
|
2019-03-09 06:31:37 -07: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 03:42:56 -06:00
|
|
|
D3D11_PRIMITIVE_TOPOLOGY m_primitive_topology;
|
2019-02-14 18:59:50 -07:00
|
|
|
bool m_use_logic_op;
|
2017-09-08 03:42:56 -06:00
|
|
|
};
|
|
|
|
} // namespace DX11
|