title: Is there any DirectX 11 (HLSL 5.0) equivalent to the DirectX 9 texture "string function" syntax?
body: <p>I am currently working with the source code from the GPU Gems 2 book, and I'm attempting to convert the <a href="http://http.download.nvidia.com/developer/GPU_Gems_2/CD/Index.html" rel="nofollow noreferrer">Improved Perlin Noise implementation (Chapter 26)</a> to work with DirectX 11. Although relatively painless, the optimisations they've used have been a slight annoyance due to their use of textures to aid lookups. The original code uses a now seemingly defunct method to declare textures which I don't know how to convert to modern DirectX.</p>
  
  <p>An example of the type of texture declaration I'm meaning is:
  (from the inoise.fxh file)</p>
  
  <pre><code>texture permTexture
  &lt;
      string texturetype = "2D";
      string format = "l8";
      string function = "GeneratePermTexture";
      int width = 256, height = 1;
  &gt;;
  </code></pre>
  
  <p>The texture type, format, width and height I understand how to configure outside of the shader, the <code>string function = "GeneratePermTexture"</code> part though has thrown me. </p>
  
  <p>The function it's referring to: (in the same file)</p>
  
  <pre><code>float4 GeneratePermTexture(float p : POSITION) : COLOR
  {
      return permutation[p*256] / 255.0;
  }
  </code></pre>
  
  <p>There's a comment above this section of the file (which contains more of these functions for their respective textures) saying <code>// Functions to generate textures using CPU runtime</code></p>
  
  <p>Is there any simple way to do this with Dx11? My current train of investigation is suggesting I should be using the <code>D3D11_SUBRESOURCE_DATA *pInitialData</code> part of the CreateTexture functions.</p>