st/mesa: fix temp texture bindings in st_CopyPixels()

The temporary texture should have either PIPE_BIND_RENDER_TARGET or
PIPE_BIND_DEPTH_STENCIL set in addition to PIPE_BIND_SAMPLER_VIEW.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
glsl: Fix null check in read_dereference.

Fixes "Logically dead code" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
ilo: silence a compiler warning

The path should never be hit.
ilo: add some assertions to help debugging

Assert that we do not support user vertex/index/constant buffers.  Issue a
warning when a sampler view is created for a resource without
PIPE_BIND_SAMPLER_VIEW.
ilo: fix for half-float vertex arrays

Commit 6fe0453c339b6e894e0ee8d2200e7638a43ed21e broke half-float vertex
arrays.  This reverts a part of that commit, and explains why.
mesa: Add infrastructure for ARB_shading_language_420pack.

v2 [mattst88]
  - Split infrastructure into separate patch.
  - Add preprocessor #define.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Allow .length() method on vectors and matrices.

Required by ARB_shading_language_420pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Allow swizzles on scalars.

Required by ARB_shading_language_420pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Add gl_{Max,Min}ProgramTexelOffset built-in constants.

Required by ARB_shading_language_420pack. Note that the 420pack spec
incorrectly specifies their values as (Min, Max) = (-7, 8) when they
should be (-8, 7) as listed in the GLSL 4.30 and ESSL 3.0 specs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Allow implicit conversion of return values.

Required by ARB_shading_language_420pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: Disallow return with a void argument from void functions.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Implement 16-wide math on G45 and Ironlake.

[chrisf:]
Improves performance in CS:S video stress test by about 2%.
No piglit regressions on Ironlake.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
i965: Shrink Gen5 VUE map layout to be the same as Gen4.

The PRM suggests a larger layout, mostly to support having
gl_ClipDistance[] somewhere predictable for the fixed-function clipper
-- but it didn't actually arrive in Gen5.

Just use the same layout for both Gen4 and Gen5.

No Piglit regressions.

Improves performance in CS:S Video Stress Test by ~3%.

V2: - Remove now-useless function for determining the SF URB read offset
    - Remove now-unused BRW_VARYING_SLOT_POS_DUPLICATE

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Assume flexible hardware primitive restart exists in the future.

Primitive restart with an arbitrary cut index was first supported as of
Haswell.  It's very doubtful that they'd take that away in future
hardware, so we may as well alter the check now.
ilo: replace util_blitter by ilo_blitter

ilo_blitter is just a wrapper for util_blitter for now.  We will port BLT code
to ilo_blitter shortly.
ilo: add BLT-based blitting methods to ilo_blitter

Port BLT code in ilo_blit.c to BLT-based blitting methods of ilo_blitter.  Add
BLT-based clears.  The latter is verifed with util_clear(), but it is not in
use yet.
ilo: add pipe-based copy method to ilo_blitter

It enables accelerated resource_copy_region() when blt-based method fails.
draw: clear the draw buffers in draw

Moves clearing of the draw so target buffers to the draw
module. They had to be cleared in the drivers before
which was quite messy.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
draw: fix a regression in computing max elt

gl can use elts without setting indices, in which case
our eltMax was set to 0 and always invoking the overflow
condition. So by default set eltMax to maximum, it will
be curbed by draw_set_indexes (if it ever comes) and if
not then it will let gl's glVertexPointer/glDrawArrays
work correctly. Fixes piglit's
triangle-rasterization-overdraw test.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
gallium: replace bswap_32 calls with util_bswap32

byteswap.h and bswap_32 aren't portable, replace them with calls to
gallium's util_bswap32 as suggested by Mark Kettenis.  Lets these files
build on OpenBSD.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>