예제 #1
0
        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,
                });
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        public void BindPipeline(GLCmdBoundPipelineRecordInfo pipelineInfo)
        {
            SetupStatePipelineSettings(pipelineInfo);

            UpdateDynamicStates(pipelineInfo);
        }