diff options
author | Dave Airlie <[email protected]> | 2016-12-07 23:45:36 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-12-08 23:05:52 +0000 |
commit | c46c376977275a3327c42ad30ec4df4cb7a4b060 (patch) | |
tree | c44b7f74e80dfe57da305d5a3e15e06a5efa4f84 | |
parent | 2a33049c70020d4a6587ff3774c86575877af371 (diff) |
radv/ac: don't pass nir to create_function
This isn't needed for later things like geom shader copy shaders,
we won't have NIR.
Reviewed by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 0ad9a7a7e8d..84a1e2462b2 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -451,8 +451,7 @@ static void set_userdata_location_indirect(struct ac_userdata_info *ud_info, uin } #endif -static void create_function(struct nir_to_llvm_context *ctx, - struct nir_shader *nir) +static void create_function(struct nir_to_llvm_context *ctx) { LLVMTypeRef arg_types[23]; unsigned arg_idx = 0; @@ -483,7 +482,7 @@ static void create_function(struct nir_to_llvm_context *ctx, } array_count = arg_idx; - switch (nir->stage) { + switch (ctx->stage) { case MESA_SHADER_COMPUTE: arg_types[arg_idx++] = LLVMVectorType(ctx->i32, 3); /* grid size */ user_sgpr_count = arg_idx; @@ -532,7 +531,7 @@ static void create_function(struct nir_to_llvm_context *ctx, ctx->main_function = create_llvm_function( ctx->context, ctx->module, ctx->builder, NULL, 0, arg_types, arg_idx, array_count, sgpr_count, ctx->options->unsafe_math); - set_llvm_calling_convention(ctx->main_function, nir->stage); + set_llvm_calling_convention(ctx->main_function, ctx->stage); ctx->shader_info->num_input_sgprs = 0; @@ -545,7 +544,7 @@ static void create_function(struct nir_to_llvm_context *ctx, for (; i < sgpr_count; i++) ctx->shader_info->num_input_sgprs += llvm_get_type_size(arg_types[i]) / 4; - if (nir->stage != MESA_SHADER_FRAGMENT) + if (ctx->stage != MESA_SHADER_FRAGMENT) for (; i < arg_idx; ++i) ctx->shader_info->num_input_vgprs += llvm_get_type_size(arg_types[i]) / 4; @@ -567,7 +566,7 @@ static void create_function(struct nir_to_llvm_context *ctx, user_sgpr_idx += 2; } - switch (nir->stage) { + switch (ctx->stage) { case MESA_SHADER_COMPUTE: set_userdata_location_shader(ctx, AC_UD_CS_GRID_SIZE, user_sgpr_idx, 3); user_sgpr_idx += 3; @@ -4680,7 +4679,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, for (i = 0; i < AC_UD_MAX_UD; i++) shader_info->user_sgprs_locs.shader_data[i].sgpr_idx = -1; - create_function(&ctx, nir); + create_function(&ctx); if (nir->stage == MESA_SHADER_COMPUTE) { int num_shared = 0; |