The DSA emulator functions query which texture is currently bound
to a given target, then bind the new one, perform an operation,
and bind the old one back.
The problem is that in order to query what's currently bound to the
GL_TEXTURE_<X> target one needs to call glGetIntegerv passing
GL_BINDING_TEXTURE_<X>. Since both GL_TEXTURE_X and GL_BINDING_TEXTURE_X
values are completely arbitrary (not contiguous nor related in any way)
we need to pass *both* them to the functions.
The right GL_BINDING_TEXTURE_X was getting already chosen (and stored)
at texture creation time by QOpenGLTexture, so it's just a matter
of passing it around.
For the "real" DSA functions, the binding target is ignored.
Change-Id: Ida823abbfb142d4a22bf9f9a762b160b7e281c6d
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>