summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-02-12 15:57:17 +0100
committerSamuel Pitoiset <[email protected]>2018-02-14 11:53:08 +0100
commit07e4268f36c18539330f77d46c15968254408876 (patch)
tree409cd50b037d674ae0bdb4fda0394ade64c78615 /src/amd
parentb9d2ff05a64f751f5814314b2cce45e6270ddf7f (diff)
ac/shader: scan force_persample
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c5
-rw-r--r--src/amd/common/ac_shader_info.c15
2 files changed, 17 insertions, 3 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 236320bd785..b33e0a984f6 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -5499,10 +5499,9 @@ handle_fs_input_decl(struct nir_to_llvm_context *ctx,
if (glsl_get_base_type(glsl_without_array(variable->type)) == GLSL_TYPE_FLOAT) {
unsigned interp_type;
- if (variable->data.sample) {
+ if (variable->data.sample)
interp_type = INTERP_SAMPLE;
- ctx->shader_info->info.ps.force_persample = true;
- } else if (variable->data.centroid)
+ else if (variable->data.centroid)
interp_type = INTERP_CENTROID;
else
interp_type = INTERP_CENTER;
diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c
index b211da60b32..3b0887995d3 100644
--- a/src/amd/common/ac_shader_info.c
+++ b/src/amd/common/ac_shader_info.c
@@ -180,6 +180,18 @@ gather_info_block(const nir_shader *nir, const nir_block *block,
}
static void
+gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var,
+ struct ac_shader_info *info)
+{
+ const struct glsl_type *type = glsl_without_array(var->type);
+
+ if (glsl_get_base_type(type) == GLSL_TYPE_FLOAT) {
+ if (var->data.sample)
+ info->ps.force_persample = true;
+ }
+}
+
+static void
gather_info_input_decl(const nir_shader *nir, const nir_variable *var,
struct ac_shader_info *info)
{
@@ -187,6 +199,9 @@ gather_info_input_decl(const nir_shader *nir, const nir_variable *var,
case MESA_SHADER_VERTEX:
info->vs.has_vertex_buffers = true;
break;
+ case MESA_SHADER_FRAGMENT:
+ gather_info_input_decl_ps(nir, var, info);
+ break;
default:
break;
}