The present invention is generally directed to a tessellation operation, and more particularly to performing a high throughput tessellation in 3D computer graphics systems.
The rendering of images in computer graphics has become increasingly more realistic with the onset of three-dimensional (3D) scenes. In some graphics applications, such as computer gaming, the level of detail (LOD) of a 3D object may not need to be the same depending on how far away the object is to be viewed. For example, an object farther away relative to the observer need not have the same LOD as the same object when viewed close-up. One way to render 3D detailed surfaces realistically with different LODs is through the use of tessellation. In tessellation, a 3D surface may be divided into surface patches. Surface patches may, in turn, be broken up into primitives for rendering in graphics hardware. By breaking up the 3D surfaces into surface patches and primitives, the same 3D objects can be rendered in greater detail as necessary. Another goal of using 3D surface patches with following on-chip tessellation is to reduce the amount of information and information transfer and processing needed to render smooth surfaces in graphics processors. Meshes based on quadrilateral primitives or triangle primitives may be considered as representations for 3D objects. 3D surface patches may be considered as a compressed representation of this quadrilateral mesh or triangle mesh with a ratio of compression that may range between 10 and 100, depending on required level of detail. In this point of view, each 3D surface patch in a scene object model needs to be decompressed to a quadrilateral mesh or triangle mesh in order to be processed by a rendering pipeline. Such decompression may be referred to as a tessellation stage, and the processing rate of this stage may determine overall 3D rendering performance in graphics systems.
Vertex shader (VS) 25 outputs one vertex for each one vertex it receives from IA 20. Hull shader (HS) 30 operates on each vertex from VS 25 in two phases. In control point phase, HS 30 outputs one control point per invocation. Its aggregate output is shared as input to both tessellator (TS) 35 and domain shader (DS) 40. In patch constant phase, which is invoked once per patch, HS 30 reads input of all input and output control points and patch constants computed so far. HS 30 outputs edge tessellation factors and other patch constant data.
Tessellator (TS) 35 receives numbers called tessellation factors (TFs) from HS 30 defining how much to tessellate. TS 35 generates domain locations and topology. For example, such tessellation factors may specify how many times a patch is subdivided on each side and in an internal area as well. As non-limiting examples, triangle patches, may have four TFs: three for sides and one for interior, while quadrilateral patches may have six TFs: one for each side and two for the interior. These factors may be fixed or adaptive based on software settings.
Domain shader (DS) 40 inputs one domain location plus shared read-only input of all HS outputs for the patch. DS 40 outputs one vertex.
Geometry shader (GS) 45 inputs one primitive and outputs up to four streams, each independently receiving no primitives or some primitives. As shown, an output stream from GS 45 can provide primitives to rasterizer (RS) 50 while, or alternatively, up to four streams can be concatenated to memory-based buffer 15.
Rasterizer (RS) 50 further prepares data for further pixel processing. RS 50 performs functions of clipping including custom clip boundaries, perspective divide, viewport/scissor selection and implementation, RenderTarget selection, and primitive setup. RenderTarget is a type of displayable frame buffer or any memory surface with pixels addressed via geometry coordinates instead of linear addressing.
Pixel shader (PS) 55 inputs one pixel for processing and outputs either one pixel at the same RenderTarget position or no pixel.
Output merger (OM) 60 provides fixed function RenderTarget blend/depth/stencil operations.
The existing tessellation solution described above includes some deficiencies which lead to poor tessellation performance, especially with small size primitives (such as quadrilaterals or triangles) in pixel or sub-pixel level subdivision when an output pixel rate is significantly reduced, possibly becoming less than or equal to a primitive rate. Pixel rate may become even lower than primitive rate when subdivision size becomes comparable to, or smaller than, a size of a single pixel. A primitive rate is normally a few times lower than output pixel rate, especially in the case of primitives of larger sizes with several pixels covered. In addition, the use of an iterative tessellation procedure adds another limitation on primitive rate, which results in additional adverse effects on pixel rate.
It may therefore be beneficial to provide a method and apparatus of tessellation to generate a larger amount of pixels and sustain a high pixel rate in case of pixel or subpixel size subdivision.
A method, a system, and a computer-readable storage medium directed to performing high-speed parallel tessellation of 3D surface patches are disclosed. The method includes generating a plurality of primitives in parallel. Each primitive in the plurality is generated by a sequence of functional blocks, in which each sequence acts independently of all the other sequences.
A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings wherein:
Although a more detailed description of the embodiments is provided below, briefly a method and apparatus for performing high throughput tessellation is disclosed. The method may generate enough pixels to sustain a relatively high pixel rate when sizes of subdivisions are so small as to be similar to, or less than, sizes of pixels. A graphics pipeline is also modified to read patch data directly into a pixel shader, which may avoid extra traffic generated by existing methods. In addition, attribute evaluation may be performed by a pixel shader instead of a domain shader, and may be deferred until pixels are visible. Accordingly, higher pixel rates for fine-grain subdivision surfaces may be sustained, limited only by the computational power of the graphics pipeline.
Continuing with the example, vertex 4 has integer local coordinates (2, 2). Such integer local coordinates are referred to in general as (i, j) hereinafter. Vertex 4 also has parametric local coordinates (0.2, 0.7). These parametric coordinates are referred to in general as (u,v) hereinafter. Parametric coordinates (u, v) define an exact position of a vertex in an internal patch parametric space. These coordinates can be used later for calculation of subdivision vertex geometry coordinates in 3D view space, which are referred to in general as (x, y, z, w) hereinafter. Other vertices in
The processor 402 may include a central processing unit (CPU), a graphics processing unit (GPU), a CPU and GPU located on the same die, or one or more processor cores, wherein each processor core may be a CPU or a GPU. The memory 404 may be located on the same die as the processor 402, or may be located separately from the processor 402. The memory 404 may include a volatile or non-volatile memory, for example, random access memory (RAM), dynamic RAM, or a cache.
The storage 406 may include a fixed or removable storage, for example, a hard disk drive, a solid state drive, an optical disk, or a flash drive. The input devices 408 may include a keyboard, a keypad, a touch screen, a touch pad, a detector, a microphone, an accelerometer, a gyroscope, a biometric scanner, or a network connection (e.g., a wireless local area network card for transmission and/or reception of wireless IEEE 802 signals). The output devices 410 may include a display, a speaker, a printer, a haptic feedback device, one or more lights, an antenna, or a network connection (e.g., a wireless local area network card for transmission and/or reception of wireless IEEE 802 signals).
The input driver 412 communicates with the processor 402 and the input devices 408, and permits the processor 402 to receive input from the input devices 408. The output driver 414 communicates with the processor 402 and the output devices 410, and permits the processor 402 to send output to the output devices 410. It is noted that the input driver 412 and the output driver 414 are optional components, and that the device 400 will operate in the same manner if the input driver 412 and the output driver 414 are not present. Although described embodiments include a main display, the invention may be practiced without a main display, and only include a source device of video. In this way, the control territory may be an office environment with a plurality of portable devices and no main display.
In the embodiment of
Tessellator 505 includes a B0 block 510 and a number of parallel processing sequences 515a, 515b, 515c, each sequence including blocks B1, B2, and B3. Each of the sequences 515a, 515b, 515c determines, in parallel with the other sequences, parametric coordinates for all vertices in a primitive, up to the N-th primitive in subdivision mesh geometry. There are a total of N sequences, one for each primitive in the subdivision mesh geometry, but for clarity only three sequences 515a, 515b, and 515c are shown in detail in
This implementation is a fully parallel one, because tessellator 505 is free of any dependencies between the blocks and sequences, dependencies that may arise in an iterative implementation such as that described hereinbefore. In this implementation, local parametric coordinates (u, v) and vertex connectivity may be found analytically and in arbitrary order, and consequently, an iterative tessellation scheme may be avoided. Other embodiments of parallel tessellation using blocks such as B0, B1, B2, and B3 may be constructed. Other embodiments may include, for example, parallel computation of vertices as well as primitives. Partially parallel implementations that do a portion of work simultaneously are possible as well.
Programmable (e.g. Hull) shader or other computing device HS 630 determines patch tessellation factors TF[i], where i goes from, for example, 1 to 4 or 6 depending on the patch type. It also determines the total number of primitives and vertices, implementing the functionality of the block B0. Programmable shader 630 may utilize variable subdivision rates when generating the tessellation factors.
Tessellation engine 640 implements the functionality of blocks B1 and B2. The tessellation engine could be implemented as a hardware block, shader or CPU firmware, or using any other means of computation. According to the flow presented in
The order of the stream of the vertices and the primitives that are sent by tessellation engine 640 may be implemented as patch subdivision mesh scan strips parameterized by the capacity of the communication channels between the blocks. For example, the width of the strip may be determined by the size of reuse buffers. An example zigzag scan path on patch subdivision mesh is shown in
Programmable (domain) shader or other computing device DS 680 implements the last piece of the flow presented in the
Finally, using connectivity information from tessellation engine 640 and the coordinates (u, v, x, y, z, w) of the indices from memory 690, geometry engine 650 sends primitives in the form of a list of coordinates to rasterizer 660.
It should be understood that many variations are possible based on the disclosure herein. Although features and elements are described above in particular combinations, each feature or element may be used alone without the other features and elements or in various combinations with or without other features and elements.
For example, a method such as that shown in
The tessellation flow described in
Tessellation flow doesn't depend on the implementation of the blocks B0-B3, as that implementation may also be varied. For example, all blocks can be implemented as fixed function hardware units, firmware code, shader code, FPGA and similar devices, or any combination thereof. Moreover, the same block may have multiple implementations in the same device. For example, block B1 may be implemented as a fixed function hardware unit and as a shader code, and depending on the availability of the resources (such as GPU cores) the tessellation flow can be switched from hardware to the shader execution.
Finally, any combination of the tessellation flows and block implementations are also possible, including multiple flows and block implementations in the same device at the same time. For example, depending on the patch size and resource availability, the flow may be either a fixed function hardware unit with a single primitive per clock output or a shader only massively parallel tessellator.
Embodiments of the method described herein may be configured to be fully compliant with existing tessellators and tessellation methods regarded as industry standards.
The methods provided may be implemented in a general purpose computer, a processor, or a processor core. Suitable processors include, by way of example, a general purpose processor, a special purpose processor, a conventional processor, a GPU shader processor, a digital signal processor (DSP), a plurality of microprocessors, one or more microprocessors in association with a DSP core, a controller, a microcontroller, Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) circuits, any other type of integrated circuit (IC), and/or a state machine. Such processors may be manufactured by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions and other intermediary data including netlists (such instructions capable of being stored on a computer readable media). The results of such processing may be maskworks that are then used in a semiconductor manufacturing process to manufacture a processor which implements aspects of the present invention.
The methods or flow charts provided herein may be implemented in a computer program, software, or firmware incorporated in a computer-readable storage medium for execution by a general purpose computer or a processor. Examples of computer-readable storage mediums include a read only memory (ROM), a random access memory (RAM), a register, cache memory, semiconductor memory devices, magnetic media such as internal hard disks and removable disks, magneto-optical media, and optical media such as CD-ROM disks, and digital versatile disks (DVDs).
This application is a continuation of U.S. patent application Ser. No. 14/984,896, filed Dec. 30, 2015, which is incorporated by reference as if fully set forth.
Number | Date | Country | |
---|---|---|---|
Parent | 14984896 | Dec 2015 | US |
Child | 16057212 | US |