/// <summary> /// Creates a new <see cref="Sampler"/> /// </summary> public unsafe Sampler( TextureAddressMode texU, TextureAddressMode texW, TextureAddressMode texV, SamplerFilterType filter, float mipLODBias = 0, uint maxAnisotropy = 16, SampleComparisonFunc comparisonFunc = SampleComparisonFunc.LessThan, Rgba128 borderColor = default, float minLOD = 0, float maxLOD = float.MaxValue ) { Debug.Assert(maxAnisotropy <= 16); Desc = new D3D12_SAMPLER_DESC { AddressU = (D3D12_TEXTURE_ADDRESS_MODE)texU, AddressW = (D3D12_TEXTURE_ADDRESS_MODE)texW, AddressV = (D3D12_TEXTURE_ADDRESS_MODE)texV, Filter = (D3D12_FILTER)filter, MipLODBias = mipLODBias, MaxAnisotropy = maxAnisotropy, ComparisonFunc = (D3D12_COMPARISON_FUNC)comparisonFunc, MinLOD = minLOD, MaxLOD = maxLOD, }; Unsafe.As <float, Rgba128>(ref Desc.BorderColor[0]) = borderColor; }
/// <summary> /// Creates a new <see cref="Sampler"/> /// </summary> public unsafe Sampler( TextureAddressMode texUWV, SamplerFilterType filter, float mipLODBias = 0, uint maxAnisotropy = 16, SampleComparisonFunc comparisonFunc = SampleComparisonFunc.LessThan, Rgba128 borderColor = default, float minLOD = 0, float maxLOD = float.MaxValue ) : this(texUWV, texUWV, texUWV, filter, mipLODBias, maxAnisotropy, comparisonFunc, borderColor, minLOD, maxLOD) { }