[Mesa-dev] [PATCH] :( fail. (i965 TXD state dependent recompiles)

Eric Anholt eric at anholt.net
Wed Jun 15 13:25:07 PDT 2011


On Wed, 15 Jun 2011 11:03:34 -0700, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On first compile...
> - brw_prepare_wm_prog populates the key with depth_compare_func = 0
>   and searches the cache.  No hit.
> - It then sets depth_compare_func and searches the cache again.  No hit.
>   (This is an additional cost.)
> - It resets depth_compare_func to 0 and compiles.
> - During compilation, emit_texture_gen5 will set key->depth_compare_func
>   only if manual shadow comparisons are required (otherwise it stays 0).
> - The newly compiled shader is added to the cache.
> 
> Subsequently...
> - For most shaders:
>   - brw_prepare_wm_prog searches the cache with depth_compare_func = 0.
>     The shader is immediately found (no additional cost).
> - If manual compares are required:
>   - brw_prepare_wm_prog searches the cache with depth_compare_func = 0.
>     No hit.  It then depth_compare_func and searches again.  If we've
>     seen this DepthFunc before, we find the shader.  Total cost is two
>     cache searches.  If we haven't seen DepthFunc before, compile.

I followed your logic.  It appears to make sense.  However, instead of
DepthFunc you mean sampler->CompareMode, so it would have to change to
be per-sampler.  If you're loading each shadow sampler's compare modes
into the key, I'm fine with recompiling when that changes even for
non-txd, because nobody's ever changing the comparemode really.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110615/073038b3/attachment.pgp>


More information about the mesa-dev mailing list