<div dir="ltr">On 6 November 2013 23:06, Chris Forbes <span dir="ltr"><<a href="mailto:chrisf@ijw.co.nz" target="_blank">chrisf@ijw.co.nz</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Signed-off-by: Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_draw.c | 8 ++++++--<br>
1 file changed, 6 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c<br>
index e6c3508..9f8ad45 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_draw.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_draw.c<br>
@@ -323,7 +323,8 @@ static bool brw_try_draw_prims( struct gl_context *ctx,<br>
GLuint nr_prims,<br>
const struct _mesa_index_buffer *ib,<br>
GLuint min_index,<br>
- GLuint max_index )<br>
+ GLuint max_index,<br>
+ const struct gl_buffer_object *indirect)<br>
{<br>
struct brw_context *brw = brw_context(ctx);<br>
bool retval = true;<br>
@@ -377,6 +378,9 @@ static bool brw_try_draw_prims( struct gl_context *ctx,<br>
brw->vb.max_index = max_index;<br>
brw->state.dirty.brw |= BRW_NEW_VERTICES;<br>
<br>
+ brw->indirect_buffer.indb = indirect;<br>
+ brw->state.dirty.brw |= BRW_NEW_INDIRECT_BUFFER;<br>
+<br></blockquote><div><br></div><div>It seems wasteful to flag this bit on every draw call. Couldn't we do something like this?<br><br></div><div>if (brw->indirect_buffer.indb != NULL || indirect != NULL) {<br></div>
<div> brw->indirect_buffer.indb = indirect;<br></div><div> brw->state.dirty.brw |= BRW_NEW_INDIRECT_BUFFER;<br>}<br><br></div><div>Assuming that's addressed, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
for (i = 0; i < nr_prims; i++) {<br>
int estimated_max_prim_size;<br>
<br>
@@ -506,7 +510,7 @@ void brw_draw_prims( struct gl_context *ctx,<br>
* manage it. swrast doesn't support our featureset, so we can't fall back<br>
* to it.<br>
*/<br>
- brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index);<br>
+ brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index, indirect);<br>
}<br>
<br>
void brw_draw_init( struct brw_context *brw )<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.4.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>