xiaoiver / infinite-canvas-tutorial

A tutorial on infinite canvas
https://infinitecanvas.cc
72 stars 6 forks source link

fwidth will throw an error in WebGPU renderer #6

Closed xiaoiver closed 1 month ago

xiaoiver commented 1 month ago

SDF in Lesson9 will throw the following error:

Error while parsing WGSL: :116:16 error: 'fwidth' must only be called from uniform control flow
    let _e16 = fwidth(_e15);
xiaoiver commented 1 month ago

Turn off diagnostic for now in WGSL.

const diagnosticDerivativeUniformityHeader =
      this.device.queryVendorInfo().platformString === 'WebGPU'
        ? 'diagnostic(off,derivative_uniformity);'
        : '';