Skip to content

Commit

Permalink
Merge #1664
Browse files Browse the repository at this point in the history
1664: hal/dx12: reset scissor and viewport r=kvark a=kvark

**Connections**
Follow-up to #1602 that actually makes it render!

**Description**
"hello-triange" and "msaa-line" examples work now.
Everything else is blocked on Naga's HLSL output, starting from gfx-rs/naga#1086

**Testing**
Ran the examples :)


Co-authored-by: Dzmitry Malyshau <[email protected]>
  • Loading branch information
bors[bot] and kvark authored Jul 15, 2021
2 parents a4a90c0 + b98cba9 commit e1392a3
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 e1392a3

Please sign in to comment.