コード例 #1
0
        /// <summary>
        /// Creates a new <see cref="Sampler"/>.
        /// </summary>
        /// <param name="description">The desired properties of the created object.</param>
        /// <returns>A new <see cref="Sampler"/>.</returns>
        public Sampler CreateSampler(ref SamplerDescription description)
        {
#if VALIDATE_USAGE
            if (!Features.SamplerLodBias && description.LodBias != 0)
            {
                throw new VeldridException(
                          "GraphicsDevice does not support Sampler LOD bias. SamplerDescription.LodBias must be 0.");
            }
            if (!Features.SamplerAnisotropy && description.Filter == SamplerFilter.Anisotropic)
            {
                throw new VeldridException(
                          "SamplerFilter.Anisotropic cannot be used unless GraphicsDeviceFeatures.SamplerAnisotropy is supported.");
            }
#endif

            return(CreateSamplerCore(ref description));
        }
コード例 #2
0
 protected abstract Sampler CreateSamplerCore(ref SamplerDescription description);
コード例 #3
0
 /// <summary>
 /// Creates a new <see cref="Sampler"/>.
 /// </summary>
 /// <param name="description">The desired properties of the created object.</param>
 /// <returns>A new <see cref="Sampler"/>.</returns>
 public Sampler CreateSampler(SamplerDescription description) => CreateSampler(ref description);