Exemplo n.º 1
0
        public CPass BuildRenderPass(int limitter = int.MaxValue, bool lastestPass = false, bool bImmCBuffer = false)
        {
            ScopeBuildRenderPass.Begin();

            CPass pass = null;

            unsafe
            {
                if (lastestPass)
                {
                    CPass.NativePointer passPtr = new CPass.NativePointer();
                    SDK_ICommandList_BuildRenderPass(CoreObject, vBOOL.FromBoolean(bImmCBuffer), limitter, &passPtr);

                    if (passPtr.GetPointer() != IntPtr.Zero)
                    {
                        pass = CPass.CreatePassFromPtr(passPtr);
                    }
                }
                else
                {
                    SDK_ICommandList_BuildRenderPass(CoreObject, vBOOL.FromBoolean(bImmCBuffer), limitter, null);
                }
            }

            ScopeBuildRenderPass.End();

            return(pass);
        }
Exemplo n.º 2
0
 public extern static void SDK_ICommandList_PushPass(NativePointer self, CPass.NativePointer Pass);
Exemplo n.º 3
0
        private static void OnPassBuilt_WireFrameAndNoCullCB(CCommandList.NativePointer cmdPtr, CPass.NativePointer ptr)
        {
            var pass = CPass.CreatePassFromPtr(ptr);

            if (pass.UserFlags == 0)
            {
                return;
            }
            var rsState = pass.RenderPipeline.RasterizerState;
            var desc    = rsState.Desc;

            desc.FillMode = EFillMode.FMD_WIREFRAME;
            desc.CullMode = ECullMode.CMD_NONE;

            var rc  = CEngine.Instance.RenderContext;
            var smp = CEngine.Instance.RasterizerStateManager.GetRasterizerState(rc, desc);

            CCommandList cmd = CCommandList.CreateFromPtr(cmdPtr);

            cmd.SetRasterizerState(smp);
        }