This disclosure relates generally to graphics processors and more specifically to techniques for processing groups of graphics work in a pipelined manner.
Graphics processing work is often formed into groups that are scheduled by graphics firmware for execution. Each group may be associated with state information, shader programs to execute, buffer information, texture data, address spaces, etc. that are needed to complete the work. Groups may be formed for different types of graphics work, such as compute tasks, fragment processing, or vertex processing, for example. These groups may be referred to as “kicks.” Multiple kicks may be executed to render a frame of graphics data, for example. Typically, graphics firmware programs configuration registers for each kick before sending the work to the pipeline for processing. Often, once a kick has started, it does not access a memory hierarchy above a certain level until the kick is finished (at which point results may be written to a higher level in the hierarchy).
With one set of configuration registers, a given kick must complete before the configuration registers for the pipeline can be updated for another kick. This may result in intervals where the graphics pipeline is not utilized. Further, higher-priority work may have to wait for prior kicks to finish before starting execution.
This specification includes references to various embodiments, to indicate that the present disclosure is not intended to refer to one particular implementation, but rather a range of embodiments that fall within the spirit of the present disclosure, including the appended claims. Particular features, structures, or characteristics may be combined in any suitable manner consistent with this disclosure.
Within this disclosure, different entities (which may variously be referred to as “units,” “circuits,” other components, etc.) may be described or claimed as “configured” to perform one or more tasks or operations. This formulation—[entity] configured to [perform one or more tasks]—is used herein to refer to structure (i.e., something physical, such as an electronic circuit). More specifically, this formulation is used to indicate that this structure is arranged to perform the one or more tasks during operation. A structure can be said to be “configured to” perform some task even if the structure is not currently being operated. A “shader pipeline configured to process graphics data” is intended to cover, for example, a circuit that performs this function during operation, even if the circuit in question is not currently being used (e.g., power is not connected to it). Thus, an entity described or recited as “configured to” perform some task refers to something physical, such as a device, circuit, memory storing program instructions executable to implement the task, etc. This phrase is not used herein to refer to something intangible.
The term “configured to” is not intended to mean “configurable to.” An unprogrammed FPGA, for example, would not be considered to be “configured to” perform some specific function, although it may be “configurable to” perform that function. After appropriate programming, the FPGA may then be configured to perform that function.
Reciting in the appended claims that a structure is “configured to” perform one or more tasks is expressly intended not to invoke 35 U.S.C. § 112(f) for that claim element. Accordingly, none of the claims in this application as filed are intended to be interpreted as having means-plus-function elements. Should Applicant wish to invoke Section 112(f) during prosecution, it will recite claim elements using the “means for” [performing a function] construct.
As used herein, the term “based on” is used to describe one or more factors that affect a determination. This term does not foreclose the possibility that additional factors may affect the determination. That is, a determination may be solely based on specified factors or based on the specified factors as well as other, unspecified factors. Consider the phrase “determine A based on B.” This phrase specifies that B is a factor that is used to determine A or that affects the determination of A. This phrase does not foreclose that the determination of A may also be based on some other factor, such as C. This phrase is also intended to cover an embodiment in which A is determined based solely on B. As used herein, the phrase “based on” is synonymous with the phrase “based at least in part on.”
Further, as used herein, the terms “first,” “second,” “third,” etc. do not necessarily imply an ordering (e.g., temporal) between elements. For example, a referring to a “first” graphics operation and a “second” graphics operation does not imply an ordering of the graphics operation, absent additional language constraining the temporal relationship between these operations. In short, references such as “first,” “second,” etc. are used as labels for ease of reference in the description and the appended claims.
This disclosure initially describes, with reference to
Referring to
Referring now to
Vertex pipe 185, in the illustrated embodiment, may include various fixed-function hardware configured to process vertex data. Vertex pipe 185 may be configured to communicate with programmable shader 160 in order to coordinate vertex processing. In the illustrated embodiment, vertex pipe 185 is configured to send processed data to fragment pipe 175 and/or programmable shader 160 for further processing.
Fragment pipe 175, in the illustrated embodiment, may include various fixed-function hardware configured to process pixel data. Fragment pipe 175 may be configured to communicate with programmable shader 160 in order to coordinate fragment processing. Fragment pipe 175 may be configured to perform rasterization on polygons from vertex pipe 185 and/or programmable shader 160 to generate fragment data. Vertex pipe 185 and/or fragment pipe 175 may be coupled to memory interface 180 (coupling not shown) in order to access graphics data.
Programmable shader 160, in the illustrated embodiment, is configured to receive vertex data from vertex pipe 185 and fragment data from fragment pipe 175 and/or TPU 165. Programmable shader 160 may be configured to perform vertex processing tasks on vertex data which may include various transformations and/or adjustments of vertex data. Programmable shader 160, in the illustrated embodiment, is also configured to perform fragment processing tasks on pixel data such as texturing and shading, for example. Programmable shader 160 may include multiple execution instances for processing data in parallel.
TPU 165, in the illustrated embodiment, is configured to schedule fragment processing tasks from programmable shader 160. In some embodiments, TPU 165 is configured to pre-fetch texture data and assign initial colors to fragments for further processing by programmable shader 160 (e.g., via memory interface 180). TPU 165 may be configured to provide fragment components in normalized integer formats or floating-point formats, for example. In some embodiments, TPU 165 is configured to provide fragments in groups of four (a “fragment quad”) in a 2×2 format to be processed by a group of four execution pipelines in programmable shader 160.
Image write unit (IWU) 170, in some embodiments, is configured to store processed tiles of an image and may perform operations to a rendered image before it is transferred for display or to memory for storage. In some embodiments, graphics unit 150 is configured to perform tile-based deferred rendering (TBDR). In tile-based rendering, different portions of the screen space (e.g., squares or rectangles of pixels) may be processed separately. Memory interface 180 may facilitate communications with one or more of various memory hierarchies in various embodiments.
In various embodiments, a programmable shader such as programmable shader 160 may be coupled in any of various appropriate configurations to other programmable and/or fixed-function elements in a graphics unit. The exemplary embodiment of
In some embodiments, graphics unit 150 is configured to divide graphics processing work into kicks and configuration registers included in graphics unit 150 are programmed for each kick and used to perform graphics operations. Information for a given kick may include state information, location of shader programs to execute, buffer information, location of texture data, available address spaces, etc. that are needed to complete the corresponding graphics operations. Graphics firmware may schedule kicks and detect an interrupt when a kick is complete, for example.
In the illustrated embodiment, front pipeline 220, back pipeline 240, and/or shared resource 230 perform graphics operations based on information in configuration registers 250. In other embodiments, only a portion of the pipeline may utilize configuration registers 250. In some embodiments, configuration registers 250 include multiple sets of registers configured to store information for multiple kicks at the same time. In the illustrated example, configuration registers 250 include data for both kick A and kick B. In various embodiments, this may facilitate pipelining and/or preemption of kicks, which may improve performance relative to implementations with registers for only one kick at a time.
The concept of a “pipeline” is well understood, and refers to the concept of splitting the “work” a processor performs on instructions into multiple stages. In CPUs, for example, these stages may include instruction decode, dispatch, execution, and retirement. In graphics units, these stages may include various operations for graphics elements such as vertices or fragments. For example, if front pipeline 220 is configured to process fragment data, it may include stages for fetching parameters, rasterization, depth and/or stencil tests, tag buffer allocation, etc. Many different pipeline architectures are possible with varying orderings of elements/portions. Various pipeline stages perform such steps on an instruction during one or more processor clock cycles, then pass the instruction and/or operations associated with the instruction on to other stages for further processing.
Further, the term “pipeline” may be used to refer to an entire pipeline structure (which may include shared hardware resources) or a portion thereof. For example, the circuitry in
Hardware Utilization with Exemplary Kick Processing Techniques
In contrast,
In some embodiments, the graphics unit or the graphics program is configured to determine whether there are dependencies between kicks. In these embodiments, a kick that depends on a previous kick may not be pipelined with the previous kick (rather, the previous kick should complete execution before start of the subsequent, dependent kick). In some embodiments, barrier operations may be used to handle dependencies between kicks. For example, a barrier may be used to specify that a prior kick must reach a certain execution point before starting a second kick. There may be different indicators for barrier status, such as complete, complete and fenced, complete and written to memory, etc.
In some embodiments, using multiple sets of configuration registers may also allow concurrent use of hardware resources by multiple kicks. For example, one kick may at least partially use of hardware resources previously-assigned another kick.
In
In some embodiments, preemption may be handled based on priority. In some embodiments, a single bit may be used to indicate higher-priority kicks. In other embodiments, multiple priority levels may be implemented. As discussed above, higher-priority kicks may completely preempt lower-priority kicks during certain time intervals or may commandeer only a portion of their hardware resources for certain time intervals. In other embodiments, allocation information associated with a kick may explicitly indicate an amount of hardware allocated to a kick. If such a kick is a higher-priority kick, it may receive all of its allocated resources while remaining resources may be used by one or more lower-priority kicks, which may not receive their full allocation until higher-priority kicks have finished.
Note that, in some embodiments, the techniques illustrated in
Exemplary Kick Execution with Command Buffers and Multiple Data Masters
In some embodiments, pipelining and preemption of kicks is performed only among kicks from a particular data master. For example, in these embodiments pixel kicks may be pipelined and may preempt each other, but may not be pipelined with or preempt compute kicks. This may allow use of specialized circuitry for at least a portion of the pipeline for each data master.
In the illustrated embodiment, each command buffer 425 includes a set of one or more kicks. As shown a given command buffer may include kicks from multiple ones of the data masters 420. Further each data master may include multiple kicks in the same command buffer. For example, in the illustrated embodiment and with respect to “cbuf 0,” kick “k1” and kick “k2” are executed on command stream 420A and command stream 420B respectfully, yet the two kicks are grouped in a single command buffer “cbuf0.”
In some embodiments, a kick is an atomic unit of work from the view of other portions of graphics unit 150. Thus, in some embodiments, any data that is needed for a given kick is read from memory that is shared among multiple processing elements at the beginning of the kick and results are written back to shared memory at the end of the kick. Therefore, other hardware does not see the results of the kick until completion of the kick, at which point the results are available in shared memory and can be accessed by other kicks (including kicks from other data masters). A kick may include a set of one or more rendering commands, which may include a command to draw procedural geometry, a command to set a shadow sampling method, a command to draw meshes, a command to retrieve a texture, a command to perform generation computation, etc. A kick may be executed at one of various stages during the rendering of a frame. Examples of rendering stages include, without limitation: camera rendering, light rendering, projection, texturing, fragment shading, etc.
Exemplary Embodiment with Multiple Data Masters and Front/Back-End Circuitry
Note that the fragment pipe 175 and the vertex pipe 185 are examples of the front pipeline circuitry 220 of
For vertex kicks, in the illustrated embodiment, vertex data master 520 sends control information to vertex pipe 185 and retrieves input data for kicks from memory 510. Vertex pipe 185, in the illustrated embodiment, is fixed-function circuitry that processes the input data based on information in configuration registers 550. In some embodiments, vertex pipe 185 is configured to perform operations such as culling, clipping, viewport transformation, etc. In some embodiments, vertex pipe 185 may have data for different kicks in different stages of the pipe, using different sets of registers in configuration registers 550. Thus, the appropriate configuration register data for a given kick may be multiplexed into the pipeline stages processing that kick. In some embodiments, vertex pipe 185 does not allow concurrent execution of kicks within a given pipeline stage but may allow concurrent execution via interleaving. In embodiments with complete preemption, vertex pipe 185 may stop processing a lower priority kick and allow its data to empty from the pipeline (e.g., for further processing by programmable shader 160). In some embodiments that allow concurrent kicks, programmable shader 160 may allow parallel processing of multiple vertex kicks.
Note that programmable shader may also be performing tasks for other data masters. Therefore, vertex data master 520 may be assigned only a portion of the resources (e.g., a percentage of the shaders, memory resources, etc.) of programmable shader 160. In embodiments with concurrent kicks and/or preemption, vertex kicks may then contend for the resources assigned to vertex data master 520, e.g., based on their priority.
In the illustrated embodiment, compression and list builder 560 is configured for tile-based processing and is configured to compress vertex data from programmable shader 160 and build lists of vertices that intersect each tile. Compression may reduce memory requirements for memory 510. When the tiles are later processed (e.g., under the control of pixel data master for rasterization and shading) the lists may be accessed to determine which vertices should be fetched. In some embodiments, compression and list builder 560 is fixed-function circuitry (e.g., in contrast to programmable shader 160, which executes various graphics instructions). In the illustrated embodiment, compression and list builder circuitry 560 sends its output data back to memory 510, where it may be stored for further processing.
Pixel data master 530 similarly may send pixel kicks to fragment pipe 175 and then for further processing by programmable shader 160. In some embodiments, fragment pipe 175 is configured to perform rasterization and includes depth and stencil buffers configured to determine which fragments from rasterization are visible and should be shaded. In some embodiments, fragment pipe 175 includes a tag buffer for fragments being aggregated until they are sent to programmable shader 160. In some embodiments, programmable shader 160 is configured to shade pixels from fragment pipe 175. In some embodiments, multi-sample anti-aliasing (MSAA) hardware in fragment back-end circuitry 570 may further process shaded pixels from programmable shader 160 before storing pixel data in memory (e.g., for eventual display).
Compute data master 540, in the illustrated embodiment, is configured to send compute kicks (which may each include multiple kernels) to programmable shader 160. In various embodiments, the pipelining, concurrency, and preemption techniques discussed above with reference to vertex kicks may be performed for pixel and/or compute kicks.
Shared resource 230, in the illustrated embodiment, includes a portion of its hardware resources assigned to kick A and a smaller portion to kick B. These portions may execute in parallel in some embodiments, e.g., using different shader cores. Back pipeline 240, in the illustrated embodiment, also includes different kick data in different stages, similarly to front pipeline 220.
At 710, in the illustrated embodiment, a graphics unit stores, in first storage circuitry, configuration information for a first group of graphics work to be performed by the graphics processor.
At 720, in the illustrated embodiment, the graphics unit stores, in second storage circuitry, configuration information for a second group of graphics work to be performed by the graphics processor.
At 730, in the illustrated embodiment, the graphics unit uses pipeline circuitry to perform graphics processing operations for the first and second groups of graphics work. In the illustrated embodiment, this includes pipelining processing of the first and second groups of graphics work such that data for both groups is processed in different stages of the pipeline circuitry during a given clock cycle. In the illustrated embodiment, during the clock cycle, the processing for the different stages is based on configuration information stored in the first and second storage circuitry respectively. For example, the method may include MUXing the configuration information to the proper pipeline stages.
In some embodiments, the second group is older than the first group (e.g., the second group may have been initiated by a graphics driver before initiation of the first group) and the first group has a higher priority than the second group. In some embodiments, and the graphics pipeline pauses processing for the second group until completion of the first group (note that stages for the second group may be allowed to complete after the pause, even in some preemption embodiments). In some embodiment, the graphics unit is configured to assign a first portion of a shared resource (e.g., programmable shader 160) to the first group and a second portion of the shared resource to the second group in response to determining that the first group has a higher priority than the second group. In some embodiments, the pipeline circuitry includes a front fixed-function portion, a programmable shader portion, and a back fixed-function portion. In some embodiments, the front fixed-function portion is configured to perform graphics processing based on configuration information in both the first storage circuitry and the second storage circuitry at the same time. In some embodiments, the configuration information includes one or more of: an indication of a location of a shader program, an indication of a location of a texture, an indication of a memory space, or state information.
In some embodiments, graphics firmware performs the following method elements. The firmware programs first storage circuitry and second storage circuitry with different sets of configuration information for different kicks. The firmware launches the kicks at a point in time when configuration for both kicks is stored in the different storage circuitry and data for both kicks is processed in different stages of the graphics pipeline during a given clock cycle, based on configuration information stored in the first and second storage circuitry respectively. In some embodiments the graphics firmware is stored on a computer-readable medium in the graphics unit.
Referring now to
Fabric 810 may include various interconnects, buses, MUX's, controllers, etc., and may be configured to facilitate communication between various elements of device 800. In some embodiments, portions of fabric 810 may be configured to implement various different communication protocols. In other embodiments, fabric 810 may implement a single communication protocol and elements coupled to fabric 810 may convert from the single communication protocol to other communication protocols internally.
In the illustrated embodiment, compute complex 820 includes bus interface unit (BIU) 825, cache 830, and cores 835 and 840. In various embodiments, compute complex 820 may include various numbers of processors, processor cores and/or caches. For example, compute complex 820 may include 1, 2, or 4 processor cores, or any other suitable number. In one embodiment, cache 830 is a set associative L2 cache. In some embodiments, cores 835 and/or 840 may include internal instruction and/or data caches. In some embodiments, a coherency unit (not shown) in fabric 810, cache 830, or elsewhere in device 800 may be configured to maintain coherency between various caches of device 800. BIU 825 may be configured to manage communication between compute complex 820 and other elements of device 800. Processor cores such as cores 835 and 840 may be configured to execute instructions of a particular instruction set architecture (ISA) which may include operating system instructions and user application instructions.
Cache/memory controller 845 may be configured to manage transfer of data between fabric 810 and one or more caches and/or memories. For example, cache/memory controller 845 may be coupled to an L3 cache, which may in turn be coupled to a system memory. In other embodiments, cache/memory controller 845 may be directly coupled to a memory. In some embodiments, cache/memory controller 845 may include one or more internal caches.
As used herein, the term “coupled to” may indicate one or more connections between elements, and a coupling may include intervening elements. For example, in
Graphics unit 150 may include one or more processors and/or one or more graphics processing units (GPU's). Graphics unit 150 may receive graphics-oriented instructions, such as OPENGL®, Metal, or DIRECT3D® instructions, for example. Graphics unit 150 may execute specialized GPU instructions or perform other operations based on the received graphics-oriented instructions. Graphics unit 150 may generally be configured to process large blocks of data in parallel and may build images in a frame buffer for output to a display. Graphics unit 150 may include transform, lighting, triangle, and/or rendering engines in one or more graphics processing pipelines. Graphics unit 150 may output pixel information for display images. In some embodiments, graphics unit 150 is configured to perform one or more of the memory consistency, mid-render compute, local image block, and/or pixel resource synchronization techniques discussed above.
Display unit 865 may be configured to read data from a frame buffer and provide a stream of pixel values for display. Display unit 865 may be configured as a display pipeline in some embodiments. Additionally, display unit 865 may be configured to blend multiple frames to produce an output frame. Further, display unit 865 may include one or more interfaces (e.g., MIPI® or embedded display port (eDP)) for coupling to a user display (e.g., a touchscreen or an external display).
I/O bridge 850 may include various elements configured to implement: universal serial bus (USB) communications, security, audio, and/or low-power always-on functionality, for example. I/O bridge 850 may also include interfaces such as pulse-width modulation (PWM), general-purpose input/output (GPIO), serial peripheral interface (SPI), and/or inter-integrated circuit (I2C), for example. Various types of peripherals and devices may be coupled to device 800 via I/O bridge 850.
The present disclosure has described various exemplary circuits in detail above. It is intended that the present disclosure cover not only embodiments that include such circuitry, but also a computer-readable storage medium that includes design information that specifies such circuitry. Accordingly, the present disclosure is intended to support claims that cover not only an apparatus that includes the disclosed circuitry, but also a storage medium that specifies the circuitry in a format that is recognized by a fabrication system configured to produce hardware (e.g., an integrated circuit) that includes the disclosed circuitry. Claims to such a storage medium are intended to cover, for example, an entity that produces a circuit design, but does not itself fabricate the design.
Non-transitory computer-readable medium 910, may comprise any of various appropriate types of memory devices or storage devices. Medium 910 may be an installation medium, e.g., a CD-ROM, floppy disks, or tape device; a computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; a non-volatile memory such as a Flash, magnetic media, e.g., a hard drive, or optical storage; registers, or other similar types of memory elements, etc. Medium 910 may include other types of non-transitory memory as well or combinations thereof. Medium 910 may include two or more memory mediums which may reside in different locations, e.g., in different computer systems that are connected over a network.
Design information 915 may be specified using any of various appropriate computer languages, including hardware description languages such as, without limitation: VHDL, Verilog, SystemC, SystemVerilog, RHDL, M, MyHDL, etc. Design information 915 may be usable by semiconductor fabrication system 920 to fabricate at least a portion of integrated circuit 930. The format of design information 915 may be recognized by at least one semiconductor fabrication system 920. In some embodiments, design information 915 may also include one or more cell libraries which specify the synthesis and/or layout of integrated circuit 930. In some embodiments, the design information is specified in whole or in part in the form of a netlist that specifies cell library elements and their connectivity. Design information 915, taken alone, may or may not include sufficient information for fabrication of a corresponding integrated circuit. For example, design information 915 may specify the circuit elements to be fabricated but not their physical layout. In this case, design information 915 may need to be combined with layout information to actually fabricate the specified circuitry.
Semiconductor fabrication system 920 may include any of various appropriate elements configured to fabricate integrated circuits. This may include, for example, elements for depositing semiconductor materials (e.g., on a wafer, which may include masking), removing materials, altering the shape of deposited materials, modifying materials (e.g., by doping materials or modifying dielectric constants using ultraviolet processing), etc. Semiconductor fabrication system 920 may also be configured to perform various testing of fabricated circuits for correct operation.
In various embodiments, integrated circuit 930 is configured to operate according to a circuit design specified by design information 915, which may include performing any of the functionality described herein. For example, integrated circuit 930 may include any of various elements shown in
As used herein, a phrase of the form “design information that specifies a design of a circuit configured to . . . ” does not imply that the circuit in question must be fabricated in order for the element to be met. Rather, this phrase indicates that the design information describes a circuit that, upon being fabricated, will be configured to perform the indicated actions or will include the specified components.
Although specific embodiments have been described above, these embodiments are not intended to limit the scope of the present disclosure, even where only a single embodiment is described with respect to a particular feature. Examples of features provided in the disclosure are intended to be illustrative rather than restrictive unless stated otherwise. The above description is intended to cover such alternatives, modifications, and equivalents as would be apparent to a person skilled in the art having the benefit of this disclosure.
The scope of the present disclosure includes any feature or combination of features disclosed herein (either explicitly or implicitly), or any generalization thereof, whether or not it mitigates any or all of the problems addressed herein. Accordingly, new claims may be formulated during prosecution of this application (or an application claiming priority thereto) to any such combination of features. In particular, with reference to the appended claims, features from dependent claims may be combined with those of the independent claims and features from respective independent claims may be combined in any appropriate manner and not merely in the specific combinations enumerated in the appended claims.