mesa: add SYSTEM_VALUE_SAMPLE_MASK_IN

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
glsl: add gl_SampleMaskIn[] builtin

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: add support for gl_SampleMaskIn[]

v2: - add assert so we don't run into trouble on Gen6.
    - adjust for Tapani's rearrangement of ir_variable

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
mesa: fix texture view use of _mesa_get_tex_image()

The target parameter to _mesa_get_tex_image() is a target enum, not an index.
When we're setting up faces for a cubemap, it should be
CUBE_MAP_POSITIVE_X .. CUBE_MAP_NEGATIVE_Z; for all other targets it
should be the same as the texobj's target.

Fixes broken cubemaps [had only +X face but claimed to have all] produced by
glTextureView, which then caused various crashes in the driver when we
tried to use them.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
i965: Treat Haswell as 75 in the surface format table.

Much like we do for G45.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
llvmpipe: (trivial) get rid of triangle subdivision code

This code was always problematic, and with 64bit rasterization we no longer
need it at all.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
llvmpipe: get rid of barycentric calculation of a0

Didn't really work as well as hoped (in particular it was not generally
more accurate), will solve this differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
gallivm: fix pointer type for stmxcsr/ldmxcsr

The argument is a i8 pointer not a i32 pointer (even though the value actually
stored/loaded IS i32). Older llvm versions didn't care but 3.2 and newer do
leading to crashes.

Reviewed-by: Zack Rusin <zackr@vmware.com>
st/dri: resolve sRGB buffers in linear colorspace

Reviewed-by: Brian Paul <brianp@vmware.com>
gallium/u_blitter: remove useless parameters from some functions

Reviewed-by: Brian Paul <brianp@vmware.com>
gallium/u_blitter: implement shader-based MSAA resolve

We need this for integer formats and upside-down blits, which Radeons don't
support for MSAA resolving.

It can be used by calling util_blitter_blit.

Reviewed-by: Brian Paul <brianp@vmware.com>
gallium/u_blitter: implement shader-based MSAA resolve with bilinear filtering

For scaled resolve. The filter is only good for magnification.

If somebody has an idea how to implement a good filter for minification,
I'm all ears. I'd have to use derivatives probably.

Reviewed-by: Brian Paul <brianp@vmware.com>
radeonsi: use shader-based MSAA resolving when hw-based one cannot be used

This fixes MSAA resolving for 32-bit integer colorbuffers, which isn't
implemented by the hardware.

It also fixes VM protection faults when resolving MSAA 2D array textures.
This may be a CB bug, because shader-based resolving works fine.

It may also be faster for upside-down and scaled blits.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
r600g: use shader-based MSAA resolving when hw-based one cannot be used

This fixes some MSAA integer tests.
radeonsi: move invariant regs to si_init_config

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
r600g: expose 32-bit integer vertex formats

This advertises GL_ARB_texture_buffer_object_rgb32.
freedreno: dummy-draw workaround for a320

Fixes gpu lockups in supertuxkart.

Signed-off-by: Rob Clark <robclark@freedesktop.org>