3 #include "util/string.h" 4 #include "d3d12_includes.h" 6 #define ROOT_SIGNATURE_MAX_PARAMETERS 64 7 #define ROOT_SIGNATURE_MAX_STATIC_SAMPLERS 64 53 void InitAsConstants(UINT shader_register, UINT num_dwords, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
60 void InitAsConstantBuffer(UINT shader_register, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
67 void InitAsBufferSRV(UINT shader_register, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
74 void InitAsBufferUAV(UINT shader_register, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
83 void InitAsDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE type, UINT count, UINT shader_register, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
91 void InitAsDescriptorTable(UINT range_count, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
101 void SetDescriptorRangeInTable(UINT range_index, D3D12_DESCRIPTOR_RANGE_TYPE type, UINT shader_register, UINT count, UINT space = 0);
136 void Create(UINT num_root_parameters, UINT num_static_samplers);
143 void Finalize(
const WString& name, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE);
152 ID3D12RootSignature*
Get()
const {
return root_signature_; }
155 operator ID3D12RootSignature*()
const {
return root_signature_; }
158 ID3D12RootSignature*
operator->()
const {
return root_signature_; }
166 void InitStaticSampler(
const D3D12_STATIC_SAMPLER_DESC& static_sampler_desc, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
174 void InitStaticSampler(UINT shader_register,
const D3D12_SAMPLER_DESC& sampler_desc, D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL);
181 void ConfirmInitializedParameter();
191 D3D12_STATIC_SAMPLER_DESC static_samplers_[ROOT_SIGNATURE_MAX_STATIC_SAMPLERS];
UINT num_initialized_static_samplers_
The number of currently initialized static samplers.
Definition: root_signature.h:188
void 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 Descrip...
Definition: root_signature.cc:286
UINT num_root_parameters_
The number of RootParameters in this RootSignature.
Definition: root_signature.h:185
void InitAsConstants(UINT shader_register, UINT num_dwords, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
Initializes this RootParameter as root constants.
Definition: root_signature.cc:228
RootParameter()
Constructs a RootParameter.
Definition: root_signature.cc:191
UINT num_initialized_root_parameters_
The number of currently initialized RootParameters.
Definition: root_signature.h:186
void InitAsConstantBuffer(UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
Initializes this RootParameter as a root constant buffer.
Definition: root_signature.cc:239
Wraps the ID3D12RootSignature object.
Definition: root_signature.h:121
ID3D12RootSignature * operator->() const
Overload the pointer operator to access the underlying ID3D12RootSignature.
Definition: root_signature.h:158
bool finalized_
Whether the RootSignature has been finalized.
Definition: root_signature.h:184
void Initialize(RootSignature *owning_signature)
Initializes the root parameter.
Definition: root_signature.cc:210
void 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 ta...
Definition: root_signature.cc:269
eastl::wstring WString
Typedef for wrapping the EASTL wstring.
Definition: string.h:20
~RootParameter()
Destructs this RootParameter.
Definition: root_signature.cc:204
ID3D12RootSignature * root_signature_
The underlying ID3D12RootSignature.
Definition: root_signature.h:189
void InitAsBufferUAV(UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
Initializes this RootParameter as a root UAV buffer.
Definition: root_signature.cc:259
void InitAsBufferSRV(UINT shader_register, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
Initializes this RootParameter as a root SRV buffer.
Definition: root_signature.cc:249
RootSignature * owning_signature_
The RootSignature that owns this RootParameter.
Definition: root_signature.h:104
The main Blowbox namespace.
Definition: image.cc:8
void InitAsDescriptorTable(UINT range_count, D3D12_SHADER_VISIBILITY visibility=D3D12_SHADER_VISIBILITY_ALL)
Initializes this RootParameter as a descriptor table.
Definition: root_signature.cc:277
UINT num_static_samplers_
The number of static samplers in this RootSignature.
Definition: root_signature.h:187
ID3D12RootSignature * Get() const
Definition: root_signature.h:152
Makes it easy to configure a D3D12_ROOT_PARAMETER.
Definition: root_signature.h:21
void Clear()
Clears the root parameter.
Definition: root_signature.cc:217