Abstract:
A computer graphics system splits vertex data into first and second streams and stores the streams in separate regions of memory. In a specific embodiment, the first stream includes positional data and the second stream includes non-positional color and texture data. A visibility subsystem uses only the first stream to perform visibility processing, thus reducing bandwidth requirement. The rendering system processes data from subsets, identified by the visibility subsystem, of both streams required to render the visible part of a scene.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
     This application is a continuation-in-part of commonly-assigned U.S. patent application Ser. No. 09/271,636, filed Mar. 17, 1999, entitled “Optimized System and Method for Binning of Graphics Data,” by Zhu et al, and is hereby incorporated by reference in its entirety. 
    
    
     BACKGROUND OF THE INVENTION 
     In the field of computer graphics, complex images are generated from simple geometries such as triangles and polygons. A typical 3-D computer generated image may consist of millions of triangles. Each of these triangles and mode information about the triangles must be stored in memory and processed rapidly. Accordingly, developing techniques for efficiently storing graphics data in memory and for rapidly accessing data from memory are critical to improving the performance of computer graphics systems. 
     One technique for improving access to memory is binning, which is described in the co-pending, commonly assigned patent application referenced above. Briefly, a binning system divides a display into tiles of predefined pixel dimensions. Geometry data for all polygons that “touch” a tile are stored in an associated area of memory termed a “bin.” Each bin is a designated area of the graphics memory which is dynamically allocated for each frame and is accessed by a specially configured memory controller. 
     From any given viewpoint, not all pixels belonging to triangles will be visible. For example, if the object were a building, and a car was parked behind the building, then the car would not be visible. Thus, 3-D rendering pipelines include a visibility subsystem for determining which pixels are visible. Also, visibility subsystems use an algorithm, such as Z-buffering, to determine which pixels are in front of other pixels. Only the frontmost pixels need be rendered. Additionally, a triangle that contains no visible pixels need not be processed by the rendering engine. 
     Vertex data includes geometry, color, and possible other data associated with a vertex. The visibility subsystem must rapidly process all geometry information to detect visibility information. Thus, the visibility system requires large memory bandwidth. 
     Accordingly, techniques for reducing the memory bandwidth requirements for performing visibility processing are vital to increasing the speed of a computer graphics system. 
     SUMMARY OF THE INVENTION 
     According to one aspect of the invention, a stream of scene data is stored in separate spaces in memory as two separate streams, a Z stream including positional vertex data such as x,y,z coordinate data required to determine whether a geometry is visible, and a C stream including all other vertex data, such as color and texture parameters, required to render a geometry. 
     According to one aspect of the invention, a stream of scene data is split and stored in separate spaces in memory as two separate streams, a Z stream including positional vertex data such as x,y,z coordinate data required to determine whether a geometry is visible, and a C stream including all other vertex data, such as color and texture parameters, required to render a geometry. 
     According to another aspect of the invention, all mode data affecting visibility and rendering is store only in the Z stream and is not duplicated in the C stream. 
     According to another aspect of the invention, only the Z stream is provided to the visibility subsystem to reduce memory bandwidth requirements and improve visibility preprocessing efficiency. 
     According to another aspect the invention, both Z and C streams are provided to the rendering engine to render geometries determined to be visible by the visibility subsystem. 
     According to another aspect the invention, only segments representing visible geometries of both Z and C streams are provided to the rendering engine to render geometries determined to be visible by the visibility subsystem. 
     According to another aspect of the invention, the visibility system provides visible geometries directly to the rendering engine. 
     Other features and advantages of the invention will now be apparent in view of the following detailed description and appended drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a system for implementing an embodiment of the invention; 
     FIG. 2 is a block diagram of a stream splitting module; and 
     FIG. 3 is a flowchart depicting a sequence of acts implemented by an embodiment of the invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The invention will now be described, by way of example, not limitation, in an embodiment that utilizes binning. The techniques described below provide the same advantages to a system that does not use binning, for example a system that utilizes a memory to store geometries for an entire frame. 
     An implementation of a preferred embodiment of the invention in a graphics chip system now be described with reference to FIG.  1 . In FIG. 1, scene image data is supplied to a graphics system  10 . The graphics system  10  can be implemented in any suitable hardware, software, or a combination in both. In one embodiment, graphics system  10  is implemented in one or more semiconductor devices such as an application specific semiconductor device (ASIC) and supporting memory devices. 
     In FIG. 1, vertex data is received by a binning engine  12 . The binning engine outputs two streams (Z and C) of vertex data to a memory controller  14 . The memory controller  14  is coupled to local graphics memory  16  and stores the streams in separate spaces of the local graphics memory  16 , a part of which is configured into bins  18  for storing vertex data for a particular tile. The memory controller  14  is also coupled to a visibility subsystem  20  and a rendering engine  22 . The visibility subsystem is connected to the rendering engine by an optional FIFO  24 . The function of the optional FIFO  24  is described below. 
     FIG. 2 is a block diagram of the stream splitting sub-system. In a binning system the stream splitting can be implemented in the binning engine by a stream splitting component  26 . In a non-binning system the stream splitting system  26  can be implemented as a separate hardware of software module or integrated with other components in the rendering pipeline. 
     Typically, a stream of data describing a scene is received by the rendering pipeline. This received stream includes two categories of data: mode, or control, data and geometry data. In the presently described embodiment the received data is in the form of packets received on a 32-bit bus and one packet may be received on this bus over several clocks. 
     Each packet includes a header and a payload. The mode data may have many different functions, one of which is to define the format of geometry packets in a system that supports variable formats. Other functions of the mode packets is to set a machine state that may affect visibility processing or to set a machine state that affects rendering. The header of the mode packet may include an address of some subset of the machine state to be set. A geometry packet payload includes, among other things, vertex positional data identifying the x,y,z coordinates of a vertex and color data for the vertex. 
     The splitter sub-system utilizes mode packets addressing it to determine the format of the received geometry packets and generates control information based on the payload of the mode packet to identify which bits in the payload of a geometry packet contains x,y,z coordinates of a vertex and which bits specify color information of a vertex. 
     The stream splitting modules reformats the geometry packets into new packets of two types: Z stream packets include vertex x,y,z coordinate data, modes that affect visibility and rendering, and control data; and C stream packets include vertex color data and other non-positional vertex data. For example, if the Z stream were compressed the optional control data could be used to uncompress the coordinate data. Headers are added to the data to identify which packets are in the Z stream and which are in the C stream. The C stream has a much simpler general structure that the Z stream and is composed of vertices that map one-to-one with vertices in the Z stream. 
     FIG. 3 is a flowchart depicting steps implemented by the presently described embodiment render a scene. If the vertex data is received as a single stream of data, a stream splitting sub-system divides the data into Z and C streams, with the Z stream including the x,y,z data for each vertex as well as modes that affect visibility processing and rendering and the C (color) stream including non-positional parameters for each vertex. Alternatively, the stream may be split, for example by software, prior to being received by the rendering pipeline. An important advantage of this embodiment is that modes only go to the Z-stream and do not have to be duplicated into both the Z and C streams. 
     In the presently described embodiment, each tile is allocated a memory bin having a virtual address space of 4 Gbytes (32 address bits). The topmost address bit of a 32-bit address space is used to distinguish the virtual address space for the Z stream (MA[ 31 ]=0) and C stream (MA[ 31 ]=1). Note that the bins for each tile are not of a fixed size but are allocated dynamically by the memory controller. 
     The memory controller maintains a current virtual address for each of the two separate virtual address spaces. An incoming packet is analyzed to determine its type (Z or C) and assigned the current address to the correct virtual address space. The current address is the incremented. 
     In a non-tiling system the memory corresponds to the entire display, and two virtual address spaces are created for the Z and C streams. A “tile” can be considered to cover the entire screen and the binary memory can be considered as pair of buffers, one for the Z stream and one for the C stream. 
     As is well known in the art, visibility preprocessing is performed before rendering so that the rendering engine need only access vertex data from memory for geometries that are visible. In the presently described embodiment, the visibility subsystem determines visibility and thus reads vertex data at a high rate from the local graphics memory creating a need for high memory bandwidth. Because the visibility subsystem acts as a screen-coverage-based filter for what triangles the rendering engine needs to render fragments of, the visibility system has a much higher vertex processing rate than the rendering engine. 
     In a tiling system the visibility system reads only the Z stream from the memory bin  18  for the current tile to be rendered. In a non-tiling system the visibility system reads only the Z stream for the entire screen. As described above, the Z stream includes the x,y,z data (and mode data including modes that affects visibility) for each vertex which is the only part of the vertex data required to determine the visibility of geometry. Thus, memory bandwidth requirements are reduced because only a part of the vertex data is provided to the visibility subsystem  20 . Additionally, the processing speed of the visibility subsystem is increased because there is no need to discriminate between different or optional parameters, such as color, for each vertex. 
     In the presently described embodiment, the visibility subsystem provides pointers to the rendering engine which are used to access vertex data for geometries determined to be visible and provides mode data that affects rendering. Alternatively, the visibility subsystem can send x,y,z data of visible geometries and mode data that affects rendering directly to the rendering engine. The output of the visibility subsystem tends to be “bursty” because visibility results may not be output until visibility processing is completed. The optional FIFO provides visibility data to the rendering engine at a constant rate so that the rendering engine is not stalled waiting on data. 
     Both the Z and C streams, or visible segments thereof representing visible geometries and mode data that affects rendering, are provided to the rendering engine. This is because the complete set of vertex data, including diffuse and specular color components as well as texture data needed to determine the final color contribution of pixels within a triangle, are required to render the scene from the particular viewpoint. 
     The invention has now been described with reference to the preferred embodiments. Alternatives and substitutions will now be apparent to persons of skill in the art. In particular, different memory management systems may be used to separate and access the data of the two streams. The invention is equally useful in graphics system that utilize binning and in systems that do not utilize binning. Further, the Z and C streams have been shown stored in a local graphics memory, however, storage in other memory, such as system memory is optional. Accordingly, it is not intended to limit the invention except as provided by the appended claims.