i965: Add a CHECK macro to call more complicated validation funcs.
authorMatt Turner <mattst88@gmail.com>
Mon, 7 Nov 2016 05:10:29 +0000 (21:10 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 20 Jan 2017 19:40:52 +0000 (11:40 -0800)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu_validate.c

index e23f1ec1b9547a9b7918f050200898890e1bacc4..322538637ca71dee710adfa250264faec5aa7de2 100644 (file)
@@ -53,6 +53,15 @@ cat(struct string *dest, const struct string src)
       }                              \
    } while(0)
 
+#define CHECK(func, args...)                             \
+   do {                                                  \
+      struct string __msg = func(devinfo, inst, ##args); \
+      if (__msg.str) {                                   \
+         cat(&error_msg, __msg);                         \
+         free(__msg.str);                                \
+      }                                                  \
+   } while (0)
+
 static bool
 src0_is_null(const struct gen_device_info *devinfo, const brw_inst *inst)
 {