From a3330b072ef90cc5b17f2362e709554112878b4b Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Sat, 27 Jun 2020 20:39:26 -0400 Subject: [PATCH] Allow DX12 Backend to work with strides of 0 --- src/backend/dx12/src/command.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/backend/dx12/src/command.rs b/src/backend/dx12/src/command.rs index 448838c6d8b..c03b4cdc9f3 100644 --- a/src/backend/dx12/src/command.rs +++ b/src/backend/dx12/src/command.rs @@ -2477,7 +2477,9 @@ impl com::CommandBuffer 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( @@ -2497,7 +2499,9 @@ impl com::CommandBuffer 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( @@ -2519,7 +2523,9 @@ impl com::CommandBuffer 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(); @@ -2542,7 +2548,9 @@ impl com::CommandBuffer 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();