Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Protected Attributes | List of all members
blowbox::GraphicsPSO Class Reference

#include <pipeline_state.h>

Public Member Functions

 GraphicsPSO ()
 
 ~GraphicsPSO ()
 
void SetBlendState (const D3D12_BLEND_DESC &blend_desc)
 
void SetRasterizerState (const D3D12_RASTERIZER_DESC &rasterizer_desc)
 
void SetDepthStencilState (const D3D12_DEPTH_STENCIL_DESC &depth_stencil_desc)
 
void SetSampleMask (UINT sample_mask)
 
void SetPrimitiveTopologyType (D3D12_PRIMITIVE_TOPOLOGY_TYPE topology_type)
 
void SetRenderTargetFormat (DXGI_FORMAT rtv_format, DXGI_FORMAT dsv_format, UINT msaa_count=1, UINT msaa_quality=0)
 
void SetRenderTargetFormats (UINT num_rtvs, const DXGI_FORMAT *rtv_formats, DXGI_FORMAT dsv_format, UINT msaa_count=1, UINT msaa_quality=0)
 
void SetInputLayout (UINT num_elements, const D3D12_INPUT_ELEMENT_DESC *input_element_descs)
 
void SetPrimitiveRestart (D3D12_INDEX_BUFFER_STRIP_CUT_VALUE ib_props)
 
void SetVertexShader (const D3D12_SHADER_BYTECODE &binary)
 
void SetPixelShader (const D3D12_SHADER_BYTECODE &binary)
 
void SetGeometryShader (const D3D12_SHADER_BYTECODE &binary)
 
void SetHullShader (const D3D12_SHADER_BYTECODE &binary)
 
void SetDomainShader (const D3D12_SHADER_BYTECODE &binary)
 
void Finalize () override
 
- Public Member Functions inherited from blowbox::PSO
 PSO ()
 
void SetRootSignature (RootSignature &root_signature)
 
RootSignatureGetRootSignature ()
 
ID3D12PipelineState * operator-> ()
 
void Destroy ()
 
ID3D12PipelineState * GetPSO () const
 

Protected Attributes

D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc_
 
D3D12_INPUT_ELEMENT_DESC input_element_descs_ [16]
 
- Protected Attributes inherited from blowbox::PSO
ID3D12PipelineState * pso_
 
RootSignatureroot_signature_
 

Detailed Description

Wraps the PipelineStateObject for graphics pipelines.

This class inherits from the base PSO and is supposed to help make it simple to create PSO's for graphics pipelines. From the moment of initialisation by the constructor, you should call all the different Setters on this class to configure the PSO properly. Once you have done that, call GraphicsPSO::Finalize() and you are ready to use this PSO in your code.

Inheritance diagram for blowbox::GraphicsPSO:
blowbox::PSO

Constructor & Destructor Documentation

blowbox::GraphicsPSO::GraphicsPSO ( )

Constructs the GraphicsPSO.

blowbox::GraphicsPSO::~GraphicsPSO ( )

Destructs the GraphicsPSO.

Member Function Documentation

void blowbox::GraphicsPSO::Finalize ( )
overridevirtual

Finalizes the PSO by actually creating it.

Implements blowbox::PSO.

void blowbox::GraphicsPSO::SetBlendState ( const D3D12_BLEND_DESC &  blend_desc)

Sets the blend state for this PSO.

Parameters
[in]blend_descThe blend state description.
void blowbox::GraphicsPSO::SetDepthStencilState ( const D3D12_DEPTH_STENCIL_DESC &  depth_stencil_desc)

Sets the depth stencil state for this PSO.

Parameters
[in]depth_stencil_descThe depth stencil state description.
void blowbox::GraphicsPSO::SetDomainShader ( const D3D12_SHADER_BYTECODE &  binary)
inline

Sets this PSO's domain shader.

Parameters
[in]binaryThe domain shader binary.
void blowbox::GraphicsPSO::SetGeometryShader ( const D3D12_SHADER_BYTECODE &  binary)
inline

Sets this PSO's geometry shader.

Parameters
[in]binaryThe geometry shader binary.
void blowbox::GraphicsPSO::SetHullShader ( const D3D12_SHADER_BYTECODE &  binary)
inline

Sets this PSO's hull shader.

Parameters
[in]binaryThe hull shader binary.
void blowbox::GraphicsPSO::SetInputLayout ( UINT  num_elements,
const D3D12_INPUT_ELEMENT_DESC *  input_element_descs 
)

Sets the input layout on this PSO.

Parameters
[in]num_elementsThe number of input elements.
[in]input_element_descsAn array of input element descriptions.
void blowbox::GraphicsPSO::SetPixelShader ( const D3D12_SHADER_BYTECODE &  binary)
inline

Sets this PSO's pixel shader.

Parameters
[in]binaryThe pixel shader binary.
void blowbox::GraphicsPSO::SetPrimitiveRestart ( D3D12_INDEX_BUFFER_STRIP_CUT_VALUE  ib_props)

Sets the primitive restart (whatever that means)

Parameters
[in]ib_propsNot a clue what this means, figure it out yourself.
void blowbox::GraphicsPSO::SetPrimitiveTopologyType ( D3D12_PRIMITIVE_TOPOLOGY_TYPE  topology_type)

Sets the primitive topology type for this PSO.

Parameters
[in]topology_typeThe topology type that should be set.
void blowbox::GraphicsPSO::SetRasterizerState ( const D3D12_RASTERIZER_DESC &  rasterizer_desc)

Sets the rasterizer state for this PSO.

Parameters
[in]rasterizer_descThe rasterizer state description.
void blowbox::GraphicsPSO::SetRenderTargetFormat ( DXGI_FORMAT  rtv_format,
DXGI_FORMAT  dsv_format,
UINT  msaa_count = 1,
UINT  msaa_quality = 0 
)

Sets the render target in this PSO. This will make it so that this PSO only uses ONE render target.

Parameters
[in]rtv_formatThe rtv format.
[in]dsv_formatThe dsv format. Use DXGI_FORMAT_UNKNOWN to unbind.
[in]msaa_countThe MSAA count on the rtv.
[in]msaa_qualityThe quality of the MSAA applied.
void blowbox::GraphicsPSO::SetRenderTargetFormats ( UINT  num_rtvs,
const DXGI_FORMAT *  rtv_formats,
DXGI_FORMAT  dsv_format,
UINT  msaa_count = 1,
UINT  msaa_quality = 0 
)

Sets the render targets in this PSO. Every format represents one render target.

Parameters
[in]num_rtvsThe number of RTVs.
[in]rtv_formatsAn array of RTV formats.
[in]dsv_formatThe DSV format to use. Use DXGI_FORMAT_UNKNOWN to unbind.
[in]msaa_countThe MSAA count on the rtv.
[in]msaa_qualityThe quality of the MSAA applied.
void blowbox::GraphicsPSO::SetSampleMask ( UINT  sample_mask)

Sets the sample mask for this PSO.

Parameters
[in]sample_maskThe sample mask that should be set.
void blowbox::GraphicsPSO::SetVertexShader ( const D3D12_SHADER_BYTECODE &  binary)
inline

Sets this PSO's vertex shader.

Parameters
[in]binaryThe vertex shader binary.

Member Data Documentation

D3D12_INPUT_ELEMENT_DESC blowbox::GraphicsPSO::input_element_descs_[16]
protected

The input element descriptions.

D3D12_GRAPHICS_PIPELINE_STATE_DESC blowbox::GraphicsPSO::pso_desc_
protected

The PSO description.


The documentation for this class was generated from the following files: