public static SamplerState New(GraphicsDevice graphicsDevice, SamplerStateDescription samplerStateDescription) { // Store SamplerState in a cache (D3D seems to have quite bad concurrency when using CreateSampler while rendering) SamplerState samplerState; lock (graphicsDevice.CachedSamplerStates) { if (graphicsDevice.CachedSamplerStates.TryGetValue(samplerStateDescription, out samplerState)) { // TODO: Appropriate destroy samplerState.AddReferenceInternal(); } else { samplerState = new SamplerState(graphicsDevice, samplerStateDescription); graphicsDevice.CachedSamplerStates.Add(samplerStateDescription, samplerState); } } return(samplerState); }
private SamplerState(GraphicsDevice graphicsDevice, SamplerStateDescription samplerStateDescription) { throw new NotImplementedException(); }
/// <summary> /// Initializes a new instance of the <see cref="SamplerState"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="name">The name.</param> /// <param name="samplerStateDescription">The sampler state description.</param> private SamplerState(GraphicsDevice device, SamplerStateDescription samplerStateDescription) : base(device) { Description = samplerStateDescription; CreateNativeDeviceChild(); }
// For FakeSamplerState. protected SamplerState(SamplerStateDescription description) { Description = description; }
public FakeSamplerState(SamplerStateDescription description) : base(description) { }
/// <summary> /// Create a new fake sampler state for serialization. /// </summary> /// <param name="description">The description of the sampler state</param> /// <returns>The fake sampler state</returns> public static SamplerState NewFake(SamplerStateDescription description) { return(new SamplerState(description)); }
// For FakeSamplerState. private SamplerState(SamplerStateDescription description) { Description = description; }