internal static VkBorderColor VdToVkSamplerBorderColor(SamplerBorderColor borderColor) { switch (borderColor) { case SamplerBorderColor.TransparentBlack: return VkBorderColor.FloatTransparentBlack; case SamplerBorderColor.OpaqueBlack: return VkBorderColor.FloatOpaqueBlack; case SamplerBorderColor.OpaqueWhite: return VkBorderColor.FloatOpaqueWhite; default: throw Illegal.Value<SamplerBorderColor>(); } }
/// <summary> /// Default SamplerStateDescription values. /// </summary> public void SetDefault() { AddressModeU = SamplerAddressMode.ClampToEdge; AddressModeV = SamplerAddressMode.ClampToEdge; AddressModeW = SamplerAddressMode.ClampToEdge; MagFilter = SamplerMinMagFilter.Nearest; MinFilter = SamplerMinMagFilter.Nearest; MipmapFilter = SamplerMipFilter.Nearest; MaxAnisotropy = 1; LodMinClamp = 0.0f; LodMaxClamp = float.MaxValue; CompareFunction = CompareFunction.Never; BorderColor = SamplerBorderColor.TransparentBlack; }
internal static MTLSamplerBorderColor VdToMTLBorderColor(SamplerBorderColor borderColor) { switch (borderColor) { case SamplerBorderColor.TransparentBlack: return(MTLSamplerBorderColor.TransparentBlack); case SamplerBorderColor.OpaqueBlack: return(MTLSamplerBorderColor.OpaqueBlack); case SamplerBorderColor.OpaqueWhite: return(MTLSamplerBorderColor.OpaqueWhite); default: throw Illegal.Value <SamplerBorderColor>(); } }
private static Color4 ToRawColor4(SamplerBorderColor borderColor) { switch (borderColor) { case SamplerBorderColor.TransparentBlack: return(new Color4(0, 0, 0, 0)); case SamplerBorderColor.OpaqueBlack: return(new Color4(0, 0, 0, 1)); case SamplerBorderColor.OpaqueWhite: return(new Color4(1, 1, 1, 1)); default: throw Illegal.Value <SamplerBorderColor>(); } }
/// <summary> /// Constructs a new SamplerDescription. /// </summary> /// <param name="addressModeU">The <see cref="SamplerAddressMode"/> mode to use for the U (or R) coordinate.</param> /// <param name="addressModeV">The <see cref="SamplerAddressMode"/> mode to use for the V (or S) coordinate.</param> /// <param name="addressModeW">The <see cref="SamplerAddressMode"/> mode to use for the W (or T) coordinate.</param> /// <param name="filter">The filter used when sampling.</param> /// <param name="comparisonKind">An optional value controlling the kind of comparison to use when sampling. If null, /// comparison sampling is not used.</param> /// <param name="maximumAnisotropy">The maximum anisotropy of the filter, when <see cref="SamplerFilter.Anisotropic"/> is /// used, or otherwise ignored.</param> /// <param name="minimumLod">The minimum level of detail.</param> /// <param name="maximumLod">The maximum level of detail.</param> /// <param name="lodBias">The level of detail bias.</param> /// <param name="borderColor">The constant color that is sampled when <see cref="SamplerAddressMode.Border"/> is used, or /// otherwise ignored.</param> public SamplerDescription( SamplerAddressMode addressModeU, SamplerAddressMode addressModeV, SamplerAddressMode addressModeW, SamplerFilter filter, ComparisonKind?comparisonKind, uint maximumAnisotropy, uint minimumLod, uint maximumLod, int lodBias, SamplerBorderColor borderColor) { AddressModeU = addressModeU; AddressModeV = addressModeV; AddressModeW = addressModeW; Filter = filter; ComparisonKind = comparisonKind; MaximumAnisotropy = maximumAnisotropy; MinimumLod = minimumLod; MaximumLod = maximumLod; LodBias = lodBias; BorderColor = borderColor; }