summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_util.c
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2017-08-25 09:50:11 +0300
committerTapani Pälli <[email protected]>2017-09-12 09:41:10 +0300
commit73638be11f4fbb016f6c6d2934134c0d2455d798 (patch)
treed94f5d1f3a06706c10a4537224c5c0cb8530435a /src/intel/vulkan/anv_util.c
parent086cfa5652ec202f87c14d11e0f6c959d75987d8 (diff)
anv: wire up anv_perf_warn macro to do debug reporting
Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_util.c')
-rw-r--r--src/intel/vulkan/anv_util.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_util.c b/src/intel/vulkan/anv_util.c
index 4b916e27f2c..45ce0a3aa0e 100644
--- a/src/intel/vulkan/anv_util.c
+++ b/src/intel/vulkan/anv_util.c
@@ -65,16 +65,30 @@ __anv_finishme(const char *file, int line, const char *format, ...)
fprintf(stderr, "%s:%d: FINISHME: %s\n", file, line, buffer);
}
-void anv_printflike(3, 4)
-__anv_perf_warn(const char *file, int line, const char *format, ...)
+void anv_printflike(6, 7)
+__anv_perf_warn(struct anv_instance *instance, const void *object,
+ VkDebugReportObjectTypeEXT type,
+ const char *file, int line, const char *format, ...)
{
va_list ap;
char buffer[256];
+ char report[256];
va_start(ap, format);
vsnprintf(buffer, sizeof(buffer), format, ap);
va_end(ap);
+ snprintf(report, sizeof(report), "%s: %s", file, buffer);
+
+ anv_debug_report(instance,
+ VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
+ type,
+ (uint64_t) (uintptr_t) object,
+ line,
+ 0,
+ "anv",
+ report);
+
fprintf(stderr, "%s:%d: PERF: %s\n", file, line, buffer);
}