Graphics texture mapping
By introducing a texture filtering operation merging circuit into the texture mapping unit of the graphics processing system, combining multiple texture filtering operations to reduce the processing amount, the problem of low texture sampling operation efficiency in the prior art is solved, and a more efficient texture sampling process is achieved.
Patent Information
- Application Number
- CN202411353465.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-29
- Filing Date
- 2024-09-26
- Publication Date
- 2025-04-01
AI Technical Summary
The prior art has the problem of low operation efficiency in the texture sampling process in the graphics processing system, especially when the results of multiple texture filtering operations are merged, a large number of texture data elements and filtering operations need to be processed.
By introducing a texture filtering operation merging circuit into the texture mapping unit, it is determined whether multiple texture filtering operations can be merged, and when the merge condition is met, multiple erectin filtering operations are replaced as a merged texture filtering operation to reduce the number of texture data elements and filtering operations that need to be processed.
Improves the efficiency of texture sampling operations, reduces the number of texture data elements and filtering operations that need to be processed when rendering output, thereby improving the performance of the graphics processing system.
Smart Images

Figure CN119741415A_ABST
Abstract
Description
[0001] The present invention relates to performing texture mapping in a graphics processing system.
[0002] It is common in graphics processing systems to generate colors for sampled locations in a rendered output, such as an image (frame) to be displayed, by applying a so-called texture or texture data to the surface to be drawn.
[0003] Graphics textures are typically configured as an array (a "texture map") of data elements (texture elements (texels)), each of which has a corresponding set of texture data (such as color, brightness, and / or light / shading values) stored for it. The texture (data) value at a given location within the texture is then determined by sampling the texture at that location (e.g., using a bilinear sampling (filtering) process).
[0004] Thus, when a texture is applied to a surface to be rendered for render output, a sampling position in the render output at which the texture is to be applied is mapped to a position in the texture, and the texture is sampled at that position using an appropriate filtering process (such as a bilinear filtering process) to determine an output texture data value to be used for the sampling position in the render output.
[0005] Texture filtering operations will typically require and use the values of multiple texels (texture data elements) in the texture being sampled, and combine these texel values in an appropriate manner to provide an output sampled texture value. For example, when a bilinear filtering operation is performed to sample a texture, a 2×2 "quadruplet" of texture data elements (texels) will be used for the bilinear filtering operation.
[0006] Some texture sampling operations combine sets of multiple individual filtered texture values (samples) to provide an overall output sampled texture value. For example, when performing anisotropic filtering, multiple bilinear samples spaced along lines in the texture (anisotropy directions) are taken and combined to provide an overall anisotropic filtered (sampled) result.
[0007] Applicants believe that there is room for improvement in the operation of graphics processors when sampling textures to provide output sampled texture values for use in rendering output.
[0008] According to a first aspect of the invention there is provided a method of operating a graphics processor in the context of sampling a texture to provide an output sampled texture value for use in rendering an output, the sampled texture comprising an array of texture data elements, each texture data element having an associated texture value;
[0009] The method comprises: when performing a texture sampling operation that uses results of a plurality of texture filtering operations to provide an overall output sampled texture value, each texture filtering operation uses a set of one or more texture data elements from the texture being sampled to provide a corresponding output filtered texture value:
[0010] determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value;
[0011] as well as
[0012] When it is determined that a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value, performing a merged texture filtering operation for the two texture filtering operations; and
[0013] The result of the merged texture filtering operation is used when providing the overall output sample texture value.
[0014] According to a second aspect of the present invention, there is provided a graphics processor, the graphics processor comprising:
[0015] a texture mapping unit configured to sample a texture to provide output sampled texture values for use in rendering output, each sampled texture comprising an array of texture data elements, each texture data element having an associated texture value;
[0016] The texture mapping unit comprises:
[0017] texture filtering circuitry configured to perform texture filtering operations, each texture filtering operation using a set of one or more texture data elements from a texture to provide a corresponding output filtered texture value; and
[0018] a texture filtering operation merging circuit configured to, when the texture mapping unit is to perform a texture sampling operation using results of a plurality of texture filtering operations to provide an overall output sampled texture value, each texture filtering operation uses a set of one or more texture data elements from the texture being sampled to provide a corresponding output filtered texture value:
[0019] determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value;
[0020] as well as
[0021] When it is determined that a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value, causing the texture filtering circuitry to:
[0022] performing a combined texture filtering operation on the two texture filtering operations; and
[0023] The result of the merged texture filtering operation is used when providing the overall output sample texture value.
[0024] The present invention relates to texture mapping in graphics processing, and in particular to sampling a texture to provide an output sampled texture value when the texture sampling process uses a set of multiple individually filtered (sampled) texture values to provide an overall output sampled texture value, such as when performing anisotropic filtering of the texture.
[0025] In the present invention, instead of simply executing each individual texture filtering operation to be executed for the overall texture sampling operation separately, it is first determined for the texture filtering operation whether the texture filtering operation can be merged with another texture filtering operation to be executed among the texture filtering operations. If so, the texture filtering operation is replaced with (at least one) "merged" texture filtering operation.
[0026] In other words, the present invention seeks to identify opportunities where filtering of texture data elements can be "merged" for an overall texture sampling operation, and if so, to "merge" the texture filtering operation for the overall texture sampling operation in question.
[0027] As will be discussed further below, this can reduce the number of texture data element "fetches" and texture filtering operations that need to be performed when performing an overall texture sampling operation, and correspondingly reduce the amount of data that needs to be provided to and processed by the texture filtering circuitry (pipeline). Thus, the present invention can provide for more efficient texture sampling operations.
[0028] In this regard, Applicants have recognized that when performing texture sampling operations (such as anisotropic filtering) that use multiple filtered texture values (samples) when generating an overall output sampled texture value, it may often be the case that some or all of the separate texture filtering operations may be combined (merged), for example because some of the separate texture filtering operations may use some or all of the same texture data elements from a texture. For example, when performing anisotropic filtering, samples along the anisotropic direction in the texture are typically spaced a distance of one texel apart, which means that adjacent bilinear samples along the anisotropic direction may typically sample the same four texture data elements (texels) in the texture.
[0029] The overall texture sampling operation being performed and considered in the present invention can be any desired and suitable texture sampling operation that uses a collection of multiple individual texture filtering operations and then provides an overall output sampled texture value for further use (for example, and preferably, in rendering output (such as a frame for display)).
[0030] As discussed above, one example of such a texture sampling operation is anisotropic filtering, so in a preferred embodiment, the overall texture sampling operation is anisotropic sampling of the texture. However, there are other texture sampling operations that use multiple individual filtered samples, such as when supersampling a texture, when performing operations such as: percentage progressive filtering (PCF) shadow mapping, screen-space ambient occlusion (SSAO), motion blur, bokeh blur, depth of field blur, or bicubic filtering, etc., and the present invention can be used (and preferably is used) for such operations as well.
[0031] The overall texture sampling operation being performed will use (and appropriately combine) the results of a collection of multiple individual texture filtering operations. Any desired number of multiple texture filtering operations may be combined, and this will depend on the exact type and configuration of the overall texture sampling operation in question.
[0032] The individual texture filtering (sampling) operations that contribute to the overall texture sampling operation may be any suitable and desired texture filtering operations. Each texture filtering operation is preferably the same (type of) operation as all other texture filtering operations in the set (so, for example, all texture filtering operations are preferably bilinear filtering operations).
[0033] Each filtering operation will use a set of one or more texture data elements to determine the output of the filtering operation. Preferably, each texture filtering operation uses the same number and configuration of one or more texture data elements.
[0034] In a preferred embodiment, the texture filtering operations each use a set of multiple texture data elements from a texture to provide an output filtered texture value, such as and preferably a set of four texture data elements.
[0035] Correspondingly, in a preferred embodiment, the (individual) texture filtering operations are each bilinear filtering operations (which use a set of four texture data elements to provide an output filtered texture value). However, if desired, other forms of texture filtering operations may also be performed, which use more or fewer texture data elements.
[0036] Determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value may be performed in any suitable and desired manner.
[0037] In a preferred embodiment, this includes (for example, and preferably first) determining that the texture filtering operations each use (preferably only use) texels from the same texture, and most preferably from the same surface (of the texture in question). In particular, it is preferably ensured that in all cases where the (u,v) coordinates result in the same (s,t) texel index, but the texel data at these indices do not contain / reference exactly the same data (such as texels at the same coordinate index (s,t) but belonging to different MIP levels, etc.), the operations will not be merged.
[0038] Therefore, in a preferred embodiment, at least when the texture includes multiple maps, consideration is given to whether the texture filtering operations under consideration are sampled from the same map level in the texture (wherein in the case where the texture filtering operations under consideration are sampled from different map levels, even in the same texture, it is determined that the texture filtering operations cannot be merged).
[0039] Similarly, at least in the case of cube textures, in a preferred embodiment, consideration is (also) given to whether the texture filtering operations under consideration are sampled from the same cube face (wherein in the case where the texture filtering operations under consideration are sampled from different faces of a cube texture, even in the same texture, it is determined that texture filtering operations cannot be merged).
[0040] Correspondingly, at least in the case of 3D textures, in a preferred embodiment, it is (also) considered whether the texture filtering operations under consideration are sampled from the same depth (Z coordinate) in the 3D texture (wherein in the case where the texture filtering operations under consideration are sampled from different depths (at different Z coordinates) in the 3D texture (in different 2D surfaces), it is determined that the texture filtering operations cannot be merged).
[0041] That is, volume texture samples (voxels) may also be merged, and in this case it is preferably determined whether texture filtering operations sample the same texture volume.
[0042] In a preferred embodiment, determining whether a texture filtering operation in a set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value comprises determining whether the texture filtering operations under consideration use the same texture data elements as each other (wherein in the case where the texture filtering operations under consideration use the same texture data elements as each other, it is determined that the texture filtering operations can be merged).
[0043] Thus, in the case of bilinear filtering operations, in this embodiment, two bilinear texture filtering operations will (only) be "merged" in the manner of the present invention when each of the two bilinear texture filtering operations uses the same four texture data elements.
[0044] In a preferred embodiment, determining whether a texture filtering operation uses the same texture data element is based on and uses (preferably only uses) the position of the texture data elements to be used for the texture filtering operation in the texture (wherein the texture filtering operations are determined to use the same texture data elements when the texture filtering operations use texture data elements having the same position in the texture).
[0045] The positions in the texture of the texture data elements to be used for the texture filtering operation under consideration may be determined in any suitable and desired manner. Preferably, this uses and is based on the positions in the texture that are sampled for each texture filtering operation under consideration.
[0046] Typically, a texture filtering operation will use a position (coordinate) in the texture to be sampled, which is then used to identify a texture data element in the texture to be used for the texture filtering operation. Most preferably, the position in the texture to be sampled is converted in a suitable manner to the position of an actual texture data element (texel) from the texture used for the texture filtering operation. Thus, the positions in the texture (e.g., and preferably, the integer parts of the position coordinates) for different texture filtering operations under consideration are preferably compared to determine whether the texture filtering operations under consideration use the same texture data element.
[0047] Thus, in a preferred embodiment, determining whether a texture filtering operation in a set of multiple texture filtering operations to be performed to provide an overall output sampled texture value is determined to be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide an overall output sampled texture value comprises comparing positions in the texture sampled by each of the texture filtering operations to determine whether the texture filtering operations can be merged (and preferably determining whether the texture filtering operations under consideration use the same texture data elements as each other (wherein in the case where the texture filtering operations under consideration use the same texture data elements as each other, it is determined that the texture filtering operations can be merged)).
[0048] The above embodiments primarily consider whether the texture filtering operations under consideration use the same set of texels as each other (and if so, merge the filtering operations).
[0049] However, the applicant has recognized that even if two texture filtering operations do not use exactly the same set of texels, it may still be the case that, for example, for the texture filtering operation being considered, there is a single set of texels that can be processed in a single texture filtering operation, such that there may still be a "merged" texture filtering operation that can be performed for and in place of a different texture filtering operation being considered.
[0050] For example, for some texture filtering operations, although in principle a specific set of multiple texture data elements is used, it may be the case that one or more texture data elements in the overall set of texture data elements to be used for the filtering operation do not actually contribute to the output of the texture filtering operation, for example because their contribution weight is zero for this specific instance of the texture filtering operation.
[0051] For example, this may occur for a bilinear filtering operation where the position being sampled actually lies on or close to the axis alignment of two texture data elements in the connecting texture, because in this case the contribution weights of the other two texture data elements that would normally make up the bilinear sample may be set to zero or close to zero.
[0052] In this regard, the applicant also recognises that this may mean, for example, that two such bilinear filtering operations which themselves use different texture data elements from each other may in fact only use (at most) four different texture data elements in total when considered together, so that they may then still be replaced by a “merged”, single bilinear filtering operation (which uses four texels).
[0053] Therefore, in another particularly preferred embodiment, determining whether a texture filtering operation in a set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide an overall output sample texture value takes into account and uses the relative contributions (contribution weights) of the texture data elements to the corresponding texture filtering operations.
[0054] Most preferably, the relative contributions (weights) of different texture data elements to different texture filtering operations are used to (try to) identify any texture data elements for the texture filtering operation under consideration that actually have zero (no) contribution to (any result of) the texture filtering operation under consideration.
[0055] Correspondingly, this is then preferably used to determine whether there is a reduced set of texture data elements that actually contribute to the texture filtering operation under consideration (whether only some but not all of the texture data elements of the texture filtering operation under consideration actually contribute to the result of the texture filtering operation under consideration).
[0056] For example, in the bilinear filtering example discussed above, it can be recognized that each bilinear filtering operation actually uses only two texels, so that instead of needing to process 8 texels for two bilinear filtering operations, only 4 texels will actually contribute to the results of the two bilinear filtering operations.
[0057] Therefore, in a particularly preferred embodiment, determining whether a texture filtering operation in a set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide an overall output sample texture value uses the relative contributions (contribution weights) of the texture data elements to the respective texture filtering operations to determine whether there is a reduced set of texture data elements that actually contribute to the texture filtering operation under consideration (wherein in the absence of a reduced set of texture data elements that actually contribute to the texture filtering operation under consideration (in the absence of other texture data elements in addition to the reduced set of texture data elements that actually contribute to the texture filtering operation under consideration), it is determined that the texture filtering operations cannot be merged).
[0058] When considering the relative contribution (contribution weight) of a texture data element to the respective texture filtering operation being considered, then only the respective contributions (weights) within the individual texture filtering operations may be considered in this respect (and in a preferred embodiment, this is the contribution that is made).
[0059] However, in particularly preferred embodiments, where another contribution (weighting) factor is applied to each respective texture filtering operation (when the respective texture filtering operations are combined to provide an overall final output sampled texture value), such as is the case in anisotropic filtering (where an anisotropic weight is applied to each bilinear sample along the anisotropic direction when combining bilinear samples to provide an overall anisotropic filtering result), then the individual contribution weights within a given texture filtering operation are preferably combined (e.g. multiplied) with the contribution weight of the texture filtering operation in question, before taking into account which texture data elements are actually used by the texture filtering operation under consideration (i.e. have a non-zero contribution weight in the overall final output of the combined texture filtering operations).
[0060] Applicants have recognised that this will have the effect of potentially causing more texture data elements to have zero contribution weights, and therefore further increasing the likelihood of identifying merging opportunities for texture filtering operations.
[0061] In a preferred embodiment, and taking into account the relative contribution of texture data elements to the texture filtering operation (to identify whether there is a reduced set of "contributing" texture data elements), the (relative) configuration of texture data elements that will actually contribute to the texture filtering operation is also considered and taken into account when determining whether the texture filtering operation can be merged.
[0062] In this case, it is preferably (only) determined that the texture filtering operation under consideration can (and should) be merged when (at least some of the texture data elements of) the reduced set of texture data elements that actually contribute to the texture filtering operation have a specific, preferably selected, preferably predefined configuration (and correspondingly, it is preferably determined that the texture filtering operation under consideration cannot be merged when the texture data elements that actually contribute to the texture filtering operation do not have the specific, preferably selected, preferably predefined configuration (in addition to having the specific, preferably selected, preferably predefined configuration, they also have other configurations)).
[0063] The specific configuration that allows merging in these embodiments may be any desired and suitable configuration of the (contributing) texture data elements. This may be, and preferably is, based on the type of texture filtering operation being considered and performed.
[0064] For example, where the texture filtering operation under consideration is a bilinear filtering operation, it is preferably determined that the texture filtering operation under consideration can (and should) be merged (only) when (at least some of) the texture data elements that will actually contribute to the texture filtering operation have a bilinear filtering configuration (footprint) in the texture (i.e., a 2×2 "quadruplet" of adjacent texture data elements).
[0065] Similar considerations can and preferably do apply to texture filtering operations other than bilinear filtering operations.
[0066] In another preferred embodiment, when there is a reduced set of contributing texture data elements, it is determined that texture filtering operations may be merged regardless of (and without regard to) the configuration of the texture data elements in the reduced set.
[0067] In this case, it is preferred to (briefly) consider whether the number of contributing texture data elements in the reduced set can be appropriately processed (filtered) using fewer "merged" texture filtering operations (e.g., a single texture filtering operation) than the original texture filtering operation being considered (wherein it is determined that texture filtering operations can (and should) be merged if they can be processed using (replaced with) fewer texture filtering operations).
[0068] In this case, the number of texture filtering operations that will need to be performed on the reduced set of contributing texture data elements is preferably determined based on how many texture data elements each texture filtering operation can (will) process. Thus, in the case of performing bilinear filtering, it is preferably considered how many bilinear filtering operations will be required to process the reduced set of contributing texture data elements (compared to the original number of bilinear filtering operations being considered).
[0069] In this regard, only corresponding pairs of texture filtering operations may be considered, wherein it is correspondingly determined that the texture filtering operation pairs may be merged when (and only when) they may be replaced by a single texture filtering operation.
[0070] Alternatively, more texture filtering operations may be considered for (potential) merging, wherein it is correspondingly determined that texture filtering operations may be merged when (and only when) a texture filtering operation may be replaced by fewer texture filtering operations (e.g., when three texture filtering operations may be replaced by two texture filtering operations).
[0071] In these embodiments, the relative contributions of texture data elements to the texture filtering operation under consideration may be identified and tracked in any suitable and desired manner.
[0072] In a preferred embodiment, this is accomplished by generating and maintaining an array (e.g., a matrix) representing the texture data elements (preferably at their relative positions in the texture) and their contribution weights, and then evaluating the array (matrix) to determine which texture data elements actually contribute to the output of the filtering operation (and, where appropriate, the configuration of the contributing texture data elements).
[0073] In a preferred embodiment, determining whether a texture filtering operation of a set of multiple texture filtering operations to be performed to provide an overall output sampled texture value can be at least partially merged with another texture filtering operation of the set of texture filtering operations to be performed to provide the overall output sampled texture value comprises an initial "coarse" check whether the positions in the texture sampled by the texture filtering operations are more than a certain, preferably selected, preferably predefined, threshold distance apart (wherein in case the positions in the texture sampled by the texture filtering operations under consideration are separated by more than the threshold distance, it is determined that the texture filtering operations cannot be merged).
[0074] In this regard, the applicant has recognized that if the texture filtering operations are, for example, sampling locations that are greater than a certain number of texels apart (e.g., 2 or 3 texels), then the texture filtering operations are unlikely to be able to be merged, and therefore this initial check can be used to avoid having to make any more complex merging determinations, which are unlikely to be beneficial.
[0075] When it is determined that texture filtering operations should be merged, then the appropriate merged texture filtering operations are performed for the texture filtering operation under consideration. There may be one or more merged texture filtering operations performed for the texture filtering operation under consideration.
[0076] A "merged" texture filtering operation should, and preferably does, replace the texture filtering operation being merged (ie, is performed in place of the texture filtering operation being considered (so that the merged texture filtering operation itself is not performed)).
[0077] As discussed above, in a preferred embodiment, pairs of texture filtering operations are replaced with a single merged texture filtering operation.
[0078] One (and each) merged texture filtering operation is preferably of the same form as the texture filtering operation being merged. Thus, for example and preferably, two or more bilinear filtering operations would be replaced by one or more bilinear filtering operations.
[0079] The merged texture filtering operation should, and preferably does, produce the same results (in terms of contribution to the overall texture sampling output) as the original texture filtering operation (which is being replaced).
[0080] This may be achieved in any suitable and desired manner.For example, and preferably, for a combined filtering operation, the locations being sampled and / or the contribution weights used for the filtering process are preferably set appropriately so that the same (correct) results will be produced.
[0081] In a particularly preferred embodiment, where a merged filtering operation uses texture data elements that contribute to multiple texture filtering operations being merged, all contribution weights for a given texture data element from each of the texture filtering operations being merged are preferably (first) combined (added together) to give a contribution weight for that texture data element in the merged texture filtering operation, and the "merged" texture filtering operation then uses the contribution weights so combined.
[0082] Also in this case, any texture filtering operation contribution weights are preferably first factored into the individual texel weights before determining the weights of the combined filtering operations.
[0083] (This is in contrast to texture filtering operations such as generating an average position in the texture to sample for merging, which is preferably not performed).
[0084] Thus, for example and preferably, in the case of merging two bilinear filtering operations (which each used the same set of four texels), preferably, for each texel, the weights of that texel in each bilinear filtering operation are added together, and then that combined weight is used for the texel in the merged bilinear filtering operation (which should and preferably uses the same set of four texels as each of the bilinear filtering operations being merged, but uses new, merged contribution weights).
[0085] Therefore, in a preferred embodiment, texture filtering operations are merged in the following manner: for each corresponding texture data element, all contribution (interpolation) weights of the texture data element from the texture filtering operations being merged are added together, and then the texture filtering operation is performed using the summed contribution weights (for the corresponding texture data element).
[0086] It will be appreciated that when operating in the manner of the present invention, multiple texture filtering operations will need to be considered in order to be able to determine whether texture filtering operations can be “merged.” This may be facilitated in any suitable and desired manner.
[0087] For example, the texture mapping unit may maintain a pool of texture filtering operations that are ready (and waiting) to be executed as a whole texture sampling operation, and then attempt to merge texture filtering operations from this pool as appropriate.
[0088] In a particularly preferred embodiment, the merge determination process operates to consider consecutive texture filter operations (from the set of texture filter operations that make up the overall texture sampling operation) in turn to see if they can be merged. In this case, corresponding pairs of consecutive texture filter operations may be considered, but preferably, the process is to consider whether the next texture filter operation can be merged with the previous texture filter operation (which may itself be a merge operation), wherein the next texture filter operation is either merged with the previous texture filter operation or the previous texture filter operation is sent for processing and a new "merge" sequence is started (and so on, until all texture filter operations in the set have been considered).
[0089] Therefore, in a particularly preferred embodiment, the merging process considers whether a first texture filtering operation in the set is mergable with another texture filtering operation in the set of texture filtering operations that make up the overall texture sampling operation.
[0090] If not, then the first texture filtering operation is preferably sent for processing (as is).
[0091] If so, the two texture filtering operations are preferably merged, and then the next texture filtering operation in the set is considered whether it can be merged with the merge operation, and so on, until the next texture filtering operation cannot be merged with the existing merge operation (or all texture filtering operations in the set have been considered).
[0092] When the next texture filter operation cannot be merged with the current (previous) texture filter operation (which may itself be a merged texture filter operation), or when all texture filter operations in the set have been considered, then the current (previous) texture filter operation is preferably sent for processing, and if there are more texture filter operations in the set to be considered, a new "merged" sequence of texture filter operations is (attempted to be) started by determining whether the next texture filter operation can be merged with the texture filter operation that cannot be merged with the previous texture filter operation (and so on, until all texture filter operations in the set have been considered for the overall texture output in question).
[0093] In these embodiments, texture filtering operations are preferably considered in a specific, preferably selected, preferably predetermined, preferably sequential order (e.g. and preferably in linear order) (one after the other). For example, and preferably, for anisotropic filtering, bilinear filtering operations are preferably considered in a linear order along the anisotropy direction, e.g. and preferably starting at one end of the anisotropy vector (sample sequence).
[0094] When the merge process identifies a texture filtering operation to be performed (whether a merge operation or a "raw" operation), the texture filtering process (texture filtering circuit) is preferably triggered to perform the desired texture filtering operation. As part of this processing, the necessary texture data elements (values) are preferably also extracted to be provided to the texture filtering process (circuitry).
[0095] Texture data elements may be fetched in any suitable and desired manner for provision to a texture filtering operation (texture filtering circuitry), such as and preferably in the normal manner for the graphics processor and graphics (data) processing system in question.
[0096] The texture data elements (values) may be fetched from, for example, main memory or made accessible to a graphics processor (e.g., of an overall data processing system of which the graphics processing system is a part), or may be appropriately cached by or accessible to the graphics processor and the texture mapping process (unit), such as a texture cache or other cache in a cache hierarchy located between the graphics processor and a (main) memory system (e.g., where the required texture data elements are already present in the cache and therefore do not need to be fetched from the memory system itself).
[0097] The graphics processor (and texture mapping unit) correspondingly preferably comprises a texture data element (texel) extraction circuit which is operable and configured to extract texture data elements (values) to be provided to the texture filtering circuit, wherein the texture filtering operation merging circuit preferably controls the texture data element extraction circuit to extract appropriate texture data elements (texels) to be provided to the texture filtering circuit (and provides the texture data elements to the texture filtering circuit).
[0098] Once the texels (texel values) have been provided to the texture filtering process / circuitry, the texture filtering process / circuitry may execute and will perform the required texture filtering operations.
[0099] The texture filtering circuitry of the texture mapper may comprise any desired and suitable processing circuitry operable to perform the required filtering function.
[0100] In an embodiment, the texture filtering circuitry is operable to perform, and may perform, a number of different filtering operations, such as bilinear filtering, trilinear filtering, and anisotropic filtering (eg, where a texture request then indicates which filtering operation is to be performed for the texture sampling operation in question).
[0101] The texture filtering circuit / process is preferably also operable (configured to) calculate (e.g., internally calculate) a set of contribution (interpolation) weight values to be used for texture filtering (sampling) operations when necessary (and then perform the texture filtering operation using the calculated set of interpolation weight values and the extracted set of texture data values).
[0102] The texture filtering process / circuitry will perform the indicated texture filtering operations.
[0103] Where a plurality of texture filtering operations are performed separately as each part of and for an overall texture sampling operation (such as an anisotropic filtering operation), the texture filtering process and circuitry is preferably also operable (and configured) to appropriately use (combine) the respective output filtered texture value of each texture filtering operation to provide (the) overall output sampled texture value for use.
[0104] The texture filtering circuitry may then return the overall output sample texture value to the graphics processor (eg, renderer / fragment shader) for use, such as applying the determined output sample texture value to the output sample position being rendered.
[0105] In addition to texture filtering circuitry, texture filtering operation incorporation circuitry (and texture data fetching circuitry), the texture mapping unit may include any suitable and desired circuitry, units and stages for performing texture mapping operations (and operations that a texture mapper may include).
[0106] For example, in a preferred embodiment, the texture mapper includes a "parking" buffer that includes (maintains) a record of pending (uncompleted) texture filtering operations to be performed (eg, that may be waiting to be (potentially) merged).
[0107] Therefore, the texture mapper preferably also includes a coordinate calculation circuit which is operable to determine the texel position (texel index) in the texture to be sampled for a texture sampling operation based on the coordinates of the position in the texture to be sampled (and the type of texture sampling operation to be performed (for example, whether it is an anisotropic sampling operation)).
[0108] The texture mapper is preferably also operable (configured to) calculate a set of contribution (interpolation) weight values to be used for texture filtering / sampling operations.
[0109] The coordinate and weight calculations are preferably performed prior to a merge determination (texture filtering operation merge circuit) (as discussed above, the merge operation preferably uses texel positions and weights to determine whether texture filtering operations can be merged).
[0110] The texture mapper may also, and preferably also, comprise appropriate anisotropic filtering parameter determination circuitry / stage, and a stage / circuitry for generating (initiating) appropriate texture filtering operations when anisotropically sampling a texture.
[0111] The overall texture sampling operation being performed may be triggered in any suitable and desired manner, such as and preferably is performed in the normal manner for the graphics processor and graphics (data) processing system in question.
[0112] For example, a graphics processor may include a programmable fragment shader (circuitry (core)) that is operable to execute a graphics fragment shading program to perform fragment shading operations, wherein the fragment shader is operable to request a texture mapper to perform a desired texture sampling operation when it encounters a graphics texture instruction in the fragment shader program it is executing.
[0113] The invention also extends to the texture mapper itself.
[0114] Therefore, according to another aspect of the present invention, there is provided a texture mapping device, which is operable to perform a graphics texturing operation, the texture mapping device comprising:
[0115] a texture mapping unit configured to sample a texture to provide output sampled texture values for use in rendering output, each sampled texture comprising an array of texture data elements, each texture data element having an associated texture value;
[0116] The texture mapping unit comprises:
[0117] texture filtering circuitry configured to perform texture filtering operations, each texture filtering operation using a set of one or more texture data elements from a texture to provide a corresponding output filtered texture value; and
[0118] a texture filtering operation merging circuit configured to, when the texture mapping unit is to perform a texture sampling operation using results of a plurality of texture filtering operations to provide an overall output sampled texture value, each texture filtering operation uses a set of one or more texture data elements from the texture being sampled to provide a corresponding output filtered texture value:
[0119] determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value;
[0120] as well as
[0121] When it is determined that a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value, causing the texture filtering circuitry to:
[0122] performing a combined texture filtering operation on the two texture filtering operations; and
[0123] The result of the merged texture filtering operation is used when providing the overall output sample texture value.
[0124] Those skilled in the art will appreciate that these aspects of the present invention can, and preferably do, include any one or more or all of the preferred and optional features of the invention described herein, as appropriate.
[0125] The graphics processor and texture mapping apparatus of the present invention can be and typically will be part of an overall graphics and / or data processing system. Therefore, the present invention also extends to a data or graphics processing system having a graphics processor and / or texture mapping apparatus as described herein.
[0126] The data or graphics processing system may include one or more memories as mentioned herein, which may be external to the graphics processor and the texture mapping device. As discussed above, the one or more memories may be operable to store and may store a set of texture maps to be used in a texturing operation.
[0127] The graphics processor may execute any one, more, or all of the processing stages that a graphics processing pipeline may typically include. Thus, for example, the graphics processor may execute and include a primitive setup stage, a rasterizer, and / or a renderer. In one embodiment, the renderer may be in the form of or include a programmable fragment shader.
[0128] A graphics processor (processing pipeline) may include one or more programmable shading stages, such as one or more or all of the following: a vertex shading stage, a hull shader, a tessellation stage (e.g., where tessellation is performed by executing a shader program), a domain (evaluation) shading stage (shader), a geometry shading stage (shader), and a fragment shader.
[0129] The graphics processor (processing pipeline) may also include any other suitable and desired processing stages that a graphics processing pipeline may include, such as a depth (or depth and stencil) tester, a blender, one or more tile buffers, a write unit, and the like.
[0130] The present invention can be used in and with any suitable and desired graphics processing system and processor. The present invention is particularly suitable for use with a tiled renderer (a tile-based graphics processing system). Therefore, in one embodiment, the graphics processor (processing pipeline) is a tile-based graphics processor (processing pipeline).
[0131] Thus, as will be appreciated, embodiments may be implemented in a data processing system including memory and a graphics processing unit (GPU) (graphics processor) that includes a texture mapping device as described herein. In embodiments, the data processing system may also include a host processor that executes applications that may require data or graphics processing by the graphics processor and instructs the graphics processor accordingly (e.g., via a driver for the graphics processor). The system may also include appropriate storage devices (e.g., memory), caches, etc.
[0132] The data / graphics processing system and / or graphics processor and / or texture mapping device may also include and / or communicate with one or more memories and / or memory devices storing the data described herein and / or storing software for performing the processes described herein. The graphics processing system and / or graphics processor and / or texture mapping device may also communicate with a host microprocessor and / or a display for displaying images based on the generated data.
[0133] The present invention can be used with any form of texture data. Thus, the present invention can be used where the texture represents appropriate color values (e.g., RGB values) (and in one embodiment this is the case), such as images, but can also be used where the texture data represents other graphics processing parameters and data (such as depth values, etc.) that can be used when generating rendered output, or is actually non-graphics data (which is still to be processed using graphics texture mapping operations).
[0134] Correspondingly, the present invention can be used for any form of output that can be generated using a graphics texture mapper and a graphics processor. In one embodiment, the present invention is used when a graphics processor is used to generate frames (images) for display, but the present invention can also be used for any other form of graphics processing output, such as (e.g., post-processed) graphics textures rendered into texture operations that a graphics processor can generate as needed. The present invention can also be used when a texture mapper, graphics processor, etc. are used to generate other (e.g., non-image or non-graphic) outputs.
[0135] In one embodiment, the various functions of the present invention are performed on a single data or graphics processing platform that generates and outputs the necessary data, such as, for example, processed image data that is written to a frame buffer for a display device.
[0136] The present invention may be implemented in any suitable system such as a suitably operable microprocessor-based system. In some embodiments, the present invention is implemented in a computer and / or microprocessor-based system.
[0137] The various functions of the present invention may be performed in any desired and suitable manner. For example, the functions of the present invention may be implemented in hardware or software as required. Thus, for example, the various functional elements, stages, units and "devices" of the present invention may include one or more suitable processors, one or more controllers, functional units, circuit systems, circuits, processing logic, microprocessor arrangements, etc. that can be operated to perform various functions, etc., such as appropriately dedicated hardware elements (processing circuits) and / or programmable hardware elements (processing circuits) that can be programmed to operate in a desired manner.
[0138] It should also be noted here that the various functions of the present invention may be repeated and / or performed in parallel on a given processor, etc. Likewise, the various processing stages may share processing circuitry / circuits, etc., if desired.
[0139] Furthermore, any one or more or all of the processing stages or units of the present invention may be embodied, for example, as a processing stage or unit circuit / circuitry in the form of one or more fixed function units (hardware) (processing circuits / circuitry systems) and / or as a processing stage or unit circuit / circuitry system in the form of a programmable processing circuit that can be programmed to perform the desired operation. Likewise, any one or more circuits / circuitry systems in one or more processing stages or unit circuits / circuitry systems of the present invention may be provided as separate circuit elements to any one or more circuits / circuitry systems in other one or more processing stages or unit circuits / circuitry systems, and / or any one or more circuits / circuitry systems or all of the one or more processing stages or unit circuits / circuitry systems may be at least partially formed by a shared processing circuit / circuitry system.
[0140] It will also be appreciated by those skilled in the art that all described embodiments of the present invention may optionally include any one or more or all of the optional features described herein.
[0141] The method according to the invention can be implemented at least in part using software such as a computer program. Therefore, further embodiments of the invention include: computer software, which is particularly suitable for executing the method described herein when installed on a data processing device; a computer program element, which includes a computer software code portion for executing the method described herein when the program element is running on a data processing device; and a computer program, which includes code means suitable for executing all steps of one or more methods described herein when the program is running on a data processing system. The data processing system can be a microprocessor, a programmable FPGA (field programmable gate array), etc.
[0142] The invention also extends to a computer software carrier comprising such software which, when used to operate a graphics processor, a renderer or other system comprising a data processing device, causes the combination with the graphics processing device, the processor, the renderer or the system to perform the steps of the method of the invention. Such a computer software carrier may be a physical storage medium, such as a ROM chip, a CD ROM, a RAM, a flash memory or a disk, or may be a signal, such as an electronic signal through a wire, an optical signal or a radio signal, such as a signal to a satellite, etc.
[0143] It will also be appreciated that not all steps of the method of the present invention need be performed by computer software, and therefore further embodiments of the present invention comprise computer software and such software installed on a computer software carrier for performing at least one of the steps of the method set forth herein.
[0144] The present invention may therefore be suitably embodied as a computer program product for use with a computer system. Such a specific implementation may include a series of computer-readable instructions fixed on a tangible non-transitory medium, such as a computer-readable medium, for example, a disk, CD ROM, ROM, RAM, flash memory, or hard disk. It may also include a series of computer-readable instructions that can be invisibly transmitted to a computer system via a modem or other interface device, through a tangible medium (including but not limited to optical communication lines or analog communication lines), or using wireless technology (including but not limited to microwave, infrared or other transmission technology). The series of computer-readable instructions embodies all or part of the functionality previously described herein.
[0145] Those skilled in the art will appreciate that such computer readable instructions may be written in a variety of programming languages for use with many computer architectures or operating systems. In addition, such instructions may be stored using any current or future memory technology (including but not limited to semiconductor, magnetic, or optical technology), or transmitted using any current or future communication technology (including but not limited to optical, infrared, or microwave technology). It is contemplated that such computer program products may be distributed as removable media with accompanying printed or electronic documentation (e.g., shrink-wrapped software), may be preloaded with a computer system, such as on a system ROM or fixed disk, or may be distributed via a network (e.g., the Internet or the World Wide Web) from a server or electronic bulletin board.
[0146] Embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:
[0147] Figure 1 An exemplary data processing system in which the present invention may be implemented is shown;
[0148] Figure 2 schematically illustrates a graphics processor including a texture mapper;
[0149] Figure 3 An exemplary graphics texture mapper is schematically shown in more detail;
[0150] Figure 4 An example of sampling two map levels anisotropically for a texture is shown;
[0151] Figure 5 is a flow chart illustrating anisotropic filtering in an embodiment of the present invention;
[0152] Figure 6 An example of two texture filtering operations sampling the same texture data element is shown;
[0153] Figure 7 is a flow chart illustrating a merging process according to an embodiment;
[0154] Fig. 8A is a flow chart illustrating a merging process according to another embodiment;
[0155] Figure 8B Shows that Fig. 8A An example array used in conjunction with the merging process of the embodiment;
[0156] Fig.9A An example of an anisotropic filtering process is shown;
[0157] Fig. 9B shows an example of merging two texture filtering operations according to an embodiment;
[0158] Fig. 9C shows an example of merging two texture filtering operations according to an embodiment;
[0159] Fig. 10A An example of an anisotropic filtering process is shown;
[0160] Fig. 10B An example of a texture element weight array is shown;
[0161] Fig.11A An example of an anisotropic filtering process is shown;
[0162] Fig. 11B shows an example of merging more than two texture filtering operations according to an embodiment;
[0163] Fig.12 shows an example of a merged texture filtering operation according to an embodiment;
[0164] Fig.13 An embodiment of a texture mapping circuit in which the present invention may be implemented is shown.
[0165] Where appropriate, similar numbers are used for similar features in the drawings.
[0166] Various embodiments of the present invention will now be described in the context of texture mapping in a graphics processor in a data processing system.
[0167] Figure 1 An exemplary data processing system is shown in which the present invention and embodiments may be implemented.
[0168] Figure 1 The exemplary data processing system shown includes a host processor including a central processing unit (CPU) 57, a graphics processor (GPU) 100, a video codec 51, a display controller 55, and a memory controller 58. Figure 3 As shown, these units communicate via interconnect 59 and have access to off-chip memory 20. In this system, GPU 100, video codec 51 and / or CPU 57 will generate frames (images) to be displayed, and display controller 55 will then provide the frames to display 54 for display.
[0169] In the course of using the system, an application 60 (such as a game) executing on a host processor (CPU) 57 will, for example, need to display frames on the display 54. To do this, the application 60 will submit appropriate commands and data to a driver 61 for the graphics processor 100 executing on the CPU 57. The driver 61 will then generate appropriate commands and data to cause the graphics processor 100 to render appropriate frames for display and store them in an appropriate frame buffer, such as in the main memory 20. The display controller 55 then reads these frames into a buffer for the display, and then reads the frames out of the buffer and displays them on the display panel of the display 54.
[0170] Figure 1 An exemplary graphics processor (graphics processing unit (GPU)) 100 that can perform texture mapping is shown. Figure 2 used in data processing systems.
[0171] like Figure 2 As shown, GPU 100 includes data processing circuitry that implements a graphics processing pipeline. The pipeline includes, among other things, a rasterizer 102 and a renderer in the form of a programmable (fragment) shader core 104. The pipeline uses a buffer 106 (e.g., in external memory 108) for storing output arrays (e.g., frames or images to be displayed).
[0172] GPU 100 also includes a texture mapper 110, and memory 108 will also store, among other things, graphics textures to be used by GPU 100 when performing texture mapping operations.
[0173] In the system, a rasterizer 102 rasterizes input primitives into individual graphics fragments for processing. To this end, the rasterizer 102 rasterizes the primitives into sampling positions representing the rendering output and generates graphics fragments representing the appropriate sampling positions for rendering the primitives. Each fragment may represent a single sampling position or a group of multiple sampling positions. The fragments generated by the rasterizer 102 are then sent forward to a fragment shader (renderer) 104 for shading.
[0174] The fragment shader 104 executes the shader program for the fragment issued by the rasterizer 102 in order to render the fragment (shade the fragment). The fragment is processed using execution threads in the shader core, where these threads execute the shader program to be used to process the fragment. A thread is executed for each sampling position to be shaded.
[0175] The shader program may include texturing instructions for texture mapping operations that need to be performed by the texture mapper 110 .
[0176] When the fragment shader 104 encounters a texturing instruction, the texturing instruction is sent from the fragment shader 104 to the texture mapper 110 , thereby requesting the texture mapper 110 to perform a texturing operation.
[0177] When requested by the fragment shader 104 to perform a texture mapping operation, the texture mapper 110 reads the texture from the memory 108 (as needed), performs the texture mapping operation, and returns the value (e.g., RGB color) sampled from the texture to the fragment shader 104 for use in shading the fragment and sampling position in question.
[0178] The “shaded” fragment sample positions from the fragment shader 104 are then stored as part of an output render target in a buffer 106 , such as in memory 108 , for example, for subsequent post-processing or display.
[0179] Figure 3 An exemplary texture mapper (texture mapping device / unit) 110 is shown in greater detail.
[0180] like Figure 3 As shown, the texture mapper 110 includes a plurality of processing stages (circuits), including an input request stage (circuit) 200 that receives input from a renderer (e.g., Figure 2 This is followed by a coordinate calculation stage (circuitry) 201 which, for example, will convert any coordinates included in the texture mapping operation request into appropriate canonical coordinates between 0.0 and 1.0 to be used when sampling the texture.
[0181] Next comes the level of detail (LOD) calculation stage (circuitry) 202, which can determine the level of detail of the texture to sample for a texture mapping operation (this LOD calculation stage selects the tile level to use and how to filter between them if the texture is in the form of a tile). For example, this level of detail calculation may not be needed if the fragment shader program itself can explicitly indicate the level of detail to use or the texture is not stored in the form of a tile.
[0182] This is followed by a texel selection stage (circuitry) 203 which uses the coordinates determined by the coordinate calculation stage 201 to determine the actual texel (texture data element) in the texture (and if appropriate, the determined mapping level in the texture) to be used for the texture mapping operation.
[0183] The required texel (its data) is then fetched via a cache lookup stage (circuitry) 204 .
[0184] like Figure 3As shown, although the texture data will be stored in the memory system 108, when the texture mapper 110 needs the texture data, the texture data required for the texturing operation will be extracted from the memory 108 storing the texture data, and the texture data will first be loaded into the texture cache 205 of the texture mapper 110 or accessible to the texture mapper, where the texture mapper 110 then reads the texture data from the texel cache 205 (by the cache lookup circuit 204) for use.
[0185] like Figure 3 As shown, the texture mapper 110 may accordingly include a texel loader (texel loading circuit) 206, which is operable to load texel data from a texture stored in the memory 108 for storage in the texel cache 205. There may also be a decompressor (decoder) stage (circuitry) 207, which may decompress (decode) a texture stored in a compressed (encoded) format in the memory system 108 before storing the texel value in the texel cache 205.
[0186] Once the required texels (texel data values) have been fetched from the texel cache 205, these texels are used by the texture filtering stage (circuitry) 208 in the required texture filtering operation to generate the appropriate output result for the sampled texture position (coordinate), which is then appropriately packaged and returned to the fragment shader by the output result stage (circuitry) 209. The texture filtering circuit 208 may, for example, use the fetched texel values to perform any desired form of filtering, such as bilinear, trilinear, anisotropic or any other form of filtering, to generate the desired filtered sample results.
[0187] The present embodiment is particularly concerned with the case where the texture mapper 110 is to perform anisotropic filtering to sample the texture.
[0188] In this case, if Figure 4 As shown, when performing "anisotropic filtering", multiple (e.g., bilinear) filter samples are taken along a line in the texture (usually called the anisotropy direction), which line (anisotropy direction) is intended to correspond to the major axis of an "ellipse" (elliptical footprint) that corresponds to the projection of a circular pixel (the circular pixel represented by the sample point) onto the (3D) surface to which the texture is to be applied. The multiple samples taken along the line (anisotropy direction) are centered at the texture coordinate to be sampled (which will be the center of the ellipse).
[0189] The multiple samples taken along the anisotropic directions are then appropriately combined, for example using a weighted average, e.g. based on their distance along the anisotropic directions from the center of the projected "ellipse" (from the sampled texture coordinate), to provide an overall output sampled texture value that is returned and used to texture the sampling point in question.
[0190] Figure 4 This is illustrated and shows a number (six in this case) of bilinearly filtered texture samples 20 being taken along anisotropic directions 21 corresponding to the major axis of an "ellipse" 22, which corresponds to the projection of the sample position in the texture onto the surface to which the texture is to be applied. The individual bilinear filtered results are then combined appropriately to give the final output sampled texture value.
[0191] Figure 5 The basic operation of the texture mapper 110 when performing anisotropic filtering of textures is shown in one embodiment.
[0192] like Figure 5 As shown, when anisotropic filtering is to be performed (step 70), the texture mapper will first determine appropriate parameters for the elliptical footprint that actually corresponds to the projection of the sample point onto the surface to which the texture is applied (step 71). This can be done in any suitable and desired manner.
[0193] The determined ellipse footprint (the parameters of the ellipse) is then used to determine the level of detail (LOD) of the texture to sample, the anisotropy direction along which the texture will be sampled, and the "anisotropy degree" which represents the number of locations in the texture to sample along the anisotropy direction (step 72). Again, this can be done in any suitable and desired manner.
[0194] Once the level of detail, anisotropy direction, and degree of anisotropy of the texture to be sampled have been determined, a map is selected to be sampled for the texture (step 73).
[0195] The map to be sampled is selected based on the level of detail at which the texture is to be sampled, and in this embodiment, in the case of a fractional level of detail, will correspond to a map level that is more detailed (i.e., includes a higher resolution version of the texture) than the determined level of detail.
[0196] It is then determined how many positions in the map should be sampled (step 74).
[0197] The number of positions sampled in the map may be determined simply as (equal to) the degree of anisotropy determined from the ellipse parameters, or may be based on this determined degree of anisotropy, but with some possible modifications. For example, the number of positions to sample may be determined based on both a determined "base" number of positions to sample determined from the ellipse parameters (i.e., a "base" degree of anisotropy) and the level of detail of the sampled texture.
[0198] Once the number of positions along the anisotropy direction at which samples should be taken has been determined, bilinearly filtered samples are taken in the selected map for the determined number of positions (step 75).
[0199] like Figure 4 As shown, in this embodiment, the sampled locations are spaced one texel apart in the texture along the anisotropy direction (along the length of the major axis of the projected ellipse footprint). In this embodiment, a single bilinear filtered sample is taken at each location to be sampled along the anisotropy direction. (However, if desired, multiple (e.g., bilinear) samples may be taken for each location along the anisotropy direction (e.g., to "supersample" at each location to be sampled)).
[0200] It should be understood that in this embodiment, it may be determined that samples should be taken for a non-integer number of positions in the tile level. In this case, the number of positions to be sampled can simply be rounded to the nearest integer (or the nearest maximum integer, or the nearest minimum integer, as required).
[0201] However, where the texture mapper supports fetching fractional samples from the texture, then this operation is preferably used to fetch samples for the desired non-integer number of positions in the map level in question.
[0202] Once the bilinear filtered samples in the selected map level have been obtained, these filtered samples are used (combined) to provide an overall output sampled texture value for use by the (fragment shader of the) graphics processor (step 76).
[0203] In this embodiment, the samples taken in the tile level are appropriately combined according to the determined bilinear filtered samples (number of positions to sample) in the tile level in question to provide a combined overall output sampled texture value.
[0204] Therefore, a weighted average of the bilinear filtered samples is generated (based on the distance of the samples (positions) from the center of the major axis of the projected ellipse along the anisotropic direction).
[0205] The resulting values for the tile level are then linearly interpolated according to the fractional LOD value (ie based on how far the tile level in question is from the actual level of detail of the desired sampled texture) to provide the final overall output sampled texture value.
[0206] Typically, the weighting of bilinearly filtered samples based on their distance from the center of the projected ellipse may follow, for example, a linear function with the distance from the center of the ellipse, or a more complex function (weight distribution) may be used, such as following a Gaussian function or some similar function to the Gaussian function, etc.
[0207] Of course, other arrangements would be possible.
[0208] Once the overall output sample texture value has been determined, that value is returned to the fragment shader for use (step 77).
[0209] As discussed above, the present invention and embodiments are particularly directed to the incorporation of texture filtering operations (eg, bilinear filtering operations), such as when performing anisotropic filtering as described above.
[0210] Figures 6 to 13 exemplifies this.
[0211] Figure 6 An illustrative example of merging separate texture filtering operations in the context of two bilinear filtering operations that share the same four texels is shown.
[0212] Figure 6 Two separate bilinear texture filtering operations of anisotropic filtering operations are shown, sampling corresponding locations 601 and 602 in the texture, wherein each separate texture filtering operation utilizes the same four texels 603a, 603b, 603c and 603d.
[0213] As discussed above, the individual texture filtering operations 601 and 602 are traditionally processed separately. However, according to the present invention, these texture filtering operations can be merged because the texture filtering operations 601 and 602 use the same four texels in their corresponding bilinear filtering operations.
[0214] exist Figure 6 , the merging of the two texture filtering operations 601 and 602 is accomplished by first determining the corresponding weight of each texel for each individual texture filtering operation, and then summing the corresponding weights of each texel of the individual texture filtering operations 601 and 602 to obtain the weight of each texel of the merged texture filtering operation.
[0215] This operation can, and in this embodiment does, take into account the respective "anisotropic channel" weights of each individual bilinear filtering operation (its contribution to the overall anisotropic filtering (sampling) operation) to give a set of adjusted texel weights for each individual bilinear filtering operation before summing these respective adjusted weights.
[0216] In this embodiment, the adjusted set of weights for each individual bilinear filtering operation is calculated by multiplying the anisotropic pass weight of the corresponding bilinear filtering operation by its corresponding set of bilinear weights.
[0217] The bilinear weight of each texel for each individual texture filtering operation may be determined in any desired manner, but in this embodiment, and as Figure 6 As shown, the bilinear weights are determined for each individual texture filtering operation in the conventional manner for bilinear filtering (ie, based on the distance of the texel from the actual sampling location).
[0218] For example, each individual texture filtering operation will have a set of coordinates (u,v) within the texture map, and these coordinates typically fall within a set of four texels, where the coordinates (index) of the top-left texel of the texture filtering operation is given by (i,j)=(floor(u),floor(v)), and the coordinates of each other texel in the texel quad associated with the texture filtering operation can be calculated by adding +1 to one or both of the components of (i,j) as appropriate (thus, in an embodiment, the texels are typically at integer coordinates of the texture sample). The fractional part of the coordinate (i.e., the distance of the texture filtering operation in question from the top-left texel (in both the vertical and horizontal directions), as a fraction of the distance between two adjacent, axis-aligned texels (defined as 1.0)) is given by (frac_u,frac_v)=(u,v)-(i,j).
[0219] Therefore, the bilinear weight of each texel for a bilinear texture filtering operation is given by:
[0220] W_0=(1-frac_u)*(1-frac_v);
[0221] W_1 = frac_u*(1-frac_v);
[0222] W_2=(1-frac_u)*frac_v;
[0223] W_3 = frac_u * frac_v;
[0224] Where W_0 is the weight of the upper left texel, W_1 is the weight of the upper right texel, W_2 is the weight of the lower left texel, and W_3 is the weight of the lower right texel.
[0225] exist Figure 6 In the example of , the individual texture filter operation 601 has coordinates (203.19, 97.19), which means that the top left texel has coordinates (203, 97), the fractional part is (0.19, 0.19), and therefore the bilinear texel weights of the individual texture filter operation 601 are calculated to be (approximately) 0.66, 0.155, 0.155, and 0.036 for texels 603a-603d, respectively. Therefore, taking into account the anisotropic weight of 0.5 for the texture filter operation 601, the adjusted weights are calculated to be (approximately) 0.33, 0.08, 0.08, and 0.02 for texels 603a-603d, respectively.
[0226] Similarly, a separate texture filter operation 602 has fractional parts of coordinates (203.91, 97.91) and (0.91, 0.91), so the bilinear texel weights for the separate texture filter operation 602 are (approximately) 0.008, 0.08, 0.08, and 0.828 for texels 603a-603d, respectively. Therefore, taking into account the anisotropic weight of 0.5 for the texture filter operation 602, the adjusted weights are calculated to be (approximately) 0.00, 0.04, 0.04, and 0.41 for texels 603a-603d, respectively.
[0227] Therefore, summing these corresponding adjusted weights, the combined texel weights of texels 603a-603d are 0.33, 0.12, 0.12 and 0.43 respectively.
[0228] Figure 6 The combined texel weights can be Figure 5 Steps 76 and 77 are performed in a similar (same) manner as for the combined texture filtering operation.
[0229] If at least the fractional part frac_u or frac_v (the fractional part associated with the horizontal or vertical direction between texels) is equal to zero (or one), then the texture filtering operation associated with that fractional part will be located on the axis-aligned line between the two texels from which it is sampled, which means that the weights of texels not on that axis may be close to zero (at zero) and these texels will not effectively contribute to the output of the individual texture filtering operations.
[0230] If two texture filtering operations do not share exactly the same set of texels, but they are adjacent and share texel pairs, they can still be merged.
[0231] For example, consider two texture filtering operations, one of which requires a set of texels from the left side of the other texture filtering operation (and shares two of these texels) for a separate texture filtering operation on the right, if at least frac_u is equal to zero, then the texels that actually contribute to the output of the rightmost texture filtering operation will still be shared by the left texture filtering operation, and thus there is a single set of texels that contribute to the output of both texture filtering operations shared by the two texture filtering operations, which means that they can be similar to Figure 6 Merge as described in .
[0232] Other arrangements will also be possible.
[0233] Figure 7 is a flow chart illustrating a first embodiment of merging separate texture filtering operations according to the present invention in the context of anisotropic filtering. Figure 7 The operation can be used, for example, to Figure 6 The examples described combine separate texture filtering operations.
[0234] The operation starts with the initialization of the anisotropic filtering channel (step 701), which initializes the number of separate texture filtering operations required for the anisotropic channel and their positions within the anisotropy ellipse for the anisotropic channel and the anisotropy direction.
[0235] The next sample of the filtering pass (ie, texture filtering operation) is then obtained (step 702).
[0236] If the sample obtained in step 702 is the first sample to be obtained (step 703-yes), then the sample is then stored in a "parking" buffer associated with the anisotropic filtering channel (step 704). Specifically, the sample is stored as the "oldest sample" (i.e., the oldest sample that has been considered and not output to the next unit in the texture filtering pipeline (discussed below) until this point in the operation). The operation continues with obtaining the next sample (step 702).
[0237] However, if the sample obtained in step 702 is not the first sample obtained in the anisotropic filtering pass (step 703-No), the process continues to store the sample in the buffer, specifically as the "current sample" (i.e., the sample being considered for merging with the oldest sample).
[0238] The process continues by checking whether the samples obtained so far (ie, the samples stored in the buffer as the "oldest sample" and the "current sample") are suitable for merging (step 705).
[0239] When determining whether the samples are suitable for merging, a number of checks are performed on the samples in question (step 705), including a number of "precursor" checks to eliminate samples that cannot be merged.
[0240] That is, in this embodiment, it is checked whether the samples being considered for mergeability (texture filtering operations) sample the same texture "surface", as if they do not sample the same texture face, then they cannot be merged because they do not share the same texels and therefore do not share the same texel data. Specifically, it is determined whether the following conditions exist:
[0241] The samples being considered for mergeability sample the same tile level (in the case of textures stored as tiles), as if the samples are not sampled from the same level of the tile texture, then the samples may be sampled from different levels of detail of the texture with different texels and therefore may not be mergeable depending on the implementation;
[0242] The samples being considered for merging have the same depth (z-coordinate) (in the case of sampling a 3D texture (i.e. a texture with depth)), as if the samples (texture filtering operations) sampled the same texture but at different depths, then the texels will not be eligible for merging because the samples (texture filtering operations) being considered will not share any of the same texels (the texels may share the same vertical and horizontal position, but their depths within the texture will be different and therefore they will not be the same set of texels);
[0243] The samples being considered for mergeability sample the same cube face (in the case of texture filtering operations operating on cube textures), as if the samples sample different cube faces, then they will not share any texels from the same texture surface and will not be eligible for merging;
[0244] The samples being considered for mergeability are within a distance of 2 of the x- and y-coordinates of their required texels, as if these distances are outside this range then the samples cannot share any of the same texels and therefore cannot be merged according to this implementation;
[0245] If the samples meet the above criteria then in principle they are candidates for merging, and so the operation then determines whether the samples being considered for merging have the same coordinates (ie share the same texel) or whether the fractional parts of their coordinates are suitably equal to zero.
[0246] If the samples do not share the same coordinates (texels) (and at least one of their fractional parts is not equal to zero), then according to this embodiment, the samples cannot be merged, because more than one texture filtering operation may be required to perform a (bilinear) texture filtering operation that can sample from all these texels.
[0247] Similarly, if the fractional part of the coordinate is non-zero (such as about Figure 6 discussed) (and the samples do not share all the same texels), then the samples cannot be merged because, according to this implementation, more than one texture filtering operation would be required to sample from all the required texels.
[0248] Specifically, if the texture filtering operations require different (possibly adjacent (as described above)) sets of texels, and one of the texture filtering operations does not have its texel weights such that the output of the corresponding texture filtering operation depends only on the texels it shares with other texture filtering operations, then the texture filtering operations cannot be merged.
[0249] If the sample is mergeable (step 706-yes), i.e., the sample meets all the requirements set out in step 705, the weights of the texels are merged (the texel weights relative to each mergeable individual texture filtering operation are summed), and the coordinates (texels) of the merged texture filtering operation are indicated as (and adjusted if necessary to) the coordinates (texels) shared by the samples being considered for mergeability (i.e., the oldest sample and the current sample) (that is, the set of texels that contribute to both outputs of the texture filtering operation being considered) (step 708), for example as described above with reference to Figure 6 discussed.
[0250] Otherwise, if the samples cannot be merged (step 706-no), that is, at least one of the requirements set out in step 705 is not met, the oldest sample is output for processing, and the unmerged sample (current sample) is stored in the buffer as the oldest sample for consideration together with the next current sample (step 707).
[0251] Reference below Fig.13 Discussing sample processing, but as shown in the figure, the texel coordinates are sent to the texel extractor, which extracts the corresponding texel (texture data element) data and provides them along with the texel weight to the texture filtering unit which performs the required texture filtering operation.
[0252] In the case where multiple texture filtering operations are merged before encountering an unmergeable sample (texture filtering operation), the oldest sample may be the merged sample (as discussed below), or the oldest sample may be a separate texture filtering operation (e.g., in the case where two separate texture filtering operations (samples) are stored as the oldest sample and the current sample and they cannot be merged).
[0253] In either case, it is then checked whether the final sample in the anisotropic filtering channel has been reached (texture filtering operation) (step 709), and if so, the operation ends (step 711); otherwise, for the anisotropic channel being considered, the operation continues by considering the next sample of the anisotropic channel (bilinear filtering operation) (step 702).
[0254] In the case where the texture filtering operations are mergable, if the final texture filtering operation has not yet been reached, the merged sample is stored in the buffer (as the oldest sample) (step 704), and the operation continues to check whether the next sample (to be stored in the buffer as the current sample) can be merged with the merged sample (stored as the oldest sample).
[0255] If the final sample (texture filtering operation) has been reached, i.e. there are no more samples in the anisotropic filtering pass being considered, the (final) merged sample is output to the next stage in the pipeline (step 710) for processing (as discussed above and with respect to Fig.13 ), and the merge operation is completed (step 711).
[0256] therefore, Figure 7 The merge determination process operates to consider consecutive texture filter operations (from the set of texture filter operations that make up the overall (anisotropic) texture sampling operation) in turn to see if they can be merged. In this case, corresponding pairs of consecutive texture filter operations are considered, but the process is to consider whether the next texture filter operation can be merged with the previous texture filter operation (which can itself be a merge operation), where the next texture filter operation is either merged with the previous texture filter operation or the previous texture filter operation is sent for processing and a new "merge" sequence begins (and so on, until all texture filter operations in the set have been considered).
[0257] Fig. 8A An alternative implementation of a merge operation is shown that may allow separate texture filtering operations to be merged even though they may not share the same set of texels.
[0258] Fig. 8A and Figure 7 Similarly, the same steps 701, 702, 703, 704, 706, 707, 709, 710, 711 and 712 are shared, but the difference lies in the check for "mergeability" of the texture filtering operation and the subsequent "merging".
[0259] exist Fig. 8AIn , when considering whether samples (texture filtering operations) are mergeable, a similar set of "precursor" checks are employed to eliminate any pairs of samples that might be immediately identified as not suitable for merging (ie, not sampled from the same texture).
[0260] For example, with Figure 7 , consider the case where samples (texture filtering operations) from the same tile level (in the case of a tile texture) have the same depth (z-coordinate) (in the case of sampling a 3D texture) (i.e., a texture with depth), and sample the same cube face (in the case of sampling a cube texture).
[0261] In this embodiment, if Fig. 8A As shown, the samples being considered for mergeability are considered to be within a distance of 3 relative to the x- and y-coordinates of the texels they require. If the coordinates of the texels required by the samples being considered are outside this range, then the samples do not share any common samples (a sample will typically require four texels). Thus, this embodiment recognizes that the coordinates of the texels required by corresponding samples may be farther apart than in previous embodiments.
[0262] This is because, even if two texture filtering operations do not use exactly the same set of texels, it may still be the case that, for example, for the texture filtering operation under consideration, a single set of texels may be processed in a single texture filtering operation such that there is a merged texture filtering operation that may be performed for and in place of the different texture filtering operation under consideration.
[0263] For example, for some texture filtering operations, although in principle a specific set of multiple texture data elements is used, it may be the case that one or more texture data elements of the entire set of texture data elements to be used for the filtering operation do not actually contribute to the output of the texture filtering operation, e.g. because their contribution weight is zero for this specific instance of the texture filtering operation, and thus two samples may be able to be merged when another sample is considered.
[0264] If the samples meet the above criteria, then in principle they are candidates for merging, so the operation then determines whether the texels that will actually contribute to the sample under consideration are within the 2×2 quad of texels. That is, since the (bilinear) texture filtering operation requires four texels to be sampled from to provide the filtered output, if a non-zero weight is determined when considering the contribution weights of the texels of two samples to form a 2×2 quad of texels, then the two samples can be replaced by a single merged sample using the texels and weights indicated by the 2×2 quad.
[0265] To determine whether this is the case, in the present embodiment, an array (e.g., a matrix) is generated representing texels (preferably at their relative positions in the texture) and their contribution weights for the sample under consideration, where the weights associated with each sample (texture filtering operation) are combined (summed) for each texel and therefore for each position within the array, and the array (matrix) is then evaluated to determine which texels actually contribute to the output of the filtering operation (and, where appropriate, the configuration of contributing texture data elements). Specifically, a texture filtering operation is considered to be mergeable if there is a 2×2 quad of texels that contributes to the output.
[0266] Figure 8B An example of determining whether weight occupation areas of two corresponding filtering operations (samples) are located within a 2×2 quadruple is illustrated.
[0267] Figure 8B An exemplary array 803 of corresponding texel weights 804 for two texture filtering operations is shown, which in this embodiment takes the form of a 4×4 matrix. In this embodiment, the first texture filtering operation requires texels and texel weights represented by 806, while the second texture filtering operation requires texels and texel weights represented by 807. In this embodiment, some texels have a weight of zero, which means that these corresponding texels do not contribute to the texture filtering operation, and there are texels with non-zero weights (represented as "x"), which means that these texels have some contribution to the texture filtering operation.
[0268] When according to the above Fig. 8A When considering the combined texel weights of multiple texture filtering operations at step 801, if the combined (e.g., summed) weights at each corresponding texel position from each texture filtering operation fall within a 2×2 quad (e.g., quad 805), then the corresponding texture filtering operations associated with those weights are considered mergeable (assuming other criteria are met). Thus, texture filtering operations that, when combined, produce the weights in quad 805 are considered mergeable.
[0269] For example, the first texture filtering operation 806 in principle requires contributions from the four texels it requires. However, as in Figure 8B As can be seen in FIG. 8 , the weights required for the rightmost texels in the first texture filtering operation 806 are zero, which means that these texels actually contribute nothing to the texture filtering operation (e.g., since the first texture filtering operation samples the texture close to the axis-aligned line between the leftmost texels, this means that the rightmost texels contribute (almost) nothing to the output (which will be relevant to Figure 6 and Figure 9 for further details)).
[0270] Similarly, for the second texture filtering operation 807, the leftmost weight of the texel of the second texture filtering operation 807 is zero.
[0271] Thus, when considering the resulting combined texel weights, a 2×2 quad of texel 805 can be seen, formed by the leftmost weight of the first texture filtering operation 806 and the rightmost weight of the second texture filtering operation 807 .
[0272] Thus, the first texture filtering operation and the second texture filtering operation may be combined into a single texture filtering operation using the texels and texel weights in the 2×2 quad 805 .
[0273] However, if the combined texel weights of texture filtering operations do not fall within a quad, then these corresponding texture filtering operations will not be considered mergeable.
[0274] Back to Fig. 8A , where the samples under consideration are mergeable, i.e., they satisfy the requirements of step 801, the samples may be merged (step 802). In this embodiment, samples are merged by summing the texel weights at the corresponding texels associated with the samples, and the merged texture filtering operation adjusts its texel set (coordinates) to be associated with the resulting texel set that falls within the 2×2 quad.
[0275] Figure 9 shows how the Figure 7 and Fig. 8A A more detailed example of merging separate texture filtering operations is accomplished by the process outlined in
[0276] Fig.9A An exemplary anisotropic filtering pass is shown, with anisotropic ellipse 901 and samples S0-S4 along the major axis of the ellipse. In this example, it can be assumed that samples S0-S4 (corresponding to five separate texture bilinear filtering operations) are sampling the same texture "surface" and can therefore potentially be merged.
[0277] Looking closely at the texture filtering operations S0 and S1, Fig. 9B In , it can be seen that these texture filtering operations use the same four texels in their corresponding texture filtering operations. Figure 7 The texture filtering operations S0 and S1 are merged, and the respective weights of each texel of each of these texture filtering operations S0 and S1 are added to obtain the texel weights for the merged texture bilinear filtering operation.
[0278] Fig. 9C The texture filtering operations S2 and S3 are shown in more detail. Fig. 9CAs shown, separate texture filtering operations S2 and S3 use different sets of texels, where S2 requires texels at coordinates (1,1), (1,2), (2,1), and (2,2), and S3 requires texels at coordinates (2,1), (2,2), (3,1), and (3,2) for their respective texture filtering operations. Therefore, these texture filtering operations may not be merged in the same way as texture filtering operations S0 and S1.
[0279] However, in Fig. 9C As can be seen in , the texture filtering operation S3 is close to the axis alignment between texels (2,1) and (2,2), and is particularly close to the texel at (2,1), while being far away from the other three texels at (2,2), (3,1), and (3,2) on which it depends. Thus, for example, when truncated to 8-bit precision, the texture filtering operation S3 only uses the texel weight of texel (2,1), which is 0.2 in this example, because the weights at its other texels are zero (the sampling position S3 is far enough away from these other texels that they actually do not contribute to the texture filtering operation).
[0280] However, the texture filtering operation S2 is positioned so that it has a non-zero weight for each of its texels, with the weights being 0.04, 0.04, 0.06, and 0.06 for the texels at (1,1), (2,1), (1,2), and (2,2), respectively.
[0281] The total weights at each texel are summed and an array (matrix) of summed weights at each texel is formed, resulting in array 902. As can be seen in array 902, the summed weights form a 2x2 quadruplet of weights 903, where weights outside of quadruplet 903 are zero.
[0282] Thus, the two operations S2 and S3, which themselves use different texels from each other, actually use only four different texels in total, so that they can then still be replaced by a "merged" single bilinear filtering operation that uses the four texel weights in the 2×2 quad 903. Thus, the texture filtering operations S2 and S3 can be Fig. 8A Merge as described in .
[0283] If S3 is sampled at (2,1) (or along the axis-aligned line between texels (2,1) and (2,2)) so that the fractional part of S3's coordinates is zero, then Figure 7 The samples were combined using the procedure described in .
[0284] FIG. 10 shows an example of combining a large number of texture filtering operations.
[0285] Specifically, Fig. 10AThree texture filtering operations S0-S2 along the major axis of the anisotropic ellipse 1001 are shown. Fig. 10A As can be seen in , none of the three texture filtering operations share the same four texels, and none of the three texture filtering operations are close to the axis-aligned line between texels, so that they have zero weight for any of their corresponding texels.
[0286] In contrast, the three texture filter operations S0-S2 have non-zero weights for all four of their corresponding texels. Furthermore, texture filter operations S0 and S1 both have weights for texels (1,0) and (1,1), and texture filter operations S1 and S3 both have weights for texels (2,0) and (2,1), while texture filter operations S0 and S2 do not share any common texels.
[0287] In this case, the three texture filtering operations can be effectively merged into two separate merged texture filtering operations. That is, by combining the texel weights at each texel produced by each of the three texture filtering operations, two side-by-side 2×2 quads of texel weights for filtering can be formed. This is because texture filtering operation S1 shares texels with S0 and S2, which means that when the corresponding texel weights are added, S1 can be effectively merged into S0 and S2. For example, if the weight per texel used for each texture filtering operation is 0.083, then when the weights are combined for overlapping use of texels by the various texture filtering operations S0-S2, Fig. 10B The array 1002 in will represent Fig. 10A The weight at each texel 1000 in .
[0288] As can be seen in array 1002, there are two 2x2 quads of non-zero weighted texels 1003 and 1004, which means that two texture filtering operations can effectively replace the initial three texture filtering operations.
[0289] Fig.11A A more complex arrangement of texture filtering operations that may be incorporated according to the present invention is shown.
[0290] Specifically, Fig.11A Three separate texture filtering operations S0 - S2 along the major axis of the anisotropic ellipse 1100 are shown.
[0291] Fig. 11B The individual texture filtering operations and their corresponding texel weights are shown in more detail. Specifically, Fig. 11BIt is shown that texture filtering operation S0 has weights only for texels (1,1) and (2,1), texture filtering operation S1 has weights only for texels (2,1) and (3,1), and texture filtering operation S3 has weights only for texels (3,0), (2,1), and (3,1).
[0292] Thus, the three texture filtering operations only have weights for a total of four texels, as outlined at 1101. Therefore, the weights at these texels may be combined accordingly, and a single merged texture filtering combination may be used instead of three separate texture filtering operations.
[0293] Fig.12 A more complex arrangement incorporating texture filtering operations is shown.
[0294] Specifically, Fig.12 Individual texture filtering operations S0 - S6 are shown distributed along the major axes of the anisotropic ellipse 1201 .
[0295] The individual texture filtering operations S0-S7 are distributed in such a way that:
[0296] For texels (0,1) and (1,1), S0 has non-zero weight;
[0297] For texels (2,0), (1,1), and (2,1), S1 has non-zero weight;
[0298] For texels (2,0), (3,0), (2,1), and (3,1), S2 has non-zero weights;
[0299] For texels (3,0), (4,0), (3,1), and (4,1), S3 has non-zero weights;
[0300] For texels (4,0), (5,0), (4,1), and (5,1), S4 has non-zero weights;
[0301] For texels (5,0), (6,0), and (5,1), S5 has non-zero weights;
[0302] For texels (6,0) and (7,0), S6 has non-zero weights.
[0303] Thus, seven separate texture filtering operations may be combined into three combined filtering operations 1202 , 1203 , and 1204 .
[0304] Specifically, the texel weights from S0, S1, and the two leftmost texel weights of S2 may be merged in a manner similar to the combination of the examples presented in Figures 10 and 11 to form a first merged filtering operation 1202. Furthermore, the two rightmost texel weights of S2, the texel weight of S3, and the two leftmost texel weights of S4 may be merged in a manner similar to that described with respect to Figure 10 to form a second merged texture filtering operation 1203. A third merged texture filtering operation 1204 is obtained by merging the texel weights from the two rightmost texel weights of S4, the texel weight of S5, and the texel weight of S6 in a manner similar to Figures 10 and 11.
[0305] Therefore, more texture filtering operations may be considered for (potential) merging, and accordingly it may be determined that texture filtering operations may be merged when they may be replaced with fewer texture filtering operations (e.g., when three texture filtering operations may be replaced with two texture filtering operations or otherwise).
[0306] Fig.13 The configuration of the texture mapper (texture mapping unit / circuit) of this embodiment is shown in more detail.
[0307] like Fig.13 As shown, a texture mapper (unit / circuit) 1300 receives at a coordinate input unit (circuit) 1301 coordinates in a texture to be (anisotropically) sampled.
[0308] The coordinate input unit 1301 then feeds the coordinates of the locations to be sampled into an anisotropic filtering parameter calculation unit (circuit) 1302. The anisotropic parameter calculation unit determines, for example, the level of detail at which to sample the texture, the number of samples to take, the distance between samples, and the parameters of the anisotropic ellipse to use.
[0309] These parameters are provided as input to the texel index calculation unit 1311, such as Fig.13 As shown, the texel index calculation unit includes an anisotropic channel initiation unit (circuit) 1304, which generates a corresponding set of bilinear texture filtering operations (samples) for the entire anisotropic sampling operation (channel) being performed, as well as any required contribution weights of the samples.
[0310] There is then a texel selection unit (circuitry) 1305 which determines which texels are to be used for each sample (bilinear texture filtering operation) and their corresponding texel weights. For example, the texel unit 1305 determines the coordinates of the texels to be sampled for each individual texture sampling operation (according to the sample position of that operation) and the associated weights of these texels for (bilinear) filtering (optionally also taking into account the anisotropic weights of the individual texture sampling operations themselves). The weights (of the filtering operations) may also be truncated to 8 bits, for example.
[0311] Then, the sample (filter operation) merging unit (circuit) 1306 determines whether the corresponding texture filter operations can be merged, and merges the texture filter operations appropriately. In one embodiment, the sample merging unit 1306 is as described with respect to Figure 7 13. In other embodiments, the sample merging unit 1306 operates as described above. Fig. 8A Operate as described.
[0312] Thus, the output of the sample merging unit 1306 (where appropriate) is the merged texture filtering operation, and any individual texture filtering operation that cannot be merged with another texture filtering operation, and their corresponding texels (texel indices) and texel weights.
[0313] The texel index and texel weight are then passed to the texel extraction unit (circuit) 1307, which obtains the associated texture data (texel) from the storage device (DRAM) 1309 and provides the texture data (texel) and weight to the texture filtering unit (circuit) 1310.
[0314] The texture filtering unit (circuitry) 1310 performs the required texture filtering operations and outputs corresponding filtered texture data (eg, filtered RGBA (red, green, blue, alpha) values in the case of an image / frame) to, for example, a fragment shader.
[0315] Specifically, the texture filtering unit 1310 appropriately uses a corresponding set of weights to perform (bilinear) filtering of the corresponding texture data (texels) associated with each (bilinear) filtering operation, and appropriately combines the results of all individual bilinear filtering operations for the anisotropic channels to provide an overall output of anisotropic filtering (sampling) of the texture.
[0316] In one embodiment, where the texel selection unit 1305 does not take into account the (anisotropic) weights of the individual texture sampling operations themselves when determining the weights for each respective texel for the individual texture filtering operations, the texture filtering unit 1310 takes into account the weight of each (bilinear) texture filtering operation (its contribution to the entire anisotropic filtering (sampling) operation) when combining each bilinear sample for the anisotropic channel in question.
[0317] In an alternative embodiment, when determining the weight of each corresponding texel for a separate texture filtering operation, the texel selection unit takes into account the (anisotropic channel) contribution weight of the individual texture sampling operation itself, for example by multiplying the weight of the corresponding texel for the individual bilinear filtering operation by the "anisotropic weight" of the individual texture operation.
[0318] In this case, since the anisotropic weights for each individual filtering operation have been considered and accounted for, the texel filtering unit 1310 does not consider the anisotropic weights, but instead uses the provided texels and weights to perform the required filtering operations to provide filtering data for each required filtering operation, and combines the filtering data for each required filtering operation in an anisotropic channel.
[0319] It should be understood that other combinations and arrangements are possible.
[0320] As can be seen from the above, at least in embodiments of the present invention, the present invention provides a mechanism for combining appropriate texture filtering operations to reduce the total number of texture filtering operations that must be performed within a set of (separate) texture filtering operations when providing an overall output sample texture value. Therefore, the present invention provides a number of benefits compared to other approaches.
Claims
1. A method of operating a graphics processor in the context of sampling a texture to provide an output sampled texture value for use in rendering an output, the sampled texture comprising an array of texture data elements, each texture data element having an associated texture value; The method comprises: When performing a texture sampling operation that uses the results of multiple texture filtering operations to provide an overall output sampled texture value, each texture filtering operation uses a set of one or more texture data elements from the texture being sampled to provide a corresponding output filtered texture value: determining whether a texture filtering operation of the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation of the set of texture filtering operations to be performed to provide the overall output sample texture value; as well as When it is determined that a texture filtering operation in the set of multiple texture filtering operations to be performed to provide the overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value, performing a merged texture filtering operation for the two texture filtering operations; as well as The result of the merged texture filtering operation is used when providing the overall output sample texture value. 2 . The method of claim 1 , wherein the texture sampling operation is anisotropic sampling of a texture. 3 . The method of claim 1 , wherein each texture filtering operation in the set of multiple texture filtering operations is a bilinear filtering operation.
4. The method of claim 1 , wherein determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value comprises at least one of the following: (i) where the texture comprises a plurality of tiles, determining whether the texture filtering operation under consideration is sampling from the same tile level in the texture; (ii) in the case of a cube texture, determining whether the texture filtering operation under consideration is sampling from the same cube face; (iii) In the case of a 3D texture, determine whether the texture filtering operation under consideration is sampling from the same depth (Z coordinate) in the 3D texture.
5. The method of claim 1 , wherein determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value comprises determining whether the texture filtering operations under consideration use the same texture data elements as each other.
6. The method of claim 1 , wherein determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value comprises comparing a position in the texture sampled by each of the texture filtering operations to determine whether the texture filtering operations can be merged.
7. A method according to claim 1 or 2, wherein determining whether a texture filtering operation in a set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially combined with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value uses the relative contributions of the texture data elements to the respective texture filtering operations to determine whether there is a reduced set of texture data elements that actually contribute to the texture filtering operation under consideration.
8. The method of claim 7, wherein the texture filtering operations are determined to be mergeable when the reduced set of texture data elements that will actually contribute to the texture filtering operation under consideration has a predefined configuration.
9. The method according to claim 1 or 2, further comprising: when a combined filtering operation uses texture data elements that contribute to a plurality of said texture filtering operations being combined; for each texture data element to be used in the merged texture filtering operation, combining all contribution weights of the texture data element from each of the texture filtering operations being merged to give a contribution weight for the texture data element in the merged texture filtering operation; and using the contribution weights so combined when performing said combined texture filtering operation.
10. The method according to claim 1 or 2, further comprising: sequentially considering consecutive texture filtering operations in the set of texture filtering operations constituting the overall texture sampling operation to determine whether they can be merged until all of the texture filtering operations in the set have been considered; in Considering in turn consecutive texture filtering operations in the set of texture filtering operations constituting the overall texture sampling operation to determine whether they can be merged comprises: Consider whether the next texture filtering operation can be merged with the previous texture filtering operation; as well as In the case where the next texture filtering operation can be merged with the previous texture filtering operation, merging the next texture filtering operation with the previous texture filtering operation; In the event that the next texture filtering operation cannot be merged with the previous texture filtering operation, the previous texture filtering operation is sent for processing and a new merging consideration process is started.
11. A graphics processor, comprising: a texture mapping unit configured to sample a texture to provide output sampled texture values for use in rendering the output, each sampled texture comprising an array of texture data elements, each texture data element having an associated texture value; The texture mapping unit comprises: texture filtering circuitry configured to perform texture filtering operations, each texture filtering operation using a set of one or more texture data elements from a texture to provide a corresponding output filtered texture value; and a texture filtering operation merging circuit configured to, when the texture mapping unit performs a texture sampling operation that uses results of a plurality of texture filtering operations to provide an overall output sampled texture value, each texture filtering operation uses a set of one or more texture data elements from the texture being sampled to provide a corresponding output filtered texture value: determining whether a texture filtering operation of the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation of the set of texture filtering operations to be performed to provide the overall output sample texture value; as well as When it is determined that a texture filtering operation of the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation of the set of texture filtering operations to be performed to provide the overall output sample texture value, causing the texture filtering circuitry to: performing a combined texture filtering operation for the two texture filtering operations; and The result of the merged texture filtering operation is used when providing the overall output sample texture value.
12. The graphics processor of claim 11, wherein the texture sampling operation is anisotropic sampling of a texture.
13. The graphics processor of claim 11 or 12, wherein each texture filtering operation in the set of multiple texture filtering operations is a bilinear filtering operation.
14. The graphics processor of claim 11 or 12, wherein the texture filtering operation merging circuit is configured to, when determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value, perform at least one of the following: (i) where the texture comprises a plurality of tiles, determining whether the texture filtering operation under consideration is sampling from the same tile level in the texture; (ii) in the case of a cube texture, determining whether the texture filtering operation under consideration is sampling from the same cube face; (iii) In the case of a 3D texture, determine whether the texture filtering operation under consideration is sampling from the same depth (Z coordinate) in the 3D texture.
15. A graphics processor according to claim 11 or 12, wherein the texture filtering operation merging circuit is configured to determine whether the texture filtering operations under consideration use the same texture data elements as each other when determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value.
16. The graphics processor of claim 11 or 12, wherein the texture filtering operation merging circuit is configured to, when determining whether a texture filtering operation in the set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value, compare a position in the texture sampled by each of the texture filtering operations to determine whether the texture filtering operations can be merged.
17. A graphics processor according to claim 11 or 12, wherein the texture filtering operation merging circuit is configured to use the relative contributions of the texture data elements to the corresponding texture filtering operations to determine whether there is a reduced set of texture data elements that actually contribute to the texture filtering operation under consideration when determining whether a texture filtering operation in a set of multiple texture filtering operations to be performed to provide an overall output sample texture value can be at least partially merged with another texture filtering operation in the set of texture filtering operations to be performed to provide the overall output sample texture value.
18. The graphics processor of claim 17, wherein the texture filtering operation is determined to be mergeable when the reduced set of texture data elements that will actually contribute to the texture filtering operation under consideration has a predefined configuration.
19. A graphics processor according to claim 11 or 12, wherein the texture filter operation merging circuit is configured to, when a merged filter operation uses texture data elements that contribute to a plurality of the texture filter operations being merged, combine all contribution weights of a given texture data element from each of the texture filter operations being merged to provide a contribution weight for the texture data element in the merged texture filter operation; and wherein The combined texture filtering operation uses the contribution weights thus combined.
20. A graphics processor according to claim 11 or 12, wherein the texture mapper unit is configured to sequentially consider consecutive texture filter operations in the set of texture filter operations constituting the overall texture sampling operation to determine whether they can be merged until all of the texture filter operations in the set have been considered; The texture filtering operation merging circuit is further configured to: When considering in turn the consecutive texture filtering operations in the set of texture filtering operations constituting the overall texture sampling operation to determine whether they can be merged, Consider whether the next texture filtering operation can be merged with the previous texture filtering operation; If the next texture filtering operation can be merged with the previous texture filtering operation, merge the next texture filtering operation with the previous texture filtering operation; and In the event that the next texture filtering operation cannot be merged with the previous texture filtering operation, the previous texture filtering operation is sent to the texture filtering circuit and a new merging consideration process is started.
21. A texture mapping device operable to perform a graphics texturing operation, the texture mapping device comprising: a texture mapping unit configured to sample a texture to provide output sampled texture values for use in rendering the output, each sampled texture comprising an array of texture data elements, each texture data element having an associated texture value; The texture mapping unit comprises: texture filtering circuitry configured to perform texture filtering operations, each texture filtering operation using a set of one or more texture data elements from a texture to provide a corresponding output filtered texture value; and a texture filtering operation merging circuit configured to, when the texture mapping unit performs a texture sampling operation that uses results of a plurality of texture filtering operations to provide an overall output sampled texture value, each texture filtering operation uses a set of one or more texture data elements from the texture being sampled to provide a corresponding output filtered texture value: determining whether a texture filtering operation of the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation of the set of texture filtering operations to be performed to provide the overall output sample texture value; as well as When it is determined that a texture filtering operation of the set of multiple texture filtering operations to be performed to provide the overall output sample texture value is at least partially combinable with another texture filtering operation of the set of texture filtering operations to be performed to provide the overall output sample texture value, causing the texture filtering circuitry to: performing a combined texture filtering operation for the two texture filtering operations; and The result of the merged texture filtering operation is used when providing the overall output sample texture value.
22. A computer-readable storage medium storing a computer program, the computer program comprising software code which, when executed on a data processor, performs the method according to claim 1 or 2.