protected override void BeforeRender(DX11GraphicsRenderer renderer, DX11RenderContext context) { renderer.EnableDepth = this.FInDepthBuffer[0]; renderer.DepthStencil = this.depthmanager.GetDepthStencil(context); renderer.DepthMode = this.depthmanager.Mode; renderer.SetRenderTargets(targets[context]); }
protected override void AfterRender(DX11GraphicsRenderer renderer, DX11RenderContext context) { if (this.genmipmap && this.sd.Count == 1) { for (int i = 0; i < this.FOutBuffers.SliceCount; i++) { context.CurrentDeviceContext.GenerateMips(this.FOutBuffers[i][context].SRV); } } }
protected override void BeforeRender(DX11GraphicsRenderer renderer, DX11RenderContext context) { IDX11RenderTargetView[] rtvs = new IDX11RenderTargetView[this.FOutBuffers.SliceCount]; for (int i = 0; i < this.FOutBuffers.SliceCount;i++) { rtvs[i] = this.FOutBuffers[i][context]; } renderer.EnableDepth = this.FInDepthBuffer[0]; renderer.DepthStencil = this.depthmanager.GetDepthStencil(context); renderer.DepthMode = this.depthmanager.Mode; renderer.SetRenderTargets(rtvs); }
protected override void AfterRender(DX11GraphicsRenderer renderer, DX11RenderContext context) { if (this.sd.Count > 1) { context.CurrentDeviceContext.ResolveSubresource(targets[context].Resource, 0, targetresolve[context].Resource, 0, targets[context].Format); } if (this.genmipmap && this.sd.Count == 1) { for (int i = 0; i < this.FOutBuffers.SliceCount; i++) { context.CurrentDeviceContext.GenerateMips(targets[context].SRV); } } }
protected override void BeforeRender(DX11GraphicsRenderer renderer, DX11RenderContext OnDevice) { }
public void Update(IPluginIO pin, DX11RenderContext context) { Device device = context.Device; if (this.updateddevices.Contains(context)) { return; } SampleDescription sd = new SampleDescription(1, 0); if (this.FResized || this.FInvalidateSwapChain || this.swapchain == null) { if (this.swapchain != null) { this.swapchain.Dispose(); } this.swapchain = new DX11SwapChain(context, this.form.Handle, Format.R8G8B8A8_UNorm, sd,this.FInRate[0],1); } if (this.renderer == null) { this.renderer = new DX11GraphicsRenderer(this.FHost, context); } this.updateddevices.Add(context); if (this.FInFullScreen[0] != this.swapchain.IsFullScreen) { if (this.FInFullScreen[0]) { this.prevx = this.form.Width; this.prevy = this.form.Height; /*Screen screen = Screen.FromControl(this.form);*/ this.form.FormBorderStyle = FormBorderStyle.None; this.form.Width = Convert.ToInt32(this.FInRes[0].X); this.form.Height = Convert.ToInt32(this.FInRes[0].Y); this.swapchain.Resize(); this.swapchain.SetFullScreen(true); this.setfull = false; } else { this.swapchain.SetFullScreen(false); this.form.FormBorderStyle = FormBorderStyle.Fixed3D; this.form.Width = this.prevx; this.form.Height = this.prevy; this.swapchain.Resize(); } } }
protected override void AfterRender(DX11GraphicsRenderer renderer, DX11RenderContext context) { }
protected abstract void BeforeRender(DX11GraphicsRenderer renderer, DX11RenderContext OnDevice);