Methods and apparatus for efficient blending in graphics pipeline

The GPU blending unit optimizes blending operations by bypassing certain multiplier operations and tailoring hardware for different data formats and blend factors, addressing inefficiencies and reducing power consumption and area while maintaining throughput.

KR103045990B1Active Publication Date: 2026-11-11SAMSUNG ELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
KR1020210032287
Authority / Receiving Office
KR · KR
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-09-22
Filing Date
2021-03-11
Publication Date
2026-11-11
Estimated Expiration
2041-03-11

AI Technical Summary

Technical Problem

Existing graphics processing unit (GPU) pipelines face inefficiencies in blending operations, particularly in handling various blend factors and data formats, leading to increased power consumption and hardware area without maintaining throughput.

Method used

Implementing a blending unit with staging registers and multipliers that bypass operations for blend factors of 0 or 1, and optimizing hardware for common and less common blending cases, using data paths tailored to different data formats and bit widths, and employing multiplexers to manage different blending modes.

Benefits of technology

Enhances blending efficiency by reducing power consumption and hardware area while maintaining throughput, supporting various blend factors and data formats, and optimizing for common and less common operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 112021029078980-PAT00002_ABST
    Figure 112021029078980-PAT00002_ABST
Patent Text Reader

Abstract

A method for performing a blending operation in a graphics processing unit may include the steps of: multiplying a first value for a component of a render target and a first blend factor using a first multiplication operation of a multiplier; multiplying a second value for the component of the render target and a second blend factor using a second multiplication operation of the multiplier; and adding the first result of the first multiplication operation and the second result of the second multiplication operation. The method may further include the step of bypassing the multiplier for the first blend factor of substantially '0'. For a blend factor of substantially '1', the method may further include the step of bypassing the multiplier and providing the first value of the component of the render target as the result of the first multiplication operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] The present disclosure generally relates to graphics processing, and more specifically to a method and apparatus for efficient blending in a graphics pipeline. Background Technology

[0002] A pipeline for a graphics processing unit (GPU) may include a blending unit that enables a programmer or application to implement various effects. For example, the blending unit may allow color values ​​of pixels stored in a frame buffer to be blended with color values ​​of incoming pixels from a pixel shader to provide a transparency effect.

[0003] The information disclosed in the above-mentioned background section is intended only to enhance understanding of the background of the present invention and may include information that does not constitute prior art. The problem to be solved

[0004] The object of the present disclosure is to provide a method and apparatus for efficient blending in a graphics pipeline. means of solving the problem

[0005] A processing method in a graphics processing unit may include the steps of receiving a first value and a first blend factor for a component of a render target, receiving a second value and a second blend factor for said component of the render target, and performing a blending operation. The blending operation may include the steps of multiplying the first value and the first blend factor using a first multiplication operation of a multiplier, multiplying the second value and the second blend factor using a second multiplication operation of the multiplier, and adding the first result of the first multiplication operation and the second result of the second multiplication operation. The method may further include the step of bypassing the multiplier for the first blend factor which is substantially '0'. The method may further include the step of bypassing the multiplier for the second blend factor which is substantially '0'. The above method may further include the steps of bypassing the multiplier for a blend factor of substantially '1' and providing the first value of the component of the render target as the result of the first multiplication operation. The first result of the first multiplication operation may be added to the second result of the second multiplication operation through a feedback path. The multiplier may be a first multiplier of a first data path having a first data format. The component of the render target may be a first component of the first render target. And the above method may further include the step of multiplying a third value and a third blend factor for a second component of the second render target using a second multiplier of a second data path having a second data format.The above method may further include the steps of transferring the first value and the first blend factor to the first multiplier through a staging register and transferring the third value and the third blend factor to the second multiplier through the staging register. The first data format may include a normalized integer format. The second data format may include a floating-point format.

[0006] The processing unit may include a multiplier, an input staging register configured to pass a first value and a first blend factor for a component of a render target to the multiplier for a first multiplication operation, and a second value and a second blend factor for the component of the render target to the multiplier for a second multiplication operation, and an adder configured to add a first result of the first multiplication operation and a second result of the second multiplication operation. The input staging register may be configured to bypass the multiplier for the first blend factor which is substantially '0'. The input staging register may be configured to bypass the multiplier for the second blend factor which is substantially '0'. The input staging register may be configured to bypass the multiplier as the first result of the first multiplication operation for the first blend factor of '1' and provide the first value of the component of the render target. The input staging register may be configured to bypass the multiplier as the second result of the second multiplication operation for the second blend factor of '1' and provide the second value of the component of the render target. The first result of the first multiplication operation may be applied to the adder through a feedback path. The graphics processing unit may further include an output staging register configured to pass the output of the adder to a buffer.

[0007] A graphics processing unit may include a blending unit comprising blending logic having a first mode and a second mode, and an input staging register configured to transmit first data having a first format of a first width to the blending unit in the first mode, and second data having a second format of a second width to the blending unit in the second mode. The second width may be substantially larger than the first width. The blending logic may be configured to blend the first data with a first throughput in the first mode and to blend the second data with a second throughput substantially lower than the first throughput in the second mode. The first format and the second format may include unorm. The blending logic may include a layer of multipliers arranged to multiply the pairs of the first data, a layer of first adders arranged to combine the outputs from the pairs of multipliers to provide first blended outputs having the first width at the first throughput, and a second adder arranged to combine the outputs from the layer of multipliers to provide a second blended output having the second width at the second throughput. The first format and the second format may include floating point. The blending logic may include a multiply-add module and a multiplexer configured to pass the floating point data having the first width or the floating point data having the second width to the multiply input of the multiply-add module.The multiplication-addition module may be configured to perform two floating-point multiplication-addition operations in the first width or one floating-point multiplication-addition operation in the second width in the same number of cycles. The graphics processing unit may further include a feedback path configured to transmit the result output from the multiplication-addition module to the addition input of the multiplication-addition module. Effects of the invention

[0008] According to embodiments of the present disclosure, a method and apparatus for efficient blending in a graphics pipeline are provided. Brief explanation of the drawing

[0009] The drawings are not necessarily drawn to scale, and elements of similar structure or function are generally indicated by similar reference numbers throughout the drawings for illustrative purposes. The drawings are intended only to illustrate the various embodiments disclosed herein. The drawings do not describe all aspects of the instructions disclosed herein and do not limit the scope of the claims. The drawings attached to this specification may be used to illustrate exemplary embodiments of the present disclosure and to explain the principles of the present disclosure together with the detailed description. FIG. 1 illustrates an example of a blending unit for a GPU according to the present disclosure. FIG. 2 illustrates an example of a blend factor generator according to the present disclosure. FIG. 3 illustrates an example of blending logic according to the present disclosure. FIG. 4 illustrates an embodiment of a blending unit having staging registers according to the present disclosure. FIG. 5 illustrates an example of blending logic for unorm8 and unorm16 operands according to the present disclosure. FIG. 6 illustrates an example of blending logic for floating-point operands according to the present disclosure. FIG. 7 illustrates an example of a method for performing a blending operation in a graphics processing unit according to the present disclosure. FIG. 8 illustrates an embodiment of an image display device (804) in which any of the methods or devices described in the present disclosure may be integrated. Specific details for implementing the invention

[0010] The present disclosure includes many inventive principles regarding shared resources for blending operations in a graphics pipeline. These principles may have independent utility and may be implemented individually, but not all embodiments may be able to utilize all principles. Additionally, the principles may also be implemented in various combinations, some of which may amplify the advantages of individual principles in a synergistic manner.

[0011] Some of these principles involve using one or more time-shared resources for blending operations. For example, in some embodiments, a multiplier may perform two multiplications sequentially on a single component of a render target. One is for the source blend factor and the other is for the destination blend factor.

[0012] Several additional principles relate to shared resources based on data formats. For example, in some embodiments, in a first operation mode, a specified number of multipliers may be configured to perform four blend factor multiplications per clock cycle for components having an 8-bit unsigned normalized integer (unorm8) format. However, in a second operation mode, the same number of multipliers may be configured to perform one blend factor multiplication per clock cycle for components having a 16-bit normalized integer (unorm16) format.

[0013] Some additional principles relate to selectively bypassing multiplier operations in response to conditions such as blending operations that do not specify multiplication operations and / or a blend factor, source data and / or destination data that is '0' or '1'. For example, even if a blending operation specifies the multiplication of a source blend factor and source data, if the source blend factor is 1, the multiplication operation may be omitted and the value of the source data may be used as the result.

[0014] Some additional principles relate to using one or more staging structures to synchronize the flow of data through a blending unit. For example, in some embodiments, one or more input staging registers may be arranged in front of a blending unit that transmits component data and / or blending factors for various render targets to one or more data paths having operation structures capable of sequentially accommodating different data formats, the number of components, the number of render targets, etc. Each of the render targets may have different blend operations, the number of components, data formats, etc. For example, one or more input staging registers may schedule operations to reduce or eliminate blocking of some operations by other operations and to prevent overwriting of data for some render target components by data from other render target components.

[0015] In some embodiments, in a multi-pass situation where a single multiplier can perform sequential multiplication operations on components of a render target, one or more output staging registers may be placed after the blending unit to pass one or more results back to the blending unit. In some embodiments, one or more output staging registers may also schedule and / or pass outputs from the operation structures of the blending unit to one or more downstream structures, such as a tile buffer, a frame buffer, etc.

[0016] In some embodiments and depending on implementation details, the principles described above throughout this disclosure may enable the area cost and / or power consumption of a blending unit to be reduced by enhancing and / or optimizing the blending logic for more general cases while implementing functions for less general cases. Furthermore, any reduction in the area cost and / or power consumption of the blending logic described herein may be multiplied in a physical implementation that may include multiple instances of the blending logic.

[0017] Blending action

[0018] In some embodiments, blending can be implemented according to the following mathematical formula 1.

[0019]

[0020] C F can represent the final calculated value of a component (e.g., color). C S can represent the value of the source component. C D can represent the value of the destination component. BF S can represent the value of the source blend factor. BF D can represent the value of the destination blend factor. Accordingly, in some embodiments, component C F The final calculated value is the source and destination component C S and C D It may be the weighted sum of. Here, the source and target blend factors BF S and BF D are the source and destination components C, respectively. S and C D It can function as a coefficient for determining the relative amounts of. However, in some embodiments, blending may be implemented using a wide variety of different blend factors and / or blending equations. Equation 1 is just one example.

[0021] FIG. 1 illustrates an embodiment of a blending unit for a GPU according to the present disclosure. For example, the blending unit illustrated in FIG. 1 may be used to implement various blending factors and / or blending equations, including the example of Equation 1. The blending unit may include a source blend factor generator (102), a destination blend factor generator (104), and blending logic (106). Each of the blend factor generators (102 and 104) may receive source data from a source apparatus, such as a shader or fragment shader, such as a pixel. Each of the blend factor generators (102 and 104) may also receive destination data from a destination apparatus, such as a buffer, for example, a tile buffer or a frame buffer. Additionally, the blend factor generators (102 and 104) may receive one or more state inputs, which will be described in more detail below, through an application programming interface (API), for example, from an application or a programmer.

[0022] The source and destination blend factor generators (102 and 104) can each generate a source blend factor and a destination blend factor by combining source data and destination data in a manner that can be specified by one or more state inputs. For example, in some embodiments, the source and destination blend factor generators (102 and 104) can generate source and destination blend factors as shown in Table 1, which will be described in more detail below.

[0023] The blending logic (106) can receive source and destination data as well as source and destination blend factors, and can generate a final blending output by combining inputs according to a blending function that can be specified by one or more state inputs. For example, in some embodiments, the blending logic (106) can combine inputs according to one or more functions as shown in Table 2, which will be described in more detail below.

[0024] In some embodiments, the blending unit may also include a multiplexer (108) that provides a final blending output by selecting between the output of the blending logic (106) and a blending bypass path (110).

[0025] To illustrate the principles of the present disclosure, some embodiments of the blending method and / or apparatus may be described in the context of systems in which a render target, such as a pixel, may have four scalar components, such as, for example, red, green, and blue color channels and an alpha transparency channel. However, the principles are not limited to these implementation details. For example, the render target may be implemented with different numbers of components representing certain attributes, such as a vector component, such as a normal vector, scalars representing depth and / or other distance values, albedo and / or other reflection properties, and / or other types of data that can be processed by a GPU. Additionally, for example, the render target may relate to any collection of one or more components, such as subpixels, within a multi-sample anti-aliasing (MSAA) implementation or a variable rate shading apparatus. Additionally, some embodiments may include a blending apparatus for accommodating multiple render targets. For example, some embodiments may include a blending apparatus configured to blend four components per pixel having four render targets and one depth buffer. As another example, some embodiments may include a blending apparatus configured to blend four components per pixel having eight render targets and one depth buffer. Other embodiments may be configured for different numbers of render targets, buffers, etc., as well as different numbers of components per pixel.

[0026] In some embodiments, the blending method and / or apparatus according to the present disclosure may be used to implement standard graphics APIs such as OpenGL, OpenGL Embedded Systems (OpenGL ES), DX (Direct-X), Vulkan, etc. To illustrate the principles of the present disclosure, some embodiments of the blending method and / or apparatus may be described in the context of a system capable of implementing OpenGL and / or Vulkan APIs. However, the principles are not limited to systems implementing standard or non-standard APIs.

[0027] Table 1 provides some embodiments of blend factors that can be generated by the blend factor generator according to the present disclosure. For illustrative purposes, some of the blend factors may be described in the context of terms used in the OpenGL API, but the same or similar factors may be implemented in other standard and / or non-standard APIs.

[0028] Referring to Table 1, some of the above elements are as follows. Dst.X may relate to destination data (e.g., read from a tile buffer, frame buffer, etc.). Src.X may relate to source color data (e.g., provided by a shader such as a pixel shader). BlendColorAlpha may relate to the alpha component of BlendColor programmed via API. BlendColor_C may relate to the C color component of BlendColor (e.g., for a red component, C may be red; for a green component, C may be green; and for a blue component, C may be blue). Dst.C and Src.C may relate to specific color channel destination or source color values ​​in use (e.g., red, green, or blue). Dst.A and Src.A may relate to the destination alpha component and the source alpha component, respectively. For example, the red channel may use Dst.A, Src.A, Dst.R, and / or Src.R color values ​​for blending. However, as mentioned above, in some embodiments, the C and A components may be implemented as any type of data that can be processed on a GPU.

[0029] 코드 명칭 컬러 블렌드 팩터 알파 블렌드 팩터 0 BLEND_ZERO 0.0 0.0 1 BLEND_ONE 1.0 1.0 2 BLEND_SRC_COLOR Src.C Src.A 3 BLEND_ONE_MINUS_SRC_COLOR 1.0 - Src.C 1.0 - Src.A 4 BLEND_DEST_COLOR Dst.C Dst.A 5 BLEND_ONE_MINUS_DEST_COLOR 1.0 - Dst.C 1.0 - Dst.A 6 BLEND_SRC_ALPHA Src.A Src.A 7 BLEND_ONE_MINUS_SRC_ALPHA 1.0 - Src.A 1.0 - Src.A 8 BLEND_DEST_ALPHA Dst.A Dst.A 9 BLEND_ONE_MINUS_DEST_ALPHA 1.0 - Dst.A 1.0 - Dst.A 10 BLEND_CONST_COLOR BlendColor_C BlendColorAlpha 11 BLEND_ONE_MINUS_COLOR_CONST 1.0 - BlendColor_C 1.0 - BlendColorAlpha 12 BLEND_CONST_ALPHA BlendColorAlpha BlendColorAlpha 13 BLEND_ONE_MINUS_CONST_ALPHA 1.0 - BlendColorAlpha 1.0 - BlendColorAlpha 14 BLEND_SRC_ALPHA_SAT min ( Src . A , ( 1.0 - Dst . A ) ) 1.0

[0030] FIG. 2 illustrates an example of a blend factor generator according to the present disclosure. The blend factor generator illustrated in FIG. 2 may be used to implement, for example, one or both of the blend factor generators (102 and 104) illustrated in FIG. 1 and to generate one or more of the blend factors listed in Table 1.

[0031] Referring to FIG. 2, the blend factor generator may include an input multiplexer (202), a 1-X unit (1X unit; 204), a minimum value unit (206), an output multiplexer (208), and a clamp unit (210). As described above in relation to Table 1, the input multiplexer (202) can select among input values. In some embodiments, support for multiple-source blending (e.g., dual-source blending) may be implemented by adding more inputs to the input multiplexer (202).

[0032] The 1-X unit (204) can calculate a value obtained by subtracting an input value from 1 to implement any of the 1-X factors of Table 1, where X is any value applied to the 1-X unit (204). To determine the source alpha saturation (code 14) as illustrated in Table 1, the minimum value unit (206) can determine the minimum value among the output of the 1-X unit (204) and the source alpha component. The output multiplexer (208) can select one of the output of the 1-X unit (204), the minimum value unit (206), or the value selected by the input multiplexer (202). The final blend factor output can be clamped by the clamp unit (210). For example, as described in more detail below, the input multiplexer (202) and / or the output multiplexer (208) may operate in response to one or more state fields (State) that can be accessed via an API.

[0033] Table 2 provides some embodiments of blending operations (e.g., mathematical expressions) that can be generated by the blend factor generator according to the present disclosure. For illustrative purposes, some of the blend elements may be described in the context of terms used in the OpenGL API, but the same or similar factors may be implemented in other standard and / or non-standard APIs.

[0034] Referring to Table 2, some of the elements are as follows. Src.BlendFactor may be the result of calculating a blend factor specified for source data. Dst.BlendFactor may be the result of calculating a blend factor for destination data. In some embodiments, 'C' may represent a destination or source color channel value (e.g., red, green, or blue). However, in other embodiments, 'C' may represent any type of data that can be processed on a GPU.

[0035] 코드 명칭 기능 1 BLEND_OP_ADD (src0 * Src . BlendFactor . C ) + ( dst * Dst . BlendFactor . C ) 2 BLEND_OP_SUBTRACT (src0*Src.BlendFactor.C)-(dst*Dst.BlendFactor.C) 3 BLEND_OP_REV_SUBTRACT ( dst * Dst . BlendFactor . C ) - ( src0 * Src . BlendFactor . C ) 4 BLEND_OP_MIN fmin( src0 , dst ) 5 BLEND_OP_MAX fmax(src0, dst)

[0036] FIG. 3 illustrates an example of a blending logic according to the present disclosure. For example, the blending logic illustrated in FIG. 3 may be used to implement one or more of the blending logic (106) illustrated in FIG. 1 and the blending operations listed in Table 2.

[0037] Referring to FIG. 3, the blending logic may include a source multiplier (302), a destination multiplier (304), a source multiplexer (305), a destination multiplexer (306), a minimum value unit (308), pre-adder multiplexers (310 and 312), an adder (314), and an output multiplexer (316). For example, the multiplexers (305, 306, 310, 312 and / or 316) may operate in response to one or more state fields, such as one or more image state fields, one or more graphic state fields, etc., which can be accessed via an API, as well as other signals shown in FIG. 3. For example, in some embodiments, the image state field may configure blending logic for operation at an image granularity such as the number of render targets, the number of components of the render targets, and / or the format of the components of the render targets. The graphics state field may configure blending logic for operation at a graphics level of granularity such as the current blending operation (e.g., granularity more finely divided at the draw call level) (e.g., controls for Tables 1 and 2).

[0038] For example, the source and destination multipliers (302 and 304) may receive source and destination component data and blend factor data for each of the outputs of one or more blend factor generators, such as those shown in FIG. 2. The source multiplexer (305) may select between the output of the source multiplier (302) and source data that can bypass the source multiplier (302). The destination multiplexer (306) may select between the output of the destination multiplier (304) and destination data that can bypass the destination multiplier (304). The pre-adder multiplexers (310 and 312) may select between the outputs of the source and destination multiplexers (305 and 306) as inputs to the adder (314). For example, to implement one of the fmin and / or fmax functions shown in Table 2 by controlling the multiplexer (312), the minimum value unit (308) can determine the minimum value of the outputs from the source and destination multiplexers (305 and 306).

[0039] Physical implementation

[0040] In some embodiments, the arrays illustrated in FIGS. 1 through 3 may represent logical implementations of blending units and / or parts thereof. However, the structure and / or operation of the physical implementation may strongly affect the cost, operating speed, area efficiency, power efficiency, and / or other performance attributes of a GPU having a blending unit according to the present disclosure.

[0041] Some of the inventive principles of the present disclosure are based on the recognition that some blending operations may occur less frequently than others in some applications. Accordingly, in some embodiments, by improving or optimizing the hardware for more common blending cases while still enabling the blending unit to perform less common blending operations that may be performed at a lower speed in some implementations, the power consumption and / or hardware area of ​​the blending unit may be reduced without affecting the operating speed of the more common blending cases.

[0042] For example, in some applications, it may be common for at least one of the two blend factors to be 0 or 1. However, if the blend factor is 0 or 1, the corresponding multiplication operation may be omitted. If the blend factor is 0, a value of 0 may be provided as output, whereas if the blend factor is 1, the value of the component may be provided as output. Thus, a physical implementation having only a single multiplier can handle most blending cases with little to no reduction in throughput. If the source blend factor is 0 or 1, the multiplier can be used only for the destination operation, so the multiplier can save power consumed by the source operation. If the destination blend factor is 0 or 1, the multiplier can be used only for the source operation, so the power consumed by the destination operation can be saved. If both blend factors are 0 or 1, the multiplier can be completely bypassed for the corresponding blend operation, thereby saving power consumed in both operations. In the rare case where the source and destination blend factors are neither 0 nor 1, the multiplier can perform the two operations sequentially. Although this may reduce blending throughput for the uncommon case where both multiplication operations can be performed, adequate performance is provided or the change in performance may be imperceptible while reducing the cost, area, and / or power consumption of the physical implementation.

[0043] As another example, in some applications, operands with smaller bit widths may be more common than operands with larger bit widths. Therefore, multipliers and / or other hardware may be implemented with relatively low bit width data paths to reduce the cost, area, and / or power consumption of physical implementation. In a first mode of operation, the hardware may be enhanced or optimized to perform lower bit width operations at maximum speed. The hardware may be reconfigured to operate in a second mode capable of computing larger bit width data even at lower throughput. However, given that larger bit width data may occur rarely, such an arrangement may not provide adequate performance or may go unnoticed, but the cost, area, and / or power consumption of physical implementation may be reduced.

[0044] Some additional enhancements and / or optimizations according to the present disclosure may involve implementing physical data paths based on data formats. For example, a blending unit may have three logical data paths: one for 8-bit data, another for 16-bit data, and the remaining one for 32-bit data. However, in some embodiments, the three logical data paths may be implemented as two physical data paths: one for unorm data and the other for floating-point data. In some embodiments, depending on implementation details, using different data paths for different data formats may enhance or optimize the hardware for each data format, which in turn may reduce the cost, area, and / or power consumption of the physical implementation.

[0045] In some embodiments, some of the above principles may be combined to provide further enhancement and / or optimization. For example, in an embodiment having different data paths for different data formats, one or more of the format-specific data paths may be further optimized for data having a specific bit width. Accordingly, in some embodiments, the blending unit may include an unorm data path having hardware that can be enhanced or optimized for smaller width unorm values ​​and / or a floating-point data path having hardware that can be enhanced or optimized for smaller width floating-point values.

[0046] Some additional inventive principles of the present disclosure relate to the use of staging techniques for delivering and / or synchronizing a data flow to blending resources (e.g., blend factor generator and / or blending logic such as a multiplier, adder, multiplexer, etc.) based on various attributes such as a data format (e.g., unorm, floating-point, etc.), a data bit width (e.g., 8, 10, 11, 16, and / or 32-bit data width, etc.), data grouping (e.g., the number of components within a rendering target), and the number of passes through a data path (e.g., where a multiplier can perform sequential multiplication operations on components). In some embodiments, blending may be performed on render targets having different numbers and / or configurations of components, different data formats, different bit widths, etc. The use of staging registers according to the present disclosure may allow various render targets to be transferred to and / or from said computation resources. Here, said computation resources may be enhanced and / or optimized for specific components, data formats, bit widths, etc., on a component-by-component and / or render target-by-render-target basis.

[0047] FIG. 4 illustrates an embodiment of a blending unit having staging registers according to the present disclosure. The embodiment illustrated in FIG. 4 may include an input staging register (402), an output staging register (404), and a blending unit (406). The blending unit (406) may be implemented using any one of the blending methods and / or devices described in the present disclosure. For example, the blending unit (406) may include one or more blending resources, such as blending factor generators and / or blending logic, which may be implemented as data paths that can be enhanced and / or optimized for render targets having different numbers of components, data formats, bit widths, etc. In some embodiments, the blending unit (406) may include multiple data paths configured to process data in multiple formats and / or bit widths. For example, the blending unit (406) may include a first data path having blending logic configured to process data in unorm8 and unorm16 formats, and a second data path having blending logic configured to process data in 16-bit floating-point (FP16) and 32-bit floating-point (FP32) formats.

[0048] In some embodiments, the input staging register (402) may be configured to receive source data from a source device (e.g., a shader or fragment shader such as a pixel) and destination data from a destination device (e.g., a buffer such as a tile buffer or frame buffer). The input staging register (402) may transfer and / or synchronize the received source and / or destination data to one or more resources within the blending unit (406). For example, data in unorm format may be transferred to one or more blend factor generators and / or blending logic configured to operate on unorm data. Conversely, data in floating-point format may be transferred to one or more blend factor generators and / or blending logic configured to operate on floating-point data. As another example, the input staging register (402) may transfer a number of small bit width operands to a hardware structure configured to process a number of small bit width operands in a first mode. After a number of small operands have been processed, the input staging register (402) is configured in a second mode to process a large bit width operand, and then the input staging register (402) can pass the large bit width operand to the hardware structure.

[0049] For example, by transferring components of different components and / or different render targets back to different blending resources within the blending unit (406), the input staging register (402) may also attempt to keep the blending unit (406) busy and / or operate at full capacity.

[0050] In some embodiments, the input staging register (402) may also be configured to bypass all or part of the blending unit (406), for example, through a bypass data path (408). For example, the bypass may be used for specific combinations of blend factors, component data, and / or graphic states for which operations by the blend factor generators and / or blending logic may not be involved. For example, if the component value or blend factor is 0 or 1, the multiplier may be bypassed. This may include cases where the component value or blend factor is substantially 0 or 1. For example, if the component value or blend factor is sufficiently close to 0 or 1 to bypass the multiplier, an imperceptible or decent quality result may be produced.

[0051] In some embodiments, the input staging register (402) may also be configured to handle data having a bit width that is not aligned with the bit width of one or more hardware components of the blending unit (406). For example, while providing clamping and / or other constraints to preserve a 10-bit or 11-bit format, the input staging register (402) may transmit data in a 10-bit or 11-bit floating-point format (FP10 or FP11) to be processed by hardware configured for 16-bit floating-point (FP16) operations.

[0052] In some embodiments, the output staging register (404) receives whole and / or partial blending outputs from the blending unit (406) and can collect, reorder, synchronize, retransmit, and / or transmit the whole and / or partial blending outputs to a destination device such as a tile buffer or frame buffer. For example, the output staging register (404) can collect outputs for components of a render target that are transmitted to different blending resources or processed in different cycles and transmit the outputs together as a single render target to a tile or frame buffer. As another example, the output staging register (404) can receive an output from a first multiplication operation for a component that requires two multiplication operations and transmit the output back to a multiplication / addition unit to be combined with the results of a second multiplication operation for said component. Additionally, for example, the output staging register (404) may receive components that bypass one or more parts of the blending unit (406) and resynchronize the components with other components from the same render target. For another example, in order to deliver the output components together to a tile or frame buffer that may be configured to receive wide write data, the output staging register (404) may accumulate the output components and / or render targets from the blending unit (406).

[0053] Although the input staging register (402) and the output staging register (404) are shown as separate components, all or part of the input staging register (402) and the output staging register (404) may be integrated into the blending unit (406) to provide access to signals and / or structures, for example, to the blending unit (406).

[0054] FIG. 5 illustrates an example of blending logic for unorm8 and unorm16 operands according to the present disclosure. The example illustrated in FIG. 5 may include a layer of 16 2:1 multiplexers (502) arranged to select between unorm8 and unorm16 inputs in response to a selection signal 8 / 16.

[0055] Inputs for a pixel having four 8-bit components may be applied to the multiplexer (502). RS, GS, BS, and AS may specify source component inputs. RD, GD, BD, and AD may specify destination component inputs. RSbf, GSbf, BSbf, and ASbf may specify source blend factor inputs. RDbf, GDbf, BDbf, and ADbf may specify destination blend factor inputs. In some implementations and / or applications, R, G, B, and A may specify the red, green, blue, and alpha color channels, respectively, but in the embodiment illustrated in FIG. 5, they may be used with any type of data, and the R, G, B, and A designators are provided for convenience to distinguish other components. Additionally, the R, G, B, and A components do not need to be associated with a single pixel or rendering target. In some implementations and / or applications, the R, G, B, and A components may be associated with any number of render targets, including four different render targets.

[0056] Inputs for a single 16-bit component can be applied to the multiplexer (502). Here, S[15:8] and S[7:0] can respectively specify the upper and lower 8-bit portions of the source component input. D[15:8] and D[7:0] can respectively specify the upper and lower 8-bit portions of the destination component input. Sbf[15:8] and Sbf[7:0] can respectively specify the upper and lower 8-bit portions of the source blend factor input. Dbf[15:8] and Dbf[7:0] can respectively specify the high and low 8-bit portions of the destination blend factor input.

[0057] In 8-bit (unorm8) mode, the multiplexer (502) can select 8-bit inputs that can be applied to a hierarchy of 8 8x8-bit multipliers (504). A 16-bit output from each of the multipliers (504) can be directly applied to the first input of the 2:1 multiplexer (508) and the second input of the multiplexer (508) through the inverter (506). This allows the multiplexer to select the direct output of the multipliers (504) or its one's complement (which can represent 1.0-X, where X is the multiplier output) in response to one or more state signals that can be used to select a blending operation such as shown in Table 2 for pairs of adjacent multipliers.

[0058] The outputs selected from the multiplexer (508) of adjacent pairs can be applied to a hierarchy of four adders (510). To provide the final blended component outputs Rblend, Gblend, Bblend, and Ablend in unorm8 format, the adders can take 16-bit operands and output the upper 8 bits of the sum. (In some implementations, the lower 8 bits of the sum may be used to provide a carry-in signal to the upper bits.)

[0059] In 16-bit (unorm16) mode, the multiplexer (502) can select upper and lower portions of 16-bit inputs that can be applied to a hierarchy of eight 8x8-bit flyers (504). The operation of the multipliers (504) and inverters (506) may be the same as in 8-bit mode. However, in 16-bit mode, the outputs of all eight flyers (504) may be applied to an adder (512) via the multiplexer (508) in response to one or more state signals to select a blending operation and provide a final blended output signal (BLEND) in unorm16 format. Thus, the four flyers located on the left side of FIG. 5 may be arranged to generate a 16x16 product of a source component S and a source blending factor Sbf. And, the four multipliers located on the right side of Fig. 5 can be arranged to generate a 16x16 product of the destination component D and the destination blending factor Dbf.

[0060] In some embodiments and depending on the implementation details, the blending logic illustrated in FIG. 5 can blend four 8-bit components per clock cycle in 8-bit (unorm8) mode, whereas in 16-bit (unorm16) mode, it can blend one 16-bit component per clock cycle.

[0061] FIG. 6 illustrates an example of blending logic for floating-point operands according to the present disclosure. The example illustrated in FIG. 6 may include a dual-mode floating-point multiplication-addition module (602) capable of performing two 16-bit multiplication-addition operations or one 32-bit multiplication-addition operation in an equal number of cycles. The multiplication-addition module (602) may have a first multiplication input (M1), a second multiplication input (M2), an addition input (A1), and a blended output (BLEND). The first multiplication input (M1) may be supplied by a multiplexer (604) capable of selecting between source / blend factor data (S / BF), destination component data (DST), and the output of a 1-X unit (610). The second multiplication input (M2) may be supplied by a multiplexer (606) that can select between source / blend factor data (S / BF) and destination component data (DST). The additional input (A1) may be supplied by the multiplexer (608) that can select between source / blend factor data (S / BF), destination component data (DST), fixed zero input, and a feedback path (612) from the output (BLEND) of the multiplication-addition module (602). The output (BLEND) may be written to a staging buffer such as the output staging buffer (404) shown in FIG. 4.

[0062] In some embodiments, for example, the multiplication-addition module (602) may be implemented as a fused multiply-add (FMA) module in which the multiplier and adder logic can be integrated so that intermediate multiplication is not available. In some embodiments, the overall precision of the result (M1 * M2 + A1) may be based on performing “M1 * M2” at effective infinite precision, then adding ‘A1’ at effective infinite precision, and then performing a single rounding operation on the output. In such embodiments, by setting “A1 = 0”, the multiplication may be affected. Or, by setting “M1 = 1” or “M2 = 1”, the addition may be affected.

[0063] The source / blend factor data S / BF may be provided by a multiplexer (614) that can select between 16-bit or 32-bit source component data (SRC) from the input register (616) and one or more component blend factors such as 'Abf' and 'Cbf'. In some implementations and / or applications, 'Abf' may specify a blend factor for the alpha color channel, and 'Cbf' may specify a blend factor for the red, blue, or green color channel.

[0064] However, the embodiment illustrated in FIG. 6 can be used with any type of data, and the A and C specifiers are provided only for convenience to distinguish different components.

[0065] The destination component data (DST) may be provided by a multiplexer (618) that can select between 16-bit or 32-bit source component data (DST) from the input register (620).

[0066] A multiplexer (622) is provided so that the 1-X unit (610) can receive inputs from both of the multiplexers (614 and 618), allowing any of the values ​​of 'SRC', 'DST', 'Abf', and 'Cbf' to be applied to the 1-X unit (610). The use of a single 1-X unit can further enhance or optimize more general cases, such as when only one or fewer 1-X operations can be used per component. This can reduce the cost, area, and / or power consumption of the physical implementation. In rare cases where a component is associated with two 1-X operations, two passes may be made through the logic. However, this may still provide adequate performance or may not be noticeable depending on implementation details, API programming, etc.

[0067] However, in some other embodiments, an additional 1-X unit may be included between the output of the multiplexer (618) and a third input to the multiplexer (606). Furthermore, in such embodiments, blend factors such as 'Abf' and 'Cbf' may be applied as additional inputs to the multiplexer (618), thereby removing the multiplexer (622).

[0068] During operation, if a component of the render target is associated with both source and destination multiplications, two passes may be performed through the multiplication-addition module (602). If the render operation (mathematical expression) is in the general form of “a·b+c·d,” the first multiplication (a·b) may be calculated in the first pass through the multiplication-addition module (602) and returned through the feedback path (612). Then, the multiplication (c·d) and the sum may be calculated in the second pass through the multiplication-addition module (602). In the case of a component associated with only one multiplication operation, the feedback path (612) may not be used, and the operation may proceed entirely in a pipelined manner.

[0069] The registers (616 and 620) and the multiplexers (614 and 618) may allow the multiplication-addition module (602) to remain busy and / or operate at full capacity. For example, in some implementations, due to a delay through the multiplication-addition module (602), the result of the first multiplication may not be available for several cycles after presenting the 'a' and 'b' multiplier / multiplicand pair. Therefore, to maintain full use of the multiplication-addition module (602), other data may be provided while the first multiplication is being calculated. Furthermore, different render targets may have different formats and numbers of components. As a result, some render targets may be calculated faster than others. The registers (616 and 620) and the multiplexers (614 and 618) may allow reading various components from different render targets and applying the various components to the multiplication-addition module (602). Consequently, there may be data from multiple pixel components passing through the multiplication-addition module (602) simultaneously at any given time.

[0070] In some embodiments, the register (616 and / or 620) may be implemented as part of the input staging register (402) shown in FIG. 4, for example.

[0071] The embodiments illustrated in FIGS. 1 through 6 may be implemented using any suitable component, such as combinational logic and / or sequential logic circuits including multiplexers, switches, latches, flops, registers, gates, inverters, counters, timers, state machines, and gate arrays, in any suitable form including individual components, integrated circuits (ICs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICS), etc.

[0072] In some embodiments, one or more parts and / or functions of the above embodiments may be implemented as a processor that executes instructions that can be stored in volatile memory such as dynamic random access memory (DRAM) and / or static random access memory (SRAM), non-volatile memory such as flash memory, etc.

[0073] While some embodiments may be described in the context of a system capable of using one or more specific data formats and / or numbers of bits, the principles of the present invention are not limited to these details and may be implemented with any other data formats and / or numbers of bits.

[0074] FIG. 7 illustrates an example of a method for performing a blending operation in a graphics processing unit according to the present disclosure. The method may start at operation (702). At operation (704), the method may multiply a first value and a first blend factor for a component of a render target using a first multiplication operation of a multiplier. At operation (706), the method may multiply a second value and a second blend factor for a component of a render target using a second multiplication operation of a multiplier. At operation (708), the method may add a first result of the first multiplication operation and a second result of the second multiplication operation. The method may end at operation (710).

