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@intel.com>
This commit is contained in:
Jason Ekstrand
2017-03-07 09:25:14 -08:00
parent a316d8f406
commit 33301d949f
2 changed files with 3 additions and 13 deletions

View File

@@ -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);
}
if (alloc == NULL)
alloc = &device->alloc;

View File

@@ -269,16 +269,6 @@ void anv_loge_v(const char *format, va_list va);
#define anv_assert(x)
#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