public void CreateSRV(D3D11RenderTarget rt) { if (m_srv != null) { m_srv.Dispose(); m_srv = null; } var texture = rt.Texture; m_srv = new ShaderResourceView(texture.Device, texture); }
public D3D11RenderTarget CreateRenderTarget(D3D11Device device) { // New RenderTargetView from the backbuffer var backBuffer = Texture2D.FromSwapChain <Texture2D>(m_swapChain, 0); backBuffer.DebugName = "backBuffer"; var rt = new D3D11RenderTarget(); rt.CreateFromTexture(backBuffer, m_swapChain.Description.SampleDescription.Count, m_swapChain.Description.SampleDescription.Quality); return(rt); }