mesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
meta: add 'f' suffix to floats to silence some MSVC warnings
st/mesa: simplify some src/dst surface setup in BlitFramebuffer

Use the renderbuffer attachment pointers that we grabbed earlier.

Reviewed-by: Reviewed-by: Marek Olšák <maraeo@gmail.com>
st/mesa: a couple fixes for st_BlitFramebuffer()

1. Loop over multiple destination color buffers.  If we set
glDrawBuffers(GL_FRONT_AND_BACK) we need to loop over multiple color
buffers, blitting to each.

2. Add checks for null src/dst surface pointers.  This fixes a crash
in the piglit fbo-missing-attachment-blit test.
See bug http://bugs.freedesktop.org/show_bug.cgi?id=59450

Reviewed-by: Reviewed-by: Marek Olšák <maraeo@gmail.com>
nv50: add space checks to clear functions, and respect depth

Thanks to calim for helping me find and fix the issue.
nvc0: add space checks to clear functions

Thanks to calim for helping me find and fix the issue.
radeonsi: Pass texture type to sampling intrinsics.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
nvc0: add support for accelerated video decoding through the dedicated engines

Currently the use of external firmware is required, with kernel and
userspace firmware needed for all Fermi cards except nvd9. Kepler and nvd9
should only require kernel firmware.
radeonsi: Consolidate calculation of tile mode index.

Apart from the obvious cleanup, this makes sure all blocks use the same tiling
mode for accessing the resource.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Enable tiling for depth/stencil resources.

Enabling it for all resources still seems to cause problems, but depth/stencil
buffers are always accessed with tiling by the DB block.

Also, stick to 1D tiling for now. Getting 2D tiling to work properly will
require substantial changes in libdrm_radeon and possibly the kernel as well.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Use proper hardware format for stencil texturing.

Fixes piglit 'spec/ARB_depth_buffer_float/fbo-clear-formats stencil' crash.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Set SPI_SHADER_COL_FORMAT to what the pixel shader actually exports.

Instead of deriving it from the colour buffer formats only.

Fixes a number of piglit tests which export depth from the pixel shader.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Fix Z24 texture formats.

About half a dozen more piglits.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: Actually keep track if we are using depth textures for samplers.

20-odd more piglits.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
swrast: fix assorted bugs in software blit code

1. The loop over dest buffers in blit_linear() needed a null pointer
check.  Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59499

2. The code to grab the drawRb's format needs to be inside the drawing loop.

3. An equality test was using = instead of == thus messing up a
renderbuffer attachment texture pointer.  This lead to memory
corruption and a crash at exit.

Finally, fix a capitalization error NumDrawBuffers -> numDrawBuffers
and change type to unsigned to fix signed/unsigned comparison warnings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
mesa: Don't allow DEPTH_STENCIL for 3D textures

Just like DEPTH_COMPONENT.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_type

Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already
done in texture_error_check because these combinations aren't allowed on
desktop GL either.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
llvmpipe: fix using wrong format with MRT in blend code

We were passing in the rt index however this was always 0 for non-independent
blend case. (The format was only actually used to decide if the color mask
covered all channels so this went unnoticed and was discovered by accident.)
Additionally, there was a second problem because we do fixups in the key based
on color buffer format we cannot use non-independent blend anyway as the fixed
up values would never get used.
So always turn non-independent blending into independent.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
llvmpipe: trivial code and comment cleanup.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
llvmpipe: more fixes for integer color buffers

Cast back the fake floats to ints, and make sure we don't try to do scaling
in format conversion (which only makes sense with normalized values).
Also need to disable blending and alpha test (as per spec) for such buffers.
This makes fbo-blending from the piglit ext_texture_integer tests work for most
formats (some crash, and the luminance and intensity variants have the GB or
GBA channels respectively wrong).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>