@@ -40,10 +40,10 @@ impl GaussianRenderer {
4040 let pipeline_layout = device. create_pipeline_layout ( & wgpu:: PipelineLayoutDescriptor {
4141 label : Some ( "render pipeline layout" ) ,
4242 bind_group_layouts : & [
43- & PointCloud :: bind_group_layout_render ( device) , // Needed for points_2d (on binding 2)
44- & GPURSSorter :: bind_group_layout_rendering ( device) , // Needed for indices (on binding 4)
43+ Some ( & PointCloud :: bind_group_layout_render ( device) ) , // Needed for points_2d (on binding 2)
44+ Some ( & GPURSSorter :: bind_group_layout_rendering ( device) ) , // Needed for indices (on binding 4)
4545 ] ,
46- push_constant_ranges : & [ ] ,
46+ immediate_size : 0 ,
4747 } ) ;
4848
4949 let shader = device. create_shader_module ( wgpu:: include_wgsl!( "shaders/gaussian.wgsl" ) ) ;
@@ -62,7 +62,21 @@ impl GaussianRenderer {
6262 entry_point : Some ( "fs_main" ) ,
6363 targets : & [ Some ( wgpu:: ColorTargetState {
6464 format : color_format,
65- blend : Some ( wgpu:: BlendState :: PREMULTIPLIED_ALPHA_BLENDING ) ,
65+ // front to back blending
66+ // this gives better visuals compared to back to front blending
67+ // if used with 8 bit textures
68+ blend : Some ( wgpu:: BlendState {
69+ color : wgpu:: BlendComponent {
70+ src_factor : wgpu:: BlendFactor :: OneMinusDstAlpha ,
71+ dst_factor : wgpu:: BlendFactor :: One ,
72+ operation : wgpu:: BlendOperation :: Add ,
73+ } ,
74+ alpha : wgpu:: BlendComponent {
75+ src_factor : wgpu:: BlendFactor :: OneMinusDstAlpha ,
76+ dst_factor : wgpu:: BlendFactor :: One ,
77+ operation : wgpu:: BlendOperation :: Add ,
78+ } ,
79+ } ) ,
6680 write_mask : wgpu:: ColorWrites :: ALL ,
6781 } ) ] ,
6882 compilation_options : Default :: default ( ) ,
@@ -78,8 +92,8 @@ impl GaussianRenderer {
7892 } ,
7993 depth_stencil : None ,
8094 multisample : wgpu:: MultisampleState :: default ( ) ,
81- multiview : None ,
8295 cache : None ,
96+ multiview_mask : None ,
8397 } ) ;
8498
8599 let draw_indirect_buffer = device. create_buffer ( & wgpu:: BufferDescriptor {
@@ -349,16 +363,18 @@ impl PreprocessPipeline {
349363 let pipeline_layout = device. create_pipeline_layout ( & wgpu:: PipelineLayoutDescriptor {
350364 label : Some ( "preprocess pipeline layout" ) ,
351365 bind_group_layouts : & [
352- & UniformBuffer :: < CameraUniform > :: bind_group_layout ( device) ,
353- & if !compressed {
366+ Some ( & UniformBuffer :: < CameraUniform > :: bind_group_layout ( device) ) ,
367+ Some ( & if !compressed {
354368 PointCloud :: bind_group_layout ( device)
355369 } else {
356370 PointCloud :: bind_group_layout_compressed ( device)
357- } ,
358- & GPURSSorter :: bind_group_layout_preprocess ( device) ,
359- & UniformBuffer :: < SplattingArgsUniform > :: bind_group_layout ( device) ,
371+ } ) ,
372+ Some ( & GPURSSorter :: bind_group_layout_preprocess ( device) ) ,
373+ Some ( & UniformBuffer :: < SplattingArgsUniform > :: bind_group_layout (
374+ device,
375+ ) ) ,
360376 ] ,
361- push_constant_ranges : & [ ] ,
377+ immediate_size : 0 ,
362378 } ) ;
363379
364380 let shader = device. create_shader_module ( wgpu:: ShaderModuleDescriptor {
@@ -432,11 +448,13 @@ impl Display {
432448 let pipeline_layout = device. create_pipeline_layout ( & wgpu:: PipelineLayoutDescriptor {
433449 label : Some ( "display pipeline layout" ) ,
434450 bind_group_layouts : & [
435- & Self :: bind_group_layout ( device) ,
436- & UniformBuffer :: < CameraUniform > :: bind_group_layout ( device) ,
437- & UniformBuffer :: < SplattingArgsUniform > :: bind_group_layout ( device) ,
451+ Some ( & Self :: bind_group_layout ( device) ) ,
452+ Some ( & UniformBuffer :: < CameraUniform > :: bind_group_layout ( device) ) ,
453+ Some ( & UniformBuffer :: < SplattingArgsUniform > :: bind_group_layout (
454+ device,
455+ ) ) ,
438456 ] ,
439- push_constant_ranges : & [ ] ,
457+ immediate_size : 0 ,
440458 } ) ;
441459 let shader = device. create_shader_module ( include_wgsl ! ( "shaders/display.wgsl" ) ) ;
442460 let pipeline = device. create_render_pipeline ( & wgpu:: RenderPipelineDescriptor {
@@ -464,7 +482,7 @@ impl Display {
464482 } ) ] ,
465483 compilation_options : Default :: default ( ) ,
466484 } ) ,
467- multiview : None ,
485+ multiview_mask : None ,
468486 cache : None ,
469487 } ) ;
470488 let ( view, bind_group) = Self :: create_render_target ( device, source_format, width, height) ;
0 commit comments