Пример #1
0
 public void VSBindTexture(UInt32 slot, CShaderResourceView tex)
 {
     if (tex == null)
     {
         return;
     }
     SDK_IShaderResources_VSBindTexture(CoreObject, (byte)slot, tex.CoreObject);
 }
Пример #2
0
        //public void BindCurrentSwapChain(CSwapChain swapChain)
        //{
        //    SDK_IRenderContext_BindCurrentSwapChain(CoreObject, swapChain.CoreObject);
        //}

        //public static Profiler.TimeScope ScopePresent = Profiler.TimeScopeManager.GetTimeScope(typeof(CRenderContext), nameof(Present));
        //public void Present(UInt32 SyncInterval, UInt32 Flags)
        //{
        //    ScopePresent.Begin();
        //    SDK_IRenderContext_Present(CoreObject, SyncInterval, Flags);
        //    ScopePresent.End();
        //}

        public CShaderResourceView LoadShaderResourceView(RName name)
        {
            unsafe
            {
                var obj = SDK_IRenderContext_LoadShaderResourceView(CoreObject, name.Address);
                if (obj.Pointer == IntPtr.Zero)
                {
                    return(null);
                }
                var rsv = new CShaderResourceView(obj);
                rsv.Name = name;
                return(rsv);
            }
        }
Пример #3
0
 public void CreateReadableTexture2D(ref CTexture2D pTexture, CShaderResourceView src, CFrameBuffer pFrameBuffers)
 {
     unsafe
     {
         CTexture2D.NativePointer oldPtr = CTexture2D.GetEmptyNativePointer();
         if (pTexture != null)
         {
             oldPtr = pTexture.CoreObject;
         }
         SDK_ICommandList_CreateReadableTexture2D(CoreObject, &oldPtr, src.CoreObject, pFrameBuffers.CoreObject);
         if (pTexture != null)
         {
             pTexture.UnsafeSetNativePointer(oldPtr);
         }
         else
         {
             pTexture = new CTexture2D(oldPtr);
         }
     }
 }
Пример #4
0
 //public bool LoadAllMips(CRenderContext rc, CShaderResourceView srv)
 //{
 //    return SDK_GfxTextureStreaming_LoadAllMips(CoreObject, rc.CoreObject, srv.CoreObject);
 //}
 public bool LoadNextMip(CRenderContext rc, CShaderResourceView srv)
 {
     return(SDK_GfxTextureStreaming_LoadNextMip(CoreObject, rc.CoreObject, srv.CoreObject));
 }
Пример #5
0
 public void CSSetShaderResource(UInt32 Index, CShaderResourceView Texture)
 {
     SDK_ICommandList_CSSetShaderResource(CoreObject, Index, Texture.CoreObject);
 }
Пример #6
0
 public void BindSRV_DS(CShaderResourceView SRV)
 {
     mSRV_DS = SRV;
 }
Пример #7
0
 public void BindSRV_RT(UInt32 index, CShaderResourceView SRV)
 {
     mSRVArray_RT[index] = SRV;
 }