Search

EP-4250237-B1 - PRIMITIVE FRAGMENT PROCESSING IN THE RASTERIZATION PHASE OF A GRAPHICS PROCESSING SYSTEM

EP4250237B1EP 4250237 B1EP4250237 B1EP 4250237B1EP-4250237-B1

Inventors

  • Brigg, Robert
  • BELLI, LORENZO

Dates

Publication Date
20260506
Application Date
20200619

Claims (15)

  1. A graphics processing system (300) in which a rendering space is subdivided into a plurality of tiles and each tile comprises a plurality of pixel samples, the graphics processing system comprising hidden surface removal logic (314, 2008) configured to: receive a primitive fragment of a set of primitive fragments associated with a tile of the plurality of tiles, the primitive fragment corresponding to a pixel sample of the tile; receive information indicating whether the primitive fragment requires a depth buffer read for full resolution depth testing; if the primitive fragment is a first primitive fragment in the set, initialize a current best depth value buffer for the tile and a depth value update map for the tile, wherein the current best depth value buffer for the tile comprises a depth value for each pixel sample of the tile, the depth value update map indicates which values of the current best depth value buffer have been updated, and the depth value update map is initialized to indicate that no depth values in the current best depth value buffer have been updated; determine whether the primitive fragment has a best depth value for the pixel sample corresponding to the primitive fragment according to a depth compare mode; and in response to determining that the primitive fragment has the best depth value for the pixel sample corresponding to the primitive fragment, update the depth value for that pixel sample in the current best depth value buffer with the depth of the primitive fragment, and update the depth value update map to indicate that the depth value for that pixel sample has been updated; wherein, when the first primitive fragment does not require a depth buffer read, initializing the current best depth value buffer comprises initializing each depth value in the current best depth value buffer to a worst depth value according to the depth compare mode, and, when the first primitive fragment requires a depth buffer read, initializing the current best depth value buffer comprises initializing each depth value in the current best depth value buffer to the corresponding depth value in the depth buffer for the tile.
  2. The graphics processing system (300) of claim 1, wherein the hidden surface removal logic (314, 2008) is further configured to, if the primitive fragment is not the first primitive fragment in the set, but is a first in the set to require a depth buffer read for full resolution depth testing, update all depth values in the current best depth value buffer, except those depth values identified in the depth value update map as having been updated, with a corresponding depth value in a depth buffer for the tile stored in memory.
  3. The graphics processing system (300) of claim 1 or claim 2, wherein the hidden surface removal logic (314, 2008) is configured to determine whether the primitive fragment has the best depth value for the pixel sample corresponding to the primitive fragment by comparing a depth of the primitive fragment to the depth value for that pixel sample in the current best depth value buffer.
  4. The graphics processing system (300) of claim 1 or claim 2, wherein the hidden surface removal logic (314, 2008) is configured to: receive information indicating whether full resolution depth testing needs to be performed for the primitive fragment; and determine whether the primitive fragment has the best depth value for the pixel sample corresponding to the primitive fragment by: if full resolution depth testing does not need to be performed for the primitive fragment, determining that the primitive fragment has the best depth value for the pixel sample corresponding to the primitive fragment, and if full resolution depth testing does need to be performed for the primitive fragment, comparing the depth of the primitive fragment to the depth value for that pixel sample in the current best depth value buffer.
  5. The graphics processing system (300) of claim 3 or claim 4, wherein the hidden surface removal logic (314, 2008) is configured to determine that the primitive fragment has the best depth value for the pixel sample corresponding to the primitive fragment if it is determined from the comparison that the primitive fragment has a better depth than the depth value for that pixel sample in the current best depth value buffer according to the depth compare mode.
  6. The graphics processing system (300) of claim 5, wherein the depth compare mode is the less than depth compare mode, and the hidden surface removal logic (314, 2008) is configured to determine that the primitive fragment has a better depth than the depth value for that pixel sample in the current best depth value buffer if it is determined from the comparison that the depth of the primitive fragment is less than the depth value for that pixel sample in the current best depth value buffer.
  7. The graphics processing system (300) of any preceding claim, wherein the hidden surface removal logic (314, 2008) is further configured to, in response to determining that the primitive fragment does not have the best depth value for the corresponding pixel sample, discard the primitive fragment.
  8. The graphics processing system (300) of any preceding claim, wherein the hidden surface removal logic (314, 2008) is further configured to, in response to determining that the primitive fragment has the best depth value for the corresponding pixel sample, send the primitive fragment for further processing.
  9. The graphics processing system (300) of claim 8, wherein sending the primitive fragment for further processing comprises sending an identifier of the primitive fragment to a tag buffer.
  10. The graphics processing system (300) of any preceding claim, wherein the hidden surface removal logic (314, 2008) is further configured to, if the primitive fragment is a last primitive fragment in the set of primitive fragments, write, to the depth buffer in memory, each depth value in the current best depth value buffer that the depth value update map indicates has been updated.
  11. The graphics processing system (300) of any preceding claim, further comprising: coarse depth test logic (320) comprising: hidden depth test logic (404) configured to: receive a set of one or more primitives related to one of the plurality of tiles; obtain a depth range for the tile, the depth range for the tile identifying a depth range based on primitives previously processed for the tile; and for at least one primitive in the set of one or more primitives: make a determination, based on the depth range for the tile, as to whether all or a portion of the primitive is hidden in the tile, wherein if a determination is made that at least a portion of the primitive is hidden in the tile, full resolution depth testing is not performed on that portion of the primitive in respect of the tile; and in response to making a determination that at least a portion of the primitive is not hidden in the tile, outputting at least that portion of the primitive; and front depth test logic (406) configured to receive the primitives output by the hidden depth test logic (404), or one or more primitive fragments generated therefrom, and for at least one of the received primitives or at least one of the primitive fragments: make a determination, based on the depth range for the tile, as to whether the primitive or primitive fragment has better depth than the primitives previously processed for the tile according to the depth compare mode; and in response to making a determination that the primitive or primitive fragment has better depth than the primitives previously processed for the tile, identifying the primitive or primitive fragment as not requiring a read of a depth buffer to perform full resolution depth testing.
  12. The graphics processing system of any preceding claim, further comprising: a priority queue (2004) for storing primitive fragments; a non-priority queue (2006) for storing primitive fragments; and logic (2002) configured to: receive a plurality of primitive fragments, each primitive fragment corresponding to a pixel sample in a tile, determine whether a depth buffer read is to be performed for full resolution depth testing of one or more of the primitive fragments, and sort the primitive fragments into the priority queue (2004) and the non-priority queue (2006) based on the depth buffer read determinations; wherein the primitive fragment received by the hidden surface removal logic (2008) is a primitive fragment selected by the hidden surface removal logic (2008) from one of the priority queue (2004) and the non-priority queue (2006) in a manner in which priority is given to the primitive fragments in the priority queue (2004).
  13. A method of performing hidden surface removal processing on primitive fragments in a graphics processing system in which a rendering space is subdivided into a plurality of tiles and each tile comprises a plurality of pixel samples, the method comprising: receiving a primitive fragment of a set of primitive fragments associated with a tile of the plurality of tiles, the primitive fragment corresponding to a pixel sample of the tile; receiving information indicating whether the primitive fragment requires a depth buffer read for full resolution depth testing; if the primitive fragment is a first primitive fragment in the set, initializing a current best depth value buffer for the tile and a depth value update map for the tile, wherein the current best depth value buffer for the tile comprises a depth value for each pixel sample of the tile, the depth value update map indicates which depth values of the current best depth value buffer have been updated, and the depth value update map is initialized to indicate no depth values in the current best depth value buffer have been updated; determining whether the primitive fragment has a best depth value for the pixel sample corresponding to the primitive fragment according to a depth compare mode; and in response to determining that the primitive fragment has the best depth value for the pixel sample corresponding to the primitive fragment, updating the depth value for that pixel sample in the current best depth value buffer with the depth of the primitive fragment, and updating the depth value update map to indicate that the depth value for that pixel sample has been updated; wherein, when the first primitive fragment does not require a depth buffer read, initializing the current best depth value buffer comprises initializing each depth value in the current best depth value buffer to a worst depth value according to the depth compare mode, and, when the first primitive fragment requires a depth buffer read, initializing the current best depth value buffer comprises initializing each depth value in the current best depth value buffer to a corresponding depth value in the depth buffer for the tile.
  14. A computer readable storage medium having stored thereon computer readable instructions that, when executed at a computer system, cause the computer system to perform the method of claim 13.
  15. A computer readable storage medium having stored thereon a computer readable description of the graphics processing system (300) of any of claims 1 to 12 that, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit embodying the graphics processing system (300).

