On 26 October 2011 11:45, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</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">
On Wed, 26 Oct 2011 10:11:15 -0700, Paul Berry <<a href="mailto:stereotype441@gmail.com" target="_blank">stereotype441@gmail.com</a>> wrote:<br>
Non-text part: multipart/alternative<br>
<div>> On 24 October 2011 14:17, Eric Anholt <<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>> wrote:<br>
><br>
> > These produce BRW_NEW_SURFACES (used by binding table emit()) and<br>
> > BRW_NEW_NR_WM_SURFACES (used by WM unit emit()). Fixes a bug where<br>
> > with no texturing and no color buffer, we wouldn't consider the null<br>
> > renderbuffer in nr_surfaces. This was harmless because nr_surfaces is<br>
> > only used for the prefetch info in the unit state.<br>
<br>
</div><div><div></div><div>> > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > index bb7fd2e..782efd5 100644<br>
> > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
> > @@ -541,47 +541,16 @@ brw_update_renderbuffer_surface(struct brw_context<br>
> > *brw,<br>
> > I915_GEM_DOMAIN_RENDER);<br>
> > }<br>
> ><br>
> > -static void<br>
> > -prepare_wm_surfaces(struct brw_context *brw)<br>
> > -{<br>
> > - struct gl_context *ctx = &brw->intel.ctx;<br>
> > - int i;<br>
> > - int nr_surfaces = 0;<br>
> > -<br>
> > - for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {<br>
> > - nr_surfaces = SURF_INDEX_DRAW(i) + 1;<br>
> > - }<br>
> > -<br>
> > - if (brw->wm.const_bo) {<br>
> > - nr_surfaces = SURF_INDEX_FRAG_CONST_BUFFER + 1;<br>
> > - }<br>
> > -<br>
> > - for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {<br>
> > - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];<br>
> > -<br>
> > - if (texUnit->_ReallyEnabled) {<br>
> > - nr_surfaces = SURF_INDEX_TEXTURE(i) + 1;<br>
> > - }<br>
> > - }<br>
> > -<br>
> > - /* Have to update this in our prepare, since the unit's prepare<br>
> > - * relies on it.<br>
> > - */<br>
> > - if (brw->wm.nr_surfaces != nr_surfaces) {<br>
> > - brw->wm.nr_surfaces = nr_surfaces;<br>
> > - brw->state.dirty.brw |= BRW_NEW_NR_WM_SURFACES;<br>
> > - }<br>
> > -}<br>
> > -<br>
> > /**<br>
> > * Constructs the set of surface state objects pointed to by the<br>
> > * binding table.<br>
> > */<br>
> > static void<br>
> > -upload_wm_surfaces(struct brw_context *brw)<br>
> > +brw_upload_wm_surfaces(struct brw_context *brw)<br>
> > {<br>
> > struct gl_context *ctx = &brw->intel.ctx;<br>
> > GLuint i;<br>
> > + int nr_surfaces = 0;<br>
> ><br>
> > /* _NEW_BUFFERS | _NEW_COLOR */<br>
> > /* Update surfaces for drawing buffers */<br>
> > @@ -595,8 +564,15 @@ upload_wm_surfaces(struct brw_context *brw)<br>
> > brw_update_null_renderbuffer_surface(brw, i);<br>
> > }<br>
> > }<br>
> > + nr_surfaces =<br>
> > SURF_INDEX_DRAW(ctx->DrawBuffer->_NumColorDrawBuffers);<br>
> > } else {<br>
> > brw_update_null_renderbuffer_surface(brw, 0);<br>
> > + nr_surfaces = SURF_INDEX_DRAW(0) + 1;<br>
> ><br>
><br>
> This looks like a behavioral change to me. The old prepare_wm_surfaces()<br>
> code would have left nr_surfaces = 0 in this case. Was this an intentional<br>
> change? Was the old code buggy?<br>
><br>
> I have similar questions about patch 15/33.<br>
<br>
</div></div>I mentioned it in the commit message :)<br>
</blockquote></div><br>Oops, so you did. Would you mind mentioning it in the commit message for patch 15/33 also? I failed to notice because I reviewed patch 15/33 first :)<br>