mesa: add infrastructure for bindless samplers/images bound to units
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 11 May 2017 15:29:47 +0000 (17:29 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 08:04:36 +0000 (10:04 +0200)
commit444b703a88f8a9c6487db278e8e4331e9fb87d12
tree1dd42516528e3516a8a09c537f30cb34a00ba993
parent4fe2a6ba7a3ef56b806a4e3888a47f05097e02f2
mesa: add infrastructure for bindless samplers/images bound to units

Yes, ARB_bindless_texture allows to do this. In other words, in
a situation like:

layout (bindless_sampler) uniform sampler2D tex;

The 'tex' sampler uniform can be either set with glUniform1()
(old-style bound samplers) or with glUniformHandleui() (resident
handles).

When glUniform1() is used, we have to somehow make the texture
resident "under the hood". This is done by requesting a texture
handle to the driver, making the handle resident in the current
context and overwriting the value directly in the constant buffer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/mtypes.h