diff options
author | Gert Wollny <[email protected]> | 2019-08-13 18:08:34 +0200 |
---|---|---|
committer | Gert Wollny <[email protected]> | 2019-08-14 07:03:15 +0000 |
commit | 742d3c918f89dc263e15e67fb26dcee8c5c0eff8 (patch) | |
tree | aa1a603fd5d6788f6941c6dc80f02a5606c2e39d /src/gallium/auxiliary/tgsi/tgsi_exec.c | |
parent | b579af77f3c8e6bacbab06002cae386eae68a357 (diff) |
softpipe: Add support for ARB_derivative_control
Enables and passes piglits:
spec/ARB_drivative_control/
dfdx-coarse
dfdx-dfdy
dfdx-fine
dfdy-coarse
dfdy-fine
Signed-off-by: Gert Wollny <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/tgsi/tgsi_exec.c')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_exec.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 18ee27502b4..0633a4e708c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -218,6 +218,17 @@ micro_ddx(union tgsi_exec_channel *dst, } static void +micro_ddx_fine(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src) +{ + dst->f[0] = + dst->f[1] = src->f[TILE_TOP_RIGHT] - src->f[TILE_TOP_LEFT]; + dst->f[2] = + dst->f[3] = src->f[TILE_BOTTOM_RIGHT] - src->f[TILE_BOTTOM_LEFT]; +} + + +static void micro_ddy(union tgsi_exec_channel *dst, const union tgsi_exec_channel *src) { @@ -228,6 +239,16 @@ micro_ddy(union tgsi_exec_channel *dst, } static void +micro_ddy_fine(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src) +{ + dst->f[0] = + dst->f[2] = src->f[TILE_BOTTOM_LEFT] - src->f[TILE_TOP_LEFT]; + dst->f[1] = + dst->f[3] = src->f[TILE_BOTTOM_RIGHT] - src->f[TILE_TOP_RIGHT]; +} + +static void micro_dmul(union tgsi_double_channel *dst, const union tgsi_double_channel *src) { @@ -5398,10 +5419,18 @@ exec_instruction( exec_scalar_unary(mach, inst, micro_cos, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; + case TGSI_OPCODE_DDX_FINE: + exec_vector_unary(mach, inst, micro_ddx_fine, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); + break; + case TGSI_OPCODE_DDX: exec_vector_unary(mach, inst, micro_ddx, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; + case TGSI_OPCODE_DDY_FINE: + exec_vector_unary(mach, inst, micro_ddy_fine, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); + break; + case TGSI_OPCODE_DDY: exec_vector_unary(mach, inst, micro_ddy, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; |