@@ -615,19 +615,27 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
615615 offset : wgt:: BufferAddress ,
616616 draw_count : u32 ,
617617 ) {
618- self . device
619- . raw
620- . cmd_draw_indirect ( self . active , buffer. raw , offset, draw_count, 0 ) ;
618+ self . device . raw . cmd_draw_indirect (
619+ self . active ,
620+ buffer. raw ,
621+ offset,
622+ draw_count,
623+ mem:: size_of :: < wgt:: DrawIndirectArgs > ( ) as u64 ,
624+ ) ;
621625 }
622626 unsafe fn draw_indexed_indirect (
623627 & mut self ,
624628 buffer : & super :: Buffer ,
625629 offset : wgt:: BufferAddress ,
626630 draw_count : u32 ,
627631 ) {
628- self . device
629- . raw
630- . cmd_draw_indexed_indirect ( self . active , buffer. raw , offset, draw_count, 0 ) ;
632+ self . device . raw . cmd_draw_indexed_indirect (
633+ self . active ,
634+ buffer. raw ,
635+ offset,
636+ draw_count,
637+ mem:: size_of :: < wgt:: DrawIndexedIndirectArgs > ( ) as u64 ,
638+ ) ;
631639 }
632640 unsafe fn draw_indirect_count (
633641 & mut self ,
@@ -637,6 +645,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
637645 count_offset : wgt:: BufferAddress ,
638646 max_count : u32 ,
639647 ) {
648+ let stride = mem:: size_of :: < wgt:: DrawIndirectArgs > ( ) as u64 ;
640649 match self . device . extension_fns . draw_indirect_count {
641650 Some ( super :: ExtensionFn :: Extension ( ref t) ) => {
642651 t. cmd_draw_indirect_count (
@@ -646,7 +655,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
646655 count_buffer. raw ,
647656 count_offset,
648657 max_count,
649- 0 ,
658+ stride ,
650659 ) ;
651660 }
652661 Some ( super :: ExtensionFn :: Promoted ) => {
@@ -657,7 +666,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
657666 count_buffer. raw ,
658667 count_offset,
659668 max_count,
660- 0 ,
669+ stride ,
661670 ) ;
662671 }
663672 None => panic ! ( "Feature `DRAW_INDIRECT_COUNT` not enabled" ) ,
@@ -671,6 +680,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
671680 count_offset : wgt:: BufferAddress ,
672681 max_count : u32 ,
673682 ) {
683+ let stride = mem:: size_of :: < wgt:: DrawIndexedIndirectArgs > ( ) as u64 ;
674684 match self . device . extension_fns . draw_indirect_count {
675685 Some ( super :: ExtensionFn :: Extension ( ref t) ) => {
676686 t. cmd_draw_indexed_indirect_count (
@@ -680,7 +690,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
680690 count_buffer. raw ,
681691 count_offset,
682692 max_count,
683- 0 ,
693+ stride ,
684694 ) ;
685695 }
686696 Some ( super :: ExtensionFn :: Promoted ) => {
@@ -691,7 +701,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
691701 count_buffer. raw ,
692702 count_offset,
693703 max_count,
694- 0 ,
704+ stride ,
695705 ) ;
696706 }
697707 None => panic ! ( "Feature `DRAW_INDIRECT_COUNT` not enabled" ) ,
0 commit comments