Since the mid-2000s, nearly all software renderers have rearranged texture images into 4x4 chunks, because in a 8-bpc RGBA format it fits on a single cacheline. This trick increases the cache hit rate in proportion to magnification, i.e. greatly for the densest mip-map, and to between 3/4ths and half the time for smaller sizes.
Really it's just a common example of arranging data according to the use pattern.
Oh well, first I confused doom and quake, and I was talking about quake 1 days (first pentiums), it was a very hardware specific, I mean not cpu cache lines, but vga card bit planes. Taken from M. Abrash Black Book IIRC.
2
u/skulgnome Oct 04 '13
Since the mid-2000s, nearly all software renderers have rearranged texture images into 4x4 chunks, because in a 8-bpc RGBA format it fits on a single cacheline. This trick increases the cache hit rate in proportion to magnification, i.e. greatly for the densest mip-map, and to between 3/4ths and half the time for smaller sizes.
Really it's just a common example of arranging data according to the use pattern.