| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <d3d11_4.h> |
| 7 |
#include <memory> |
| 8 |
|
| 9 |
#include "VideoBackends/D3D/D3DBase.h" |
| 10 |
#include "VideoCommon/AbstractPipeline.h" |
| 11 |
|
| 12 |
namespace DX11 |
| 13 |
{ |
| 14 |
class DXPipeline final : public AbstractPipeline |
| 15 |
{ |
| 16 |
public: |
| 17 |
DXPipeline(const AbstractPipelineConfig& config, ID3D11InputLayout* input_layout, |
| 18 |
ID3D11VertexShader* vertex_shader, ID3D11GeometryShader* geometry_shader, |
| 19 |
ID3D11PixelShader* pixel_shader, ID3D11RasterizerState* rasterizer_state, |
| 20 |
ID3D11DepthStencilState* depth_state, ID3D11BlendState* blend_state, |
| 21 |
D3D11_PRIMITIVE_TOPOLOGY primitive_topology, bool use_logic_op); |
| 22 |
~DXPipeline() override; |
| 23 |
|
| 24 |
ID3D11InputLayout* GetInputLayout() const { return m_input_layout.Get(); } |
| 25 |
ID3D11VertexShader* GetVertexShader() const { return m_vertex_shader.Get(); } |
| 26 |
ID3D11GeometryShader* GetGeometryShader() const { return m_geometry_shader.Get(); } |
| 27 |
ID3D11PixelShader* GetPixelShader() const { return m_pixel_shader.Get(); } |
| 28 |
ID3D11RasterizerState* GetRasterizerState() const { return m_rasterizer_state.Get(); } |
| 29 |
ID3D11DepthStencilState* GetDepthState() const { return m_depth_state.Get(); } |
| 30 |
ID3D11BlendState* GetBlendState() const { return m_blend_state.Get(); } |
| 31 |
D3D11_PRIMITIVE_TOPOLOGY GetPrimitiveTopology() const { return m_primitive_topology; } |
| 32 |
bool HasGeometryShader() const { return m_geometry_shader != nullptr; } |
| 33 |
bool UseLogicOp() const { return m_use_logic_op; } |
| 34 |
|
| 35 |
static std::unique_ptr<DXPipeline> Create(const AbstractPipelineConfig& config); |
| 36 |
|
| 37 |
private: |
| 38 |
ComPtr<ID3D11InputLayout> m_input_layout; |
| 39 |
ComPtr<ID3D11VertexShader> m_vertex_shader; |
| 40 |
ComPtr<ID3D11GeometryShader> m_geometry_shader; |
| 41 |
ComPtr<ID3D11PixelShader> m_pixel_shader; |
| 42 |
ComPtr<ID3D11RasterizerState> m_rasterizer_state; |
| 43 |
ComPtr<ID3D11DepthStencilState> m_depth_state; |
| 44 |
ComPtr<ID3D11BlendState> m_blend_state; |
| 45 |
D3D11_PRIMITIVE_TOPOLOGY m_primitive_topology; |
| 46 |
bool m_use_logic_op; |
| 47 |
}; |
| 48 |
} |