protected override void OnUpdate(DX11RenderContext context) { if (this.resetbuffers || !this.FOutBuffers[0].Contains(context)) { this.DisposeBuffers(context); for (int i = 0; i < this.FInTargetCount[0]; i++) { DX11RenderTarget2D rt = new DX11RenderTarget2D(context, this.width, this.height, this.sd, DeviceFormatHelper.GetFormat(this.FInFormat[i].Name), this.genmipmap, this.mipmaplevel); #if DEBUG rt.Resource.DebugName = "MRTRenderTexture"; #endif this.FOutBuffers[i][context] = rt; } } }
public DX11RenderTarget2D(DxDevice device, DX11RenderTarget2D renderTarget) : this(device, renderTarget.Width, renderTarget.Height, renderTarget.resourceDesc.SampleDescription, renderTarget.Format) { }
public void Unlock(DX11RenderTarget2D target) { this.targetpool.UnLock(target); }
public void Update(IPluginIO pin, DX11RenderContext context) { Device device = context.Device; if (this.spmax == 0) { return; } if (this.updateddevices.Contains(context)) { return; } if (!this.FOutTexture[0].Contains(context)) { for (int i = 0; i < this.FInElementCount[0]; i++) { var rt = new DX11RenderTarget2D(context, (int)this.FInSize[i].X, (int)this.FInSize[i].Y, new SampleDescription(1, 0), DeviceFormatHelper.GetFormat(this.FInFormat[i]), this.FInMips[i], 0, false, false); this.FOutTexture[i][context] = rt; if (this.FInDepthBuffer[0]) { Format depthfmt = DeviceFormatHelper.GetFormat(this.depthformatpin[0].Name); var db = new DX11DepthStencil(context, (int)this.FInSize[i].X, (int)this.FInSize[i].Y, new SampleDescription(1, 0), depthfmt); this.FOutDepthTexture[i][context] = db; } } } this.updateddevices.Add(context); }