[Mesa-dev] [RFC] Gallium constant handling speed improvements

Jakob Bornecrantz jakob at vmware.com
Fri Dec 3 11:47:39 PST 2010


Hi all

I have attached two patches that should help with speed on applications that
causes a lot of constant buffers to be emitted or lot of constant state as in
the case of the second patch as it eliminates a memcpy.

The first patch just adds a offset and size argument to the set_constant_buffer
call on the context, making it possible for the state tracker sub-allocate the
buffers out a larger buffer. For ipers this is a pretty big win. Even if we did
something similar inside the drivers various locks would have to be taken
because since create buffer is a screen function.

The second patch switches from a inline write to map buffer call and points the
_mesa_load_state_parameters to it directly. For ipers this is a minor loss but
for application that has a different ratio of number of constants vs number of
times the constants changes it will probably be a win.

I have tested the patches on i915g only, unfortunately I based the i915 part
of these patches on some other work I had laying around so there is no point
in sending them out since they wont apply.

Before I go and try and change the other drivers I would like to hear some input
on these changes. So comment please, anyways have a nice weekend.

Cheers Jakob.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gallium-Make-it-possible-for-state-trackers-to-subal.patch
Type: text/x-patch
Size: 12570 bytes
Desc: 0001-gallium-Make-it-possible-for-state-trackers-to-subal.patch
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20101203/727abd61/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-st-mesa-Map-constant-buffers-instead-of-inline-write.patch
Type: text/x-patch
Size: 3880 bytes
Desc: 0002-st-mesa-Map-constant-buffers-instead-of-inline-write.patch
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20101203/727abd61/attachment-0003.bin>


More information about the mesa-dev mailing list