glamor: Require and use GL_ARB_sampler_objects

Sampler objects were introduced to GL in 2010, and are a software-only
API improvement that reduces the overhead of texture state changes,
which glamor's Render acceleration does a lot of. The idea is that
instead of doing a series of TexParameteri calls that have to validate a
bunch of GLenums and their values, you do one BindSampler of the sampler
object you want to use, and the driver gets to cache computed state in
the sampler object and reuse that.

For now, instead of having each core operation doing texturing reset
the sampler object, we have the Render and XV cases reset the sampler
on their way out. This causes more state changes for Render-only
operation, but is less invasive as it matches our previous behavior.

This commit is a prerequisite for doing ARB_texture_view for Render
acceleration of other formats.

Signed-off-by: Eric Anholt <>
5 jobs for glamor-sampler-objects-2020 in 4 minutes and 32 seconds (queued for 8 seconds)
Status Name Job ID Coverage
  Docker Image
passed debian-buster #11679611


  Build And Test
passed autotools #11679612


passed meson #11679613


passed meson-noglamor #11679614


passed mingw-cross-build #11679615