示例#1
0
        internal virtual void Begin()
        {
            if (Locals == null)
            {
                Locals = new MyPassLocals();
            }
            Locals.Clear();

            //if (!m_isImmediate)
            //{
            //    //Debug.Assert(m_RC == null);
            //    //m_RC = MyRenderContextPool.AcquireRC();
            //}

            var mapping = MyMapping.MapDiscard(RC.Context, MyCommon.ProjectionConstants);

            mapping.stream.Write(Matrix.Transpose(ViewProjection));
            mapping.Unmap();

            // common settings
            Context.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
            Context.Rasterizer.SetViewport(Viewport.OffsetX, Viewport.OffsetY, Viewport.Width, Viewport.Height);

            Context.PixelShader.SetSamplers(0, MyRender11.StandardSamplers);

            RC.SetCB(MyCommon.FRAME_SLOT, MyCommon.FrameConstants);
            RC.SetCB(MyCommon.PROJECTION_SLOT, MyCommon.ProjectionConstants);
            RC.SetCB(MyCommon.ALPHAMASK_VIEWS_SLOT, MyCommon.AlphamaskViewsConstants);

            Context.PixelShader.SetShaderResource(MyCommon.DITHER_8X8_SLOT, MyTextures.Views[MyTextures.Dithering8x8TexId.Index]);

            if (MyBigMeshTable.Table.m_IB != null)
            {
                RC.VSBindSRV(MyCommon.BIG_TABLE_INDICES,
                             MyBigMeshTable.Table.m_IB.Srv,
                             MyBigMeshTable.Table.m_VB_positions.Srv,
                             MyBigMeshTable.Table.m_VB_rest.Srv);
            }
        }
示例#2
0
        internal virtual void Begin()
        {
            if (Locals == null)
            {
                Locals = new MyPassLocals();
            }
            Locals.Clear();

            //if (!m_isImmediate)
            //{
            //    //Debug.Assert(m_RC == null);
            //    //m_RC = MyRenderContextPool.AcquireRC();
            //}

            var mapping = MyMapping.MapDiscard(RC.Context, MyCommon.ProjectionConstants);
            mapping.stream.Write(Matrix.Transpose(ViewProjection));
            mapping.Unmap();

            // common settings
            Context.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList;
            Context.Rasterizer.SetViewport(Viewport.OffsetX, Viewport.OffsetY, Viewport.Width, Viewport.Height);

            Context.PixelShader.SetSamplers(0, MyRender11.StandardSamplers);

            RC.SetCB(MyCommon.FRAME_SLOT, MyCommon.FrameConstants);
            RC.SetCB(MyCommon.PROJECTION_SLOT, MyCommon.ProjectionConstants);
            RC.SetCB(MyCommon.ALPHAMASK_VIEWS_SLOT, MyCommon.AlphamaskViewsConstants);

            Context.PixelShader.SetShaderResource(MyCommon.DITHER_8X8_SLOT, MyTextures.Views[MyTextures.Dithering8x8TexId.Index]);

            if (MyBigMeshTable.Table.m_IB != null)
            {
                RC.VSBindSRV(MyCommon.BIG_TABLE_INDICES,
                    MyBigMeshTable.Table.m_IB.Srv,
                    MyBigMeshTable.Table.m_VB_positions.Srv,
                    MyBigMeshTable.Table.m_VB_rest.Srv);
            }
        }