glsl: lower mediump partial derivatives

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002>
This commit is contained in:
Marek Olšák
2020-05-09 21:38:34 -04:00
committed by Marge Bot
parent 6fe20ebaaa
commit 1192989533
4 changed files with 37 additions and 6 deletions

View File

@@ -399,12 +399,13 @@ find_lowerable_rvalues_visitor::visit_enter(ir_expression *ir)
stack.back().state = CANT_LOWER;
/* Don't lower precision for derivative calculations */
if (ir->operation == ir_unop_dFdx ||
ir->operation == ir_unop_dFdx_coarse ||
ir->operation == ir_unop_dFdx_fine ||
ir->operation == ir_unop_dFdy ||
ir->operation == ir_unop_dFdy_coarse ||
ir->operation == ir_unop_dFdy_fine) {
if (!options->LowerPrecisionDerivatives &&
(ir->operation == ir_unop_dFdx ||
ir->operation == ir_unop_dFdx_coarse ||
ir->operation == ir_unop_dFdx_fine ||
ir->operation == ir_unop_dFdy ||
ir->operation == ir_unop_dFdy_coarse ||
ir->operation == ir_unop_dFdy_fine)) {
stack.back().state = CANT_LOWER;
}