I’m expecting the following shader to draw a triangle accross the screen, but it does not behave that way.
#version 420 core
void main()
{
vec2[] vertices = vec2[](vec2(-1.0),vec2(1.0,-1.0),vec2(0.0,1.0));
gl_Position = vec4(vertices[gl_VertexID],0.0,1.0);
uint compressed = packHalf2x16(gl_Position.xy);
gl_Position.xy = unpackHalf2x16(compressed);
}
I have attached an image showing the difference between not using the pack/unpack functions (left) and using them (right). AFAIK, the images should be similar.
Code can be downloaded here (gmake and vs2010 projects are provided).