I recently decided to compress my vertex data to make rendering more efficient, and I found a solution - using half (in particular half4 and half2 ) instead of float to store my vertex data. My vertex structure is shown below:
[StructLayout(LayoutKind.Sequential)] public struct MyVertex { public Half4 Position;
And here is my vertex declaration:
MyVertexDecl = new VertexDeclaration(device, new VertexElement[6] { new VertexElement(0, 0, DeclarationType.HalfFour, DeclarationMethod.Default, DeclarationUsage.Position, 0), new VertexElement(0, 8, DeclarationType.HalfFour, DeclarationMethod.Default, DeclarationUsage.Normal, 0), new VertexElement(0, 16, DeclarationType.HalfTwo, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0), new VertexElement(0, 20, DeclarationType.HalfFour, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 1), new VertexElement(0, 28, DeclarationType.HalfFour, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 2), VertexElement.VertexDeclarationEnd });
Everything works fine when I directly send my data as an array of MyVertex to DrawUserPrimitives.
But when I decided to put all my data in VBO to avoid excessive copy operations, my whole grid turned into a mess in pixels. I write my values ββas indications (SlimDX shelves have a RawValue field for each component).
Here is what PIX says about my grid: 
And here is the same part in the buffer viewer after specifying my layout (I will show only one column, since they are quite wide, hope you get this idea):

As you can see, my halves are mistakenly treated as floating. Changing float4 to half4 in the shader also does not help, it seems the problem is elsewhere. Is there any other way to tell my GPU to use my vertex buffer as half buffer, and not as a floating point buffer?
UPD:
Here is my drawing code (abbreviated):
public void Render(GraphicsDevice device, ICamera camera, MyModel model) {
And this is how this method is called (main part):
_eff.BeginPass(0); GraphicsDevice.VertexDeclaration = vDecl; renderer.Render(GraphicsDevice, camera, world); _eff.EndPass();
I am using D3D9 via SlimDX with C #.