Sony Patent | Fragment Shaders Perform Vertex Shader Computations

Patent: Fragment Shaders Perform Vertex Shader Computations

Publication Number: 20190035050

Publication Date: 2019-01-31

Applicants: Sony

Abstract

Graphics processing may include implementing a vertex shader and a pixel shader with the GPU. Vertex indices output from a vertex shader may be written to a cache. The vertex indices written to the cache may be accessed with the pixel shader and vertex parameter values associated with the vertex indices may be accessed from a memory unit with the pixel shader. It is emphasized that this abstract is provided to comply with the rules requiring an abstract that will allow a searcher or other reader to quickly ascertain the subject matter of the technical disclosure. It is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims.

Background

Graphics processing typically involves coordination of two processors, a central processing unit (CPU) and a graphics processing unit (GPU). The GPU is a specialized electronic circuit designed to accelerate the creation of images in a frame buffer intended for output to a display. GPUs are used in embedded systems, tablet computers, portable game devices, mobile phones, personal computers, workstations, and game consoles. A GPU is typically designed to be efficient at manipulating computer graphics. GPU’s often have a highly parallel processing architecture that makes the GPU more effective than a general-purpose CPU for algorithms where processing of large blocks of data is done in parallel.

The CPU may send commands to the GPU to implement a particular graphics processing task, e.g. render a particular texture that has changed with respect to a previous frame in an image. These draw commands may be coordinated by the CPU with a graphics application interface (API) in order to issue graphics rendering commands that correspond to the state of the particular application’s virtual environment.

In order to render textures for a particular program, a GPU may perform a series of processing tasks in a “graphics pipeline” to translate the visuals in the virtual environment into images that can be rendered onto a display. A typical graphics pipeline may include performing certain rendering or shading operations on virtual objects in the virtual space, transformation and rasterization of the virtual objects in the scene to produce pixel data in a form suitable for output to a display, and additional rendering tasks on the pixels (or fragments) before outputting the rendered image on the display.

Virtual objects of an image are often described in virtual space in terms of shapes known primitives, which together make the shapes of the objects in the virtual scene. For example, objects in a three-dimensional virtual world to be rendered may be reduced to a series of distinct triangle primitives having vertices defined in terms of their coordinates in three-dimensional space, whereby these polygons make up the surfaces of the objects. Each polygon may have an associated index that can be used by the graphics processing system to distinguish a given polygon from other polygons. Likewise, each vertex may have an associated index that can be used to distinguish a given vertex from other vertices. A graphics pipeline may perform certain operations on these primitives to produce visuals for the virtual scene and transform this data into a two-dimensional format suitable for reproduction by the pixels of the display. The term graphics primitive information (or simply “primitive information”), as used herein, is used to refer to data representative of a graphics primitive. Such data includes, but is not limited to, vertex information (e.g., data representing vertex positions or vertex indices) and polygon information, e.g., polygon indices and information that associates particular vertices with particular polygons.

A GPU may perform rendering tasks of the graphics pipeline by implementing programs commonly known as shaders. A typical graphics pipeline may include vertex shaders, which may manipulate certain properties of the primitives on a per-vertex basis, as well as pixel shaders (also known as “fragment shaders”), which operate downstream from the vertex shaders in the graphics pipeline and may manipulate certain values on a per-pixel basis before transmitting the pixel data to a display. The pipeline may also include other shaders at various stages in the pipeline, such as geometry shaders that use the output of the vertex shaders to generate a new set of primitives (or corresponding primitive information), as well as compute shaders (CS) which may implemented by a GPU to perform certain other general computational tasks.

One challenge associated with processing graphics in the pipeline is that certain bottlenecks may occur and slow down performance as data is input and output to the various shaders in the pipeline. Moreover, it is desirable to provide a developer of a particular application running the visuals with a large amount of control over how shaders utilize various visual parameters and underlying data in order to permit them to optimize the rendering processes.

It is within this context that aspects of the present disclosure arise.

Summary

According to aspects of the present disclosure, a computer graphics processing method may include writing vertex indices output from a vertex shader to a cache; accessing the vertex indices written to the cache with a pixel shader; and accessing vertex parameter values associated with the vertex indices from a memory unit with the pixel shader.

In some implementations of the present disclosure, the computer graphics processing method may include performing vertex shader computations on the vertex parameter values with the pixel shader.

In some implementations, the computer graphics processing method may include interpolating the vertex parameter values with the pixel shader.

In some implementations, accessing the vertex indices may include copying the vertex indices from the cache to a local memory unit of a GPU, and accessing the indices from the local memory unit with the pixel shader.

In some implementations, the vertex shader computations may include manipulating a visual effect of a primitive’s vertex in three-dimensional virtual space.

In some implementations, accessing the vertex parameter values may include accessing parameter values of all three vertices of a triangle primitive.

In some implementations, the method may further include, after said accessing the vertex parameter values: performing vertex shader computations on the vertex parameter values with the pixel shader; interpolating the parameter values with the pixel shader; performing pixel shader computations on the interpolated parameter values with the pixel shader

In some implementations, the vertex shader output is limited to vertex position and the vertex indices, and the pixel shader may perform any remaining vertex shader computations after said accessing the vertex indices.

In some implementations, the memory unit is a main memory of a system.

In some implementations, the parameter values may be stored in vertex buffers in the main memory.

According to aspects of the present disclosure, a graphics processing system may include: a graphic processing unit (GPU); a memory unit; and a cache; and the system may be configured to implement a graphic processing method that may include: implementing a vertex shader and a pixel shader with the GPU; writing vertex indices output from a vertex shader to the cache; accessing the vertex indices written to the cache with the pixel shader; and accessing vertex parameter values associated with the vertex indices from the memory unit with the pixel shader.

In some implementations, the memory unit may be a main memory unit of the system

In some implementations, the GPU may include a plurality of compute units and a plurality of local memory units, wherein each of the local memory units are associated with a respective one of the compute units.

In some implementations, said accessing the vertex indices may include copying the vertex indices from the cache to the local memory units, and accessing the indices from the local memory units with the pixel shader.

In some implementations, the cache may be integrated with the GPU.

According to aspects of the present disclosure, a non-transitory computer readable medium may have computer readable instructions embodied therein, the computer readable instructions being configured to implement a graphics processing method when executed, the graphics processing method including: writing vertex indices output from a vertex shader to a cache; accessing the vertex indices written to the cache with a pixel shader; and accessing vertex parameter values associated with the vertex indices from a memory unit with the pixel shader.

发表评论

电子邮件地址不会被公开。 必填项已用*标注