i965/fs: Handle derivative quality decisions in the front-end.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Nov 2014 09:39:14 +0000 (01:39 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 28 Nov 2014 04:25:14 +0000 (20:25 -0800)
commitcea37f0911cf2d88f11a7a2afe4ab2351601571a
tree3c093614f5d8f0710f7ce46deaf988fe3668f4de
parent2315ae6653e0a85c9bd814e03e1474ec89b47211
i965/fs: Handle derivative quality decisions in the front-end.

Kristian noted that there's very little use of brw_wm_prog_key in the
generator, and that it basically just generates what it's told, without
caring about what stage it's handling.

One exception to this is derivative handling.  When handling dFdxCoarse
and dFdxFine, we packed an enum value in a second source register,
explicitly telling the generator what to do.  For dFdx, we specified an
enum value of "please use the hint", then checked the program key in the
generator level code.

A natural method is to define separate FS_OPCODE_DD[XY]_{COARSE,FINE}
opcodes, and have the front-end (which already decides what IR to
generate based on the program key) decide which dPdx/dPdy should
correspond to.  This consolidates the decision making in one place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp