Primitive Tiling in a Graphics Processing System

By introducing chunking units into the graphics processing system and performing chunking tests on subsets of tiles, the problem of excessive floating-point operations when primitive chunking in the prior art is solved, and the rendering efficiency is improved.

CN113936081BActive Publication Date: 2025-06-10IMAGINATION TECH LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111208300.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2015-04-22
Filing Date
2016-03-21
Publication Date
2025-06-10
Estimated Expiration
2036-03-21

AI Technical Summary

Technical Problem

In the prior art, when chunking primitives in a graphics processing system, a large number of floating-point operations are required to be performed, resulting in high computational costs and affecting the rendering efficiency of the system.

Method used

By introducing a chunking unit into the graphics processing system, chunking tests are performed on a subset of tiles, and the chunking test results of tiles in the subset are used to determine whether the primitives are in other tiles within the area where the subset tiles are bounded, thereby reducing the number of chunking calculations.

Benefits of technology

It effectively reduces the number of chunked calculations, improves the speed and power efficiency of the graphics processing system when rendering primitives, and reduces the system's calculation cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113936081B_ABST
    Figure CN113936081B_ABST
Patent Text Reader

Abstract

This application relates to primitive tiling in a graphics processing system. In a tile-based graphics processing system, a tiling unit determines in which tiles of a rendering space a primitive lies so that the primitives in the tiles can be rendered. Tiling tests can be performed on a subset of the tiles rather than performing tiling calculations for each tile in the bounding box for the primitive. Then the results of the tiling tests for the subset of tiles can be used to determine whether the primitive is in other tiles within a region bounded by two or more tiles in the subset. In this way, the tiling process can be achieved without performing tiling calculations for all the tiles in the bounding box for the primitive. Reducing the number of tiling calculations can help improve the efficiency of the graphics processing system in rendering primitives (in terms of speed and power consumption).
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application with the original application number 201610162795.5, the application date of March 21, 2016, and the invention title of "Primitive Tiling in a Graphics Processing System". Technical Field

[0002] Embodiments of the present application relate to primitive tiling in a graphics processing system. Background Art

[0003] Graphics processing systems are 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. The application can send the graphics data to be rendered to the graphics processing system, where the graphics data describes a plurality of primitives to be rendered. As is known in the art, a primitive is typically a convex polygon, such as a triangle or a convex quadrilateral, where a primitive generally has its position in the rendering space of the graphics processing system defined by the positions of its vertices and can have its appearance defined by other attributes such as color or texture attributes. An object in a scene can be represented by one or more primitives. As graphics processing systems advance, their ability to render complex images improves, and thus applications take advantage of this and provide more complex images for the graphics processing system to render. This means that the number of primitives in an image tends to increase, so the ability of the graphics processing system to efficiently process primitives becomes more important.

[0004] A known way to improve the efficiency of a graphics processing system is to render an image in a tile - based manner. In this way, the rendering space into which primitives are to be rendered is divided into a plurality of tiles, which can then be rendered independently of each other. To render a primitive, the rendering unit uses memory to store intermediate results (e.g., depth values and primitive identifiers, etc.) at different sample positions. If the rendering unit operates on one tile at a time, most (or all) of this memory can be located "on - chip", i.e., on the Graphics Processing Unit (GPU), which may not be feasible when the entire rendering space is to be rendered immediately. Thus, in a tile - based graphics system, the number of read and write operations between the GPU and off - chip memory (i.e., what can be referred to as "system memory") is typically reduced compared to a non - tile - based graphics system. Since read and write operations between the GPU and system memory are generally extremely slow and consume 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. A tile - based graphics system includes a tiling unit for tiling primitives. That is, the tiling unit determines for a primitive in which of the plurality of tiles of the rendering space the primitive lies. Then, when the rendering unit renders a tile, it can be given information indicating which primitives should be used to render that tile.

[0005] For example, Figure 1 FIG. shows some elements of a tile - based graphics processing system 100 that can be used to render an image of a 3D scene. The graphics processing system 100 includes a Graphics Processing Unit (GPU) 102 and two parts of memory 104 1 and 104 2 . Note that the two parts of memory 104 1 and 104 2 may or may not be part of the same physical memory, and both memories 104 1 and 104 2 can be located "off - chip", i.e., not on the same chip as the GPU 102. Communication between the memories (104 1 and 104 2 ) and the GPU 102 can occur on the communication bus in the system 100.

[0006] The GPU 102 includes a preprocessing module 106, a tiling unit 108, and a rendering unit 110. The tiling unit 108 includes processing logic 112 and a data store 114, and the rendering unit 110 includes a hidden surface removal (HSR) module 116 and a texturing / shading module 118. The graphics processing system 100 is arranged such that graphical data provided by an application that describes a sequence of primitives is received at the preprocessing module 106. The preprocessing module 106 performs functions such as geometric processing including culling and clipping to remove primitives that do not fall within the visible view. The preprocessing module 106 may also project the primitives into screen space. The preprocessing module 106 outputs the primitives to the tiling unit 108.

[0007] The tiling unit 108 receives the primitives from the preprocessing module 106 and determines which of these primitives are present within each tile in a tile of the rendering space of the graphics processing system 100. The primitives may be located in one or more tiles of the tiles in the rendering space. The tiling unit 108 assigns the primitives to the tiles of the rendering space by creating a display list for the tile, where the display list for the tile includes an indication of the primitives present in the tile (i.e., primitive IDs). The display list and the primitives are output from the tiling unit 108 and stored in the memory 104 1 therein. The rendering unit retrieves the display list for the tile and the primitives associated with the tile from the memory 104 1 and the HSR module 116 performs hidden surface removal to remove fragments of primitives that are 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 the pixel color values of the rendered image that can be passed to the memory 104 2 for storage in the 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 therein, the image can be output from the graphics processing system 100 and displayed, for example, on a display. In Figure 1 the example shown, the tile-based graphics processing system 100 is a deferred rendering system, meaning that the rendering unit 110 performs hidden surface removal on primitive fragments before performing texturing and / or shading on the primitive fragments 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 primitive fragments before performing hidden surface removal on the primitives.

[0008] Figure 2 shows a rendering space 202 that has been divided into an 8×12 array of tiles 204, where the tile in the m-th row and the n-th column is referred to as 204 mn。The primitive 206 is shown. The tiling unit 108 operates to determine in which tiles 204 the primitive 206 lies. If the primitive 206 overlaps at least partially with a tile 204, then the primitive 206 is "in" that 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 a box 208 based on these coordinates. The tiling unit 108 can thus determine that the primitive 206 does not lie in any tile 204 that is not within the bounding box 208. If a tile 204 overlaps at least partially with the bounding box 208, then the tile 204 is "in" the bounding box 208. In some examples, the bounding box can be determined at the tile resolution, whereby the size of the bounding box can be increased such that the edges of the bounding box fall on the tile boundaries. In Figure 2 this case, the tiles with dots (i.e., the tiles in the top and bottom rows of the rendering space 202, the tiles in the first column and the last two columns) are outside the bounding box 208, and thus, based on this, 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 the tiles within the bounding box 208. However, this means that the primitive is indicated as being in some tiles in which it is not actually present. This can lead to additional memory consumption due to storing unnecessary primitives and / or primitive IDs in the memory 104 1 and inefficiencies in the rendering unit 110, because the primitive is read from the memory 1041 and processed for tiles in which the primitive is not visible. Thus, it is generally preferred that the tiling unit 108 determines in which tiles within the bounding box 208 the primitive lies.

[0009] For each tile within the bounding box 208 (e.g., Figure 2 each white tile in this case), a tiling calculation can be performed to determine if the primitive 206 is in that tile. For example, the tiling calculation used to determine if the primitive 206 is in a tile 204 may include calculations for each edge of the primitive. For example, as shown in Figure 3 this case, the equations representing the edge lines (302 1 、302 2 and 302 3 ) that define the edges of the primitive 206 use the vertices (304 1 、304 2 and 304 3) is determined by its position. Then, for each edge line 302, a test can be performed to determine whether the tile 204 is inside or outside the corresponding edge line 302 by comparing the position of a test point in the tile with the equation of the edge line 302. For tests regarding different edges, the test points in the tile can be different, i.e., the test points can be edge-specific. For example, to test whether the tile is inside the edge line 302 1 inside, the test point is in the lower left middle of the tile; to test whether the tile is inside the edge line 302 2 inside, the test point is in the upper left middle of the tile; and to test whether the tile is inside the edge line 302 3 inside, the test point is in the lower right middle of the tile. If it is determined that the tile is inside all the edge lines 302, it is determined that the primitive is in the tile. However, if it is determined that the tile is outside any of the edge lines 302, it is determined that the primitive is not in the tile.

[0010] Chunking calculations can be performed for each tile in the tiles within the bounding box 208 to determine whether the primitive is in the corresponding tile. For each edge of the primitive and for each tile in the bounding box, comparing the position of the edge-specific test point in the tile with the equation of the appropriate edge line generally involves performing one or more floating-point operations. Performing floating-point operations is expensive (in terms of time and power consumption). This can cause problems, especially since the number of primitives in an image tends to increase, because the number of floating-point operations involved in the chunking process can become large enough to significantly and adversely affect the performance of the graphics processing system 100. Therefore, it is generally beneficial to reduce the time and power consumed during the chunking process. SUMMARY OF THE INVENTION

[0011] This summary of the invention is provided to introduce a selection of concepts that are further described below in the detailed description in a simplified form. 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 that can reduce the number of chunking calculations (e.g., including floating-point operations) performed for chunking primitives compared to the prior art examples described in the background art section above. This can help improve the efficiency of the graphics processing system in rendering primitives (e.g., in terms of speed and power).

[0013] A method for processing primitives in a graphics processing system is described herein. The method includes tiling a primitive to determine in which of a plurality of tiles in a rendering space the primitive lies. The tiling of the primitive includes: for each tile in a subset of tiles, performing a tiling test to determine whether the primitive lies in the tile; and using the results of the tiling tests for two or more tiles in the subset of tiles to determine whether the primitive lies in at least one other tile within a region bounded by the two or more tiles in the subset of tiles.

[0014] A graphics processing system is described herein. The system includes a tiling unit for tiling a primitive to determine in which of a plurality of tiles in a rendering space the primitive lies. The tiling unit is configured to: for each tile in a subset of tiles, perform a tiling test to determine whether the primitive lies in the tile; and use the results of the tiling tests for two or more tiles in the subset of tiles to determine whether the primitive lies in at least one other tile within a region bounded by the two or more tiles in the subset of tiles.

[0015] Computer-readable code may also be provided which, when run on a computer, is adapted to perform the steps of the method of any example described herein. Additionally, computer-readable code for generating a graphics processing system according to any example described herein may be provided. The computer-readable code may be encoded on a computer-readable storage medium.

[0016] As will be apparent to those skilled in the art, the above features may be combined as appropriate and may be combined with any aspect of the examples described herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Examples will now be described in detail with reference to the drawings, in which:

[0018] Figure 1 is a schematic diagram of a graphics processing system;

[0019] Figure 2 shows a primitive in a tile in a rendering space;

[0020] Figure 3 illustrates an edge line defining an edge of a primitive;

[0021] Figure 4a and Figure 4b shows a flowchart illustrating a first method of processing a primitive in a graphics processing system;

[0022] Figure 5a shows an example of a primitive in a single tile in a rendering space;

[0023] Figure 5bShows an example of primitives in a row of tiles in a rendering space;

[0024] Figure 5c Shows three primitives whose bounding boxes have been clipped to the edges of the rendering space;

[0025] Figure 6 Shows primitives in three tiles within a 2×2 tile square in the rendering space.

[0026] Figure 7a Shows primitives in a 2×8 tile rectangle in the rendering space;

[0027] Figure 7b Shows primitives that extend beyond the edges of the rendering space that includes a 4×8 tile array;

[0028] Figure 8 Shows edge-specific test points in a tile for corresponding edge orientations;

[0029] Figure 9 Shows an example of primitives in some of the tiles in a 9×14 tile rectangle in the rendering space;

[0030] Figure 10 Shows a flowchart that illustrates a second method of processing primitives in a graphics processing system;

[0031] Figures 11a to 11d Illustrates four different stages of the tiled processing of the second method; and

[0032] Figure 12 Is a schematic diagram of a computer system.

[0033] The accompanying drawings illustrate various examples. Those skilled in the art will recognize that the element boundaries illustrated in the drawings (e.g., boxes, groups of boxes, or other shapes) represent examples of boundaries. It is possible that in some examples, one 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 drawings to indicate similar features. Detailed Description

[0034] Embodiments will now be described by way of example only.

[0035] In Figure 1 The graphics processing system 100 shown can be used to implement the methods of the examples described herein. As described above, the graphics processing system 100 is a tile-based deferred rendering graphics processing system that includes a GPU 102 and two parts of memory 104 1 and 104 2 . As mentioned above, the two parts of memory 104 1and 104 2 may or may not be part of the same physical memory, and memory 104 1 and 104 2 both may be "off-chip", i.e., not on the same chip as GPU 102. The communication between the memory (104 1 and 104 2 ) and GPU 102 may occur on the communication bus in system 100. GPU 102 includes a preprocessing 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 (e.g., from an application) that describes a sequence of primitives. The preprocessing module 106 performs functions such as geometric processing including clipping and culling to remove primitives that do not fall within the visible view. The preprocessing module 106 may also project the primitives into screen space. The preprocessing module 106 outputs the primitives to the tiling unit 108.

[0037] Referring to the flowcharts shown in Figure 4a and Figure 4b , an example of how the graphics processing system 100 may process primitives is described. The tiling test may be performed for a subset of tiles, rather than performing the tiling calculation for each tile in the bounding box for the primitive. Then the results of the tiling test for the subset of tiles can be used to determine whether the primitive is in other tiles within a region bounded by two or more tiles in the subset of tiles. Note 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 achieved without performing the tiling calculation for all tiles in the bounding box for the primitive. Reducing the number of tiling calculations can help improve the efficiency of the graphics processing system in rendering primitives (in terms of speed and power consumption).

[0038] In step S402, the tiling unit 108 receives the primitives from the preprocessing module 106. The operation of the tiling unit 108 is referred to in Figure 4a and Figure 4bThe flowcharts shown are described in detail, but generally speaking, the tiling unit 108 determines which of these primitives exist within each tile in a tile in 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 store 114 stores data of intermediate results of the tiling process, such as the results of tiling calculations and partially filled display lists. The processing logic 112 may be implemented in dedicated hardware specifically designed to perform the operations of the tiling unit 108. Alternatively, the processing logic 112 may be implemented by executing software on a processor, where the software is written such 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 example 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 in the rendering space; however, in other examples, the bounding boxes may not be axis-aligned, i.e., they may be angled with respect 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 on the edge of the rendering space. The bounding box may be determined at the resolution of the tiles such that the edges of the bounding box are on the tile boundaries (since in these examples, the bounding boxes are axis-aligned). If this is the case, the edges of the bounding box are extended out to the next tile boundary even if a closer tile boundary could be found by pushing the bounding box edges inwards. In this way, the bounding box is conservatively determined so that it includes all the tiles in the tile in which the primitive is located. Alternatively, the bounding box may be determined at a resolution finer than the tile resolution, e.g., the bounding box 208 shown in Figure 2 is not at the tile resolution. In these examples, if a tile overlaps the bounding box at least partially, the tile is determined to be within the bounding box.

[0040] In step S406, the tiling unit 108 determines whether the bounding box extends more than one tile in both the x and y directions. If this is not the case (i.e., if the bounding box extends only one tile in either or both of the x and y directions), then, unless it is an exceptional case (e.g., one of the exceptional cases described below), the primitive will be in all the tiles in the tile within the bounding box. For example, Figure 5a an example of a primitive 504 is shown, which is located in only a single tile 502. There are tiles in the rendering space that are not in Figure 5aThe other tiles shown in, but the primitive 504 does not overlap with those other tiles. In this case, the tile 502 is the only tile in the bounding box, so the bounding box does not extend more than one tile in the x direction or the y direction. Obviously, the primitive 504 is in the tile 502 and not in other tiles in the rendering space. Therefore, in this case, in order to determine in which one or more tiles the primitive 504 is, the tiling unit 108 does not need to perform any tiling calculations involving floating-point operations used to compare the edge lines of the primitive 504 with test points in the tiles. Therefore, the tiling process for the primitive 504 can be performed extremely efficiently.

