mesa: Don't flatten IF statements by default.

MaxIfDepth of 0 means "flatten all the time", not "never flatten".
This is only desirable on hardware that can't support control flow;
software rasterization and most hardware drivers want this.

This alters behavior for swrast as well as i915.  Tested on i915.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Fix segfault when using INTEL_DEBUG=perf with non-GLSL.

Now that ARB programs and fixed function are routed through the new
backend, shader might be NULL.  Don't do INTEL_DEBUG=perf support in
that case, since it relies on shader->compiled_once.

Since INTEL_DEBUG=perf wasn't previously supported, this maintains the
status quo.  It might be nice to support it someday, however.

This could be moved to brw_shader_program instead of brw_shader, but
it appears even prog can be NULL in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
glapi: use new-style Python classes.

An unfortunate quirk of Python 2 is that there are two types of
classes: "classic" classes (which are backward compatible with some
unfortunate design decisions made early in Python's history), and
"new-style" classes.  Classic classes have a number of limitations
(for example they don't support super()) and are unavailable in Python
3.  There's really no reason to use classic classes, except in
unmaintained legacy code.  For more information see
http://www.python.org/download/releases/2.2.3/descrintro/.

This patch upgrades the Python code in src/mapi/glapi/gen to use
exclusively new-style classes.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glapi: Add es1 and es2 attributes to XML.

Currently, the set of functions which exist in GLES1 or GLES2 is
determined by hardcoded lists of function names in gles_api.py.  This
patch encodes that information into the XML files using new
attributes, es1 and es2.

The es1 attribute denotes the first version of GLES 1 in which the
function exists (e.g. es1="1.1" means the function exists in GLES 1.1
but not GLES 1.0).  "none" (the default) means the function is not
available in any version of GLES 1.

The es2 attribute denotes the first version of GLES 2/3 in which the
function exists (e.g. es2="2.0" means the function exists in both GLES
2.0 and GLES 3.0).  "none" (the default) means the function is not
available in any version of GLES 2 or GLES 3.

Note that since GLES 3 is a strict superset of GLES 2, there is no
need for a separate attribute for it; instead, 'es2="3.0"' should be
used to denote functions that are present in GLES 3 but not GLES 2.

This patch only adds information about GLES versions 1.0, 1.1, and
2.0.

Later patches will modify the python code generation scripts to use
this information rather than the hardcoded lists in gles_api.py.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glapi: Read GLES information from XML.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glapi: Use GLES information from XML rather than gles_api.py.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mapi_abi: Collect all imports at top of file.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mapi_abi: Remove sanity check that all GLES functions are present.

Currently mapi_abi.py uses hardcoded lists of function names (in
gles_api.py) to determine which functions need to be included in the
GLES 1 or GLES 2 API.  This patch removes a sanity check which
verified that all GLES functions listed in the hardcoded lists were
actually present in the XML.

Later patches in this series will modify mapi_abi.py to determine
which functions need to be included in the GLES 1 or GLES 2 API based
directly on the XML.  Once that is done, the sanity check will be
redundant.  Removing the sanity check now will simplify the patches to
come.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mapi_abi: Get rid of unnecessary copy.

Previously, _get_api_entries() would make a deep copy of each element
in the entries table before modifying the 'hidden' and 'handcode'
attributes.  This was unnecessary, since the entries aren't used again
after this function.  Removing the copy simplifies the code, because
it is no longer necessary to adjust the alias pointers to point to the
copied entries.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mapi_abi: Override 'hidden' and 'handcode' attributes using polymorphism.

Previously, the ES1, ES2, and shared GLAPI printers passed a list of
function names to the base class constructor, which was used by the
_override_for_api() function to loop over all the API functions and
adjust their 'hidden' and 'handcode' attributes as appropriate for the
API flavour being code-generated.

This patch lifts the loop from _override_for_api() into its caller,
and makes it into a polymorphic function, so that the derived classes
can customize its behaviour directly.  In a future patch, this will
allow us to override the 'hidden' and 'handcode' attributes based on
information from the XML rather than a list of functions.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
mapi_abi: Use GLES information from XML rather than gles_api.py.

Note: mapi_abi can consume API information from either XML or a .csv
file.  A side effect of this change is that the ES1 and ES2 API
printers can only be used with XML input now.  That's ok, since the
.csv input format is only used for the OpenVG API.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
glapi: Delete gles_api.py, since it is no longer used.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
WIP: mark stuff as deprecated
WIP: mark more stuff as deprecated
WIP: mark more stuff as deprecated
Whoops, erroneously marked DrawBuffer as deprecated
Whoops, StencilFuncSeparateATI should be deprecated, not StencilFuncSeparate.
Whoops, PolygonOffsetEXT should be deprecated, not PolygonOffset
Never mind, GetPointerv shouldn't be deprecated.