Module: Mesa
Branch: master
Commit: 50f25da2b54110d5ae0bea882f9e9faaf8cd2cf1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=50f25da2b54110d5ae0bea882f9e9faaf8cd2cf1

Author: Eric Anholt <[email protected]>
Date:   Mon Oct  5 14:31:26 2020 -0700

turnip: Always enable TU_DEBUG=startup on debug drivers.

For Android, it's hard to inject environment variables for testing, and I
figure if you've got a debug driver then you'd love to see about driver
init failures anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7014>

---

 src/freedreno/vulkan/tu_device.c  | 8 ++++++++
 src/freedreno/vulkan/tu_private.h | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index 0afdff14cc8..fbc8d60bac6 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -256,6 +256,14 @@ tu_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
    instance->debug_flags =
       parse_debug_string(getenv("TU_DEBUG"), tu_debug_options);
 
+#ifdef DEBUG
+   /* Enable startup debugging by default on debug drivers.  You almost always
+    * want to see your startup failures in that case, and it's hard to set
+    * this env var on android.
+    */
+   instance->debug_flags |= TU_DEBUG_STARTUP;
+#endif
+
    if (instance->debug_flags & TU_DEBUG_STARTUP)
       mesa_logi("Created an instance");
 
diff --git a/src/freedreno/vulkan/tu_private.h 
b/src/freedreno/vulkan/tu_private.h
index d057dbbb24a..1f82a8f2e66 100644
--- a/src/freedreno/vulkan/tu_private.h
+++ b/src/freedreno/vulkan/tu_private.h
@@ -140,7 +140,8 @@ __vk_errorf(struct tu_instance *instance,
 #define vk_errorf(instance, error, format, ...)                              \
    __vk_errorf(instance, error, false, __FILE__, __LINE__, format, 
##__VA_ARGS__);
 
-/* Prints startup errors if TU_DEBUG=startup is set.
+/* Prints startup errors if TU_DEBUG=startup is set or on a debug driver
+ * build.
  */
 #define vk_startup_errorf(instance, error, format, ...) \
    __vk_errorf(instance, error, instance->debug_flags & TU_DEBUG_STARTUP, \

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to