mesa: Add support for GL_ARB_base_instance

Reviewed-by: Brian Paul <brianp@vmware.com>
gallium: Add PIPE_CAP_START_INSTANCE

Reviewed-by: Brian Paul <brianp@vmware.com>
st/mesa: Add support for GL_ARB_base_instance

Reviewed-by: Brian Paul <brianp@vmware.com>
docs: update GL3.txt for ARB_base_instance

Reviewed-by: Brian Paul <brianp@vmware.com>
radeon/llvm: Fix sin/cos codegen on R700

Based on https://bugs.freedesktop.org/show_bug.cgi?id=50317#c4

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=50316
https://bugs.freedesktop.org/show_bug.cgi?id=50317

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
radeon/llvm: Fix CR/LF in Processors.td

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
r600g: fix z/stencil texture creation v2

z or stencil texture should not be created with the z/stencil
flags for surface creation as they are intended to be bound
as texture.

v2: remove broken code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
st/mesa: move st_validate_state() call earlier in st_DrawPixels()
st/mesa: clamp glDrawPixels size to max texture size
softpipe: Offset is not to be applied to the layer parameter of array texture fetches.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
draw: fix flat shading and screen-space linear interpolation in clipper

This includes:
- picking up correctly which attributes are flatshaded and which are
  noperspective

- copying the flatshaded attributes when needed, including the
  non-built-in ones

- correctly interpolating the noperspective attributes in screen-space
  instead than in a 3d-correct fashion.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
llvmpipe: Simplify and fix system variables fetch.

The system array values concept doesn't really because it expects the
system values to be fixed per call, which is wrong for gl_VertexID and
iffy for gl_SampleID.  So this patch does two things:

- kill the array, have emit_fetch_system_value directly pick the
  values it needs (only gl_InstanceID for now, as the previous code)

- correctly handle the expected type in emit_fetch_system_value

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
llvmpipe: Add vertex id support.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
i965: Don't set brw_wm_prog_key::iz_lookup on Gen6+.

Sandy Bridge and later don't use this field, so there's no point in
setting it.  It can only cause harmful state-based recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
st/vdpau: clear Cb&Cr with 0.5f

That makes the output black in case of decoding errors.

Signed-off-by: Christian König <deathsimple@vodafone.de>
st/vdpau: use template size as default for source_rect.

Fixes alignment problems with flash player.

Signed-off-by: Christian König <deathsimple@vodafone.de>
mesa: remove obsolete confdiff.sh

this script is obsolete since
0cc216676c96efacb0e1eb82457e6a83920ae704
i965/msaa: Disable unsupported formats.

Due to hardware limitations, MSAA is unsupported on Gen6 for formats
containing >64 bits of data per pixel.  From the Sandy Bridge PRM,
vol4 part1, p72 ("Surface Format"):

    If Number of Multisamples is set to a value other than
    MULTISAMPLECOUNT_1, this field cannot be set to the following
    formats:
    - any format with greater than 64 bits per element
    - any compressed texture format (BC*)
    - any YCRCB* format

Gen7 has a similar, but less stringent limitation: formats with >64
bits of data per pixel only support 4x MSAA.

This patch causes the unsupported formats to report
GL_FRAMEBUFFER_UNSUPPORTED.

Fixes piglit "multisample-formats" tests on Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
i965/msaa: Only do multisample rasterization if GL_MULTISAMPLE enabled.

From the GL 3.0 spec (p.116):

    "Multisample rasterization is enabled or disabled by calling
    Enable or Disable with the symbolic constant MULTISAMPLE."

Elsewhere in the spec, where multisample rasterization is described
(sections 3.4.3, 3.5.4, and 3.6.6), the following text is consistently
used:

    "If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is
    one, then..."

So, in other words, disabling GL_MULTISAMPLE should prevent
multisample rasterization from occurring, even if the draw framebuffer
is multisampled.  This patch implements that behaviour by setting the
WM and SF stage's "multisample rasterization mode" to
MSRAST_ON_PATTERN only when the draw framebuffer is multisampled *and*
GL_MULTISAMPLE is enabled.

Fixes piglit test spec/EXT_framebuffer_multisample/enable-flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
msaa: Add IsCentroid bitfield to gl_fragment_program.

This bitfield tells the back-ends which of a fragment shader's inputs
require centroid interpolation.