File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
apps/typegpu-docs/src/content/examples/image-processing Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 9
9
// https://webgpu.github.io/webgpu-samples/?sample=imageBlur
10
10
11
11
// -- 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' ;
17
13
// --
18
14
import {
19
15
arrayOf ,
@@ -254,7 +250,7 @@ const renderPipeline = runtime.makeRenderPipeline({
254
250
} ,
255
251
} ) ;
256
252
257
- onFrame ( ( ) => {
253
+ const render = ( ) => {
258
254
computePipelines [ 0 ] . execute ( {
259
255
workgroups : [
260
256
Math . ceil ( srcWidth / runtime . readPlum ( settingsPlum ) . blockDim ) ,
@@ -295,4 +291,9 @@ onFrame(() => {
295
291
} ) ;
296
292
297
293
runtime . flush ( ) ;
298
- } ) ;
294
+ } ;
295
+
296
+ render ( ) ;
297
+
298
+ runtime . onPlumChange ( filterSize , ( ) => render ( ) ) ;
299
+ runtime . onPlumChange ( iterations , ( ) => render ( ) ) ;
You can’t perform that action at this time.
0 commit comments