I just looked at my code and do this kind of stuff all the times and it's not a problem. I can't imagine the compiler would fail on something so basic. Sure, if you space out your data it will still work and possibly PIX will give you what you expect. But that's a huge waste of space, and I'm sure you don't need to do it.
So just to make sure I'm understanding you, your program (not PIX) failed until you aligned everything at 16-byte boundaries? Just as an example the code below works fine.
//################################################################
//## SDLSLight
//################################################################
struct SDLSLight
{
uint uLightType; // Vector4 0
float3 f3Attenuation;
float3 f3Position; // Vector4 1
float fRange;
float4 f4Ambient; // Vector4 2
float4 f4Diffuse; // Vector4 3
float4 f4Specular; // Vector4 4
float3 f3Face; // Vector4 5
float fSpot;
};
//################################################################
//## CBPerFrameData
//################################################################
struct CBPerFrameData
{
// f4P is our special projection vector. It is constructed as follows:
//
// f4P = [tan(HeightViewAng/2) * AspectRatio, tan(HeightViewAng/2), PowerOfTwoZDiv, NearPlane]
//
// AspectRatio = Viewing aspect ratio width over height
// HeightViewAng = vertical viewing angle of the window
// PowerOfTwoZDiv = Tested with ldexp(1,96) which should be OK up to a galaxy
// NearPlane = Near clipping plane (near Z)
//
float4 f4P;
int iLightCount;
int iLightWireframe;
int iLightReserved2;
int iLightReserved3;
SDLSLight sLightArray[MDLDX_MAX_LIGHTS];
};
And then the constant buffer declaration:
ConstantBuffer<CBPerFrameData> cbPFD : register(b0,space0);