how to use PBO + glTexSubImage2D to display 10bit image?

Hi,
I have an One-dimensional binary array stored RGBA 10bit 10bit 10bit 2bit data.
Now, I want to use PBO and glTexSubImage2D to render this array data.
what parameter I wolud change parameter about glTexImage2D and glTexImage2D?

glTexImage2D(GL_TEXTURE_TYPE, 0, GL_RGBA8, imageWidth, imageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);

glTexSubImage2D(GL_TEXTURE_TYPE, 0, 0, 0, imageWidth, imageHeight, GL_BGRA, GL_UNSIGNED_BYTE, 0);

[QUOTE=v770729;1282338]Hi,
I have an One-dimensional binary array stored RGBA 10bit 10bit 10bit 2bit data.
Now, I want to use PBO and glTexSubImage2D to render this array data.
what parameter I wolud change parameter about glTexImage2D and glTexImage2D?
[/QUOTE]


glTexImage2D(GL_TEXTURE_2D, 0,  GL_RGB10_A2, imageWidth, imageHeight, 0, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2, (const GLvoid *) 0);

glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, imageWidth, imageHeight, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2, (const GLvoid *) 0); 

Alternatively, the type may need to be GL_UNSIGNED_INT_2_10_10_10_REV, and/or the format GL_BGRA, depending upon how the fields are ordered.

GL_UNSIGNED_INT_10_10_10_2 has the 4 fields (R,G,B,A or B,G,R,A in bits 22-31,12-21,2-11,0-1 respectively). GL_UNSIGNED_INT_2_10_10_10_REV has them in bits 0-9,10-19,20-29,30-31.

This assumes that you want the internal format to be an unsigned normalised format with the same precision as the data. But that isn’t required; you can use any internal format, and the data will be converted accordingly.

The buffer containing the data needs to be bound to the GL_PIXEL_UNPACK_BUFFER target at the time of the call.