Add CreateSamplerDesc helper method
This commit is contained in:
@@ -38,6 +38,7 @@ public:
|
||||
static D3D12_ROOT_PARAMETER CreateDescriptorTable(uint32_t numRanges, const D3D12_DESCRIPTOR_RANGE* ranges, ShaderVisibility visibility = ShaderVisibility::All);
|
||||
|
||||
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);
|
||||
|
||||
private:
|
||||
ComPtr<ID3D12RootSignature> m_rootSignature;
|
||||
|
||||
@@ -118,5 +118,15 @@ D3D12_STATIC_SAMPLER_DESC D3D12RootSignature::CreateStaticSampler(uint32_t shade
|
||||
return samplerDesc;
|
||||
}
|
||||
|
||||
D3D12_SAMPLER_DESC D3D12RootSignature::CreateSamplerDesc(FilterMode filter, TextureAddressMode address, float maxLOD) {
|
||||
D3D12_SAMPLER_DESC desc = {};
|
||||
desc.Filter = ToD3D12(filter);
|
||||
desc.AddressU = ToD3D12(address);
|
||||
desc.AddressV = ToD3D12(address);
|
||||
desc.AddressW = ToD3D12(address);
|
||||
desc.MaxLOD = maxLOD;
|
||||
return desc;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user