[0041] Similarly, Figure 5b an example of the primitive 508 located in a row of tiles 506 1 , 506 2 , 506 3 and 506 4 is shown. There are other tiles in the rendering space that are not shown in Figure 5b , but the primitive 508 does not overlap with those other tiles. The bounding box of the primitive 508 extends four tiles in the x direction, but does not extend more than one tile in the y direction. In this case, the tiles 506 1 , 506 2 , 506 3 and 506 4 are the only tiles in the bounding box, and obviously, the primitive 508 is in the tiles 506 1 , 506 2 , 506 3 and 506 4 and not in other tiles in the rendering space. Therefore, in this case, in order to determine in which one or more tiles the primitive 508 is, the tiling unit 108 does not need to perform any tiling calculations involving floating-point operations used to compare the edge lines of the primitive 508 with test points in the tiles. Therefore, the tiling process for the primitive 508 can be performed extremely efficiently.

[0042] If the bounding box for the primitive does not extend more than one tile in both the x and y directions, the method proceeds from step S406 to step S408, in which it is determined whether the bounding box is an exceptional case. The examples shown in Figure 5a and Figure 5b are not exceptional cases. Exceptional cases occur when:

[0043] (i) the bounding box for the primitive has been clipped according to the edges of the rendering space, and the clipped edges of the bounding box extend more than one tile; or

[0044] (ii) the bounding box for the primitive has been clipped in both directions.

[0045] For example, Figure 5c shows a rendering space including 21 tiles arranged in a 3×7 layout and labeled 0 to 20 in Figure 5c and three primitives represented as 510, 514, and 518 within the rendering space. Primitive 510 has a bounding box 512 that has been clipped according to the edges of the rendering space, and the bounding box 512 extends portions of tiles 0, 1, 2, 3, 4, and 5. Thus, the bounding box 512 does not extend more than one tile in the y direction (vertical direction), but the clipped edge of the bounding box 512 (the upper edge of the bounding box 512) extends more than one tile in the x direction (horizontal direction), so the bounding box 512 is an exception. It can be seen that the primitive 510 is not in all of the tiles within the bounding box 512. In such an exceptional case, a tiling calculation will be performed on the tiles within the bounding box 512 to determine in which of the tiles within the bounding box 512 the primitive 510 lies. Thus, in such exceptional cases, the method proceeds 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 according to the edges of the rendering space, and the bounding box 516 extends portions of tiles 8 and 15. Thus, the bounding box 516 does not extend more than one tile in the x direction, and specifically the clipped edge of the bounding box 516 (the lower edge of the bounding box 516) does not extend more than one tile (the clipped edge is only in tile 15). Additionally, the bounding box 516 is not clipped in both directions. Thus, the bounding box 516 is not an exception according to the rules given above. It can be seen that the primitive 514 is in all of the tiles within the bounding box 516. Thus, there is no need to perform a tiling calculation on the tiles within the bounding box 516 to determine in which of the tiles within the bounding box 516 the primitive 514 lies. Thus, in such non-exceptional cases, the method proceeds from step S408 to step S410, which is described in more detail below. Note that (as in the examples referred to above in Figure 5a and Figure 5b described) an unclipped bounding box is not an exception, so in those cases the method proceeds from step S408 to step S410.

[0047] As another example, primitive 518 has a bounding box 520 that has been clipped in both directions. Thus, the bounding box 520 is an exception according to the rules given above. It can be seen that the primitive 518 is not in the tiles of the bounding box 520. Since this is an exceptional case, a tiling calculation will be performed on the tiles within the bounding box 520 (tile 20) to determine if the primitive 518 is in the tiles of the bounding box 520 (tile 20). Thus, in this case, the method proceeds from step S408 to step S412.

[0048] Note that, in some examples, the detection and handling of exceptions may be optional. If the primitive of the exception (e.g., 510, 514, or 518) is not treated separately, it may incur an efficiency loss because the primitive of the exception may subsequently be added to the display lists of more tiles than necessary. However, this does not result in a rendering error, so it may be acceptable. If the exception is not handled separately, the processing involved in step S408 can be avoided at the cost of including some primitives of the exception in more display lists than strictly necessary.

[0049] For each tile in the rendering space, when the tiling unit 108 processes the primitives, the tiling unit 108 creates a display list, which can be stored, for example, in the memory 114. The display list for a tile includes primitive identifiers indicating which primitives are in that tile. In step S410, for non-exception cases, the tiling unit 108 adds the primitive identifier of the currently processed primitive to one or more display lists for one or more corresponding tiles in the bounding box. For example, in Figure 5a the example shown, 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. Similarly, in Figure 5b the example shown, the primitive identifier for primitive 508 will be added to the display lists for tile 506 1 , 506 2 , 506 3 and 506 4 but not to the display lists for other tiles in the rendering space. Similarly, in Figure 5c the example shown, 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, the primitives can be tiled very efficiently without performing the tiling calculation on the edge equations as mentioned above. Note that in some tests, it was found that more than 70% of the primitives in normal scenarios can be tiled in this way without performing the tiling calculation on the edge equations. The method proceeds from step S410 to step S430 described below.

[0050] If in step S406 it is determined that the bounding box does extend more than one tile in both the x and y directions, the method proceeds from step S406 to step S412. In step S412, the tiling unit 108 identifies the tiles in which the vertices of the primitive lie, thereby determining that the primitive is within the identified tiles. Note that more than one vertex of the primitive can be in the same tile. Identifying the tiles in which the vertices lie is straightforward because the vertex positions have been used to determine the bounding box. Step S412 can be performed efficiently (in terms of time and power consumption) without performing additional tiling tests to determine whether the primitive is in the identified tiles. For example, Figure 6 shows a primitive 604, where the bounding box of the primitive 604 includes tiles represented as 602 11 、602 12 、602 21 and 602 22 in a 2×2 tile group. Figure 6 The tiles shown hatched in (tiles 602 12 、602 21 and 602 22 ) are identified in step S412 because they each include a vertex of the primitive 604. Thus, the tiling unit 108 can easily determine that the primitive is in the hatched tiles without, for example, performing tiling calculations for the edge equations of the primitive 604.

[0051] In step S414, the primitive identifier is added to the display list for the identified tiles.

[0052] In step S416, the tiling unit 108 determines whether there are more tiles to be processed in the bounding box. If it has not yet been determined whether the primitive is in a tile, that tile is still to be processed. For example, if all the tiles in the bounding box include vertices of the primitive, it has been determined that the primitive is in all the tiles in the bounding box, so there are no more tiles to be processed in the bounding box. In this case, the method proceeds 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 that tile), the process proceeds to step S418. For example, referring to Figure 6 , it has not yet been determined whether the primitive 604 is in tile 602 11 , so the method proceeds to step S418.

[0053] In step S418, for each tile in at least a subset of the tiles, if it has not yet been determined, the tiling unit 108 determines whether the primitive is in that tile. For example, in the case where the bounding box includes more than four tiles, the subset of tiles can include corner tiles at the corners of the bounding box. An example of this case is shown in Figure 7a , Figure 7aShows primitive 704, which has a bounding box including a 2×8 array of tiles 702. The corner tiles are hatched in Figure 7a and are denoted as 702 11 , 702 18 , 702 21 and 702 28 .

[0054] One vertex of primitive 704 is in tile 702 11 , and another vertex of primitive 704 is in tile 702 28 , so the tiling unit 108 has determined that primitive 704 is in corner tiles 702 11 and 702 28 . In step S418, the tiling unit 108 determines whether primitive 704 is in tiles 702 18 and 702 21 by performing tiling calculations. To perform tiling calculations for primitives with respect to tiles, for each edge of the primitive, the edge equation describing the edge of the primitive is used to determine whether a particular edge-specific test point in the tile is inside or outside the edge. If it is determined that the particular edge-specific test point for any of the edges is outside the edge, the primitive is determined to be outside the tile. The test points for the tiles vary according to the orientation of the edge being tested, because if any part of the primitive is inside any part of the tile, the primitive should be determined to be inside that tile. Thus, the edge-specific test point for an edge in the tile is the point in the tile that is most likely to be inside the edge according to the orientation of the edge. For example, Figure 8 shows test points for different edge orientations. Figure 8 (a) in 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 tile 802 (e.g., the upper left sample position within tile 802). It can be appreciated that if test point 804 is outside the edge, then all other points in tile 802 are also. Similarly, Figure 8 (b) in 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 tile 806 (e.g., the lower right sample position within tile 806). It can be appreciated that if test point 808 is outside the edge, then all other points in tile 806 are also. Similarly, Figure 8(c) in 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 recognized that if the test point 812 is outside the edge, then all other points in the tile 810 are also. Similarly, Figure 8 (d) in 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 recognized that if the test point 816 is outside the edge, then all other points in the tile 814 are also.

[0055] Thus, referring again to Figure 7a , for each tile in the subset (e.g., corner tiles 702 11 、702 18 、702 21 and 702 28 ), a tiled test has been performed to determine if the primitive 704 is in the corresponding tile. As described above, the tiled test can include determining that the primitive 704 has one or more vertices in the tile, or the tiled test can include performing a tiled calculation to determine if the primitive is in the tile. If the primitive is in the tile, the primitive identifier is added to the appropriate display list for that tile.

[0056] In step S420, the tiling unit 108 determines if there are more tiles to be processed in the bounding box. If it has not yet been determined if the primitive is in the tile, then the tile is still to be processed. If there are no more tiles to be processed in the bounding box, the method proceeds 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 if the primitive is in that tile), the method proceeds to step S422. For example, referring to Figure 7a , it has not yet been determined if the primitive 704 is in a non-corner tile that does not include the vertices of the primitive 704, so the method proceeds to step S422.

[0057] In step S422, the tiling unit 108 analyzes a subset of tiles for which the tiling test has been performed. This analysis is performed to determine whether the result of tiling for at least one other tile in the bounding box can be inferred based on the results of the tiling tests for two or more tiles in the subset of tiles, without performing the tiling test for the at least one other tile. In the example described herein, the primitive is known to be convex, so the result of tiling for at least one other tile in the bounding box can be correctly inferred based on the results of the tiling tests for two or more tiles in the subset of tiles. In some examples, all primitives may be known to be convex (e.g., all primitives may be triangular), 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, where if the primitive is convex, the method may be performed as described herein to infer the tiling result for a tile based on the tiling results for two or more tiles in the subset of tiles; and if the primitive is not convex, other methods may be used to tile the primitive.

[0058] In step 424, if the analysis indicates that it is possible, the results of the tiling tests for two or more tiles in the subset are used to determine whether the primitive is in at least one other tile. The at least one other tile is not in the subset of tiles for which the tiling test is performed. Specifically, the at least one other tile is located within the region bounded by two or more tiles in the subset of tiles. If a particular tile is surrounded by tiles from the subset that all have the same tiling test result, it can be inferred that the particular tile will also have the same result. A tile can be "surrounded" in one dimension, i.e., the tile can be located between two tiles in the subset that are in a row or a column of tiles. That is, two tiles in the subset that are in the same row or the same column of tiles can be used to infer the tiling result for a tile in the same row or the same column of tiles between the two tiles in the subset (i.e., within the region bounded by the two tiles). Additionally, a tile can be "surrounded" in two dimensions, i.e., the tile can be located within the region bounded by four tiles in the subset. That is, four tiles arranged in a rectangle within the rendering space can be used to infer the tiling result for a tile within the region bounded by the four tiles (i.e., within the rectangle that has the four tiles in the corners). Note that the term "rectangle" includes "square".

[0059] Note that while a tile surrounded by tiles that include a primitive allows the inference that the tile also includes the primitive, a determination based solely on a tile being surrounded by tiles that do not include the primitive does not allow the inference that the tile does not include the primitive. However, when two or more tiles do not include the primitive because they are both outside the same edge of the primitive, then it can be inferred that any tile they surround is also outside that edge and thus outside the primitive. Accordingly, a result based on the edge can be determined for tiles in a subset that do not include the primitive. In this way, when a tile is surrounded by two or more tiles in a subset that do not include the primitive, those surrounding tiles can be examined to be outside the same edge of the primitive, and in that case it can be inferred that the surrounded tile is also outside the primitive. However, if the surrounding tiles are outside different edges of the primitive, it cannot be inferred that the surrounded tile is also outside the primitive. Note that when it is inferred that a tile includes the primitive, the problem is simplified by the fact that the tile is determined to be inside all edges. Accordingly, it is not necessary to use the result based on the edge to infer that a tile includes the primitive based on a determination that surrounding tiles in a subset include the primitive.

[0060] If a subset of tiles includes the corner tiles of a bounding box (as in Figure 7a ), then if the result of the tiling test for the subset of tiles indicates that the primitive is in all of the corner tiles of the bounding box (as in Figure 7a ), then those results are used to determine that the primitive (e.g., Figure 7a 's 704) is in all of the tiles of the bounding box. In this way, in the example shown in Figure 7a , the results of the tiling test for twelve of the tiles in the tile can be inferred without specifically performing the tiling test for each of those tiles.

[0061] Similarly, the example illustrated in Figure 7b shows a rendering space that includes 32 tiles arranged in a 4×8 grid. A large primitive 708 is in all of the tiles 706 in the rendering space. The bounding box for the primitive 708 will be clipped according to the edges of the rendering space. In this example, the tiling unit determines whether the primitive 708 is in the corner tiles 706 Figure 7b hatched with shading in 11 , 706 18 , 706 41 and 706 48 . These four tiles make up the subset of tiles in this example. The tiling test for the tile 706 11 involves determining whether the vertices of the primitive 708 are in the tile 706 11 , while the tiling tests for the tiles 706 18 , 706 41 and 706 48The tile test involves performing a tile calculation based on the edge equation 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 tile 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 the other tiles in the rendering space without having to perform a tile calculation for the corresponding other tiles in 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 proceeds to step S426, where the tiling unit 108 determines whether there are more tiles to be processed in the bounding box. If it has not been determined whether the primitive is in the tile, the tile is still to be processed. If there are no more tiles to be processed in the bounding box (as in the example shown in Figure 7a and Figure 7b ), the method proceeds 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 been determined whether the primitive is in the tile), the method proceeds to step S428. In step S428, for each remaining tile (i.e., for each tile for which it has not been determined whether the primitive is in the tile), a tile 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 tile calculation for a particular tile includes comparing the line equation for the edge of the primitive with the edge-specific test points in the particular tile. Thus, after step S428, it has been determined for all the tiles in the rendering space whether the primitive is in the tile, and the primitive identifiers have been added to the display lists for the corresponding tiles accordingly. The method then proceeds to step S430.

[0063] In step S430, the tiling unit 108 determines whether there are more primitives to be tiled in the current rendering. Each rendering will likely include many primitives (e.g., thousands or millions of primitives). The rendering may be performed, for example, to generate an image to be displayed on the screen or to be used as a texture in other renderings based on a 3D model. If there are more primitives to be tiled, the method returns to step S404 and repeats for the next primitive. Once all the primitives in the current rendering have been tiled, the method will proceed from step S430 to step S432, where the display lists for the tiles are output from the tiling unit 108 and stored in the memory 104 1In. As described above, in the examples described herein, while the display lists are being created, they can be stored in the storage 114 located inside the tiling unit 108. In some examples, once all the primitives for rendering have been tiled, the display lists are complete and they are passed to the off-chip memory 104 1 for storage therein. In other examples, the tiling unit 108 may not include internal storage (such as storage 114) for use in storing the display lists, and the primitive identifiers can instead be written directly to the memory 104 when tiling is performed 1 into the display lists in the memory. In some additional examples, the internal storage 114 can be implemented in the tiling unit 108, but the internal storage 114 may not be large enough to immediately store all the display lists for all the tiles. Thus, the internal storage 114 can be used to collect the tiling results when tiling is performed, and the tiling results can then be written out to the memory 104 in chunks (or "batches") 1 . This can avoid inefficient memory access patterns when primitives are written to different display lists in the memory 104 1 .

[0064] The rendering unit 110 can then render the primitives in each tile according to the display lists. To render the primitives for a tile, in step S434, the rendering unit 110 retrieves the appropriate display list for the tile from the memory 104 1 . The rendering unit 110 can then retrieve the primitives indicated by the display list as being located in the tile currently being rendered. These primitives can be retrieved from the memory 104 1 . The rendering unit 110 then renders the primitives in the tile. In the Figure 1 example shown, the rendering unit 110 implements deferred rendering, whereby hidden surface removal is performed before texturing and / or shading. Thus, the HSR module 116 performs hidden surface removal to thereby remove the fragments of the primitives hidden in the scene. The remaining fragments are passed to the texturing / shading module 118, which performs texturing and / or shading on these fragments to determine the result of the rendering, e.g., to determine the pixel color values of the rendered image. In step S436, the result of the rendering is output and can be passed to the memory 104 2 , e.g., for storage in a frame buffer. The rendering unit 110 processes the primitives in each tile, and when the entire image has been rendered and stored in the memory 104 2 , the image can be output from the graphics processing system 100 and, e.g., displayed on a display. Note that in other examples, the rendering unit may be a non-deferred rendering unit, whereby texturing and / or shading can be performed on the primitives before hidden surface removal.

