private void UpdateDynamicStates(GLCmdBoundPipelineRecordInfo pipelineInfo) { UpdateLineWidth(pipelineInfo.LineWidth); UpdateViewports(pipelineInfo.Viewports); UpdateScissors(pipelineInfo.Scissors); UpdateDepthBias(pipelineInfo.DepthBias); UpdateBlendConstants(pipelineInfo.BlendConstants); UpdateDepthBounds(pipelineInfo.DepthBounds); UpdateFrontStencil(pipelineInfo.FrontStencilInfo); UpdateBackStencil(pipelineInfo.BackStencilInfo); if (pipelineInfo.FrontStencilWriteMask == pipelineInfo.BackStencilWriteMask) { UpdateStencilWriteMask(new GLCmdPipelineStencilWriteInfo { Face = MgStencilFaceFlagBits.FRONT_AND_BACK, WriteMask = pipelineInfo.FrontStencilWriteMask, }); } else { UpdateStencilWriteMask(new GLCmdPipelineStencilWriteInfo { Face = MgStencilFaceFlagBits.FRONT_BIT, WriteMask = pipelineInfo.FrontStencilWriteMask, }); UpdateStencilWriteMask(new GLCmdPipelineStencilWriteInfo { Face = MgStencilFaceFlagBits.BACK_BIT, WriteMask = pipelineInfo.BackStencilWriteMask, }); } }
private void SetupStatePipelineSettings(GLCmdBoundPipelineRecordInfo pipelineInfo) { // Static pipeline stuff such as depth test enabled var pipeline = pipelineInfo.Pipeline; mCache.SetProgramID(MgPipelineBindPoint.GRAPHICS, pipeline.ProgramID, pipeline.InternalCache, pipeline.Layout); SetupBlendSettings(pipeline); SetupDepthSettings(pipeline); SetupStencilSettings(pipeline); SetupRasterizationSettings(pipeline); }
public void BindPipeline(GLCmdBoundPipelineRecordInfo pipelineInfo) { SetupStatePipelineSettings(pipelineInfo); UpdateDynamicStates(pipelineInfo); }