Fixed Sampler State filters + Documentation

This commit is contained in:
Simon Lübeß
2023-01-03 22:18:43 +01:00
parent 9d97579857
commit 427323744b
2 changed files with 14 additions and 4 deletions
@@ -40,8 +40,8 @@ namespace DirectX.D3D11
{ {
output = .Anisotropic; output = .Anisotropic;
} }
// Min filter // Mag filter
if(samplerDesc.MagFilter == .Linear) if(samplerDesc.MagFilter == .Linear)
{ {
output |= .Min_Point_Mag_Linear_Mip_Point; output |= .Min_Point_Mag_Linear_Mip_Point;
@@ -51,12 +51,12 @@ namespace DirectX.D3D11
output = .Anisotropic; output = .Anisotropic;
} }
// Mag filter // Min filter
if(samplerDesc.MinFilter == .Linear) if(samplerDesc.MinFilter == .Linear)
{ {
output |= .Min_Linear_Mag_Mip_Point; output |= .Min_Linear_Mag_Mip_Point;
} }
else if(samplerDesc.MagFilter == .Anisotropic) else if(samplerDesc.MinFilter == .Anisotropic)
{ {
output = .Anisotropic; output = .Anisotropic;
} }
@@ -101,10 +101,17 @@ namespace GlitchyEngine.Renderer
[BonTarget] [BonTarget]
public struct SamplerStateDescription : IHashable public struct SamplerStateDescription : IHashable
{ {
/// Sampling method used for minification.
/// If set to "Anisotropic" all Filters are set to "Anisotropic" internally.
public FilterFunction MinFilter = .Linear; public FilterFunction MinFilter = .Linear;
/// Sampling method used for magnification.
/// If set to "Anisotropic" all Filters are set to "Anisotropic" internally.
public FilterFunction MagFilter = .Linear; public FilterFunction MagFilter = .Linear;
/// Method used for mip-level sampling.
/// If set to "Anisotropic" all Filters are set to "Anisotropic" internally.
public FilterFunction MipFilter = .Linear; public FilterFunction MipFilter = .Linear;
/// Filtering method to use when sampling a texture.
public FilterMode FilterMode = .Default; public FilterMode FilterMode = .Default;
/** /**
@@ -113,8 +120,11 @@ namespace GlitchyEngine.Renderer
*/ */
public ComparisonFunction ComparisonFunction = .Never; public ComparisonFunction ComparisonFunction = .Never;
/// Method to use for resolving a u texture coordinate that is outside the 0 to 1 range.
public TextureAddressMode AddressModeU = .Clamp; public TextureAddressMode AddressModeU = .Clamp;
/// Method to use for resolving a v texture coordinate that is outside the 0 to 1 range.
public TextureAddressMode AddressModeV = .Clamp; public TextureAddressMode AddressModeV = .Clamp;
/// Method to use for resolving a w texture coordinate that is outside the 0 to 1 range.
public TextureAddressMode AddressModeW = .Clamp; public TextureAddressMode AddressModeW = .Clamp;
/** /**