diff options
author | Dave Airlie <[email protected]> | 2018-02-19 04:55:52 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-02-21 00:01:28 +0000 |
commit | 952222ddd423bce3b6e836f3ae305cbad0622e22 (patch) | |
tree | 25349de9deb8e77de10923a9cdc89df1d7bf0637 /src/amd/common | |
parent | 77fd1b9187a3aec665257ced5e58fae6fc89290f (diff) |
radv/tess: don't need to look in constant for vertices_per_patch
This just avoids passing this value via user sgprs.
Reviewed-by: Samuel Pitoiset <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index ec4dd098ed1..351e6fa9efc 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -127,6 +127,7 @@ struct radv_shader_context { uint32_t tcs_patch_outputs_read; uint64_t tcs_outputs_read; + uint32_t tcs_vertices_per_patch; }; static inline struct radv_shader_context * @@ -2781,7 +2782,7 @@ static LLVMValueRef get_tcs_tes_buffer_address(struct radv_shader_context *ctx, LLVMValueRef param_stride, constant16; LLVMValueRef rel_patch_id = get_rel_patch_id(ctx); - vertices_per_patch = unpack_param(&ctx->ac, ctx->tcs_offchip_layout, 9, 6); + vertices_per_patch = LLVMConstInt(ctx->ac.i32, ctx->tcs_vertices_per_patch, false); num_patches = unpack_param(&ctx->ac, ctx->tcs_offchip_layout, 0, 9); constant16 = LLVMConstInt(ctx->ac.i32, 16, false); @@ -6905,11 +6906,13 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, ctx.abi.load_tess_varyings = load_tcs_varyings; ctx.abi.load_patch_vertices_in = load_patch_vertices_in; ctx.abi.store_tcs_outputs = store_tcs_output; + ctx.tcs_vertices_per_patch = shaders[i]->info.tess.tcs_vertices_out; } else if (shaders[i]->info.stage == MESA_SHADER_TESS_EVAL) { ctx.tes_primitive_mode = shaders[i]->info.tess.primitive_mode; ctx.abi.load_tess_varyings = load_tes_input; ctx.abi.load_tess_coord = load_tess_coord; ctx.abi.load_patch_vertices_in = load_patch_vertices_in; + ctx.tcs_vertices_per_patch = shaders[i]->info.tess.tcs_vertices_out; } else if (shaders[i]->info.stage == MESA_SHADER_VERTEX) { if (shader_info->info.vs.needs_instance_id) { if (ctx.options->key.vs.as_ls) { |