webgpu / webgpu-samples

WebGPU Samples
https://webgpu.github.io/webgpu-samples/
BSD 3-Clause "New" or "Revised" License
1.74k stars 297 forks source link

A few minor issues in imageBlur #438

Open mkvenkit opened 1 month ago

mkvenkit commented 1 month ago

Thanks for the interesting sample!

I noticed these minor issues:

  1. buffer0 and buffer1 in main.ts are associated with flip in the the shader, but where are these buffers being written to? I didn't see associated buffer write calls.
  2. samp seems unused in the shader.
  3. cubeTexture - naming is a little confusing.
greggman commented 1 month ago
  1. buffer0 and buffer1 in main.ts are associated with flip in the the shader, but where are these buffers being written to? I didn't see associated buffer write calls.

They are set when they are created using mappedAtCreation, calling getMappedRange(), setting the value, and then unmaping.

One or the other is bound to flip. Bind buffer0 to not flip, bind buffer1 to flip. They don't need to be updated.

  1. samp seems unused in the shader.

samp is used, line 52 of blur.wsgl

  1. cubeTexture - naming is a little confusing.

Agreed. Will rename

mkvenkit commented 1 month ago

They are set when they are created using mappedAtCreation, calling getMappedRange(), setting the value, and then unmaping.

Sorry, missed that. Thanks for the quick response!