summaryrefslogtreecommitdiff
path: root/src/amd/common/ac_shader_info.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-04-18 05:29:34 +1000
committerDave Airlie <airlied@redhat.com>2017-04-19 09:00:42 +1000
commitec4785afb7bbba0627719731ceba05deeb58baac (patch)
tree9b406a3c94c13ca88e76da7bb122817987eb5f4e /src/amd/common/ac_shader_info.c
parentec15e0d3015ccef4d6c60bd282cfb848118557ae (diff)
radv/ac: move needs_push_constants to shader info.
First step to optimising push constants. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/amd/common/ac_shader_info.c')
-rw-r--r--src/amd/common/ac_shader_info.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c
index ef3692563b..79c13767f6 100644
--- a/src/amd/common/ac_shader_info.c
+++ b/src/amd/common/ac_shader_info.c
@@ -76,6 +76,14 @@ ac_nir_shader_info_pass(struct nir_shader *nir,
struct ac_shader_info *info)
{
struct nir_function *func = (struct nir_function *)exec_list_get_head(&nir->functions);
+
+ info->needs_push_constants = true;
+ if (!options->layout)
+ info->needs_push_constants = false;
+ else if (!options->layout->push_constant_size &&
+ !options->layout->dynamic_offset_count)
+ info->needs_push_constants = false;
+
nir_foreach_variable(variable, &nir->inputs)
gather_info_input_decl(nir, options, variable, info);