Hi Jakob, I like the idea behind the first patch and there is a slight performance improvement with it on r300g, so I hope we'll get it accepted soon. r300g has no requirements on alignment of the offset but other drivers might have. The only change that's needed for r300g in set_constant_buffer is "mapped += offset/4;"
The second patch will make sense for large constant buffers (once it's finished), e.g. nv50 has a 64kB large constant file and avoiding one unnecessary memcpy might be a win there. Similarly for r600. Marek On Fri, Dec 3, 2010 at 8:47 PM, Jakob Bornecrantz <[email protected]> wrote: > 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. > _______________________________________________ > mesa-dev mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > >
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
