<div dir="ltr"><div>Hello,</div>that patch is according to remark:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"Additionally, we </span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">probably ought to fix the callers to stop allocating 0 size BOs.<br></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">It looks like most of them come from the 3DSTATE_SO_BUFFER code,<br></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">where one stream has valid transform feedback info, and the other<br></span><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">3 are empty. "</span></blockquote><div><br></div><div> And seems additional one: <a href="https://patchwork.freedesktop.org/patch/244674/">https://patchwork.freedesktop.org/patch/244674/</a></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 15, 2018 at 3:21 PM, Sergii Romantsov <span dir="ltr"><<a href="mailto:sergii.romantsov@gmail.com" target="_blank">sergii.romantsov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Avoided filling of whole structure and bo-allocation if<br>
size of surface is 0.<br>
<br>
Signed-off-by: Sergii Romantsov <<a href="mailto:sergii.romantsov@globallogic.com" target="_blank">sergii.romantsov@globallogic.<wbr>com</a>><br>
---<br>
src/mesa/drivers/dri/i965/gen<wbr>X_state_upload.c | 9 +++++----<br>
1 file changed, 5 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/ge<wbr>nX_state_upload.c b/src/mesa/drivers/dri/i965/ge<wbr>nX_state_upload.c<br>
index ea5ad55..c051848 100644<br>
--- a/src/mesa/drivers/dri/i965/ge<wbr>nX_state_upload.c<br>
+++ b/src/mesa/drivers/dri/i965/ge<wbr>nX_state_upload.c<br>
@@ -3787,19 +3787,20 @@ genX(upload_3dstate_so_buffers<wbr>)(struct brw_context *brw)<br>
for (int i = 0; i < 4; i++) {<br>
struct intel_buffer_object *bufferobj =<br>
intel_buffer_object(xfb_obj->B<wbr>uffers[i]);<br>
+ uint32_t start = xfb_obj->Offset[i];<br>
+ uint32_t end = ALIGN(start + xfb_obj->Size[i], 4);<br>
+ uint32_t const size = end - start;<br>
<br>
- if (!bufferobj) {<br>
+ if (!bufferobj || !size) {<br>
brw_batch_emit(brw, GENX(3DSTATE_SO_BUFFER), sob) {<br>
sob.SOBufferIndex = i;<br>
}<br>
continue;<br>
}<br>
<br>
- uint32_t start = xfb_obj->Offset[i];<br>
assert(start % 4 == 0);<br>
- uint32_t end = ALIGN(start + xfb_obj->Size[i], 4);<br>
struct brw_bo *bo =<br>
- intel_bufferobj_buffer(brw, bufferobj, start, end - start, true);<br>
+ intel_bufferobj_buffer(brw, bufferobj, start, size, true);<br>
assert(end <= bo->size);<br>
<br>
brw_batch_emit(brw, GENX(3DSTATE_SO_BUFFER), sob) {<br>
<span class="gmail-m_-2508049638296328549HOEnZb"><font color="#888888">-- <br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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><br clear="all"><div><br></div>-- <br><div class="gmail-m_-2508049638296328549gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Sergii Romantsov<br></div><div dir="ltr"><div style="margin:0px;padding:0px;color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:14px">GlobalLogic Inc.<br><a href="http://www.globallogic.com/" rel="nofollow" style="color:rgb(0,82,204)" target="_blank">www.globallogic.com</a><br></div></div></div></div></div></div>
</div></div>