summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-12-20 20:56:07 +0100
committerSamuel Pitoiset <[email protected]>2017-12-27 10:25:17 +0100
commit3260a96c17a5738004cd7b126d934331b119c8ce (patch)
treeb174ac58291c7dddc38955b9c70db5c6d326006e /src
parent4221a816e26f793bd75074fea81b0a3deab76b5e (diff)
amd/common: rework set_userdata_location() and rename to set_loc()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 89ef9afcf1c..d9f2cb408c3 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -504,12 +504,14 @@ get_tcs_out_current_patch_data_offset(struct nir_to_llvm_context *ctx)
"");
}
-static void set_userdata_location(struct ac_userdata_info *ud_info, uint8_t *sgpr_idx, uint8_t num_sgprs)
+static void
+set_loc(struct ac_userdata_info *ud_info, uint8_t *sgpr_idx, uint8_t num_sgprs,
+ uint32_t indirect_offset)
{
ud_info->sgpr_idx = *sgpr_idx;
ud_info->num_sgprs = num_sgprs;
- ud_info->indirect = false;
- ud_info->indirect_offset = 0;
+ ud_info->indirect = indirect_offset > 0;
+ ud_info->indirect_offset = indirect_offset;
*sgpr_idx += num_sgprs;
}
@@ -517,7 +519,11 @@ static void
set_loc_shader(struct nir_to_llvm_context *ctx, int idx, uint8_t *sgpr_idx,
uint8_t num_sgprs)
{
- set_userdata_location(&ctx->shader_info->user_sgprs_locs.shader_data[idx], sgpr_idx, num_sgprs);
+ struct ac_userdata_info *ud_info =
+ &ctx->shader_info->user_sgprs_locs.shader_data[idx];
+ assert(ud_info);
+
+ set_loc(ud_info, sgpr_idx, num_sgprs, 0);
}
static void
@@ -528,10 +534,7 @@ set_loc_desc(struct nir_to_llvm_context *ctx, int idx, uint8_t *sgpr_idx,
&ctx->shader_info->user_sgprs_locs.descriptor_sets[idx];
assert(ud_info);
- ud_info->sgpr_idx = *sgpr_idx;
- ud_info->num_sgprs = 2;
- ud_info->indirect = indirect_offset > 0;
- ud_info->indirect_offset = indirect_offset;
+ set_loc(ud_info, sgpr_idx, 2, indirect_offset);
}
struct user_sgpr_info {