<div dir="ltr"><div>Do you have any data on how much this helps? Regardless, the series is<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 12, 2017 at 5:33 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We can promote INVALIDATE_RANGE_BIT to INVALIDATE_BUFFER_BIT if the<br>
range contains the only valid data in the buffer. This allows us to<br>
orphan the storage, instead of doing stall avoidance blits.<br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_buffer_objects.c | 7 +++++++<br>
1 file changed, 7 insertions(+)<br>
<br>
I don't have any performance data for this.<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_buffer_objects.c b/src/mesa/drivers/dri/i965/<wbr>intel_buffer_objects.c<br>
index 09c18db1afe..c305539e1b5 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_buffer_objects.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_buffer_objects.c<br>
@@ -371,6 +371,13 @@ brw_map_buffer_range(struct gl_context *ctx,<br>
return NULL;<br>
}<br>
<br>
+ if ((access & GL_MAP_INVALIDATE_RANGE_BIT) &&<br>
+ (length == obj->Size ||<br>
+ (intel_obj->valid_data_start >= offset &&<br>
+ intel_obj->valid_data_end <= offset + length))) {<br>
+ access |= GL_MAP_INVALIDATE_BUFFER_BIT;<br>
+ }<br>
+<br>
/* If the access is synchronized (like a normal buffer mapping), then get<br>
* things flushed out so the later mapping syncs appropriately through GEM.<br>
* If the user doesn't care about existing buffer contents and mapping would<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>