gpujs / gpu.js

GPU Accelerated JavaScript
https://gpu.rocks
MIT License
15.1k stars 652 forks source link

Combining GPU kernels error: 'cannot read property 'kernel' of undefined #662

Open joshbrew opened 3 years ago

joshbrew commented 3 years ago

Error:

Uncaught TypeError: Cannot read property 'kernel' of undefined
    at GPU.combineKernels (gpu-browser.js:18522)
    at gpuUtils.addFunctions (gpu-browser.js:14)
    at new gpuUtils (gpu-browser.js:14)
    at Object.parcelRequire.js/utils/eegworker.js../gpuUtils.js (gpu-browser.js:14)
    at newRequire (gpuUtils-functs.js:31)
    at eegworker.js:54
    at gpuUtils.js:129

Code: This is within a class where I am assigning functions to "this." variables. I've tried this without the named function with the same result

    //Bandpass FFT+iFFT to return a cleaned up waveform
    const signalBandpass = (signal, sampleRate, freqStart, freqEnd, scalar) => { //Returns the signal wave with the bandpass filter applied
      var dft = this.fft_windowed(signal, sampleRate, freqStart, freqEnd, scalar);
      var filtered_signal = this.ifft_windowed(dft, sampleRate, freqStart, freqEnd, scalar); 
      return filtered_signal;
    }
    this.signalBandpass = this.gpu.combineKernels(this.dft_windowedKern,this.idft_windowedKern, signalBandpass);