Skip to content

Commit

Permalink
hal/dx12: reset scissor and viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Jul 15, 2021
1 parent a4a90c0 commit b98cba9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions wgpu-hal/src/dx12/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,25 @@ impl crate::CommandEncoder<super::Api> 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();
Expand Down

0 comments on commit b98cba9

Please sign in to comment.