summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-01-14 19:52:24 +1100
committerTimothy Arceri <[email protected]>2018-01-31 09:14:07 +1100
commit580f1aa247479b0cd06e94ba09c13317240561be (patch)
treed537eaf3dc9ee97b151574c844528433bdb011c4 /src
parent882eff4d2027e2389b1c1ac5cbdf5242ea26c598 (diff)
radeonsi/nir: add interpolate at intrinsics to scan_instruction()
V2: use the uses_*_opcode_interp_* flags Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_nir.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 453d31bd135..6368b712062 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -127,6 +127,36 @@ static void scan_instruction(struct tgsi_shader_info *info,
case nir_intrinsic_ssbo_atomic_comp_swap:
info->writes_memory = true;
break;
+ case nir_intrinsic_interp_var_at_centroid:
+ case nir_intrinsic_interp_var_at_sample:
+ case nir_intrinsic_interp_var_at_offset: {
+ enum glsl_interp_mode interp =
+ intr->variables[0]->var->data.interpolation;
+ switch (interp) {
+ case INTERP_MODE_SMOOTH:
+ case INTERP_MODE_NONE:
+ if (intr->intrinsic == nir_intrinsic_interp_var_at_centroid)
+ info->uses_persp_opcode_interp_centroid = true;
+ else if (intr->intrinsic == nir_intrinsic_interp_var_at_sample)
+ info->uses_persp_opcode_interp_sample = true;
+ else
+ info->uses_persp_opcode_interp_offset = true;
+ break;
+ case INTERP_MODE_NOPERSPECTIVE:
+ if (intr->intrinsic == nir_intrinsic_interp_var_at_centroid)
+ info->uses_linear_opcode_interp_centroid = true;
+ else if (intr->intrinsic == nir_intrinsic_interp_var_at_sample)
+ info->uses_linear_opcode_interp_sample = true;
+ else
+ info->uses_linear_opcode_interp_offset = true;
+ break;
+ case INTERP_MODE_FLAT:
+ break;
+ default:
+ unreachable("Unsupported interpoation type");
+ }
+ break;
+ }
default:
break;
}