[Mesa-dev] [PATCH 1/5] i965: wrap assert param in #ifndef NDEBUG

Grazvydas Ignotas notasas at gmail.com
Tue Oct 4 10:42:04 UTC 2016


On Tue, Oct 4, 2016 at 3:15 AM, Timothy Arceri
<timothy.arceri at collabora.com> wrote:
> This fixes an unused variable warning on release builds.
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index dc000d9..ccf311d 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -5866,7 +5866,9 @@ fs_visitor::allocate_registers(bool allow_spilling)
>     schedule_instructions(SCHEDULE_POST);
>
>     if (last_scratch > 0) {
> +#ifndef NDEBUG
>        unsigned max_scratch_size = 2 * 1024 * 1024;
> +#endif

What about using MAYBE_UNUSED instead?

GraÅžvydas


More information about the mesa-dev mailing list