title: What does square brackets operator do in HLSL
body: <p>I'm working on porting our application from Windows to Linux and I need to understand what does operator [] do in HLSL and how to port in to GLSL.</p>
  
  <p>I have code like this:</p>
  
  <pre class="lang-c prettyprint-override"><code>red = texture.Sample(sampler, uv)[x];
  </code></pre>
  
  <p>Sample function should return a pixel value, right? Is x a kind of offset?</p>