st/wgl: Don't cache HDC anywhere.

Applications may destroy HDC at any time. So always get a HDC as needed.

Fixes lack of presents with Solidworks eDrawings when screen resolution is
changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: Note that OPCODE_RFL is not part of ARB_fp (it's NV_fp only).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Pass fragment depth to the fb write as a fs_reg, not an ir_variable.

This will be used for the ARB_fp change to use this backend.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Refactor rectangle/GL_CLAMP texture coordinate adjustment.

We'll want to reuse this for ARB_fp handling.

v2: Fold the remaining bit of emit_texcoord back into visit(ir_texture).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Pull ir_binop_min/ir_binop_max handling to a separate function.

This will be reused from the ARB_fp compiler.  I touched up the pre-gen6 path
to not overwrite dst in the first instruction, which prevents the need for
aliasing checks (we'll need that in the ARB_fp compiler, but it actually
hasn't been needed in this codebase since the revert of the nasty old
MOV-avoidance code).  I also made the conditional_mod between gen6 and
pre-gen6 consistent, which shouldn't matter except for denorm/(+/-)0
comparisons where the choice between left and right hand side of the
comparison changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Add a couple more algebraic cases that help some ARB_fp patterns.

ARB_fp doesn't go through the GLSL optimizer, and these were things you see
frequently thanks to conditionals being lowered to SLT/SGE and MUL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Reduce maximum GL_ARB_fragment_program instruction count to 1024.

I don't know of any programs that would need more than this.  The larger
programs I've seen have neared 100 instructions.  This prevent excessive
runtimes of automatic tests that attempt to test up to the exposed maximums
(like fp-long-alu).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Replace brw_wm_* with dumping code into the fs_visitor.

This makes a giant pile of code newly dead.  It also fixes TXB on newer
chipsets, which has been totally broken (I now have a piglit test for that).
It passes the same set of Ian's ARB_fragment_program tests.  It also improves
high-settings ETQW performance by 3.2 +/- 1.9% (n=3), thanks to better
optimization and having 8-wide along with 16-wide shaders.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24355
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Remove the old ARB_fragment_program backend.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Move constant propagation to the same codebase as copy prop.

This means that we don't get constant prop across into the first block after a
BRW_OPCODE_IF or a BRW_OPCODE_DO, but we have hope for properly doing it
across control flow at some point.  More importantly, with the next commit it
will help avoid O(n^2) with instruction count runtime for shaders that have
many constant moves.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/fs: Improve performance of copy/constant propagation.

Use a simple chaining hash table for the ACP.  This is not really very good,
because we still do a full walk of the tree per destination write, but it
still reduces fp-long-alu runtime from 5.3 to 3.9s.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i915g: Don't clobber I915_NEW_FS on new framebuffer.

This snuck in with a previous commit.
llvmpipe: remove unused variables to fix compile warnings
r600g: remove unused variables to fix compile warnings
softpipe: initialize quadColor2 to fix compile warnings
mesa: remove unused variables to fix compile warnings
st/mesa: remove unused variables to fix compile warnings
mesa: minor whitespace fixes in teximage.c
Revert "st/mesa: remove unused variables to fix compile warnings"

This reverts commit 810d2e167c5a507084d1865a260809b847ca3201.

The pscreen variable is used in an assertion.  Use "(void) pscreen;"
to silence the warning.
nvc0: fix missing permanent bo reference on poly cache

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>