title: Strange issue with shader constants (with a scent of SharpDX)
body: <p>I want to use lights in my shader that I can set when I desire, the first and second light get the values I want in them, the third light does not seem to...</p>
  
  <p>I have this as my shader code (a bit messy but I will clean it after this):</p>
  
  <pre><code>struct VS_IN
  {
      float4 pos : POSITION;
      float4 norm : NORMAL;
      matrix instance : INSTANCEMATRIX;
  };
  
  struct PS_IN
  {
      float4 pos : SV_POSITION;
      float4 norm : NORMAL;
  };
  
  cbuffer world : register (b0)
  {
      matrix world;
  }
  
  cbuffer viewProj : register (b1)
  {
      matrix viewProj;
  }
  
  cbuffer material : register (b2)
  {
      float4 color : COLOR;
  }
  
  cbuffer lights : register (b3)
  {
      float4 Light1Color;
      float3 Light1Direction;
  
      float4 Light2Color;
      float3 Light2Direction;
  
      float4 Light3Color;
      float3 Light3Direction;
  }
  
  PS_IN VS( VS_IN input )
  {
      PS_IN output = (PS_IN)0;
  
      output.pos = mul(input.pos, input.instance);
      //output.pos = mul(output.pos, world);
      //output.pos = mul(input.pos, world);
      output.pos = mul(output.pos, viewProj);
      output.norm = normalize(mul( input.norm, input.instance));
      //output.col = input.col;
  
      return output;
  }
  
  float4 PS( PS_IN input ) : SV_Target
  {
      return Light3Color;//float4(Light3Direction.r, Light3Direction.g, Light3Direction.b, 1.0f);// + float4(0.2f,0.2f,0.2f,0.9f);
      //return color;
  }
  </code></pre>
  
  <p>I have a Light struct defined as follows:</p>
  
  <pre><code>[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  struct Light
  {
      public Color4 Color; 
      public Vector3 Direction;
      float padding;
  
      public Light(Color color, float directionX, float directionY, float directionZ)
      {
          Direction = new Vector3(directionX, directionY, directionZ);
          Color = color;
          padding=0;
      }
  }
  </code></pre>
  
  <p>I create my lightbuffer like this:</p>
  
  <pre><code>_lightBuffer = new Buffer(_device, Utilities.SizeOf&lt;Matrix&gt;(), ResourceUsage.Default, BindFlags.ConstantBuffer, CpuAccessFlags.None, ResourceOptionFlags.None, 0);
  _device.ImmediateContext.PixelShader.SetConstantBuffer(3, _lightBuffer);
  </code></pre>
  
  <p>and fill it using:</p>
  
  <pre><code>Light[] lights = new Light[]
                  {
                      new Light(Color.Red, 0.5f,0.5f,0.5f),
                      new Light(Color.Blue, 0.5f, 0.5f, 0.5f),
                      new Light(Color.White, 1, 1, 1),
                  };
                  _device.ImmediateContext.UpdateSubresource(lights, _lightBuffer);
  </code></pre>
  
  <p>If I return either Light1Color or Light2Color in my pixelshader, I get the expected result (red or blue), if I return Light3Color, all I get is my background color...</p>
  
  <p>What am I doing wrong?</p>