1. Field of the Invention
Embodiments of the present invention relate generally to computer graphics applications and more specifically to reducing memory bandwidth requirements in an anti-aliasing operation.
2. Description of the Related Art
Unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.
Anti-aliasing processing typically occurs during the rendering stage of graphics processing and is generally used to diminish artifacts such as “jaggies,” which are stair-like lines that appear at places in an image where there should be smooth, straight lines or curves. To achieve high quality anti-aliasing results without significantly scaling up the memory footprint and bandwidth requirements, one approach is the virtual coverage anti-aliasing (“VCAA”) technique, which is discussed and claimed in the U.S. application titled, “System and Method for Virtual Coverage Anti-Aliasing,” referenced above. Basically, the VCAA technique extends the concept of multi-sample anti-aliasing by weighing different color contributions of the real samples, also referred to as real subpixels, of each pixel to determine the color of the pixel. To influence the aforementioned color contributions, the VCAA technique creates and utilizes a set of virtual samples for each pixel. Unlike a real sample, which is uniquely associated with at least Z-data and color data, a virtual sample does not have such association. Instead, a virtual sample contains information associating with or pointing to one or more real samples based on geometric primitive coverage. Such information is also referred to as “virtual coverage information” or “virtual sample coverage information.” Because the virtual samples mainly provide the affiliation information to the real samples and also the additional coverage information of one or more geometric primitives on the pixel but not the Z-data and color data, they are represented by significantly fewer bits than the real samples.
The virtual samples with the aforementioned affiliation and coverage information generally are stored in the frame buffer. This affiliation and coverage information is needed and potentially updated when performing, for example, Z-testing on the real samples. Thus, to either update or retrieve these virtual samples, the frame buffer needs to be accessed. Such accesses consume frame buffer bandwidth, which is somewhat limited in typical graphics processing unit (“GPU”) designs, and also the resources of the requesting component. Repeated accesses of the frame buffer for virtual sample information can thus limit overall system performance.
As the foregoing illustrates, what is needed is a way to efficiently manage the accesses of the virtual samples to further improve the overall performance of anti-aliasing operations performed by a GPU.
A method and system for reducing memory bandwidth requirements for an anti-aliasing operation are disclosed. In one embodiment, the first virtual coverage information for a pixel involved in an anti-aliasing operation is maintained. If a certain operating condition of the anti-aliasing operation deterministically implies the second virtual coverage information for this pixel, the second virtual coverage information, as opposed to the first virtual coverage information, is used in the anti-aliasing operation.
One advantage of the disclosed method and system is that they provide a way to reduce accesses made to the frame buffer of a graphics system, thereby improving the overall performance of the graphics system.
So that the manner in which the above recited features of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to embodiments, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only typical embodiments of this invention and are therefore not to be considered limiting of its scope, for the invention may admit to other equally effective embodiments.
A method and system for reducing memory bandwidth requirements in an anti-aliasing operation are described. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced without these specific details.
Throughout this disclosure, “geometric primitive” and “primitive” are used interchangeably. To render a computer graphics image, each geometric primitive, such as a triangle, is transformed into a screen-aligned coordinate system, referred to as “screen space.” Each geometric primitive can be mapped into a discrete and finite grid of “tiles” in memory, each of which further includes a discrete and finite grid of “frame buffer pixels,” which are used interchangeably with “pixels.” The depth value and stencil data associated with a pixel are used to determine pixel visibility. The combination of depth value and stencil data is referred to herein as “Z-data.” Each pixel can be further divided into a discrete and finite grid of “subpixels,” which are used interchangeably with “samples.” Each “real sample” is uniquely associated with at least Z-data and color data, but a “virtual sample” does not have such association. Instead, a virtual sample contains information associating with or pointing to one or more real samples based on geometric primitive coverage. Such information is also referred to as “virtual coverage information” or “virtual sample coverage information.” If a real sample and a virtual sample are covered by the same geometric primitive, then the virtual sample is associated with the real sample and is assumed to have the same color data as the real sample. Each real sample and virtual sample occupies a unique location within a pixel.
One embodiment of raster engine 104 traverses and decomposes the 2D geometric primitives into fragments, corresponding to screen space pixels that are at least partially covered by the geometric primitives. These fragments correspond to tiles of pixels in frame buffer 114; each of the pixels further contains real samples and virtual samples. In addition, raster engine 104 sets appropriate coverage masks to identify the real samples that are within the coverage area of a primitive and to identify the virtual samples that are covered by the same primitive as the real samples. Subsequent paragraphs will further describe the process of affiliating the virtual samples to the real samples and generating the virtual coverage masks for certain operations that utilize the virtual samples, such as the VCAA operation.
In addition, raster engine 104 establishes different compression status information depending on the coverage of a tile by one or more geometric primitives. For example, one status may indicate that the fragment data, such as the Z-data or the color data, associated to the tile are not eligible for reduction, because the tile is not completely covered by any one geometric primitive. Another status may indicate the fragment data associated to the tile are eligible for reduction, because it is fully covered by a single geometric primitive.
Shader engine 106 may compute, without limitation, color and Z-data for the pixels that are within the tile. Texture unit 108 applies one or more texture values to each of such pixels. For the real samples that raster engine 104 determines to be within the coverage area of a particular geometric primitive, Raster OPeration (“ROP”) unit 110 generally reads and writes their Z-data, compares their Z-data to determine occlusion, reads and writes their color data, and performs alpha blending and testing. ROP unit 110 also interacts with cache 112 and frame buffer 114. The Z-data and the color data typically are stored in the depth buffer and the color buffer, respectively, both of which reside in frame buffer 114. For VCAA operations, the virtual coverage information generated by raster engine 104, as mentioned above, is utilized to adjust the weight given to the color components of the real samples when computing the final color value for a pixel. Subsequent paragraphs will further detail the generation of virtual coverage information.
One embodiment of ROP unit 100 utilizes the compression status information from raster engine 104 to access the data in frame buffer 114. In one implementation, each tile has an associated on-chip memory location, such as a location in cache 112, which stores the current format in which the tile should be accessed. If a tile is to be stored in frame buffer 114 and if the compression status information indicates that the data are eligible for reduction, then ROP unit 100 stores the data in a compressed format and sets certain compression state bits in cache 112. On the other hand, if a tile is to be retrieved from frame buffer 114, then ROP unit 100 queries the compression state bits in cache 112 to determine whether the data being accessed are compressed or non-compressed. As an illustration, if the compression state bits of “00” are set, then that indicates no compression is performed on the tile. If the compression state bits of “01” are set, then that indicates the tile is compressed on a single Z plane and is covered by a single geometric primitive.
Moreover, one embodiment of graphics rendering pipeline 100 also includes coverage update module 118, which is mainly responsible for accessing or storing the virtual coverage information for the different virtual samples related to a particular pixel. The virtual coverage information typically is stored in frame buffer 114 and may be stored along with the other types of data, such as the Z-data or the color data for the pixel. When a new primitive is processed in the graphics pipeline, the coverage of a particular tile may change, which may change the association between the real samples and the virtual samples. In one implementation, coverage update module 118 determines whether to update the stored virtual coverage information to reflect these changes. Moreover, in the event the stored virtual coverage information is requested, coverage update module 118 determines whether to access memory to retrieve the requested information. It should be apparent to one with ordinary skill in the art to combine the functionality of coverage update module 118 with other components, such as ROP unit 110, or distribute the functionality to multiple components, such as raster engine 104 and ROP unit 110, without exceeding the scope of the claimed invention. Subsequent paragraphs will further describe the functionality of coverage update module 118.
As mentioned above, unlike a real sample, a virtual sample is not uniquely associated with Z-data and/or color data. Thus, a virtual sample requires only sufficient bits to be associated with or to point to all the real samples in a pixel that are covered by the same primitive also covering the virtual sample. In one implementation, 1 bit is allocated to represent the association to a real sample, and each real sample is assigned a pre-selected bit code. As an illustration, in
Each of the samples shown in pixel 300 has a corresponding memory location in frame buffer 114 of
Alternatively,
On the other hand, if some or all of the new real samples fail the Z-testing operation in step 504, then coverage update module 118 may update the depth buffer in step 508. In particular, in one scenario, some new real samples may pass the Z-testing operation (the “passed real samples”) but some may fail (the “failed real samples”). For the passed real samples, coverage update module 118 writes the new virtual coverage information to the depth buffer. For the failed real samples, coverage update module 118 still modifies the virtual coverage information stored in the depth buffer to disassociate the stored virtual coverage information from the failed real samples in step 508. In another scenario, all of the new real samples may fail the Z-testing operation. Coverage update module 118 then does not update the depth buffer with the new virtual coverage information, since the virtual samples will not be associated with the new real samples.
Similarly, if the results of step 502 indicate that the new real and virtual samples are not covered fully by the new primitive, then for each new real sample that is covered the new primitive, the Z-testing operation is performed in step 510. If the Z-testing operation passes, then coverage update module 118 writes the new virtual coverage information to the depth buffer in step 512. Otherwise, coverage update module 118 does not update the depth buffer in step 514.
There are other compression states that imply full coverage of a single primitive over the tile and thus imply the virtual coverage information. As an illustration, one color compression scheme utilizes the full coverage information. Specifically, if anti-aliased pixels are fully covered by a single primitive, then these pixels contain samples of identical colors. Because of this condition, instead of representing each of these identical colors individually, these samples can be represented in a reduced format. Following this logic, if a compression state indicates that color compression has been performed, then that means the condition of having samples of identical colors exists, which further implies that the pixels are covered by a single primitive. Although the single Z-plane compression scheme and the color compression scheme are used in this disclosure, it should be apparent to a person with ordinary skill in the art to recognize that they are used for illustration purposes only and should not be construed to limit the scope of the claimed invention.
A device driver, graphics driver 604, stored within system memory 602, configures GPU 616 to share the graphics processing workload performed by system 600 and communicate with applications that are executed by host processor 608. In one embodiment, graphics driver 604 generates and places a stream of commands in a “push buffer.” When the commands are executed, certain tasks, which are defined by the commands, are carried out by the GPU.
In some embodiments of system 600, chipset 612 provides interfaces to host processor 608, memory devices, storage devices, graphics devices, input/output (“I/O”) devices, media playback devices, network devices, and the like. It should be apparent to a person skilled in the art to implement chipset 612 in two or more discrete devices, each of which supporting a distinct set of interfaces.
GPU 616 is responsible for outputting image data to display 626. Display 626 may include one or more display devices, such as, without limitation, a cathode ray tube (“CRT”), liquid crystal display (“LCD”), or the like. GPU 616 has on-chip cache 618 and is also coupled to memory controller 620 and video memory 622. On-chip cache 618 and video memory 622 in one embodiment correspond to cache 112 and video memory 116 as shown in
Upon execution of the commands in the aforementioned push buffer, one embodiment of GPU 616 performs the functions of the various engines as shown in
The above description illustrates various embodiments of the present invention along with examples of how aspects of the present invention may be implemented. The above examples, embodiments, and drawings should not be deemed to be the only embodiments, and are presented to illustrate the flexibility and advantages of the present invention as defined by the following claims.
The current application is a continuation-in-part of the U.S. patent application titled, “System and Method for Virtual Coverage Anti-Aliasinng,” filed on Nov. 2, 2004 and having patent application Ser. No. 10/980,078 now U.S. Pat. No. 7,333,119. This related patent application is incorporated herein by reference in its entirety. The current application also relates to the U.S. patent application titled, “Color Compression Using Automatic Reduction of Multi-Sample Pixels,” filed on Nov. 6, 2006 having patent application Ser. No. 11/557,068. This related patent application is also incorporated here by reference in its entirety.
Number | Name | Date | Kind |
---|---|---|---|
5818456 | Cosman et al. | Oct 1998 | A |
6072500 | Foran et al. | Jun 2000 | A |
6366289 | Johns | Apr 2002 | B1 |
6452595 | Montrym | Sep 2002 | B1 |
6469707 | Voorhies | Oct 2002 | B1 |
6614449 | Morein | Sep 2003 | B1 |
6720975 | Dietrich | Apr 2004 | B1 |
6768491 | Lefebvre et al. | Jul 2004 | B2 |
6825847 | Molnar et al. | Nov 2004 | B1 |
6989835 | Deering et al. | Jan 2006 | B2 |
6999100 | Leather et al. | Feb 2006 | B1 |
7123277 | Brown et al. | Oct 2006 | B2 |
20040161146 | Van Hook et al. | Aug 2004 | A1 |
20040196297 | Elliott et al. | Oct 2004 | A1 |
20050265614 | Seong et al. | Dec 2005 | A1 |
20050270305 | Rasmussen et al. | Dec 2005 | A1 |
Number | Date | Country | |
---|---|---|---|
Parent | 10980078 | Nov 2004 | US |
Child | 11557085 | US |