Search

EP-4238050-B1 - FAST INCREMENTAL SHARED CONSTANTS

EP4238050B1EP 4238050 B1EP4238050 B1EP 4238050B1EP-4238050-B1

Inventors

  • FRISINGER, THOMAS EDWIN
  • HAMMERSTONE, RICHARD
  • GRUBER, ANDREW EVAN
  • ZHONG, Gang
  • DU, YUN
  • NAGENDRA KUMAR, JONNALA GADDA

Dates

Publication Date
20260506
Application Date
20210928

Claims (15)

  1. A method of graphics processing, comprising: receiving (506), in at least one register, shared constant data from a central processing unit, CPU, the shared constant data comprising constants that are shared across different shader stages, the shared constant data corresponding to a draw call update of a first draw call of a plurality of draw calls; updating (508) the at least one register based on the shared constant data corresponding to the draw call update of the first draw call; sending (510) the shared constant data corresponding to the draw call update of the first draw call to at least one of a constant memory or a constant buffer; storing (512) the shared constant data in the at least one of the constant memory or the constant buffer; receiving (514), in the at least one register, updated shared constant data from the CPU, the updated shared constant data corresponding to a draw call update of a second draw call of the plurality of draw calls, the second draw call being subsequent to the first draw call; and, updating the at least one register based on the updated shared constant data.
  2. The method of claim 1, wherein the constant memory is a constant random access memory, RAM.
  3. The method of claim 1, further comprising configuring (502) a shader preamble for at least one shader prior to receiving the shared constant data from the CPU.
  4. The method of claim 3, wherein the shared constant data is received based on the shader preamble for the at least one shader.
  5. The method of claim 3, wherein the at least one shader includes at least one of a vertex shader, a fragment shader, or a geometry shader.
  6. The method of claim 1, further comprising performing an initial configuration (504) of the at least one register prior to receiving the shared constant data from the CPU.
  7. The method of claim 1, wherein the at least one register is updated independently from at least one other register.
  8. The method of claim 1, wherein the at least one register is at least one of a context register or a pipeline register.
  9. The method of claim 1, wherein the shared constant data is associated with at least one context register state of the at least one register.
  10. An apparatus for graphics processing, comprising: a memory; and at least one processor coupled to the memory and configured to: receive (506), in at least one register, shared constant data from a central processing unit, CPU, the shared constant data comprising constants that are shared across different shader stages, the shared constant data corresponding to a draw call update of a first draw call of a plurality of draw calls; update (508) the at least one register based on the shared constant data corresponding to the draw call update of the first draw call; send (510) the shared constant data corresponding to the draw call update of the first draw call to at least one of a constant memory or a constant buffer; store (512) the shared constant data in the at least one of the constant memory or the constant buffer; receive (514), in the at least one register, updated shared constant data from the CPU, the updated shared constant data corresponding to a draw call update of a second draw call of the plurality of draw calls, the second draw call being subsequent to the first draw call; and update the at least one register based on the updated shared constant data.
  11. The apparatus of claim 10, wherein the constant memory is a constant random access memory, RAM.
  12. The apparatus of claim 10, wherein the at least one register is at least one of a context register or a pipeline register.
  13. The apparatus of claim 10, wherein the apparatus is a wireless communication device.
  14. The apparatus of claim 10, configured to perform the method of any one of claims 1 to 9.
  15. A computer-readable medium storing computer executable code, the code when executed by at least one processor, causes the at least one processor execute the method of claim 1.

Description

BACKGROUND Technical Field The present disclosure relates generally to processing systems, and more particularly, to one or more techniques for graphics processing. Introduction Computing devices often perform graphics processing (e.g., utilizing a graphics processing unit (GPU)) to render graphical data for display by the computing devices. Such computing devices may include, for example, computer workstations, mobile phones such as smartphones, embedded systems, personal computers, tablet computers, and video game consoles. GPUs are configured to execute a graphics processing pipeline that includes one or more processing stages which operate together to execute graphics processing commands and output a frame. A central processing unit (CPU) may control the operation of the GPU by issuing one or more graphics processing commands to the GPU. Modem day CPUs are typically capable of executing multiple applications concurrently, each of which may need to utilize the GPU during execution. A device that provides content for visual presentation on a display may utilize a GPU. GPU operations may be based on shader processing techniques that utilize non-incremental constants. This may be beneficial in binning architectures because it can allow each draw call to be independent. However, non-incremental constants may not be the most efficient technique in some instances. Accordingly, there is a need for improved shader processing techniques. US 8120608 discloses a programmable graphics processing system and method in which a first group of constants corresponding to a first rendering context are received at a constant buffer. In response to a second shader operation, a second group of constants corresponding to a second rendering context are received without flushing the first group. SUMMARY The following presents a simplified summary of one or more aspects in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later. Constant data utilized for shader processing may be loaded to a dedicated block of constant memory and may remain constant across an entire draw call. Constants indicated via the constant data may be changed for subsequent draw calls, such as when lighting relationships change with respect to items/features within a frame. In order to change the constants for the subsequent draw calls, all new constant data may be loaded to the constant memory/constant buffer, even if a small amount of the constant data is to be changed from a previous version of the constant data. In some cases, the entire constant buffer may be copied to change a small subset of the constants in the constant buffer, so that GPU commands currently being processed based on a prior version of the constant buffer are not impacted by the changes to the constant buffer. Copying the entire constant buffer each time a change to the constant buffer is to occur may result in significant overhead associated with determining when to release each version of the constant buffer and may provide a pipeline of constant buffers. Accordingly, shared constants, which are constants that may be shared across different shader stages, may be configured to appear to a driver interface as context registers. The shared constants may be loaded to a register storage in an incremental manner. Based on execution of a shader preamble, the driver may program the shared constants/context registers to be mapped to the constant memory/constant buffer in a non-incremental manner. The shader preamble may be executed once per draw call before a main portion of the shader to copy the shared constants from the context registers to the constant memory/constant buffer on an as-needed basis. For instance, if three shared constants are copied to the constant memory for a first draw call and another three shared constants are copied to the constant memory for a second draw call, six shared constants may be available for the second draw call. After the shared constants are loaded to the constant memory from the register data, shader execution may be performed as usual, regardless of whether the constants are shared constants or regular/unshared constants. The scope of the present invention is defined by the scope of the appended claims. Any embodiments that do not fall under the scope of the claims are examples which are useful for understanding the invention, but do not form a part of the invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram that illustrates an example content generation system in accordance with one or more techniques of this disclosure.FIG. 2 illustrates an example GPU in accordance with one or more