[0065] In the example described above, it can be seen that by performing a tiling test 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 a region bounded by some of the tiles in the subset. In Figure 7a and Figure 7b The examples shown illustrate a subset of tiles that are corner tiles in a bounding box. In other examples, the subset of tiles can be different tiles within the bounding box. For example, there may be a regular spacing between subsets of tiles. For example, the subset of tiles can include corresponding tiles from each of a plurality of N×M tile frames in a rendering space, where N and M are integers. Figure 9 An example where N = M = 2 is shown. That is, in Figure 9 a tiling test is performed on a 2×2 tile grid such that one tile from each 2×2 tile frame is in the subset of tiles for which the tiling test is performed.

[0066] Figure 9 A primitive 904 is shown, where a group of 9×14 tiles is in the bounding box of the primitive 904 and is shown in Figure 9 Row numbers (1 to 9) and column numbers (1 to 14) are shown in Figure 9 The positions of the vertices of the primitive 904 are used to determine that the primitive 904 is in the fourteenth tile in the first row (tile T 1,14 ), in the fourth tile in the second row (tile T 2,4 ), and in the first tile in the ninth row (tile T 9,1 ) (in step S412). These three tiles are shown in Figure 9 with downward slanting hatching. There is no need to perform a tiling calculation involving comparing an edge equation with a test point for these three tiles.

[0067] In Figure 9 the tiles in the subset of tiles are shown with upward slanting hatching (except for the first tile in the ninth row (tile T 9,1 ), which is in the subset but has downward slanting hatching because the vertex is located in that tile), for example including tile 902 11 (tile T 1,1 ). The tiles in the subset include the first, third, fifth, seventh, and ninth rows of the first, third, fifth, seventh, ninth, eleventh, and thirteenth tiles from the tiles in the bounding box. It can be appreciated that due to the positions of the vertices of the primitive 904, the tiling unit 108 has determined that the primitive is in the first tile in the ninth row (tile T 9,1)Among them. For other tiles in the subset, block calculations (in step S418) are performed to determine whether the primitive 904 is in these tiles. These block calculations are performed by comparing the edge equations of the primitive 904 with the test points in the tile as described above. By indicating whether the primitive 904 is "in" or "out" of the tile for each tile in the subset, in Figure 9 shows the results of the block tests performed on the subset of tiles.

[0068] The results of the block tests for the subset of tiles (including the results based on the edges, which are used as described above for inferring whether a tile does not include the primitive) can then (in step S422) be analyzed to determine whether there is a 3×3 tile box in the corner that has tiles from the subset of tiles, where those tiles in the subset have the same block test results. If this is the case, the remaining five tiles in the 3×3 box can (in step S424) be assigned the same results as the relevant tiles in the subset, without performing specific block calculations on those five tiles. For example, in Figure 9 the 3×3 tile box shown in the upper left corner of the bounding box (i.e., the first three tiles in the first three rows of the bounding box) includes tiles from the subset in four corners (tile T 1,1 、T 1,3 、T 3,1 and T 3,3 ), the block test results of which indicate that the primitive 904 is outside those tiles and particularly indicate that the primitive 904 is outside those tiles because all those tiles are outside the same edge of the primitive 904 (e.g., as shown in Figure 9 outside the left edge of the primitive 904). Therefore, based on the block results of the subset of tiles, it can be inferred that the primitive 904 is outside the other five tiles (tiles T 1,2 、T 2,1 、T 2,2 、T 2,3 and T 3,2 ) in the region bounded by the four tiles in the subset in the 3×3 box, without performing any further block tests on those five tiles. Similarly, Figure 9 the 3×3 tile box shown in the fifth to seventh rows and third to fifth columns of the bounding box includes tiles from the subset in four corners (tiles T 5,3 、T 5,5 、T 7,3 and T 7,5 ), the block test results for which indicate that the primitive 904 is inside those tiles. Therefore, it can be inferred based on the block results for the subset of tiles that the primitive 904 is outside the other five tiles (tiles T 5,4 、T6,3 , T 6,4 , T 6,5 and T 7,4 ), without performing any further tiling tests on those five tiles.

[0069] Similarly, the results of the tiling tests for a subset of tiles can be (in step S422) analyzed to determine whether there are two tiles in the subset that have the same tiling test result and are in-line (e.g., in the same row or the same column). If this is the case, then one or more other tiles between those two tiles in the subset can be (in step S424) assigned the same result as the relevant tiles in the subset, without performing a specific tiling calculation on those one or more other tiles. For example, the tiling tests for the first tiles in the third and fifth rows of the bounding box (tiles T 3,1 and T 5,1 ) indicate that the primitive 904 is outside those tiles and that tiles T 3,1 and T 5,1 are outside the same edge of the primitive 904. Thus, based on the tiling results for the subset of tiles, it can be inferred that the primitive 904 is outside the first tile in the fourth row (tile T 4,1 )(which is in the region bounded by the two tiles in the subset (tiles T 3,1 and T 5,1 )) without performing a further tiling test on that tile. Similarly, the tiling tests for the seventh and ninth tiles in the third row of the bounding box (tiles T 3,7 and T 3,9 ) indicate that the primitive 904 is inside those tiles. Thus, based on the tiling results for the subset of tiles, it can be inferred that the primitive 904 is inside the eighth tile in the third row (tile T 3,8 )(which is in the region bounded by the two tiles in the subset (tiles T 3,7 and T 3,9 )) without performing a further tiling test on that tile.

[0070] In some examples, steps S422 and S424 can be repeated so that further analysis of the tiling results can be achieved, for example, based on the tiles in which the vertices of the primitive are located. This can allow the tiling results of additional tiles to be inferred without performing specific tiling calculations for those additional tiles based on comparisons involving edge equalities. For example, after the first analysis of the tiling tests for a subset of tiles, it has been inferred that the primitive 904 is inside the eleventh tile in the second row of the bounding box shown in Figure 9 . Due to the location of one of the vertices of 904, it is also known that the primitive 904 is in the fourth tile in the second row of the bounding box (tile T 2,11 ). Since the position of one of the vertices of 904, it is also known that the primitive 904 is in the fourth tile in the second row of the bounding box (tile T 2,4) Inside. Therefore, in the further analysis stage, it can be inferred that the primitive 904 is in the fifth to tenth tiles (tiles T 2,5 to T 2,10 ) in the second row of the bounding box, without performing the tiling calculation for those tiles. Similarly, in the further analysis stage, it can be inferred that the primitive 904 is in the third and fourth tiles (tiles T 3,4 and T 4,4 ) in the fourth column of the bounding box, without performing the tiling calculation for those tiles.

[0071] The tiles whose tiling results are inferred based on the tiling results of the tiles in the subset are shown with dot cross-hatching in Figure 9 . The lightest dot cross-hatching indicates that the primitive 904 is outside the tile, while the two darker types of dot cross-hatching indicate that the primitive 904 is inside the tile. The lighter of the two darker dot cross-hatches indicates that the primitive 904 is determined to be inside the tile after the first analysis, and the darker of the two darker dot cross-hatches indicates that the primitive 904 is determined to be inside the tile after further analysis.

[0072] As described above, note that when analyzing the results of the tiling test, if the tiling test indicates that the primitive is outside a set of tiles in the subset, the reason why the primitive is outside the tile should be considered, i.e., on which edge of the primitive the tile is outside. For the results of multiple tiles in the subset that will be used to infer that the primitive is outside another tile, all the multiple tiles in the subset should be outside the same edge of the primitive, otherwise it may be wrongly inferred that the primitive is outside another tile.

