Hi Jakob,<br><br>I like the idea behind the first patch and there is a slight performance improvement with it on r300g, so I hope we&#39;ll get it accepted soon. r300g has no requirements on alignment of the offset but other drivers might have. The only change that&#39;s needed for r300g in set_constant_buffer is &quot;mapped += offset/4;&quot;<br>



<br>The second patch will make sense for large constant buffers (once it&#39;s finished), e.g. nv50 has a 64kB large constant file and avoiding one unnecessary memcpy might be a win there. Similarly for r600.<br><br>Marek<br>


<br><div class="gmail_quote">
On Fri, Dec 3, 2010 at 8:47 PM, Jakob Bornecrantz <span dir="ltr">&lt;<a href="mailto:jakob@vmware.com" target="_blank">jakob@vmware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



Hi all<br>
<br>
I have attached two patches that should help with speed on applications that<br>
causes a lot of constant buffers to be emitted or lot of constant state as in<br>
the case of the second patch as it eliminates a memcpy.<br>
<br>
The first patch just adds a offset and size argument to the set_constant_buffer<br>
call on the context, making it possible for the state tracker sub-allocate the<br>
buffers out a larger buffer. For ipers this is a pretty big win. Even if we did<br>
something similar inside the drivers various locks would have to be taken<br>
because since create buffer is a screen function.<br>
<br>
The second patch switches from a inline write to map buffer call and points the<br>
_mesa_load_state_parameters to it directly. For ipers this is a minor loss but<br>
for application that has a different ratio of number of constants vs number of<br>
times the constants changes it will probably be a win.<br>
<br>
I have tested the patches on i915g only, unfortunately I based the i915 part<br>
of these patches on some other work I had laying around so there is no point<br>
in sending them out since they wont apply.<br>
<br>
Before I go and try and change the other drivers I would like to hear some input<br>
on these changes. So comment please, anyways have a nice weekend.<br>
<br>
Cheers Jakob.<br>_______________________________________________<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="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
<br></blockquote></div><br>