How do I use unpackHalf2x16?
- by user1032861
I'm trying to use (un)packHalf2x16, without success so far. I'm drawing with:
glVertexAttribIPointer(0, 2, GL_UNSIGNED_INT, 0, 0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glDrawArrays(GL_POINTS, 0, n_points);
glDisableVertexAttribArray(0);
and on the shader
#version 330 core
#extension GL_ARB_shading_language_packing : require
in uvec2 A0;
// (...)
vec4 t = vec4(unpackHalf2x16(A0.x), unpackHalf2x16(A0.y));
But nothing gets drawn. I'm pretty sure buffer's content is right, and if I use vec4 t = vec4(0); I can see it's working properly.
How is this packing / unpacking thing supposed to work? I can't find any example.