ac/shader: scan force_persample
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 12 Feb 2018 14:57:17 +0000 (15:57 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Feb 2018 10:53:08 +0000 (11:53 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_shader_info.c

index 236320bd785d98c461397c659a731ef8eb24c3b3..b33e0a984f63986b4930c3ef8c4dca0899374b36 100644 (file)
@@ -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;
index b211da60b32a7507fcc16c3dd9b9774e858877bf..3b0887995d301ab4a3b37f205d60899bd09312f2 100644 (file)
@@ -179,6 +179,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;
        }