Add CreateDescriptorRange helper
This commit is contained in:
@@ -39,6 +39,7 @@ public:
|
||||
|
||||
static D3D12_STATIC_SAMPLER_DESC CreateStaticSampler(uint32_t shaderRegister, const D3D12_SAMPLER_DESC& desc, ShaderVisibility visibility = ShaderVisibility::Pixel);
|
||||
static D3D12_SAMPLER_DESC CreateSamplerDesc(FilterMode filter, TextureAddressMode address, float maxLOD = D3D12_FLOAT32_MAX);
|
||||
static D3D12_DESCRIPTOR_RANGE CreateDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE type, uint32_t baseShaderRegister, uint32_t numDescriptors, uint32_t registerSpace = 0);
|
||||
|
||||
private:
|
||||
ComPtr<ID3D12RootSignature> m_rootSignature;
|
||||
|
||||
@@ -128,5 +128,15 @@ D3D12_SAMPLER_DESC D3D12RootSignature::CreateSamplerDesc(FilterMode filter, Text
|
||||
return desc;
|
||||
}
|
||||
|
||||
D3D12_DESCRIPTOR_RANGE D3D12RootSignature::CreateDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE type, uint32_t baseShaderRegister, uint32_t numDescriptors, uint32_t registerSpace) {
|
||||
D3D12_DESCRIPTOR_RANGE range = {};
|
||||
range.RangeType = type;
|
||||
range.NumDescriptors = numDescriptors;
|
||||
range.BaseShaderRegister = baseShaderRegister;
|
||||
range.RegisterSpace = registerSpace;
|
||||
range.OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
|
||||
return range;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user