US 7224364 B1 Abstract A frame buffer is divided into tiles of, for example, 32 by 32 pixels. Triangles (and portions thereof) that are within a given tile are rasterized one triangle at a time into the tile location. This process repeats for each tile in the image frame. A sorting circuit generates control bits representing a vertical order of the vertices of a current triangle. A series of multiplexers vertically sorts the vertices bases on these control bits. A region calculation circuit generates region bits representing a location each of the vertices with respect to the current tile. A trivial discard of the triangle data occurs if the region bits indicate that the entire triangle lies outside of the tile. Subsequently, an initial rasterization starting point is estimated based on the region bits to lower the time needed for the rasterizer to find the first pixel of the current triangle to be assigned values.
Claims(32) 1. A method for providing an initial rasterizing point, comprising:
receiving vertex data corresponding to the vertices of a primitive, the vertex data including x-coordinate and y-coordinate position information;
sorting the vertex data in coordinate-dependent fashion;
generating region bits representing the location of the sorted vertex data with respect to a current tile being rendered;
generating coordinate data representing an initial rasterization starting point estimate that is within the current tile when the region bits indicate that at least one of the sorted vertex data lies within the current tile being rendered and discarding the sorted vertex data of primitives that lie outside the boundary of the current tile being rendered; and
providing the initial rasterization starting point estimate to a rasterizer.
2. The method of
generating an orientation bit representing an orientation of a line connecting the first and second vertices of the sorted primitive with respect to a line connecting the first and third vertices of the sorted primitive before generating the initial rasterization starting point coordinates.
3. A circuit, comprising:
a sorting circuit operative to provide sorted vertex data in response to input data corresponding to vertices of a primitive, the vertex data being sorted in a coordinate-dependent fashion, the vertex data including x-coordinate and y-coordinate position information;
a region calculation circuit, coupled to the sorting circuit, operative to receive the sorted vertex data and to generate region bits representing the location of the sorted vertex data with respect to a current tile being rendered; and
an initial rasterization starting point circuit, coupled to the region calculation circuit, operative to generate an initial rasterization starting point coordinate that is within the current tile in response to the region bits, the initial rasterization starting point circuit including a discard circuit operative to discard the vertex data of a primitive that lies outside the boundary defined by the current tile.
4. The circuit of
5. The circuit of
6. The circuit of
7. The circuit of
8. The circuit of
9. The circuit of
10. The circuit of
11. The circuit of
12. The circuit of
13. The circuit of
14. The circuit of
15. The circuit of
16. A circuit for optimally determining an initial rasterization starting point, comprising:
a sorting circuit operative to provide sorted vertex data in response to input data corresponding to vertices of a primitive, the vertex data being sorted in a coordinate-dependent fashion, the vertex data including x-coordinate and y-coordinate position information;
a region calculation circuit, coupled to the sorting circuit, operative to receive the sorted vertex data and to generate region bits representing the location of the sorted vertex data with respect to a current tile being rendered; and
an initial rasterization starting point circuit, coupled to the region calculation circuit, operative to generate an initial rasterization starting point coordinate that is within the current tile when the region bits indicate that at least one of the sorted vertex data lies within the current tile, the initial rasterization starting point circuit including a discard circuit operative to discard the vertex data of primitives whose vertices lie outside the boundary defined by the current tile.
17. A method, comprising:
(a) receiving a pixel tile containing vertex position data for a plurality of primitives;
(b) sorting the primitives in axis-dependent order;
(c) determining whether the sorted primitives are positioned within a current tile to be transmitted to a rasterizer;
(d) determining an initial rasterization point that is within the current tile within the sorted primitive; and
(e) discarding the sorted vertex data of primitives that lie outside the boundary of the current tile being rendered.
18. The method of
19. The method of
20. The method of
21. The method of
22. The method of
23. The method of
24. The method of
(c) further comprises:
(c1) comparing the x-coordinate position data with the corresponding coordinate position data of the current tile; and
wherein discarding comprises:
(c2) discarding the primitive when the x-coordinate position is greater than the largest corresponding coordinate position of the current tile.
25. The method of
(c3) comparing the x-coordinate position data with the corresponding coordinate position data of the current tiles; and
wherein discarding comprises:
(c4) discarding the primitive when the x-coordinate position is less than the smallest corresponding coordinate position of the current tile.
26. The method of
(c5) comparing the y-coordinate position data with the corresponding coordinate position data of the current tile; and
wherein discarding comprises:
(c6) discarding the primitive when the y-coordinate position is greater than the largest corresponding coordinate position of the current tile.
27. The method of
(c7) comparing the y-coordinate position data with the corresponding coordinate position data of the current tile; and
wherein discarding comprises:
(c8) discarding the primitive when the y-coordinate position is less than the smallest corresponding coordinate position of the current tile.
28. The method of
(d1) generating an initial x-coordinate and an initial y-coordinate based on the corresponding x-coordinate and sorted y-coordinate of the primitive within the current tile.
29. The method of
(d2) generating the initial x-coordinate and y-coordinate based on the boundary region of the current tile.
30. A method, comprising:
receiving a pixel tile containing vertex position data for a plurality of primitives;
sorting the primitives in axis-dependent order;
comparing the x-coordinate position data with the corresponding coordinate position data of the current tile;
discarding the primitive when the x-coordinate position is greater than the largest corresponding coordinate position of the current tile;
discarding the primitive when the x-coordinate position is less than the smallest corresponding coordinate position of the current tile; and
determining an initial rasterization point that is within the current tile within the sorted primitive.
31. The method of
generating the initial x-coordinate and y-coordinate based on the boundary region of the current tile.
32. A method for providing an initial rasterizing point, comprising:
receiving vertex data corresponding to the vertices of a primitive, the vertex data including x-coordinate and y-coordinate position information;
sorting the vertex data and coordinate dependent fashion;
generating region bits comprising the location of the sorted vertex data with respect to a current tile being rendered;
generating an initial rasterization starting point based on a determined interception of x-coordinate position data or the y-coordinate position data with the boundary defined by the region bits; and
providing the initial rasterization starting point estimate to a rasterizer.
Description An image typically includes several objects (e.g., a tree, sky or animated character). Each object may be computer represented by a group of triangles. Vertex data for each triangle includes x and y-coordinate data defining the position of each vertex of the triangle within the image. In three-dimensional applications, the vertex data also includes z-coordinate data which defines the depth of the triangle in virtual space. On a display, a triangle having a greater depth may be obscured by a triangle having a lesser depth, thereby giving the appearance that the image is three-dimensional. In writing each image frame, a graphics processor feeds triangle data, one triangle at a time, to a rasterizer which assigns luminance and color values to each pixel location within the triangle. After all triangles of the image frame are written into a frame buffer, the image frame is displayed. In typical graphics applications, an image frame may include many thousands of triangles depending on the image resolution of the image frame. Furthermore, many image frames are displayed each second in graphics applications. Thus, as the graphics applications become more complex, the graphics processor and rasterizer must operate faster. Images may be represented as a group of triangles. A rasterizer assigns pixel values corresponding to one triangle at a time to a frame buffer, each triangle represented by vertex data. In one embodiment, a frame buffer is divided into tiles of, for example, 32 by 32 pixels. Triangles (and portions thereof) that are within a current tile are rasterized one triangle at a time into the tile location. This process repeats for each tile in the image frame. For graphics applications, this process repeats for each image frame in the graphics stream. In accordance with the present invention, vertex data corresponding to three vertices of a triangle are received in a sorting circuit. The sorting circuit generates control bits representing an order of the vertices along, for example, the vertical direction. A multiplexer passes data corresponding to one (e.g., the highest) of the vertices in response to the control bits. Similarly, other multiplexers may pass data corresponding to the middle and lowest vertices. Thus, the vertices of the triangle are sorted through the multiplexers such that the ordering of the vertices after the multiplexer is predictable. This predictability simplifies the downstream logic circuit by reducing the vertex position permutations that the downstream logic circuit may encounter. A region calculation circuit generates region bits representing a location of each of the vertices with respect to a current tile. A trivial discard of the triangle data occurs if the region bits indicate that the entire triangle lies outside of the tile. For example, a trivial discard occurs if the region bits indicate that the lowest vertex is higher than the top edge of the tile, that the highest vertex is lower than the bottom edge of the tile, that all the vertices are left of the left edge of the tile, or that all the vertices are right of the right edge of the tile. After the trivial discard, initial rasterization starting point estimate coordinates are generated for the rasterizer. This starting point estimate lowers the time needed for the rasterizer to find the first pixel of the current triangle to be assigned values. The starting point may be generated using the region bits. The principles of the present invention will best be understood in light of the following detailed description along with the accompanying drawings. In this description, the same or similar elements in different drawings are identified with the same reference symbols. In this description, “&” means logical AND, “+” means logical OR, and “!” means logical NOT. Items within parentheses “( )” have highest logical priority followed by “!”, “&”, and “+”, in descending priority order. A frame buffer (not shown) may be divided into tiles of, for example, 32 by 32 pixels. Triangles (and portions thereof) that are within a given tile are rasterized one triangle at a time into the tile location. This process repeats for each tile in the image frame. For graphics applications, this process repeats for each image frame in the graphics stream. Setup engine Setup engine A y-sort circuit
The six possible cases 0, 1, 3, 4, 6 and 7 of Table (1) for the y-coordinate-ordering of the three vertices are shown respectively in 3B, 3C, 3D, 3E and 3F.
In response to control bits y After sorting, a trivial discard analysis occurs as follows. Referring to Referring to An orientation circuit The region bits n Referring to
Cases 1, 2, 3 and 4 are shown respectively as triangles 501, 502, 503 and 504 of 1 to 4 of Table (2) is true, trivial discard circuit 208 generates a bit y308 of a value 1, causing setup engine 101 (102 (Note that bit y If none of the trivial discard cases are true (i.e., bit y A typical rasterizer checks each pixel in a field (e.g., a tile or frame) to determine if the pixel is positioned within an object (e.g., a triangle). If not, the rasterizer proceeds to the next pixel and so on in a raster pattern until a pixel is found which is positioned in the object. Once a pixel within the object is found, there are numerous conventional ways to reduce the number of pixels checked by a rasterizer before the object is entirely rasterized. However, often significant time is taken finding a pixel that lies within the object. Setup engine Specifically, referring to Trivial accept circuit Circuit Circuit Circuit Circuit Circuit Circuit Circuit Thus, an initial rasterization starting point is estimated. Rasterizer This process is repeated for all triangles within the selected tile, and for all tiles within the image frame. Although the above describes a specific embodiment of the present invention, this embodiment is illustrative only and not limiting. Various modifications and substitutions will be apparent to one skilled in the art. All such modifications and substitutions are intended to be part of the present invention. The invention is defined by the following claims. Patent Citations
Non-Patent Citations
Referenced by
Classifications
Legal Events
Rotate |