On Wed, 15 Jun 2011 11:03:34 -0700, Kenneth Graunke <kenn...@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.
pgpiJNxWCgolj.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev