private void Render(DirectXResource input, DirectXDownloaderPlaneData plane, DeviceContext ctx) { using (var srv = input.GetShaderResourceView()) using (var rtv = plane.GpuTexture.GetRenderTargetView()) { plane.Pipeline.Render(ctx, rtv, srv); } }
private FramePlaneDesc Map(DirectXResource input, DirectXDownloaderPlaneData plane, DeviceContext ctx) { ctx.CopyResource(plane.GpuTexture.Texture2D, plane.CpuTexture.Texture2D); var db = ctx.MapSubresource(plane.CpuTexture.Texture2D, 0, MapMode.Read, SharpDX.Direct3D11.MapFlags.None); return(new FramePlaneDesc { Data = db.DataPointer, Stride = db.RowPitch, StrideCount = _height / plane.Format.HeightFactor }); }
private void Unmap(DirectXDownloaderPlaneData p, DeviceContext ctx) { ctx.UnmapSubresource(p.CpuTexture.Texture2D, 0); }