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 <gert.wollny@collabora.com> Reviewed-by: Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5085>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user