summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-01-20 20:32:02 -0500
committerMarge Bot <eric+marge@anholt.net>2020-02-11 00:34:57 +0000
commit11db8e0e00a72884ba9fda953b549dd65119dc73 (patch)
tree2f514515a8a17e38fcfffcb98d6a536c1c295b42
parent36cc6b105b5299ae07f005feabd8bd6eb34c5257 (diff)
st/mesa: optimize st_update_array with ALWAYSINLINE
The time spent in st_update_array is reduced by 5-10%. Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>
-rw-r--r--src/mesa/state_tracker/st_atom_array.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index 7913e3512b9..5c258ed9956 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -364,7 +364,10 @@ static void init_velement_lowered(const struct st_vertex_program *vp,
}
}
-void
+/* ALWAYS_INLINE helps the compiler realize that most of the parameters are
+ * on the stack.
+ */
+void ALWAYS_INLINE
st_setup_arrays(struct st_context *st,
const struct st_vertex_program *vp,
const struct st_common_variant *vp_variant,
@@ -427,7 +430,10 @@ st_setup_arrays(struct st_context *st,
*has_user_vertex_buffers = uses_user_vertex_buffers;
}
-void
+/* ALWAYS_INLINE helps the compiler realize that most of the parameters are
+ * on the stack.
+ */
+void ALWAYS_INLINE
st_setup_current(struct st_context *st,
const struct st_vertex_program *vp,
const struct st_common_variant *vp_variant,