radv,aco: use per-attribute vertex descriptors for robustness
We have to use a different num_records for each attribute to correctly implement robust buffer access. fossil-db (GFX10.3, robustBufferAccess enabled): Totals from 60059 (41.06% of 146267) affected shaders: VGPRs: 2169040 -> 2169024 (-0.00%); split: -0.02%, +0.02% CodeSize: 79473128 -> 81156016 (+2.12%); split: -0.00%, +2.12% MaxWaves: 1635360 -> 1635258 (-0.01%); split: +0.00%, -0.01% Instrs: 15559040 -> 15793205 (+1.51%); split: -0.01%, +1.52% Latency: 90954792 -> 91308768 (+0.39%); split: -0.30%, +0.69% InvThroughput: 14937873 -> 14958761 (+0.14%); split: -0.04%, +0.18% VClause: 444280 -> 412074 (-7.25%); split: -9.22%, +1.97% SClause: 588545 -> 644141 (+9.45%); split: -0.54%, +9.99% Copies: 1010395 -> 1011232 (+0.08%); split: -0.44%, +0.53% Branches: 274279 -> 274282 (+0.00%); split: -0.00%, +0.00% PreSGPRs: 1431171 -> 1405056 (-1.82%); split: -2.89%, +1.07% PreVGPRs: 1575253 -> 1575259 (+0.00%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7871>
This commit is contained in:
@@ -107,7 +107,7 @@ count_vs_user_sgprs(struct radv_shader_args *args)
|
||||
{
|
||||
uint8_t count = 1; /* vertex offset */
|
||||
|
||||
if (args->shader_info->vs.has_vertex_buffers)
|
||||
if (args->shader_info->vs.vb_desc_usage_mask)
|
||||
count++;
|
||||
if (args->shader_info->vs.needs_draw_id)
|
||||
count++;
|
||||
@@ -268,7 +268,7 @@ declare_vs_specific_input_sgprs(struct radv_shader_args *args, gl_shader_stage s
|
||||
{
|
||||
if (!args->is_gs_copy_shader && (stage == MESA_SHADER_VERTEX ||
|
||||
(has_previous_stage && previous_stage == MESA_SHADER_VERTEX))) {
|
||||
if (args->shader_info->vs.has_vertex_buffers) {
|
||||
if (args->shader_info->vs.vb_desc_usage_mask) {
|
||||
ac_add_arg(&args->ac, AC_ARG_SGPR, 1, AC_ARG_CONST_DESC_PTR, &args->ac.vertex_buffers);
|
||||
}
|
||||
ac_add_arg(&args->ac, AC_ARG_SGPR, 1, AC_ARG_INT, &args->ac.base_vertex);
|
||||
@@ -393,11 +393,12 @@ set_vs_specific_input_locs(struct radv_shader_args *args, gl_shader_stage stage,
|
||||
{
|
||||
if (!args->is_gs_copy_shader && (stage == MESA_SHADER_VERTEX ||
|
||||
(has_previous_stage && previous_stage == MESA_SHADER_VERTEX))) {
|
||||
if (args->shader_info->vs.has_vertex_buffers) {
|
||||
if (args->shader_info->vs.vb_desc_usage_mask) {
|
||||
set_loc_shader_ptr(args, AC_UD_VS_VERTEX_BUFFERS, user_sgpr_idx);
|
||||
}
|
||||
|
||||
unsigned vs_num = count_vs_user_sgprs(args) - args->shader_info->vs.has_vertex_buffers;
|
||||
unsigned vs_num =
|
||||
count_vs_user_sgprs(args) - (args->shader_info->vs.vb_desc_usage_mask ? 1 : 0);
|
||||
set_loc_shader(args, AC_UD_VS_BASE_VERTEX_START_INSTANCE, user_sgpr_idx, vs_num);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user