Skip to content

Commit 8f0dbcc

Browse files
authored
Changed image-blur refresh logic (#294)
1 parent 02d4c73 commit 8f0dbcc

File tree

1 file changed

+8
-7
lines changed
  • apps/typegpu-docs/src/content/examples/image-processing

1 file changed

+8
-7
lines changed

apps/typegpu-docs/src/content/examples/image-processing/blur.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
// https://webgpu.github.io/webgpu-samples/?sample=imageBlur
1010

1111
// -- Hooks into the example environment
12-
import {
13-
addElement,
14-
addSliderPlumParameter,
15-
onFrame,
16-
} from '@typegpu/example-toolkit';
12+
import { addElement, addSliderPlumParameter } from '@typegpu/example-toolkit';
1713
// --
1814
import {
1915
arrayOf,
@@ -254,7 +250,7 @@ const renderPipeline = runtime.makeRenderPipeline({
254250
},
255251
});
256252

257-
onFrame(() => {
253+
const render = () => {
258254
computePipelines[0].execute({
259255
workgroups: [
260256
Math.ceil(srcWidth / runtime.readPlum(settingsPlum).blockDim),
@@ -295,4 +291,9 @@ onFrame(() => {
295291
});
296292

297293
runtime.flush();
298-
});
294+
};
295+
296+
render();
297+
298+
runtime.onPlumChange(filterSize, () => render());
299+
runtime.onPlumChange(iterations, () => render());

0 commit comments

Comments
 (0)