Is there any way in OpenGL to load and read a 10 bit image? It doesn’t have to be optimal efficiency on the GPU side. I just want to offload my CPU from converting everyting to 8bit before shuffling it to the GPU.
I noticed that the only 10 bit texture format supported is RGB10, which isn’t what I’m looking for.
Vendor specific extensions are alright.
Well, that’s not going to happen. The GPU never does format conversions (except maybe swizzling, but that’s really part of the DMA). The CPU does format conversions, which is why it is so important to avoid format mismatches.
So even if OpenGL had a way to describe 10-bit single-channel data, you’d still be relying on the CPU to decode it into the format the GPU actually uses (ie: 8-bit). It just wouldn’t be your code doing the conversion; it’d be driver code. Either way, it’s eating CPU resources.
But that’s irrelevant to your needs, since OpenGL does not have a way to upload 10-bit single-channel data. How do you even store that; the pixels aren’t byte-aligned.
In general, you are advised to do this kind of conversion off-line where possible and store the data in the formats where it makes the most sense.