Beispiel #1
0
 public void PushPass(CPass Pass)
 {
     if (Pass.PreUse())
     {
         SDK_ICommandList_PushPass(CoreObject, Pass.CoreObject);
     }
 }
Beispiel #2
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);
        }
Beispiel #3
0
        private static void OnPassBuilt_WireFrameCB(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;

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

            CCommandList cmd = CCommandList.CreateFromPtr(cmdPtr);

            cmd.SetRasterizerState(smp);
        }
Beispiel #4
0
        public static CPass CreatePassFromPtr(NativePointer ptr)
        {
            var result = new CPass(ptr);

            result.Core_AddRef();

            var pipeLinePtr = SDK_IPass_GetPipeline(ptr);

            if (pipeLinePtr.Pointer == IntPtr.Zero)
            {
                return(null);
            }
            result.mRenderPipeline = new CRenderPipeline(pipeLinePtr, true);

            var GpuProgram = SDK_IPass_GetGpuProgram(ptr);

            if (GpuProgram.Pointer == IntPtr.Zero)
            {
                return(null);
            }
            else
            {
                CShaderProgram Temp = new CShaderProgram(GpuProgram);
                Temp.Core_AddRef();
                result.mGpuProgram = Temp;
            }

            var srvs = SDK_IPass_GetShaderResurces(ptr);

            result.mShaderResources = new CShaderResources(srvs);

            //var srvs = SDK_IPass_GetShaderSma(ptr);
            //result.mShaderResources = new CShaderResources(srvs);

            return(result);
        }