Anisotropic texture filtering with texture data prefetching
AssigneeInternational Business Machines Corporation
InventorsMiguel Comparan, Eric Oliver Mejdrich, Adam James Muff, Matthew Ray Tubbs
Life of this patent
Estimating the term…
Abstract
A circuit arrangement and method utilize texture data prefetching to prefetch texture data used by an anisotropic filtering algorithm. In particular, stride-based prefetching may be used to prefetch texture data for use in anisotropic filtering, where the value of the stride, or difference between successive accesses, is based upon a distance in a memory address space between sample points taken along the line of anisotropy used in an anisotropic filtering algorithm.
Claims2
A method of performing anisotropic texture filtering using a texture defined in a texel coordinate system having u and v axes and a scene defined in a pixel coordinate system having x and y axes, the method comprising, for an initial sample point in the texture at u,v coordinates:
- determining a line of anisotropy, including determining au, av values for the line of anisotropy as follows:
- au=max(du/dx, du/dy)
- av=max(dv/dx, dv/dy)
- where du/dx is a ratio between texel coordinates along the u axis and pixel coordinates along the x axis, du/dy is a ratio between texel coordinates along the u axis and pixel coordinates along the y axis, dv/dx is a ratio between texel coordinates along the v axis and pixel coordinates along the x axis, and dv/dy is a ratio between texel coordinates along the v axis and pixel coordinates along the y axis;
- determining n sample points along the line of anisotropy, including determining ui, vi coordinates for each sample point i, where i=0 to n−1, as follows:
- ui=u+(i*au/(n−1)−au/2)
- vi=v+(i*av/(n−1)−av/2)
- determining a length ulen between adjacent sample points along the u axis and a length vlen between adjacent sample points along the v axis as follows:
- ulen=au/(n−1)
- vlen=av/(n−1)
- determining a stride value as follows:
- stride=vlen*(Uw*D)+ulen*D
- where Uw is a width of the texture in texels along the u axis and D is a data size for each texel in memory;
- for each of the n sample points, loading texture data for such sample point and applying a filter to the first sample point using the loaded texture data for such sample point to generate a sample result;
- for each of the n sample points after a first sample point, using the stride value to initiate a prefetch of the texture data for such sample point prior to attempting to load the texture data for such sample point;
- and
- averaging the sample results for the n sample points.
A circuit arrangement, comprising:
- a memory storage element;
- and
- processing logic coupled to the memory storage element and configured to perform anisotropic texture filtering using a texture defined in a texel coordinate system having u and v axes and a scene defined in a pixel coordinate system having x and y axes, the processing logic configured to, for an initial sample point in the texture at u,v coordinates:
- determine a line of anisotropy, including determine au, av values for the line of anisotropy as follows:
- au=max(du/dx, du/dy)
- av=max(dv/dx, dv/dy)
- where du/dx is a ratio between texel coordinates along the u axis and pixel coordinates along the x axis, du/dy is a ratio between texel coordinates along the u axis and pixel coordinates along the y axis, dv/dx is a ratio between texel coordinates along the v axis and pixel coordinates along the x axis, and dv/dy is a ratio between texel coordinates along the v axis and pixel coordinates along the y axis;
- determine n sample points along the line of anisotropy, including determine ui, vi coordinates for each sample point i, where i=0 to n−1, as follows:
- ui=u+(i*au/(n−1)−au/2)
- vi=v+(i*av/(n−1)−av/2)
- determine a length ulen between adjacent sample points along the u axis and a length vlen between adjacent sample points along the v axis as follows:
- ulen=au/(n−1)
- vlen=av/(n−1)
- determine a stride value as follows:
- stride=vlen*(Uw*D)+ulen*D
- where Uw is a width of the texture in texels along the u axis and D is a data size for each texel in memory;
- for each of the n sample points, load texture data for such sample point and apply a filter to the first sample point using the loaded texture data for such sample point to generate a sample result;
- for each of the n sample points after a first sample point, use the stride value to initiate a prefetch of the texture data for such sample point prior to attempting to load the texture data for such sample point;
- and
- average the sample results for the n sample points.
Dependencies are inferred from the claim text.