From cecd4aad4605de47c056913ed430ad38f14625e5 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 20 May 2020 09:55:37 +0200 Subject: [PATCH] aco: implement nir_intrinsic_shader_clock with device scope Use s_memrealtime instead. Signed-off-by: Samuel Pitoiset Reviewed-by: Rhys Perry Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index d9a5742164c..fa9937dabe9 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -7958,10 +7958,14 @@ void visit_intrinsic(isel_context *ctx, nir_intrinsic_instr *instr) get_ssa_temp(ctx, &instr->dest.ssa)); break; } - case nir_intrinsic_shader_clock: - bld.smem(aco_opcode::s_memtime, Definition(get_ssa_temp(ctx, &instr->dest.ssa)), false); + case nir_intrinsic_shader_clock: { + aco_opcode opcode = + nir_intrinsic_memory_scope(instr) == NIR_SCOPE_DEVICE ? + aco_opcode::s_memrealtime : aco_opcode::s_memtime; + bld.smem(opcode, Definition(get_ssa_temp(ctx, &instr->dest.ssa)), false); emit_split_vector(ctx, get_ssa_temp(ctx, &instr->dest.ssa), 2); break; + } case nir_intrinsic_load_vertex_id_zero_base: { Temp dst = get_ssa_temp(ctx, &instr->dest.ssa); bld.copy(Definition(dst), get_arg(ctx, ctx->args->ac.vertex_id)); -- 2.30.2