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); } }
public void Clear() { Renderpasses.Clear(); Pipelines.Clear(); StencilWrites.Clear(); Viewports.Clear(); Scissors.Clear(); DepthBias.Clear(); LineWidths.Clear(); DepthBounds.Clear(); BlendConstants.Clear(); VAOs.Clear(); StencilFunctions.Clear(); Draws.Clear(); DrawIndexeds.Clear(); DrawIndirects.Clear(); DrawIndexedIndirects.Clear(); DescriptorSets.Clear(); }
public override int GetHashCode() { return(DepthTest.GetHashCode() ^ DepthBias.GetHashCode() ^ FrontFace.GetHashCode() ^ CullMode.GetHashCode() ^ BlendMode.GetHashCode() ^ FillMode.GetHashCode() ^ StencilMode.GetHashCode()); }