[Mesa-dev] Path to optimize (moving from create/bind/delete paradgim to set only ?)

Jakob Bornecrantz wallbraker at gmail.com
Tue Nov 16 14:57:42 PST 2010


On Tue, Nov 16, 2010 at 9:17 PM, Jerome Glisse <j.glisse at gmail.com> wrote:
> On Tue, Nov 16, 2010 at 3:51 PM, Jakob Bornecrantz <wallbraker at gmail.com> wrote:
>> On Tue, Nov 16, 2010 at 7:21 PM, Jerome Glisse <j.glisse at gmail.com> wrote:
>>> Hi,
>>>
>>> So i looked a bit more at what path we should try to optimize in the
>>> mesa/gallium/pipe infrastructure. Here are some number gathers from
>>> games :
>>> drawcall /     ps constant   vs constant     ps sampler    vs sampler
>>> doom3            1.45             1.39               9.24              9.86
>>> nexuiz             6.27             5.98               6.84              7.30
>>> openarena  2805.64             1.38               1.51              1.54
>>>
>>> (value of 1 mean there is a call of this function for every draw call,
>>> while value of 10 means there is a call to this function every 10 draw
>>> call, average)
>>>
>>> Note that openarena ps constant number is understable as it's fixed GL
>>> pipeline which is in use here and the pixel shader constant doesn't
>>> need much change in those case.
>>>
>>> So i think clear trend is that there is a lot of constant upload and
>>> sampler changing (allmost at each draw call for some games)
>>
>> Can you look into what actually changes between the sampler states?
>> Also that vs sampler state change number for OpenArena looks a bit
>> fishy to me.
>>
>> Cheers Jakob.
>>
>
> I haven't looked at what change yet, i assume something small, i think
> bugle trace of the engine is maybe easier to use than looking at
> quake3 source code. For the vs sampler i was surprised too but it's
> just the fact that q3 changes the vertex buffer a lot and this trigger
> the vs sampler.

I was thinking more along the lines of diffing the pipe_sampler_state
object and see what changed, what I'm suspecting is that its only the
max_lod field that keep changing. Games should usually stay within the
same number of textures and type of texture modes for for most draw
calls.

When you say vs_sampler do you mean bind_vertex_sampler_states or
bind_vertex_elements_state.

Cheers Jakob.


More information about the mesa-dev mailing list