Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hal/dx12: reset scissor and viewport #1664

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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