[Mesa-dev] [PATCH 14/18] radeionsi: make si_llvm_emit_tcs_epilogue compatible with emit_outputs abi

Nicolai Hähnle nhaehnle at gmail.com
Tue Dec 12 09:55:23 UTC 2017


Typo in the subject: radeonsi

Cheers,
Nicolai

On 11.12.2017 03:43, Timothy Arceri wrote:
> ---
>   src/gallium/drivers/radeonsi/si_shader.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index 66d38415602..41698720df1 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -3241,23 +3241,26 @@ si_insert_input_ptr_as_2xi32(struct si_shader_context *ctx, LLVMValueRef ret,
>   	ptr = LLVMGetParam(ctx->main_fn, param);
>   	ptr = LLVMBuildPtrToInt(builder, ptr, ctx->i64, "");
>   	ptr = LLVMBuildBitCast(builder, ptr, ctx->v2i32, "");
>   	lo = LLVMBuildExtractElement(builder, ptr, ctx->i32_0, "");
>   	hi = LLVMBuildExtractElement(builder, ptr, ctx->i32_1, "");
>   	ret = LLVMBuildInsertValue(builder, ret, lo, return_index, "");
>   	return LLVMBuildInsertValue(builder, ret, hi, return_index + 1, "");
>   }
>   
>   /* This only writes the tessellation factor levels. */
> -static void si_llvm_emit_tcs_epilogue(struct lp_build_tgsi_context *bld_base)
> +static void si_llvm_emit_tcs_epilogue(struct ac_shader_abi *abi,
> +				      unsigned max_outputs,
> +				      LLVMValueRef *addrs)
>   {
> -	struct si_shader_context *ctx = si_shader_context(bld_base);
> +	struct si_shader_context *ctx = si_shader_context_from_abi(abi);
> +	struct lp_build_tgsi_context *bld_base = &ctx->bld_base;
>   	LLVMBuilderRef builder = ctx->ac.builder;
>   	LLVMValueRef rel_patch_id, invocation_id, tf_lds_offset;
>   
>   	si_copy_tcs_inputs(bld_base);
>   
>   	rel_patch_id = get_rel_patch_id(ctx);
>   	invocation_id = unpack_llvm_param(ctx, ctx->abi.tcs_rel_ids, 8, 5);
>   	tf_lds_offset = get_tcs_out_current_patch_data_offset(ctx);
>   
>   	if (ctx->screen->info.chip_class >= GFX9) {
> @@ -6046,21 +6049,22 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx,
>   		else
>   			ctx->abi.emit_outputs = si_llvm_emit_vs_epilogue;
>   		bld_base->emit_epilogue = si_tgsi_emit_epilogue;
>   		break;
>   	case PIPE_SHADER_TESS_CTRL:
>   		bld_base->emit_fetch_funcs[TGSI_FILE_INPUT] = fetch_input_tcs;
>   		ctx->abi.load_tess_inputs = si_nir_load_input_tcs;
>   		bld_base->emit_fetch_funcs[TGSI_FILE_OUTPUT] = fetch_output_tcs;
>   		bld_base->emit_store = store_output_tcs;
>   		ctx->abi.store_tcs_outputs = si_nir_store_output_tcs;
> -		bld_base->emit_epilogue = si_llvm_emit_tcs_epilogue;
> +		ctx->abi.emit_outputs = si_llvm_emit_tcs_epilogue;
> +		bld_base->emit_epilogue = si_tgsi_emit_epilogue;
>   		break;
>   	case PIPE_SHADER_TESS_EVAL:
>   		bld_base->emit_fetch_funcs[TGSI_FILE_INPUT] = fetch_input_tes;
>   		ctx->abi.load_tess_inputs = si_nir_load_input_tes;
>   		if (shader->key.as_es)
>   			ctx->abi.emit_outputs = si_llvm_emit_es_epilogue;
>   		else
>   			ctx->abi.emit_outputs = si_llvm_emit_vs_epilogue;
>   		bld_base->emit_epilogue = si_tgsi_emit_epilogue;
>   		break;
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list