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

#include <root_signature.h>

Public Member Functions

void InitAsConstants (UINT shader_register, UINT num_dwords, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
 
void InitAsConstantBuffer (UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
 
void InitAsBufferSRV (UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
 
void InitAsBufferUAV (UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
 
void InitAsDescriptorRange (D3D12_DESCRIPTOR_RANGE_TYPE type, UINT count, UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
 
void InitAsDescriptorTable (UINT range_count, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
 
void SetDescriptorRangeInTable (UINT range_index, D3D12_DESCRIPTOR_RANGE_TYPE type, UINT shader_register, UINT count, UINT space=0)
 

Protected Member Functions

 RootParameter ()
 
 RootParameter (RootSignature *owning_signature)
 
 ~RootParameter ()
 
void Initialize (RootSignature *owning_signature)
 
void Clear ()
 

Private Attributes

RootSignatureowning_signature_
 

Friends

class RootSignature
 

Detailed Description

Makes it easy to configure a D3D12_ROOT_PARAMETER.

This class wraps the functionality of a D3D12_ROOT_PARAMETER. It's goal is to make it simple and straightforward to configure RootParameter in an elegant way. Call one of the InitAs* functions on this to initialize the RootParameter as something.

Inheritance diagram for blowbox::RootParameter:

Constructor & Destructor Documentation

blowbox::RootParameter::RootParameter ( )
protected

Constructs a RootParameter.

blowbox::RootParameter::RootParameter ( RootSignature owning_signature)
protected

Constructs a RootParameter.

Parameters
[in]owning_signatureThe root signature that owns this RootParameter.
blowbox::RootParameter::~RootParameter ( )
protected

Destructs this RootParameter.

Member Function Documentation

void blowbox::RootParameter::Clear ( )
protected

Clears the root parameter.

void blowbox::RootParameter::InitAsBufferSRV ( UINT  shader_register,
D3D12_SHADER_VISIBILITY  visibility = D3D12_SHADER_VISIBILITY_ALL 
)

Initializes this RootParameter as a root SRV buffer.

Parameters
[in]shader_registerThe register at which the root SRV buffer should appear in the shaders.
[in]visibilityThe shader stages in which this root parameter is visible.
void blowbox::RootParameter::InitAsBufferUAV ( UINT  shader_register,
D3D12_SHADER_VISIBILITY  visibility = D3D12_SHADER_VISIBILITY_ALL 
)

Initializes this RootParameter as a root UAV buffer.

Parameters
[in]shader_registerThe register at which the root UAV buffer should appear in the shaders.
[in]visibilityThe shader stages in which this root parameter is visible.
void blowbox::RootParameter::InitAsConstantBuffer ( UINT  shader_register,
D3D12_SHADER_VISIBILITY  visibility = D3D12_SHADER_VISIBILITY_ALL 
)

Initializes this RootParameter as a root constant buffer.

Parameters
[in]shader_registerThe register at which the root constant buffer should appear in the shaders.
[in]visibilityThe shader stages in which this root parameter is visible.
void blowbox::RootParameter::InitAsConstants ( UINT  shader_register,
UINT  num_dwords,
D3D12_SHADER_VISIBILITY  visibility = D3D12_SHADER_VISIBILITY_ALL 
)

Initializes this RootParameter as root constants.

Parameters
[in]shader_registerThe register at which these constants should appear in the shaders.
[in]num_dwordsThe number of 32 bit values that are in this root parameter.
[in]visibilityThe shader stages in which this root parameter is visible.
void blowbox::RootParameter::InitAsDescriptorRange ( D3D12_DESCRIPTOR_RANGE_TYPE  type,
UINT  count,
UINT  shader_register,
D3D12_SHADER_VISIBILITY  visibility = D3D12_SHADER_VISIBILITY_ALL 
)

Initializes this RootParameter as a descriptor range (actually it gets initialized as a descriptor table with only one range in it).

Parameters
[in]typeThe type of descriptor range this should be (UAV, SRV, CBV, SAMPLER).
[in]countThe size of the descriptor range, should be at least 1.
[in]shader_registerThe register at which the descriptor range should appear in the shaders.
[in]visibilityThe shader stages in which this root parameter is visible.
void blowbox::RootParameter::InitAsDescriptorTable ( UINT  range_count,
D3D12_SHADER_VISIBILITY  visibility = D3D12_SHADER_VISIBILITY_ALL 
)

Initializes this RootParameter as a descriptor table.

Parameters
[in]range_countThe number of descriptor ranges that this descriptor table controls.
[in]visibilityThe shader stages in which this root parameter is visible.
Remarks
This doesn't initializes the different descriptor ranges in this descriptor table. Use RootParameter::SetTableRange() for that.
void blowbox::RootParameter::Initialize ( RootSignature owning_signature)
protected

Initializes the root parameter.

Parameters
[in]owning_signatureThe signature that owns this parameter.
void blowbox::RootParameter::SetDescriptorRangeInTable ( UINT  range_index,
D3D12_DESCRIPTOR_RANGE_TYPE  type,
UINT  shader_register,
UINT  count,
UINT  space = 0 
)

Sets a descriptor range inside of this RootParameter (which should have been initialized as a DescriptorTable before!)

Parameters
[in]range_indexThe index of the descriptor range in the descriptor table that you want to set.
[in]typeThe type of descriptor range this should be (UAV, SRV, CBV, SAMPLER).
[in]shader_registerThe register at which the descriptor range should appear in the shaders.
[in]countThe size of the descriptor range, should be at least 1.
[in]spaceThe register space of this descriptor range.

Member Data Documentation

RootSignature* blowbox::RootParameter::owning_signature_
private

The RootSignature that owns this RootParameter.


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