Mesa (master): anv: Drop the anv_validate block helper

Jason Ekstrand jekstrand at kemper.freedesktop.org
Tue Mar 7 23:58:05 UTC 2017


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Mar  7 09:25:14 2017 -0800

anv: Drop the anv_validate block helper

Over the course of driver development, we've come up with a number of
different schemes for adding giant blocks of asserts inside the driver.
This one is only being used once in anv_pipeline.c and the way it's
being used actually generates compiler warnings in release builds.  This
commit drops the anv_validate macro and just puts the contents of the
one validation function in side of a "#ifdef DEBUG" guard.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/intel/vulkan/anv_pipeline.c |  6 +++---
 src/intel/vulkan/anv_private.h  | 10 ----------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 0db9f68..dc65e26 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -1119,6 +1119,7 @@ copy_non_dynamic_state(struct anv_pipeline *pipeline,
 static void
 anv_pipeline_validate_create_info(const VkGraphicsPipelineCreateInfo *info)
 {
+#ifdef DEBUG
    struct anv_render_pass *renderpass = NULL;
    struct anv_subpass *subpass = NULL;
 
@@ -1158,6 +1159,7 @@ anv_pipeline_validate_create_info(const VkGraphicsPipelineCreateInfo *info)
          break;
       }
    }
+#endif
 }
 
 /**
@@ -1189,9 +1191,7 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
 {
    VkResult result;
 
-   anv_validate {
-      anv_pipeline_validate_create_info(pCreateInfo);
-   }
+   anv_pipeline_validate_create_info(pCreateInfo);
 
    if (alloc == NULL)
       alloc = &device->alloc;
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 7d3fd40..b53d3d8 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -270,16 +270,6 @@ void anv_loge_v(const char *format, va_list va);
 #endif
 
 /**
- * If a block of code is annotated with anv_validate, then the block runs only
- * in debug builds.
- */
-#ifdef DEBUG
-#define anv_validate if (1)
-#else
-#define anv_validate if (0)
-#endif
-
-/**
  * A dynamically growable, circular buffer.  Elements are added at head and
  * removed from tail. head and tail are free-running uint32_t indices and we
  * only compute the modulo with size when accessing the array.  This way,




More information about the mesa-commit mailing list