i965: Stop aux data compare preventing program binary re-use
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 25 Jun 2015 11:00:41 +0000 (14:00 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 13 Aug 2015 10:37:49 +0000 (13:37 +0300)
commit1bba29ed403e735ba0bf04ed8aa2e571884fcaaf
tree578d9a1434bf1525c81b943cd98920850af41e14
parent12a66d91f6b0beff123fb6fd8a4f3c3796379532
i965: Stop aux data compare preventing program binary re-use

Items in the program cache consist of three things: key, the data
representing the instructions and auxiliary data representing
uniform storage. The data consisting of instructions is stored into
a drm buffer object while the key and the auxiliary data reside in
malloced section. Now the cache uploading is equipped with a check
that iterates over existing items and seeks to find a another item
using identical instruction data than the one being just uploaded.
If such is found there is no need to add another section into the
drm buffer object holding identical copy of the existing one. The
item just being uploaded should instead simply point to the same
offset in the underlying drm buffer object.

Unfortunately the check for the matching instruction data is
coupled with a check for matching auxiliary data also. This
effectively prevents the cache from ever containing two items
that could share a section in the drm buffer object.

The constraint for the instruction data and auxiliary data to
match is, fortunately, unnecessary strong. When items are stored
into the cache they will anyway contain their own copy of the
auxiliary data (even if they matched - which they in real world
never will). The only thing the items would be sharing is the
instruction data and hence we should only check for that to match
and nothing else.

No piglit regression in jenkins.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_state_cache.c