[Mesa-dev] [PATCH] i965: Record NOS dependencies for shader programs and only check those.

Matt Turner mattst88 at gmail.com
Wed Sep 13 23:39:14 UTC 2017


On 08/22, Kenneth Graunke wrote:
>Previously, the state upload code listened to a broad set of dirty flags
>that corresponded to all possible state dependencies for a shader stage.
>This is somewhat overkill.  For example, if a shader has no textures,
>there is no need to listen to _NEW_TEXTURE.  Although these extra
>dependencies are harmless for correctness, they cause us to recompute
>the program keys and search the program cache more often than necessary.
>
>This patch introduces a new brw_program::nos field, containing the dirty
>flags which cover a shader's non-orthogonal state dependencies.  We look
>at what the shader actually requires, and record that at link time (or
>fixed function program generation time).  Then, the state upload code
>simply checks the current dirty flags against those.
>
>This should reduce CPU overhead when drawing with the same shaders
>multiple times, but changing state or resources (such as binding new
>textures or changing uniforms).
>
>Improves performance in GFXBench4's gl_driver2_off on Apollolake at
>1280x720 by 3.06834% +/- 0.722141% (n=25).

That all makes sense and seems like an obviously good idea.

Reviewed-by: Matt Turner <mattst88 at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170913/fdc4dd94/attachment-0001.sig>


More information about the mesa-dev mailing list