shader: Prefer roundEven in generated GLSL

There is no TGSI OPCODE for roundEven, prefer roundEven
so roundEven in guest gets translated to roundEven.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Lepton Wu 5 years ago
parent b17ba74ae5
commit c86d06c65e
  1. 8
      src/vrend_shader.c

@ -4839,7 +4839,13 @@ iter_instruction(struct tgsi_iterate_context *iter,
emit_op1("floor"); emit_op1("floor");
break; break;
case TGSI_OPCODE_ROUND: case TGSI_OPCODE_ROUND:
emit_op1("round"); // There is no TGSI OPCODE for roundEven, prefer roundEven
// so roundEven in guest gets translated to roundEven.
if ((ctx->cfg->use_gles && ctx->cfg->glsl_version >= 300) ||
ctx->cfg->glsl_version >= 400)
emit_op1("roundEven");
else
emit_op1("round");
break; break;
case TGSI_OPCODE_ISSG: case TGSI_OPCODE_ISSG:
emit_op1("sign"); emit_op1("sign");

Loading…
Cancel
Save