radeonsi/nir: handle key.mono.u.ps.interpolate_at_sample_force_center

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
This commit is contained in:
Marek Olšák
2019-07-29 22:04:16 -04:00
parent b3eed3cff9
commit f818d9ae3c
3 changed files with 8 additions and 1 deletions

View File

@@ -3080,6 +3080,9 @@ static LLVMValueRef barycentric_at_sample(struct ac_nir_context *ctx,
unsigned mode,
LLVMValueRef sample_id)
{
if (ctx->abi->interp_at_sample_force_center)
return barycentric_center(ctx, mode);
LLVMValueRef halfval = LLVMConstReal(ctx->ac.f32, 0.5f);
/* fetch sample ID */

View File

@@ -203,6 +203,7 @@ struct ac_shader_abi {
/* Whether to clamp the shadow reference value to [0,1]on GFX8. Radeonsi currently
* uses it due to promoting D16 to D32, but radv needs it off. */
bool clamp_shadow_reference;
bool interp_at_sample_force_center;
/* Whether to workaround GFX9 ignoring the stride for the buffer size if IDXEN=0
* and LLVM optimizes an indexed load with constant index to IDXEN=0. */

View File

@@ -1243,6 +1243,9 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
ac_to_integer(&ctx->ac,
ac_build_gather_values(&ctx->ac, values, 4));
}
ctx->abi.interp_at_sample_force_center =
ctx->shader->key.mono.u.ps.interpolate_at_sample_force_center;
}
ctx->abi.inputs = &ctx->inputs[0];