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. 6
      src/vrend_shader.c

@ -4839,6 +4839,12 @@ iter_instruction(struct tgsi_iterate_context *iter,
emit_op1("floor");
break;
case TGSI_OPCODE_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;
case TGSI_OPCODE_ISSG:

Loading…
Cancel
Save