Skip to content

Commit 42bd5c1

Browse files
authored
core(gpu): Fix Floyd-Steinberg dithering errors & performance issues (#61)
1 parent d98400d commit 42bd5c1

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

core/src/gpu/compute.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -305,28 +305,12 @@ impl Processor {
305305
match config.mapping {
306306
Mapping::Palettized => {
307307
compute_pass.set_pipeline(&self.context.palettized_pipeline);
308+
compute_pass.set_bind_group(1, &self.context.blue_noise_bind_group, &[]);
308309
match config.dither_algorithm {
309310
Dithering::Fs => {
310311
compute_pass.dispatch_workgroups(1, 1, 1);
311312
}
312-
Dithering::Bn => {
313-
compute_pass.set_bind_group(
314-
1,
315-
&self.context.blue_noise_bind_group,
316-
&[],
317-
);
318-
let dispatch_x =
319-
gpu_chunk_config.image_width.div_ceil(WORKGROUP_SIZE_X);
320-
let dispatch_y =
321-
gpu_chunk_config.image_height.div_ceil(WORKGROUP_SIZE_Y);
322-
compute_pass.dispatch_workgroups(dispatch_x, dispatch_y, 1);
323-
}
324-
Dithering::None => {
325-
compute_pass.set_bind_group(
326-
1,
327-
&self.context.blue_noise_bind_group,
328-
&[],
329-
);
313+
Dithering::Bn | Dithering::None => {
330314
let dispatch_x =
331315
gpu_chunk_config.image_width.div_ceil(WORKGROUP_SIZE_X);
332316
let dispatch_y =

0 commit comments

Comments
 (0)