diff options
author | Kenneth Graunke <[email protected]> | 2014-11-08 01:39:14 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-11-27 20:25:14 -0800 |
commit | cea37f0911cf2d88f11a7a2afe4ab2351601571a (patch) | |
tree | 3c093614f5d8f0710f7ce46deaf988fe3668f4de /src/mesa/drivers/dri/i965/brw_shader.cpp | |
parent | 2315ae6653e0a85c9bd814e03e1474ec89b47211 (diff) |
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 <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_shader.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_shader.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 8e4f7795d82..8528d3ef727 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -450,10 +450,14 @@ brw_instruction_name(enum opcode op) case VEC4_OPCODE_PACK_BYTES: return "pack_bytes"; - case FS_OPCODE_DDX: - return "ddx"; - case FS_OPCODE_DDY: - return "ddy"; + case FS_OPCODE_DDX_COARSE: + return "ddx_coarse"; + case FS_OPCODE_DDX_FINE: + return "ddx_fine"; + case FS_OPCODE_DDY_COARSE: + return "ddy_coarse"; + case FS_OPCODE_DDY_FINE: + return "ddy_fine"; case FS_OPCODE_PIXEL_X: return "pixel_x"; @@ -724,7 +728,7 @@ backend_instruction::writes_accumulator_implicitly(struct brw_context *brw) cons return writes_accumulator || (brw->gen < 6 && ((opcode >= BRW_OPCODE_ADD && opcode < BRW_OPCODE_NOP) || - (opcode >= FS_OPCODE_DDX && opcode <= FS_OPCODE_LINTERP && + (opcode >= FS_OPCODE_DDX_COARSE && opcode <= FS_OPCODE_LINTERP && opcode != FS_OPCODE_CINTERP))); } |