title: Bilateral Grid with OpenGL/GLSL schedule
body: <p>I am trying to re-implement the bilateral grid example with multi-channel input/output(3 channels image). And try to use the OpenGL/GLSL schedule. Here is the code segments that I wrote. </p>
  
  <pre><code>class BilateralGrid : public Halide::Generator&lt;BilateralGrid&gt; {
  public:
  GeneratorParam&lt;int&gt;   s_sigma{"s_sigma", 8};
  
  ImageParam            input{Float(32), 3, "input"};
  Param&lt;float&gt;          r_sigma{"r_sigma"};
  
  Func build() {
      Var x("x"), y("y"), z("z"), c("c"), ch("ch");
  
       ...         
  
      Func histogram("histogram");
      histogram(x, y, ch, z, c) = 0.0f;
      histogram(x, y, ch, zi, c) += select(c == 0, val, 1.0f);
  
      ...
  
      input.dim(2).set_bounds(0,3);
      bilateral_grid.bound(ch, 0 ,3);
      bilateral_grid.glsl(x , y, ch);
  
      return bilateral_grid;
      }
  };
  
  Halide::RegisterGenerator&lt;BilateralGrid&gt; register_me{"bilateral_grid"};
  </code></pre>
  
  <p>But I've got an error when trying to compile the code.</p>
  
  <pre><code>Error
  Allocations inside GLSL kernels must be constant-sized
  </code></pre>
  
  <p>In my limited experience with halide,  I can't find why...</p>
  
  <p>Thanks in advance.</p>