summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-07-29 22:04:16 -0400
committerMarek Olšák <[email protected]>2019-08-06 17:08:39 -0400
commitf818d9ae3c89f858e93ea0ea3293103b97599e8f (patch)
treeb25d0907b377d9338d4dfd6ecb9f392dc91f1da7 /src/amd
parentb3eed3cff9a051007630f74cc1b70639511bbf0b (diff)
radeonsi/nir: handle key.mono.u.ps.interpolate_at_sample_force_center
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c3
-rw-r--r--src/amd/common/ac_shader_abi.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 5e25e838f8f..879d32f50d6 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -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 */
diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h
index d6db398ee7b..3033ae0cac2 100644
--- a/src/amd/common/ac_shader_abi.h
+++ b/src/amd/common/ac_shader_abi.h
@@ -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. */