/// <summary> /// Function to assign a list of <see cref="GorgonBlendState"/> objects to the pipeline. /// </summary> /// <param name="states">The states to apply to the pipeline</param> /// <param name="startSlot">[Optional] The first slot to assign the states into.</param> /// <returns>The fluent builder interface.</returns> /// <exception cref="ArgumentNullException">Thrown when the <paramref name="startSlot"/> is less than 0, or greater than/equal to 8.</exception> public GorgonPipelineStateBuilder BlendStates(IReadOnlyList <GorgonBlendState> states, int startSlot = 0) { if ((startSlot < 0) || (startSlot >= D3D11.OutputMergerStage.SimultaneousRenderTargetCount)) { throw new ArgumentOutOfRangeException(nameof(startSlot), string.Format(Resources.GORGFX_ERR_BLEND_SLOT_INVALID, D3D11.OutputMergerStage.SimultaneousRenderTargetCount)); } StateCopy.CopyBlendStates(_workState.RwBlendStates, states, startSlot); return(this); }
/// <summary> /// Function to reset the pipeline state to the specified state passed in to the method. /// </summary> /// <param name="pipeState">The pipeline state to copy.</param> /// <returns>The fluent interface for the builder.</returns> public GorgonPipelineStateBuilder ResetTo(GorgonPipelineState pipeState) { if (pipeState == null) { Clear(); return(this); } _workState.RasterState = pipeState.RasterState; _workState.DepthStencilState = pipeState.DepthStencilState; _workState.PixelShader = pipeState.PixelShader; _workState.VertexShader = pipeState.VertexShader; _workState.GeometryShader = pipeState.GeometryShader; _workState.DomainShader = pipeState.DomainShader; _workState.HullShader = pipeState.HullShader; _workState.PrimitiveType = pipeState.PrimitiveType; _workState.IsIndependentBlendingEnabled = pipeState.IsIndependentBlendingEnabled; _workState.IsAlphaToCoverageEnabled = pipeState.IsAlphaToCoverageEnabled; StateCopy.CopyBlendStates(_workState.RwBlendStates, pipeState.RwBlendStates, 0); return(this); }