mesa/vbo: Plumb ctx through to the conv_i(10|2)_to_norm_float functions.

The rules for converting these values actually depend on the current
context API and version.  The next patch will implement those changes.

v2: Mark ctx as const, as suggested by Brian.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
mesa/vbo: Support the ES 3.0 signed normalized scaling rules.

Traditionally, OpenGL has had two separate equations for converting from
signed normalized fixed-point data to floating point data.  One was used
primarily for vertex data, while the other was primarily for texturing
and framebuffer data.

However, ES 3.0 and GL 4.2 change this, declaring there's only one
equation to be used in all cases.  Unfortunately, it's the other one.

v2: Correctly convert 0b10 to -1.0, as pointed out by Chris Forbes.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
mesa/vbo: Check for invalid types in various packed vertex functions.

According to the ARB_vertex_type_2_10_10_10_rev specification:
"The error INVALID_ENUM is generated by VertexP*, NormalP*,
 TexCoordP*, MultiTexCoordP*, ColorP*, or SecondaryColorP if <type>
 is not UNSIGNED_INT_2_10_10_10_REV or INT_2_10_10_10_REV."

Fixes 7 subcases of oglconform's packed-vertex test.

v2: Add "gl" prefix to error messages (pointed out by Brian).
    Also rebase atop the ctx plumbing.

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: remove '(void) k' lines

Serves no purpose as the k parameter is used later in the code.
vbo: minor whitespace fix
vbo: move code after declarations to fix MSVC errors

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
vbo: move another line of code after declarations

Signed-off-by: Brian Paul <brianp@vmware.com>
configure.ac: Remove -O., -g and -Wall from LLVM_C{PP,XX}FLAGS.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
scons: Build ws_xlib on Mac OS X.

Fixes this SCons build error on Mac OS X if X11 is found.

NameError: name 'ws_xlib' is not defined:
  File "SConstruct", line 144:
    duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/SConscript", line 34:
    SConscript('gallium/SConscript')
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/gallium/SConscript", line 135:
    'targets/libgl-xlib/SConscript',
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/gallium/targets/graw-xlib/SConscript", line 9:
    ws_xlib,

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
radeonsi: Fix z/stencil texture creation.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>

[ Cherry-picked from r600g commit b4f0ab0b22625ac1bb3cf16342039557c086ebae ]
radeonsi: Fix sampler views for depth textures.

Consistently reference the flushed depth texture in the sampler view, not the
original one.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Flesh out support for depth/stencil exports from the pixel shader.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Depth/stencil fixes.

Adapted from r600g commit 018e3f75d69490598d61059ece56d379867f3995.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: correct texture memory size for Z32F_S8X24

[ Cherry-picked from r600g commit ea72351a919c594e7f40e901dca42aebb866f8a6 ]
radeonsi: Use explicit stencil mipmap level offsets.

Extracted from r600g commit 428e37c2da420f7dc14a2ea265f2387270f9bee1.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: remove redundant parameter in r600_init_surface

[ Cherry-picked from r600g commit f5ac60152b10b04d38e77db6b904dd50d1a54d6c ]
radeonsi: Re-enable Z16 depth buffers.

8 more piglits.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
radeonsi: Reinstate assertions against invalid colour/depth formats.

radeonsi now supports Z16 and doesn't fail these assertions anymore.

This partially reverts commit 7bba4879bb79719e22a18b52759b1d1d839c783c, but
leaves the error messages in place to allow diagnosing such problems even with
non-debugging builds.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
gallivm: fix multiple lods with different min/mag filter and wide vectors

broken since 529fe420ba6836479619ba42e53665724755fc1c,
I forgot some code, only added the comment...
Fixes bug 57644.
mesa: fix BlitFramebuffer between linear and sRGB formats

NOTE: This is a candidate for the stable branches.

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