wined3d: Use bindless textures for GLSL shaders if possible.
Based on a patch by Andrew Wesie, with some modifications from myself:
-
Remove shader_glsl_map_tex_unit(); it's not correct here.
-
Rename and move around various functions.
-
Avoid making the same handle resident twice; this is a GL error.
-
Use bindless textures for all bindings, not just the ones that exceed 16, and use them for buffer textures as well. Don't use them when we need SRGB read control, though, because ARB_bindless_texture doesn't work with EXT_texture_sRGB_decode.
-
Use glGetTextureHandleARB() for dummy textures. This matches the behaviour with wined3d_context_gl_bind_shader_resources(), where 0 is bound for a sampler instead of device->null_sampler, and is a bit simpler.