summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-02-14 12:03:55 +0100
committerSamuel Pitoiset <[email protected]>2018-02-15 14:53:30 +0100
commit61a4fc3ecc3d7740d2b9122c502144e69fe3060c (patch)
tree92ef57e46195d8950f9be7caa808865cd51c215a
parenta34715ad9c84c4209de4c16fdf40655181350bd9 (diff)
ac/shader: be a little smarter when scanning vertex buffers
Although meta shaders don't use any vertex buffers, there is no behaviour change but I think it's better to do this. Though, this saves two user SGPRs for push constants inlining or something else. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/common/ac_shader_info.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c
index 3b0887995d3..f6cdd347035 100644
--- a/src/amd/common/ac_shader_info.c
+++ b/src/amd/common/ac_shader_info.c
@@ -180,6 +180,16 @@ gather_info_block(const nir_shader *nir, const nir_block *block,
}
static void
+gather_info_input_decl_vs(const nir_shader *nir, const nir_variable *var,
+ struct ac_shader_info *info)
+{
+ int idx = var->data.location;
+
+ if (idx >= VERT_ATTRIB_GENERIC0 && idx <= VERT_ATTRIB_GENERIC15)
+ info->vs.has_vertex_buffers = true;
+}
+
+static void
gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var,
struct ac_shader_info *info)
{
@@ -197,7 +207,7 @@ gather_info_input_decl(const nir_shader *nir, const nir_variable *var,
{
switch (nir->info.stage) {
case MESA_SHADER_VERTEX:
- info->vs.has_vertex_buffers = true;
+ gather_info_input_decl_vs(nir, var, info);
break;
case MESA_SHADER_FRAGMENT:
gather_info_input_decl_ps(nir, var, info);