summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-06-07 15:44:43 -0700
committerDylan Baker <[email protected]>2018-06-12 08:43:35 -0700
commit31c70b88a749f4aa3a63789fbc1e0f6e2074efc0 (patch)
tree8c63b7e97991c3fb84beca1bd95441487920cddd /src/intel/vulkan
parent5a3107b7ec3908d2550189d2ea8528d80640a3a0 (diff)
anv: Disable __gen_validate_value if NDEBUG is set.
We were enabling undefined memory checking for genxml values based on Valgrind being installed at build time, even for release builds. This generates piles and piles of assembly whenever you touch genxml. With gcc 7.3.1 and -O3 and -march=native on a Kabylake with Valgrind installed at build time: text data bss dec hex filename 5978385 262884 13488 6254757 5f70a5 libvulkan_intel.so 3799377 262884 13488 4075749 3e30e5 libvulkan_intel.so That's a 36% reduction in text size. Fixes: 047ed02723071d7eccbed3210b5be6ae73603a53 (vk/emit: Use valgrind to validate every packed field) Reviewed-by: Jason Ekstrand <[email protected]> (cherry picked from commit 0d5329d626e3f96a7788880052ae2a5ecfc8cdbe)
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_private.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 52d4ba58dc9..98312e27144 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -36,7 +36,9 @@
#include <valgrind.h>
#include <memcheck.h>
#define VG(x) x
+#ifndef NDEBUG
#define __gen_validate_value(x) VALGRIND_CHECK_MEM_IS_DEFINED(&(x), sizeof(x))
+#endif
#else
#define VG(x)
#endif