[Mesa-dev] [PATCH] state trackers and state changes propagation
Pierre-Eric Pelloux-Prayer
pelloux at gmail.com
Mon May 30 01:12:46 PDT 2011
Here is a new patches set implementing the same ideas.
(The numbering of the patches is different)
> On Sat, May 21, 2011 at 5:34 PM, Brian Paul <brian.e.paul at gmail.com> wrote:
> In patch 0001:
> How reliable is the "total" checksum value? If two different constant
> buffer hash to the same value, that would be a problem.
(now patches 0004 + 0005 + 0006)
I've changed the approach here : constant upload is skipped if
'gl_parameter_list' content did not change between successive calls.
It allows to also skip the '_mesa_load_state_parameters' function call.
Patch 0005 adds simplistic refcounting + versionning mechanism to
'gl_parameter_list'. It is enough for my testing, but I guess it would
need a rework to get merged ; is there any standard way to do this in
mesa tree ? (maybe using p_atomic_inc ?)
Patch 0004 was already sent to mesa-dev, fixing the _mesa_layout_parameters bug.
>
> In patch 0002:
> This is look kind of clumsy. A better approach might be to keep a
> pipe_rasterizer object in the st_context and update it incrementally.
(now patch 0003)
I removed the 'tmp' variable (which was useless), and now the
pipe_rasterizer object is directly updated when needed.
> In patch 0003:
> ... Follow the current coding style ...
(now patch 0001)
Modifications done, it should follow requested coding style.
>
> In patch 0004:
> One thing we could do in the CSO module is keep track of the previous
> state object and compare it to the new one being given to us.
(now patch 0002)
hash_keys are now kept alongside the current sampler_object.
When a new sampler_object is requested, its hash_key is compared to
the saved one, and the update is skipped if hash_key is unchanged.
I've also attached patch-0007, which adds some debug counter to
monitor above patches activity : if a given patch allows to skip early
quit state propagation, 1 is added to first
Testing done :
* piglit quicks.test profile does not show any regression
* drawoverhead goes from 230 thousand draws/s to 380t d/s
* all real app I've tested do not see any performance improvement :
Lightsmark, Openarena, Unigine Heaven
* I've attached the debug counters output summary for above apps
Pierre-Eric
-------------- next part --------------
Lightsmark :
cso_set_rasterizer : 19000 44656 => 29.8 %
st_upload_constants_same_params : 16000 42014 => 27.6 %
st_upload_constants_state_flags : 10000 6560 => 60.4 %
single_sampler : 3562272 35000 => 99.0 %
cso_set_sampler_view : 1313000 1312997 => 50.0 %
FPS /w : 53.7 54.3
FPS /wo : 53.6
Openarena (anholt demo):
cso_set_rasterizer : 40000 9864 => 80.2 %
st_upload_constants_same_params : 179000 4 => 100.0 %
st_upload_constants_state_flags : 127000 52139 => 70.9 %
single_sampler : 112285 63000 => 64.1 %
cso_set_sampler_view : 145000 128185 => 53.1 %
FPS /w : 76.5 76.8 76.7
FPS /wo : 77.2 74.8 75.7
Blender (simple editing):
cso_set_rasterizer : 34000 7943 => 81.1 %
st_upload_constants_same_params : 186000 36205 => 83.7 %
st_upload_constants_state_flags : 67000 119944 => 35.8 %
single_sampler : 1192 4000 => 23.0 %
cso_set_sampler_view : 78000 8951 => 89.7 %
Unigine Heaven (benchmark mode):
cso_set_rasterizer : 242000 132103 => 64.7 %
st_upload_constants_same_params : 2024000 3283790 => 38.1 %
st_upload_constants_state_flags : 2022000 2099 => 99.9 %
single_sampler : 2957989 400000 => 88.1 %
cso_set_sampler_view : 815000 728794 => 52.8 %
FPS /w : 7.2 (score = 180)
FPS /wo : 7.6 (score = 192)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-st-mesa-reduce-cso_set_vertex_sampler_views-cso_set_.patch
Type: text/x-patch
Size: 3599 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-cso_context-add-early-quit-to-single_sampler.patch
Type: text/x-patch
Size: 4421 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-st-mesa-reduce-cso_set_rasterizer-calls-count.patch
Type: text/x-patch
Size: 14669 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-bugfix-gl_program_parameter_list-StateFlags-field-ma.patch
Type: text/x-patch
Size: 1103 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-struct-gl_program_parameter_list-modified-to-be-refc.patch
Type: text/x-patch
Size: 9654 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0011.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-st-mesa-reduced-constant-buffers-upload.patch
Type: text/x-patch
Size: 6145 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0012.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-adds-debug-counters-output-for-measuring-previous-pa.patch
Type: text/x-patch
Size: 8465 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110530/3fe77fbe/attachment-0013.bin>
More information about the mesa-dev
mailing list