Skip to content

Commit

Permalink
Merge #3282
Browse files Browse the repository at this point in the history
3282: Allow DX12 Backend to work with strides of 0 r=kvark a=cwfitzgerald

So this fixes the problem gfx-rs/wgpu#754 was working around, but found a much more interesting problem:

- DX12 _must_ have a stride of 16/20, the value of the stride is ignored other than the assert. This isn't a problem from the wgpu perspective (we assume tightly packed), but would have issues for gfx-portability.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
  • Loading branch information
bors[bot] and cwfitzgerald authored Jun 28, 2020
2 parents 6faf27a + a3330b0 commit 4b25f06
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/backend/dx12/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2477,7 +2477,9 @@ impl com::CommandBuffer<Backend> for CommandBuffer {
draw_count: DrawCount,
stride: u32,
) {
assert_eq!(stride, 16);
if stride != 0 {
assert_eq!(stride, 16);
}
let buffer = buffer.expect_bound();
self.set_graphics_bind_point();
self.raw.ExecuteIndirect(
Expand All @@ -2497,7 +2499,9 @@ impl com::CommandBuffer<Backend> for CommandBuffer {
draw_count: DrawCount,
stride: u32,
) {
assert_eq!(stride, 20);
if stride != 0 {
assert_eq!(stride, 20);
}
let buffer = buffer.expect_bound();
self.set_graphics_bind_point();
self.raw.ExecuteIndirect(
Expand All @@ -2519,7 +2523,9 @@ impl com::CommandBuffer<Backend> for CommandBuffer {
max_draw_count: DrawCount,
stride: u32
) {
assert_eq!(stride, 16);
if stride != 0 {
assert_eq!(stride, 16);
}
let buffer = buffer.expect_bound();
let count_buffer = count_buffer.expect_bound();
self.set_graphics_bind_point();
Expand All @@ -2542,7 +2548,9 @@ impl com::CommandBuffer<Backend> for CommandBuffer {
max_draw_count: DrawCount,
stride: u32
) {
assert_eq!(stride, 20);
if stride != 0 {
assert_eq!(stride, 20);
}
let buffer = buffer.expect_bound();
let count_buffer = count_buffer.expect_bound();
self.set_graphics_bind_point();
Expand Down

0 comments on commit 4b25f06

Please sign in to comment.