[Mesa-dev] [PATCH 1/4] genxml: Add macros for exporting genxml functions.

Rafael Antognolli rafael.antognolli at intel.com
Fri May 19 16:02:43 UTC 2017


The GENX_DECL() macro is used to declare prototypes of a given function
to each gen, so we don't have to manually add each of them to headers.

The second macro, genX_find(), is used to call the right function for
the running gen, but from code that is not gen specific.

Signed-off-by: Rafael Antognolli <rafael.antognolli at intel.com>
---
 src/mesa/drivers/dri/i965/brw_context.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 6b37500..1f61e5f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1558,6 +1558,17 @@ void
 gen7_upload_urb(struct brw_context *brw, unsigned vs_size,
                 bool gs_present, bool tess_present);
 
+#define GENX_DECL(_ret, _name, ...)            \
+   _ret gen4_##_name(__VA_ARGS__);             \
+   _ret gen45_##_name(__VA_ARGS__);            \
+   _ret gen5_##_name(__VA_ARGS__);             \
+   _ret gen6_##_name(__VA_ARGS__);             \
+   _ret gen7_##_name(__VA_ARGS__);             \
+   _ret gen75_##_name(__VA_ARGS__);            \
+   _ret gen8_##_name(__VA_ARGS__);             \
+   _ret gen9_##_name(__VA_ARGS__);             \
+   typedef _ret (* _name ## _ptr)(__VA_ARGS__);
+
 /* brw_reset.c */
 extern GLenum
 brw_get_graphics_reset_status(struct gl_context *ctx);
-- 
2.9.3



More information about the mesa-dev mailing list