ac: move tg_size to the ABI
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 9 Feb 2018 12:54:19 +0000 (13:54 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 12 Feb 2018 10:54:04 +0000 (11:54 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_shader_abi.h

index e82348b83b02a950e3cca9fa8c2484c56eead98a..9d149b49eabe8891ff925164aee1c493cd43b95c 100644 (file)
@@ -87,7 +87,6 @@ struct nir_to_llvm_context {
        LLVMValueRef ring_offsets;
        LLVMValueRef push_constants;
        LLVMValueRef view_index;
-       LLVMValueRef tg_size;
 
        LLVMValueRef vertex_buffers;
        LLVMValueRef rel_auto_id;
@@ -789,7 +788,7 @@ static void create_function(struct nir_to_llvm_context *ctx,
                }
 
                if (ctx->shader_info->info.cs.uses_local_invocation_idx)
-                       add_arg(&args, ARG_SGPR, ctx->ac.i32, &ctx->tg_size);
+                       add_arg(&args, ARG_SGPR, ctx->ac.i32, &ctx->abi.tg_size);
                add_arg(&args, ARG_VGPR, ctx->ac.v3i32,
                        &ctx->abi.local_invocation_ids);
                break;
@@ -3906,7 +3905,7 @@ visit_load_local_invocation_index(struct nir_to_llvm_context *ctx)
 {
        LLVMValueRef result;
        LLVMValueRef thread_id = ac_get_thread_id(&ctx->ac);
-       result = LLVMBuildAnd(ctx->builder, ctx->tg_size,
+       result = LLVMBuildAnd(ctx->builder, ctx->abi.tg_size,
                              LLVMConstInt(ctx->ac.i32, 0xfc0, false), "");
 
        return LLVMBuildAdd(ctx->builder, result, thread_id, "");
index 9499c1a15fd04eb169354cde0043ff7b4e9e2c51..5d52584996625746edbdbbadfe97b957a0381d21 100644 (file)
@@ -58,6 +58,7 @@ struct ac_shader_abi {
        LLVMValueRef local_invocation_ids;
        LLVMValueRef num_work_groups;
        LLVMValueRef workgroup_ids[3];
+       LLVMValueRef tg_size;
 
        /* For VS and PS: pre-loaded shader inputs.
         *