[0075] The actions and / or components described for the embodiment illustrated in FIG. 7, as well as any other embodiments described herein, are exemplary actions and / or components. In some embodiments, some actions and / or components may be omitted and / or other actions and / or components may be included. Furthermore, in some embodiments, the temporal and / or spatial order of the actions and / or components may be changed.

[0076] FIG. 8 illustrates an embodiment of an image display device (804) in which any of the methods or devices described in the present disclosure may be integrated. The display device (804) may have any form factor such as a panel display for a PC, laptop, mobile device, etc., a projector, VR goggles, etc., and may be based on any imaging technology such as a cathode ray tube (CRT), digital light projector (DLP), light emitting diode (LED), liquid crystal display (LCD), organic LED (OLED), quantum dot, etc., for displaying a rasterized image (806) with pixels. An image processor (810), such as a graphics processing unit (GPU), and / or a display driver circuit (812) may process and / or convert the image into a form that can be displayed on or through the imaging device (804). A portion of the image (806) is magnified and displayed so that the pixels (808) are visible. Any of the methods or devices described in this disclosure may be integrated into a display device (804), an image processor (810), and / or a display driver circuit (812) to generate the pixels (808) and / or groups thereof shown in FIG. 8. In some embodiments, for example, the image processor (810) may include a pipeline capable of implementing one or more blending operations and / or any other inventive principles described herein implemented on an integrated circuit (811). In some embodiments, the integrated circuit (811) may also include the driver circuit (812) and / or any other components capable of implementing any other function of the display device (804).

[0077] Although the embodiments described above have been explained in the context of various implementation details, the principles of the present disclosure are not limited to these or any other specific details. For example, while some functions have been described as being implemented by specific components, in other embodiments, said functions may be distributed among different systems and components having various user interfaces at different locations. Specific embodiments have been described as having specific processes, steps, etc. However, these terms also include embodiments in which specific processes, steps, etc. may be implemented as multiple processes, steps, etc., or multiple processes, steps, etc. may be integrated into a single process, step, etc. References to a component or element may refer only to a part of the component or element.

[0078] The use of terms such as “first” and “second” within this disclosure and claims is solely for distinguishing what they modify and does not indicate any spatial or temporal order unless otherwise evident from the context. Reference to the first does not imply the existence of the second. Various organizational aids, such as section headings, may be provided for convenience. However, such aids and the subject matter arranged according to the principles of this disclosure are not limited by such organizational aids.

[0079] The various details and embodiments described above may be combined to produce additional embodiments according to the inventive principles of the present disclosure. Since the inventive principles of the present disclosure may be modified in arrangement and details without departing from the concept of the invention, such changes and modifications are deemed to be within the scope of the following claims.

Claims

Claim 1 A processing method in a graphics processing unit comprises: receiving a first value and a first blend factor for a component of a render target; receiving a second value and a second blend factor for the component of the render target; and performing a blending operation, wherein the blending operation comprises: multiplying the first value and the first blend factor using a first multiply operation of a multiplier; multiplying the second value and the second blend factor using a second multiply operation of the multiplier; and adding a first result of the first multiply operation and a second result of the second multiply operation, and the method further comprises bypassing the blending operation based on the first blend factor and the second blend factor by means of a staging register. Claim 2 In claim 1, the step of bypassing the blending operation based on the first blend factor and the second blend factor by means of a staging register further comprises the step of bypassing the multiplier when the first blend factor is 0. Claim 3 In claim 1, the step of bypassing the blending operation based on the first blend factor and the second blend factor by means of a staging register further comprises the step of bypassing the multiplier when the second blend factor is 0. Claim 4 A method according to claim 1, wherein the step of bypassing the blending operation based on the first blend factor and the second blend factor by means of a staging register comprises: the step of bypassing the multiplier when the first blend factor is 1; and the step of providing the first value of the component of the render target as the result of the first multiplication operation. Claim 5 A method according to claim 1, characterized in that the first result of the first multiplication operation is added to the second result of the second multiplication operation through a feedback path. Claim 6 A device comprising a graphics processing unit, a multiplier configured to perform a blending operation; an input staging register configured to transmit a first value and a first blend factor for a component of a render target to the multiplier for a first multiplication operation, and a second value and a second blend factor for the component of the render target to the multiplier for a second multiplication operation; and an adder configured to add a first result of the first multiplication operation and a second result of the second multiplication operation, wherein the input staging register is further configured to bypass the blending operation based on the first blend factor and the second blend factor. Claim 7 In claim 6, the input staging register is configured to bypass the multiplier when the first blend factor is 0. Claim 8 In claim 7, the input staging register is configured to bypass the multiplier when the second blend factor is 0. Claim 9 In claim 6, the input staging register is configured to bypass the multiplier as a first result of the first multiplication operation and provide the first value of the component of the render target when the first blend factor is 1. Claim 10 In claim 9, the input staging register is configured to bypass the multiplier as a second result of the second multiplication operation and provide the second value of the component of the render target when the second blend factor is 1.

Citation Information

Patent Citations

  • Efficient display processing with pre-fetching

    KR1020180054797A

  • Programmable blending in a graphics processing unit

    US20080094410A1

  • Front to back compositing

    US20150138226A1

  • Data processing device with time-multiplexed memory bus

    US5983328A