i965: Report the type of color clear in INTEL_DEBUG=blorp.

It's useful to know whether a clear is fast (MCS-based), using the
SIMD16 repdata message, or slow.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
st/mesa: recreate sampler view on context change v3

With shared glx contexts it is possible that a texture is create and used
in one context and then used in another one resulting in incorrect
sampler view usage.

v2: avoid template copy
v3: add XXX comment

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: Fix format matching checks for GL_INTENSITY* internalformats.

GL_INTENSITY has never been valid as a pixel format -- to get the memcpy
pack/unpack paths, the app needs to specify GL_RED as the pixel format
(or GL_RED_INTEGER for the integer formats).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlier

The ARB_framebuffer_object spec lists this case before the
FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases.

Fixes two broken cases in piglit's fbo-incomplete test, if
ARB_ES2_compatibility is not advertised. (If it is, this is masked
because the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER /
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases are removed by that extension)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
i965/vec4: Add missing doxygen close brace.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Add and use vec4_instruction::writes_flag().

To be consistent with the fs backend. Also the instruction scheduler
incorrectly considered SEL with a conditional modifier to read the flag
register.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Rename depends_on_flags() to reads_flag().

To be consistent with the fs backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Print the predicate in dump_instructions().

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Add is_null() method to dst_reg.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Preparatory clean up of dead_code_eliminate().

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Don't dead code eliminate instructions writing the flag.

A future patch adds support for removing dead writes to the flag
register. This patch simplifies the logic until then.

total instructions in shared programs: 811813 -> 811869 (0.01%)
instructions in affected programs:     3378 -> 3434 (1.66%)

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Track live ranges per-channel, not per vgrf.

Will be squashed with the next patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Let dead code eliminate trim dead channels.

That is, modify

   mad dst, a, b, c

to be

   mad dst.xyz, a, b, c

if dst.w is never read.

total instructions in shared programs: 811869 -> 805582 (-0.77%)
instructions in affected programs:     168287 -> 162000 (-3.74%)

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Factor code out of DCE into a separate function.

Will be reused in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Eliminate writes that are never read.

With an awful O(n^2) algorithm that searches previous instructions for
dead writes.

total instructions in shared programs: 805582 -> 788074 (-2.17%)
instructions in affected programs:     144561 -> 127053 (-12.11%)

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/vec4: Eliminate dead writes to the flag register.

For each write, search previous instructions for unread writes to the
flag register and remove them. Note that this will not eliminate the
last unread write.

total instructions in shared programs: 788074 -> 788004 (-0.01%)
instructions in affected programs:     4930 -> 4860 (-1.42%)

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Add an env var for forcing window system MSAA.

Sometimes it would be nice to benchmark some app with MSAA versus not, but
it doesn't offer the controls you want.  Just provide a handy knob to
force the issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Don't forget to free the old singlesample_mt.

Fixes a memory leak with MSAA winsys buffers since my move of
singlesample_mt to the rb in 4e0924c5de5f3964e4ca81f923d877dbb59fad0a

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Simplify the no-reopening-the-winsys-buffer tests.

The formatting was weird, and the tests were duplicated, and it is
guaranteed that mt->region exists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Skip reallocating the private MSAA miptree, unless it's resized.

Even if the singlesample_mt got reopened from DRI due to
pageflipping/buffer swapping, our private miptree shouldn't need any
changes.

Improves performance of a little swapbuffers-loving microbenchmark with
MSAA forced on, by 1.2371% +/- 0.624802% (n=102)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>