title: Why won't this HLSL Pixel Shader compile when RWStructuredBuffer is referenced?
body: <p>I'm using DirectX 12, trying to render using UAVs. Here is my pixel shader code:</p>
  
  <pre><code>    struct PSInput
  {
      float4 position : SV_POSITION;
      float4 color : COLOR;
  };
  
  struct FragmentDataStruct
  {
      float4 color;
      float depth;
  };
  
  struct FragmentAndLinkStruct
  {
      FragmentDataStruct fragmentData;
      uint nextFragment;
  };
  
  RWStructuredBuffer &lt;FragmentAndLinkStruct&gt; FLBuffer : register(u0);
  
  RWByteAddressBuffer StartOffsetBuffer : register(u1);
  
  float4 PSMain(PSInput input) : SV_TARGET
  {
      input.color.x = float(FLBuffer[0].nextFragment);
  
      return input.color;
  }
  </code></pre>
  
  <p>It fails compilation when using the <code>D3DCompileFromFile</code> function.</p>
  
  <p>When I replace this line:</p>
  
  <pre><code>input.color.x = float(FLBuffer[0].nextFragment);
  </code></pre>
  
  <p>with something like this:</p>
  
  <pre><code>FragmentAndLinkStruct otherThing;
  otherThing.nextFragment = 1;
  input.color.x = float(otherThing.nextFragment);
  </code></pre>
  
  <p>that has no mention of the <code>RWStructuredBuffer</code>, then it compiles just fine and renders properly.</p>
  
  <p>I don't think I have any issues with bound data (VS Graphics Debugger shows the two UAVs bound properly). I don't think that would affect the compiling of the shader, though.</p>
  
  <p>Any time I reference <code>FLBuffer</code> or <code>StartOffsetBuffer</code>, it won't compile.</p>
  
  <p>What would cause this problem?</p>