Description

BACKGROUND Graphics processing systems are configured to receive graphics data, e.g. from an application (e.g. a game application) running on a computer system, and to render an image from the graphics data to provide a rendering output. For example, an application may generate a 3D model of a scene and output geometry data representing the objects in the scene. In particular, the application may represent each object using one or more primitives (i.e. simple geometric shapes, such as, but not limited to rectangles, triangles, lines and points to which a texture can be applied) which are defined by the position of one or more vertices. In these cases, the geometry data output by the application may include information identifying each vertex (e.g. the coordinates of the vertex in world space) and information indicating the primitives formed by the vertices. The graphics processing system then converts the received geometry data into an image that may be displayed on the screen. A graphics processing system may, for example, implement immediate mode rendering (IMR) or tile-based rendering (TBR). In IMR the entire scene is rendered as a whole. In contrast, in TBR a scene is rendered using a rendering space which is divided into subsections or subregions, which are referred to as tiles, wherein at least a portion of the rendering process may be performed independently for each tile. The tiles may have any suitable shape, but are typically rectangular (wherein the term "rectangular" includes square). An advantage of TBR is that fast, on-chip memory can be used during the rendering for colour, depth and stencil buffer operations, which allows a significant reduction in system memory bandwidth over IMR, without requiring on-chip memory that is large enough to store data for the entire scene at the same time. TBR involves two key phases: a geometry processing phase; and a rasterization phase. During the geometry processing phase the geometry data (e.g. vertices defining primitives) received from an application (e.g. a game application) is transformed from world space coordinates into screen space coordinates. A per-tile list is then created of the transformed primitives (e.g. triangles) that fall at least partially within the bounds of the tile. During the rasterization phase each tile is rendered separately (i.e. the transformed primitives are mapped to pixels and the colour is identified for each pixel in the tile). This may comprise identifying which primitive(s) are visible at each pixel. The colour of each pixel may then be determined by the appearance of the visible primitive(s) at that pixel which may be defined by a texture applied at that pixel and/or the pixel shader program run on that pixel. A pixel shader program describes operations that are to be performed for given pixels. Rendering each tile separately enables the graphics processing system to only retrieve the transformed primitive data related to a particular tile when rendering that tile in the rasterization phase, which keeps bandwidth requirements for the memory (e.g. intermediate buffer) low. Once a colour value has been identified for each pixel in a tile the colour values for the tile are written out to memory (e.g. a frame buffer). Once the entire scene has been rendered (i.e. once colour values have been determined for the pixels of all of the tiles) the scene may be, for example, displayed on a screen. FIG. 1 illustrates an example TBR graphics processing system 100. The system 100 comprises memory 1024, 1022, 1023, 1024, geometry processing logic 104 and rasterization logic 106. Two or more of the memories 1021, 1022, 1023, and 1024 may be implemented in the same physical unit of memory. The geometry processing logic 104 implements the geometry processing phase of TBR. The geometry processing logic 104 comprises transformation logic 108 and a tiling engine 110. The transformation logic 108 receives geometry data (e.g. vertices, primitives and/or patches) from an application (e.g. a game application) and transforms the geometry data into the rendering space (e.g. screen space). The transformation logic 108 may also perform functions such as clipping and culling to remove geometry data (e.g. primitives or patches) that falls outside of a viewing frustum, and/or apply lighting/attribute processing as is known to those of skill in the art. The transformed geometry data (e.g. vertices, primitives and/or patches) is (i) stored in the memory 1022, and (ii) provided to the tiling engine 110. The tiling engine 110 generates, from the transformed geometry data, a list, for each tile, of the transformed primitives that fall, at least partially, within that tile. The list may be referred to as a display list or a transformed display list. In some cases, the transformed display lists comprise pointers or links to the transformed geometry data (e.g. vertex data) related to the primitives that, at least partially, fall within the tile. The rasterizat