Mesa (main): st/mesa: inline st_setup_arrays on MSVC too by adding a wrapper
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Jul 17 03:37:12 UTC 2021
Module: Mesa
Branch: main
Commit: 703279e6da2168aadde4407a8b97a1f54bf3250f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=703279e6da2168aadde4407a8b97a1f54bf3250f
Author: Marek Olšák <marek.olsak at amd.com>
Date: Mon Jun 14 19:39:33 2021 -0400
st/mesa: inline st_setup_arrays on MSVC too by adding a wrapper
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11939>
---
src/mesa/state_tracker/st_atom_array.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index 8adc899d818..7cc74410724 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -125,16 +125,13 @@ init_velement(const struct st_vertex_program *vp,
/* ALWAYS_INLINE helps the compiler realize that most of the parameters are
* on the stack.
*/
-void
-#ifndef _MSC_VER /* MSVC doesn't like inlining public functions */
-ALWAYS_INLINE
-#endif
-st_setup_arrays(struct st_context *st,
- const struct st_vertex_program *vp,
- const struct st_common_variant *vp_variant,
- struct cso_velems_state *velements,
- struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers,
- bool *has_user_vertex_buffers)
+static void ALWAYS_INLINE
+setup_arrays(struct st_context *st,
+ const struct st_vertex_program *vp,
+ const struct st_common_variant *vp_variant,
+ struct cso_velems_state *velements,
+ struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers,
+ bool *has_user_vertex_buffers)
{
struct gl_context *ctx = st->ctx;
const struct gl_vertex_array_object *vao = ctx->Array._DrawVAO;
@@ -221,6 +218,18 @@ st_setup_arrays(struct st_context *st,
}
}
+void
+st_setup_arrays(struct st_context *st,
+ const struct st_vertex_program *vp,
+ const struct st_common_variant *vp_variant,
+ struct cso_velems_state *velements,
+ struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers,
+ bool *has_user_vertex_buffers)
+{
+ setup_arrays(st, vp, vp_variant, velements, vbuffer, num_vbuffers,
+ has_user_vertex_buffers);
+}
+
/* ALWAYS_INLINE helps the compiler realize that most of the parameters are
* on the stack.
*
@@ -332,8 +341,8 @@ st_update_array(struct st_context *st)
/* ST_NEW_VERTEX_ARRAYS alias ctx->DriverFlags.NewArray */
/* Setup arrays */
- st_setup_arrays(st, vp, vp_variant, &velements, vbuffer, &num_vbuffers,
- &uses_user_vertex_buffers);
+ setup_arrays(st, vp, vp_variant, &velements, vbuffer, &num_vbuffers,
+ &uses_user_vertex_buffers);
/* _NEW_CURRENT_ATTRIB */
/* Setup zero-stride attribs. */
More information about the mesa-commit
mailing list