haiku: Fix missing HaikuGL header paths

Acked-by: Brian Paul <brianp@vmware.com>
haiku libGL: Move from gallium target to src/hgl

* The Haiku renderers need to link to libGL to function properly
  in all usage contexts. As mesa drivers build before gallium
  targets, we couldn't properly link the mesa swrast driver to
  the gallium libGL target for Haiku.
* This is likely better as it mimics how glx is laid out ensuring
  the Haiku libGL is better understood.
* All renderers properly link in libGL now.

Acked-by: Brian Paul <brianp@vmware.com>
glsl: Add extension tracking for AMD_shader_trinary_minmax

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: add a shader_trinary_minmax predicate

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: add min() and max() functions to builder.cpp

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Implement min3 built-in function

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: implement max3 built-in function

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: implement mid3 built-in function

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
mesa: enable AMD_shader_trinary_minmax

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
docs/relnotes/10.1.html: report AMD_shader_trinary_minmax support

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
mesa: Remove GLXContextID typedef from glxext.h.

This patch fixes this build error with gcc <= 4.5 and clang <= 3.1.

  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333:0,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275:13: error: redefinition of typedef 'GLXContextID'
../../include/GL/glx.h:171:13: note: previous declaration of 'GLXContextID' was here

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Remove unused PIPE_CONTROL defines.

Both brw_defines.h and intel_reg.h defined PIPE_CONTROL fields, which
had similar names, but couldn't be used in the same way.  (One had
built-in shifts, and the other didn't...)

Delete the unused set to preserve sanity.

(Eric wrote an almost identical patch back in August, so I believe he
approves.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: rename min(), max() functions to fix MSVC build

Evidently, there's some other definition of "min" and "max" that
causes MSVC to choke on these function names.  Renaming to min2()
and max2() fixes things.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gallium/draw: remove double semicolon

code cleanup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
swrast: fix delayed texel buffer allocation regression for OpenMP

Commit 9119269ca14ed42b51c7d8e2e662500311b29fa3 moved the texel
buffer allocation to _swrast_texture_span(), however, when compiled
with OpenMP support this code already runs multi-threaded so a
critical section is required to prevent multiple allocations and
rendering errors.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
llvmpipe: Implement alpha_to_coverage for non-MSAA framebuffers.

Implement Alpha to Coverage by discarding a fragment alpha component is
less than 0.5.  This is a joint work of Jose and Si.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cso_context: Fix cso_context::sample_mask initial value.

The initial value of cso_context::sample_mask_saved is irrelevant as it
will be overwritten with cso_context::sample_mask in
cso_save_sample_mask.  Therefore it is cso_context::sample_mask that
needs to be properly initialized.

This fixes regressions in blits and mipmap generation after adding
support for sample_mask to llvmpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
llvmpipe: Basic implementation of pipe_context::set_sample_mask.

We don't support MSAA (ie, number of samples is always one) therefore
sample_mask boils down to a synonym of the rasterizer_discard flag.

Also, this change makes setup actually use the value received in
lp_setup_set_rasterizer_discard instead of reaching out to llvmpipe
upper layers to re-fetch it.

Based on Si Chen's draft.

With this patch `wgf11multisample Coverage passes 100%` on the UMD
D3D10 state tracker.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Si Chen <sichen@vmware.com>
mesa: Use get_local_param_pointer in glProgramLocalParameters4fvEXT().

Using the get_local_param_pointer helper ensures that the LocalParams
arrays have actually been allocated before attempting to use them.

glProgramLocalParameters4fvEXT needs to do a bit of extra checking,
but it can be simplified since the helper has already validated the
target.

Fixes crashes in programs that use Cg (for example, Awesomenauts,
Rocketbirds: Hardboiled Chicken, and Tiny and Big: Grandpa's Leftovers)
since commit e5885c119de1e508099cc1111e1c9f8ff00fab88
(mesa: Dynamically allocate the storage for program local parameters.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73136
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
glsl: Optimize pow(1.0, X) --> 1.0.

Surprisingly, this helps one vertex shader in 3DMMES.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>