Revert "i915g: Don't bind 0-length programs"

This reverts commit 8c28a9bd733f5b51ab459c6bc626a5aaac5a6c0c.
i915g: Don't update I915_HW_PROGRAM in update_framebuffer

It's already going to be updated in update_dst_buf_vars.
i915g: Remove the i915_context->saved_* stuff.

When using u_blitter, the state was being saved from saved_*, but we
don't use that. So after u_blitter resumed we got some corrupted
state in.

So let's just remove the saved_* stuff. I thought it was weird but
harmless, it's actually broken.
i915g: Get rid of the fixup state functions.

Now that the saved_* state is gone, we don't need those any longer.
mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.

The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
GLSL or ARB vp/fp) are in use.  If either TNL or TexEnv programs are
active, at least one stage is using fixed function.

On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
tests, as well as missing textures in Xonotic.  These were all
regressions since commit fb4a34e60eb4c1bdc7b0fdcd98d1bf3038c354e8.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
radeon/r200: make radeon_context subclass of gl_context

radeon_context now contains a gl_context, rather than a pointer to one.
This will allow some minor core Mesa clean-up.
radeon/r200: remove use of gl_context::DriverCtx field
mesa: remove unused gl_context::DriverCtx field
mesa: remove the driverCtx parameter to _mesa_create/initialize_context()

No longer used.
gallium: allow debug helpers in the release build

No idea why this is #ifdef'd. Trace and Noop are definitely useful no matter
how Mesa is built.

Reviewed-by: Brian Paul <brianp@vmware.com>
r600g: fix streamout on RS780 and RS880

The latest kernel from git is required. Transform feedback (along with GL3.0)
is turned off on older kernels.
r600g: don't modify pipe_resource in resource_copy_region, fixing race condition

pipe_resource can be shared between contexts, we shouldn't modify its
description. Instead, let's use the resource "views" (sampler views and
surfaces), where we can freely change almost any property of a resource.
r600g: ensure PERFECT_ZPASS+NOOP_CULL_DISABLE are 0 for blits+decompression

When an occlusion query was active, the derived DB state wasn't changed
for u_blitter even though all the occlusion queries were suspended.

It's fixed by moving the state update into the emit functions, which are
called whenever queries are stopped or suspended.
r600g: fix possible issue with stencil mipmap rendering

Somehow I only hit this issue with my latest libdrm changes.
This won't be needed with DB texturing.

NOTE: This is a candidate for the 9.0 branch.
glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section

This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the
EXT_polygon_offset section. (Solution by Ian Romanick)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: glGet: fix parameter lookup for apps using multiple APIs

The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: glGet: simplify the 'enum not found' condition

When traversing the hash table looking up an enum that is invalid we
eventually reach the first element in the descriptor array. By looking
at the type of that element, which is always TYPE_API_MASK, we know that
we can stop the search and return error. Since this element is always
the first it's enough to check for its index being 0 without looking at
its type.

Later in this patchset, when we generate the hash tables during build
time, this will allow us to remove the TYPE_API_MASK and related flags
completly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: glGet: rename *{_EXT,_ARB} enums missing from the XML spec

The following enums used to be extensions but later became part of the
core specification. The _EXT/_ARB versions of these are not present in
in the current XML spec files, only defined in GL/glext.h

Later we'll need to look up these in a python script using the XML spec.
As a preparation for that remove the _EXT,_ARB suffix from these enums
and rename GL_DISTANCE_ATTENUATION_EXT to GL_POINT_DISTANCE_ATTENUATION.
Naturally, all enums keep their numerical values.

Note that similar renames shouldn't be necessary in the future: in case
of a new extension the XML spec is updated with the new _EXT/_ARB etc.
name and this name is added to the enum table in get.c.  Later the
extension may become part of the core spec, at which point the name w/o
the _EXT/_ARB suffix is added to the XML spec and the table in get.c
remains the same.

GL_BLEND_DST_ALPHA_EXT
GL_BLEND_DST_RGB_EXT
GL_BLEND_SRC_ALPHA_EXT
GL_BLEND_SRC_RGB_EXT
GL_COLOR_SUM_EXT
GL_COMPRESSED_TEXTURE_FORMATS_ARB
GL_CURRENT_FOG_COORDINATE_EXT
GL_CURRENT_SECONDARY_COLOR_EXT
GL_DISTANCE_ATTENUATION_EXT
GL_FOG_COORDINATE_ARRAY_EXT
GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
GL_FOG_COORDINATE_ARRAY_TYPE_EXT
GL_FOG_COORDINATE_SOURCE_EXT
GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
GL_PACK_IMAGE_HEIGHT_EXT
GL_PACK_SKIP_IMAGES_EXT
GL_SECONDARY_COLOR_ARRAY_EXT
GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
GL_UNPACK_IMAGE_HEIGHT_EXT
GL_UNPACK_SKIP_IMAGES_EXT

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
scons/android: add flag to check for enabled GL APIs

Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: glGet: add script to generate hash tables in build time

This will be needed by the next patch, which will switch to using
the parameter descriptor- and hash tables generated by the script.

The hash algorithm remains the same, the output parameter descriptor
table format changes slightly. There the TYPE_API_MASK entries are
removed and an invalid NULL entry is inserted at the beginning. This is
ok, as get.c:find_value() doesn't rely on TYPE_API_MASK any more to
detect an invalid enum.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>