@@ -305,7 +305,7 @@ fn align_up_u32(value: u32, alignment: u32) -> u32 {
305305
306306/// Validate immediate ranges and calculate the minimum allocation size.
307307///
308- /// wgpu v28 uses a single byte region of size `immediate_size`, addressed by
308+ /// wgpu uses a single byte region of size `immediate_size`, addressed by
309309/// `set_immediates(offset, data)`. This function enforces that the provided
310310/// ranges:
311311/// - Start at byte offset 0 (as a union)
@@ -408,10 +408,13 @@ impl<'a> PipelineLayoutBuilder<'a> {
408408
409409 /// Build the layout.
410410 pub fn build ( self , gpu : & Gpu ) -> PipelineLayout {
411- let layouts_raw: Vec < & wgpu:: BindGroupLayout > =
412- self . layouts . iter ( ) . map ( |l| l. raw ( ) ) . collect ( ) ;
411+ let layouts_raw: Vec < Option < & wgpu:: BindGroupLayout > > = self
412+ . layouts
413+ . iter ( )
414+ . map ( |layout| Some ( layout. raw ( ) ) )
415+ . collect ( ) ;
413416
414- // wgpu v28 allocates a single immediate byte region sized by
417+ // wgpu allocates a single immediate byte region sized by
415418 // `PipelineLayoutDescriptor::immediate_size`. If callers provide multiple
416419 // ranges, they are treated as sub-ranges of the same contiguous allocation.
417420 //
@@ -442,7 +445,7 @@ impl<'a> PipelineLayoutBuilder<'a> {
442445 . device ( )
443446 . create_pipeline_layout ( & wgpu:: PipelineLayoutDescriptor {
444447 label : self . label . as_deref ( ) ,
445- bind_group_layouts : & layouts_raw,
448+ bind_group_layouts : layouts_raw. as_slice ( ) ,
446449 immediate_size,
447450 } ) ;
448451 if fallback_used {
@@ -625,8 +628,8 @@ impl<'a> RenderPipelineBuilder<'a> {
625628 pub fn with_depth_stencil ( mut self , format : DepthFormat ) -> Self {
626629 self . depth_stencil = Some ( wgpu:: DepthStencilState {
627630 format : format. to_wgpu ( ) ,
628- depth_write_enabled : true ,
629- depth_compare : wgpu:: CompareFunction :: Less ,
631+ depth_write_enabled : Some ( true ) ,
632+ depth_compare : Some ( wgpu:: CompareFunction :: Less ) ,
630633 stencil : wgpu:: StencilState :: default ( ) ,
631634 bias : wgpu:: DepthBiasState :: default ( ) ,
632635 } ) ;
@@ -637,34 +640,34 @@ impl<'a> RenderPipelineBuilder<'a> {
637640 pub fn with_depth_compare ( mut self , compare : CompareFunction ) -> Self {
638641 let ds = self . depth_stencil . get_or_insert ( wgpu:: DepthStencilState {
639642 format : wgpu:: TextureFormat :: Depth32Float ,
640- depth_write_enabled : true ,
641- depth_compare : wgpu:: CompareFunction :: Less ,
643+ depth_write_enabled : Some ( true ) ,
644+ depth_compare : Some ( wgpu:: CompareFunction :: Less ) ,
642645 stencil : wgpu:: StencilState :: default ( ) ,
643646 bias : wgpu:: DepthBiasState :: default ( ) ,
644647 } ) ;
645- ds. depth_compare = compare. to_wgpu ( ) ;
648+ ds. depth_compare = Some ( compare. to_wgpu ( ) ) ;
646649 return self ;
647650 }
648651
649652 /// Enable or disable depth writes. Requires depth-stencil enabled.
650653 pub fn with_depth_write_enabled ( mut self , enabled : bool ) -> Self {
651654 let ds = self . depth_stencil . get_or_insert ( wgpu:: DepthStencilState {
652655 format : wgpu:: TextureFormat :: Depth32Float ,
653- depth_write_enabled : true ,
654- depth_compare : wgpu:: CompareFunction :: Less ,
656+ depth_write_enabled : Some ( true ) ,
657+ depth_compare : Some ( wgpu:: CompareFunction :: Less ) ,
655658 stencil : wgpu:: StencilState :: default ( ) ,
656659 bias : wgpu:: DepthBiasState :: default ( ) ,
657660 } ) ;
658- ds. depth_write_enabled = enabled;
661+ ds. depth_write_enabled = Some ( enabled) ;
659662 return self ;
660663 }
661664
662665 /// Configure stencil state (front/back ops and masks). Requires depth-stencil enabled.
663666 pub fn with_stencil ( mut self , stencil : StencilState ) -> Self {
664667 let ds = self . depth_stencil . get_or_insert ( wgpu:: DepthStencilState {
665668 format : wgpu:: TextureFormat :: Depth24PlusStencil8 ,
666- depth_write_enabled : true ,
667- depth_compare : wgpu:: CompareFunction :: Less ,
669+ depth_write_enabled : Some ( true ) ,
670+ depth_compare : Some ( wgpu:: CompareFunction :: Less ) ,
668671 stencil : wgpu:: StencilState :: default ( ) ,
669672 bias : wgpu:: DepthBiasState :: default ( ) ,
670673 } ) ;
0 commit comments