@@ -144,7 +144,6 @@ struct onedraw
144144 struct
145145 {
146146 WGPUBuffer heads ;
147- WGPUComputePipeline clear_pso ;
148147 WGPUComputePipeline binning_pso ;
149148 WGPUComputePipeline write_indirect_buffer_pso ;
150149 WGPUBuffer counters ;
@@ -933,21 +932,7 @@ void build_pso(struct onedraw* r, WGPUTextureFormat surface_format)
933932 .label = WGPU_STRING_VIEW ("binning" )
934933 });
935934
936- WGPUComputePipelineDescriptor compute_pipeline_desc =
937- {
938- .layout = layout ,
939- .compute =
940- {
941- .module = shader ,
942- .entryPoint = WGPU_STRING_VIEW ("clear_heads" ),
943- .constants = NULL
944- }
945- };
946-
947- r -> tiles .clear_pso = wgpuDeviceCreateComputePipeline (r -> device , & compute_pipeline_desc );
948- assert_msg (r -> tiles .clear_pso != NULL , "can't create binning pso" );
949-
950- compute_pipeline_desc = (WGPUComputePipelineDescriptor )
935+ WGPUComputePipelineDescriptor compute_pipeline_desc = (WGPUComputePipelineDescriptor )
951936 {
952937 .layout = layout ,
953938 .compute =
@@ -1310,18 +1295,6 @@ void od_end_frame(struct onedraw* r, WGPUTextureView target_view)
13101295 // clear counter
13111296 wgpuCommandEncoderClearBuffer (encoder , r -> tiles .counters , 0 , sizeof (uint32_t ) * 2 );
13121297
1313- // clear heads pass
1314- {
1315- WGPUComputePassDescriptor desc = {.label = WGPU_STRING_VIEW ("clear_heads pass" )};
1316- WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass (encoder , & desc );
1317- wgpuComputePassEncoderSetPipeline (pass , r -> tiles .clear_pso );
1318- wgpuComputePassEncoderSetBindGroup (pass , 0 , r -> binding .binning_bindgroup , 0 , NULL );
1319- wgpuComputePassEncoderSetBindGroup (pass , 1 , r -> binding .frame_bindgroup [buffer_index ], 0 , NULL );
1320- wgpuComputePassEncoderDispatchWorkgroups (pass , r -> tiles .num_width * r -> tiles .num_height , 1 , 1 );
1321- wgpuComputePassEncoderEnd (pass );
1322- wgpuComputePassEncoderRelease (pass );
1323- }
1324-
13251298 // binning pass
13261299 {
13271300 WGPUComputePassDescriptor desc = {.label = WGPU_STRING_VIEW ("binning pass" )};
@@ -1418,6 +1391,8 @@ void od_terminate(struct onedraw* r)
14181391 SAFE_RELEASE (r -> tiles .nodes , wgpuBufferRelease );
14191392 SAFE_RELEASE (r -> tiles .heads , wgpuBufferRelease );
14201393 SAFE_RELEASE (r -> rasterizer .pso , wgpuRenderPipelineRelease );
1394+ SAFE_RELEASE (r -> tiles .binning_pso , wgpuComputePipelineRelease );
1395+ SAFE_RELEASE (r -> tiles .write_indirect_buffer_pso , wgpuComputePipelineRelease );
14211396 r -> mem_interface .free_fn (r , r -> mem_interface .user );
14221397}
14231398
0 commit comments