US20030115181A1 - Method and system for providing a hardware sort in a graphics system - Google Patents
Method and system for providing a hardware sort in a graphics system Download PDFInfo
- Publication number
- US20030115181A1 US20030115181A1 US10/359,432 US35943203A US2003115181A1 US 20030115181 A1 US20030115181 A1 US 20030115181A1 US 35943203 A US35943203 A US 35943203A US 2003115181 A1 US2003115181 A1 US 2003115181A1
- Authority
- US
- United States
- Prior art keywords
- sort
- item
- cell
- value
- new
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000000717 retained effect Effects 0.000 claims abstract description 34
- 239000012634 fragment Substances 0.000 claims description 125
- 238000013500 data storage Methods 0.000 claims description 17
- 238000002156 mixing Methods 0.000 claims description 6
- 239000000872 buffer Substances 0.000 description 15
- 239000007787 solid Substances 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 239000003086 colorant Substances 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000009877 rendering Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/22—Arrangements for sorting or merging computer data on continuous record carriers, e.g. tape, drum, disc
- G06F7/24—Sorting, i.e. extracting data from one or more carriers, rearranging the data in numerical or other ordered sequence, and rerecording the sorted data on the original carrier or on a different carrier or set of carriers sorting methods in general
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y10—TECHNICAL SUBJECTS COVERED BY FORMER USPC
- Y10S—TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y10S707/00—Data processing: database and file management or data structures
- Y10S707/99931—Database or file accessing
- Y10S707/99937—Sorting
Definitions
- the present invention relates to computer systems, and more particularly to a method and system for providing a hardware sort which is simple to design, simple to use, fast, and applicable to computer graphics system.
- Computer graphics systems may utilize a software sort in order to render an image.
- images of three-dimensional objects can be depicted on a two dimensional display.
- computer graphics systems use each objects “z value,” the distance of each object to the viewing plane.
- the objects are ordered based on each object's z value.
- the key for such a sort is the z value.
- the software sort occurs when a display list is generated through an application.
- the display list orders three-dimensional objects based on a key, typically the z value.
- the display list typically orders translucent object from back to front.
- the display list sorts translucent objects. Although they may appear on the display list, opaque objects are typically sorted using a conventional Z buffer.
- Hardware in the computer graphics system utilizes the display list, a frame buffer, and a z buffer to render the three-dimensional objects in the order dictated by the display list.
- the frame buffer and z buffer describe a portion of a three-dimensional object that is to be rendered.
- the frame buffer includes data such as color and alpha values for the portion of the object, while the z buffer includes corresponding the z values.
- the conventional computer graphics system provides the objects described in the frame and z buffers to the display screen in the order prescribed by the display list. Consequently, solid objects are rendered first, then translucent objects are rendered from back to front.
- the display list generated by software is used to render the three-dimensional objects.
- the present invention provides a method and system for providing a sort in a computer system.
- the sort is based on a plurality of values of a key.
- Each of the plurality of items has an associated value of the plurality of values.
- the method and system comprise providing a new item of the plurality of items to a plurality of sort cells.
- the new item includes a new value of the plurality of values.
- the plurality of sort cells is for sorting the plurality of items.
- Each sort cell is for sorting a corresponding item of the plurality of items.
- the corresponding item has a corresponding value of the plurality of values.
- the method and system further comprise comparing the new value to the corresponding value for each of the plurality of sort cells to determined whether to retain the corresponding item.
- Each of the plurality of sort cells retains the corresponding item if the corresponding item is to be retained. For each of the plurality of sort cells, the method and system determine whether to accept the new item or an item corresponding to the previous sort cell if the corresponding item is not to be retained. If the corresponding item is not to be retained, the method and system allow a sort cell to accept the new item or the item corresponding to the previous sort cell.
- the present invention provides a hardware sort which is simple to implement and modify, fast, and applicable to computer graphics systems.
- FIG. 1 is a block diagram of a conventional system for depicting three-dimensional objects on a two dimensional display.
- FIG. 2 is a block diagram depicting a computer graphics system utilizing the system and method in accordance with the present invention.
- FIG. 3 is a block diagram of one embodiment of a system in accordance with the present invention.
- FIG. 4 is a flow chart of a method for providing a sort in accordance with the present invention.
- FIG. 5 is a block diagram depicting one embodiment of a sort cell in accordance with the present invention.
- FIG. 6 is a detailed flow chart of a method for providing a sort in accordance with the present invention.
- FIG. 7 is a block diagram of a preferred embodiment of a system in accordance with the present invention.
- FIG. 8 is a block diagram depicting a preferred embodiment of a sort cell in accordance with the present invention.
- the present invention relates to an improvement in computer systems which sort items based on a key.
- the following description is presented to enable one of ordinary skill in the art to make and use the invention and is provided in the context of a patent application and its requirements.
- Various modifications to the preferred embodiment will be readily apparent to those skilled in the art and the generic principles herein may be applied to other embodiments.
- the present invention is not intended to be limited to the embodiment shown but is to be accorded the widest scope consistent with the principles and features described herein.
- FIG. 1 depicts a block diagram of a conventional system 10 for providing a two dimensional display of three-dimensional objects.
- the three-dimensional objects are broken into polygons, such as triangles, for display. Consequently, rendering a three dimensional object will be discussed in the context of rendering polygons.
- a software application 12 is used to display the polygons.
- the application 12 calls drivers 14 which create a display list.
- the display list contains the x, y, and z coordinates, alpha or blending value, color, and other information for each polygon.
- the display list also lists the information relating to each polygon in the order in which the polygons will be rendered to the display 22 .
- the display list typically places polygons which are part of opaque or solid objects first on the display list. These opaque objects are typically sorted by a z-buffer 17 , described below.
- the polygons for translucent objects are generally next on the display list. The translucent polygons are ordered from back to front, or highest to lowest z value, on the display list. The ordering of the polygons allows the computer system to properly depict the images of the three-dimensional objects on the display.
- the drivers 14 sort the translucent polygons based on the z value of each polygon in order to create the display list.
- a polygon may contain a range of z values. Consequently, the sort provided by the display list may actually be more complex to take into account the range of z values.
- the translucent polygons are sorted by software to determine the order in which the objects will be rendered to the display.
- a hardware renderer 16 can begin the process of rendering the polygons to the display 22 .
- the display list is provided to the hardware renderer 16 , which prepares data relating to the polygons for display.
- the hardware renderer 16 creates a z buffer 17 and a frame buffer 18 to store data relating to each of the polygons.
- the z buffer 17 includes the z values for each pixel in the polygon.
- the frame buffer 18 includes the colors for each pixel in the polygon.
- each polygon on the display list data from the z buffer 17 and frame buffer 18 are then provided to the display controller 20 .
- the display controller 20 then outputs the data on the display 22 .
- each polygon is rendered in the order dictated by the display list. Because the polygons are rendered in the order prescribed by the display list, the conventional system 10 can correctly blend the colors of translucent objects and opaque objects that can be seen through the translucent objects to achieve the proper color for each pixel to be displayed.
- the conventional system 10 shown in FIG. 1 is capable of displaying three-dimensional objects on a two dimensional display
- the software sort required to provide the display list has several disadvantages.
- the software sort can be relatively slow if not optimized. If the software sort is optimized, the time required to perform the software sort can be reduced to a certain extent. However, development time for the software sort is significantly increased. Moreover, changes to the display list and the software sort creating the display list may be difficult or time consuming to implement.
- the fact that the hardware renderer 16 requires the data to be provided in the order of the display list limits the computer system 10 to using applications 12 which provide the translucent polygons sorted on the display list and, therefore, perform a software sort. Without having the translucent polygons properly sorted in the display list, the computer system 10 may not be able to properly depict three-dimensional objects.
- the present invention provides a method and system for providing a sort in a computer system.
- the sort is based on a plurality of values of a key.
- Each of the plurality of items has an associated value of the plurality of values.
- the method and system comprise providing a new item of the plurality of items to a plurality of sort cells.
- the new item includes a new value of the plurality of values.
- the plurality of sort cells is for sorting the plurality of items.
- Each sort cell is for sorting a corresponding item of the plurality of items.
- the corresponding item has a corresponding value of the plurality of values.
- the method and system further comprise comparing the new value to the corresponding value for each of the plurality of sort cells to determine whether to retain the corresponding item.
- Each of the plurality of sort cells retains the corresponding item if the corresponding item is to be retained. For each of the plurality of sort cells, the method and system determine whether to accept the new item or an item corresponding to the previous sort cell if the corresponding item is not to be retained. If the corresponding item is not to be retained, the method and system allow a sort cell to accept the new item or the item corresponding to the previous sort cell.
- the present invention will be described in terms of a computer graphics system which sorts fragments using a specified number of sort cells. However, one of ordinary skill in the art will readily recognize that this method and system will operate effectively for other computer systems which sorts other items and for another number of sort cells.
- FIG. 2 depicting a computer graphics system 50 in which the present invention could be implemented.
- the computer system 50 is described more completely in co-pending U.S. patent application Ser. No. 08/624,261 entitled “Method and Apparatus for Identifying and Eliminating Three-Dimensional Objects Visually Obstructed from a Planar Surface”.
- the computer graphics system 50 includes a central processing unit (CPU) 52 , a display 54 , a user interface 56 such as a keyboard or mouse or other communicating device, a memory 55 , and an image generating unit 60 coupled with a bus 58 . Note, however, that nothing prevents the method and system from being implemented in a different computer system having other components.
- the image generating unit includes an interface 61 connected to the bus 58 .
- the interface 61 transmits data to a data processing unit 62 .
- a processor block 65 is coupled with the data processing unit 62 .
- the processor block 65 identifies data describing polygons (“intersecting polygons”) which intersect a z axis extending from a selected pixel in an x-y plane corresponding to a screen of the display 54 .
- the processor block 65 includes a processor for each polygon that may intersect the z axis extending from the selected pixel.
- the data associated with an intersecting polygon is termed a fragment.
- data relating to each selected pixel includes fragments for each of the intersecting polygons.
- a quick z unit 66 receives the fragments from each intersecting polygon associated with the selected pixel and removes fragments for certain polygons which are obstructed without determining the precise z value of the polygon.
- the quick z 66 is described more completely in co-pending U.S. patent application Ser. No. 08/624,261 entitled “Method and Apparatus for Identifying and Eliminating Three-Dimensional Objects Visually Obstructed from a Planar Surface”.
- the interpolator 68 receives the fragments for the polygons intersecting the particular pixel and interpolates the data, including interpolating texture, color, and alpha values for the fragment.
- the interpolator 68 provides the fragments for each of the intersecting polygons to a hardware sorter 100 constructed in accordance with the present invention.
- the hardware sorter 100 sorts the fragments for the intersecting polygons based on the value of a key associated with the fragment.
- the key is the z value for the fragment at the selected pixel.
- FIG. 3 depicting one embodiment of the hardware sorter 100 .
- the hardware sorter 100 is described in conjunction with the computer graphics system 50 , nothing prevents the use of the hardware sorter 100 in another computer system.
- the hardware sorter 100 will be described as sorting based on a particular key (the z value) associated with a particular item (the fragment for an intersecting polygon for a selected pixel).
- the hardware sorter 100 is applicable to other systems requiring a sort, such as a router in a network.
- the hardware sorter 100 includes a plurality of sort cells 110 . Note that although only four sort cells 110 are depicted, nothing prevents the hardware sorter 100 from having another number of sort cells 110 .
- the number of sort cells 110 is at least equal to the number of items to be sorted. Thus, in a preferred embodiment, the number of sort cells 110 is the same as the number of processors in the processor block 65 . Also in a preferred embodiment, the number of sort cells is sixteen. However, nothing prevents the use of another number of sort cells 110 . Similarly, nothing prevents the number of sort cells 110 from being different from the number of processors in the processor block 65 .
- Alternate embodiments of the present invention can also be used where overflow may occur. Overflow occurs where there are more items to sort than there are sort cells.
- the alternate embodiments used for overflow cases may depend on the application for which the hardware sorter 100 is used. For example, where the embodiment is used in a computer graphics system subject to overflow, fragments which are determined to be “solid” may be passed through the hardware sorter 100 . In such a case, the hardware sorter 100 will only sort non-solid fragments. The solid fragments may be sorted in a different portion of the image generating unit 60 . Note that in such an embodiment, “non-solid” may apply to partial fragments such as those generated by anti-aliasing. Moreover, whether a fragment is solid or non-solid need not be based solely on a fragment's alpha value.
- the hardware sorter 100 further includes a new input line 102 for providing a new fragment in parallel to each of the sort cells 110 via new input 120 .
- Each sort cell 110 also includes an output 130 .
- the output 130 of a sort cell 130 is coupled to an input of a next sort cell 110 .
- the output 130 of the last sort cell 110 is not coupled to another sort cell 110 . Instead, the output 130 of the last sort cell 110 provides the output of the hardware sorter 100 .
- each sort cell could have another number of new input lines 102 , another number of outputs 130 , and/or another number of inputs. In such a system each sort cell 110 could sort another number of fragments.
- Each sort cell 110 may have a fragment which corresponds to it (“corresponding fragment”).
- Each corresponding fragment includes a corresponding z value, which is used to sort the fragment, and corresponding data, such as color and alpha values for the corresponding fragment.
- a new fragment, including the new z value is broadcast to each of the plurality of sort cells 110 , via step 152 . Note that in a preferred embodiment, if the new fragment is the first fragment for a pixel, the first fragment is also placed in the first sort cell 110 .
- the new fragment is a first fragment for a pixel when the hardware sorter 100 is empty
- the first fragment is placed in the first sort cell 110 .
- this is accomplished by indicating that data in other sort cells 110 is invalid.
- nothing prevents the present invention from using another method for placing the first fragment in the first sort cell 110 when the hardware sorter 100 is empty.
- Steps 154 through 164 are performed for each sort cell 110 in the hardware sorter 100 that takes part in the sort.
- the new z value for the new fragment is compared to the corresponding z value via step 154 . Based on this comparison, each sort cell 110 retains the corresponding fragment, accepts the new fragment, or accepts the fragment corresponding to a previous sort cell 110 . Thus, it is determined whether the sort cell 110 will retain the corresponding fragment, including the corresponding z value, via step 156 . If the corresponding fragment is to be retained, then the sort cell 110 keeps the corresponding fragment via step 158 . If the corresponding fragment is not to be retained, then in step 160 it is determined whether the sort cell 110 is to take the fragment corresponding to a previous sort cell 110 .
- the sort cell 110 takes the fragment corresponding to the previous cell and passes its corresponding fragment to be accepted by the next sort cell 110 via step 162 . If the fragment is not to be taken by the sort cell 110 , the sort cell 110 takes the new fragment and passes its corresponding fragment to be accepted by the next cell in step 164 . As a result, the new fragment is inserted into the hardware sorter 100 in the appropriate sort cell 110 . This process continues to sort all of the fragments provided to the hardware sorter.
- the sort cell 110 is coupled to a new input 120 .
- the new input 120 includes a new data input 122 , a new key input 124 , and a new identification input 126 .
- the sort cell 110 includes an input 140 and an output 130 .
- the input 140 includes a control signal input 141 , a previous key input 142 , and a previous data input 143 .
- the output 130 includes a control signal output 132 , a key output 134 , and a data output 136 .
- the sort cell 110 also includes an OR gate 113 which combines the control signal input with a control signal provided by the controller 115 to be output on the control signal output 132 .
- control signal output 132 is coupled to the control signal input 141 of a next sort cell.
- the key output 134 is coupled to the key input 142 of the next sort cell.
- the data output 136 is coupled to the data input 143 of the next sort cell. Consequently, to pass a corresponding fragment to the next sort cell 110 , the corresponding key and data are provided over the key output 134 and the data output 136 .
- the sort cell 110 further includes a comparator 114 and a controller 115 coupled with the comparator 114 .
- the sort cell 110 contains a key selector 116 , a key storage 117 , a data selector 118 and a data storage 119 .
- the corresponding key is stored in the key storage 117 .
- the corresponding data for the corresponding fragment is stored in the data storage 119 .
- the sort cell 110 is depicted as having key storage 117 and data storage 119 internal to the sort cell 110 , nothing prevents the method and system from storing the key and/or the data in a location remote from the sort cell 110 , such as in a random access memory.
- the key selector 116 and data selector 118 are controlled by a controller 115 .
- the controller 115 can also provide a “take data” signal which is ORed with a previous cell's “take data” signal by the OR gate 113 . This combination signal is provided to the control signal output 132 .
- the current sort cell 110 also asserts a “take data” signal over the control signal output 132 .
- the next sort cell 110 will accept the corresponding fragment previously stored in the sort cell 110 .
- the key selector 116 and data selector 118 are multiplexers.
- the key selector 116 selects between the new key, a key corresponding to a previous cell input through previous key input 142 , and a new key input from new key input 122 .
- the data selector selects between the new data provided by the new data input 124 , data corresponding to a previous sort cell 110 that is provided through previous data input 143 , and the corresponding data.
- fragments for pixels in a scan line are provided one after another to the hardware sorter 100 .
- the hardware sorter 100 should be capable of sorting the fragments for one pixel without affecting the order of the fragments for another pixel. This capability can be provided using the controller 115 and a pixel identification. Consequently, in a preferred embodiment, each fragment for a pixel includes a pixel identification. The new identification is provided to the sort cell 110 through the new identification input 126 .
- the pixel identification is provided by a counter, not shown.
- each fragment has a fragment type associated with it.
- An N fragment is simply an nth fragment in the pixel. This could be any fragment for the pixel except for the last fragment.
- An L fragment is a last fragment for a particular pixel.
- An E (empty) fragment indicates that there are no intersecting polygons for the pixel.
- An EOL fragment indicates that the hardware sorter 100 should be flushed, for example due to an end of line or end of frame.
- the identification merely allows the hardware sorter 100 to distinguish between different pixels having fragments in the hardware sorter 100 at the same time. Because there are N sort cells 110 in the hardware sorter 100 , there can be at most fragments for N different pixels in the hardware sorter 100 . Consequently, the identification may represent up to only N different values to ensure that each fragment in the hardware sorter 100 can be associated with a unique pixel. For example, for a hardware sorter 100 having four sort cells 110 , an identification having only two bits (four different values) can be used. The counter can run, reusing values for pixels which cannot both have fragments in the hardware sorter 100 at the same time.
- FIG. 6 depicts a method 200 for providing a hardware sort using the identification in accordance with the present invention.
- a new fragment is provided to all of the sort cells 110 through the new input line 102 and new input 120 .
- the new fragment includes the new z value, new data and new identification.
- the new z value for the fragment is provided to each sort cell 110 via the new key input 124 .
- the new data is provided via the new data input 122 .
- the new identification is provided through new identification input 126 . If the new fragment is the first fragment for a pixel, then the new fragment is automatically input to the first sort cell 110 .
- step 204 it is determined if the new identification is the same as the corresponding identification. In a preferred embodiment, step 204 is performed by the controller 115 . Depending on whether the new identification is the same as the corresponding identification, the sort cell 110 behaves differently.
- the comparator 114 is used to compare the new z value to the corresponding z value, via step 214 . In one embodiment, this comparison determines whether the corresponding z value is greater than the new z value. In the embodiment depicted in FIG. 4, the results of the comparison are provided to the controller 115 . However, nothing prevents the resultant of the comparator 114 from being used directly to control the key selector 116 , the data selector 118 , or generate a signal over control signal output 132 .
- the sort cell 110 When the resultant of the comparator 114 indicates that the corresponding z value is greater than the new z value, the sort cell 110 will not retain its state. Consequently, the “take data” signal is asserted via step 218 . In a preferred embodiment, the “take data” signal is simply the resultant of the comparator 114 indicating that the corresponding z value is greater than the new z value. To determine what the sort cell 110 will do, the controller determines whether the “take data” signal from a previous sort cell has been asserted via step 220 .
- the sort cell 110 When the corresponding fragment (z value and data) is not to be retained, the sort cell 110 must determine whether to accept the new key and data provided over lines 124 and 122 , respectively, or to accept the z value and data from a previous cell provided via previous key input 142 and previous data input 143 . Consequently, the controller 115 determines whether the “take data” signal from a previous cell has been asserted over the control signal input 141 via step 220 . If the “take data” signal is not asserted, then the sort cell 110 accepts the new fragment via step 222 .
- the controller 115 allows the sort cell 110 to accept the new data. To do so, the controller provides the selectors 116 and 118 with a signal indicating that the values from the new key input 124 and the new data input 122 are to chosen. The new z value and new data are then stored in the key storage 117 and data storage 118 , respectively.
- step 224 the sort cell 110 accepts the fragment corresponding to the previous cell. Consequently, when the resultant of the comparator 114 indicates that the corresponding z value is greater than the new z value and the “take data” signal from the previous sort cell 110 is provided via control signal input 141 , the controller 115 allows the sort cell 110 to accept the z value and data corresponding to a previous cell. To do so, the controller provides the selectors 116 and 118 with a signal indicating that the values from the previous key input 142 and the previous data input 143 to the selectors 116 and 118 are to be selected. Thus, the z value and data corresponding to the previous cell are stored in the key storage 117 and data storage 118 , respectively.
- step 206 is performed by turning off the comparator 114 for the sort cell 110 . Turning the comparator off assures that the sort cell 110 will not accept the new data, thereby preventing the new fragment from being sorted with fragments for another pixel.
- the controller 115 determines if the “take data” signal from the previous cell has been provided to the sort cell 110 via step 208 . If the “take data” signal has not been asserted, then the sort cell 110 retains the corresponding fragment via step 210 .
- the first sort cell 110 in the hardware sorter 100 a take data signal is never asserted over the control signal input 141 .
- the first sort cell 110 will only transfer its corresponding fragment to the second sort cell when its corresponding z value is less than the new z value, a fragment for a new pixel arrives, or the hardware sorter 100 is flushed.
- the z value for the fragment stored in the first sort cell 110 is the smallest for a particular pixel.
- the pixels input to the hardware sorter 100 will be output in order.
- the OR gate 113 in each sort cell 110 allows the hardware sorter 100 to accomplish this.
- a first fragment for a current pixel is input to the first sort cell 110 .
- the “take data” signal may be asserted by a sort cell 110 near the top of the hardware sorter 100 .
- each subsequent sort cell 110 will assert the “take data” signal over the control signal output 132 .
- fragments for prior pixels and fragments for the current sort cell which have a higher z value are passed down the hardware sorter 100 in order.
- an EOL fragment causes the “take data” signal to be asserted by all of the sort cells 110 .
- the hardware sorter 100 is flushed. Consequently, the system 50 is synchronized, ensuring that pixels are written at a particular time.
- the new fragment is broadcast in parallel to the sort cells 110 in a first clock cycle.
- the sort cells perform a comparison, insert the new fragment in the appropriate place, and, if necessary, move fragments which are displaced by the new fragment farther down the hardware sorter 100 . Consequently, each new fragment is sorted in a single cycle in a preferred embodiment.
- the number of sort cells is based on the order of the number of fragments to be sorted. As a result, the number of cycles between providing a pixel to the first cell of the hardware sorter 100 and providing the sorted pixel to the output of the last sort cell 110 is substantially the same as the number of sort cells 110 .
- this time is at least as good as the time achieved by an optimized software sort.
- latency may be a delay between the first pixel being input to the hardware sorter 100 and the first pixel being output by the hardware sorter 100 (“latency”), the sort for each pixel is performed in a single clock cycle. Therefore, a sort performed in accordance with the present invention is typically faster than an optimized software sort.
- FIG. 5 depicts each sort cell 110 as having an internal controller 115
- the controller 115 for each sort cell is combined to a single controller outside of the sort cells.
- FIG. 7 depicts a preferred embodiment of a hardware sorter 300 in accordance with the present invention. Note that although the hardware sorter 300 will be described in conjunction with the computer graphics system 50 , nothing prevents the use of the hardware sorter 300 in another computer system. Thus, the hardware sorter 300 will be described as sorting based on a particular key (the z value) associated with particular data (the fragments for a pixel including color and alpha values) nothing prevents the hardware sorter 300 from sorting based on another key or accepting other types of data. Thus, the hardware sorter 300 is applicable to other systems requiring a sort, such as a router in a network.
- the hardware sorter 300 further includes a new input line 320 for providing a new fragment in parallel to each of the sort cells 310 via new input 320 .
- Each sort cell 310 also includes an output 330 .
- the output 330 of a sort cell 130 is coupled to an input of a next sort cell 310 .
- the output 330 of the last sort cell 310 is not coupled to another sort cell 310 . Instead, the output 330 of the last sort cell 310 provides the output of the hardware sorter 300 .
- the hardware sorter 300 also includes a controller 350 which controls the sort cells 310 through control lines 360 .
- the sort cell 310 is coupled to a new input 320 .
- the sort cell 310 includes a control line 360 , an output 330 , and an input 340 .
- the new input 320 includes new data input 322 and new key input 324 .
- the input 340 includes previous key input 312 and previous data input 313 .
- the output 330 includes corresponding key output 334 and corresponding data output 336 .
- the control line 360 includes control signal output 362 and control signal input 364 .
- the sort cell 310 also includes a key selector 316 , key storage 317 , data selector 318 , and data storage 319 . In one embodiment, the key storage 317 and data storage 319 exist outside of the sort cell 310 .
- the sort cell 310 and hardware sorter 300 function similarly to the sort cell 110 and hardware sorter 100 , respectively.
- the primary difference is that the hardware sorter 300 includes a single controller 350 separate from the sort cells 300 .
- the controller 350 takes on the functions of the controllers 115 for all of the sort cells 110 in the hardware sorter 100 .
- each sort cell 310 includes an input 364 for the signals used to control the key selector 116 and the data selector 118 .
- the sort cell 310 also includes an output 362 to provide the resultant from the comparator 314 to the controller 350 . Because the controller 350 controls all of the sort cells 310 , in a preferred embodiment no control signal is passed between the sort cells 310 . However, the controller 350 controls the sort cells 310 to provide the same functions as provided by the hardware sorter 100 .
- the hardware sorter 100 and the hardware sorter 300 include a number of sort cells on which is at least the same as the number of items to be sorted. However, nothing prevents fewer sort cells from being used. This is particularly true if an appropriate sort cell 110 or 310 were provided with a heuristic in order to choose which item to discard in the event that the number of items to be sorted is greater than the number of sort cells 110 or 310 .
- the corresponding fragment for the last sort cell 110 or 310 is the fragment farthest from the viewer.
- the new fragment has a z value near that of the fragment corresponding to the last sort cell 110 or 310 .
- a heuristic included in the last sort cell 110 or 310 could take the z value and other information into account to determine how to respond to the new fragment, for example by discarding one of the fragments. Consequently, although a preferred embodiment includes at least as many sort cells as items expected to be sorted, nothing prevents the use of fewer sort cells.
- a method and system has been disclosed for providing a hardware sort. Because the new item (fragment) to be sorted can be broadcast to all sort cells in parallel and because each sort cell can simultaneously perform functions, the system and method provide an efficient sort. In addition, each sort cell can be the same as other sort cells. When the number of items sorted or size of the hardware sorter are desired to be changed, sort cells be easily added or subtracted from the hardware sorter. Consequently, the time required to develop the method and system is reduced. In addition, because each sort cell can be made the same, the hardware sorter is a regular array. Consequently, the hardware sorter is relatively simple to lay out once the layout of a single cell is determined.
Abstract
Description
- The present application is related to co-pending U.S. patent application Ser. No. 08/624,261 entitled “Method and Apparatus for Identifying and Eliminating three-dimensional Objects Visually Obstructed from a Planar Surface” filed on Mar. 29, 1996. The present application is also related to U.S. patent application Ser. No. 08/624,260 entitled “Graphics Processors, System and Method for Generating Screen Pixels in Raster Order Utilizing a Single Interpolator” filed on Mar. 29, 1996.
- The present invention relates to computer systems, and more particularly to a method and system for providing a hardware sort which is simple to design, simple to use, fast, and applicable to computer graphics system.
- Many computer systems must sort items based on the value of a key in order to achieve certain functions. Such computer systems conventionally employ a software sort. For example, computer graphics systems may utilize a software sort in order to render an image. In current computer graphics systems, images of three-dimensional objects can be depicted on a two dimensional display. In order to give the illusion of depth, computer graphics systems use each objects “z value,” the distance of each object to the viewing plane. In particular, the objects are ordered based on each object's z value. Thus, the key for such a sort is the z value. Once the objects are sorted according to their z values, the computer graphics system can correctly blend the colors of translucent objects and opaque objects that can be seen through the translucent objects to achieve the proper color to be displayed for each pixel.
- In a conventional computer graphics system, the software sort occurs when a display list is generated through an application. The display list orders three-dimensional objects based on a key, typically the z value. The display list typically orders translucent object from back to front. Thus, the display list sorts translucent objects. Although they may appear on the display list, opaque objects are typically sorted using a conventional Z buffer.
- Placing the objects in the order prescribed by the display list allows the computer system to properly depict the images of the three-dimensional objects on the display. Hardware in the computer graphics system utilizes the display list, a frame buffer, and a z buffer to render the three-dimensional objects in the order dictated by the display list. The frame buffer and z buffer describe a portion of a three-dimensional object that is to be rendered. The frame buffer includes data such as color and alpha values for the portion of the object, while the z buffer includes corresponding the z values. The conventional computer graphics system provides the objects described in the frame and z buffers to the display screen in the order prescribed by the display list. Consequently, solid objects are rendered first, then translucent objects are rendered from back to front. Thus, the display list generated by software is used to render the three-dimensional objects.
- Although conventional computer graphics systems are capable of depicting three-dimensional objects, the software sort required to provide the display list can be relatively slow. If the software sort is optimized, the sort time can be reduced to a limited extent. However, development time for the software sort is significantly increased. Moreover, changes to the display list and the software sort creating the display list may be difficult to implement. Finally, since the hardware requires a display list in order to properly render the objects, the computer system is limited to using those applications which provide a sorted display list. Without the display list and the attendant software sort, the computer system may not be able to properly depict three-dimensional objects.
- Accordingly, what is needed is a system and method for sorting items which does not require a sort performed by software. It would also be beneficial if the system and method could be implemented in a computer graphics system for providing a two dimensional image of three-dimensional objects. The present invention addresses such a need.
- The present invention provides a method and system for providing a sort in a computer system. The sort is based on a plurality of values of a key. Each of the plurality of items has an associated value of the plurality of values. The method and system comprise providing a new item of the plurality of items to a plurality of sort cells. The new item includes a new value of the plurality of values. The plurality of sort cells is for sorting the plurality of items. Each sort cell is for sorting a corresponding item of the plurality of items. The corresponding item has a corresponding value of the plurality of values. The method and system further comprise comparing the new value to the corresponding value for each of the plurality of sort cells to determined whether to retain the corresponding item. Each of the plurality of sort cells retains the corresponding item if the corresponding item is to be retained. For each of the plurality of sort cells, the method and system determine whether to accept the new item or an item corresponding to the previous sort cell if the corresponding item is not to be retained. If the corresponding item is not to be retained, the method and system allow a sort cell to accept the new item or the item corresponding to the previous sort cell.
- According to the system and method disclosed herein, the present invention provides a hardware sort which is simple to implement and modify, fast, and applicable to computer graphics systems.
- FIG. 1 is a block diagram of a conventional system for depicting three-dimensional objects on a two dimensional display.
- FIG. 2 is a block diagram depicting a computer graphics system utilizing the system and method in accordance with the present invention.
- FIG. 3 is a block diagram of one embodiment of a system in accordance with the present invention.
- FIG. 4 is a flow chart of a method for providing a sort in accordance with the present invention.
- FIG. 5 is a block diagram depicting one embodiment of a sort cell in accordance with the present invention.
- FIG. 6 is a detailed flow chart of a method for providing a sort in accordance with the present invention.
- FIG. 7 is a block diagram of a preferred embodiment of a system in accordance with the present invention.
- FIG. 8 is a block diagram depicting a preferred embodiment of a sort cell in accordance with the present invention.
- The present invention relates to an improvement in computer systems which sort items based on a key. The following description is presented to enable one of ordinary skill in the art to make and use the invention and is provided in the context of a patent application and its requirements. Various modifications to the preferred embodiment will be readily apparent to those skilled in the art and the generic principles herein may be applied to other embodiments. Thus, the present invention is not intended to be limited to the embodiment shown but is to be accorded the widest scope consistent with the principles and features described herein.
- Many conventional systems achieve a particular desired result by sorting items based on the value of a key associated with the items. For example, computer graphics systems which depict images of three-dimensional objects on a two dimensional display use a software sort to create the illusion of depth. The key that is used for this software sort is typically an object's “z value”, or distance from the viewing plane at a particular pixel.
- FIG. 1 depicts a block diagram of a
conventional system 10 for providing a two dimensional display of three-dimensional objects. Typically, the three-dimensional objects are broken into polygons, such as triangles, for display. Consequently, rendering a three dimensional object will be discussed in the context of rendering polygons. Asoftware application 12 is used to display the polygons. Theapplication 12 callsdrivers 14 which create a display list. - The display list contains the x, y, and z coordinates, alpha or blending value, color, and other information for each polygon. The display list also lists the information relating to each polygon in the order in which the polygons will be rendered to the
display 22. The display list typically places polygons which are part of opaque or solid objects first on the display list. These opaque objects are typically sorted by a z-buffer 17, described below. The polygons for translucent objects are generally next on the display list. The translucent polygons are ordered from back to front, or highest to lowest z value, on the display list. The ordering of the polygons allows the computer system to properly depict the images of the three-dimensional objects on the display. Thedrivers 14 sort the translucent polygons based on the z value of each polygon in order to create the display list. Note that in general, a polygon may contain a range of z values. Consequently, the sort provided by the display list may actually be more complex to take into account the range of z values. Thus, in the conventionalcomputer graphics system 10, the translucent polygons are sorted by software to determine the order in which the objects will be rendered to the display. - Once the polygons are properly ordered in the display list, a
hardware renderer 16 can begin the process of rendering the polygons to thedisplay 22. The display list is provided to thehardware renderer 16, which prepares data relating to the polygons for display. Thehardware renderer 16 createsa z buffer 17 and aframe buffer 18 to store data relating to each of the polygons. Thez buffer 17 includes the z values for each pixel in the polygon. Theframe buffer 18 includes the colors for each pixel in the polygon. - For each polygon on the display list, data from the
z buffer 17 andframe buffer 18 are then provided to thedisplay controller 20. Thedisplay controller 20 then outputs the data on thedisplay 22. Thus, each polygon is rendered in the order dictated by the display list. Because the polygons are rendered in the order prescribed by the display list, theconventional system 10 can correctly blend the colors of translucent objects and opaque objects that can be seen through the translucent objects to achieve the proper color for each pixel to be displayed. - Although the
conventional system 10 shown in FIG. 1 is capable of displaying three-dimensional objects on a two dimensional display, those with ordinary skill in the art will realize that the software sort required to provide the display list has several disadvantages. The software sort can be relatively slow if not optimized. If the software sort is optimized, the time required to perform the software sort can be reduced to a certain extent. However, development time for the software sort is significantly increased. Moreover, changes to the display list and the software sort creating the display list may be difficult or time consuming to implement. Finally, the fact that thehardware renderer 16 requires the data to be provided in the order of the display list limits thecomputer system 10 to usingapplications 12 which provide the translucent polygons sorted on the display list and, therefore, perform a software sort. Without having the translucent polygons properly sorted in the display list, thecomputer system 10 may not be able to properly depict three-dimensional objects. - The present invention provides a method and system for providing a sort in a computer system. The sort is based on a plurality of values of a key. Each of the plurality of items has an associated value of the plurality of values. The method and system comprise providing a new item of the plurality of items to a plurality of sort cells. The new item includes a new value of the plurality of values. The plurality of sort cells is for sorting the plurality of items. Each sort cell is for sorting a corresponding item of the plurality of items. The corresponding item has a corresponding value of the plurality of values. The method and system further comprise comparing the new value to the corresponding value for each of the plurality of sort cells to determine whether to retain the corresponding item. Each of the plurality of sort cells retains the corresponding item if the corresponding item is to be retained. For each of the plurality of sort cells, the method and system determine whether to accept the new item or an item corresponding to the previous sort cell if the corresponding item is not to be retained. If the corresponding item is not to be retained, the method and system allow a sort cell to accept the new item or the item corresponding to the previous sort cell.
- The present invention will be described in terms of a computer graphics system which sorts fragments using a specified number of sort cells. However, one of ordinary skill in the art will readily recognize that this method and system will operate effectively for other computer systems which sorts other items and for another number of sort cells.
- To more particularly illustrate the method and system in accordance with the present invention, refer now to FIG. 2 depicting a
computer graphics system 50 in which the present invention could be implemented. Thecomputer system 50 is described more completely in co-pending U.S. patent application Ser. No. 08/624,261 entitled “Method and Apparatus for Identifying and Eliminating Three-Dimensional Objects Visually Obstructed from a Planar Surface”. Thecomputer graphics system 50 includes a central processing unit (CPU) 52, adisplay 54, auser interface 56 such as a keyboard or mouse or other communicating device, amemory 55, and animage generating unit 60 coupled with abus 58. Note, however, that nothing prevents the method and system from being implemented in a different computer system having other components. - The image generating unit includes an
interface 61 connected to thebus 58. Theinterface 61 transmits data to adata processing unit 62. Aprocessor block 65 is coupled with thedata processing unit 62. Theprocessor block 65 identifies data describing polygons (“intersecting polygons”) which intersect a z axis extending from a selected pixel in an x-y plane corresponding to a screen of thedisplay 54. In a preferred embodiment, theprocessor block 65 includes a processor for each polygon that may intersect the z axis extending from the selected pixel. The data associated with an intersecting polygon is termed a fragment. Thus, data relating to each selected pixel includes fragments for each of the intersecting polygons. - A
quick z unit 66 receives the fragments from each intersecting polygon associated with the selected pixel and removes fragments for certain polygons which are obstructed without determining the precise z value of the polygon. Thequick z 66 is described more completely in co-pending U.S. patent application Ser. No. 08/624,261 entitled “Method and Apparatus for Identifying and Eliminating Three-Dimensional Objects Visually Obstructed from a Planar Surface”. Theinterpolator 68 receives the fragments for the polygons intersecting the particular pixel and interpolates the data, including interpolating texture, color, and alpha values for the fragment. Theinterpolator 68 provides the fragments for each of the intersecting polygons to ahardware sorter 100 constructed in accordance with the present invention. Thehardware sorter 100 sorts the fragments for the intersecting polygons based on the value of a key associated with the fragment. In a preferred embodiment, the key is the z value for the fragment at the selected pixel. - To more particularly illustrate the
hardware sorter 100 in accordance with the present invention, refer now to FIG. 3 depicting one embodiment of thehardware sorter 100. Note that although thehardware sorter 100 is described in conjunction with thecomputer graphics system 50, nothing prevents the use of thehardware sorter 100 in another computer system. Thus, thehardware sorter 100 will be described as sorting based on a particular key (the z value) associated with a particular item (the fragment for an intersecting polygon for a selected pixel). However, nothing prevents thehardware sorter 100 from sorting based on another key or accepting other types of data. Thus, thehardware sorter 100 is applicable to other systems requiring a sort, such as a router in a network. - The
hardware sorter 100 includes a plurality ofsort cells 110. Note that although only foursort cells 110 are depicted, nothing prevents thehardware sorter 100 from having another number ofsort cells 110. In a preferred embodiment, the number ofsort cells 110 is at least equal to the number of items to be sorted. Thus, in a preferred embodiment, the number ofsort cells 110 is the same as the number of processors in theprocessor block 65. Also in a preferred embodiment, the number of sort cells is sixteen. However, nothing prevents the use of another number ofsort cells 110. Similarly, nothing prevents the number ofsort cells 110 from being different from the number of processors in theprocessor block 65. - Alternate embodiments of the present invention can also be used where overflow may occur. Overflow occurs where there are more items to sort than there are sort cells. The alternate embodiments used for overflow cases may depend on the application for which the
hardware sorter 100 is used. For example, where the embodiment is used in a computer graphics system subject to overflow, fragments which are determined to be “solid” may be passed through thehardware sorter 100. In such a case, thehardware sorter 100 will only sort non-solid fragments. The solid fragments may be sorted in a different portion of theimage generating unit 60. Note that in such an embodiment, “non-solid” may apply to partial fragments such as those generated by anti-aliasing. Moreover, whether a fragment is solid or non-solid need not be based solely on a fragment's alpha value. - The
hardware sorter 100 further includes anew input line 102 for providing a new fragment in parallel to each of thesort cells 110 vianew input 120. Eachsort cell 110 also includes anoutput 130. Theoutput 130 of asort cell 130 is coupled to an input of anext sort cell 110. Theoutput 130 of thelast sort cell 110 is not coupled to anothersort cell 110. Instead, theoutput 130 of thelast sort cell 110 provides the output of thehardware sorter 100. Although not depicted in FIG. 3, in an alternate embodiment, each sort cell could have another number ofnew input lines 102, another number ofoutputs 130, and/or another number of inputs. In such a system eachsort cell 110 could sort another number of fragments. - Refer now to FIG. 4 depicting a
method 150 in accordance with the present invention which uses thehardware sorter 100. Eachsort cell 110 may have a fragment which corresponds to it (“corresponding fragment”). Each corresponding fragment includes a corresponding z value, which is used to sort the fragment, and corresponding data, such as color and alpha values for the corresponding fragment. A new fragment, including the new z value, is broadcast to each of the plurality ofsort cells 110, viastep 152. Note that in a preferred embodiment, if the new fragment is the first fragment for a pixel, the first fragment is also placed in thefirst sort cell 110. Where the new fragment is a first fragment for a pixel when thehardware sorter 100 is empty, the first fragment is placed in thefirst sort cell 110. Preferably, this is accomplished by indicating that data inother sort cells 110 is invalid. However, nothing prevents the present invention from using another method for placing the first fragment in thefirst sort cell 110 when thehardware sorter 100 is empty. -
Steps 154 through 164 are performed for eachsort cell 110 in thehardware sorter 100 that takes part in the sort. The new z value for the new fragment is compared to the corresponding z value viastep 154. Based on this comparison, eachsort cell 110 retains the corresponding fragment, accepts the new fragment, or accepts the fragment corresponding to aprevious sort cell 110. Thus, it is determined whether thesort cell 110 will retain the corresponding fragment, including the corresponding z value, via step 156. If the corresponding fragment is to be retained, then thesort cell 110 keeps the corresponding fragment viastep 158. If the corresponding fragment is not to be retained, then instep 160 it is determined whether thesort cell 110 is to take the fragment corresponding to aprevious sort cell 110. If thesort cell 110 is to accept this fragment, thesort cell 110 takes the fragment corresponding to the previous cell and passes its corresponding fragment to be accepted by thenext sort cell 110 viastep 162. If the fragment is not to be taken by thesort cell 110, thesort cell 110 takes the new fragment and passes its corresponding fragment to be accepted by the next cell instep 164. As a result, the new fragment is inserted into thehardware sorter 100 in theappropriate sort cell 110. This process continues to sort all of the fragments provided to the hardware sorter. - Refer now to FIG. 5 depicting one embodiment of a
sort cell 110 in accordance with the present invention. Thesort cell 110 is coupled to anew input 120. Thenew input 120 includes anew data input 122, a newkey input 124, and anew identification input 126. Thesort cell 110 includes aninput 140 and anoutput 130. Theinput 140 includes acontrol signal input 141, a previouskey input 142, and aprevious data input 143. Theoutput 130 includes acontrol signal output 132, akey output 134, and adata output 136. Thesort cell 110 also includes an ORgate 113 which combines the control signal input with a control signal provided by thecontroller 115 to be output on thecontrol signal output 132. In a preferred embodiment, thecontrol signal output 132 is coupled to thecontrol signal input 141 of a next sort cell. Thekey output 134 is coupled to thekey input 142 of the next sort cell. Also in a preferred embodiment, thedata output 136 is coupled to thedata input 143 of the next sort cell. Consequently, to pass a corresponding fragment to thenext sort cell 110, the corresponding key and data are provided over thekey output 134 and thedata output 136. - The
sort cell 110 further includes acomparator 114 and acontroller 115 coupled with thecomparator 114. In addition, thesort cell 110 contains akey selector 116, akey storage 117, adata selector 118 and adata storage 119. The corresponding key is stored in thekey storage 117. The corresponding data for the corresponding fragment is stored in thedata storage 119. Note that although thesort cell 110 is depicted as havingkey storage 117 anddata storage 119 internal to thesort cell 110, nothing prevents the method and system from storing the key and/or the data in a location remote from thesort cell 110, such as in a random access memory. Thekey selector 116 anddata selector 118 are controlled by acontroller 115. Thecontroller 115 can also provide a “take data” signal which is ORed with a previous cell's “take data” signal by theOR gate 113. This combination signal is provided to thecontrol signal output 132. Thus, when either aprevious sort cell 110 or thecurrent sort cell 110 provides a “take data” signal, thecurrent sort cell 110 also asserts a “take data” signal over thecontrol signal output 132. When a “take data” signal is asserted overcontrol signal output 132, thenext sort cell 110 will accept the corresponding fragment previously stored in thesort cell 110. - In one embodiment, the
key selector 116 anddata selector 118 are multiplexers. Thekey selector 116 selects between the new key, a key corresponding to a previous cell input through previouskey input 142, and a new key input from newkey input 122. Similarly, the data selector selects between the new data provided by thenew data input 124, data corresponding to aprevious sort cell 110 that is provided throughprevious data input 143, and the corresponding data. - In a preferred embodiment, fragments for pixels in a scan line are provided one after another to the
hardware sorter 100. As a result, thehardware sorter 100 should be capable of sorting the fragments for one pixel without affecting the order of the fragments for another pixel. This capability can be provided using thecontroller 115 and a pixel identification. Consequently, in a preferred embodiment, each fragment for a pixel includes a pixel identification. The new identification is provided to thesort cell 110 through thenew identification input 126. - In a preferred embodiment, the pixel identification is provided by a counter, not shown. Also in a preferred embodiment, each fragment has a fragment type associated with it. Preferably, there are four fragment types, N, L, E and EOL. An N fragment is simply an nth fragment in the pixel. This could be any fragment for the pixel except for the last fragment. An L fragment is a last fragment for a particular pixel. An E (empty) fragment indicates that there are no intersecting polygons for the pixel. An EOL fragment indicates that the
hardware sorter 100 should be flushed, for example due to an end of line or end of frame. - In the preferred embodiment the fragment types are transformed to an identification by the counter, not shown. The counter provides a unique number for a set of fragments corresponding to a particular pixel. The counter does so by incrementing after every L or E fragment. Consequently, all fragments for the first pixel have an identification of one. All fragments for the second pixel have an identification of two. The identification for each pixel may be incremented until an EOL fragment which flushes the
hardware sorter 100 is reached. This identification is provided to each of thesort cells 110 along with the fragment. Consequently, in a preferred embodiment, a corresponding fragment for aparticular sort cell 110 includes a corresponding identification in addition to the corresponding z value and the corresponding data. - Note, however, the identification merely allows the
hardware sorter 100 to distinguish between different pixels having fragments in thehardware sorter 100 at the same time. Because there areN sort cells 110 in thehardware sorter 100, there can be at most fragments for N different pixels in thehardware sorter 100. Consequently, the identification may represent up to only N different values to ensure that each fragment in thehardware sorter 100 can be associated with a unique pixel. For example, for ahardware sorter 100 having foursort cells 110, an identification having only two bits (four different values) can be used. The counter can run, reusing values for pixels which cannot both have fragments in thehardware sorter 100 at the same time. - To more particularly describe the operation of the
hardware sorter 100, refer to FIGS. 3, 5, and 6. FIG. 6 depicts a method 200 for providing a hardware sort using the identification in accordance with the present invention. Instep 202, a new fragment is provided to all of thesort cells 110 through thenew input line 102 andnew input 120. The new fragment includes the new z value, new data and new identification. In a preferred embodiment, the new z value for the fragment is provided to eachsort cell 110 via the newkey input 124. Similarly, the new data is provided via thenew data input 122. The new identification is provided throughnew identification input 126. If the new fragment is the first fragment for a pixel, then the new fragment is automatically input to thefirst sort cell 110. - The
steps 204 through 224 for the method 200 are performed by eachsort cells 110 that is taking part in the sort. Instep 204, it is determined if the new identification is the same as the corresponding identification. In a preferred embodiment,step 204 is performed by thecontroller 115. Depending on whether the new identification is the same as the corresponding identification, thesort cell 110 behaves differently. - If the identifications match, the
comparator 114 is used to compare the new z value to the corresponding z value, viastep 214. In one embodiment, this comparison determines whether the corresponding z value is greater than the new z value. In the embodiment depicted in FIG. 4, the results of the comparison are provided to thecontroller 115. However, nothing prevents the resultant of thecomparator 114 from being used directly to control thekey selector 116, thedata selector 118, or generate a signal overcontrol signal output 132. - If the corresponding z value is not greater than the new z value, the then the new fragment will not displace the corresponding fragment or the fragment corresponding to any
sort cell 110 located prior to thesort cell 110. Thus, if the corresponding z is not greater than the new z, thesort cell 110 retains the corresponding fragment viastep 216. In a preferred embodiment, the corresponding z value and data are retained instep 216 because thecontroller 115 signals theselectors key storage 117 anddata storage 119, respectively. - When the resultant of the
comparator 114 indicates that the corresponding z value is greater than the new z value, thesort cell 110 will not retain its state. Consequently, the “take data” signal is asserted viastep 218. In a preferred embodiment, the “take data” signal is simply the resultant of thecomparator 114 indicating that the corresponding z value is greater than the new z value. To determine what thesort cell 110 will do, the controller determines whether the “take data” signal from a previous sort cell has been asserted viastep 220. - When the corresponding fragment (z value and data) is not to be retained, the
sort cell 110 must determine whether to accept the new key and data provided overlines key input 142 andprevious data input 143. Consequently, thecontroller 115 determines whether the “take data” signal from a previous cell has been asserted over thecontrol signal input 141 viastep 220. If the “take data” signal is not asserted, then thesort cell 110 accepts the new fragment viastep 222. Consequently, when the resultant of thecomparator 114 indicates that the corresponding z value is greater than the new z value and the take data signal from the previous sort cell is not provided viacontrol signal input 141, thecontroller 115 allows thesort cell 110 to accept the new data. To do so, the controller provides theselectors key input 124 and thenew data input 122 are to chosen. The new z value and new data are then stored in thekey storage 117 anddata storage 118, respectively. - If the “take data” signal is asserted over the
control signal input 141, then via step 224 thesort cell 110 accepts the fragment corresponding to the previous cell. Consequently, when the resultant of thecomparator 114 indicates that the corresponding z value is greater than the new z value and the “take data” signal from theprevious sort cell 110 is provided viacontrol signal input 141, thecontroller 115 allows thesort cell 110 to accept the z value and data corresponding to a previous cell. To do so, the controller provides theselectors key input 142 and theprevious data input 143 to theselectors key storage 117 anddata storage 118, respectively. - If the identifications do not match, then via
step 206, it is ensured that the new fragment is not sorted by thesort cell 110. In a preferred embodiment,step 206 is performed by turning off thecomparator 114 for thesort cell 110. Turning the comparator off assures that thesort cell 110 will not accept the new data, thereby preventing the new fragment from being sorted with fragments for another pixel. Thecontroller 115 then determines if the “take data” signal from the previous cell has been provided to thesort cell 110 viastep 208. If the “take data” signal has not been asserted, then thesort cell 110 retains the corresponding fragment viastep 210. In a preferred embodiment, the controller accomplishes this by controlling theselectors key storage 117 anddata storage 119, respectively. If the “take data” signal has been asserted, then viastep 212, thesort cell 110 accepts the fragment from theprevious sort cell 110 and, due to theOR gate 113, asserts the “take data” signal over thecontrol signal output 132. - Note that for the
first sort cell 110 in thehardware sorter 100, a take data signal is never asserted over thecontrol signal input 141. As a result, thefirst sort cell 110 will only transfer its corresponding fragment to the second sort cell when its corresponding z value is less than the new z value, a fragment for a new pixel arrives, or thehardware sorter 100 is flushed. Thus, the z value for the fragment stored in thefirst sort cell 110 is the smallest for a particular pixel. - In a preferred embodiment, the pixels input to the
hardware sorter 100 will be output in order. The ORgate 113 in eachsort cell 110 allows thehardware sorter 100 to accomplish this. A first fragment for a current pixel is input to thefirst sort cell 110. As subsequent fragments for the current pixel are sorted by thehardware sorter 100, the “take data” signal may be asserted by asort cell 110 near the top of thehardware sorter 100. Because of theOR gate 113, eachsubsequent sort cell 110 will assert the “take data” signal over thecontrol signal output 132. As a result, fragments for prior pixels and fragments for the current sort cell which have a higher z value are passed down thehardware sorter 100 in order. Eventually, the fragments for these pixels are output by thelast sort cell 110 in the hardware sorter. As a result, the pixels pass through thehardware sorter 100 in order and the fragments for each pixel are properly sorted. In a preferred embodiment, at the end of a line, an EOL fragment causes the “take data” signal to be asserted by all of thesort cells 110. As a result, thehardware sorter 100 is flushed. Consequently, thesystem 50 is synchronized, ensuring that pixels are written at a particular time. - In a preferred embodiment, the new fragment is broadcast in parallel to the
sort cells 110 in a first clock cycle. In the same clock cycle, the sort cells perform a comparison, insert the new fragment in the appropriate place, and, if necessary, move fragments which are displaced by the new fragment farther down thehardware sorter 100. Consequently, each new fragment is sorted in a single cycle in a preferred embodiment. The number of sort cells is based on the order of the number of fragments to be sorted. As a result, the number of cycles between providing a pixel to the first cell of thehardware sorter 100 and providing the sorted pixel to the output of thelast sort cell 110 is substantially the same as the number ofsort cells 110. In general, this time is at least as good as the time achieved by an optimized software sort. Although there may be a delay between the first pixel being input to thehardware sorter 100 and the first pixel being output by the hardware sorter 100 (“latency”), the sort for each pixel is performed in a single clock cycle. Therefore, a sort performed in accordance with the present invention is typically faster than an optimized software sort. - Although FIG. 5 depicts each
sort cell 110 as having aninternal controller 115, in a preferred embodiment, thecontroller 115 for each sort cell is combined to a single controller outside of the sort cells. FIG. 7 depicts a preferred embodiment of ahardware sorter 300 in accordance with the present invention. Note that although thehardware sorter 300 will be described in conjunction with thecomputer graphics system 50, nothing prevents the use of thehardware sorter 300 in another computer system. Thus, thehardware sorter 300 will be described as sorting based on a particular key (the z value) associated with particular data (the fragments for a pixel including color and alpha values) nothing prevents thehardware sorter 300 from sorting based on another key or accepting other types of data. Thus, thehardware sorter 300 is applicable to other systems requiring a sort, such as a router in a network. - The
hardware sorter 300 includes a plurality ofsort cells 310. Note that although only foursort cells 310 are depicted, nothing prevents thehardware sorter 300 from having another number ofsort cells 310. In a preferred embodiment, the number ofsort cells 310 is at least equal to the number of items to be sorted. Thus, in a preferred embodiment, the number ofsort cells 310 is the same as the number of processors in theprocessor block 65. Also in a preferred embodiment, the number ofsort cells 310 is sixteen. - The
hardware sorter 300 further includes anew input line 320 for providing a new fragment in parallel to each of thesort cells 310 vianew input 320. Eachsort cell 310 also includes anoutput 330. Theoutput 330 of asort cell 130 is coupled to an input of anext sort cell 310. Theoutput 330 of thelast sort cell 310 is not coupled to anothersort cell 310. Instead, theoutput 330 of thelast sort cell 310 provides the output of thehardware sorter 300. Thehardware sorter 300 also includes acontroller 350 which controls thesort cells 310 throughcontrol lines 360. - To more particularly describe the
hardware sorter 300 refer to FIG. 8, depicting asort cell 310 in accordance with the present invention. Thesort cell 310 is coupled to anew input 320. Thesort cell 310 includes acontrol line 360, anoutput 330, and aninput 340. Thenew input 320 includesnew data input 322 and newkey input 324. Theinput 340 includes previouskey input 312 andprevious data input 313. Theoutput 330 includes correspondingkey output 334 andcorresponding data output 336. Thecontrol line 360 includescontrol signal output 362 and controlsignal input 364. Thesort cell 310 also includes akey selector 316,key storage 317,data selector 318, anddata storage 319. In one embodiment, thekey storage 317 anddata storage 319 exist outside of thesort cell 310. - The
sort cell 310 andhardware sorter 300 function similarly to thesort cell 110 andhardware sorter 100, respectively. The primary difference is that thehardware sorter 300 includes asingle controller 350 separate from thesort cells 300. In thehardware sorter 300, thecontroller 350 takes on the functions of thecontrollers 115 for all of thesort cells 110 in thehardware sorter 100. In addition, eachsort cell 310 includes aninput 364 for the signals used to control thekey selector 116 and thedata selector 118. Thesort cell 310 also includes anoutput 362 to provide the resultant from thecomparator 314 to thecontroller 350. Because thecontroller 350 controls all of thesort cells 310, in a preferred embodiment no control signal is passed between thesort cells 310. However, thecontroller 350 controls thesort cells 310 to provide the same functions as provided by thehardware sorter 100. - As discussed above, in a preferred embodiment, the
hardware sorter 100 and thehardware sorter 300 include a number of sort cells on which is at least the same as the number of items to be sorted. However, nothing prevents fewer sort cells from being used. This is particularly true if anappropriate sort cell sort cells - For example, in the
computer graphics system 50, the corresponding fragment for thelast sort cell last sort cell last sort cell - A method and system has been disclosed for providing a hardware sort. Because the new item (fragment) to be sorted can be broadcast to all sort cells in parallel and because each sort cell can simultaneously perform functions, the system and method provide an efficient sort. In addition, each sort cell can be the same as other sort cells. When the number of items sorted or size of the hardware sorter are desired to be changed, sort cells be easily added or subtracted from the hardware sorter. Consequently, the time required to develop the method and system is reduced. In addition, because each sort cell can be made the same, the hardware sorter is a regular array. Consequently, the hardware sorter is relatively simple to lay out once the layout of a single cell is determined.
- Although the present invention has been described in accordance with the embodiments shown, one of ordinary skill in the art will readily recognize that there could be variations to the embodiments and those variations would be within the spirit and scope of the present invention. Accordingly, many modifications may be made by one of ordinary skill in the art without departing from the spirit and scope of the appended claims.
Claims (29)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US10/359,432 US20030115181A1 (en) | 1998-04-20 | 2003-02-05 | Method and system for providing a hardware sort in a graphics system |
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US6287298A | 1998-04-20 | 1998-04-20 | |
US09/583,063 US6377258B1 (en) | 1998-04-20 | 2000-05-30 | Method and system for providing a hardware sort in a graphics system |
US10/003,784 US6556993B2 (en) | 2000-05-30 | 2001-11-15 | Method and system for providing a hardware sort in a graphics system |
US10/359,432 US20030115181A1 (en) | 1998-04-20 | 2003-02-05 | Method and system for providing a hardware sort in a graphics system |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US10/003,784 Continuation US6556993B2 (en) | 1998-04-20 | 2001-11-15 | Method and system for providing a hardware sort in a graphics system |
Publications (1)
Publication Number | Publication Date |
---|---|
US20030115181A1 true US20030115181A1 (en) | 2003-06-19 |
Family
ID=24331538
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US10/003,784 Expired - Fee Related US6556993B2 (en) | 1998-04-20 | 2001-11-15 | Method and system for providing a hardware sort in a graphics system |
US10/359,432 Abandoned US20030115181A1 (en) | 1998-04-20 | 2003-02-05 | Method and system for providing a hardware sort in a graphics system |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US10/003,784 Expired - Fee Related US6556993B2 (en) | 1998-04-20 | 2001-11-15 | Method and system for providing a hardware sort in a graphics system |
Country Status (1)
Country | Link |
---|---|
US (2) | US6556993B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8448092B2 (en) * | 2009-11-25 | 2013-05-21 | International Business Machines Corporation | Positional effects in a three-dimensional desktop environment |
US10296612B2 (en) | 2015-09-29 | 2019-05-21 | At&T Mobility Ii Llc | Sorting system |
US10416959B2 (en) | 2015-10-27 | 2019-09-17 | At&T Mobility Ii Llc | Analog sorter |
US10261832B2 (en) | 2015-12-02 | 2019-04-16 | At&T Mobility Ii Llc | Sorting apparatus |
US10496370B2 (en) | 2015-12-02 | 2019-12-03 | At&T Intellectual Property I, L.P. | Adaptive alphanumeric sorting apparatus |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5410689A (en) * | 1991-06-13 | 1995-04-25 | Kabushiki Kaisha Toshiba | System for merge sorting that assigns an optical memory capacity to concurrent sort cells |
US5265260A (en) * | 1991-06-26 | 1993-11-23 | International Business Machines Corporation | High performance sort hardware for a database accelerator in a data processing system |
DE69232425T2 (en) * | 1991-07-10 | 2002-10-10 | Hitachi Ltd | Sorting procedure in a distributed database and access procedure for it |
US5517603A (en) * | 1991-12-20 | 1996-05-14 | Apple Computer, Inc. | Scanline rendering device for generating pixel values for displaying three-dimensional graphical images |
JPH0728624A (en) * | 1993-07-13 | 1995-01-31 | Mitsubishi Electric Corp | Device and method for sorting |
JPH11515121A (en) * | 1995-07-26 | 1999-12-21 | レイカー,インコーポレイティド | Method and apparatus for span and subspan sorting rendering system |
US5949428A (en) * | 1995-08-04 | 1999-09-07 | Microsoft Corporation | Method and apparatus for resolving pixel data in a graphics rendering system |
JP3680370B2 (en) * | 1995-09-13 | 2005-08-10 | ヤマハ株式会社 | Image display device |
US5963210A (en) * | 1996-03-29 | 1999-10-05 | Stellar Semiconductor, Inc. | Graphics processor, system and method for generating screen pixels in raster order utilizing a single interpolator |
US5884307A (en) * | 1997-02-28 | 1999-03-16 | Oracle Corporation | Updating bitmapped indexes |
US6377258B1 (en) * | 1998-04-20 | 2002-04-23 | Broadcom Corporation | Method and system for providing a hardware sort in a graphics system |
-
2001
- 2001-11-15 US US10/003,784 patent/US6556993B2/en not_active Expired - Fee Related
-
2003
- 2003-02-05 US US10/359,432 patent/US20030115181A1/en not_active Abandoned
Also Published As
Publication number | Publication date |
---|---|
US6556993B2 (en) | 2003-04-29 |
US20020040362A1 (en) | 2002-04-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6509897B1 (en) | Method and system for providing implicit edge antialiasing | |
US4967392A (en) | Drawing processor for computer graphic system using a plurality of parallel processors which each handle a group of display screen scanlines | |
US6750867B1 (en) | Image processing apparatus | |
US5757374A (en) | Method and apparatus for performing texture mapping | |
JPH10208076A (en) | High-speed alpha transparency rendering method | |
US6963346B2 (en) | Method and system for efficiently using fewer blending units for antialiasing | |
EP1295256B1 (en) | Method and system for image rendering with tiles | |
JPH09223244A (en) | Method and device for rendering three-dimensional object at a high speed | |
WO2005073925A1 (en) | Image rendering with multi-level z-buffers | |
US6731296B2 (en) | Method and system for providing programmable texture processing | |
US20040012611A1 (en) | Anti-aliasing interlaced video formats for large kernel convolution | |
US7233964B2 (en) | Method and system for compositing three-dimensional graphics images using associative decision mechanism | |
US6556993B2 (en) | Method and system for providing a hardware sort in a graphics system | |
US6690381B1 (en) | Method and system for performing multi-texturing operations using recursive interleaving | |
US6775667B1 (en) | Method and system for providing a hardware sort for a large number of items | |
US6377258B1 (en) | Method and system for providing a hardware sort in a graphics system | |
JP2002529869A (en) | Depth sorting for use in computerized 3D shading and texturing systems | |
US6795088B2 (en) | Method and system for more efficiently utilizing processors of a graphics system | |
US6882345B2 (en) | Method and system for efficiently loading primitives into processors of a graphics system | |
JPH0695342B2 (en) | Hidden surface treatment device | |
JP2006285372A (en) | Z-sorting processing circuit and three-dimensional image drawing device using the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
STCB | Information on status: application discontinuation |
Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION |
|
AS | Assignment |
Owner name: STELLAR CORPORATION, CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:LEWIS, MICHAEL C.;REEL/FRAME:037033/0823 Effective date: 19980415 Owner name: BROADCOM CORPORATION, CALIFORNIA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:STELLAR SEMICONDUCTOR, INC.;REEL/FRAME:037033/0926 Effective date: 20000526 |
|
AS | Assignment |
Owner name: BANK OF AMERICA, N.A., AS COLLATERAL AGENT, NORTH CAROLINA Free format text: PATENT SECURITY AGREEMENT;ASSIGNOR:BROADCOM CORPORATION;REEL/FRAME:037806/0001 Effective date: 20160201 Owner name: BANK OF AMERICA, N.A., AS COLLATERAL AGENT, NORTH Free format text: PATENT SECURITY AGREEMENT;ASSIGNOR:BROADCOM CORPORATION;REEL/FRAME:037806/0001 Effective date: 20160201 |
|
AS | Assignment |
Owner name: AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD., SINGAPORE Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BROADCOM CORPORATION;REEL/FRAME:041706/0001 Effective date: 20170120 Owner name: AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BROADCOM CORPORATION;REEL/FRAME:041706/0001 Effective date: 20170120 |
|
AS | Assignment |
Owner name: BROADCOM CORPORATION, CALIFORNIA Free format text: TERMINATION AND RELEASE OF SECURITY INTEREST IN PATENTS;ASSIGNOR:BANK OF AMERICA, N.A., AS COLLATERAL AGENT;REEL/FRAME:041712/0001 Effective date: 20170119 |