*/
#include <stdio.h>
#include <errno.h>
+
+#ifdef HAVE_VALGRIND
+#include <valgrind.h>
+#include <memcheck.h>
+#define VG(x) x
+#define __gen_validate_value(x) VALGRIND_CHECK_MEM_IS_DEFINED(&(x), sizeof(x))
+#else
+#define VG(x)
+#endif
+
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "pipe/p_context.h"
#define iris_pack_command(cmd, dst, name) \
for (struct cmd name = { __genxml_cmd_header(cmd) }, \
*_dst = (void *)(dst); __builtin_expect(_dst != NULL, 1); \
- __genxml_cmd_pack(cmd)(NULL, (void *)dst, &name), \
- _dst = NULL)
+ ({ __genxml_cmd_pack(cmd)(NULL, (void *)_dst, &name); \
+ VG(VALGRIND_CHECK_MEM_IS_DEFINED(_dst, __genxml_cmd_length(cmd) * 4)); \
+ _dst = NULL; \
+ }))
#define iris_pack_state(cmd, dst, name) \
for (struct cmd name = {}, \
include_directories : [inc_common, inc_intel],
c_args : [c_vis_args, no_override_init_args,
'-DGEN_VERSIONx10=@0@'.format(v)],
- dependencies : [dep_libdrm],
+ dependencies : [dep_libdrm, dep_valgrind],
)
iris_gen_libs += _lib
endforeach