Separate sampler state from texture state

An oft requested feature since OpenGL 2.1. Right now, OpenGL treats sampler state as part of the texture object. This is *not* how the hardware works and makes specific algorithms inefficient (those that require different sampling states for the same texture).

glActiveTexture and glTexParameter tokens that set sampler state will be deprecated.

Backwards compatibility can be maintained:
1. using a new version profile
2. specifying that glTexParameter will be ignored when the relevant texture is bound to a sampler with glSamplerTexture. Old applications (using glActiveTexture) will continue to use glTexParameter and ignore glSamplerParameter.

Re: Separate sampler state from texture state

1. The name should be very different. This is a good thing.
2. no more bind to edit in the next API revision
3. or TextureImageUnit but Sampler sounds simpler.
4. What is the risk of this becoming obsolete? Will samplers become programmable one day? Will we have to do this instead one day?
loc=glGetUniformLocation(program, "MagFilter");
glUseProgram(X);
glUniform(loc, GL_LINEAR);

Re: Separate sampler state from texture state

If you are going to separate sampler state from textures, then there should be sampler objects that encapsulate that state. That way, you only need one function to set the sampler state on a uniform.

Have to agree. The original LP designs called for an (immutable) object along these lines, no? If you're going to change things - and we now have a deprecation mechanism in place to facilitate the emergence of new approaches - why not head in the general LP direction. Seems to me it's not too late to climb that peak (or the twin peaks of Kilimanjaro :-))...