[Mesa-dev] [PATCH] nicer-no-wrap-patch

Rogovin, Kevin kevin.rogovin at intel.com
Mon Nov 11 22:39:17 PST 2013


Hi all, I will later submit a patch taking into account comments, however one comment I will address *now*.

Eric Anholt [eric at anholt.net] writes:

>Kevin Rogovin <kevin.rogovin at intel.com> writes:
>
>> This patch adds a function interface for enabling no wrap on batch commands,
>>adds to it assert enforcement that the number bytes added to the
>> batch buffer does not exceed a passed value and finally this is used
>> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
>> is a good value.
>
>I don't like adding overhead to every batch operation.  You can just do
>an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6

That approach used in brw_blorp_exec.cpp will not work here because the estimate
is (and should be) computed in brw_try_draw_prims() and the assert needs to be done
whenever commands or state are added to the batch buffer. Additionally it is literally an
overhead or exactly writing one boolean and two integers _per_ draw call. This overhead
is literally insignificant next to the overhead of the call stack to reach brw_try_draw_primis().

However, I will make it so that the write to those variables only occurs in debug, since the
assert is only for the purpose of debug; going further those members will only exists in debug
for that matter.
________________________________________
From: Eric Anholt [eric at anholt.net]
Sent: Monday, November 11, 2013 9:56 PM
To: Rogovin, Kevin; mesa-dev at lists.freedesktop.org
Cc: Rogovin, Kevin
Subject: Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

Kevin Rogovin <kevin.rogovin at intel.com> writes:

> This patch adds a function interface for enabling no wrap on batch commands,
> adds to it assert enforcement that the number bytes added to the
> batch buffer does not exceed a passed value and finally this is used
> in brw_try_draw_prims() to help make sure that estimated_max_prim_size
> is a good value.

I don't like adding overhead to every batch operation.  You can just do
an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6


More information about the mesa-dev mailing list