mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
ac/radeonsi: add load_base_vertex() to the abi
Fixes the following piglit tests: ./bin/arb_shader_draw_parameters-basevertex basevertex -auto -fbo ./bin/arb_shader_draw_parameters-basevertex basevertex-baseinstance -auto -fbo Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
7f91473414
commit
8de6f79707
3 changed files with 10 additions and 1 deletions
|
|
@ -4389,7 +4389,7 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
|
|||
break;
|
||||
}
|
||||
case nir_intrinsic_load_base_vertex: {
|
||||
result = ctx->abi->base_vertex;
|
||||
result = ctx->abi->load_base_vertex(ctx->abi);
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_load_local_group_size:
|
||||
|
|
@ -4634,6 +4634,11 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
static LLVMValueRef radv_load_base_vertex(struct ac_shader_abi *abi)
|
||||
{
|
||||
return abi->base_vertex;
|
||||
}
|
||||
|
||||
static LLVMValueRef radv_load_ssbo(struct ac_shader_abi *abi,
|
||||
LLVMValueRef buffer_ptr, bool write)
|
||||
{
|
||||
|
|
@ -6908,6 +6913,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
|
|||
ctx.gs_max_out_vertices = shaders[i]->info.gs.vertices_out;
|
||||
ctx.abi.load_inputs = load_gs_input;
|
||||
ctx.abi.emit_primitive = visit_end_primitive;
|
||||
ctx.abi.load_base_vertex = radv_load_base_vertex;
|
||||
} else if (shaders[i]->info.stage == MESA_SHADER_TESS_CTRL) {
|
||||
ctx.tcs_outputs_read = shaders[i]->info.outputs_read;
|
||||
ctx.tcs_patch_outputs_read = shaders[i]->info.patch_outputs_read;
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ struct ac_shader_abi {
|
|||
|
||||
LLVMValueRef (*load_sample_mask_in)(struct ac_shader_abi *abi);
|
||||
|
||||
LLVMValueRef (*load_base_vertex)(struct ac_shader_abi *abi);
|
||||
|
||||
/* Whether to clamp the shadow reference value to [0,1]on VI. Radeonsi currently
|
||||
* uses it due to promoting D16 to D32, but radv needs it off. */
|
||||
bool clamp_shadow_reference;
|
||||
|
|
|
|||
|
|
@ -6021,6 +6021,7 @@ 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;
|
||||
ctx->abi.load_base_vertex = get_base_vertex;
|
||||
break;
|
||||
case PIPE_SHADER_TESS_CTRL:
|
||||
bld_base->emit_fetch_funcs[TGSI_FILE_INPUT] = fetch_input_tcs;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue