Video graphics system that includes custom memory and supports anti-aliasing and method therefor

A method and apparatus for supporting anti-aliasing oversampling in a video graphics system that utilizes a custom memory for storage of the frame buffer is presented. The custom memory includes a memory array that stores the frame buffer as well as a data path that performs at least a portion of the blending operations associated with pixel fragments generated by a graphics processor. The fragments produced by a graphics processor are oversampled fragments such that each fragment may include a plurality of samples. If the sample set for a particular pixel location can be compressed, the compressed sample set is stored within the frame buffer of the custom memory circuit. However, if such compression is not possible, pointer information is stored within the frame buffer on the custom memory, and a sample memory controller included on the graphics processor maintains a complete sample set for the pixel location within a sample memory. When the sample memory controller maintains a complete sample set for a pixel location, the frame buffer stores a pointer corresponding to the location of the sample set.

FIELD OF THE INVENTION

The invention relates generally to video graphics processing and more particularly to a method and apparatus for anti-aliasing support and a video graphics system that includes custom memory.

BACKGROUND OF THE INVENTION

Computers are used in many applications. As computer systems continue to evolve, the graphical display requirements of the systems become more demanding. This is especially true in applications where detailed graphical displays must be updated quickly. In many applications that utilize such detailed graphical displays, maintaining the detail of the display can consume large amounts of memory storage space and processing bandwidth.

Computer displays and other high resolution display devices present an image to a viewer as an array of individual picture elements, or pixels. The individual pixels are each given a specific color which corresponds to the color of the image of the location of the particular pixel. The pixels are closely spaced, and the viewer's visual system performs a filtering of the individual pixel colors to form a composite image. If the partitioning of the image into individual pixel elements is performed properly, and the pixels are close enough together, the viewer perceives the displayed array of pixels as a virtually continuous image. Despite the viewer's visual filtering, the viewer remains sensitive to aberrations in the image and video graphics systems must be designed to minimize these aberrations.

In many systems, graphical images for display are sampled and the image is regenerated based on the stored samples. Where the conservation of detail is important, oversampling is often utilized in order to avoid aliasing in the reconstructed graphical image. Oversampling techniques are well known in the art. In an oversampling system, multiple samples of each pixel are stored. Although each pixel is rendered using only a single color value, each of the samples for that particular pixel is used in generating the final color. In effect, a much more detailed, or higher resolution, version of the image is stored in memory, and this version is used to generate each of the colors for the pixels displayed on the screen.

Conventional oversampling in video graphic systems can require large amounts of memory. For example, if the system stores 8 samples for each pixel, and each sample includes 32 bits of color information and a 32-bit Z value, or the depth coordinate value, memory requirements for a high quality images which is 640×480 pixels is nearly 20 million bytes. The disadvantages of this amount of memory usage are apparent. First, the memory storage must be provided, which is costly. Second, the memory accesses required to store and improve the data can consume large amounts of bandwidth within the computing system.

The memory bandwidth issue can become especially troublesome when the bandwidth over a bus structure connecting a memory to a graphics processor is limited. In three-dimensional (3D) graphics processing, stored graphics data is often retrieved from memory and compared with newly generated pixel fragments to determine whether or not the fragments modify the state of the image as it is currently stored. If a determination is made that the fragment modifies the stored pixel information, the new value must be written back to the memory. As such, a large amount of bus bandwidth is required in order to perform both reading and writing operations associated with transferring video graphics data to and from the memory, which is often referred to as a frame buffer.

Therefore, a need exists for an anti-aliasing technique that makes efficient use of memory resources such that less memory space is required for storing the samples, and less bus bandwidth is required in order to perform the blending operations required in 3D graphics applications.

DETAILED DESCRIPTION

Generally, the present invention provides method and apparatus for supporting anti-aliasing oversampling in a video graphics system that utilizes a custom memory for storage of the frame buffer. The custom memory includes a memory array that stores the frame buffer as well as a data path that performs at least a portion of the blending operations associated with pixel fragments generated by a graphics processor. The fragments produced by a graphics processor are oversampled fragments such that each fragment may include a plurality of samples. If the sample set for a particular pixel location can be compressed, the compressed sample set is stored within the frame buffer of the custom memory circuit. However, if such compression is not possible, pointer information is stored within the frame buffer on the custom memory, and a sample memory controller included on the graphics processor maintains a complete sample set for the pixel location within a sample memory. When the sample memory controller maintains a complete sample set for a pixel location, the frame buffer stores a pointer corresponding to the location of the sample set.

The invention can be better understood with reference toFIGS. 1-6.FIG. 1illustrates a block diagram of a graphics processing system50that supports oversampling anti-aliasing. The system50includes a graphics processor10, a sample memory25, and a custom memory40. The graphics processor10, the custom memory40, and the sample memory25may each be individual integrated circuits.

The graphics processor10includes a pixel pipe14, a buffer20, a custom memory interface18, and a sample memory controller24. The pixel pipe14of the graphics processor10receives video graphics primitives12. The video graphics primitives12may be generated by a central processor in a computing system that includes the system50. The pixel pipe14performs three-dimensional (3D) processing of the video graphics primitives12to produce pixel fragments16. The 3D processing performed by the pixel pipe may include functions such as those performed by a raster engine, texture mapping blocks, and other graphics processing blocks commonly associated with 3D video graphics processing pipelines which are know in the art. The pixel fragments16produced by the pixel pipe14are oversampled pixel fragments, where each pixel fragment includes a color value, a Z value, and a coverage mask. The coverage mask indicates to which of the samples for the pixel fragment the color and Z values correspond. For example, the color and Z values may only correspond to the bottom most samples of the pixel fragment. As such, only half of the bits within the coverage mask will be set, where this encodes for which pixel fragments the color and Z values are valid.

Once generated, the pixel fragments16are stored within the buffer20, which is operably coupled to the pixel pipe14. Storage of the pixel fragment16within buffer20is performed such that the sample memory controller24can retrieve these pixel fragments for later use if necessary. In addition to storing the pixel fragments16within the buffer20, the pixel fragments16are provided to the custom memory interface18. The custom memory interface transmits the pixel fragments16to the custom memory40over the bus30. Because the bandwidth available over the bus30may be limited due to the maximum bus speed with which the bus30can operate as well as the number of physical connectors provided on the bus30, a packing block28may be included within the custom memory interface18.

The packing block28may pack a number of pixel fragments together into a data block that can be transferred more efficiently over the bus30in a manner that maximizes the available bandwidth. Such packing techniques can include buffering a number of fragments that are to be processed simultaneously within the custom memory40, where when enough fragments have been collected within a particular block, the block is packed and then transferred over the bus30. Packing can be used to ensure that only valid fragment data is sent over the bus30with minimal inclusion of placeholders when necessary. As such, if a fragment block includes up to eight fragments, yet only three fragments are included in a block when it is to be transferred over the bus30, the memory bandwidth utilized will only be that required to transfer the three fragments, and not the bandwidth required to send over a complete eight fragment block. Such packing techniques are described in additional detail in copending patent application Ser. No. 09/630,783 entitled “GRAPHICS PROCESSING SYSTEM WITH ENHANCED BUS BANDWIDTH UTILIZATION AND METHOD THEREFOR” which was filed on Aug. 2, 2000.

The custom memory40includes a memory array46and a data path48. The memory array46may be a dynamic random access memory (DRAM) memory array. The memory array46stores a frame buffer corresponding to a display frame. The frame buffer includes an entry for each pixel location of the plurality of pixel locations of the display frame. Each entry of the frame buffer stores either a compressed sample set corresponding to the pixel location or a set of pointer information for the pixel location. Because DRAM memories typically allow a large amount of data to be read out simultaneously, the data path48may perform block processing operations, where the size of the block operated upon is dependent upon the width of the data word provided by the memory array46. For example, if the memory array46is able to provide the data corresponding to eight pixel entries to the data path48simultaneously, the data path48may attempt to perform the processing for eight fragments simultaneously before writing the results back to the memory array46. The block processing allows a large amount of parallelism, thus increasing the speed with which the overall system is capable of operating. Performing block processing operations within the data path48requires the pixel fragments sent across the bus30to be grouped into blocks for such processing. Preferably, this is performed within the graphics processor10prior to transference over the bus30. However it may be possible to perform such grouping within an unpacking buffer44. In other cases, the unpacking buffer44may simply unpack packed fragment blocks prior to providing them to the data path48for processing.

In order to minimize costs, the amount of additional logic included on the custom memory40aside from the memory array46may be minimized. This is due to the fact that in typical DRAM processing technology, the inclusion of additional circuitry on the integrated circuit that includes the DRAM is relatively expensive. Therefore, although some of the blending circuitry within the video graphics system has been moved onto the custom memory40, some functions remain within the graphics processor10in order to keep the production costs of the custom memory40within a feasible range.

The data path48receives pixel fragments transmitted to the custom memory40by the custom memory interface18. The data path performs first pass blending operations that include Z comparison operations using the pixel fragments. Preferably, as mentioned above, such first pass blending operations are performed on a block-by-block basis such that a plurality of pixel locations and their corresponding fragments are processed simultaneously.

The first pass blending operation for each pixel fragment blends the pixel fragment with the stored pixel data retrieved from the frame buffer within the memory array46. As will be described below, the first pass blending may result in a determination that additional second pass blending operations need to take place within the graphics processor10. This occurs when the blending operations performed by the data path48do not result in a sample set that can be represented as a compressed sample set, where a compressed sample set may vary from one implementation to the next.

When the first pass blending data produced through the first pass blending operation by the data path48can be compressed to a compressed sample set, the compressed sample set is stored back into the frame buffer within the memory array46at the appropriate pixel location. When block-by-block operations occur, a block of pixel data is read from the frame buffer from a specific block location, and after processing, a block of resultant pixel data is written back into the frame buffer at the same location, where various portions of the resultant pixel data block may or may not be modified by the first pass blending operations.

In one example embodiment, each compressed sample set includes a single color value, a single Z value, and a flag that indicates whether or not the information stored within the entry of the frame buffer is a compressed sample set. Thus, in such an embodiment, the full set of samples for the pixel must be compressible into a single color and Z value. This only occurs when all of the samples for the pixel have the same color value and the same Z value. Thus, if a single primitive completely overlaps a pixel, it can be described using a single color value and a single Z value. Any pixels that do not have this characteristic require a complete sample set stored within the sample memory25and pointer information stored within the frame buffer. Such a single sample compression technique is described in additional detail in a co-pending patent application Ser. No. 09/619,129 entitled “METHOD AND APPARATUS FOR VIDEO GRAPHICS ANTI-ALIASING USING A SINGLE SAMPLE FRAME BUFFER AND ASSOCIATED SAMPLE MEMORY”, a filing date of Jul. 18, 2000.

In another example embodiment, each compressed sample set within the frame buffer includes a first color value, a first Z value, a second color value, a second Z value, and a mask. The first color value and the first Z value form a first color/Z pair, and the second color value and the second Z value form a second color/Z pair. The mask differentiates between which samples are covered by the first color/Z pair and the second color/Z pair. Thus, in an 8 times oversampling implementation, the mask will include 8 bits, where a 0 in a particular bit location may indicate that that particular sample is described using the first color/Z pair. In such an example embodiment, a 1 value in a bit location of the mask would indicate that the corresponding sample is covered by the second color/Z pair. Therefore, a pixel that is completely covered by a single color/Z pair can be indicated either by all 0's or all 1's within the mask. As such, one of these homogenous bit patterns is selected to indicate complete coverage and the other is used to indicate that the entry within the frame buffer stores pointer information rather than two color values and two Z values. Such a two-sample compression technique is described in additional detail in co-pending patent application entitled “METHOD AND APPARATUS FOR VIDEO GRAPHICS ANTI-ALIASING” which has a U.S. patent application Ser. No. 09/141,797, and which was filed on Aug. 28, 1998.

When the first pass blending data cannot be compressed to a compressed sample set, pointer information is stored within the appropriate pixel location in the frame buffer instead of a compressed sample set. The pointer information preferably includes a pointer value that corresponds to the location in the sample memory25at which the complete sample set for the pixel location is stored. Thus, when the sample set cannot be compressed to a compressed size for storage in the frame buffer, the complete sample set is stored within sample memory25at a particular location, and a pointer to this location is stored within the frame buffer such that the complete sample set can be retrieved for use in the future.

The pointer information stored within the frame buffer when compression cannot be achieved may also include a front-most Z value corresponding to the complete sample set. In other embodiments, a rear-most or other Z value representative of the sample set may be included in the pointer information stored within the frame buffer. Front- and rear-most Z values can enable some of the pixel fragments that are to be processed to be discarded based on the relative positioning of the fragments with regard to the pixel data currently stored within the frame buffer. For example, if the Z value for a pixel fragment is behind the rear-most Z value for a particular pixel location, the fragment can simply be discarded as it will not be visible due to the fact that it lies behind the data stored for that pixel location. In other cases, the front-most Z value can be useful in determining that a pixel fragment completely overlaps the currently stored pixel data for a pixel location such that the color and Z value for the pixel fragment are appropriate for all of the samples of the pixel following the blending operation.

In some cases, a new entry may have to be established within the sample memory25based on a first pass blending operation. Thus, if it is determined that a pixel location requires a complete sample set within the sample memory25, and such a sample set does not already exist, a new pointer must be derived in order to store pointer information within the frame buffer such that the sample set can be referenced in the future. The pointer value may be retrieved from a pointer buffer54that stores released pointer values that have been sent over the bus30from the custom memory interface18. The pointer buffer54may be of a relatively small size such that the pointer buffer54can only store a relatively small number of pointer values.

As the pointer values stored within the pointer buffer54are consumed through processing operations by the data path48, the custom memory interface18may maintain an indication as to the fullness of the pointer buffer54. When the number of forwarded released pointer locations falls below a threshold number, the custom memory interface can pop at least one released pointer location from a stack26, which stores released pointer locations, and forward these released pointer locations to the pointer buffer54for subsequent use. Because the custom memory interface18receives an indication from the data path48when it has fetched a pointer location from the pointer buffer54, and the custom memory interface18controls the ingress of pointer locations to the pointer buffer54, the custom memory interface18can determine the current number of pointer locations stored within the pointer buffer54.

A counter52may be also included within the custom memory40. The counter52may store the next available pointer location, which can be fetched by the data path48for use. Thus, if the pointer buffer54is empty, or if the system does not reuse the released pointer locations, the next available pointer location can be fetched from the counter52. Each time a next available pointer location is fetched for use by the data path48, the counter52increments such that it subsequently points to the next available pointer location within the sample memory25.

After performing the first pass blending operation, the data path48provides first pass blending results to the custom memory interface within the graphics processor. The first pass blending results may be packed using a packing block53such that the bandwidth available on the bus32is used efficiently. The packing performed by the packing block53may be similar to that performed by the packing block28such that only relevant data is sent back over the bus32and an overabundance of placeholders associated with the block transfer do not unnecessarily consume bus bandwidth.

The first pass blending results for each fragment indicate whether the results of the first pass blending operation were compressed to a compressed sample set and stored within the frame buffer in such a compressed format. The custom memory interface18forwards the first pass blending results to the sample memory controller24. The sample memory controller24is operably coupled to the sample memory25.

In some cases where second pass blending operations are required, the pixel fragment must be blended with a compressed sample set that had been stored in the frame buffer to produce a sample set that cannot be compressed back to a compressed sample set. In such cases, the first pass blending results include a pointer value and the compressed sample set with which the pixel fragment is to be blended. In an embodiment that includes a counter52and a pointer buffer54in the custom memory40, such first pass blending information may also include an indication as to whether the pointer value was retrieved from the counter52or the pointer buffer54. The sample memory controller24then blends the pixel fragment, which it retrieves from the buffer20, with the compressed sample set, which was sent over as a part of the first pass blending results, to produce a complete sample set that is stored at the location indicated by the pointer. By storing the pixel fragments16within the buffer20, they do not need to be sent back across the bus32from the custom memory40when second pass blending operations are required. As such, the bus32is not unnecessarily utilized, thus enabling the system to be designed with lower bandwidth requirements on the bus32.

In some cases, a sample set for the pixel location may already be stored within the sample memory, and the pixel fragment must be blended with this already existing sample set. The sample set is retrieved based on the pointer location sent back as a part of the first pass blending results. The sample memory controller24retrieves the pixel fragment to which the first pass blending results correspond from the buffer20and blends it with the sample set retrieved from the sample memory. The resultant sample set generated by such a second pass blending operation are stored back to the sample memory25based on the pointer location included in the first pass blending result received from the custom memory40.

In some cases, the blending of a pixel fragment results in the sample set for a pixel location changing such that it can be compressed when it could not be compressed before the fragment was blended with the stored data. In such cases, the sample set stored within the sample memory25is no longer valid as a compressed sample set stored within the frame buffer completely describing the pixel. As such, the location at which the sample set is stored is released for subsequent use for storage of a different sample set. These pointer locations are sent back across the bus32as a part of the first pass blending results, and the released locations are accumulated within the stack26prior to forwarding to the pointer buffer54.

In the case where the first pass blending results indicate that the second pass blending operations are not required, the sample memory controller24removes the pixel fragment to which the first pass blending results correspond from the buffer20. As such, the buffer20is continuously being filled and emptied. In one embodiment, the buffer20is a first-in-first-out (FIFO) buffer where pixel fragments are pushed into the buffer20by the pixel pipe14and pulled out by the sample memory controller24.

Each sample set stored within the sample memory25preferably includes the same number of samples. In one embodiment, each pixel location is described using eight samples, which corresponds to eight times oversampling. In other embodiments, a greater or lesser number of samples may be used to describe each pixel within the display frame. As is apparent to one of ordinary skill in the art, a tradeoff exits between the number of samples maintained for each pixel location and the degree of accuracy with which the image included in the display frame is maintained.

FIG. 2illustrates a flow diagram of a method for oversampled graphics processing. The method illustrated inFIG. 2may correspond to the various operations performed by the graphics processor10included in FIG.1. The method ofFIG. 2begins at step60where a video graphics primitive is received. At step62, the video graphics primitive is processed to produce over sampled pixel fragments. As described above, the processing performed may be that commonly performed within 3-D graphics pipelines. Each oversampled pixel fragment includes a color value, a Z value, and a coverage mask that indicates to which of the samples the color and the Z values correspond.

At step64, the oversampled pixel fragments generated through processing the video graphics primitive are stored in a fragment buffer. The fragment buffer may be a buffer such as the buffer20described inFIG. 1above. The fragment buffer may be a FIFO buffer such that fragments are withdrawn from the fragment buffer in the order in which they were inserted into the fragment buffer.

At step66, the oversampled pixel fragments generated from the video graphics primitive are forwarded to a custom memory that performs first pass blending operations. In response to forwarding the oversampled pixel fragments to the custom memory, the graphics processor receives first passed blending results from the custom memory at step68. First pass blending results indicate whether or not second pass blending is required for each oversampled pixel fragment. If no second pass blending is required, the pixel information for the pixel to which the fragment corresponds can be completely described using a compressed sample set that is stored within the frame buffer. As such, no entry is required within the sample memory for that particular pixel location.

If it is determined at step70that second pass blending is not required based on the first pass blending results received at step68, the method proceeds to step72. At step72, the oversampled pixel fragment corresponding to the first pass blending results is removed from the fragment buffer. Thus, the oversampled pixel fragment is not required for further processing, and therefore can be removed from the buffer such that the space within the buffer is available for subsequently generated fragments. If the first pass blending results include a pointer that has now been released, such a pointer is pushed onto a stack for future use.

If it is determined at step70that second pass blending operations are required based on the first pass blending results, the method proceeds to step74. At step74, the corresponding oversampled pixel fragment is retrieved from the fragment buffer for use in the second pass blending operations. Retrieval of the oversampled pixel fragment from the fragment buffer removes the oversampled pixel fragment from the fragment buffer such that the space is available for subsequently generated oversampled pixel fragments.

At step76, the oversampled pixel fragment that has been retrieved is blended with sample data to produce a resultant sample set. The blending operations that occur at step76may include the retrieval of a current sample set for the appropriate pixel location based on a pointer value that accompanies the first pass blending results. Thus, the particular pixel to which the pixel fragment corresponds may already be described using a complete sample set within the sample memory. As such, this complete sample set must be retrieved in order to perform blending operations to produce the resultant sample set which is to be stored back into the sample memory based on the pointer.

In other cases, there may not currently be a complete sample set stored within the sample memory for the particular pixel location to which the fragment corresponds. As such, the first pass blending results passed from the custom memory to the graphics processor include a pointer value as well as at least a portion of the compressed sample set that was stored for the pixel location within the frame buffer prior to first pass blending of the pixel fragment. Thus, the first pass blending resulted in pointer information being stored within the frame buffer for the pixel location, and the second pass blending operation blends the pixel fragment with the sampled data as described by the compressed sample set provided by the custom memory.

In one example, the compressed sample sets stored within the frame buffer may only include a single color and a single Z value. If a subsequently received fragment only has partial coverage of the pixel and lies in front of the current pixel data stored within the frame buffer, the result of blending this fragment with the current pixel data produces samples for that pixel location that correspond to the color and Z value of the fragment as well as the color and Z value of the pixel data previously stored within the frame buffer. As such, a pointer is stored within the frame buffer, and a complete sample set is created within the sample memory at the pointer location based on the fragment and the compressed sample set that had been stored for that pixel location.

At step78, the resultant sample set produced through the second pass blending operation is stored in the sample memory at a location corresponding to the pointer provided as a part of the first pass blending results. Note that when new sample sets must be created within the sample memory, pointer values must be generated by the custom memory. This may be accomplished by providing a pointer buffer within the custom memory, where released locations are forwarded to the pointer buffer by the graphics processor when it is determined that the contents of the pointer buffer reach a low threshold. A stack within the graphics processor may be used to store released pointers prior to forwarding them to the pointer buffer within the custom memory. This was described above with respect to FIG.1. Released pointers are pushed onto the stack when first pass blending results indicate that second pass blending is not required and a released pointer is included in the first pass blending results. Thus, when a pointer value that had been stored within the frame buffer is no longer required (a compressed sample set now resides within the frame buffer for that pixel location), the released pointer is included in first pass blending results passed to the graphics processor such that the released pointer can be pushed onto the stack for subsequent use.

FIG. 3illustrates a flow diagram of a method for blending oversampled fragments within a custom memory. The method begins at step90where oversampled pixel fragments are received. In some embodiments, the oversampled pixel fragments may be received in a packed format, where unpacking of the oversampled pixel fragments is required. Such unpacking may include formatting the oversampled pixel fragments into blocks such that block-by-block blending can be performed within the custom memory. Such unpacking may include buffering operations such that the speed with which blocks are transferred over the bus to the custom memory can be controlled to ensure that buffer overflow does not occur.

Each oversampled pixel fragment includes a color value, a Z value, and a coverage mask. The coverage mask indicates to which samples of the oversampled pixel fragment the color and Z values correspond. When the coverage mask indicates that the color and Z values correspond to all of the samples of the oversampled pixel fragment, the pixel fragment has complete coverage.

At step92, first pass blending is performed for each pixel fragment. First pass blending operations utilize pixel data stored in a frame buffer within the custom memory. First blending operations fetch the pixel data from the frame buffer and determine based on the pixel data stored in the frame buffer and the particular oversampled pixel fragment corresponding to that particular pixel location whether or not second pass blending operations must be performed. The determination as to whether second pass blending operations need to be performed is based on whether or not the results of the first pass blending operation can be compressed to a resultant compressed sample set. Determination as to whether or not the results of the first pass blending operation can be compressed is based on the type of compression used for storing the sample set within the frame buffer. In some cases, single sample compression is used, where if a sample set cannot be compressed to a single color value and a single Z value, pointer information is stored within the frame buffer. In other embodiments, multiple sample compression is used. In a two-sample compression technique, the compressed sample set includes two color values, two Z values, and a mask that indicates the coverage of each color/Z pair.

The specific cases where compression and non-compression is possible for a pixel fragment in an oversampled system is described in additional detail for a specific type of compression with respect toFIG. 6below. Such a specific example uses single sample compression, where compressed sample sets only include a single color value, a single Z value, and a flag that indicates whether a compression sample set is stored within the frame buffer for the pixel location or if pointer information is stored for that pixel location.

At step94, it is determined whether or not the results of the first pass blending can be compressed into a compressed sample set for storage within the frame buffer. For an example embodiment where a compressed sample set includes a single color value and a single Z value,FIG. 4illustrates an example frame buffer entry140. The frame buffer entry140includes a color field145, a Z field143, and a flag141. The color field145stores an N-bit color value, and the Z field143stores and N-1 bit Z value. The flag141is a single bit flag that indicates that the frame buffer entry140stores valid color and Z data. Note that in other embodiments, the distribution of bits within the frame buffer entry140may vary, and other values may be included within the frame buffer entry140such as stencil values and the like.

FIG. 5illustrates an example frame buffer entry150that stores pointer information rather than a compressed sample set. The frame buffer entry150includes a color field155that stores a pointer to a specific location within the sample memory, rather than storing color information as was the case in the frame buffer entry140. The Z field153stores a front-most Z value corresponding to the samples included in the sample set stored within the sample memory. The flag151provides an indication that the frame buffer entry150stores pointer information rather than a compressed sample set.

Returning toFIG. 3, if it is determined at step94that the result of the first pass blending operations can be compressed into a compressed sample set, the method proceeds to step96. At step96, the compressed sample set is stored within the frame buffer at the location to which the pixel fragment corresponds. At step98, first pass blending results are provided to the graphics processor, and the first pass blending results indicate that the pass blending operations completed all of the blending required for the particular pixel fragment. Note that the first pass blending results may also include a released pointer value if the frame buffer formerly stored pointer information and now stores a compressed sample set.

If it is determined at step94that the results of the first pass blending operation cannot be compressed into a compressed sample set for storage in the frame buffer, the method proceeds to step100. At step100, pointer information is stored in the frame buffer at the appropriate pixel location. The pointer information preferably includes a pointer that points to the complete sample set as it will be stored within the sample memory once the graphics processor has completed the second pass blending operations. The pointer included in the pointer information may be retrieved from a pointer buffer within the custom memory, or from a counter that indicates the next available pointer location within the sample memory.

The pointer information may also include a front-most Z value such that subsequent blending operations corresponding to this pixel location may be simplified. The front-most Z value, or another representative Z value such as the rear-most Z value, that is stored within the frame buffer may be the Z value for the oversampled pixel fragment which is blended during the first pass blending operations.

At step102, the first pass blending operation results are provided to the graphics processor, where the first pass blending results include the pointer that is included in the pointer information stored in the frame buffer. As such, the pointer can be used by the graphics processor to store the complete sample set for the pixel location at the appropriate address within the sample memory. The first pass blending results provided at step102also include an indication that second pass blending operations are required. In some cases, the indication that second pass blending operations are required may be accompanied by a compressed sample set (or portion thereof) that was stored for that pixel location within the frame buffer such that this compressed sample set can be utilized in the second pass blending operations. In other cases, the sample data corresponding to the pixel location may already be stored within the sample memory such that retrieval of the sample data is required for the second pass blending operations. In such cases, a compressed sample set does not accompany the indication that second pass blending operations are required.

FIG. 6illustrates a flow diagram that corresponds to an example set of steps that may be performed as a part of the first pass blending operations within a particular example system. The example system to which the flow diagram ofFIG. 6corresponds is a system that utilizes single sample compression, where each press sample set only includes a single Z value and a single color value.

The method begins at step202where a fragment is received. The fragment includes a color, a Z value, and a coverage mask that indicates which samples for the pixel the fragment covers. The fragment also includes pixel coordinate information that indicates to which pixel of the display the fragment corresponds. Based on this coordinate data, the stored pixel data for that pixel location is retrieved from the frame buffer.

The stored pixel data for each pixel location includes a flag. The flag indicates whether the stored pixel data represents valid color and Z data or pointer information. At step204, it is determined if the flag indicates that valid color and Z data have been retrieved from the frame buffer. If the flag indicates that valid color and Z data have not been fetched, and therefore pointer information has been retrieved, the method proceeds to step206. In some embodiments, the color data and Z data portions of the stored pixel data may be stored in separate memory structures. In such embodiments, a flag may be included with the color data as it is stored as well as with the Z data as it is stored. As such, only one of the two memory structures would have to be accessed in order to determine whether or not valid color and Z data is present in the frame buffer.

At step206, the mask included in the fragment data received is examined to determine if the fragment has complete pixel coverage. In other words, it is determined if the color and Z values for the fragment correspond to all of the samples for the pixel. In one embodiment, this may be indicated by the mask containing all 1's. If the fragment has complete coverage, the method proceeds to step208.

At step208, it is determined if the fragment is in front of the stored pixel information. This determination can be made if the front-most Z value for the complete set of samples corresponding to the pixel location is stored with the stored pixel data in the frame buffer. This front-most Z value can be compared with the Z value of the fragment, and if the fragment Z value is in front of the front-most Z value, the fragment, which has complete coverage of the pixel, completely covers the stored pixel data and renders it moot. If such is the case, the method proceeds to step212. At step212, the color and Z values for the pixel fragment are stored in the frame buffer along with a flag that indicates the values in the pixel location represent color and Z data as opposed to pointer information. Thus, the first pass blending operation has completed all of the blending required for the fragment. An indication as to this is sent back to the graphics processor such that the fragment can be removed from the buffer included in the graphics processor.

If it is determined at step208that the fragment does not lie in front of the front-most sample of the stored pixel data for the pixel, the method proceeds to step210. At step210, the pointer to the full set of samples stored for the pixel is sent to the sample memory controller. The sample memory controller can then blend the fragment (which it retrieves from the buffer on the graphics processor) with the stored samples in the sample memory on a sample-by-sample basis and store the results at the location corresponding to the pointer. The information in the frame buffer is not updated, as the samples for the pixel are still in the same location and the front-most Z value has not been changed as a result of blending the fragment.

