Parameter compaction in tile based rendering device
8 claims: 2 independent, 6 dependent
- 1A method for managing memory usage in a three-dimensional computer graphics system comprising the steps of:dividing a scene to be textured and shaded into a plurality of rectangular areas (4), each comprising a plurality of picture elements in the scene;deriving a list (6) of objects for each rectangular area, each list comprising objects which may be visible in the scene;removing (8) from each list all objects that do not contribute to the final textured and shaded scene;texturing and shading (16) each rectangular area using the thus reduced lists of objects for each rectangular area;and characterised in that the step of removing from each list objects that do not contribute to the final textured and shaded scene comprises performing a rasterisation pass on depth and stencil data for each rectangular area in the scene to derive a buffer of tags for the frontmost visible object for each pixel end regenerating the object list for each tile for only those objects required to correctly render the scene.
- 7Apparatus for managing memory usage in a three-dimensional computer graphics system comprising:means (4) for dividing a scene to be textured and shaded into a plurality of rectangular areas, each comprising a plurality of picture elements in the scene;means (6) for deriving a list of objects for each rectangular area, each list comprising objects which may be visible in the scene;means (8) for removing from each list all objects that do not contribute to the final textured and shaded scene, and means (16) for texturing and shading each rectangular area using the thus reduced lists of objects for each rectangular area;characterised in that the means for removing from each list objects that do not contribute to the final textured and shaded scene comprises means for performing a rasterisation pass on depth and stencil data for each rectangular area in the scene to derive a buffer of tags for the frontmost visible object for each pixel and regenerating the object list for each tile for only those objects required to correctly render the scene.
Independent claims2
31 paragraphs, as filed
0001This invention relates to a 3-dimensional computer graphics system and in particular to methods and apparatus that reduce the amount of intermediate data stored in a tile based rendering system.
0002Tile based rendering systems are known. These break down an image to be rendered into a plurality of rectangular blocks or tiles. The way in which this is done and the subsequent texturing and shading performed is shown schematically in <figref idref="f0001">figure 1</figref>. This shows a geometry-processing unit 2 that receives the image data from an application and transforms it into screen space using a well-known method. The data is then supplied to a tiling unit 4, which inserts the screen space geometry into lists for a set of defined rectangular regions, or tiles, 6. Each list contains primitives that exist wholly or partially in a sub-region of a screen (i.e. a tile). A list exists for every tile on the screen, although it should be borne in mind that some lists may have no data in them.
0003Data then passes tile by tile to a hidden surface removal unit 8 (HSR) which determines the visibility of each object by comparing the depth at each pixel in the object with the value currently stored in the depth buffer 14. If a pixel is determined to be visible the depth buffer is updated and the object tag passed to the pass spawn control unit 10 (PSCU). The PSCU updates the tag buffer 12 with visible tags from each object and passes them to the texturing and shading unit 16 (TSU) when it determines that a pass must be "spawned". A pass is typically spawned when the PSCU attempts to write a tag for a translucent object into a tag buffer location that is already occupied. For a detailed description of the pass spawning process refer to patent <patcit id="pcit0001" dnum="GB2404316A"><text>GB 2 404 316</text></patcit>.
0004The presence of the screen space geometry lists imposes an overhead on tile based rendering systems (TBR) that is not required in conventional immediate mode rendering (IMP) architectures. This overhead is typically dealt with by rendering the current scene and freeing the parameter memory used for subsequent primitives. This method has the disadvantage of requiring memory to be allocated for a full sized Z buffer in external memory. Further to this, if anti-aliasing is being applied to the scene then both the Z buffer and target render surfaces have to be at the full anti-aliased resolution i.e. if the scene is being rendered with 4x anti-aliasing with a target resolution of 512x512 then the Z and target surfaces must be allocated for 1024x1024 resolution. The use of high precision intermediate render targets that could otherwise remain on chip further compounds this problem. The net result is that one of the key advantages of a TBR system is removed by this approach.
0005The above approach also means that the entire memory used by a scene cannot be freed until it has been entirely rendered. This means that the system must either stall when waiting for a scene to complete or only allow half the memory resource be used in a single render so that tiling can continue during a render.
0006This situation is improved by a technique know as 'Macro Tiling' in which the screen is subdivided into a plurality of tiles which are then treated as rectangular groups of tiles or macro tiles. Object data is pointed to in per tile geometry lists as per normal tiling, however instead of a single 'global' list of objects each macro tile is given its own macro list. This allows memory to be allocated and freed on a macro tile granularity e.g. when all parameter space has been consumed, macro tiles are rendered to enable memory to be freed as opposed to rendering the whole scene. This mechanism minimises the amount of time the tiling and geometry processing hardware remains idle for in these circumstances, however it retains the same need for high resolution/precision Z and render target buffers to be allocated as above.
Summary of the Invention
0007As tiling is applied to all geometry prior to visibility testing it is evident that the tiled lists will contain data that is not required for the correct rasterisation of the 3D scene. For example if a scene is composed entirely of opaque objects then only the frontmost visible objects need to be retained in the parameter buffer in order to correctly rasterise the scene. As such much of this data can be removed thereby freeing its memory resource for other objects.
0008This can be achieved by performing a rasterisation pass on the tiled data that removes all objects that do not contribute to the final 3D scene. As this pass is not required to generate an image it only needs to rasterise the depth and stencil data for the scene making it considerably faster than a "full" render. Further to this, as the retained object data is then guaranteed to correctly render the final image no additional external storage is required for depth and frame buffer images. This pass can be referred to as a "Parameter compaction" pass.
0009The parameter compaction pass works by building up a buffer of 'tags' for the frontmost visible objects for each pixel within the scene. The contents of this buffer are considered to be required for the final scene under the following conditions, <ol id="ol0001" compact="compact"><li>1. All objects in the tile/scene have been rasterised,</li><li>2. A pass needs to be spawned to the texture and shading unit</li><li>3. The stencil buffer has been updated</li><li>4. The depth buffer has been updated and the object that caused the updating does not modify the 'tag' buffer.</li></ol>
0010When it has been decided that the contents of the tag buffer are required they are processed to regenerate the tile based object list for only those objects required to correctly render the scene and to mark memory blocks for those objects as still referenced. In cases 3 and 4 above, after the buffer has been processed the object that caused the flush to the texture and shading unit must itself be processed. In case 3 this will include the object itself, even if it has been determined to not be visible.
0011Given that objects that update the stencil buffer can cause a relatively large number of objects to be retained it may be preferable to store the stencil buffer state itself. This allows the objects that update the stencil buffer image to be discarded and avoids the need to flush other valid objects at this time. The stencil buffer image needs to be saved at the point any object updates either depth or tag buffers. Based on its state, the memory for the saved stencil image is allocated using the same parameter memory management mechanism as is used for parameters. The same mechanism could be applied to depth only update objects, however these tend to be much fewer in number than stencil update objects and so do not tend to consume a large quantity of memory.
0012This mechanism can be combined with macro tiling to allow macro tiles that have consumed memory to be 'compacted' i.e. to free memory when the system is running out of memory, without incurring the disadvantages described above. Further to this, as macro tiling allocates memory to objects that i.e. in a locality of tiles the likelihood of a memory block successfully being freed by a parameter compaction pass is significantly increased. As memory is freed block by block the scheme avoids the need to reshuffle data in order to retrieve space, but does have the disadvantage of requiring all references to a block to be removed before it can be freed. The amount of memory freed could be improved by managing memory with a smaller granularity than this such as per tile or even per object in order to maximise the system's ability to free unneeded object data memory.
0013Alternatively it is possible to retain a coarse granularity block based scheme and conditionally apply a more aggressive compaction algorithm. For example, if the system sees a large number of object pointers being removed from the tiled geometry lists but only a small reduction in the number of memory blocks used it could then apply a second compaction pass to the macro tile. This second pass could compact object data by moving it in memory such that any free space becomes contiguous allowing it to be freed. It is likely that this form of compaction would only be required in extreme circumstance so could be done by software.
0014The invention is defined with more precision in the appended claims to which reference should now be made.
Brief Description of the Drawings
0015Preferred embodiments of the invention, will now be described in detail by way of example with reference to the accompanying drawings in which: <ul id="ul0001" list-style="none" compact="compact"><li><figref idref="f0001">Figure 1</figref> shows a block diagram of a prior art tile based rendering system discussed above;</li><li><figref idref="f0001">Figure 2</figref> shows a flow chart of how an embodiment of the invention determines if an object should be retained;</li><li><figref idref="f0002">Figure 3</figref> shows a modification to the algorithm shown in <figref idref="f0001">figure 2</figref>;</li><li><figref idref="f0003">Figure 4</figref> shows how an object tag buffer is processed once it has been determined that its contents are required for the final scene;</li><li><figref idref="f0003">Figure 5</figref> shows how an individual object tag is processed once it has been extracted from a tag buffer;</li><li><figref idref="f0004">Figure 6</figref> shows how a whole macro tile is processed;</li><li><figref idref="f0005">Figure 7</figref> shows how memory is processed/freed at the end of each macro tile;</li><li><figref idref="f0006">Figure 8</figref> is a block diagram of an embodiment of the invention.</li></ul>
Detailed Description of Preferred Embodiment
0016It should be noted that the described embodiment makes the following assumptions about the manner in which memory is managed, <ul id="ul0002" list-style="bullet" compact="compact"><li>Memory for object.pointers is allocated from separate memory blocks to object data.</li><li>Pointer memory blocks are allocated per tile as apposed to per macro tile.</li></ul>
0017<figref idref="f0001">Figure 2</figref> illustrates the basic algorithm used to determine if an object is required and when the tag buffer should be processed. At 22 a determination is made as whether or not the object updates the stencil buffer, if it does, based on rule 3 above, then all tag buffers are processed at 28 and the object itself is processed at 50 before exiting.
0018If the object does not update the stencil buffer then the visibility of the object is determined at 24, if the - object is not visible the algorithm exits. If the object is visible then it is determined at 26 if the object updates the tag buffer, if it does not then, in accordance with rule 4 above all tag buffers are processed at 28 and the object itself is processed at 50 before exiting.
0019If the object does update the tag buffer then it is determined at 30 as to whether a pass needs to be spawned (see patent, pass spawning, ref <patcit id="pcit0002" dnum="GB2404316A"><text>GB 2 404 316</text></patcit>), if so then based on rule 2 above, the tag buffers are processed as per the requirements of pass spawning at 31 and the object tags are then written to the tag buffer at 32 and the algorithm then exits.
0020<figref idref="f0002">Figure 3</figref> illustrates the basic algorithm defined above with the addition of stencil objects replaced with.stencil buffer load/store, as described in the summary section. At 22 a test is made to see if the object updates the stencil buffer as per <figref idref="f0001">figure 2</figref>, however after this an additional test is made at 33 to determine if it is only the stencil buffer that is updated, if not the algorithm proceeds in <figref idref="f0001">figure 2</figref>. otherwise the object just updates the stencil buffer and is then discarded. As in <figref idref="f0001">figure 2</figref> object visibility is tested at 24, however this is followed by an additional test at 36 to determine if the object visibility was dependent on the contents of the stencil buffer. If so then the current tag buffers are processed at 37 and the stencil buffer for the tile stored to memory at 38. A 'load stencil' object is then inserted into the per tile geometry lists at 39. The algorithm then proceeds as in <figref idref="f0001">figure 2</figref>.
0021<figref idref="f0003">Figure 4</figref> illustrates the manner in which a tag buffer is processed. After the start of the process 40 the tag buffer 80 is scanned for a valid tag at 42, if no valid tag is found the process exits at 44. Otherwise, at 46 all tags within the tag buffer with the same tag value as found at 42 are invalidated. This action is required as the tag buffer represents pixels of which any single object may cover many, so in order to prevent an object being repeatedly inserted into the tile geometry list all instances of a tag must be invalidated the first time it is found. The object tag is then processed at 50 before returning to 42 to scan for the next valid tag.
0022When an object tag is processed two operations are performed. First each tag is used to regenerate an object list pointer that is then inserted into a new object list for the tile. Secondly a flag is set for.each memory block that is referenced by a tag to indicate that the memory block is still required. This process is illustrated in <figref idref="f0003">figure 5</figref>.
0023At 52 a pointer to the object is extracted from the object tag. At 54 it is then determined if there is space in the current tile object pointer block, if not then a new memory block is allocated at 56. The pointer to the object is then added back into the tile list at 58. A pointer to the memory block containing the object is the extracted at 60 and used to flag the blocks continued use in a "continued reference" array at 62 before exiting.
0024The processing of a whole macro tile is illustrated by <figref idref="f0004">figure 6</figref>. At the start of processing each macro tile's array of flags indicating if an object is currently 'referenced' and if a block should continue to be referenced (referred to as the 'continued reference' array) are cleared at 72. For each object a 'referenced' flag is set at 74 to indicate that the memory block is referenced in this macro tile. Each object is then processed at 20 as described above. At 76 a test is made to see if there are any more object pointers in the current pointer memory block, if not the current block is returned to the free list at 78 and the process moves to the next block if one is present at 80. A test is then made at 82 to determine if there are any more objects to be processed in the tile, if so the process moves to the next object at 84 and then returns to 74. If there are no more. objects in the tile all tag buffers are processed as defined above (process 40, 'Start Process Tag Buffer'). The process then checks if there are any more tiles to be processed in the macro tile at 88. If there are then moving to the next tile at 90 before returning to 74. When all tiles in the macro tile have been processed the object memory is processed at 100.
0025When all tiles in a macro tile have been processed the memory block's 'referenced' and 'continued reference' flag arrays are processed to determine which memory blocks can be freed. This process is illustrated by <figref idref="f0005">figure 7</figref>.
0026For each memory block in the system the flag from the referenced array is first checked at 102. If it is not set then the process moves to the test at 108. Otherwise the continued reference array flag is tested at 104. If the continued referenced flag is not set then the memory block is returned to the list of free blocks at 106. Otherwise it continues to be required by the scene and the process moves onto the next entry at 108 and 110 as necessary.
0027<figref idref="f0006">Figure 8</figref> shows a block diagram of the preferred embodiment. A parameter fetch unit (200) reads the input per tile parameter lists and feeds them to an hidden surface removal (HSR) unit (201) that determines which objects need to be retained or which stencil data needs to be stored in order to rasterise the scene correctly, as described in the previous section. The HSR unit passes referenced memory block pointers to memory reference unit (202). This sets a flag for each referenced block in the reference array (206). The HSR unit also passes the tags for the required objects to a control stream regenerator unit (203), which rebuilds valid lists of objects, using newly allocated memory blocks (requested from the memory manager (205)). If the HSR unit determines that the stencil state should be stored then it passes the stencil data to the Stencil Store unit (204) which will allocate memory for a tile's worth of stencil buffer, store the stencil data to memory and ask the control stream regenerator to insert a stencil load reference into the per tile object list. When a parameter fetch unit (207) signals to a parameter memory management unit (205) that all parameters have been processed for the macro tile it scans the list of memory blocks previously used by the macro tile (208) and returns any that are no longer flagged as required to the list of free blocks (209) as described in <figref idref="f0005">figure 7</figref>.
0028The above will be started by the device driver software for one macro tile at a time whenever the system runs out of parameter memory.
6 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6
Every citation, both ways
| Document | Relation | Office |
|---|---|---|
| WO0195257A | Cites | World Intellectual Property Organization (WIPO) |
| GB2378108A | Cites | United Kingdom |
| GB2404316A | Cites | United Kingdom |
| HSIEH E ET AL: "ZR: A 3Dd API transparent technology for chunk rendering" MICROARCHITECTURE, 2001. MICRO-34. PROCEEDINGS. 34TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON DEC. 1-5, 2001, PISCATAWAY, NJ, USA,IEEE, 1 December 2001 (2001-12-01), pages 284-292, XP010583692 ISBN: 0-7965-1369-7 | Non-patent | – |
10 members in 5 offices
Members10
| Document | Office | Kind | |
|---|---|---|---|
| GB0611631D0 | United Kingdom | D0 | |
| GB2439129A | United Kingdom | A | |
| WO2007144622A1 | World Intellectual Property Organization (WIPO) | A1 | |
| US2008007560A1 | United States of America | A1 | |
| GB2439129B | United Kingdom | B | |
| EP2033166A1 | European Patent Office (EPO) | A1 | |
| JP2009541820A | Japan | A | |
| US7978199B2 | United States of America | B2 | |
| JP5041380B2 | Japan | B2 | |
| EP2033166B1This record | European Patent Office (EPO) | B1 |
26 legal events, as 3 offices reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | Office | |
|---|---|---|---|
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| Annual fee paid to national office [announced via postgrant information from national office to epo]GrantedPGFP | PGFP | EP | |
| Opt-out of the competence of the unified patent court (upc) registeredP01 | P01 | EP | |
| Fee paymentPLFP | PLFP | FR | |
| Fee paymentPLFP | PLFP | FR | |
| Fee paymentPLFP | PLFP | FR | |
| No opposition filed against granted patent, or epo opposition proceedings concluded without decisionGrantedR097 | R097 | DE | |
| No opposition filedOpposition26N | 26N | EP | |
| No opposition filed within time limitOppositionORIGINAL CODE: 0009261PLBE | PLBE | EP | |
| Information on the status of an ep patent application or granted ep patentGrantedSTATUS: NO OPPOSITION FILED WITHIN TIME LIMITSTAA | STAA | EP | |
| Dpma publication of mentioned ep patent grantGrantedR096 | R096 | DE | |
| Designated contracting statesAK | AK | EP | |
| (expected) grantORIGINAL CODE: 0009210GRAA | GRAA | EP | |
| Grant fee paidORIGINAL CODE: EPIDOSNIGR3GRAS | GRAS | EP | |
| Information provided on ipc code assigned before grantRIC1 | RIC1 | EP | |
| Information provided on ipc code assigned before grantRIC1 | RIC1 | EP | |
| Despatch of communication of intention to grant a patentORIGINAL CODE: EPIDOSNIGR1GRAP | GRAP | EP | |
| Amendment of ipc main classPREVIOUS MAIN CLASS: G06T0015400000R079 | R079 | DE | |
| First examination report despatched17Q | 17Q | EP | |
| Request for extension of the european patent (deleted)DAX | DAX | EP | |
| Designated contracting states (corrected)RBV | RBV | EP | |
| Request for examination filed17P | 17P | EP | |
| Designated contracting statesAK | AK | EP | |
| Request for extension of the european patentAX | AX | EP | |
| Public reference made under article 153(3) epc to a published international application that has entered the european phaseORIGINAL CODE: 0009012PUAI | PUAI | EP |
Numbers
- Publication
- 2033166
- Application
- 77332153
Titles3
- German
- PARAMETERKOMPAKTIERUNG IN EINER WIEDERGABEEINRICHTUNG AUF MOSAIKBASIS
- English
- PARAMETER COMPACTION IN TILE BASED RENDERING DEVICE
- French
- COMPACTAGE DES PARAMÈTRES DANS UN DISPOSITIF DE RENDU EN MOSAÏQUE
Classification
- CPC, 2
- G06T1/60
- G06T15/40
- IPC, 2
- G06T1 60
- G06T15 40
Designated states2
- Contracting states, 2
- Germany
- France