[0073] In step S428, for the remaining tiles in Figure 9 (i.e., those tiles without shading or cross-hatching), perform the tiling calculation using the edge equation and the test points within the tile to complete the tiling of the primitive 904. In the example shown in Figure 9 , the bounding box includes 126 tiles. Perform the tiling calculation based on the edge equation for 68 of these tiles; the tiling test for 3 of these tiles involves identifying in which tiles the vertices of the primitive 904 are; and for the other 55 tiles, infer the determination as to whether the primitive 904 is in the tile based on the results of the tiling tests for the other tiles in the bounding box. In the previous systems described in the background art section above, for each tile in the bounding box (i.e., for those in Figure 9For the 126 tiles in the example shown, block calculations are performed. Thus, in this example, the method described herein avoids performing block calculations on 58 of the tiles (46% of the tiles). Since block calculations involve floating-point operations and take a significant amount of processing resources and time to implement, reducing the number of tiles for which block calculations are performed will significantly improve the efficiency of the block process (in terms of speed and power consumption) in this example.

[0074] The number of tiles included in the subset can be varied. Specifically, the tiling of the primitives can be implemented in a hierarchical manner such that in a first (coarse) stage, block tests are performed on a subset of the tiles and the results of these block tests are used to determine, at a relatively coarse resolution, whether the primitive is in at least one other tile, where the subset of tiles includes the respective tiles of each of a plurality of N 1 ×M 1 tile boxes in the render space. Then, in a second (fine) stage, block tests are performed on a subset of the tiles and the results of these block tests are used to determine, at a relatively fine resolution, whether the primitive is in at least one other tile, where the subset of tiles includes the respective tiles of each of a plurality of N 2 ×M 2 tile boxes in the render space, 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 such that the subset of tiles includes the respective tiles of each of a plurality of 4×4 tile boxes in the render space, and then in the second stage, N 2 and M 2 can be equal to 2 such that the subset of tiles includes the respective tiles of each of a plurality of 2×2 tile boxes in the render space. In this way, if possible, the block results can be inferred for those regions where all the tiles in a large area within the bounding box have the same block result in the first stage without performing many block calculations, and then the block results can be inferred for those regions where all the tiles in the remaining smaller areas within the bounding box have the same block result in the second stage. In another example, in the first stage, only the corner tiles in the bounding box can be included in the subset of tiles, and then in the second stage, the respective tiles of each of a plurality of N 2 ×M 2 tile boxes can be included in the subset of tiles. Additionally, in other examples, more than two stages can be implemented at different resolutions, i.e., there can be more than two stages in the hierarchy.

[0075] ReferenceFigure 10 and Figures 11a to 11d , describes another way of partitioning primitive blocks, which can be implemented by the partitioning unit 108 in addition to or as an alternative to the partitioning method described above.

[0076] Referring to the flowchart shown in Figure 10 , in step S1002, the partitioning unit 108 receives a primitive from the preprocessing module 106. The partitioning unit 108 considers the first primitive. In step S1004, a bounding box is determined for the primitive in the same way 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 exceed the edge of the rendering space. As described above, if a tile at least partially overlaps the bounding box, the tile is determined to be within the bounding box. The primitive is determined to not be in tiles that do not at least partially overlap the bounding box.

[0077] In the method described with reference to Figure 10 and Figures 11a to 11d , the tile lines within the bounding box are processed simultaneously, where these lines can be rows or columns. If there are more tile columns than tile rows in the bounding box, it may be beneficial to set the lines as rows; while if there are more tile rows than tile columns in the bounding box, it may be beneficial to set the lines as columns. Thus, the tile lines are selected to be in the dimension with the lowest number of tile lines within the bounding box. This is beneficial because the number of calculations performed to partition the primitive scales linearly with the number of lines within the bounding box, so selecting the dimension of the lines to be the minimum can reduce the amount of processing involved in partitioning the primitive. In step S1006, the partitioning unit 108 determines whether there are more tile columns than tile rows in the bounding box. If there are more tile columns than tile rows in the bounding box, then in step S1008 the partitioning unit 108 determines that the bounding box will be processed according to tile rows. Alternatively, if there are not more tile columns than tile rows in the bounding box, then in step S1010 the partitioning unit 108 determines that the bounding box will be processed according to tile columns.

[0078] As a broad overview of the method described in detail with reference to the flowchart shown in Figure 10 , for each tile boundary among one or more tile boundaries between the tile lines within the bounding box, the partitioning unit 108 determines the intersection points of the tile boundary with the edges of the primitive, and uses the determined intersection points to determine in which tiles of the bounding box the primitive lies.

[0079] Figures 11a to 11dAn example of a primitive 1102 is shown, which has a bounding box including a 6×4 tile group. In this example, there are more tile rows than tile columns in the bounding box, so in step S1010, the tiling unit 108 determines that the bounding box will be processed by tile columns. In the examples described below, the bounding box is processed by tile columns, but it should be recognized that in other examples, the bounding box can be processed by tile rows if appropriate.

[0080] The first tile column in the bounding box is considered, where the tile boundary 1104 between the first and second tile columns is considered. In step S1012, for the first tile column in the bounding box, the tiling unit determines the initial intersection points of the tile boundary 1104 with the edge lines defining the edges of the primitive 1102. Two of the edges in the primitive 1102 cross the tile boundary 1104, while for the other edges of the primitive, the edge lines 1106 defining the edges cross the tile boundary 1104 at positions outside the primitive 1102. The initial intersection points are at Figure 11a point 1108 in 1 、1108 2 and 1108 3 as shown. Unless one of the edges of the primitive 1102 is parallel to the tile boundary 1104, there will be three initial intersection points 1108, two of which ( Figure 11a 1108 in the example shown in 2 and 1108 3 ) will be on the edges of the primitive 1102 and will be useful for determining in which tiles the primitive 1102 is, while the other intersection point (1108 1 ) will not be on the edges of the primitive 1102 and will not be useful for determining in which tiles the primitive 1102 will be.

[0081] In step S1014, the tiling unit 108 determines which of the initial intersection points will be used as the intersection points of the tile boundary 1104 with the edges of the primitive 1102 by identifying which initial intersection points are on the edges of the primitive 1102. This can be done by considering moving along the tile boundary 1104 and determining for the points on either side (e.g., either immediate side) of the initial intersection point whether these points are inside or outside the primitive 1102. If it is determined to be different for the two points on either side of the initial intersection point, the initial intersection point is an intersection point on the edge of the primitive (e.g., points 1108 2 and 1108 3 ), while if it is determined to be the same for the two points on either side of the initial intersection point, the initial intersection point is not an intersection point on the edge of the primitive (e.g., point 1108 1 ). Thus, in the example shown in Figure 11a , the intersection point 11082 and 1108 3 are identified as being on the edge of primitive 1102, and the intersections of these identifications are used to determine in which tiles of the first column of the bounding box the primitive lies. The intersections of the identifications can be stored in storage 114 for use in subsequent iterations for processing subsequent columns, as will be apparent from the description provided below. What may be stored is the sample location of the intersection or just the tile in which the intersection occurs. The method then branches from step S1014 to both step 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 looking for the first tile in the column that includes on its boundary one of the determined intersections identified in step S1014 (1108 2 or 1108 3 ) or the first tile that includes a vertex of primitive 1102 (e.g., starting from the top of the bounding box and working down). Tile 1112 s is determined to be the starting tile because it has intersection 1108 2 on its boundary. In step S1018, the tiling unit 108 determines the ending tile 1112 in the column of tiles e . This is done by looking for the last tile in the column that includes on its boundary one of the determined intersections identified in step S1014 (1108 2 or 1108 3 ) or the last tile that includes a vertex of primitive 1102 (e.g., starting from the top of the bounding box and working down). Tile 1112 e is determined to be the ending tile because it has intersection 1108 3 on its boundary and it also has vertex 1110.

[0083] In step S1020, the tiling unit 108 determines that the primitive lies in the column between the starting tile 1112 s and the ending tile 1112 e and includes the starting tile 1112 s and the ending tile 1112 e . The tiles in the first column that lie between the starting tile and the ending tile (1112 s and 1112 e ) and include the starting tile and the ending tile are shown hatched, and it can be seen that primitive 1102 is in the hatched tiles and not in the other tiles of the first column of the bounding box.

[0084] In step 1022, the primitive identifier for primitive 1102 is added to the display list for those tiles (e.g., Figure 11a the hatched tiles shown in

[0085] In step S1024, the tiling unit 108 determines whether there are more tile rows (columns in this example) to process in the bounding box. If so, the method proceeds to step S1026 to process the next row (e.g., column). In step S1026, the tiling unit 108 determines whether the next row is the last row in the bounding box. If the next row is not the last row in the bounding box, the method proceeds from step S1026 to step S1012 to process the next row.

[0086] For example, in the example shown in Figure 11b the second tile column can be processed. In this way, the tile boundary 1114 between the second tile column and the third tile column is used to determine the initial intersections 1118 1 , 1118 2 and 1118 3 (in step S1012). The initial intersection 1118 1 is located at the point where the edge line 1116 crosses the tile boundary 1114, but this initial intersection 1118 1 is not on the edge of the primitive 1102. However, the other initial intersections 1118 2 and 1118 3 are on the edge of the primitive 1102, so in step S1014 the initial intersections 1118 2 and 1118 3 (but not 1118 1 ) are identified as intersections located on the edge of the primitive. These identified intersections can be stored for use in subsequent iterations.

[0087] To find the start and end tiles of the second column, the positions of the intersections 1108 2 and 1108 3 (which were determined in a previous iteration and stored for use in this iteration), the positions of the intersections 1118 2 and 1118 3 and the position of the vertex 1020 are used. The start tile is determined to be tile 1122 s (in step S1016), because this tile includes the vertex 1120. The end tile is determined to be tile 1122 e (in step S1018), because this tile includes the intersections 1108 3 and 11183 . The tiles hatched in Figure 11b are determined to be within primitive 1102 in step S1020 because they are between starting tile 1122 s and ending tile 1122 e (and including starting tile 1122 s and ending tile 1122 e ). Accordingly, the primitive identifier for primitive 1102 is added to the display list for the tiles hatched in Figure 11b (in step S1022).

[0088] The method is repeated for the next column (the third column) as shown in Figure 11c . Since the third column is not the last column in the bounding box, the method loops back to step S1012 and the third column is processed. In this way, the tile boundaries 1124 between the third and fourth tile columns are used to determine the initial intersections 1128 1 , 1128 2 and 1128 3 (in step S1012). The initial intersection 1128 1 is located at the point where the edge line 1126 crosses the tile boundary 1124, but this initial intersection 1128 1 is not on the edge of primitive 1102. However, the other initial intersections 1128 2 and 1128 3 are on the edge of primitive 1102, so in step S1014 the initial intersections 1128 2 and 1128 3 (but not 1128 1 ) are identified as intersections on the edge of the primitive. These identified intersections can be stored for use in subsequent iterations.

[0089] To find the starting and ending tiles for the third column, the positions of intersections 1118 2 and 1118 3 (which were determined in the previous iteration and stored for use in this iteration) and the positions of intersections 1128 2 and 1128 3 are used. The starting tile is determined to be tile 1130 s (in step S1016) because this tile includes intersection 1118 2 . The ending tile is determined to be tile 1130 e (in step S1018) because this tile includes intersection 1128 3 . In Figure 11cThe tiles shaded in the figure are determined to be in primitive 1102 in step S1020 because they are between the starting tile 1130 s and the ending tile 1130 e (and include the starting tile 1130 s and the ending tile 1130 e ). Accordingly, the primitive identifier for primitive 1102 is added to the display list for the Figure 11c tiles shaded in the figure (in step S1022).

[0090] The method is repeated for the next column (the fourth column) as shown in Figure 11d . Since the fourth column is the last column in the bounding box, the method transfers from step S1026 to steps S1016 and S1018 without performing step S1012 or step 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 cross this tile boundary. To find the starting and ending tiles of the last column, the positions of intersections 1128 2 and 1128 3 (which were 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 this tile includes intersection 1128 2 . The ending tile is determined to be tile 1134 e (in step S1018) because this tile includes intersection 1128 3 and vertex 1032. The Figure 11d tiles shaded in the figure are determined to be in primitive 1102 in step S1020 because they are between the starting tile 1134 s and the ending tile 1134 e (and include the starting tile 1134 s and the ending tile 1134 e ). Accordingly, the primitive identifier for primitive 1102 is added to the display list for the Figure 11d tiles shaded in the figure (in step S1022).

[0091] Then, in step S1024, it is determined that there are no more tile columns to process in the bounding box, so the method transfers to step S1028. In step S1028, the display lists for the tiles are output from the tiling unit 108 and stored in the memory 104 1In the example described herein, while the display lists are being created, they can be stored in the storage 114 located inside the tiling unit 108. In some examples, once all the primitives for rendering have been tiled, the display lists are complete and they are passed to the off-chip memory 104 1 for storage therein. As described above, in other examples, the tiling unit 108 may not use internal storage (such as storage 114) to store the display lists, and instead the primitive identifiers can be written directly to the memory 104 when tiling is performed 1 into the display lists in the memory. Additionally, in some other examples, the internal storage 114 can be implemented in the tiling unit 108, but the internal storage 114 may not be large enough to immediately store all the display lists for all the tiles. Thus, the internal storage 114 can be used to collect the tiling results when tiling is performed, and the tiling results can then be written out to the memory 104 in chunks (or "batches") 1 . This can avoid inefficient memory access patterns when primitives are written to different display lists in the memory 104 1 .

[0092] The rendering unit 110 can then render the primitives in each tile according to the display lists. To render the primitives for a tile, in step S1030, the rendering unit 110 retrieves the display list for the tile from the memory 104 1 . The rendering unit 110 can then retrieve the primitives indicated by the display list as being located in the tile currently being rendered. These primitives can be retrieved from the memory 104 1 . The rendering unit 110 then renders the primitives in the tile. In the example shown in Figure 1 , the rendering unit 110 implements deferred rendering, whereby the hidden surface removal is performed before texturing and / or shading, but in other examples non-deferred rendering can be implemented. In step S1032, the result of the rendering is output and can 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 and when the entire image has been rendered and stored in the memory 104 2 , the image can be output from the graphics processing system 100 and displayed on a display, for example.

[0093] In some cases, for example for primitives with large bounding boxes, the method described in Figure 10 and Figures 11a to 11d can provide a more efficient way of tiling primitives compared to the example described in Figures 4a to 9 . In contrast, in other cases, for example for primitives with small bounding boxes, the reference Figures 4a to 9The described method can provide a more efficient way of partitioning primitives compared to the references Figure 10 and Figures 11a to 11d described examples. Specifically, in the references Figure 10 and Figures 11a to 11d the number of calculations performed in the described method is linearly proportional to the minimum dimension of the bounding box (e.g., linearly proportional to the minimum of the number of tile columns and the number of tile rows in the bounding box). This is because for each line except the last line (e.g., the columns of tiles), the same number of calculations are performed regardless of how many tiles are in each line. For the last line, fewer calculations can be performed, as is obvious from the above description. For example, as would be performed for a bounding box including a 6×4 tile group (i.e., 6 rows and 4 columns) as shown in the example in Figures 11a to 11d , the same calculations would be performed for a bounding box including a 20×4 tile group (i.e., 20 rows and 4 columns). This is in contrast to the methods Figures 4a to 9 described, in which the number of calculations performed for partitioning 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 square of the minimum dimension of the bounding box. Thus, the references Figure 10 and Figures 11a to 11d described methods are particularly useful for processing primitives with large bounding boxes, especially for processing primitives with bounding boxes that are significantly longer in one dimension than in the other.

[0094] Thus, in some embodiments, the partitioning unit 108 may be able to implement the partitioning method in two different ways: (i) Method 1, as described in the flowcharts shown in the references Figure 4a and Figure 4b , and (ii) Method 2, as described in the flowchart shown in the reference Figure 10 . The first two steps of the method are the same, i.e., the partitioning unit receives the primitive and determines the bounding box for the primitive. The partitioning 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 exceeds a threshold number of tiles, the partitioning unit 108 can proceed with Method 2, while if the maximum dimension of the bounding box does not exceed the threshold number of tiles, the partitioning unit 108 can proceed with Method 1. Other ways of choosing between Method 1 and Method 2 can be used in different examples, e.g., based on the area of the bounding box. In this way, the way of partitioning the primitive can be different for different primitives and, specifically, can be chosen to suit the size and / or shape of the primitive to thereby provide an efficient partitioning of the primitive.

[0095] In Figure 4a , Figure 4b and Figure 10The method steps of the flowchart shown can be implemented as logic blocks within the processing logic 112 of the tiling 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 particular 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 sets of computer instructions that can be stored in a memory and can be provided to the processing logic 112 for execution thereon to provide the functions of the logic blocks.

[0096] The graphics processing system 100 described above can be implemented in a computer system. For example, Figure 12 FIG. shows a computer system including a GPU 102, a CPU 1202, and a memory 1204, where the memory 1204 can include memory blocks for the memories 104 1 and 104 2 described above. The computer system also includes other devices 1206, such as a display 1208, speakers 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] In general, any of the functions, methods, techniques, or components described above (e.g., the tiling 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 generally to denote software, firmware, hardware, or any combination thereof.

[0098] In the case of a software implementation, a module, function, component, unit, or logic represents program code that, when executed on a processor (e.g., one or more CPUs), performs a specified task. In one example, the described method can be performed by a computer configured with software in a machine-readable form stored on a computer-readable medium. One such configuration of a computer-readable medium is a signal-bearing medium and is thus configured to convey instructions (e.g., as a carrier wave) to a computing device, such as via a network. A computer-readable medium can also be configured as a non-transitory computer-readable storage medium and is thus not a signal-bearing medium. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disks, flash memory, hard disk storage, and other memory devices that can store instructions and other data using magnetic, optical, and other technologies and can be accessed by a machine.

[0099] Software can take the form of a computer program that includes computer program code for configuring a computer to perform the described method, or take the form of a computer program that includes computer program code means for performing all steps of any method described herein when the program is run on a computer and in the case where the computer program can be embodied on a computer-readable medium. The program code can be stored on one or more computer-readable media. The techniques described herein are platform-independent, meaning that these techniques can be implemented on various computing platforms with various processors.

[0100] Those skilled in the art will also recognize 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 within the processing logic 112 of the tilt unit 108) can include hardware in the form of a circuit. Such a circuit can include transistors and / or other hardware elements available in the manufacturing process. Such transistors and / or other elements can be used to form circuits or structures that implement and / or contain memory, as examples, such as registers, trigger circuits, or latches, logic operators such as Boolean operations, arithmetic operators such as adders, multipliers, or shifters, and interconnections. Such elements can be provided as custom circuits or standard cell libraries, macros, or other levels of abstraction. Such elements can be interconnected in a specific arrangement. A module, function, component, unit, or logic (e.g., a logic block within the processing logic 112) can include circuits with fixed functions and circuits that can be programmed to perform one or more functions; such programming can be provided via firmware or software updates or via a control mechanism. In one example, the hardware logic has circuits that implement fixed-function operations, state machines, or processing.

[0101] It is also intended to cover software that “describes” or defines the configuration of hardware that implements the modules, functions, components, units, or logic described above, such as HDL (Hardware Description Language) software for designing integrated circuits or for configuring programmable chips to perform desired functions. That is, a computer-readable storage medium having computer-readable program code encoded thereon for generating a graphics processing system configured to execute any of the methods described herein or for generating a graphics processing system including any of the devices described herein may be provided. That is, a computer system may be configured to generate a representation of a digital circuit based on a definition of circuit elements and data defining rules for combining those circuit elements, where a non-transitory computer-readable storage medium may have stored thereon processor-executable instructions that, when executed at such a computer system, cause the computer system to generate, for example, a graphics processing system including tile units 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 such that it can execute instructions, or to dedicated 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 logical acts, it will 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 be associated with one example or may be associated with several examples.

[0104] As will be apparent to those skilled in the art, any range or value given herein can be extended or altered without losing the desired effect. The steps of the methods described herein may be performed in any suitable order or, where appropriate, simultaneously. Aspects of any of the examples described above may be combined with aspects of any of the other examples described to form additional examples without losing the desired effect.

Claims

1. A method for processing primitives in a graphics processing system, the method including chunking the primitive to determine in which of a plurality of tiles in a rendering space the primitive is, the chunking of the primitive comprises: For each tile in a subset of the tiles, performing an edge-specific test to determine whether the tile is outside an edge of the primitive; and Using the results of the edge-specific tests for at least two tiles in the subset determined to be outside the edge of the primitive, to infer that at least one other tile within a region bounded by the at least two tiles is outside the edge of the primitive, without performing an edge-specific test for the at least one other tile with respect to the edge of the primitive.

2. The method according to claim 1, wherein, The following steps are performed for each edge of the primitive: (i) For each tile in the subset, performing an edge-specific test to determine whether the tile is outside an edge of the primitive, and (ii) Using the results of the edge-specific tests for at least two tiles in the subset determined to be outside the edge of the primitive, to infer that at least one other tile within a region bounded by the at least two tiles is outside the edge of the primitive, without performing an edge-specific test for the at least one other tile with respect to the edge of the primitive.

3. The method according to claim 2, wherein, If it is determined that a tile is outside any edge of the primitive, the primitive is determined to be outside the tile.

4. The method according to claim 2, wherein, If it is determined that a tile is inside all edges of the primitive, the primitive is determined to be inside the tile.

5. The method according to claim 4, the method further comprises: For each tile in the tiles in the rendering space, rendering the primitives determined to be inside the tile.

6. The method according to any one of claims 1 to 5, wherein, Performing the edge-specific test to determine whether the tile is outside an edge of the primitive includes: using an edge equation describing an edge of the primitive to determine whether a test point specific to the edge in the tile is inside or outside the edge.

7. The method according to any one of claims 1 to 5, wherein, The chunking of the primitive further includes determining a bounding box for the primitive.

8. A graphics processing system, the graphics processing system includes a chunking unit for chunking a primitive to determine in which of a plurality of tiles in a rendering space the primitive is, the chunking unit is configured to: For each tile in a subset of the tiles, perform an edge-specific test to determine whether the tile is outside an edge of the primitive; and Using the result of an edge-specific test for at least two tiles in the subset that are determined to be outside the edge of the primitive, infer that at least one other tile located within the region bounded by the at least two tiles is outside the edge of the primitive without performing an edge-specific test for the at least one other tile with respect to the edge of the primitive.

9. The graphics processing system according to claim 8, wherein, the tiling unit is configured to perform the following steps for each edge of the primitive: (i) For each tile in the subset, perform an edge-specific test to determine whether the tile is outside the edge of the primitive, and (ii) Using the result of an edge-specific test for at least two tiles in the subset that are determined to be outside the edge of the primitive, infer that at least one other tile located within the region bounded by the at least two tiles is outside the edge of the primitive without performing an edge-specific test for the at least one other tile with respect to the edge of the primitive.

10. The graphics processing system according to claim 9, wherein, the tiling unit is configured to determine that the primitive is outside the tile if it is determined that a tile is outside any edge of the primitive.

11. The graphics processing system according to claim 9, wherein, the tiling unit is further configured to determine that the primitive is inside the tile if it is determined that a tile is inside all edges of the primitive.

12. The graphics processing system according to claim 11, wherein, the tiling unit is further configured to include the primitive identifier of the primitive in the display list for the specific tile if it is determined that the primitive is inside the specific tile.

13. The graphics processing system according to claim 11 or 12, the graphics processing system further includes a rendering unit configured to render the primitives determined to be inside the tile for each tile in the tiles in the rendering space.

14. The graphics processing system according to any one of claims 8 to 12, wherein, the tiling unit is configured to perform the edge-specific test to determine whether the tile is outside the edge of the primitive by using an edge equation describing the edge of the primitive to determine whether a point for the edge-specific test in the tile is inside or outside the edge.

15. The graphics processing system according to claim 14, wherein, the point for the edge-specific test in the tile is the point in the tile that is most likely to be inside the edge according to the orientation of the edge.

16. The graphics processing system according to any one of claims 8 to 12, wherein, the tiling unit is further configured to determine a bounding box for the primitive.

17. The graphics processing system according to any one of claims 8 to 12, wherein, the subset of tiles includes a corresponding tile from each tile frame in a plurality of N×M tile frames in the rendering space, where N and M are integers.

18. The graphics processing system according to any one of claims 8 to 12, wherein, the at least two tiles in the subset include: two tiles in the same tile row or the same tile column in the rendering space; or four tiles arranged in a rectangle within the rendering space.

19. A computer-readable storage medium having computer-readable code encoded thereon, the computer-readable code being adapted to perform the method according to any one of claims 1 to 7 when the code is run on a computer.

20. A computer-readable storage medium having computer-readable code encoded thereon, the computer-readable code for generating the graphics processing system according to any one of claims 8 to 12.

Citation Information

Patent Citations

  • Method for determining tiles in a computer display that are covered by a graphics primitive

    US6437780B1