From: Gert Wollny Date: Wed, 6 May 2020 21:25:03 +0000 (+0200) Subject: r600: Lower int64 ops from TGSI-to-NIR shaders too X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b689de3444ab053e2b81022537ae31fb2c38b82d;p=mesa.git r600: Lower int64 ops from TGSI-to-NIR shaders too r600 uses a TGSI shaders with 64 bit ints for a query compute shader. v2: Use screen version of tgsi_to_nir and fix compile error Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 7784f35c317..346498cd98a 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -194,9 +194,18 @@ int r600_pipe_shader_create(struct pipe_context *ctx, goto error; } } else { - if (sel->ir_type == PIPE_SHADER_IR_TGSI) - sel->nir = tgsi_to_nir_noscreen(sel->tokens, &r600_nir_options); + if (sel->ir_type == PIPE_SHADER_IR_TGSI) { + sel->nir = tgsi_to_nir(sel->tokens, ctx->screen, true); + /* Lower int64 ops because we have some r600 build-in shaders that use it */ + if (!ctx->screen->get_param(ctx->screen, PIPE_CAP_DOUBLES)) { + NIR_PASS_V(sel->nir, nir_lower_regs_to_ssa); + NIR_PASS_V(sel->nir, nir_lower_alu_to_scalar, NULL, NULL); + NIR_PASS_V(sel->nir, nir_lower_int64, ~0); + NIR_PASS_V(sel->nir, nir_opt_vectorize); + } + } nir_tgsi_scan_shader(sel->nir, &sel->info, true); + r = r600_shader_from_nir(rctx, shader, &key); if (r) { fprintf(stderr, "--Failed shader--------------------------------------------------\n");