File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ pub fn main(
34
34
1.0 ,
35
35
) ;
36
36
37
- unsafe { output_buffer. write ( global_ix. truncate ( ) , frag_color) }
37
+ // Without the int8 capability, can't use bools
38
+ // A better choice might be to just enable the int8 capability
39
+ if global_ix. x < config. width {
40
+ if global_ix. y < config. height {
41
+ unsafe { output_buffer. write ( global_ix. truncate ( ) , frag_color) }
42
+ }
43
+ }
38
44
}
39
45
40
46
// A simple vert/frag shader to copy an image to the swapchain.
Original file line number Diff line number Diff line change @@ -334,7 +334,8 @@ impl State {
334
334
cpass. set_pipeline ( & self . pipelines . compute_pipeline ) ;
335
335
cpass. set_push_constants ( 0 , bytemuck:: bytes_of ( & config) ) ;
336
336
cpass. set_bind_group ( 0 , & self . compute_bind_group , & [ ] ) ;
337
- cpass. dispatch ( size. width / 16 , size. height / 16 , 1 ) ;
337
+ // Round up to next multiple
338
+ cpass. dispatch ( ( size. width + 16 - 1 ) / 16 , ( size. height + 16 - 1 ) / 16 , 1 ) ;
338
339
}
339
340
{
340
341
let mut rpass = encoder. begin_render_pass ( & wgpu:: RenderPassDescriptor {
You can’t perform that action at this time.
0 commit comments