On 11 January 2012 11:44, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The gen7_urb atom depends on CACHE_NEW_VS_PROG and CACHE_NEW_GS_PROG,<br>
causing gen7_upload_urb() to be called when switching to a new VS<br>
program.<br>
<br>
In addition to partitioning the URB space between the VS and GS,<br>
gen7_upload_urb() also allocated space for VS and PS push constants.<br>
Unfortunately, this meant that whenever CACHE_NEW_VS was flagged, we'd<br>
reallocate the space for the PS push constants. This appears to trash<br>
the PS push constants until the next 3DSTATE_CONSTANT_PS packet.<br>
<br>
Since our URB allocation for push constants is entirely static, it makes<br>
sense to split it out into its own atom that only subscribes to<br>
BRW_NEW_CONTEXT. This avoids reallocating the space and trashing<br>
constants.<br>
<br>
Fixes a rendering artifact in Extreme Tuxracer, where instead of a snow<br>
trail, you'd get a bright red streak (affectionately known as the<br>
"bloody penguin bug").<br>
<br>
This also explains why adding VS-related dirty bits to gen7_ps_state<br>
made the problem disappear: it made 3DSTATE_CONSTANT_PS be emitted after<br>
every 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet.<br>
<br>
NOTE: This is a candidate for the 7.11 and 8.0 branches.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=38868" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=38868</a><br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br></blockquote><div><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div></div>