public void UpdateFrontStencil(GLCmdStencilFunctionInfo stencilInfo) { if ( mPastFrontStencilInfo.StencilFunction != stencilInfo.StencilFunction || mPastFrontStencilInfo.ReferenceMask != stencilInfo.ReferenceMask || mPastFrontStencilInfo.CompareMask != stencilInfo.CompareMask ) { mStencil.SetFrontFaceCullStencilFunction(stencilInfo.StencilFunction, stencilInfo.ReferenceMask, stencilInfo.CompareMask); mPastFrontStencilInfo.ReferenceMask = stencilInfo.ReferenceMask; mPastFrontStencilInfo.StencilFunction = stencilInfo.StencilFunction; mPastFrontStencilInfo.CompareMask = stencilInfo.CompareMask; } //if (mPastFrontStencilInfo.WriteMask != stencilInfo.WriteMask) //{ // mStencil.SetStencilWriteMask(stencilInfo.WriteMask); //} }
public void Initialize() { const int NO_OF_COLOR_ATTACHMENTS = 4; mPastColorBlendEnums = mBlend.Initialize(NO_OF_COLOR_ATTACHMENTS); var initialStencilValue = mStencil.Initialize(); mPastStencilInfo = initialStencilValue; mPastFrontWriteMask = initialStencilValue.Front.WriteMask; mPastBackWriteMask = initialStencilValue.Back.WriteMask; mPastFrontStencilInfo = new GLCmdStencilFunctionInfo { CompareMask = initialStencilValue.Front.CompareMask, ReferenceMask = initialStencilValue.Front.Reference, StencilFunction = initialStencilValue.Enums.FrontStencilFunction, }; mPastBackStencilInfo = new GLCmdStencilFunctionInfo { CompareMask = initialStencilValue.Back.CompareMask, ReferenceMask = initialStencilValue.Back.Reference, StencilFunction = initialStencilValue.Enums.BackStencilFunction, }; var initialDepthValue = mDepth.Initialize(); PreviousPipeline = new GLCmdBufferPipelineItem { DepthState = initialDepthValue, StencilState = initialStencilValue.Enums, }; mPastRasterization = mRaster.Initialize(); mPastClearValues = mClear.Initialize(); }