[Mesa-dev] [PATCH 2/3] radv: Make radv_finishme only warn once per call-site

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Nov 24 18:37:07 UTC 2016


Making this thread safe is probably overkill I guess?

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Nov 24, 2016 at 7:18 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/amd/vulkan/radv_private.h | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
> index a5d13a9..def0af2 100644
> --- a/src/amd/vulkan/radv_private.h
> +++ b/src/amd/vulkan/radv_private.h
> @@ -211,7 +211,13 @@ void radv_loge_v(const char *format, va_list va);
>   * Print a FINISHME message, including its source location.
>   */
>  #define radv_finishme(format, ...)                                     \
> -       __radv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__);
> +       do { \
> +               static bool reported = false; \
> +               if (!reported) { \
> +                       __radv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
> +                       reported = true; \
> +               } \
> +       } while (0)
>
>  /* A non-fatal assert.  Useful for debugging. */
>  #ifdef DEBUG
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list