Tiling primitives in a graphics system
By determining bounding box and analyzing the intersection point of the primitives in the graphics processing system, the number of tiled calculations is reduced, and the problem of high calculation costs in the tiled process is solved and the rendering efficiency of the system is improved.
Patent Information
- Application Number
- CN202110312488.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2015-04-22
- Filing Date
- 2016-04-06
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2036-04-24
AI Technical Summary
In a graphics processing system, when tiling the primitives, a large number of floating-point operations are required to be performed, resulting in high calculation costs and affecting the efficiency of the system.
By determining the bounding box of the primitive and reducing the number of tiled calculations for the intersection of the tiled bounding box and the edge of the primitive, performing tiled tests only on the necessary tiles.
It effectively reduces the number of floating-point operations required during the tiling process, improves the rendering efficiency of the graphics processing system, and reduces power consumption.
Smart Images

Figure CN113077531B_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese invention patent application with the application date of April 6, 2016, application number 201610211411.4, and invention name “Blocking primitives in a graphics processing system”. Technical Field
[0002] The present disclosure relates to tiling primitives in a graphics processing system. Background Art
[0003] A graphics processing system is used to process graphics data. For example, an application running on a computing system may need to render an image of a three-dimensional (3D) scene for display to a user. An application may send graphics data to a graphics processing system to be rendered, wherein the graphics data describes a plurality of primitives to be rendered. As known in the art, primitives are typically convex polygons, such as triangles or convex quadrilaterals, wherein primitives typically have positions in a rendering space of a graphics processing system defined by the positions of their vertices, and may have appearances defined by other attributes such as color or texture attributes. Objects in a scene may be represented by one or more primitives. As graphics processing systems develop, their ability to render complex images improves, and therefore applications take advantage of this and provide more complex images to the graphics processing system for rendering. This means that the number of primitives in an image tends to increase, and therefore the ability of a graphics processing system to efficiently process primitives becomes more important.
[0004] One known way to improve the efficiency of a graphics processing system is to render images in a tile-based manner. In this way, the rendering space into which primitives are to be rendered is divided into multiple tiles, which can then be rendered independently of each other. In order to render primitives, the rendering unit uses memory to store intermediate results (such as depth values and primitive identifiers, etc.) for different sample positions. If the rendering unit operates on one tile at a time, most (or all) of this memory can be located "on the chip", that is, on the graphics processing unit (GPU), which may not be possible when the entire rendering space is rendered at the same time. Therefore, in a tile-based graphics system, the number of read and write operations between the GPU and the off-chip memory (that is, it can be called "system memory") is generally reduced compared to a non-tile-based graphics system. Since read and write operations between the GPU and the system memory are generally very slow and use a lot of power (compared to operations performed within the GPU), tile-based graphics systems are often more efficient (in terms of power and speed) than non-tile-based graphics systems. The tile-based graphics system includes a tiling unit for tiling primitives. That is, the tiling unit determines, for a primitive, which tiles of a plurality of tiles of a rendering space the primitive is in. Thereafter, when the rendering unit renders the tile, information indicating which primitives should be used to render the tile may be given.
[0005] For example, Figure 1 Some elements of a tile-based graphics processing system 100 that can be used to render an image of a 3D scene are shown. The graphics processing system 100 includes a graphics processing unit (GPU) 102 and two portions of memory 104. 1 and 104 2 It is noted that the two portions of memory 104 1 and 104 2 may or may not be part of the same physical memory, and memory 104 1 and 104 2 Both may be located "off-chip", i.e. not on the same chip as GPU 102. 1 and 104 2 ) and GPU 102 can be carried out through a communication bus in system 100.
[0006] The GPU 102 includes a pre-processing module 106, a tiling unit 108, and a rendering unit 110. The tiling unit 108 includes processing logic 112 and data storage 114, and the rendering unit 110 includes a hidden surface elimination (HSR) module 116 and a texturing / shading module 118. The image processing system 100 is arranged so that graphics data describing a sequence of primitives provided by an application is received at the pre-processing module 106. The pre-processing module 106 performs functions such as geometry processing including clipping and culling to eliminate primitives that do not fall into the visible view. The pre-processing module 106 may also project the primitives into screen space. The pre-processing module 106 outputs the primitives to the tiling unit 108.
[0007] The tiling unit 108 receives primitives from the pre-processing module 106 and determines which of the primitives are present in each tile of the tiles of the rendering space of the graphics processing system 100. The primitive may be in one or more tiles of the tiles of the rendering space. The tiling unit 108 assigns the primitives to the tiles of the rendering space by creating a display list for the tiles, wherein the display list for the tiles includes an indication of the primitives present in the tiles (i.e., primitive IDs). The display list and primitives are output from the tiling unit 108 and stored in the memory 104. 1 The rendering unit receives data from the memory 104 1 The display list for the tile and the primitives associated with the tile are extracted, and the HSR module 116 performs hidden surface elimination to thereby eliminate fragments of primitives hidden in the scene. The remaining fragments are passed to the texturing / shading module 118, which performs texturing and / or shading on the fragments to determine pixel color values of the rendered image, which can be passed to the memory 104. 2 The rendering unit 110 processes the primitives in each tile in the tile, and when the entire image has been rendered and stored in the memory 104 2 When the image is output from the graphics processing system 100 and displayed on a display, for example. Figure 1 In the example shown in , the tile-based graphics processing system 100 is a deferred rendering system, meaning that the rendering unit 110 performs hidden surface elimination on primitive fragments before performing texturing and / or shading on the primitive fragments in order to render the scene. However, in other examples, the graphics processing system may not be a deferred rendering system, such that texturing and / or shading is performed on the primitive fragments before performing hidden surface elimination on the primitives.
[0008] Figure 2 2 shows an example of a rendering space 202 that has been divided into an 8x12 array of tiles 204, where the tile in the mth row and nth column is referred to as 204. mn. Primitive 206 is illustrated. The tiling unit 108 operates to determine which tiles of the tiles 204 the primitive 206 is in. Where the primitive 206 at least partially overlaps with the tile 204, the primitive 206 is "in" the tile 204. The tiling unit 108 determines the bounding box 208 by finding the minimum and maximum x and y coordinates of the three vertices of the primitive 206 and forming the box 208 from those coordinates. The tiling unit 108 may thereby determine that the primitive 206 is not in any tile of the tiles 204 that is not in the bounding box 208. Where the tile 204 at least partially overlaps with the bounding box 208, the tile 204 is "in" the bounding box 208. In some examples, the bounding box may be determined at a tile resolution, whereby the size of the bounding box may be increased so that the edges of the bounding box fall on a tile boundary. Figure 2 208, there are tiles with points (i.e., the top and bottom rows of tiles of the rendering space 202, the first column and the last two columns of tiles) outside the bounding box 208, and so on this basis, the tiling unit 108 can determine that the primitive 206 is not in those tiles. In a very simple implementation, the tiling unit 108 can simply indicate that the primitive is in all tiles in the bounding box 208. However, this means that the primitive is indicated as being in some tiles that it is not actually in. When the primitive is retrieved from the memory 104 1 When primitives are read and processed for tiles in which they are not visible, due to the fact that 1 This can lead to additional memory consumption due to unnecessary storage of primitives and / or primitive IDs in the rendering unit 110 and inefficiencies in the rendering unit 110. Therefore, it is generally preferred that the tiling unit 108 determine in which tiles of the tiles in the bounding box 208 the primitives are located.
[0009] For each tile in the bounding box 208 (e.g., Figure 2 For each white tile in the white tile in the image, a tile calculation may be performed to determine whether the primitive 206 is in the tile. For example, the tile calculation for determining whether the primitive 206 is in the tile 204 may include a calculation for each edge of the primitive. For example, Figure 3 As shown, the edge line (302) defining the edge of the primitive 206 is shown. 1 ,302 2 and 302 3 ) uses the vertex (304) of primitive 206 1 ,304 2 and 304 3) is determined by the position of the edge line 302. A test may then be performed for each edge line 302 to determine whether the tile 204 is inside or outside the corresponding edge line 302 by comparing the position of the test point in the tile with the equation of the edge line 302. The test point in the tile may be different for tests relative to different edges, i.e., the test point may be edge specific. For example, a test may be performed to determine whether the tile is inside or outside the edge line 302. 1 Internal test, the test point is at the lower left of the tile; whether the tile is on the edge line 302 2 Internal test, the test point is at the upper left of the tile; and whether the tile is on the edge line 302 3 For the internal test, the test point is at the lower right of the tile. If the tile is determined to be inside all edge lines 302, then the primitive is determined to be in the tile. However, if the tile is determined to be outside any edge line in edge lines 302, then the primitive is determined not to be in the tile.
[0010] Tiling calculations may be performed for each of the tiles in the bounding box 208 in order to determine whether a primitive is in the corresponding tile. For each edge of the primitive, and for each tile in the bounding box, the comparison of the location of edge-specific test points in the tile with the equation of the appropriate edge line typically involves performing one or more floating point operations. Floating point operations are expensive to perform (in terms of time and power consumption). This may be problematic, particularly as the number of primitives in an image tends to increase, because the number of floating point operations involved in the tiling process may become large enough to significantly and adversely affect the performance of the graphics processing system 100. Therefore, it would generally be beneficial to reduce the time and power consumed in the tiling process. Summary of the invention
[0011] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0012] Examples are described herein in which the number of tiled calculations (e.g., involving floating point operations) used to tile primitives can be reduced compared to the prior art examples described in the background section above. This can help improve the efficiency of a graphics processing system used to render primitives (e.g., in terms of speed and power).
[0013] A method of processing primitives in a graphics processing system is described herein, the method comprising tiling the primitives to determine in which tiles of a plurality of tiles of a rendering space the primitives are located, the tiling the primitives comprising: determining a bounding box for the primitive; for each tile boundary of at least one tile boundary between lines of the tile in the bounding box, determining an intersection point of the tile boundary with an edge of the primitive; and determining in which tiles of the tiles in the bounding box the primitives are located using the determined intersection points.
[0014] A graphics processing system is described herein that includes a tiling unit for tiling a primitive to determine in which tiles of a plurality of tiles of a rendering space the primitive is located, the tiling unit being configured to: determine a bounding box for the primitive; for each tile boundary of at least one tile boundary between lines of the tile in the bounding box, determine an intersection point of the tile boundary with an edge of the primitive; and determine in which tiles of the tiles in the bounding box the primitive is located using the determined intersection points.
[0015] A computer readable code may be provided, which is suitable for performing the steps of the method of any example in the examples described herein when the code is run on a computer. In addition, a computer readable code may be provided for generating a graphics processing system according to any example in the examples described herein. The computer readable code may be encoded on a computer readable storage medium.
[0016] As will be apparent to the skilled person, the above features may be combined where appropriate and may be combined with any of the aspects of the examples described herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Examples will now be described in detail with reference to the accompanying drawings, in which:
[0018] Figure 1 is a schematic diagram of a graphics processing system;
[0019] Figure 2 showing primitives in a tile of the rendering space;
[0020] Figure 3 illustrating edge lines defining edges of primitives;
[0021] Figure 4a and Figure 4b A flow chart illustrating a first method of processing primitives in a graphics processing system is shown;
[0022] Figure 5a An example of primitives in a single tile of the rendering space is shown;
[0023] Figure 5b An example of primitives in a row of a tile of a rendering space is shown;
[0024] Figure 5c Three primitives are shown whose bounding boxes have been clipped to the edge of the rendering space;
[0025] Figure 6 shows primitives in three tiles of a 2x2 square of tiles of the rendering space;
[0026] Figure 7a shows primitives in a 2x8 rectangle of a tile of rendering space;
[0027] Figure 7b Primitives are shown extending beyond the edge of a rendering space comprising a 4x8 array of tiles;
[0028] Figure 8 edge-specific test points in the tile for corresponding edge orientations are shown;
[0029] Fig. 9 An example of primitives in some tiles in a 9x14 rectangle of tiles of rendering space is shown;
[0030] Fig.10 A flow chart illustrating a second method of processing primitives in a graphics processing system is shown;
[0031] Figures 11a to 11d illustrates four different stages of the tiling process of the second method; and
[0032] Fig.12 It is a schematic diagram of a computer system.
[0033] The accompanying drawings illustrate various examples. The skilled person will recognize that the illustrated element boundaries (e.g., boxes, groups of boxes, or other shapes) in the accompanying drawings represent an example of boundaries. It is possible that, in some examples, an element may be designed as multiple elements, or multiple elements may be designed as one element. Where appropriate, common reference numerals are used throughout the accompanying drawings to indicate similar features. DETAILED DESCRIPTION
[0034] Embodiments will now be described by way of example only.
[0035] Figure 1 The graphics processing system 100 shown in FIG. 1 can be used to implement the example methods described herein. As described above, the graphics processing system 100 is a tile-based deferred rendering graphics processing system, which includes a GPU 102 and two portions of memory 104. 1 and 104 2 As mentioned above, the two portions of memory 104 1 and 104 2may or may not be part of the same physical memory, and memory 104 1 and 104 2 Both can be located "off-chip", that is, not on the same chip as GPU 102. 1 and 104 2 ) and the GPU 102 may be communicated via a communication bus in the system 100. The GPU 102 includes a pre-processing module 106, a tiling unit 108, and a rendering unit 110. The tiling unit 108 includes processing logic 112 and data storage 114, and the rendering unit 110 includes a hidden surface removal (HSR) module 116 and a texturing / shading module 118.
[0036] In operation, the graphics processing system 100 receives graphics data describing a sequence of primitives (e.g., from an application). The pre-processing module 106 performs functions such as geometry processing including clipping and culling to eliminate primitives that do not fall into the visible view. The pre-processing module 106 may also project the primitives into screen space. The pre-processing module 106 outputs the primitives to the tiling unit 108.
[0037] refer to Figure 4a and Figure 4b The flowchart shown in , describes an example of how the graphics processing system 100 can process a primitive. Instead of performing tiling calculations for each tile in the bounding box of the primitive, a tiling test can be performed for a subset of tiles. The results of the tiling test for the subset of tiles can then be used to determine whether the primitive is located in other tiles that are within the area defined by two or more tiles in the subset of tiles. It is noted that the "other tiles" are not in the subset of tiles for which the tiling test is performed. In this way, the tiling process can be implemented without performing tiling calculations for all tiles in the bounding box of the primitive. Reducing the number of tiling calculations can help improve the efficiency of the graphics processing system used to render primitives (in terms of speed and power consumption).
[0038] In step S402, the tiling unit 108 receives primitives from the pre-processing module 106. Figure 4a and Figure 4bThe flowchart shown in describes the operation of the tiling unit 108 in detail, but in general terms the tiling unit 108 determines which of the primitives are present within each tile of the tiles of the rendering space of the graphics processing system 100. The processing logic 112 of the tiling unit 108 performs the operations of the tiling unit 108 described herein, and the data storage 114 stores data of intermediate results of the tiling process, such as the results of the tiling calculations and partially populated display lists. The processing logic 112 can be implemented in dedicated hardware that is specifically designed to perform the operations of the tiling unit 108. Alternatively, the processing logic 112 can be implemented by executing software on a processor, where the software is written so that when it is executed it causes the processor to perform the operations of the tiling unit 108.
[0039] The tiling unit 108 considers a first primitive. In step S404, a bounding box is determined for the primitive. In the examples described in detail herein, the bounding boxes are axis-aligned bounding boxes, i.e., they are aligned with the axes of the grid of tiles of the rendering space; however, in other examples, the bounding boxes may not be axis-aligned, i.e., they may be angled relative to the grid of tiles. If the primitive extends beyond the edge of the rendering space, the bounding box is clipped so that it does not extend beyond the edge of the rendering space. For example, the bounding box may be clipped so that it has an edge that is on the edge of the rendering space. The bounding box may be determined at the resolution of the tile so that the edges of the bounding box are on the tile boundaries (because in these examples, the bounding box is axis-aligned). If this is the case, the edges of the bounding box are extended outward to the next tile boundary, even if a closer tile boundary can be found by bringing the bounding box edges inward. In this way, the bounding box is conservatively determined so that it includes all tiles in which the primitive is located. Alternatively, the bounding box may be determined at a resolution finer than the tile resolution, e.g. Figure 2 The bounding box 208 shown in FIG. 2 is not at the tile resolution. In these examples, a tile is determined to be within the bounding box if the tile at least partially overlaps the bounding box.
[0040] In step S406, the tiling unit 108 determines whether the bounding box extends over more than one tile in both the x-direction and the y-direction. If this is not the case (i.e., if the bounding box extends over only one tile in either or both of the x-direction and the y-direction), then unless it is an exceptional case (e.g., one of the exceptional cases described below), the primitive will be in all tiles in the bounding box. For example, Figure 5a An example of a primitive 504 located in only a single tile 502 is shown. Figure 5a, but primitive 504 does not overlap with those other tiles. In this case, tile 502 is the only tile in the bounding box, so the bounding box does not extend over more than one tile in the x-direction or the y-direction. It is obvious that primitive 504 is in tile 502 and is not in other tiles of the rendering space. Therefore, in this case, in order to determine which tile(s) primitive 504 is in, the tiling unit 108 does not need to perform any tiling calculations involving floating-point operations comparing the edge lines of primitive 504 with test points in the tile. Therefore, the tiling process for primitive 504 can be performed very efficiently.
[0041] Similarly, Figure 5b An example of primitive 508 is shown, which is located in tile 506 1 ,506 2 ,506 3 and 506 4 There are no rows in the rendering space that are not shown in Figure 5b , but primitive 508 does not overlap with those other tiles. The bounding box for primitive 508 extends over four tiles in the x-direction, but does not extend over more than one tile in the y-direction. In this case, tile 506 1 ,506 2 ,506 3 and 506 4 is the only tile in the bounding box, and it is apparent that primitive 508 is in tile 506 1 ,506 2 ,506 3 and 506 4 , but not in other tiles of the rendering space. Therefore, in this case, in order to determine which tile(s) the primitive 508 is in, the tiling unit 108 does not need to perform any tiling calculations involving floating point operations comparing the edge lines of the primitive 508 with the test points in the tile. Therefore, the tiling process for the primitive 508 can be performed very efficiently.
[0042] If the bounding box for the primitive does not extend over more than one tile in both the x-direction and the y-direction, the method passes from step S406 to step S408 where it is determined whether the bounding box is an exceptional case. Figure 5a and Figure 5b The examples shown in are not exceptions. Exceptions occur when:
[0043] (i) the bounding box for the primitive has been clipped to the edge of the rendering space, and the clipped edge of the bounding box extends over more than one tile; or
[0044] (ii) The bounding box for the primitive has been clipped in both directions.
[0045] For example, Figure 5c Three primitives are shown within a rendering space, which are represented as 510, 514 and 518, and the rendering space includes a 3x7 arrangement and arranged in Figure 5c , labeled 0 to 20 in . Primitive 510 has a bounding box 512 that has been clipped to the edge of the rendering space, and bounding box 512 extends over portions of tiles 0, 1, 2, 3, 4, and 5. Thus, bounding box 512 does not extend over more than one tile in the y direction (vertical direction), but the clipped edge of bounding box 512 (the top edge of bounding box 512) extends over more than one tile in the x direction (horizontal direction), so bounding box 512 is an exception. It can be seen that primitive 510 is not in all tiles in bounding box 512. In this exceptional case, tiling calculations are performed on the tiles in bounding box 512 to determine which tiles of bounding box 512 primitive 510 is in. Thus, in exceptional cases such as this, the method passes from step S408 to step S412, which is described in more detail below.
[0046] As another example, primitive 514 has a bounding box 516 that has been clipped to the edge of the rendering space, and bounding box 516 extends over portions of tiles 8 and 15. Thus, bounding box 516 does not extend over more than one tile in the x-direction, and specifically the clipped edge of bounding box 516 (the bottom edge of bounding box 516) does not extend over more than one tile (the clipped edge is only in tile 15). In addition, bounding box 516 is not clipped in both directions. Thus, bounding box 516 is not an exception to the rule given above. It can be seen that primitive 514 is in all tiles in bounding box 516. Thus, there is no need to perform tiling calculations on the tiles in bounding box 516 in order to determine which tiles of bounding box 516 primitive 514 is in. Thus, in non-exceptional cases such as this, the method passes from step S408 to step S410, which is described in more detail below. It is noted that the bounding box that is not clipped (as described in the above reference) is not clipped. Figure 5a and Figure 5b ) in the described example is not an exceptional case, so in those cases the method passes from step S408 to step S410.
[0047] As another example, primitive 518 has a bounding box 520 that has been clipped in two directions. Therefore, bounding box 520 is an exception to the rules given above. It can be seen that primitive 518 is not in the tile of bounding box 520. Since this is an exception, a tiling calculation is performed on the tile in bounding box 520 (tile 20) to determine whether primitive 518 is in the tile of bounding box 520 (tile 20). Therefore, in this case, the method passes from step S408 to step S412.
[0048] It is noted that in some examples, the detection and handling of exceptional cases may be optional. In the case of not treating exceptional primitives (e.g., primitives 510, 514, or 518) separately, a loss of efficiency may be incurred because the exceptional primitives may then be added to the display list of more tiles than necessary. However, this does not result in rendering errors, so it may be acceptable. If exceptional cases are not handled separately, the processing involved in step S408 may be avoided, at the expense of including some exceptional primitives in the display list more than strictly necessary.
[0049] For each tile in the rendering space, the tiling unit 108 creates a display list, which may be stored, for example, in the storage 114, while the tiling unit 108 processes primitives. The display list for a tile includes primitive identifiers indicating which of the primitives are in the tile. In step S410, for non-exceptional cases, the tiling unit 108 adds the primitive identifier of the currently processed primitive to the display list(s) for the corresponding tile(s) in the bounding box. For example, in step S410, Figure 5a In the example shown in , the primitive identifier for primitive 504 will be added to the display list for tile 502, but not to the display lists for other tiles in the rendering space. Figure 5b In the example shown in FIG. 5 , the primitive identifier for primitive 508 will be added to the primitive identifier for tile 506. 1 ,506 2 ,506 3 and 506 4 , but is not added to the display lists for other tiles in the rendering space. Figure 5cIn the example shown in , the primitive identifier for primitive 514 will be added to the display lists for tiles 8 and 15, but not to the display lists for other tiles in the rendering space. In this way, primitives can be tiled very efficiently without performing tiling calculations on the edge equations as mentioned above. It is noted that in some tests, it was found that over 70% of the primitives in an average scene could be tiled in this way without performing tiling calculations on the edge equations. The method passes from step S410 to step S430, which is described below.
[0050] If it is determined in step S406 that the bounding box does not extend over more than one tile in both the x-direction and the y-direction, the method passes from step S406 to step S412. In step S412, the tiling unit 108 identifies the tile in which the vertices of the primitive are located, thereby determining that the primitive is in the identified tile. It is noted that more than one of the vertices of the primitive may be in the same tile. It is easy to identify the tile in which the vertex is located because the vertex position has already been used to determine the bounding box. Step S412 can be performed efficiently (in terms of time and power consumption) without performing other tiling tests for determining whether the primitive is in the identified tile. For example, Figure 6 A primitive 604 is shown, wherein the bounding box of the primitive 604 includes the 11 ,602 12 ,602 21 and 602 22 In step S412, the 2x2 group of tiles is identified. Figure 6 The hatched block (block 602 12 ,602 21 and 602 22 ), because they both include vertices of primitive 604. Therefore, tiling unit 108 can easily determine that a primitive is in a hatched tile, for example, without performing tiling calculations on edge equations for primitive 604.
[0051] In step S414 , the primitive identifier is added to the display list for the identified tile.
[0052] In step S416, the tiling unit 108 determines whether there are more tiles to be processed in the bounding box. In the event that it has not yet been determined whether the primitive is in a tile, the tile still needs to be processed. For example, if all tiles of the bounding box include vertices of the primitive, it has been determined that the primitive is in all tiles of the bounding box, and therefore there are no more tiles to be processed in the bounding box. In this case, the method passes from step S416 to step S430. However, if there are more tiles to be processed in the bounding box (i.e., more tiles for which it has not yet been determined whether the primitive is in a tile), the method passes to step S418. For example, referring to Figure 6 , it is still not determined whether primitive 604 is in tile 602 11 Therefore, the method passes to step S418.
[0053] In step S418, for each tile in at least a subset of tiles, the tiling unit 108 determines whether the primitive is in the tile if it has not already been determined. For example, where the bounding box includes more than four tiles, the subset of tiles may include corner tiles, which are at the corners of the bounding box. An example of this is shown in Figure 7a middle, Figure 7a A primitive 704 is shown having a bounding box comprising a 2x8 array of tiles 702. The corner tiles are shown with hatching. Figure 7a and is represented as 702 11 ,702 18 ,702 21 and 702 28 .
[0054] The vertices of primitive 704 are located in tile 702 11 In the example, another vertex of primitive 704 is located in block 702. 28 Therefore, the tiling unit 108 has determined that the primitive 704 is in the corner tile 702 11 and 702 28 In step S418, the tile unit 108 determines whether the primitive 704 is in the tile 702 by performing a tile calculation. 18 and 702 21In order to perform tiled calculations on primitives for a tile, for each edge of the primitive, the edge equation describing the edge of the primitive is used to determine whether an edge-specific test point in the tile is inside or outside the edge. In the event that the corresponding edge-specific test point is determined to be outside the edge for any of the edges, the primitive is determined to be outside the tile. The test points of the tile differ depending on the orientation of the edge being tested, because in the event that any part of the primitive is inside any part of the tile, the primitive should be determined to be in the tile. Therefore, the edge-specific test point in the tile for an edge is the point in the tile that is most likely to be inside the edge based on the orientation of the edge. For example, Figure 8 Test points used for different edge orientations are shown. Figure 8 (a) shows that for an upward sloping edge where points outside the edge are below and / or to the right of the edge, the edge-specific test point 804 is in the upper left corner of the tile 802 (e.g., the upper left sample position within the tile 802). It can be appreciated that if the test point 804 is outside the edge, so are all other points in the tile 802. Similarly, Figure 8 (b) shows that for an upward sloping edge where points outside the edge are above and / or to the left of the edge, the edge-specific test point 808 is in the lower right corner of the tile 806 (e.g., the lower right sample position within the tile 806). It can be appreciated that if the test point 808 is outside the edge, so are all other points in the tile 806. Similarly, Figure 8 (c) shows that for a downward sloping edge where points outside the edge are below and / or to the left of the edge, the edge-specific test point 812 is in the upper right corner of the tile 810 (e.g., the upper right sample position within the tile 810). It can be appreciated that if the test point 812 is outside the edge, so are all other points in the tile 810. Similarly, Figure 8 (d) shows that for a downward sloping edge where points outside the edge are above and / or to the right of the edge, the edge-specific test point 816 is in the lower left corner of the tile 814 (e.g., the lower left sample position within the tile 814). It can be appreciated that if the test point 816 is outside the edge, then so are all other points in the tile 814.
[0055] Therefore, refer again Figure 7a , for each tile in the subset (e.g., corner tile 702 11 ,702 18 ,702 21 and 702 28), a tiling test has been performed to determine whether the primitive 704 is in the corresponding tile. As described above, the tiling test may include determining that the primitive 704 has one or more vertices in the tile, or the tiling test may include performing a tiling calculation to determine whether the primitive is in the tile. If the primitive is in the tile, the primitive identifier is added to the appropriate display list for the tile.
[0056] In step S420, the tiling unit 108 determines whether there are more tiles to be processed in the bounding box. In the event that it has not yet been determined whether the primitive is in a tile, the tile is still to be processed. If there are no more tiles to be processed in the bounding box, the method passes from step S420 to step S430. However, if there are more tiles to be processed in the bounding box (i.e., more tiles for which it has not yet been determined whether the primitive is in a tile), the method passes to step S422. For example, referring to Figure 7a , it is still not determined whether the primitive 704 is in a non-corner tile that does not include a vertex of the primitive 704 , so the method passes to step S422 .
[0057] In step S422, the tiling unit 108 analyzes the subset of tiles for which the tiling test has been performed. This analysis is performed to determine whether the result of tiling at least one other tile in the bounding box can be inferred from the result of the tiling test for two or more tiles of the subset of tiles without performing the tiling test for the at least one other tile. In the examples described herein, the primitive is known to be convex so that the result of tiling at least one tile in the bounding box can be correctly inferred from the result of the tiling test for two or more tiles of the subset of tiles. In some examples, all primitives may be known to be convex (e.g., all primitives may be triangles), but in some other examples, the incoming primitives may not necessarily be strictly convex, and in these examples the method may involve determining whether the primitive is convex, wherein if the primitive is convex, the method may be performed as described herein to infer tiling results for the tile based on tiling results for two or more tiles of a subset of the tile; however, if the primitive is not convex, other methods may be used to perform tiling on the primitive.
[0058] In step S424, if the analysis indicates that this is possible, the result of the tile test for two or more tiles in the tiles of the subset is used to determine whether the primitive is in at least one other tile. At least one other tile is not in the subset of the tiles for which the tile test is performed. Specifically, at least one other tile is located in an area defined by two or more tiles in the tiles of the subset. If a particular tile is surrounded by tiles from a subset that all have the same tile test result, it can be inferred that the particular tile will also have the same result. The tile can be "surrounded" in one dimension, that is, the tile can be located between two tiles of the subset in a row or column of the tile. That is, two tiles of the subset in the same row or column of the tile can be used to deduce the tile result for the tile in the same row or column of the tile between the two tiles of the subset (i.e., in the area defined by the two tiles of the subset). In addition, the tile can be "surrounded" in two dimensions, that is, the tile can be located in an area defined by four tiles of the subset. That is, four tiles arranged in a rectangle within the rendering space can be used to deduce tiling results for tiles in the area bounded by those four tiles (ie, in the rectangle with those four tiles in the corners). Note that the term "rectangular" includes "square".
[0059] It is noted that, although a tile surrounded by a tile including a primitive allows the tile to be deduced that it also includes a primitive, it is not deduced that the tile does not include a primitive based solely on the determination that the tile is surrounded by a tile that does not include a primitive. However, when two or more tiles do not include a primitive, because both of them are outside the same edge of the primitive, it can be deduced that any tile they surround is also outside the edge, and therefore also outside the primitive. Therefore, the edge-by-edge result for a tile that does not include a subset of primitives can be determined. In this way, when a tile is surrounded by two or more tiles that do not include a subset of primitives, it can be checked that those surrounding tiles are outside the same edge of the primitive, and in that case it is deduced that the surrounded tiles are also outside the primitive. However, if the surrounding tiles are outside different edges of the primitive, it will not be deduced that the surrounded tiles are also outside the primitive. It is noted that when the tile is deduced to include a primitive, the problem is simplified by the fact that in order to include the primitive, the tile is determined to be inside all edges. Therefore, there is no need to use per-edge results for inferring tile-inclusion primitives based on determining a subset of surrounding tile-inclusion primitives.
[0060] If the subset of tiles includes the corner tiles of the bounding box (such as Figure 7a ), then if the result of the tiling test for a subset of tiles indicates that the primitive is in all corner tiles of the bounding box (e.g. Figure 7a ), those results are used to determine primitives (e.g., Figure 7a704) is in all tiles of the bounding box. In this way, Figure 7a In the example shown in , the results of the tiling test for twelve of the tiles can be extrapolated without having to perform a tiling test specifically for each of those tiles.
[0061] Similarly, Figure 7b The example illustrated in FIG. 7 shows a rendering space comprising 32 tiles arranged in a 4x8 grid. A large primitive 708 is in all tiles 706 of the rendering space. The bounding box for the primitive 708 will be clipped to the edge of the rendering space. In this example, the tiling unit determines whether the primitive 708 is in a corner tile 706. 11 ,706 18 ,706 41 and 706 48 (which is shown with hatching in Figure 7b In this example, these four tiles constitute a subset of tiles. 11 The tile test involves determining whether the vertices of primitive 708 are in tile 706. 11 However, for block 706 18 ,706 41 and 706 48 The tiling test involves performing tiling calculations based on the edge equations of the primitive 708 as described above to determine whether the primitive 708 is in the corresponding tile 706. By analyzing the results of the tiling test for the four corner tiles, the tiling unit 108 can determine in this example that since the primitive is in the four corner tiles, the primitive is also in all other tiles in the rendering space without performing tiling calculations for the corresponding other tiles of the rendering space. As described above, if the primitive is determined to be in a tile, the primitive identifier is added to the display list for the corresponding tile.
[0062] The method continues to step S426, where the tiling unit 108 determines whether there are more tiles to be processed in the bounding box. In the event that it has not yet been determined whether the primitive is in a tile, the tile is still to be processed. If there are no more tiles to be processed in the bounding box (e.g. Figure 7a and Figure 7b), the method passes from step S426 to step S430. However, if there are more tiles to be processed in the bounding box (i.e., more tiles for which it has not yet been determined whether the primitive is in the tile), the method passes to step S428. In step S428, for each remaining tile (i.e., for each tile for which it has not yet been determined whether the primitive is in the tile), a tiling calculation is performed to determine whether the primitive is in the tile, and if so, the primitive identifier is added to the display list for the tile. As described above, the tiling calculation for a particular tile includes comparing the line equation for the edge of the primitive with the edge-specific test points of the particular tile. Therefore, after step S428, it has been determined for all tiles in the rendering space whether the primitive is in the tile, and accordingly the primitive identifier has been added to the display list for the corresponding tile. The method then passes to step S430.
[0063] In step S430, the tiling unit 108 determines whether there are more primitives to tile in the current rendering. Each rendering will likely include many primitives (e.g., thousands or millions of primitives). The rendering may, for example, be performed to generate an image from a 3-dimensional model that is to be displayed on a screen or used as a texture in other renderings. If there are more primitives to tile, the method passes back to step S404 and repeats for the next primitive. Once all primitives in the current rendering have been tiled, the method passes from step S430 to step S432, where a display list for the tile is output from the tiling unit 108 and stored in the memory 104. 1 As described above, in the examples described herein, while display lists are being created, they may be stored in storage 114 internal to tiling unit 108. In some examples, once all primitives for rendering have been tiled, the display lists are complete and they are transferred to off-chip memory 104. 1 In other examples, the tiling unit 108 may not include internal storage (such as storage 114) for use in storing display lists, and instead the primitive identifiers may be written directly to the memory 104 when performing tiling. 1 In some other examples, internal storage 114 may be implemented in tiling unit 108, but internal storage 114 may not be large enough to store all display lists for all tiles at the same time. Therefore, internal storage 114 may be used to collect the display lists that can then be written out to memory 104 in blocks (or "batches") when performing tiling. 1 This can avoid the primitive being written to memory 104 1 Inefficient memory access pattern when displaying different lists in .
[0064] The rendering unit 110 may then render the primitives in each tile in the tile according to the display list. To render the primitives for the tile, in step S434, the rendering unit 110 retrieves the primitives from the memory 104. 1 The rendering unit 110 may then retrieve the primitives indicated by the display list that are in the tile currently being rendered. These primitives may be retrieved from the memory 104 1 The rendering unit 110 then renders the primitives in the tile. Figure 1 In the example shown in FIG. 4 , the rendering unit 110 implements deferred rendering, whereby hidden surface removal is performed before texturing and / or shading. Therefore, the HSR module 116 performs hidden surface removal to thereby remove fragments of primitives hidden in the scene. The remaining fragments are passed to the texturing / shading module 118, which performs texturing and / or shading on the fragments to determine a rendered result, for example, to determine pixel color values of a rendered image. In step S436, the rendered result is output and may be passed to the memory 104. 2 , for example, for storage in a frame buffer. The rendering unit 110 processes the primitives in each tile in the tile, and when the entire image has been rendered and stored in the memory 104 2 When the image is processed, the image can be output from the graphics processing system 100 and displayed on a display, for example. It is noted that in other examples, the rendering unit can be a non-deferred rendering unit, whereby texturing and / or shading can be performed on the primitives before hidden surface elimination.
[0065] In the examples described above, it can be seen that by performing tiling tests to determine whether a primitive is in a subset of tiles, the results of those tiling tests can be used to determine whether the primitive is in other tiles within the area bounded by some of the tiles in the subset. Figure 7a and Figure 7b The example shown in shows a subset of tiles that are corner tiles of a bounding box. In other examples, the subset of tiles may be different tiles within the bounding box. For example, there may be regular spacing between tiles of the subset of tiles. For example, the subset of tiles may include a corresponding tile from each of a plurality of N×M blocks of tiles of the rendering space, where N and M are integers. Fig. 9 An example in which N=M=2 is shown. That is, Fig. 9 In , the tiling test is performed on a 2x2 tile grid such that one tile from each 2x2 block of tiles is in a subset of the tiles for which the tiling test is performed.
[0066] Fig. 9A primitive 904 is shown, where a 9x14 group of tiles is within the bounding box of the primitive 904 and is shown in Fig. 9 The row numbers (1 to 9) and column numbers (1 to 14) are shown in Fig. 9 The positions of the vertices of primitive 904 are used to determine that primitive 904 is in the fourteenth tile of the first row (tile T 1,14 ), the fourth tile in the second row (tile T 2,4 ), and the first tile in the ninth row (tile T 9,1 ) (in step S412). These three blocks are shown with downward sloping hatching. Fig. 9 There is no need to perform tiled calculations involving comparing edge equations with test points for these three tiles.
[0067] exist Fig. 9 , the tiles of the subset of tiles are shown with upward sloping hatching (except for the first tile of the ninth row (tile T 9,1 ), which is in the subset but has a downward sloping hatch because the vertex is in that tile), including tile 902 as an example 11 (Block T 1,1 ). The subset of tiles includes the first tile, the third tile, the fifth tile, the seventh tile, the ninth tile, the eleventh tile, and the thirteenth tile from the first row, the third row, the fifth row, the seventh row, and the ninth row of tiles in the bounding box. It can be appreciated that due to the position of the vertices of primitive 904, tiling unit 108 has determined that the primitive is in the first tile of the ninth row (tile T 9,1 ). For the other tiles of the subset, tiling calculations are performed (in step S418) to determine whether the primitive 904 is in the tile. These tiling calculations are performed as described above by comparing the edge equations of the primitive 904 to the test points in the tile. The results of the tiling tests performed on the subset of tiles are shown in FIG. 1 by indicating, for each tile of the subset, whether the primitive 904 is "inside" or "outside" the tile. Fig. 9 middle.
[0068] The results of the tiling test for the subset of tiles (including the per-edge results, which are used as described above for use in inferring whether a tile does not include a primitive) may then be analyzed (in step S422) to determine if there is a 3x3 block of tiles that has tiles from the subset of tiles in the corners, where those tiles of the subset have the same tiling test result. If this is the case, the remaining five tiles in the 3x3 block may be assigned the same result as the associated tiles of the subset (in step S424) without performing a specific tiling calculation for those five tiles. For example, Fig. 9The 3x3 block of tiles in the upper left corner of the bounding box shown in FIG. 1 (ie, the first three tiles in the first three rows of the bounding box) includes tiles of a subset in the four corners (tiles T 1,1 、T 1,3 、T 3,1 and T 3,3 ), for which the tiled test results indicate that primitive 904 is outside those tiles, and specifically because the tiles are all outside the same edge of primitive 904 (e.g., in Fig. 9 904 is outside those tiles. Therefore, the primitive 904 in the other five tiles (tile T) in the 3x3 block can be inferred from the tiling results for the subset of tiles. 1,2 、T 2,1 、T 2,2 、T 2,3 and T 3,2 ), which is within the region bounded by the four tiles of the subset, without performing any other tiling tests for those five tiles. Similarly, Fig. 9 The 3x3 block of tiles in the fifth to seventh rows and third to fifth columns of the bounding box shown in FIG. 1 includes tiles for which the tiling test results indicate that the primitives 904 are in the four corners of the interior of those tiles (tiles T 5,3 、T 5,5 、T 7,3 and T 7,5 ). Therefore, it can be inferred from the tiling result for the subset of tiles that the primitive 904 is located in the other five tiles (tile T) in the 3x3 block. 5,4 、T 6,3 、T 6,4 、T 6,5 and T 7,4 ), it is in the area bounded by four tiles of the subset without performing any other tiling tests for those five tiles.
[0069] Similarly, the results of the tiling test for the subset of tiles may be analyzed (in step S422) to determine if there are two tiles of the subset in a line (e.g., in the same row or column) that have the same tiling test result. If this is the case, then the other tile(s) between those two tiles of the subset may be assigned the same result as the associated tile of the subset (in step S424) without performing a specific tiling calculation for that other tile(s). For example, for the first tile in the third and fifth rows of the bounding box (tile T 3,1 and T 5,1 ) indicates that primitive 904 is outside those tiles, and tile T 3,1 and T 5,1Outside the same edge of primitive 904. Therefore, the first tile (tile T) in the fourth row of primitive 904 can be inferred from the tiling result for the subset of tiles. 4,1 )(which is located between two tiles of the subset (tile T 3,1 and T 5,1 ) outside the area defined by ), without performing other tile tests for that tile. Similarly, for the seventh tile and the ninth tile in the third row of the bounding box (tile T 3,7 and T 3,9 ) indicates that primitive 904 is inside those tiles. Therefore, it can be inferred from the tiling results for the subset of tiles that primitive 904 is in the eighth tile in the third row (tile T 3,8 )(which is located between two tiles of the subset (tile T 3,7 and T 3,9 ) in the area defined by the tile without performing other tiling tests for that tile.
[0070] In some examples, steps S422 and S424 may be repeated so that further analysis of the tiling results may be performed, for example, based on the tiles in which the primitive's vertices are located. This may allow for inference of tiling results for other tiles without performing specific tiling calculations for those other tiles based on comparisons involving edge equations. For example, after a first analysis of the tiling test for a subset of tiles, it may have been inferred that primitive 904 is located in Fig. 9 The eleventh tile (tile T) in the second row of the bounding box shown in 2,11 ). Due to the position of one of the vertices of primitive 904, we also know that primitive 904 is in the fourth tile in the second row of the bounding box (tile T 2,4 ). Therefore, in a further analysis stage, it can be deduced that the primitive 904 is located in the fifth tile to the tenth tile (tile T) in the second row of the bounding box. 2,5 to T 2,10 ) without performing tile calculations for those tiles. Similarly, in a further analysis phase, it can be inferred that primitive 904 is in the third tile and the fourth tile in the fourth column of the bounding box (tile T 3,4 and T 4,4 ) without performing tiling calculations for those tiles.
[0071] exist Fig. 9The tiles for which the tiling results are derived from the tiling results of the tiles of the subset are shown with dotted shading. The lightest dotted shading indicates that the primitive 904 is outside the tile, whereas the two types of darker dotted shading indicate that the primitive 904 is inside the tile. The lighter of the two darker dotted shadings indicates that the primitive 904 is determined to be inside the tile after a first analysis, and the darker of the two darker dotted shadings indicates that the primitive 904 is determined to be inside the tile after further analysis.
[0072] As described above, it is noted that when analyzing the results of the tile test, if the tile test indicates that the primitive is outside the group of tiles of the subset, the reason why the primitive is outside the tile should be considered, that is, which edge of the primitive is outside the tile. For the results of multiple tiles of the subset to be used to infer that the primitive is outside another tile, all multiple tiles of the subset should be outside the same edge of the primitive, otherwise the primitive may be erroneously inferred to be outside the other tile.
[0073] In step S428, Fig. 9 For the remaining tiles in (i.e., those tiles without shadows or hatching), the tiling calculations are performed using the edge equations and the test points within the tiles so that the tiling of primitive 904 is complete. Fig. 9 In the example shown in , the bounding box includes 126 tiles. For 68 of the tiles, the tiling calculation based on the edge equation is performed; for 3 of the tiles, the tiling test involves identifying which tiles the vertices of primitive 904 are in; and for the other 55 tiles, the determination of whether primitive 904 is in a tile is inferred from the results of the tiling tests for other tiles in the bounding box. In the previous system described in the background section above, for each tile in the bounding box, i.e., for each tile in the bounding box, a tiling test is performed. Fig. 9 In the example shown in FIG. 126 , tiled calculations are performed for 126 tiles. Thus, in this example, the method described herein avoids performing tiled calculations for 58 of the tiles (46% of the tiles). Since tiled calculations involve floating point operations and take a lot of processing resources and time to implement, the reduction in the number of tiles for which tiled calculations are performed in this example will significantly improve the efficiency of the tiled process (in terms of speed and power consumption).
[0074] The number of tiles included in a subset may be varied. Specifically, tiling of primitives may be implemented in a hierarchical manner such that in a first (coarse) stage, a tiling test is performed for a subset of tiles, and the result of the tiling test is used to determine whether the primitive is in at least one other tile at a relatively coarse resolution, wherein the subset of tiles includes a plurality N of tiles from the rendering space. 1 ×M 1Then in a second (fine) stage, a tiling test is performed on a subset of the tiles, and the results of the tiling test are used to determine whether the primitive is in at least one other tile at a relatively fine resolution, where the subset of tiles includes a plurality N of tiles from the rendering space. 2 ×M 2 The corresponding tile for each block in the block, where N 1 >N 2 and / or M 1 >M 2 For example, in the first stage, N 1 and M 1 can be equal to 4 so that the subset of tiles includes corresponding tiles from each of the multiple 4x4 blocks of tiles in the rendering space, and then in the second stage, N 2 and M 2 may be equal to 2 so that the subset of tiles includes corresponding tiles from each of the multiple 2x2 blocks of tiles from the rendering space. In this way, if possible, then in a first stage, the tiling results for large areas of the bounding box may be inferred without performing many tiling calculations if all tiles in those areas have the same tiling results, and then in a second stage, the tiling results for the remaining smaller areas of the bounding box may be inferred if all tiles in those areas have the same tiling results. In another example, in a first stage, only the corner tiles of the bounding box may be included in the subset of tiles, and then in a second stage, multiple N tiles from the tile may be included in the subset of tiles. 2 ×M 2 The corresponding tiles of each block in the block may be included in the subset of tiles.In addition, in other examples, more than two stages may be implemented at different resolutions, ie, there may be more than two stages in the hierarchy.
[0075] refer to Fig.10 and Figures 11a to 11d In addition to or as an alternative to the tiling method described above, another way of tiling primitives is described, which may be implemented by the tiling unit 108 .
[0076] refer to Fig.10, in step S1002, the tiling unit 108 receives primitives from the pre-processing module 106. The tiling unit 108 considers a first primitive. In step S1004, a bounding box is determined for the primitive, for example in the same manner as described above, and if the primitive extends beyond the edge of the rendering space, the bounding box is clipped so that it does not extend beyond the edge of the rendering space. As described above, in the case where the tile at least partially overlaps with the bounding box, the tile is determined to be in the bounding box. The primitive is determined to not be in a tile that does not at least partially overlap with the bounding box.
[0077] In reference Fig.10 and Figures 11a to 11d In the described method, lines of tiles in a bounding box are processed at a time, where lines can be rows or columns. It can be beneficial to set lines as rows in the case where there are more columns of tiles than rows of tiles in the bounding box; however, it can be beneficial to set lines as columns in the case where there are more rows of tiles than columns of tiles in the bounding box. Therefore, the lines of tiles are selected to be in the dimension with the minimum number of lines of tiles in the bounding box. This is beneficial because the number of calculations performed for tiling primitives scales linearly with the number of lines in the bounding box, so selecting the dimension of the lines to be the minimum can reduce the amount of processing involved in tiling primitives. In step S1006, the tiling unit 108 determines whether there are more columns of tiles than rows of tiles in the bounding box. If there are more columns of tiles than rows of tiles in the bounding box, then in step S1008, the tiling unit 108 determines that the bounding box is to be processed in rows of tiles. Alternatively, if there are no more columns of tiles than rows of tiles in the bounding box, then in step S1010 , the tiling unit 108 determines that the bounding box is to be processed in columns of tiles.
[0078] As a reference Fig.10 , for each of one or more tile boundaries between lines of tiles in a bounding box, the tiling unit 108 determines the intersection of the tile boundary with the primitive edge, and uses the determined intersection points to determine in which tiles of the tiles in the bounding box the primitive is located.
[0079] Figures 11a to 11d An example of a primitive 1102 having a bounding box that includes a 6x4 group of tiles is shown. In this example, there are more rows of tiles than columns of tiles in the bounding box, so in step S1010, the tiling unit 108 determines that the bounding box is to be processed in columns of tiles. In the example described below, the bounding box is processed in columns of tiles, but it should be appreciated that in other examples, the bounding box may be processed in rows of tiles where appropriate.
[0080] Consider the first column of tiles in the bounding box, wherein a tile boundary 1104 between the first column and the second column of tiles is considered. In step S1012, for the first column of tiles in the bounding box, the tiling unit determines an initial intersection point of the tile boundary 1104 with an edge line defining an edge of the primitive 1102. Two of the edges of the primitive 1102 intersect the tile boundary 1104, however, for another edge of the primitive, an edge line 1106 defining the edge intersects the tile boundary 1104 at a location outside of the primitive 1102. The initial intersection point is shown at Fig.11a Center point 1108 1 ,1108 2 and 1108 3 Unless one of the edges of primitive 1102 is parallel to tile boundary 1104, there will be three initial intersection points 1108, two of which (at Fig.11a In the example shown in 1108 2 and 1108 3 ) will be on the edge of primitive 1102 and is useful for determining in which tiles primitive 1102 is located, while another intersection point (1108 1 ) will not be located on the edge of primitive 1102 and will not be useful for determining in which tiles of the tile primitive 1102 is located.
[0081] In step S1014, the tiling unit 108 determines which of the initial intersection points are to be used as the intersection points of the tile boundary 1104 and the edge of the primitive 1102 by identifying which of the initial intersection points are located on the edge of the primitive 1102. This can be done by considering proceeding along the tile boundary 1104 and determining for points on both sides of the initial intersection point (e.g., immediately on both sides of the initial intersection point) whether the point is inside or outside the primitive 1102. If it is determined that the two points on both sides of the initial intersection point are different, then the initial intersection point is an intersection point on the edge of the primitive (e.g., point 1108). 2 and 1108 3 ), however, if it is determined that the two points on both sides of the initial intersection are the same, then the initial intersection is not an intersection on the edge of the primitive (e.g., point 1108 1 ). Therefore, in Fig.11a In the example shown, the intersection 1108 2 and 1108 3are identified as being on the edge of the primitive 1102, and these identified intersections are used to determine in which of the tiles in the first column of the bounding box the primitive is. The identified intersections may be stored in storage 114 for use in subsequent iterations for processing subsequent columns, as will be apparent from the description provided below. The sample positions of the intersections may be stored or simply the tiles in which the intersections occur. The method then passes from step S1014 to both steps S1016 and S1018.
[0082] In step S1016, the tiling unit 108 determines the starting tile 1112 in the column of tiles. s This is done by finding a column that includes one of the determined intersections identified in step S1014 on its boundary (1108 2 or 1108 3 ) or the first tile that includes the vertices of primitive 1102 (e.g., starting from the top of the bounding box and working downwards). Tile 1112 s is determined to be the starting tile because it has an intersection point 1108 on its border 2 In step S1018, the tiling unit 108 determines the end tile 1112 in the column of tiles. e This is done by finding a column that includes one of the determined intersections identified in step S1014 on its boundary (1108 2 or 1108 3 ) or the last tile that includes the vertices of primitive 1102 (e.g., starting from the top of the bounding box and working downwards). Tile 1112 e is determined to be the end tile because it has an intersection 1108 on its border 3 And it also has vertex 1110 .
[0083] In step S1020, the tiling unit 108 determines that the primitive is in the column at the start tile 1112. s and end block 1112 e Between and including start block 1112 s and end block 1112 e The first column is between the start block and the end block (1112 s with 1112 e ) and includes the start block and the end block (1112 s and 1112 e ) are shown with hatching, and it can be seen that primitive 1102 is in the hatched tile, but not in the other tiles in the first column of the bounding box.
[0084] In step 1022, a primitive identifier for primitive 1102 is added to the tiles (eg, Fig.11a A display list of those tiles in the image (the hatched tiles shown in FIG. 1 ).
[0085] In step S1024, the tiling unit 108 determines whether there are more lines (columns in this example) of tiles to be processed in the bounding box. If so, the method passes to step S1026 so that the next line (e.g., column) can be processed. In step S1026, the tiling unit 108 determines whether the next line is the last line of the bounding box. If the next line is not the last line in the bounding box, the method passes from step S1026 to step S1012 so that the next line can be processed.
[0086] For example, in Fig.11b In the example shown in , the second column of the tile can be processed. In this way, the tile boundary 1114 between the second column and the third column of the tile is used to determine the initial intersection 1118 1 ,1118 2 and 1118 3 (In step S1012). Initial intersection 1118 1 At the point where edge line 1116 intersects tile boundary 1114, but the initial intersection point 1118 1 is not on the edge of primitive 1102. However, other initial intersection points 1118 2 and 1118 3 On the edge of primitive 1102, so in step S1014, the initial intersection point 1118 2 and 1118 3 (But not 1118 1 ) are identified as intersections located on the edges of primitives. These identified intersections can be stored for use in subsequent iterations.
[0087] To find the start and end tiles of the second column, the intersection 1108 2 and 1108 3 The position of (which was determined in the previous iteration and stored for use in this iteration), the intersection 1118 2 and 1118 3 The position of and the position of vertex 1020 are used. The starting tile is determined to be tile 1122 s (In step S1016), because the tile includes vertex 1120. The ending tile is determined to be tile 1122 e (In step S1018), because the block includes the intersection 1108 3 and 1118 3 .exist Fig.11b The hatched tiles in FIG. 1 are determined in step S1020 to be in primitive 1102 because they are in starting tile 1122. s and end block 1122 e Thus, the primitive identifier for primitive 1102 is added to the primitive identifier for primitive 1104. Fig.11b The display list of the tiles shown with hatching in FIG. 10 is shown (in step S1022 ).
[0088] like Fig.11c As shown in FIG. 1 , the method is repeated for the next column (the third column). Since the third column is not the last column in the bounding box, the method repeats back to step S1012 and the third column is processed. In this way, the tile boundary 1124 between the third and fourth columns of the tile is used to determine the initial intersection point 1128. 1 ,1128 2 and 1128 3 (In step S1012). Initial intersection 1128 1 At the point where edge line 1126 intersects tile boundary 1124, but the initial intersection point 1128 1 is not on the edge of primitive 1102. However, other initial intersection points 1128 2 and 1128 3 On the edge of primitive 1102, so in step S1014, the initial intersection point 1128 2 and 1128 3 (But not 1128 1 ) are identified as intersections located on the edges of primitives. These identified intersections can be stored for use in subsequent iterations.
[0089] To find the start and end tiles of the third column, the intersection 1118 2 and 1118 3 The position of (which was determined in the previous iteration and stored for use in this iteration) and the intersection 1128 2 and 1128 3 The starting tile is determined to be tile 1130 s (In step S1016), because the block includes the intersection 1118 2 The end block is determined to be block 1130 e (In step S1018), because the block includes the intersection 1128 3 .exist Fig.11c The hatched tiles in FIG. 1 are determined in step S1020 to be in primitive 1102 because they are in starting tile 1130. sand end block 1130 e Thus, the primitive identifier for primitive 1102 is added to the primitive identifier for primitive 1104. Fig.11c The display list of the tiles shown with hatching in FIG. 10 is shown (in step S1022 ).
[0090] like Fig.11d As shown in , the method repeats for the next column (the fourth column). Since the fourth column is the last column in the bounding box, the method passes from step S1026 to steps S1016 and S1018 without executing steps S1012 or S1014. This is because the tile boundary to the right of the last column in the bounding box is the edge of the bounding box, so the primitive will not intersect that tile boundary. To find the start and end tiles of the last column, the intersection 1128 2 and 1128 3 The position of (which was determined in the previous iteration and stored for use in this iteration) and the position of vertex 1032 are used. The starting tile is determined to be tile 1134 s (In step S1016), because the block includes the intersection 1128 2 The end block is determined to be block 1134 e (In step S1018), because the block includes the intersection 1128 3 and vertex 1032. Fig.11d The hatched tiles in FIG. 1 are determined in step S1020 to be in primitive 1102 because they are in starting tile 1134. s and end block 1134 e Thus, the primitive identifier for primitive 1102 is added to the primitive identifier for primitive 1104. Fig.11d The display list of the tiles shown with hatching in FIG. 10 is shown (in step S1022 ).
[0091] It is then determined in step S1024 that there are no more tile columns to be processed in the bounding box, so the method passes to step S1028. In step S1028, the display list for the tile is output from the tiling unit 108 and stored in the memory 104. 1 As described above, in the examples described herein, display lists may be stored in storage 114 internal to tiling unit 108 while they are being created. In some examples, once all primitives for rendering have been tiled, the display lists are complete and they are transferred to off-chip memory 104. 1As described above, in other examples, the tiling unit 108 may not use internal storage (such as storage 114) to store display lists, and instead, the primitive identifiers may be written directly to the memory 104 when performing tiling. 1 In addition, in some other examples, internal storage 114 may be implemented in tiling unit 108, but internal storage 114 may not be large enough to store all display lists for all tiles at the same time. Therefore, internal storage 114 may be used to collect the display lists that can then be written out to memory 104 in blocks (or "batches") when performing tiling. 1 This can avoid the primitive being written to memory 104 1 Inefficient memory access pattern when displaying different lists in .
[0092] The rendering unit 110 may then render the primitives in each of the tiles according to the display list. To render the primitives for the tiles, in step S1030, the rendering unit 110 retrieves the primitives from the memory 104 1 The display list for the tile is retrieved. The rendering unit 110 may then retrieve the primitives indicated by the display list that are in the tile currently being rendered. These primitives may be retrieved from the memory 104 1 The rendering unit 110 then renders the primitives in the tile. Figure 1 In the example shown in FIG. 1 , the rendering unit 110 implements deferred rendering, whereby hidden surface elimination is performed before texturing and / or shading, but in other examples, non-deferred rendering may be implemented. In step S1032, the rendered result is output and may be transferred to the memory 104. 2 The rendering unit 110 processes the primitives in each tile in the tile, and when the entire image has been rendered and stored in the memory 104 2 When in progress, an image may be output from graphics processing system 100 and displayed, for example, on a display.
[0093] In some cases, such as for primitives with large bounding boxes, refer to Fig.10 and Figures 11a to 11d The described method can be compared to the reference Figures 4a to 9 The described example provides a more efficient way to tile primitives. In contrast, in other cases, such as for primitives with small bounding boxes, reference Figures 4a to 9 The described method can be compared to the reference Fig.10 and Figures 11a to 11d The described examples provide a more efficient method for tiling primitives. Specifically, in reference Fig.10 and Figures 11a to 11dThe number of calculations performed in the described method is linearly proportional to the smallest dimension of the bounding box (e.g., linearly proportional to the minimum of the number of columns of tiles and the number of rows of tiles in the bounding box). This is because for each of the lines (e.g., columns of tiles) except the last line, the same number of calculations is performed regardless of how many tiles are in each line. As is apparent from the above description, for the last lines, fewer calculations may be performed. For example, for a bounding box comprising a 20x4 group of tiles (i.e., 20 rows and 4 columns), the same number of calculations will be performed as in Figures 11a to 11d The same calculations would be performed for a bounding box consisting of a 6x4 group of tiles (i.e. 6 rows and 4 columns) in the example shown in FIG. Figures 4a to 9 This is in contrast to the approach described above, where the number of computations performed for tiling is approximately proportional to the number of tiles in the bounding box, e.g., approximately proportional to the area of the bounding box, which scales approximately with the smallest dimension of the bounding box being square. Fig.10 and Figures 11a to 11d The described method is particularly useful for processing primitives with large bounding boxes, and particularly useful for processing primitives with bounding boxes that are significantly longer in one dimension than in another.
[0094] Therefore, in some embodiments, the tiling unit 108 may be capable of implementing the tiling method in two different ways: (i) Method 1, i.e., as described in reference Figure 4a and Figure 4b As described in the flowchart shown in FIG. , and (ii) method 2, i.e., as described in reference Fig.10 As described by the flowchart shown in . The first two steps of the method are the same, namely the tiling unit receives the primitive and determines the bounding box for the primitive. The tiling unit 108 can then analyze the bounding box to determine whether to perform method 1 or method 2. For example, if the maximum dimension of the bounding box is greater than the threshold number of tiles, the tiling unit 108 can proceed with method 2, but if the maximum dimension of the bounding box is not greater than the threshold number of tiles, the tiling unit 108 can proceed with method 1. Other ways of selecting between method 1 and method 2 can be used in different examples, for example based on the area of the bounding box. In this way, the way in which the primitives are tiled can be different for different primitives, and specifically can be selected to be well suited to the size and / or shape of the primitive to thereby provide efficient tiling of the primitive.
[0095] Figure 4a , Figure 4b and Fig.10The method steps of the flowchart shown in can be implemented as logic blocks within the processing logic 112 of the tiled unit 108. The logic blocks can be implemented in hardware or software or a combination thereof. For example, if the logic blocks are implemented in hardware, they can be formed as a specific arrangement of transistors and other hardware components suitable for performing the desired functions of the logic blocks as described herein. In contrast, if the logic blocks are implemented in software, they can include a set of computer instructions that can be stored in a memory and can be provided to the processing logic 112 for execution thereon to thereby provide the functions of the logic blocks.
[0096] The graphics processing system 100 described above may be implemented in a computer system. For example, Fig.12 The computer system includes a GPU 102, a CPU 1202, and a memory 1204, wherein the memory 1204 may include memory 104 corresponding to the above description. 1 and 104 2 The computer system also includes other devices 1206, such as a display 1208, a speaker 1210, a microphone 1212, and a camera 1214. The components of the computer system can communicate with each other via a communication bus 1216. Computer program code for an application can be stored in the memory 1204 and can be executed, for example, on the CPU 1202. If the application needs to render an image of a 3D scene, the graphics data describing the primitives can be sent to the GPU 102, and the GPU 102 can render the scene as described above.
[0097] Generally, any of the functions, methods, techniques, or components described above (e.g., tiled unit 108 and its components) can be implemented in modules using software, firmware, hardware (e.g., fixed logic circuitry), or any combination of these implementations. The terms "module," "function," "component," "block," "unit," and "logic" are used herein to generally represent software, firmware, hardware, or any combination thereof.
[0098] In the case of software implementation, the module, function, component, unit or logic represents the program code that performs the specified task when executed on a processor (e.g., one or more CPUs). In one example, the described method can be performed by a computer configured with software stored in a machine-readable form on a computer-readable medium. One such configuration of a computer-readable medium is a signal-bearing medium and is therefore configured to transmit instructions (e.g., as a carrier) such as via a network to a computing device. The computer-readable medium can also be configured as a non-transient computer-readable storage medium and is therefore not a signal-bearing medium. The example of a computer-readable storage medium includes a random access memory (RAM), a read-only memory (ROM), an optical disc, a flash memory, a hard disk storage and other memory devices that can be accessed by a machine and can store instructions or other data using magnetic technology, optical technology and other technologies.
[0099] The software may be in the form of a computer program comprising computer program code for configuring a computer to perform constituent parts of the described method, or in the form of a computer program comprising computer program code means adapted to perform all the steps of any of the methods described herein when the program is run on a computer, and wherein the computer program may be embodied on a computer readable medium. The program code may be stored in one or more computer readable media. Features of the techniques described herein are platform independent, meaning that the techniques may be implemented on a variety of computing platforms having a variety of processors.
[0100] Those skilled in the art will also appreciate that all or part of the functions, techniques or methods can be implemented by dedicated circuits, application specific integrated circuits, programmable logic arrays, field programmable gate arrays, etc. For example, a module, function, component, unit, or logic (e.g., a logic block implemented in the processing logic 112 of the tiled unit 108) may include hardware in the form of a circuit. Such a circuit may include transistors and / or other hardware elements available in the manufacturing process. By way of example, such transistors and / or other elements may be used to form a circuit or structure that implements and / or includes memories such as registers, flip-flops or latches, logic operators such as Boolean operations, mathematical operators such as adders, multipliers or shifters, and interconnections. Such elements may be provided as custom circuits or standard cell libraries, macros, or at other levels of abstraction. Such elements may be interconnected in a specific arrangement. A module, function, component, unit, or logic (e.g., a logic block in the processing logic 112) may include circuits that are fixed functions and circuits that may be programmed to perform one or more functions; such programming may be provided from firmware or software updates or control mechanisms. In an example, hardware logic has circuitry that implements a fixed-function operation, state machine, or process.
[0101] It is also intended to include software that "describes" or defines the configuration of the hardware that implements the modules, functions, components, units, or logic described above, such as HDL (hardware description language) software, such as is used to design integrated circuits or to configure programmable chips to implement desired functions. That is, a computer-readable storage medium can be provided, which has a computer-readable program code encoded thereon, the computer-readable program code being used to generate a graphics processing system configured to perform any of the methods described herein, or for generating a graphics processing system including any of the devices described herein. That is, a computer system can be configured to generate a representation of a digital circuit from definitions of circuit elements and data defining rules for combining those circuit elements, wherein a non-transitory computer-readable storage medium can have processor-executable instructions stored thereon, which when executed at such a computer system causes the computer system to generate, for example, a graphics processing system including a tiled unit as described in the examples herein.
[0102] The terms 'processor' and 'computer' are used herein to refer to any device or portion thereof having processing capabilities enabling it to execute instructions, or special purpose circuitry capable of performing all or part of a function or method, or any combination thereof.
[0103] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. It will be understood that the benefits and advantages described above may relate to one example or may relate to several examples.
[0104] As will be apparent to the skilled person, any range or value given herein may be extended or altered without losing the effect sought. The method steps described herein may be performed in any suitable order or simultaneously where appropriate. Aspects of any of the examples described above may be combined with aspects of any other examples in the other examples described to form other examples without losing the effect sought.
Claims
1. A method of processing primitives in a graphics processing system, the method comprising tiling the primitives to determine in which tiles of a plurality of tiles of a rendering space the primitives are located, and rendering the primitives in the tiles, wherein the tiling the primitives comprises: determining a bounding box for the primitive; for each tile boundary of at least one tile boundary between lines of tiles in the bounding box, determining an intersection of the tile boundary with an edge of the primitive; as well as using the determined intersection points to determine in which of the tiles within the bounding box the primitive is located, The step of determining the intersection of the tile boundary and the edge of the primitive comprises: For each edge of the primitive: Unless the edge is parallel to the tile boundary, determining an initial intersection of the tile boundary with an edge line, wherein the edge line is represented by a line equation, and wherein the edge line defines a corresponding edge of the primitive; as well as identifying which of those initial intersection points are located on said edge of said primitive, The identified initial intersection point is the determined intersection point used to determine in which of the tiles the primitive is located in the bounding box.
2. The method of claim 1 , wherein the step of using the determined intersection points to determine in which of the tiles in the bounding box the primitive is located comprises, for a line of a tile: determining a starting tile in the line of tiles by finding a first tile in the line that includes the determined intersection point on its border or includes a vertex of the primitive; determining an ending tile in the line of tiles by finding a last tile in the line that includes the determined intersection point on its border or includes a vertex of the primitive; and The primitive is determined to be in a tile in the line between and including the start tile and the end tile. The method according to claim 1 , wherein the lines of tiles are rows or columns of tiles. The method of claim 1 , wherein the primitive is determined to be not in a tile that does not at least partially overlap with the bounding box.
5. The method of claim 1 or 2, wherein the bounding box is clipped so that the bounding box does not extend beyond an edge of the rendering space. 6 . The method of claim 1 , further comprising including a primitive identifier of the primitive in a display list for a specific tile if it is determined that the primitive is in the specific tile. 7 . The method of claim 6 , further comprising, for each of the tiles of the rendering space, rendering the primitives in the tile according to the display list for the tile.
8. The method of claim 1 or 2, wherein the identifying which of those initial intersections are located on the edge of the primitive comprises, for each of the initial intersections: Proceed along the tile boundary and determine whether points on either side of the initial intersection are inside or outside the primitive.
9. A method according to claim 8, wherein if the determination of whether the points on both sides of the initial intersection are inside or outside the primitive is different for the two points on both sides of the initial intersection, then the initial intersection is an intersection on the edge of the primitive, whereas if the determination of whether the two points on both sides of the initial intersection are the same, then the initial intersection is not an intersection on the edge of the primitive.
10. A graphics processing system comprising a tiling unit for tiling primitives to determine in which tiles of a plurality of tiles of a rendering space the primitives are located, and a rendering unit for rendering the primitives in the tiles, wherein the tiling unit is configured to: determining a bounding box for the primitive; for each tile boundary of at least one tile boundary between lines of tiles in the bounding box, determining an intersection of the tile boundary with an edge of the primitive; as well as using the determined intersection points to determine in which of the tiles within the bounding box the primitive is located, The tiling unit is configured to determine the intersection of the tile boundary with the edge of the primitive by: for each edge of the primitive, unless the edge is parallel to the tile boundary, determining an initial intersection of the tile boundary with an edge line, wherein the edge line is represented by a line equation and wherein the edge line defines a corresponding edge of the primitive; as well as identifying which of those initial intersection points are located on said edge of said primitive, Wherein the identified initial intersection point is the determined intersection point to be used to determine in which of the tiles the primitive is located within the bounding box.
11. The graphics processing system of claim 10, wherein the tiling unit is configured to use at least some of the determined intersection points to determine in which of the tiles in the bounding box the primitive is located by: determining a starting tile in the line of tiles by finding a first tile in the line that includes the determined intersection point on its border or includes a vertex of the primitive; determining an ending tile in the line of tiles by finding a last tile in the line that includes the determined intersection point on its border or includes a vertex of the primitive; and The primitive is determined to be in a tile in the line between and including the start tile and the end tile.
12. A graphics processing system as claimed in claim 10 or 11, wherein the lines of tiles are rows or columns of tiles.
13. The graphics processing system of claim 10 or 11, wherein the tiling unit is configured to determine that the primitive is not in a tile that does not at least partially overlap with the bounding box. 14 . The graphics processing system of claim 10 , wherein the tiling unit is configured to clip the bounding box so that the bounding box does not extend beyond an edge of the rendering space. 15 . The graphics processing system of claim 10 , wherein the tiling unit is further configured to include a primitive identifier of the primitive in a display list for a specific tile if it is determined that the primitive is in the specific tile. 16 . The graphics processing system of claim 15 , further comprising a rendering unit configured to, for each of the tiles of the rendering space, render the primitives in the tile according to the display list for the tile.
17. The graphics processing system of claim 10 or 11, wherein the tiling unit is configured to identify which of the initial intersection points are located on the edge of the primitive by performing the following for each of the initial intersection points: Proceed along the tile boundary and determine whether points on either side of the initial intersection are inside or outside the primitive.
18. A graphics processing system according to claim 17, wherein if the determination of whether the points on both sides of the initial intersection are inside or outside the primitive is different for the two points on both sides of the initial intersection, then the initial intersection is an intersection on the edge of the primitive, but if the determination of whether the two points on both sides of the initial intersection are the same, then the initial intersection is not an intersection on the edge of the primitive.
19. A computer readable storage medium having computer readable code encoded thereon, the computer readable code being adapted to perform the method according to claim 1 or claim 2.
20. A computer readable storage medium having computer readable code encoded thereon, the computer readable code for generating a graphics processing system according to claim 1 or claim 2.
Citation Information
Patent Citations
Method for detecting border tiles or border pixels of a primitive for tile-based rendering
US20090147016A1
Apparatus and method for tile binning to reduce power consumption
US20120147007A1