glapi: add ARB_texture_multisample

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
dispatch_sanity: enable checks for ARB_texture_multisample

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: add stubs for new entrypoints for ARB_texture_multisample

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: add texobj support for ARB_texture_multisample

V2: Allow multisample texture targets in glInvalidateTexSubImage too.
This was already partly there, but I missed it the first time around
since the interaction is defined in a newer extension.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
tests: add ARB_texture_multisample enums to table

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: add new texture state for ARB_texture_multisample

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: support getting current binding for multisample textures

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
glsl: add support for ARB_texture_multisample

V2: emit `sample` parameter properly for multisample texelFetch()

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
wire up GL_TEXTURE_SAMPLES and GL_TEXTURE_FIXED_SAMPLE_LOCATIONS

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: add new max sample count state

- GL_MAX_COLOR_TEXTURE_SAMPLES
- GL_MAX_DEPTH_TEXTURE_SAMPLES
- GL_MAX_INTEGER_SAMPLES

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: expose new max sample counts

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: implement GetMultisamplefv

Actual sample locations deferred to a driverfunc since only the driver
really knows where they will be.

V2: pass the draw buffer to the driverfunc; don't fallback to pixel
center if driverfunc is missing.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: implement sample mask

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: add support for sample mask on Gen6+

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: expose sample locations

Moves the definition of the sample locations out of
gen6_emit_3dstate_multisample, and unpacks them in
gen6_get_sample_postiion.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: implement TexImage*Multisample

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: support multisample textures in framebuffer completeness check

- sample count must be the same on all attachments
- fixedsamplepositions must be the same on all attachments
(renderbuffers have fixedsamplepositions=true implicitly; only
multisample textures can choose to have it false)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
mesa: adjust texture completeness for multisample

GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY targets
don't allow filtering state to be set, but the default state fails the
completeness check for integer formats.

We still care about other reasons the texture might be considered
incomplete though, so can't skip this entirely like GL_TEXTURE_BUFFER.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: sanity check that built miptree wont need immediate rebuild

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: add support for multisample textures

This is a bit nasty -- I've just (ab)used the existing multisample
renderbuffer path.

Also put the actual sample count from the mt back into the
renderbuffer so core mesa can see what the driver actually gave it.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>