i965: Move PSCDEPTH calculations from draw time to compile time.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 30 Nov 2014 09:14:17 +0000 (01:14 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 4 Dec 2014 23:04:35 +0000 (15:04 -0800)
commit8daf3c53c7df806f7302446acb8a58d391f69779
tree753ff5de419c6ab93481f467686b4d433ec294de
parent4265148ac62366033cfa6ae37e6a8f8c3e1fa864
i965: Move PSCDEPTH calculations from draw time to compile time.

The "Pixel Shader Computed Depth Mode" value is entirely based on the
shader program, so we can easily do it at compile time.  This avoids the
if+switch on every 3DSTATE_WM (Gen7)/3DSTATE_PS_EXTRA (Gen8+) upload,
and shares a bit more code.

This also simplifies the PMA stall code, making it match the formula
more closely, and drops a BRW_NEW_FRAGMENT_PROGRAM dependency.  (Note
that the previous comment was wrong - the code and the documentation
have != PSCDEPTH_OFF, not ==.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/gen7_wm_state.c
src/mesa/drivers/dri/i965/gen8_depth_state.c
src/mesa/drivers/dri/i965/gen8_ps_state.c