[Mesa-dev] [PATCH] i965: Don't reallocate push constant URB space on new VS programs.

Paul Berry stereotype441 at gmail.com
Wed Jan 11 09:01:10 PST 2012


On 11 January 2012 11:44, Kenneth Graunke <kenneth at whitecape.org> wrote:

> The gen7_urb atom depends on CACHE_NEW_VS_PROG and CACHE_NEW_GS_PROG,
> causing gen7_upload_urb() to be called when switching to a new VS
> program.
>
> In addition to partitioning the URB space between the VS and GS,
> gen7_upload_urb() also allocated space for VS and PS push constants.
> Unfortunately, this meant that whenever CACHE_NEW_VS was flagged, we'd
> reallocate the space for the PS push constants.  This appears to trash
> the PS push constants until the next 3DSTATE_CONSTANT_PS packet.
>
> Since our URB allocation for push constants is entirely static, it makes
> sense to split it out into its own atom that only subscribes to
> BRW_NEW_CONTEXT.  This avoids reallocating the space and trashing
> constants.
>
> Fixes a rendering artifact in Extreme Tuxracer, where instead of a snow
> trail, you'd get a bright red streak (affectionately known as the
> "bloody penguin bug").
>
> This also explains why adding VS-related dirty bits to gen7_ps_state
> made the problem disappear: it made 3DSTATE_CONSTANT_PS be emitted after
> every 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet.
>
> NOTE: This is a candidate for the 7.11 and 8.0 branches.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120111/e7cc3d28/attachment-0001.htm>


More information about the mesa-dev mailing list