private void Update(EvaluationContext context) { RasterizerState.Value?.Dispose(); var rasterizerDesc = new RasterizerStateDescription() { CullMode = CullMode.GetValue(context), DepthBias = DepthBias.GetValue(context), DepthBiasClamp = DepthBiasClamp.GetValue(context), FillMode = FillMode.GetValue(context), IsAntialiasedLineEnabled = AntialiasedLineEnabled.GetValue(context), IsDepthClipEnabled = DepthClipEnabled.GetValue(context), IsFrontCounterClockwise = FrontCounterClockwise.GetValue(context), IsMultisampleEnabled = MultiSampleEnabled.GetValue(context), IsScissorEnabled = ScissorEnabled.GetValue(context), SlopeScaledDepthBias = SlopeScaledDepthBias.GetValue(context) }; try { RasterizerState.Value = new RasterizerState(ResourceManager.Instance().Device, rasterizerDesc); // todo: put into resource manager } catch (Exception e) { Log.Error("Failed to create rasterizer state: " + e.Message); } }