i965/vec4/scalarize_df: do not scalarize swizzles that we can support natively
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 19 Jul 2016 07:28:04 +0000 (09:28 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 3 Jan 2017 10:26:51 +0000 (11:26 +0100)
commitc3edacaa288ae01c0f37e645737feeeb48f2c3f2
treed46e37f5a9e0646937ac519499bb648491de1f3f
parent2f0bc54e2bf6c7d218f30acc88f5cb94bd6214f7
i965/vec4/scalarize_df: do not scalarize swizzles that we can support natively

Certain swizzles like XYZW can be supported by translating only the first two
64-bit swizzle channels to 32-bit channels. This happens with swizzles such
that the first two logical components, when translated to 32-bit channels and
replicated across the second dvec2 row, select the same channels specified by
the 3rd and 4th logical swizzle components.

Notice that this opens up the possibility that some instructions are not
scalarized and can end up with XY or ZW 32-bit writemasks. Make sure we always
scalarize in such cases.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_reg.h
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4.h