From b98cba9bfdd977cc6c02d157ee794c77b47beb2d Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 15 Jul 2021 01:58:35 -0400 Subject: [PATCH] hal/dx12: reset scissor and viewport --- wgpu-hal/src/dx12/command.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wgpu-hal/src/dx12/command.rs b/wgpu-hal/src/dx12/command.rs index 2f1cab0376..ce74685b5d 100644 --- a/wgpu-hal/src/dx12/command.rs +++ b/wgpu-hal/src/dx12/command.rs @@ -527,7 +527,25 @@ impl crate::CommandEncoder for super::CommandEncoder { ); } } + + let raw_vp = d3d12::D3D12_VIEWPORT { + TopLeftX: 0.0, + TopLeftY: 0.0, + Width: desc.extent.width as f32, + Height: desc.extent.height as f32, + MinDepth: 0.0, + MaxDepth: 1.0, + }; + let raw_rect = d3d12::D3D12_RECT { + left: 0, + top: 0, + right: desc.extent.width as i32, + bottom: desc.extent.height as i32, + }; + list.RSSetViewports(1, &raw_vp); + list.RSSetScissorRects(1, &raw_rect); } + unsafe fn end_render_pass(&mut self) { if !self.pass.resolves.is_empty() { let list = self.list.unwrap();