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 statechanges, 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 eric@anholt.net
This change is mostly Eric's work. I rebased it to current glamor, and changed glamor_reset_sampler
to default to GLAMOR_SAMPLER_NEAREST_EDGE
which made X -retro
work, apparently the tile/stipple logic in core rendering needs GL_TEXTURE_WRAP_*
to be GL_REPEAT
. I don't love that this breaks acceleration on GLES2, but - since nobody should care about any GLES2 driver that isn't Mesa - that's what mesa/mesa!2440 (merged) is for.