If it is determined at step206that the fragment received does not have complete coverage, the method proceeds to step216. At step216the pointer to the full set of samples stored for the pixel is sent to the sample memory controller. The sample memory controller can then blend the fragment (retrieved from the buffer on the graphics processor) with the stored samples in the sample memory on a sample-by-sample basis and store the results at the location corresponding to the pointer. The method then proceeds to step218at which it is determined whether or not the fragment is positioned in front of the stored pixel data. This can be determined by comparing the Z value for the fragment with the front-most Z value for the full set of samples, where the front-most Z value is stored in the frame buffer.

If it is determined that the fragment does lie in front of the stored pixel information, the method proceeds to step236where the front-most Z value stored in the frame buffer is updated to reflect the new front-most Z value for the sample set stored in the sample memory. The new front-most Z value is the Z value of the fragment. If it is determined at step218that the fragment is not in front of all of the stored samples for the pixel, the method proceeds to step220. At step220, the frame buffer entry is left unchanged as the front-most Z value for the sample set is not modified as a result of blending the fragment with the stored set of samples.

Returning to step204, if it is determined that the flag indicates that valid color and Z data are stored in the frame buffer for the pixel (the sample set for that pixel could be compressed to a single color and Z value pair), the method proceeds to step222. At step222, it is determined if the incoming mask included in the fragment indicates that the fragment completely covers the pixel. If so, the method proceeds to step224and the fragment and stored color/Z pair are blended as they would be in a non-antialiased system. In other words, the Z value stored in the frame buffer is compared with the Z value of the fragment. If the Z value of the fragment indicates it lies in front of the stored pixel data, the color and Z values for the fragment replace the color and Z values currently stored in the frame buffer. If the fragment lies behind the stored pixel data, the fragment is discarded. An indication that the first pass blending operation completely blended the fragment is then provided to the graphics processor.

If it is determined at step222that the fragment does not have complete pixel coverage, the method proceeds to step226. At step226, it is determined if the fragment is behind the stored pixel data. This is accomplished by comparing the Z value in the frame buffer with the Z value for the fragment. Because the Z value in the frame buffer represents the Z value for all of the samples for the pixel, if the fragment Z is behind the stored Z, the fragment is completely covered by the stored samples and therefore moot. As such, the fragment is discarded at step228. Once again, an indication that the first pass blending operation completely blended the fragment is then provided to the graphics processor.

If it determined at step226that the fragment is not behind the stored pixel data, the method proceeds to step230. If the fragment is not behind the stored pixel data, the resultant pixel data resulting from the blending of the fragment with the stored pixel data is going to include samples from both the fragment and samples corresponding to the current Z and color values stored. As such, the resultant data cannot be compressed to a single color/Z pair and the full set of samples will be stored in the sample memory.

At step230, a pointer to the next available location in the sample memory is obtained. This may be done by retrieving the pointer from a buffer or a stack, or by retrieving the next available location from a counter. At step232, the pointer, the fragment and at least a portion of the pixel data stored in the frame buffer are sent to the sample memory controller for second pass blending operations. The sample memory controller can then blend the fragment and the stored pixel data to produce a sample set that is stored at the location corresponding to the pointer. At step234, the pointer and the front-most Z value (either the fragment Z or the stored Z) is stored in the frame buffer along with a flag that indicates the presence of pointer information rather than a single color/Z pair.

The present invention provides a method and apparatus for performing video graphics anti-aliasing in a system that utilizes a custom memory. The custom memory includes a memory array, which may be a DRAM memory array, that stores the frame buffer for the system. Also included within the custom memory is a portion of the blending circuitry used to blend newly generated pixel fragments with stored pixel data. In cases where the blending performed within the DRAM results in data that can be reduced to a compressed sample set, further blending operations are not required. However, if the results of the first pass blending cannot be compressed, the appropriate information is provided back to the graphics processor such that the complete sample set for the particular pixel location can be stored within a sample memory for subsequent use. As such, the present invention provides a lossless compression technique that supports an over-sampled video graphics-processing environment. Such oversampling can help reduce undesirable aberrations within displayed images.

It should be understood that the implementation of other variations and modifications of the invention in its various aspects will be apparent to those of ordinary skill in the art, and that the invention is not limited by the specific embodiments described. For example, methods of compressing the sample set for a pixel may be used which result in some loss of information, where the loss is understood and tolerated by the system. It is therefore contemplated to cover by the present invention, any and all modifications, variations, or equivalents that fall within the spirit and scope of the basic underlying principles disclosed and claimed herein.