mesa/es3: Enable ES 3.0 API and shading language version

v2: Add ARB_internalformat_query to the list of required extensions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
i965/Gen6+: Enable ARB_ES3_compatibility extension

IMPORTANT: this patch should not be pushed to master until ES3 support
is fully implemented on i965/Gen6+.
i965: Bump maximum supported ES2 context version to 3.0

Since patch "i965: Validate requested GLES context version in
brwCreateContext", we have been able to create ES 3.0 contexts due to the
max version check.  So...bump the max version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
mesa: Use GL_RED for DEPTH_TEXTURE_MODE for everything but legacy GL.

According to page 163 of the ES 3.0 spec:

"Texture lookups involving textures with depth component data generate
 a texture base color C_b either using depth data directly or by
 performing a comparison with the D_ref value used to perform the
 lookup, as described in section 3.8.15.  The resulting value R_t is
 then expanded to a color C_b = (R_t,0,0,1), ..."

In other words, depth textures are supposed to be treated as GL_RED.

A discussion about this text can be found in Khronos bugzilla:
https://cvs.khronos.org/bugzilla/show_bug.cgi?id=7962

It's unclear what the behavior of desktop GL should be.  The GL 3.x
specifications indicate that it should be (r, r, r, 1), which is
GL_LUMINANCE (the old default).  However, page 112 of the 4.2 core
specification contains the text quoted above, explicitly declaring it
to be (R_t, 0, 0, 1), which is GL_RED.

So it hinges on whether the 4.2 text is a change or a clarification.
Personally I think that using GL_RED in core contexts and GL_INTENSITY
in legacy contexts seems reasonable.

Fixes 4 es3conform tests:
- depth_texture_fbo
- depth_texture_fbo_clear
- depth_texture_teximage
- depth_texture_texsubimage

Cc: Ian Romanick <idr@freedesktop.org>
copyteximage: make sure is_srgb(src) == is_srgb(dst)

v2:
 * Remove _EXT on enums
 * Remove compressed forms of sRGB from is_srgb_format
 * Add comment referencing GL Core spec

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
copyteximage: update error checking for GLES3

Changes based on GTF/gles3 conformance test suite.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
readpix: add error checking for GLES3

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
readpix: check FBO completeness before trying to access the read-buffer

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
extensions: enable EXT_color_buffer_float for ES2/ES3

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
readpix: allow implementation format/type

For GLES2/3 allow reading of pixels with format/type based on:
 * GL_IMPLEMENTATION_COLOR_READ_FORMAT
 * GL_IMPLEMENTATION_COLOR_READ_TYPE

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
framebuffer: update allowed implementation format/type

Allow additional format/type combinations based on the
color render buffer to fix failures with gles3-gtf.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
fbobject: add additional fbo completeness checks for GLES

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Merge branch 'wip' into gles3