diff options
author | Bas Nieuwenhuizen <[email protected]> | 2018-01-22 09:01:29 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-01-23 12:58:48 +0100 |
commit | 5a4dc285002e1924dbc8c72d17481a3dbc4c0142 (patch) | |
tree | 977d705fc1df4ebcfa904c32d560a766e356e969 /src/amd | |
parent | de00e8227b00740e3fe91c5c8fd0b2498751606c (diff) |
ac/nir: Use instance_rate_inputs per attribute, not per variable.
This did the wrong thing if we had e.g. an array for which only some
of the attributes use the instance index. Tripped up some new CTS
tests.
CC: <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 9ba324a5132..cc3af773863 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -5311,21 +5311,20 @@ handle_vs_input_decl(struct nir_to_llvm_context *ctx, variable->data.driver_location = idx * 4; - if (ctx->options->key.vs.instance_rate_inputs & (1u << index)) { - buffer_index = LLVMBuildAdd(ctx->builder, ctx->abi.instance_id, - ctx->abi.start_instance, ""); - if (ctx->options->key.vs.as_ls) { - ctx->shader_info->vs.vgpr_comp_cnt = - MAX2(2, ctx->shader_info->vs.vgpr_comp_cnt); - } else { - ctx->shader_info->vs.vgpr_comp_cnt = - MAX2(1, ctx->shader_info->vs.vgpr_comp_cnt); - } - } else - buffer_index = LLVMBuildAdd(ctx->builder, ctx->abi.vertex_id, - ctx->abi.base_vertex, ""); - for (unsigned i = 0; i < attrib_count; ++i, ++idx) { + if (ctx->options->key.vs.instance_rate_inputs & (1u << (index + i))) { + buffer_index = LLVMBuildAdd(ctx->builder, ctx->abi.instance_id, + ctx->abi.start_instance, ""); + if (ctx->options->key.vs.as_ls) { + ctx->shader_info->vs.vgpr_comp_cnt = + MAX2(2, ctx->shader_info->vs.vgpr_comp_cnt); + } else { + ctx->shader_info->vs.vgpr_comp_cnt = + MAX2(1, ctx->shader_info->vs.vgpr_comp_cnt); + } + } else + buffer_index = LLVMBuildAdd(ctx->builder, ctx->abi.vertex_id, + ctx->abi.base_vertex, ""); t_offset = LLVMConstInt(ctx->ac.i32, index + i, false); t_list = ac_build_load_to_sgpr(&ctx->ac, t_list_ptr, t_offset); |