GNOME Bugzilla – Bug 633595
st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
Last modified: 2010-11-12 22:37:56 UTC
The texture is independent of the size that the user passed in; so there is no obvious reason to include the texture in the cache key.
Created attachment 173580 [details] [review] st_texture_cache_load_from_raw: Don't pointlessly include size in cache key
Comment on attachment 173580 [details] [review] st_texture_cache_load_from_raw: Don't pointlessly include size in cache key >- /* In theory, two images of different size could have the same >- * pixel data. We ignore that theory. >- */ That comment is still true, though still ignorable. (If we wanted to be safe we could include width, height, and has_alpha in the key.)
(In reply to comment #2) > (From update of attachment 173580 [details] [review]) > >- /* In theory, two images of different size could have the same > >- * pixel data. We ignore that theory. > >- */ > > That comment is still true, though still ignorable. (If we wanted to be safe we > could include width, height, and has_alpha in the key.) Oh, the comment meant "two images of different width and height could have the same pixel data" - it wasn't referring to the "size" parameter. Confusing. Another approach would be to add width, height has_alpha to the start of the check-summed data. I'll add the comment back clarified or (time permitting) make a new version that obsoletes it before committing.
Comment restored and made more explanatory; didn't actually do the work to use a more accurate checksum. Attachment 173580 [details] pushed as 86f3a63 - st_texture_cache_load_from_raw: Don't pointlessly include size in cache key