title: Understanding of Buffer index in compute shader
body: <p>compute shader script:</p>
  <pre><code>#pragma kernel CSMain
  RWStructuredBuffer&lt;int&gt; result;
   
  [numthreads(8, 8, 8)]
  void CSMain(int id : SV_DispatchThreadID )
  {
      result[id] = id;
  }
  </code></pre>
  <p>c# script:</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class ForTesting : MonoBehaviour
  {
      public ComputeShader compute;
   
      // Use this for initialization
      void Start()
      {
          ComputeBuffer resultBuffer = new ComputeBuffer(8*8*8, sizeof(int));
       
          var kernel = compute.FindKernel(&quot;CSMain&quot;);
          compute.SetBuffer(kernel, &quot;result&quot;, resultBuffer);
          compute.Dispatch(kernel,1,1,1);
   
          int[] result = new int[8 * 8 * 8];
          resultBuffer.GetData(result);
     
          resultBuffer.Release();
      }
  }
  
  </code></pre>
  <p>These are testing code for what value is in a result.
  I don't understand result[id] = id; line.</p>
  <p>Exactly, <code>result[id]</code>. Accessing with index to buffer.</p>
  <p>And while google, I saw a post saying that the shader function is executed as many as the number of threads.</p>
  <p>Then in above case, cause numthreads(8, 8, 8) and Dispatch(kernel, 1, 1, 1), Does CSMain function run 8 * 8 * 8 * 1 * 1 * 1 times?</p>