update sampler definition
parent
66e0fe9924
commit
a55cd83123
|
@ -9,7 +9,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public Sampler(
|
public Sampler(
|
||||||
GraphicsDevice device,
|
GraphicsDevice device,
|
||||||
ref SamplerState samplerState
|
in SamplerState samplerState
|
||||||
) : base(device)
|
) : base(device)
|
||||||
{
|
{
|
||||||
Handle = Refresh.Refresh_CreateSampler(
|
Handle = Refresh.Refresh_CreateSampler(
|
||||||
|
|
|
@ -4,29 +4,29 @@ namespace MoonWorks.Graphics
|
||||||
{
|
{
|
||||||
public struct SamplerState
|
public struct SamplerState
|
||||||
{
|
{
|
||||||
public Refresh.Filter MinFilter;
|
public Filter MinFilter;
|
||||||
public Refresh.Filter MagFilter;
|
public Filter MagFilter;
|
||||||
public Refresh.SamplerMipmapMode MipmapMode;
|
public SamplerMipmapMode MipmapMode;
|
||||||
public Refresh.SamplerAddressMode AddressModeU;
|
public SamplerAddressMode AddressModeU;
|
||||||
public Refresh.SamplerAddressMode AddressModeV;
|
public SamplerAddressMode AddressModeV;
|
||||||
public Refresh.SamplerAddressMode AddressModeW;
|
public SamplerAddressMode AddressModeW;
|
||||||
public float MipLodBias;
|
public float MipLodBias;
|
||||||
public bool AnisotropyEnable;
|
public bool AnisotropyEnable;
|
||||||
public float MaxAnisotropy;
|
public float MaxAnisotropy;
|
||||||
public bool CompareEnable;
|
public bool CompareEnable;
|
||||||
public Refresh.CompareOp CompareOp;
|
public CompareOp CompareOp;
|
||||||
public float MinLod;
|
public float MinLod;
|
||||||
public float MaxLod;
|
public float MaxLod;
|
||||||
public Refresh.BorderColor BorderColor;
|
public BorderColor BorderColor;
|
||||||
|
|
||||||
public static readonly SamplerState AnisotropicClamp = new SamplerState
|
public static readonly SamplerState AnisotropicClamp = new SamplerState
|
||||||
{
|
{
|
||||||
MinFilter = Refresh.Filter.Linear,
|
MinFilter = Filter.Linear,
|
||||||
MagFilter = Refresh.Filter.Linear,
|
MagFilter = Filter.Linear,
|
||||||
MipmapMode = Refresh.SamplerMipmapMode.Linear,
|
MipmapMode = SamplerMipmapMode.Linear,
|
||||||
AddressModeU = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeU = SamplerAddressMode.ClampToEdge,
|
||||||
AddressModeV = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeV = SamplerAddressMode.ClampToEdge,
|
||||||
AddressModeW = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeW = SamplerAddressMode.ClampToEdge,
|
||||||
CompareEnable = false,
|
CompareEnable = false,
|
||||||
AnisotropyEnable = true,
|
AnisotropyEnable = true,
|
||||||
MaxAnisotropy = 4,
|
MaxAnisotropy = 4,
|
||||||
|
@ -37,12 +37,12 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public static readonly SamplerState AnisotropicWrap = new SamplerState
|
public static readonly SamplerState AnisotropicWrap = new SamplerState
|
||||||
{
|
{
|
||||||
MinFilter = Refresh.Filter.Linear,
|
MinFilter = Filter.Linear,
|
||||||
MagFilter = Refresh.Filter.Linear,
|
MagFilter = Filter.Linear,
|
||||||
MipmapMode = Refresh.SamplerMipmapMode.Linear,
|
MipmapMode = SamplerMipmapMode.Linear,
|
||||||
AddressModeU = Refresh.SamplerAddressMode.Repeat,
|
AddressModeU = SamplerAddressMode.Repeat,
|
||||||
AddressModeV = Refresh.SamplerAddressMode.Repeat,
|
AddressModeV = SamplerAddressMode.Repeat,
|
||||||
AddressModeW = Refresh.SamplerAddressMode.Repeat,
|
AddressModeW = SamplerAddressMode.Repeat,
|
||||||
CompareEnable = false,
|
CompareEnable = false,
|
||||||
AnisotropyEnable = true,
|
AnisotropyEnable = true,
|
||||||
MaxAnisotropy = 4,
|
MaxAnisotropy = 4,
|
||||||
|
@ -53,12 +53,12 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public static readonly SamplerState LinearClamp = new SamplerState
|
public static readonly SamplerState LinearClamp = new SamplerState
|
||||||
{
|
{
|
||||||
MinFilter = Refresh.Filter.Linear,
|
MinFilter = Filter.Linear,
|
||||||
MagFilter = Refresh.Filter.Linear,
|
MagFilter = Filter.Linear,
|
||||||
MipmapMode = Refresh.SamplerMipmapMode.Linear,
|
MipmapMode = SamplerMipmapMode.Linear,
|
||||||
AddressModeU = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeU = SamplerAddressMode.ClampToEdge,
|
||||||
AddressModeV = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeV = SamplerAddressMode.ClampToEdge,
|
||||||
AddressModeW = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeW = SamplerAddressMode.ClampToEdge,
|
||||||
CompareEnable = false,
|
CompareEnable = false,
|
||||||
AnisotropyEnable = false,
|
AnisotropyEnable = false,
|
||||||
MipLodBias = 0f,
|
MipLodBias = 0f,
|
||||||
|
@ -68,12 +68,12 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public static readonly SamplerState LinearWrap = new SamplerState
|
public static readonly SamplerState LinearWrap = new SamplerState
|
||||||
{
|
{
|
||||||
MinFilter = Refresh.Filter.Linear,
|
MinFilter = Filter.Linear,
|
||||||
MagFilter = Refresh.Filter.Linear,
|
MagFilter = Filter.Linear,
|
||||||
MipmapMode = Refresh.SamplerMipmapMode.Linear,
|
MipmapMode = SamplerMipmapMode.Linear,
|
||||||
AddressModeU = Refresh.SamplerAddressMode.Repeat,
|
AddressModeU = SamplerAddressMode.Repeat,
|
||||||
AddressModeV = Refresh.SamplerAddressMode.Repeat,
|
AddressModeV = SamplerAddressMode.Repeat,
|
||||||
AddressModeW = Refresh.SamplerAddressMode.Repeat,
|
AddressModeW = SamplerAddressMode.Repeat,
|
||||||
CompareEnable = false,
|
CompareEnable = false,
|
||||||
AnisotropyEnable = false,
|
AnisotropyEnable = false,
|
||||||
MipLodBias = 0f,
|
MipLodBias = 0f,
|
||||||
|
@ -83,12 +83,12 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public static readonly SamplerState PointClamp = new SamplerState
|
public static readonly SamplerState PointClamp = new SamplerState
|
||||||
{
|
{
|
||||||
MinFilter = Refresh.Filter.Nearest,
|
MinFilter = Filter.Nearest,
|
||||||
MagFilter = Refresh.Filter.Nearest,
|
MagFilter = Filter.Nearest,
|
||||||
MipmapMode = Refresh.SamplerMipmapMode.Nearest,
|
MipmapMode = SamplerMipmapMode.Nearest,
|
||||||
AddressModeU = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeU = SamplerAddressMode.ClampToEdge,
|
||||||
AddressModeV = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeV = SamplerAddressMode.ClampToEdge,
|
||||||
AddressModeW = Refresh.SamplerAddressMode.ClampToEdge,
|
AddressModeW = SamplerAddressMode.ClampToEdge,
|
||||||
CompareEnable = false,
|
CompareEnable = false,
|
||||||
AnisotropyEnable = false,
|
AnisotropyEnable = false,
|
||||||
MipLodBias = 0f,
|
MipLodBias = 0f,
|
||||||
|
@ -98,12 +98,12 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public static readonly SamplerState PointWrap = new SamplerState
|
public static readonly SamplerState PointWrap = new SamplerState
|
||||||
{
|
{
|
||||||
MinFilter = Refresh.Filter.Nearest,
|
MinFilter = Filter.Nearest,
|
||||||
MagFilter = Refresh.Filter.Nearest,
|
MagFilter = Filter.Nearest,
|
||||||
MipmapMode = Refresh.SamplerMipmapMode.Nearest,
|
MipmapMode = SamplerMipmapMode.Nearest,
|
||||||
AddressModeU = Refresh.SamplerAddressMode.Repeat,
|
AddressModeU = SamplerAddressMode.Repeat,
|
||||||
AddressModeV = Refresh.SamplerAddressMode.Repeat,
|
AddressModeV = SamplerAddressMode.Repeat,
|
||||||
AddressModeW = Refresh.SamplerAddressMode.Repeat,
|
AddressModeW = SamplerAddressMode.Repeat,
|
||||||
CompareEnable = false,
|
CompareEnable = false,
|
||||||
AnisotropyEnable = false,
|
AnisotropyEnable = false,
|
||||||
MipLodBias = 0f,
|
MipLodBias = 0f,
|
||||||
|
@ -115,20 +115,20 @@ namespace MoonWorks.Graphics
|
||||||
{
|
{
|
||||||
return new Refresh.SamplerStateCreateInfo
|
return new Refresh.SamplerStateCreateInfo
|
||||||
{
|
{
|
||||||
minFilter = MinFilter,
|
minFilter = (Refresh.Filter)MinFilter,
|
||||||
magFilter = MagFilter,
|
magFilter = (Refresh.Filter)MagFilter,
|
||||||
mipmapMode = MipmapMode,
|
mipmapMode = (Refresh.SamplerMipmapMode)MipmapMode,
|
||||||
addressModeU = AddressModeU,
|
addressModeU = (Refresh.SamplerAddressMode)AddressModeU,
|
||||||
addressModeV = AddressModeV,
|
addressModeV = (Refresh.SamplerAddressMode)AddressModeV,
|
||||||
addressModeW = AddressModeW,
|
addressModeW = (Refresh.SamplerAddressMode)AddressModeW,
|
||||||
mipLodBias = MipLodBias,
|
mipLodBias = MipLodBias,
|
||||||
anisotropyEnable = Conversions.BoolToByte(AnisotropyEnable),
|
anisotropyEnable = Conversions.BoolToByte(AnisotropyEnable),
|
||||||
maxAnisotropy = MaxAnisotropy,
|
maxAnisotropy = MaxAnisotropy,
|
||||||
compareEnable = Conversions.BoolToByte(CompareEnable),
|
compareEnable = Conversions.BoolToByte(CompareEnable),
|
||||||
compareOp = CompareOp,
|
compareOp = (Refresh.CompareOp)CompareOp,
|
||||||
minLod = MinLod,
|
minLod = MinLod,
|
||||||
maxLod = MaxLod,
|
maxLod = MaxLod,
|
||||||
borderColor = BorderColor
|
borderColor = (Refresh.BorderColor)BorderColor
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue