i965/blorp: Add support for non-render-target formats.
i965/blorp: Add support for non-render-target formats.

Once blorp gains the ability to do format conversions, it's conceivable
that the source format may be texturable but not supported as a render
target.  This would break Paul's code, which assumes that it can use the
render_target_format array even for the source format.

There are three ways to convert MESA_FORMAT enums to BRW_SURFACEFORMAT
enums:

1. brw_format_for_mesa_format()

   This translates the Mesa format to the most equivalent BRW format.

2. brw->render_target_format[]

   This is used for renderbuffers, and handles the subset of formats
   that are renderable.  However, it's not always equivalent, since
   it overrides a few non-renderable formats.  For example, it
   converts B8G8R8X8_UNORM to B8G8R8A8_UNORM so it can be rendered to.

3. translate_tex_format()

   This is used for textures.  It wraps brw_format_for_mesa_format(),
   but overrides depth textures, and one sRGB case on Gen4.

BLORP has a fourth function, which uses brw->render_target_format[]
and overrides depth formats (differently than translate_tex_format).

This patch makes the BLORP function to use brw_format_for_mesa_format()
for textures/source data, since not everything will be a render target.
It continues using brw->render_target_format[] for render targets, since
it needs the format overrides that provides.

We don't use translate_tex_format() since the additional overrides are
not useful or simply redundant.

Signed-off-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>
Reviewed-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>
Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>
Reviewed-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,mcanthony/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,wolf96/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer