draw: make vs_slot signed.

Otherwise (vs_slot < 0) will never be true.

Trivial.
llvmpipe: Advertise PIPE_CAP_DEPTH_CLIP_DISABLE.

Actually implemented by draw module.

Tested piglit ARB_depth_clamp tests, which pass 100%.

Trivial.
scons: Fix build when rtti is disabled

* The rtti fix actually dug up a bug in the scons build scripts.
* Autotools took the LLVM cpp and cxx flags, while scons only took
  the cpp flags.
* This grabs the cxx flags and applies them where needed. We may
  want to make the same change for the llvm cpp flags in scons.
* The only linux platform I can find with LLVM no-rtti is Ubuntu.
* Fixes bug #70471

Tested-by: Vinson Lee <vlee@freedesktop.org>
egl-wayland: Add support for RGB565 pixel format for Wayland clients

With this patch Wayland clients can now ask EGL for RGB 565 format buffers
and attach them to a Wayland compositor.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
i965: Add support for RGB565 __DRIimage

Add information for RGB565 to the table of image formats so that we can
create a __DRIimage for that format.  This in turn enables RGB565
wayland clients.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
egl_dri2: Match X11 visuals using rgba masks instead of depth

Matching on visual depth to buffer size makes 8 bpc RGBA look similar to
10 bit RGB with 2 bit alphs - both have buffer size 32.  Instead, build
the rgba masks from the visual data and use that for finding matching
DRI configs.

We need to keep the special case that allows us to match 24 bit visuals
to DRI configs with buffer size 32.  We do that by creating an alpha
mask of "all the non-rgb bits" for 24 bit visuals and matching a second
time with that.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
egl_dri2: Remove depth argument from dri2_add_config()

All callers now use the more correct rgba mask mechanism for filtering
out mathcing DRI configs.  Even if depth and buffer size match, the
color component layout can be different, or in case or ARGB8888 and
ARGB2101010 the color components can even be different sizes.

Since anything that the depth check would reject is also rejected by
the rgba mask comparison, the depth parameter is redundant and not
specific enough.  We should probably have removed it when the rgba
masks argument was introduced, but better late than never.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
egl_dri2: Set NativeVisualID to the matching GBM config for the gbm platform

The EGLConfig doesn't have the rgba masks, only the rgba sizes.  To
make sure a config is usable with a given GBM/KMS format, we need a way
to make sure the formats really match.
dri/common: Add support for creating ARGB2101010 configs

This extends the common dri driver infrastructure with the ability to create
__DRIconfigs for 10 bits/channel + 2 bit alphs formats.  This still has
to be supported and requested by a driver, so this doesn't enable anthing yet.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
i965: Create ARGB2101010 DRI configs

This commit enables ARGB2101010 system framebuffers (that is, DRI drawables)
for the i965 drivers.  This is done by generating DRI configs that advertise
this color format as well as teaching intelCreateBuffer to pick the right
color format when it sees such a DRI config.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
dri: Add __DRIimage support for the ARGB2101010 format

We add support for the ARGB2101010 color format to the DRI image extension,
which allows DRI loaders to create a __DRIimage with this color format.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
gbm: Add support for gbm bos and surfaces using GBM_FORMAT_ARGB2101010

We can now add GBM support for the 10 bit/channel formats which lets us
create a gbm surface that we can use with KMS for display hardware that
support the format.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
mesa: consolidate cube width=height error checking

Instead of checking width==height in four places, just do it in
_mesa_legal_texture_dimensions() where we do the other width, height,
depth checks.  Similarly, move the check that cube map array depth is
a multiple of 6.

This change also fixes some missing cube dimension checks for the
glTexStorage[23]D() functions.

Remove width==height assertion in _mesa_get_tex_max_num_levels() since
that's called before the other size checks for glTexStorage.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
vbo: access VBO memory more efficiently when building display lists

Use GL_MAP_INVALIDATE_RANGE, UNSYNCHRONIZED and FLUSH_EXPLICIT flags
when mapping VBOs during display list compilation.  This mirrors what
we do for immediate-mode VBO building in vbo_exec_vtx_map().

This improves performance for applications which interleave display
list compilation with execution.  For example:

glNewList(A);
glBegin/End prims;
glEndList();
glCallList(A);
glNewList(B);
glBegin/End prims;
glEndList();
glCallList(B);

Mesa's vbo module tries to combine the vertex data from lists A and B
into the same VBO when there's room.  Before, when we mapped the VBO for
building list B, we did so with GL_MAP_WRITE_BIT only.  Even though we
were writing to an unused part of the buffer, the map would stall until
the preceeding drawing call finished.

Use the extra map flags and FlushMappedBufferRange() to avoid the stall.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
mesa: update glext.h to version 20131008

Only two notable changes in this revision:
* GLvoid has been replaced by void.
* Added the GL_NV_blend_equation_advanced extension.
mesa: update glxext.h to version 20131008

The diff is huge but the actual changes are few:
* Whitespace changes
* Items are reordered
* extern qualifiers dropped
cso: fix incorrect sampler view count in cso_restore_sampler_views()

During the recent bind_sampler_states() interface change in gallium
we changed the CSO single_sampler_done() function so that if we were
decreasing the number of sampler states bound in the driver, we'd
null-out the "extra/old" sampler states to unbind them.  See commit
1e2fbf265.

However, we didn't make the corresponding fix for sampler views.
This caused an assertion to fail in the svga driver which checked
that the number of sampler views matched the number of sampler states.

This patch fixes cso_restore_sampler_views() so that it nulls-out
the extra/old sampler views if the number of new views is less than
the number of current/old views.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
svga: minor fix-ups in svga_get_shader_param()

Fix debug error message.  Add switch case for PIPE_SHADER_COMPUTE.
Trivial.
mesa: change glTexImage[23]DMultisample() internalformat to GLenum

To match glext.h and the GL_ARB_texture_multisample extension.
However, the GL 4.0 spec and man page say it's GLint.
An OpenGL spec bug will be filed.
clover: Link libclc before running any optimizations

This is required in order for clang to correctly handle the OpenCL C
barrier() builtin which has the following restrictions acording to
the OpenCL 1.1 Specification:

If barrier is inside a conditional statement, then all work-items must
enter the conditional if any work-item enters the conditional statement
and executes the barrier.

If barrier is inside a loop, all work-items must execute the barrier for
each iteration of the loop before any are allowed to continue execution
beyond the barrier.

By linking before otimizations, we can replace calls to barrier() with
calls to a target specific intrinsic which has the noduplicate attribute
This attribute prevents clang from performing optimizations which could
violate the above rules.

This attribute must be applied to the call instruction that invokes
the function, so it is not enough to add this attribute the barrier()
declaration.

As a bonus this will probably speed up compile times since we will no
longer need to run link-time optimizations.