WO2022134125A1 - Graphics processing method and apparatus and electronic device - Google Patents

Graphics processing method and apparatus and electronic device Download PDF

Info

Publication number
WO2022134125A1
WO2022134125A1 PCT/CN2020/139783 CN2020139783W WO2022134125A1 WO 2022134125 A1 WO2022134125 A1 WO 2022134125A1 CN 2020139783 W CN2020139783 W CN 2020139783W WO 2022134125 A1 WO2022134125 A1 WO 2022134125A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
draw
subunit
pixel
priority
Prior art date
Application number
PCT/CN2020/139783
Other languages
French (fr)
Chinese (zh)
Inventor
殷亚云
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080108178.1A priority Critical patent/CN116670719A/en
Priority to PCT/CN2020/139783 priority patent/WO2022134125A1/en
Publication of WO2022134125A1 publication Critical patent/WO2022134125A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering

Definitions

  • the present application relates to the technical field of graphics processing, and in particular, to a graphics processing method, apparatus and electronic device.
  • a graphics processor graphics processing unit, GPU
  • GPU graphics processing unit
  • a graphics processor graphics processing unit, GPU
  • GPU graphics processing unit
  • the GPU can sequentially draw multiple drawings (draws) in the display area, each draw includes one or more primitives, and the primitives in the same draw can overlap each other.
  • Each draw can cover the display area, and the primitives in different draws can also overlap each other.
  • the GPU renders the primitives in each draw to get the target image. Wherein, when any two primitives partially or completely overlap, the pixel of the primitive with a higher visual priority is preferentially displayed on each pixel of the overlapping area.
  • the target image is superimposed by multiple draws.
  • Different draws can have the same or different visual priorities on the same pixel in the display area.
  • the depth value can be used to represent the visual priority of each draw on each pixel. The smaller the depth value of any draw on any pixel, the higher the visual priority of the draw on that pixel.
  • the GPU can respectively determine the depth values of multiple draws at pixel a, and select the pixel a in the draw with the smallest depth value (such as draw1) as the pixel a in the target image. That is, the pixel a in the final generated image is the pixel a in draw1, and the pixel a in other draws will be occluded by the pixel a in draw1.
  • the present application provides a graphics processing method, apparatus and electronic device, which are beneficial to saving computing resources.
  • the present application provides a graphics processing method, which mainly includes: dividing a display area into a plurality of units arranged in an array, each unit including at least one pixel, and the display area is used to display a target image to be generated, the target image Include multiple drawing draws that overlap within the display area.
  • the visual priority may be a depth value or a drawing order.
  • the greater the depth value the lower the visual priority.
  • the primitives drawn first have a higher priority on each pixel than those drawn later. Primitive priority per pixel.
  • the part of the first draw in the first cell can be rendered.
  • the highest visible priority of the first draw in the first unit is lower than the lowest visible priority corresponding to the first unit, it indicates that the part of the first draw in the first unit may be blocked by other draws. In this case, the part of the first draw in the first unit is not visible in the target image, so the part of the first draw in the first unit may not be rendered, which is beneficial to saving computing resources.
  • the highest visual priority of the first draw in the first unit is further exemplified.
  • the first draw may include one or more primitives, wherein: when part or all of at least one primitive in the first draw is located in the first unit, the highest visible element of the first draw in the first unit The priority is the highest value of the highest visual priority of at least one primitive in the first unit; and/or, when none of the one or more primitives in the first draw is located in the first unit, the first The highest visual priority of draw in the first unit is the default value, and the default value is not higher than the lowest visual priority that can appear in the target image.
  • each primitive may be partially or wholly located in the first unit, or may be located outside the first unit.
  • each primitive in the first unit has the highest visible priority.
  • the maximum value of the highest priority can be selected as the The highest visual priority of the first draw in the first unit.
  • the visual priority is set to the default value, which is no higher than the lowest visual priority that can appear in the target image.
  • each unit may include at least one subunit arranged in an array, and each subunit includes at least one pixel arranged in an array.
  • the lowest visible priority corresponding to the first unit may be the lowest value of the lowest visible priority corresponding to at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit level is the lowest visible priority of the target image in the first subunit, and the first subunit is any subunit in at least one subunit of the first unit.
  • the first draw When rendering the first draw, it can be rendered at subunit granularity. In the case where there are multiple primitives in the first draw, one or more primitives may also be blocked by other primitives in the unit to be rendered, which will also result in invalid rendering.
  • the first draw includes one or more primitives, and before rendering the part of the first draw in the first unit, a The first primitive, the first primitive is a primitive part or all of which is located in the first subunit in the first draw.
  • At least one second graphic element is filtered out from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively, and the screened out
  • the at least one second graphic element is the first graphic element with the highest visual priority not lower than the lowest visual priority corresponding to the first subunit.
  • the first primitives there may be primitives that are completely occluded.
  • the second primitive that is not completely occluded may be filtered out from the first primitive, and then the second primitive is rendered, thereby saving computing resources.
  • the visual priority of the first pixel may be determined for each second primitive, and the first pixel may be each second primitive. Any pixel in the first subunit.
  • the visible priority of the first pixel is higher than or equal to the lowest visible priority corresponding to the first subunit, the first pixel is rendered, and the visible priority of the first pixel is lower than the lowest visible priority corresponding to the first subunit. Depending on the priority, the first pixel is not rendered.
  • the visual priority of the first pixel is higher than or equal to the lowest visual priority corresponding to the first subunit, it means that the first pixel of the second graphic element may be displayed on the first pixel of the display area. Therefore the first pixel of the second primitive needs to be rendered. If the visual priority of the first pixel is lower than the lowest visual priority corresponding to the first sub-unit, it means that the first pixel of the second graphic element on the first pixel of the display area will be blocked by other graphic elements, so there is no need to Rendering the first pixel in the second primitive is beneficial to save computing resources.
  • the present application provides a graphics processing device, which may be a GPU, such as a tile base rendering (TBR) GPU, an immediate rendering (IMR) GPU, and a tile deferred rendering (tile base rendering, TBR) GPU. base deferred rendering, TBDR) GPU, etc.
  • a graphics processing device such as a tile base rendering (TBR) GPU, an immediate rendering (IMR) GPU, and a tile deferred rendering (tile base rendering, TBR) GPU.
  • TBR tile base rendering
  • IMR immediate rendering
  • TBR tile deferred rendering
  • TBDR base deferred rendering
  • the graphics processing device mainly includes a partition unit and a rendering unit, wherein: the partition unit can divide the display area into a plurality of units arranged in an array, each unit includes at least one pixel, and the display area is used for The target image to be generated is displayed, and the target image includes a plurality of drawing draws overlapping in the display area; the rendering unit can render the plurality of draws respectively, and any one of the plurality of draws is the first draw, wherein: in the first draw When the highest visual priority in the first unit is not lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is rendered.
  • the lowest visual priority corresponding to a unit is the lowest visual priority of the target image in the first unit; the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit level, the part of the first draw in the first unit is not rendered.
  • the visual priority is the depth value or the drawing order.
  • the first draw may include one or more primitives, wherein: when a part or all of at least one primitive is located in the first unit in the first draw, the highest visible value of the first draw in the first unit is The priority may be the highest value of the highest visual priority of the at least one graphic element in the first unit.
  • one or more primitives in the first draw often cannot cover all the units, so one or more primitives in the first draw may not be located in the first unit.
  • the highest visual priority of the first draw in the first unit can be the default value, and the default value is not higher than the one that can appear in the target image Lowest visible priority.
  • each unit may include at least one subunit arranged in an array, and each subunit may include at least one pixel arranged in an array.
  • the lowest visible priority corresponding to the first unit may be the lowest value of the lowest visible priority corresponding to at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit may be the target image
  • the lowest visible priority in the first subunit, and the first subunit may be any subunit in at least one subunit of the first unit.
  • the partition unit may further determine a first graphic element associated with the first subunit, where the first graphic element is partially or wholly located in the first subunit in the first draw graphic element; when there is at least one first graphic element, filter out at least one second graphic element from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively , the screened out at least one second primitive is the first primitive whose highest visible priority is not lower than the lowest visible priority corresponding to the first subunit; the rendering unit can render at least one second primitive in the first primitive part of the subunit.
  • the rendering unit may determine the visual priority of the first pixel for each second primitive, and the first pixel may be each Any pixel of the two primitives in the first subunit; when the visible priority of the first pixel is higher than or equal to the lowest visible priority corresponding to the first subunit, the first pixel is rendered; When the visual priority is lower than the lowest visual priority corresponding to the first subunit, the first pixel is not rendered.
  • the present application provides a graphics processing apparatus, and the graphics processing apparatus may be a GPU.
  • the graphics processing device mainly includes a memory and an arithmetic circuit.
  • the memory can buffer the operation data of the arithmetic circuit.
  • the arithmetic circuit may execute the graphics processing method provided in any one of the above-mentioned first aspects.
  • the present application provides an electronic device, which may be an electronic device with a graphics processing function, such as a smart phone and a tablet computer. It mainly includes a processor and a graphics processing device as provided in the third aspect, and the processor can instruct the graphics processing device to generate a target image.
  • the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer executes the methods described in the above aspects.
  • the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the methods of the above aspects.
  • 1 is a schematic structural diagram of an electronic device
  • 2a to 2c are schematic diagrams of multiple draws of a target image
  • 3 is a schematic diagram of a depth value
  • FIG. 4 is a schematic flowchart of a graphics processing method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of multiple draws of a target image provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of the relationship between tile and pixel block provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of the relationship between the pixel block and the depth block provided by the embodiment of the present application.
  • FIG. 8 is a schematic diagram of the positional relationship between each graphic element of drawX and a plurality of subunits of any unit according to an embodiment of the present application;
  • FIG. 9 is a schematic flowchart of a specific graphics processing method provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a graphics processing apparatus according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a graphics processing apparatus according to an embodiment of the present application.
  • a GPU is a hardware-accelerated processor dedicated to graphics and graphics work. GPUs can generate target images for displaying 2D or 3D models. Therefore, GPUs are widely used in graphics-related fields such as games, videos, and modeling.
  • FIG. 1 exemplarily shows an electronic device, and the electronic device may be a smart camera, a smart phone, a tablet computer, or other devices with an image generation function.
  • the electronic device 10 mainly includes a processor 11 and a GPU 12 , and the processor 11 is connected to the GPU 12 .
  • the processor 11 may be a chip with logic computing capability such as a central processing unit (CPU), a system on chip (SoC), or other types of application specific integrated circuits (application specific integrated circuits). ASIC), field programmable gate array (FPGA) and other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
  • the processor 11 can send various types of instructions to the GPU 12 so that the GPU 12 can complete graphics processing under the control of the processor 11 .
  • the processor 11 can run the game client to obtain the target model that needs to be presented through the target image.
  • the target model can be a combination of one or more objects such as mountains, water, trees, characters, and the sky.
  • the target image can also be understood as a game screen.
  • the target model of any form can usually be constructed by multiple primitives, and the processor 11 can instruct the GPU 12 to render these primitives in the display area of the target image, thereby obtaining the target image.
  • primitives generally refer to basic graphic elements, mostly simple graphics such as dots, lines, and surface patterns.
  • the processor 11 When instructing the GPU 12 to render a primitive, the processor 11 often needs to send a draw-call (draw-call) instruction to the GPU 12, and the draw-call instruction may indicate the primitive to be rendered by the GPU 12 and the rendering state of the primitive.
  • the GPU 12 After receiving the draw-call instruction, the GPU 12 can determine the primitive to be rendered according to the draw-call instruction, and configure the rendering state of the primitive (for example, the shader configured to color the primitive, the material texture, etc.) to complete the rendering of the primitive.
  • the processor 11 can classify the plurality of primitives according to the rendering states of the plurality of primitives.
  • the processor 11 may instruct the GPU 12 to render a draw every time a draw-call instruction is sent.
  • Each draw can include one or more primitives, these primitives correspond to the same draw-call instruction, and the primitives have the same or similar rendering state.
  • the target model is mainly composed of primitive a and primitive b, wherein primitive a belongs to drawA, and primitive b belongs to drawB.
  • the CPU 12 may instruct the GPU to render draw B and draw A in sequence.
  • the image shown in Figure 2b is formed in the display area of the target image.
  • the image shown in FIG. 2c can be obtained in the display area.
  • draw A and draw B can cover the display area. For each pixel in the display area, draw A and draw B have the same or different visual priority.
  • a depth value can be used to characterize the visual priority. First, a brief description of the depth value is given.
  • the virtual camera may also be called a view point.
  • the target model includes one or more objects, along the lens orientation of the virtual camera, the projection distance of the object on the display area can be understood as the depth value of the object.
  • the projection distance between the object 2 and the display area is the smallest, so the depth value of the object 2 is the smallest.
  • the projection distance between object 3 and the display area is the largest, so the depth value of object 3 is the largest.
  • the depth value of object 1 is located between the depth value of object 2 and the depth value of object 3.
  • object 1 can block object 3. Therefore, when the projection angle shown in Figure 3 is adopted and object 1, object 2 and object 3 are used as target models, the projection of object 1 will be preferentially displayed in the target image, while the projection of object 3 will be partially or completely occluded.
  • the depth value and the occlusion relationship are also satisfied between the primitives. That is to say, if any two primitives cover the same pixel, the pixel of the primitive with the smaller depth value is preferentially displayed on the pixel. It can also be understood that if the depth value of the draw on the pixel is smaller, the visual priority of the draw on the pixel is higher.
  • the default value can be used for the depth value corresponding to the area not covered by the primitive in each draw. The default value should be greater than or equal to the largest possible depth value in the target image.
  • depth value and visual priority are not fixed. In some scenarios, the larger the depth value, the higher the visual priority. This embodiment of the present application does not limit this.
  • the visual priority may also be represented by the drawing sequence.
  • the processor 11 may instruct the GPU 12 to draw multiple primitives in sequence in the display area, and the visual priority of each primitive increases in sequence according to the drawing sequence of the GPU 12 . That is, when two primitives overlap, the primitive drawn later is preferentially displayed in the overlapping area.
  • the visual priority in the embodiment of the present application may also have multiple possible representation modes, which are not listed one by one in the embodiment of the present application.
  • the following embodiments of the present application take a scenario in which the smaller the depth value is, the higher the visual priority is, as an example for description.
  • the GPU 12 may further perform a depth-test (depth-test) on the primitives in each draw, so as to filter out the primitives that are not completely occluded in each draw for rendering.
  • depth-test depth-test
  • each time the GPU 12 receives a draw-call instruction it may perform a depth test on the primitives in the draw indicated by the draw-call instruction.
  • the processor 11 indicates all the primitives corresponding to the target model to the GPU 12 through the draw-call instruction
  • the GPU 12 will also synchronously complete the depth test on all the primitives, thereby obtaining the depth buffer data.
  • draw X can be any draw used to generate the target image.
  • draw X includes one or more primitives.
  • the processor 11 may send multiple draw-call instructions to the GPU 12 in sequence.
  • draw X is the draw indicated by the first draw-call instruction received by the GPU 12
  • the GPU 12 can obtain the initial depth buffer data, and the depth value of each pixel in the initial depth buffer data is Defaults. It can be understood that the default value is not less than the maximum depth value that can appear in the target image.
  • the GPU updates the depth buffer data based on the depth values of one or more primitives in draw X.
  • draw X includes primitive x and primitive y, and primitive x and primitive y overlap at pixel i. Among them, the depth value of primitive x at pixel i is 10, and the depth value of primitive y at pixel i is 15.
  • the GPU can obtain the depth value of the primitive x at each pixel.
  • the GPU first updates the depth buffer data according to the depth value of the primitive x at each pixel.
  • the depth value of pixel i in the depth buffer data is the default value
  • the depth value of the primitive x in pixel i is 10 (less than the default value)
  • the GPU can update the depth value of pixel i in the depth buffer data to 10.
  • the GPU can obtain the depth value of each pixel in the primitive y.
  • the GPU continues to update the depth buffer data according to the depth value of the primitive y at each pixel.
  • the depth value of pixel i in the depth buffer data is 10
  • the depth value of primitive y in pixel i is 15 (greater than 10). Since the depth value of the primitive y at the pixel i is greater than the depth value of the pixel i in the depth buffer data at this time, it can be considered that the primitive y at the pixel i will be covered by other primitives (the primitive x), and the GPU maintains the depth buffer.
  • the depth value of pixel i in the data is 10.
  • the GPU 12 can then render the primitives in draw X respectively according to the depth buffer data.
  • the depth value corresponding to the pixel j in the depth buffer data is 15, if the depth value of the primitive x in the pixel j is 10, it is smaller than the depth corresponding to the pixel j in the depth buffer data. value, it means that the pixel j in the target image may represent the pixel j of the primitive x, and the GPU 12 can render the pixel j in the primitive x, that is, the pixel of the primitive x is presented on the pixel j.
  • the depth value of the primitive x in the pixel j is 20, which is greater than the depth value corresponding to the pixel j in the depth buffer data, it means that the pixel j in the target image may not present the pixel j of the primitive x, and the GPU 12 may not render the pixel j.
  • the pixel j in the primitive j is beneficial to save the computing resources of the GPU 12 .
  • draw X is the draw indicated by the nth draw-call instruction corresponding to the target image received by the GPU 12, and n is an integer greater than 1, then the GPU 12 can obtain a The depth buffer data obtained after the draw) indicated by the draw-call instruction completes the depth test, and on this basis, the depth test of draw X is continued.
  • the specific depth testing process is similar to the above, and will not be repeated here.
  • GPUs can perform depth testing before pixel shaders.
  • depth testing pixels in each primitive that are not occluded by other primitives in the same draw can be shaded.
  • the depth test performed before pixel shading may also be called early-depth-test.
  • pixel shading will change the depth value of some pixels, so it is often necessary to perform depth testing after pixel shading, which can also be called post-depth testing (late-depth testing). depth-test).
  • a pre-depth test can be performed before pixel shading and another depth test after pixel shading. This depth test method may also be referred to as a conservative depth test.
  • the embodiments of the present application provide a graphics processing method, which can reduce invalid rendering during graphics processing and save GPU computing resources. It should be pointed out that the graphics processing method provided by the embodiments of the present application can be applied to subregion rendering (tile base rendering, TBR) GPU, immediate rendering (immediate rendering, IMR) GPU, subregion deferred rendering (tile base deferred rendering, TBDR) GPU and other types of GPU.
  • subregion rendering tile base rendering, TBR
  • IMR immediate rendering
  • IMR immediate rendering
  • subregion deferred rendering tile base deferred rendering
  • TBDR subregion deferred rendering
  • FIG. 4 exemplarily shows a graphics processing method provided by an embodiment of the present application. As shown in Figure 4, it mainly includes the following steps:
  • S401 Divide the display area of the target image to be generated into a plurality of units arranged in an array, and each unit includes at least one pixel.
  • S401 may also be referred to as a binning pass.
  • the GPU 12 may divide the display area into units 0 to 15 .
  • Cells 0 to 15 are arranged in an array in the display area, and each cell may include one or more pixels arranged in an array. It can be understood that since the target image includes multiple draws that overlap in the display area, the GPU12 divides the display area into multiple units, which can also be equivalent to that the GPU12 divides the multiple draws that constitute the target image into multiple draws arranged in an array. unit.
  • the target image includes drawA and drawB, and the display area is divided into units 0 to 15, which is equivalent to the GPU 12 dividing drawA and drawB into units 0 to 15 respectively.
  • the target image includes drawA, drawB, drawC and drawD
  • the display area is divided into units 0 to 15, which is equivalent to the GPU 12 dividing drawA, drawB, drawC and drawD into units 0 to 15 respectively.
  • each unit corresponds to the lowest visible priority, that is, the lowest visible priority of the target image in each unit.
  • the lowest visual priority corresponding to each unit is the maximum depth value Dmax corresponding to each unit.
  • the maximum depth value Dmax corresponding to each unit can be understood as the maximum depth value of the target image in this unit.
  • the maximum depth value corresponding to unit 0 may be the maximum depth value of the target image in unit 0, or it may be understood as the maximum depth value of visible pixels in unit 0.
  • the GPU 12 may calculate the maximum depth value of the target image in each unit by methods such as enumeration, scan line algorithm, linear difference algorithm, etc., which is not limited in this embodiment of the present application. It can be understood that there may be errors in the calculation result compared with the actual target image obtained. In view of this, the GPU can use a more conservative algorithm to calculate each corresponding maximum depth value. Taking unit 0 as an example, the calculation is performed by a relatively conservative algorithm. On the basis of ensuring that the calculated maximum depth value Dmax corresponding to unit 0 is not less than the maximum depth value of the target image actually obtained in the later stage in unit 0, make the corresponding maximum depth value of unit 0. The maximum depth value Dmax is as close as possible to the maximum depth value of the target image in unit 0 actually obtained later.
  • the lowest visual priority corresponding to each unit is the minimum depth value corresponding to each unit.
  • the minimum depth value corresponding to each unit can be understood as the minimum depth value of the target image in this unit.
  • the minimum depth value corresponding to unit 0 may be the minimum depth value of the target image in unit 0, or it may be understood as the minimum depth value of the visible pixels in unit 0.
  • the lowest visual priority corresponding to each unit is the earliest graphic element drawn by the target image in that unit.
  • priority For example, if there are 3 primitives in the target image, some or all of them are located in unit 0, and the lowest visible priority corresponding to unit 0 is the priority of the earliest drawn primitive among the above 3 primitives.
  • the lowest visual priority corresponding to each unit is the final value of the primitive drawn by the target image in the unit. priority. For example, if there are 3 primitives in the target image, some or all of them are located in unit 0, and the lowest visible priority corresponding to unit 0 is the priority of the earliest drawn primitive among the above 3 primitives.
  • each draw in the embodiment of the present application also corresponds to a plurality of maximum visual priorities.
  • each draw can be divided into multiple units, and the multiple maximum visual priorities corresponding to each draw can be understood as the maximum visual priorities of the draw in the multiple units respectively.
  • each draw corresponds to multiple minimum depth values Dmin.
  • drawA includes unit 0 to unit 15, then draw A has 15 minimum depth values corresponding to unit 0 to unit 15 respectively, such as DminA0 to DminA15.
  • DminA0 is the minimum depth value of drawA in unit 0
  • DminA1 is the minimum depth value of drawA in unit 1
  • DminA15 is the minimum depth value of drawA in unit 15.
  • each draw corresponds to multiple maximum depth values.
  • each draw corresponds to multiple highest visual priorities, that is, the draw is drawn at the latest in each unit. The priority of the primitive.
  • each draw corresponds to multiple highest visual priorities, that is, the earliest drawing drawn by the draw in each unit. Element priority.
  • the embodiment of the present application uses a scene in which the smaller the depth value is, the higher the visual priority is, as an example for description. It should be pointed out that the specific implementation of the visual priority in other scenarios and the determination of the priority level can be realized by making adaptive adjustments on the basis of the following examples provided in this application, and shall also be included in the embodiments of this application. among.
  • the minimum depth value corresponding to each unit can be understood as the minimum depth value of the target image in this unit.
  • the GPU 12 may obtain the minimum depth value corresponding to each unit according to the depth buffer data. Taking FIG. 5 as an example, it is assumed that the processor 11 sequentially sends the draw-call instruction 1 corresponding to draw D, the draw-call instruction 2 corresponding to draw C, the draw-call instruction 3 corresponding to draw B, and the draw corresponding to draw C to the GPU 12. -call instruction 4. GPU12 can also perform depth test on draw D to draw A. After completing the depth test on draw A, the depth value corresponding to each pixel in the obtained depth buffer data can be understood as the depth corresponding to each pixel in the target image. value. Therefore, the maximum depth value corresponding to each unit can be determined on the basis of the depth buffer data.
  • draw D includes a primitive d1 and a primitive d2 (the same is true for the case where draw D has only one primitive or draw D has three or more primitives).
  • the minimum depth value of the unit mainly has the following possible situations:
  • Case 1 Part or all of the primitive d1 is located in the unit, and the primitive d2 is all located outside the unit, such as unit 0 in FIG. 5 .
  • the minimum depth value of drawD in unit 0 is the minimum depth value of primitive d1 in unit 0, that is, the minimum depth value of each pixel in the part of primitive d1 located in unit 0.
  • Case 2 Part or all of the primitives d2 are located in this unit, and all of the primitives d1 are located outside the unit, such as unit 15 in FIG. 5 .
  • the minimum depth value of drawD in unit 15 is the minimum depth value of primitive d2 in unit 15, that is, the minimum depth value of each pixel in the portion of primitive d2 located in unit 15.
  • Case 3 Part or all of the primitive d1 is located in this unit, and part or all of the primitive d2 is located in this unit, for example, the unit 9 in FIG. 5 .
  • the minimum depth value of primitive d1 in unit 9 is Dmind1
  • the minimum depth value of primitive d2 in unit 9 is Dmind2
  • the minimum depth value of drawD in unit 9 is the minimum of Dmind1 and Dmind2.
  • Case 4 Both the primitive d1 and the primitive d2 are located outside the unit, such as unit 11 in FIG. 5 .
  • the minimum depth value of drawD in unit 11 may be the default value, and the default value is not less than the maximum depth value that can appear in the target image.
  • each unit has a maximum depth value Dmax corresponding to it, and a plurality of minimum depth values, and the plurality of minimum depth values respectively correspond to a plurality of draws of the target image in a one-to-one manner.
  • unit 0 in FIG. 5 has one maximum depth value Dmax and 4 minimum depth values Dmin corresponding to it.
  • the four minimum depth values Dmin are respectively the minimum depth value DminA0 of drawA in unit 0, the minimum depth value DminB0 of drawB in unit 0, the minimum depth value DminC0 of drawC in unit 0, and the minimum depth value DminD0 of drawD in unit 0.
  • the GPU 12 may calculate a plurality of minimum depth values corresponding to each unit through methods such as enumeration, scan line algorithm, linear difference algorithm, etc., which is not limited in this embodiment of the present application.
  • S402 may also be referred to as a rendering pass.
  • the GPU 12 may render the multiple draws according to the respective maximum depth values Dmax corresponding to the multiple units and multiple minimum depth values Dmin corresponding to each draw.
  • the GPU 12 sequentially traverses the units in drawA in the order of unit 0 to unit 15 .
  • unit 0 when the minimum depth value DminA0 of drawA in unit 0 is less than or equal to the maximum depth value Dmax0 corresponding to unit 0, it means that at unit 0, drawA may not be blocked by primitives in other draws. So the GPU can render the part of drawA in cell 0.
  • the GPU 12 continues to traverse the unit 1 to the unit 15 according to the above process, so as to complete the rendering of drawA. It can be understood that, because the GPU 12 in this embodiment of the present application may not render the completely occluded units in drawA, there may be one or more units in the rendered drawA that have not been rendered.
  • the rendering of drawB, drawC, and drawD by GPU12 is similar, and the specific implementation will not be repeated.
  • the GPU 12 completes the rendering of draw D to draw A, the target image can be obtained.
  • the depth value of primitive a in draw A is greater than the depth value of primitive b in draw B, primitive a will be completely occluded by primitive b.
  • the GPU 12 does not need to respond to the draw-call instruction 4 corresponding to draw A, neither needs to configure the rendering state of the primitive a, nor does it need to render the primitive a, which is beneficial to The computing resources of the GPU 12 are saved.
  • each unit may include at least one subunit arranged in an array, Each subunit includes at least one pixel arranged in an array.
  • the display area may be divided into 16 cells (cell 0 to cell 15).
  • Each unit may further include 4 subunits, specifically, unit 0 may include subunit 0-0 to subunit 0-3, unit b1 includes subunit 1-4 to subunit 1-7, ..., unit 15 Subunits 15-60 to 15-63 may be included.
  • Each subunit corresponds to a maximum depth value
  • the maximum depth value is the maximum depth value of the target image in the first subunit.
  • the GPU may take the maximum value among the maximum depth values corresponding to subunit 0-0 to subunit 0-3 as the maximum depth value corresponding to unit 0. The same is true for other units and will not be repeated here.
  • the unit when the embodiments of the present application are applied to a TBR GPU, the unit may be a tile, and the subunit may be a pixel block or a depth block; Cells can be depth blocks.
  • tiles in TBR GPU are mainly used for partition rendering.
  • the TBR GPU In the process of rendering each draw on the TBR GPU, the TBR GPU only needs to cache the data generated in the process of rendering a tile.
  • the display Dividing a region into multiple tiles can greatly reduce the storage space required by the GPU.
  • the tiles in the TBR GPU can be reused as the unit in the embodiment of the present application, which is beneficial to reduce changes to the TBR GPU and save design costs.
  • tiles include more pixels. It can be understood that if the number of pixels in a unit is large, it is not conducive to improving the fineness of the embodiment of the present application, and may reduce the optimization effect of the embodiment of the present application on the computing resources of the GPU 12 .
  • the unit in this embodiment of the present application may also be a pixel block.
  • each tile may include a plurality of pixel blocks (b0 to b15) arranged in an array.
  • the subunit may be a depth block.
  • each pixel block includes 4 depth blocks, wherein b0 includes d0 to d3, b1 includes d4 to d7, ..., b15 includes d60 to d63.
  • the GPU 12 may render each draw at the granularity of subunits. Since the number of pixels in the subunit is not greater than the number of pixels in the unit, it is beneficial to improve the fineness of the contrast in the rendering process and to improve the optimization effect of the computing resources of the GPU 12 .
  • the draw X can be any draw in the target image.
  • the GPU 12 may first determine the first primitive associated with each subunit in the draw X, wherein the first primitive associated with each subunit may be a part or all of the primitives located in the first subunit.
  • Figure 8 is a schematic diagram of drawX in any unit, and any unit is a pixel block.
  • the any unit includes 64 sub-units (depth blocks), which are sub-unit d0 to sub-unit d63 respectively.
  • the first primitive associated with the subunit d48 includes the primitive x1, the primitive x2 and the primitive x3.
  • the GPU 12 filters out at least one second primitive from the primitive x1 to the primitive x3 according to the minimum depth values of the primitive x1, the primitive x2 and the primitive x3 in the subunit d48, respectively. Specifically, if the minimum depth value of the primitive x1 in the subunit d48 is less than or equal to the maximum depth value corresponding to the subunit d48, it means that the part of the primitive x1 in the subunit d48 may not be blocked by other primitives , so the part of the primitive x1 in the subunit d48 needs to be rendered, and the primitive x1 can be used as the second primitive.
  • the minimum depth value of the primitive x1 in the subunit d48 is smaller than the maximum depth value corresponding to the subunit d48, it means that the part of the primitive x1 in the subunit d48 is blocked by other primitives, so there is no need to render the primitive x1 in the subunit d48. Section in cell d48. The same is true for other graphic elements and will not be repeated here.
  • the GPU 12 In the process of subsequent rendering of drawX, the GPU 12 only needs to render the part of the second primitive in the subunit d48.
  • the GPU does not need to render the primitives that are completely occluded in the subunit d48, so it is beneficial to further save the GPU computing resources.
  • the GPU can determine the second primitive that needs to be rendered in each draw in the partition stage, and record the difference between the second primitive and the subunit in each draw in the polygon list (PL). Correspondence.
  • the PL can be stored in the PL heap, and the PL heap can also include the configuration information of each draw (such as the identifier and pointer of each draw), the boundary identifier between adjacent draws, etc.
  • the specific implementation You can refer to the existing TBR GPU, which will not be repeated here.
  • the GPU 12 can first determine the depth value of the pixel for each pixel in this part, and the depth value of the pixel is less than or equal to When the maximum depth value corresponding to the subunit d48, the pixel is rendered; when the depth value of the pixel is greater than the maximum depth value corresponding to the subunit d48, the pixel is not rendered.
  • the invalid rendering of some pixels can be further omitted, which is beneficial to further saving the computing resources of the GPU 12.
  • the graphics processing method provided by the embodiment of the present application is further exemplified.
  • the graphics method provided by the embodiment of the present application is mainly divided into a partition stage ( S401 ) and a rendering stage ( S402 ). Specifically, it mainly includes the following steps:
  • the GPU 12 After receiving the multi-draw instruction instructed by the processor 11, the GPU 12 performs rasterization (raserization) processing on the display area. Each draw includes one or more primitives.
  • the display area can be divided into a plurality of pixels arranged in an array. On this basis, the display area can be further divided into a plurality of units arranged in an array, and each unit includes at least one pixel arranged in an array.
  • S902 Determine the maximum depth value Dmax corresponding to each unit, and the minimum depth value Dmin of each draw in each unit.
  • the maximum depth value Dmax corresponding to each unit is the depth value of the pixel in the target image.
  • the maximum depth value Dmax corresponding to each unit can also be understood as the depth value corresponding to each pixel in the obtained depth buffer data after completing the depth test for all the multiple draws of the target image. For example, in the scene shown in Figure 5, the depth test is performed on draw D to draw A in turn, and the depth buffer data obtained after the depth test on draw A is completed can be used as the maximum depth value Dmax corresponding to each unit (pixel). .
  • the minimum depth value Dmin of each draw in each unit is the depth value of each draw on each pixel.
  • the depth value of draw A on unit (pixel) 14 is equivalent to the minimum depth value Dmin of draw A on unit (pixel) 14 .
  • S903 Filter out the second primitive in each draw and record it in the PL.
  • PL can be stored in the PL heap.
  • the second primitive in each draw can be understood as a primitive that is not completely occluded by other primitives in the same draw. By filtering the second primitive in each draw, invalid rendering can be reduced and GPU computing resources can be saved .
  • S905 Determine whether the part of the draw in each unit needs to be rendered according to the maximum depth value Dmax corresponding to each unit and the minimum depth value Dmin of the draw in each unit. As mentioned earlier, occlusion may also occur between primitives between different draws. Before rendering, filter out the units that need to be rendered in each draw, which is beneficial to reduce invalid rendering and save GPU computing resources.
  • S906 Render the part of the draw that needs to be rendered in each unit.
  • the GPU 12 may include corresponding hardware structures and/or software modules for performing each function.
  • the present invention can be implemented in hardware or a combination of hardware and computer software in conjunction with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a function is implemented by hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
  • FIG. 10 shows a possible exemplary block diagram of the graphics processing apparatus involved in the embodiments of the present application, and the graphics processing apparatus 1000 may be the GPU in any of the above-mentioned embodiments or other Integrated circuits for graphics processing functions.
  • the graphics processing apparatus 1000 may include: a partition unit 1001 and a rendering unit 1002 .
  • the partition unit 1001 can divide the display area into a plurality of units arranged in an array, each unit includes at least one pixel, the display area is used to display the target image to be generated, and the target image is included in the display area. Multiple drawing draws that overlap in the area; the rendering unit 1002 can render multiple draws respectively, and any draw in the multiple draws is the first draw, wherein: the highest visual priority of the first draw in the first unit is not When it is lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is rendered.
  • the first unit is any one of the multiple units, and the lowest visual priority corresponding to the first unit is the target.
  • the lowest visual priority of the image in the first unit when the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit, do not render the first draw in the first unit part of the unit.
  • the visual priority is the depth value or the drawing order.
  • the first draw may include one or more primitives, wherein: when a part or all of at least one primitive is located in the first unit in the first draw, the highest visible value of the first draw in the first unit is The priority, which can be the highest value of the highest visual priority of the at least one graphic element in the first unit; and/or, when one or more graphic elements in the first draw are not located in the first unit,
  • the highest visual priority of the first draw in the first unit may be a default value, and the default value is not higher than the lowest visual priority that can appear in the target image.
  • each unit may include at least one subunit arranged in an array, and each subunit may include at least one pixel arranged in an array.
  • the lowest visible priority corresponding to the first unit may be the lowest value of the lowest visible priority corresponding to at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit may be the target image
  • the lowest visible priority in the first subunit, and the first subunit may be any subunit in at least one subunit of the first unit.
  • the partitioning unit 1001 may also determine a first graphic element associated with the first subunit, where the first graphic element is partially or entirely located in the first subunit in the first draw.
  • the partitioning unit 1001 may also determine a first graphic element associated with the first subunit, where the first graphic element is partially or entirely located in the first subunit in the first draw.
  • the rendering unit 1002 may determine the visual priority of the first pixel for each second primitive, and the first pixel may be each The second primitive is any pixel in the first subunit; when the visual priority of the first pixel is higher than or equal to the lowest visual priority corresponding to the first subunit, the first pixel is rendered; in the first pixel When the visible priority of the first subunit is lower than the lowest visible priority corresponding to the first subunit, the first pixel is not rendered.
  • the graphics processing device may be the GPU in the above-mentioned embodiment or other integrated circuits with graphics processing functions.
  • the graphics processing apparatus 1100 includes: a memory 1101 and an arithmetic circuit 1102 .
  • the operation circuit 1102 may be an integrated circuit with logic operation capability, and may execute the above-mentioned graphics processing method provided by the embodiments of the present application.
  • the operation circuit 1102 may include multiple arithmetic and logic units (ALUs), and the multiple ALUs in the graphics processing device 1100 may perform logic operations in parallel, thereby improving the performance of the graphics processing device 1100. calculating speed.
  • ALUs arithmetic and logic units
  • the memory 1101 can buffer data generated when the arithmetic circuit 1102 operates. For example, the operation circuit 1102 may write the lowest visible priority corresponding to each unit into the memory 1101 after determining the lowest visible priority corresponding to each unit. In the rendering stage, the arithmetic circuit 1102 reads the lowest visual priority corresponding to each unit from the memory 1101, so that each draw can be rendered.
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

Disclosed in the present application are a graphics processing method and apparatus and an electronic device. The method mainly comprises: dividing a display region into multiple units arranged in an array, and respectively rendering multiple draws. For a part of any draw in any unit, when the highest visual priority of the draw in the unit is not lower than the lowest visual priority corresponding to the unit, the part of the draw in the unit is rendered, and when the highest visual priority of the draw in the unit is lower than the lowest visual priority corresponding to the unit, the part of the draw in the unit is not rendered, thereby facilitating the saving of computing resources.

Description

一种图形处理方法、装置及电子设备A graphics processing method, device and electronic device 技术领域technical field
本申请涉及图形处理技术领域,尤其涉及一种图形处理方法、装置及电子设备。The present application relates to the technical field of graphics processing, and in particular, to a graphics processing method, apparatus and electronic device.
背景技术Background technique
图形处理器(graphics processing unit,GPU)是一种专用的图像渲染硬件加速处理器,可以以基础图形元素(图元)为素材进行图形处理,从而生成图像。在图形处理过程中,GPU可以在显示区域内依次绘制多个绘图(draw),每个draw包括一个或多个图元,同一个draw内的图元可以互相重叠。每一个draw皆可以覆盖显示区域,不同draw中的图元也可以互相重叠。之后,GPU对每个draw中的图元进行渲染,从而得到目标图像。其中,在任意两个图元部分或全部重叠时,在重叠区域的每个像素上优先显示可视优先级较高的图元的像素。A graphics processor (graphics processing unit, GPU) is a dedicated hardware-accelerated processor for image rendering, which can perform graphics processing using basic graphics elements (primitives) as materials to generate images. In the process of graphics processing, the GPU can sequentially draw multiple drawings (draws) in the display area, each draw includes one or more primitives, and the primitives in the same draw can overlap each other. Each draw can cover the display area, and the primitives in different draws can also overlap each other. After that, the GPU renders the primitives in each draw to get the target image. Wherein, when any two primitives partially or completely overlap, the pixel of the primitive with a higher visual priority is preferentially displayed on each pixel of the overlapping area.
具体来说,目标图像由多个draw叠加而成。在显示区域的同一个像素上,不同draw之间可以具有相同或不同的可视优先级。例如,可以用深度值表征各个draw在各个像素上的可视优先级,任一draw在任一像素上的深度值越小,该draw在该像素上可视优先级越高。以像素a为例,GPU可以分别确定多个draw在像素a的深度值,并选择深度值最小的draw(如draw1)中的像素a作为目标图像中的像素a。即,最后生成的图像中的像素a,为draw1中的像素a,其它draw中的像素a将被draw1中的像素a遮挡。Specifically, the target image is superimposed by multiple draws. Different draws can have the same or different visual priorities on the same pixel in the display area. For example, the depth value can be used to represent the visual priority of each draw on each pixel. The smaller the depth value of any draw on any pixel, the higher the visual priority of the draw on that pixel. Taking pixel a as an example, the GPU can respectively determine the depth values of multiple draws at pixel a, and select the pixel a in the draw with the smallest depth value (such as draw1) as the pixel a in the target image. That is, the pixel a in the final generated image is the pixel a in draw1, and the pixel a in other draws will be occluded by the pixel a in draw1.
由于在GPU的图形处理过程中,往往会出现一个或多个图元被其它图元遮挡。在此情况下,这些被遮挡的部分实际上是不需要渲染的,因此也就浪费了GPU的运算资源。Because in the graphics processing process of the GPU, one or more primitives are often occluded by other primitives. In this case, these occluded parts do not actually need to be rendered, so the computing resources of the GPU are wasted.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请提供一种图形处理方法、装置及电子设备,有利于节省运算资源。In view of this, the present application provides a graphics processing method, apparatus and electronic device, which are beneficial to saving computing resources.
第一方面,本申请提供一种图形处理方法,主要包括:将显示区域分为阵列排布的多个单元,每个单元包括至少一个像素,显示区域用于显示待生成的目标图像,目标图像包括在显示区域内重叠的多个绘图draw。分别渲染多个draw,多个draw中的任一draw为第一draw,其中:在第一draw在第一单元中的最高可视优先级不低于第一单元对应的最低可视优先级时,渲染第一draw在第一单元的部分,第一单元为多个单元中的任一单元,第一单元对应的最低可视优先级为目标图像在第一单元内的最低可视优先级;在第一draw在第一单元中的最高可视优先级低于第一单元对应的最低可视优先级时,不渲染第一draw在第一单元的部分。In a first aspect, the present application provides a graphics processing method, which mainly includes: dividing a display area into a plurality of units arranged in an array, each unit including at least one pixel, and the display area is used to display a target image to be generated, the target image Include multiple drawing draws that overlap within the display area. Render multiple draws respectively, and any one of the multiple draws is the first draw, where: when the highest visual priority of the first draw in the first unit is not lower than the lowest visual priority corresponding to the first unit , rendering the part of the first draw in the first unit, where the first unit is any one of the multiple units, and the lowest visible priority corresponding to the first unit is the lowest visible priority of the target image in the first unit; When the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is not rendered.
示例性的,可视优先级可以是深度值或绘图顺序,例如深度值越大,可视优先级越低,又例如,先绘制的图元在每个像素上的优先级高于后绘制的图元在每个像素上的优先级。采用该实现方式,在第一draw在第一单元中的最高可视优先级不低于第一单元对应的最低可视优先级时,说明第一draw在第一单元中的部分有可能未被其它draw遮挡。在此情况下,可以渲染第一draw在第一单元的部分。在第一draw在第一单元中的最高可视优先级低于第一单元对应的最低可视优先级时,说明第一draw在第一单元中的部分有可能被其它draw遮挡。在此情况下,第一draw在第一单元的部分在目标图像中是不可视的,因 此可以不渲染第一draw在第一单元的部分,从而有利于节省运算资源。Exemplarily, the visual priority may be a depth value or a drawing order. For example, the greater the depth value, the lower the visual priority. For another example, the primitives drawn first have a higher priority on each pixel than those drawn later. Primitive priority per pixel. With this implementation, when the highest visual priority of the first draw in the first unit is not lower than the lowest visual priority corresponding to the first unit, it means that the part of the first draw in the first unit may not be Other draw occlusions. In this case, the part of the first draw in the first cell can be rendered. When the highest visible priority of the first draw in the first unit is lower than the lowest visible priority corresponding to the first unit, it indicates that the part of the first draw in the first unit may be blocked by other draws. In this case, the part of the first draw in the first unit is not visible in the target image, so the part of the first draw in the first unit may not be rendered, which is beneficial to saving computing resources.
接下来,对第一draw在第一单元中的最高可视优先级作进一步的示例性说明。具体来说,第一draw可以包括一个或多个图元,其中:在第一draw中存在至少一个图元的部分或全部位于第一单元时,第一draw在第一单元中的最高可视优先级,为至少一个图元分别在第一单元中的最高可视优先级的最高值;和/或,在第一draw中的一个或多个图元皆不位于第一单元时,第一draw在第一单元中的最高可视优先级为默认值,默认值不高于目标图像中能够出现的最低可视优先级。Next, the highest visual priority of the first draw in the first unit is further exemplified. Specifically, the first draw may include one or more primitives, wherein: when part or all of at least one primitive in the first draw is located in the first unit, the highest visible element of the first draw in the first unit The priority is the highest value of the highest visual priority of at least one primitive in the first unit; and/or, when none of the one or more primitives in the first draw is located in the first unit, the first The highest visual priority of draw in the first unit is the default value, and the default value is not higher than the lowest visual priority that can appear in the target image.
在第一draw中存在一个或多个图元,每个图元即有可能部分或全部位于第一单元,也有可能位于第一单元之外。在存在一个或多个图元部分或全部位于第一单元时,每个图元在第一单元的部分皆存在最高可视优先级,在此情况下,可以选择其中最高优先级的最大值作为第一draw在第一单元中的最高可视优先级。在第一draw中的所有图元都部位于第一单元时,也就是在绘制第一draw时并不会在第一单元绘制图元,因此可以将第一draw在第一单元中的最高可视优先级设为默认值,该默认值不高于目标图像中能够出现的最低可视优先级。There are one or more primitives in the first draw, and each primitive may be partially or wholly located in the first unit, or may be located outside the first unit. When there are one or more primitives partially or entirely located in the first unit, each primitive in the first unit has the highest visible priority. In this case, the maximum value of the highest priority can be selected as the The highest visual priority of the first draw in the first unit. When all the primitives in the first draw are located in the first unit, that is, when the first draw is drawn, the primitives are not drawn in the first unit, so the highest possible value of the first draw in the first unit can be set. The visual priority is set to the default value, which is no higher than the lowest visual priority that can appear in the target image.
在本申请实施例中,每个单元可以包括阵列排布的至少一个子单元,每个子单元包括阵列排布的至少一个像素。在此情况下,第一单元对应的最低可视优先级可以为第一单元中,至少一个子单元分别对应的最低可视优先级的最低值,其中,第一子单元对应的最低可视优先级为目标图像在第一子单元中的最低可视优先级,第一子单元为第一单元的至少一个子单元中的任一子单元。In this embodiment of the present application, each unit may include at least one subunit arranged in an array, and each subunit includes at least one pixel arranged in an array. In this case, the lowest visible priority corresponding to the first unit may be the lowest value of the lowest visible priority corresponding to at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit level is the lowest visible priority of the target image in the first subunit, and the first subunit is any subunit in at least one subunit of the first unit.
在渲染第一draw时,可以以子单元为粒度进行渲染。在第一draw中存在多个图元的情况下,在需要渲染的单元中也有可能出现一个或多个图元被其它图元遮挡的情况,此时也会造成无效渲染。为了进一步节省运算资源,在一种可能的实现方式中,第一draw包括一个或多个图元,在渲染第一draw在第一单元的部分之前,还可以先确定与第一子单元关联的第一图元,第一图元为第一draw中部分或全部位于第一子单元的图元。在存在至少一个第一图元时,根据至少一个第一图元分别在第一子单元中的最高可视优先级,从至少一个第一图元中筛选出至少一个第二图元,筛选出来的至少一个第二图元为最高可视优先级不低于第一子单元对应的最低可视优先级的第一图元。之后,在渲染第一draw在第一单元的部分时,可以渲染至少一个第二图元位于第一子单元的部分。When rendering the first draw, it can be rendered at subunit granularity. In the case where there are multiple primitives in the first draw, one or more primitives may also be blocked by other primitives in the unit to be rendered, which will also result in invalid rendering. In order to further save computing resources, in a possible implementation manner, the first draw includes one or more primitives, and before rendering the part of the first draw in the first unit, a The first primitive, the first primitive is a primitive part or all of which is located in the first subunit in the first draw. When there is at least one first graphic element, at least one second graphic element is filtered out from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively, and the screened out The at least one second graphic element is the first graphic element with the highest visual priority not lower than the lowest visual priority corresponding to the first subunit. Afterwards, when rendering the part of the first draw in the first unit, the part in which the at least one second primitive is located in the first subunit may be rendered.
在至少一个第一图元中,有可能存在被完全遮挡的图元。为了减少无效渲染,可以先从第一图元中筛选出没有被完全遮挡的第二图元,再对第二图元进行渲染,从而节省了运算资源。In at least one of the first primitives, there may be primitives that are completely occluded. In order to reduce invalid rendering, the second primitive that is not completely occluded may be filtered out from the first primitive, and then the second primitive is rendered, thereby saving computing resources.
示例性的,在渲染至少一个第二图元位于第一子单元的部分时,可以针对每个第二图元,确定第一像素的可视优先级,第一像素可以是每个第二图元在第一子单元中的任一像素。在第一像素的可视优先级高于或等于第一子单元对应的最低可视优先级时,渲染第一像素,在第一像素的可视优先级低于第一子单元对应的最低可视优先级时,不渲染第一像素。Exemplarily, when rendering the part of the at least one second primitive located in the first subunit, the visual priority of the first pixel may be determined for each second primitive, and the first pixel may be each second primitive. Any pixel in the first subunit. When the visible priority of the first pixel is higher than or equal to the lowest visible priority corresponding to the first subunit, the first pixel is rendered, and the visible priority of the first pixel is lower than the lowest visible priority corresponding to the first subunit. Depending on the priority, the first pixel is not rendered.
具体来说,若第一像素的可视优先级高于或等于第一子单元对应的最低可视优先级,说明在显示区域的第一像素上有可能呈现第二图元的第一像素,因此需要渲染该第二图元的第一像素。若第一像素的可视优先级低于第一子单元对应的最低可视优先级,说明在显示区域的第一像素上该第二图元的第一像素会被其它图元遮挡,因此无需渲染第二图元中 的第一像素,从而有利于节省运算资源。Specifically, if the visual priority of the first pixel is higher than or equal to the lowest visual priority corresponding to the first subunit, it means that the first pixel of the second graphic element may be displayed on the first pixel of the display area. Therefore the first pixel of the second primitive needs to be rendered. If the visual priority of the first pixel is lower than the lowest visual priority corresponding to the first sub-unit, it means that the first pixel of the second graphic element on the first pixel of the display area will be blocked by other graphic elements, so there is no need to Rendering the first pixel in the second primitive is beneficial to save computing resources.
第二方面,本申请提供一种图形处理装置,该图形处理装置可以是GPU,如分区域渲染(tile base rendering,TBR)GPU、直接渲染(immediate rendering,IMR)GPU、分区域延迟渲染(tile base deferred rendering,TBDR)GPU等。第二方面中相应方案的技术效果可以参照第一方面中对应方案可以得到的技术效果,重复之处不予详述。In a second aspect, the present application provides a graphics processing device, which may be a GPU, such as a tile base rendering (TBR) GPU, an immediate rendering (IMR) GPU, and a tile deferred rendering (tile base rendering, TBR) GPU. base deferred rendering, TBDR) GPU, etc. For the technical effects of the corresponding solutions in the second aspect, reference may be made to the technical effects that can be obtained by the corresponding solutions in the first aspect, and the repeated parts will not be described in detail.
示例性的,本申请所提供的图形处理装置主要包括分区单元和渲染单元,其中:分区单元可以将显示区域分为阵列排布的多个单元,每个单元包括至少一个像素,显示区域用于显示待生成的目标图像,目标图像包括在显示区域内重叠的多个绘图draw;渲染单元可以分别渲染多个draw,多个draw中的任一draw为第一draw,其中:在第一draw在第一单元中的最高可视优先级不低于第一单元对应的最低可视优先级时,渲染第一draw在第一单元的部分,第一单元为多个单元中的任一单元,第一单元对应的最低可视优先级为目标图像在第一单元内的最低可视优先级;在第一draw在第一单元中的最高可视优先级低于第一单元对应的最低可视优先级时,不渲染第一draw在第一单元的部分。Exemplarily, the graphics processing device provided by the present application mainly includes a partition unit and a rendering unit, wherein: the partition unit can divide the display area into a plurality of units arranged in an array, each unit includes at least one pixel, and the display area is used for The target image to be generated is displayed, and the target image includes a plurality of drawing draws overlapping in the display area; the rendering unit can render the plurality of draws respectively, and any one of the plurality of draws is the first draw, wherein: in the first draw When the highest visual priority in the first unit is not lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is rendered. The lowest visual priority corresponding to a unit is the lowest visual priority of the target image in the first unit; the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit level, the part of the first draw in the first unit is not rendered.
其中,可视优先级为深度值或绘图顺序。Among them, the visual priority is the depth value or the drawing order.
示例性的,第一draw可以包括一个或多个图元,其中:在第一draw中存在至少一个图元的部分或全部位于第一单元时,第一draw在第一单元中的最高可视优先级,可以是上述至少一个图元分别在第一单元中的最高可视优先级的最高值。Exemplarily, the first draw may include one or more primitives, wherein: when a part or all of at least one primitive is located in the first unit in the first draw, the highest visible value of the first draw in the first unit is The priority may be the highest value of the highest visual priority of the at least one graphic element in the first unit.
可以理解,第一draw中的一个或多个图元往往无法覆盖所有单元,因此第一draw中的一个或多个图元也有可能皆不位于第一单元。在第一draw中的一个或多个图元皆不位于第一单元时,第一draw在第一单元中的最高可视优先级可以是默认值,默认值不高于目标图像中能够出现的最低可视优先级。It can be understood that one or more primitives in the first draw often cannot cover all the units, so one or more primitives in the first draw may not be located in the first unit. When one or more primitives in the first draw are not located in the first unit, the highest visual priority of the first draw in the first unit can be the default value, and the default value is not higher than the one that can appear in the target image Lowest visible priority.
在本申请实施例中,每个单元可以包括阵列排布的至少一个子单元,每个子单元可以包括阵列排布的至少一个像素。第一单元对应的最低可视优先级可以为第一单元中,至少一个子单元分别对应的最低可视优先级的最低值,其中,第一子单元对应的最低可视优先级可以为目标图像在第一子单元中的最低可视优先级,第一子单元可以为第一单元的至少一个子单元中的任一子单元。In this embodiment of the present application, each unit may include at least one subunit arranged in an array, and each subunit may include at least one pixel arranged in an array. The lowest visible priority corresponding to the first unit may be the lowest value of the lowest visible priority corresponding to at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit may be the target image The lowest visible priority in the first subunit, and the first subunit may be any subunit in at least one subunit of the first unit.
在渲染第一draw时,可以以子单元为粒度进行渲染。为了进一步节省运算资源,在一种可能的实现方式中,分区单元还可以确定与第一子单元关联的第一图元,第一图元为第一draw中部分或全部位于第一子单元的图元;在存在至少一个第一图元时,根据至少一个第一图元分别在第一子单元中的最高可视优先级,从至少一个第一图元中筛选出至少一个第二图元,筛选出的至少一个第二图元为最高可视优先级不低于第一子单元对应的最低可视优先级的第一图元;渲染单元则可以渲染至少一个第二图元位于第一子单元的部分。When rendering the first draw, it can be rendered at subunit granularity. In order to further save computing resources, in a possible implementation manner, the partition unit may further determine a first graphic element associated with the first subunit, where the first graphic element is partially or wholly located in the first subunit in the first draw graphic element; when there is at least one first graphic element, filter out at least one second graphic element from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively , the screened out at least one second primitive is the first primitive whose highest visible priority is not lower than the lowest visible priority corresponding to the first subunit; the rendering unit can render at least one second primitive in the first primitive part of the subunit.
示例性的,渲染单元在渲染至少一个第二图元位于第一子单元的部分时,可以针对每个第二图元,确定第一像素的可视优先级,第一像素可以为每个第二图元在第一子单元中的任一像素;在第一像素的可视优先级高于或等于第一子单元对应的最低可视优先级时,渲染第一像素;在第一像素的可视优先级低于第一子单元对应的最低可视优先级时,不渲染第一像素。Exemplarily, when rendering the part of the at least one second primitive located in the first subunit, the rendering unit may determine the visual priority of the first pixel for each second primitive, and the first pixel may be each Any pixel of the two primitives in the first subunit; when the visible priority of the first pixel is higher than or equal to the lowest visible priority corresponding to the first subunit, the first pixel is rendered; When the visual priority is lower than the lowest visual priority corresponding to the first subunit, the first pixel is not rendered.
第三方面,本申请提供一种图形处理装置,该图形处理装置可以是GPU。示例性的,该图形处理装置主要包括存储器和运算电路。其中,存储器可以缓存运算电路的运行数据。运算电路可以执行如上述第一方面中任一项所述提供的图形处理方法。In a third aspect, the present application provides a graphics processing apparatus, and the graphics processing apparatus may be a GPU. Exemplarily, the graphics processing device mainly includes a memory and an arithmetic circuit. Wherein, the memory can buffer the operation data of the arithmetic circuit. The arithmetic circuit may execute the graphics processing method provided in any one of the above-mentioned first aspects.
第四方面,本申请提供一种电子设备,该电子设备可以是智能手机、平板电脑等具有图形处理功能的电子设备。其中主要包括处理器和如第三方面所提供的图形处理装置,处理器可以指示该图形处理装置生成目标图像。In a fourth aspect, the present application provides an electronic device, which may be an electronic device with a graphics processing function, such as a smart phone and a tablet computer. It mainly includes a processor and a graphics processing device as provided in the third aspect, and the processor can instruct the graphics processing device to generate a target image.
第五方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a fifth aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer executes the methods described in the above aspects.
第六方面,本申请提供一种包括指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a sixth aspect, the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the methods of the above aspects.
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the present application will be more clearly understood in the description of the following embodiments.
附图说明Description of drawings
图1为一种电子设备结构示意图;1 is a schematic structural diagram of an electronic device;
图2a至图2c为一种目标图像的多个draw的示意图;2a to 2c are schematic diagrams of multiple draws of a target image;
图3为一种深度值示意图;3 is a schematic diagram of a depth value;
图4为本申请实施例提供的一种图形处理方法流程示意图;4 is a schematic flowchart of a graphics processing method provided by an embodiment of the present application;
图5为本申请实施例提供的一种目标图像的多个draw的示意图;5 is a schematic diagram of multiple draws of a target image provided by an embodiment of the present application;
图6为本申请实施例提供的tile与pixel block之间的关系示意图;FIG. 6 is a schematic diagram of the relationship between tile and pixel block provided by an embodiment of the present application;
图7为本申请实施例提供的pixel block与depth block之间的关系示意图;7 is a schematic diagram of the relationship between the pixel block and the depth block provided by the embodiment of the present application;
图8为本申请实施例提供的一种drawX的各个图元与任一单元的多个子单元之间的位置关系示意图;8 is a schematic diagram of the positional relationship between each graphic element of drawX and a plurality of subunits of any unit according to an embodiment of the present application;
图9为本申请实施例提供的一种具体的图形处理方法流程示意图;FIG. 9 is a schematic flowchart of a specific graphics processing method provided by an embodiment of the present application;
图10为本申请实施例提供的一种图形处理装置结构示意图;FIG. 10 is a schematic structural diagram of a graphics processing apparatus according to an embodiment of the present application;
图11为本申请实施例提供的一种图形处理装置结构示意图。FIG. 11 is a schematic structural diagram of a graphics processing apparatus according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述。方法实施例中的具体操作方法也可以应用于装置实施例或系统实施例中。需要说明的是,在本申请的描述中“至少一个”是指一个或多个,其中,多个是指两个或两个以上。鉴于此,本发明实施例中也可以将“多个”理解为“至少两个”。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The specific operation methods in the method embodiments may also be applied to the apparatus embodiments or the system embodiments. It should be noted that, in the description of the present application, "at least one" refers to one or more, wherein a plurality of refers to two or more. In view of this, in the embodiment of the present invention, "a plurality" may also be understood as "at least two". "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. In addition, the character "/", unless otherwise specified, generally indicates that the related objects are an "or" relationship. In addition, it should be understood that in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and should not be understood as indicating or implying relative importance, nor should it be understood as indicating or implied order.
GPU是一种专用于图像和图形运算工作的硬件加速处理器。GPU可以生成用于展示2D或3D模型的目标图像,因此,GPU被广泛应用于游戏、视频以及建模等图形学相关领域。A GPU is a hardware-accelerated processor dedicated to graphics and graphics work. GPUs can generate target images for displaying 2D or 3D models. Therefore, GPUs are widely used in graphics-related fields such as games, videos, and modeling.
图1示例性示出了一种电子设备,该电子设备可以是智能相机、智能手机、平板电脑等具备图像生成功能的设备。如图1所示,电子设备10主要包括处理器11和GPU12,处理器11与GPU12连接。FIG. 1 exemplarily shows an electronic device, and the electronic device may be a smart camera, a smart phone, a tablet computer, or other devices with an image generation function. As shown in FIG. 1 , the electronic device 10 mainly includes a processor 11 and a GPU 12 , and the processor 11 is connected to the GPU 12 .
其中,处理器11可以是中央处理器(central processing unit,CPU)、片上系统(system on chip,SoC)等具有逻辑运算能力的芯片,也可以是其它类型的专用集成电路(application specific integrated circuits,ASIC),现场可编程门阵列(field programmable gate array,FPGA)等可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器11可以向GPU12发送多种类型的指令,以使GPU12可以在处理器11的控制下完成图形处理。The processor 11 may be a chip with logic computing capability such as a central processing unit (CPU), a system on chip (SoC), or other types of application specific integrated circuits (application specific integrated circuits). ASIC), field programmable gate array (FPGA) and other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The processor 11 can send various types of instructions to the GPU 12 so that the GPU 12 can complete graphics processing under the control of the processor 11 .
以游戏场景为例,处理器11可以运行游戏客户端,以得到需要通过目标图像呈现的目标模型,例如该目标模型可以是山、水、树木、人物、天空等一个或多个物体的组合,该目标图像也可以理解为游戏画面。在大多数的场景下,任意形式的目标模型通常可以通过多个图元构建,处理器11可以指示GPU12在目标图像的显示区域渲染这些图元,从而得到目标图像。其中,图元一般指基本图形元素,多为点、线、面图案等简单图形。Taking the game scene as an example, the processor 11 can run the game client to obtain the target model that needs to be presented through the target image. For example, the target model can be a combination of one or more objects such as mountains, water, trees, characters, and the sky. The target image can also be understood as a game screen. In most scenarios, the target model of any form can usually be constructed by multiple primitives, and the processor 11 can instruct the GPU 12 to render these primitives in the display area of the target image, thereby obtaining the target image. Among them, primitives generally refer to basic graphic elements, mostly simple graphics such as dots, lines, and surface patterns.
处理器11在指示GPU12渲染图元时,往往需要向GPU12发送绘图-调用(draw-call)指令,该draw-call指令可以指示GPU12需要渲染的图元,以及该图元的渲染状态等。GPU12在接收到draw-call指令后,便可以根据draw-call指令确定需要渲染的图元,并配置该图元的渲染状态(例如配置为该图元着色的着色器(shader)、图元的材质纹理等等),从而完成对该图元的渲染。When instructing the GPU 12 to render a primitive, the processor 11 often needs to send a draw-call (draw-call) instruction to the GPU 12, and the draw-call instruction may indicate the primitive to be rendered by the GPU 12 and the rendering state of the primitive. After receiving the draw-call instruction, the GPU 12 can determine the primitive to be rendered according to the draw-call instruction, and configure the rendering state of the primitive (for example, the shader configured to color the primitive, the material texture, etc.) to complete the rendering of the primitive.
可以理解,若draw-call命令过多,会使GPU12频繁配置渲染状态,不利于提高图形处理效率。因此,目前一个draw-call指令往往可以调用GPU12绘制一个或多个图元,对应于同一个draw-call指令的图元具有相同或类似的渲染状态。处理器11在发送draw-call指令之前,GPU12只需配置一次渲染状态,便可以完成一个或多个图元的渲染。从而有利于降低draw-call指令的数量,提高图形处理效率。It can be understood that if there are too many draw-call commands, the GPU 12 will frequently configure the rendering state, which is not conducive to improving the graphics processing efficiency. Therefore, currently a draw-call instruction can often call the GPU 12 to draw one or more primitives, and the primitives corresponding to the same draw-call instruction have the same or similar rendering states. Before the processor 11 sends the draw-call instruction, the GPU 12 only needs to configure the rendering state once, and then the rendering of one or more primitives can be completed. Therefore, it is beneficial to reduce the number of draw-call instructions and improve the efficiency of graphics processing.
以游戏场景为例,处理器11在得到目标模型对应的多个图元后,可以根据多个图元的渲染状态进行分类。在此情况下,处理器11每发送一个draw-call指令,可以指示GPU12渲染一个draw。在每个draw中可以包括一个或多个图元,这些图元对应于同一个draw-call指令,图元之间具有相同或类似的渲染状态。Taking a game scene as an example, after the processor 11 obtains a plurality of primitives corresponding to the target model, the processor 11 can classify the plurality of primitives according to the rendering states of the plurality of primitives. In this case, the processor 11 may instruct the GPU 12 to render a draw every time a draw-call instruction is sent. Each draw can include one or more primitives, these primitives correspond to the same draw-call instruction, and the primitives have the same or similar rendering state.
示例性的,假设目标模型主要由图元a和图元b组成,其中图元a属于drawA,图元b属于drawB。如图2a所示,CPU12可以依次指示GPU渲染draw B和draw A。GPU在完成渲染draw B后,在目标图像的显示区域形成如图2b所示的图像。GPU12继续在显示区域完成渲染draw A后,可以在显示区域得到如图2c所示的图像。Exemplarily, it is assumed that the target model is mainly composed of primitive a and primitive b, wherein primitive a belongs to drawA, and primitive b belongs to drawB. As shown in Figure 2a, the CPU 12 may instruct the GPU to render draw B and draw A in sequence. After the GPU finishes rendering draw B, the image shown in Figure 2b is formed in the display area of the target image. After the GPU 12 continues to render draw A in the display area, the image shown in FIG. 2c can be obtained in the display area.
可以理解,draw A和draw B皆可以覆盖显示区域。针对显示区域中的每一个像素,draw A和draw B皆对应有相同或不同的可视优先级。It can be understood that both draw A and draw B can cover the display area. For each pixel in the display area, draw A and draw B have the same or different visual priority.
在一种可能的实现方式中,可以使用深度值表征可视优先级。首先对深度值作简单说明。In one possible implementation, a depth value can be used to characterize the visual priority. First, a brief description of the depth value is given.
假设存在一虚拟相机,该虚拟相机也可以称为视点(view point)。目标模型包括一个或多个物体,沿虚拟相机的镜头朝向,物体在显示区域上的投影距离,即可以理解为该物体的深度值。Assuming that there is a virtual camera, the virtual camera may also be called a view point. The target model includes one or more objects, along the lens orientation of the virtual camera, the projection distance of the object on the display area can be understood as the depth value of the object.
如图3所示,物体2与显示区域之间的投影距离最小,因此物体2的深度值最小。物体3与显示区域之间的投影距离最大,因此物体3的深度值最大。物体1的深度值则位于物体2的深度值和物体3的深度值之间。As shown in Fig. 3, the projection distance between the object 2 and the display area is the smallest, so the depth value of the object 2 is the smallest. The projection distance between object 3 and the display area is the largest, so the depth value of object 3 is the largest. The depth value of object 1 is located between the depth value of object 2 and the depth value of object 3.
在两个物体的投影重叠时,远处的物体将会被近处的物体遮挡。例如图3中,物体1便可以遮挡物体3。因此,在采用图3所示的投影角度,并以物体1、物体2和物体3为 目标模型时,目标图像中将优先展示物体1的投影,而物体3的投影将被部分或全部遮挡。When the projections of two objects overlap, distant objects will be occluded by nearby objects. For example, in Figure 3, object 1 can block object 3. Therefore, when the projection angle shown in Figure 3 is adopted and object 1, object 2 and object 3 are used as target models, the projection of object 1 will be preferentially displayed in the target image, while the projection of object 3 will be partially or completely occluded.
以上为不同物体之间的深度值与遮挡关系,在目标图像中,图元之间也满足该深度值与遮挡关系。也就是说,若任两个图元覆盖了同一个像素,则在该像素上优先显示深度值较小的图元的像素。也可以理解为,若draw在像素上的深度值越小,则该draw在该像素上的可视优先级越高。对于每个draw中未被图元覆盖的区域对应的深度值,则可以采用默认值。该默认值应大于或等于目标图像中有可能出现的最大的深度值。The above is the depth value and the occlusion relationship between different objects. In the target image, the depth value and the occlusion relationship are also satisfied between the primitives. That is to say, if any two primitives cover the same pixel, the pixel of the primitive with the smaller depth value is preferentially displayed on the pixel. It can also be understood that if the depth value of the draw on the pixel is smaller, the visual priority of the draw on the pixel is higher. For the depth value corresponding to the area not covered by the primitive in each draw, the default value can be used. The default value should be greater than or equal to the largest possible depth value in the target image.
可以理解,深度值与可视优先级之间的关系并不是固定的。在部分场景下,也可能出现深度值越大,可视优先级越高的情况。本申请实施例对此并不多做限制。It will be appreciated that the relationship between depth value and visual priority is not fixed. In some scenarios, the larger the depth value, the higher the visual priority. This embodiment of the present application does not limit this.
在另一种可能的实现方式中,也可以使用绘图先后顺序表征可视优先级。具体来说,在部分场景下,处理器11可以指示GPU12在显示区域依次绘制多个图元,按照GPU12绘制的先后顺序,每个图元的可视优先级依次升高。也就是说,当两个图元存在重叠时,在重叠区域优先显示较晚绘制的图元。In another possible implementation, the visual priority may also be represented by the drawing sequence. Specifically, in some scenarios, the processor 11 may instruct the GPU 12 to draw multiple primitives in sequence in the display area, and the visual priority of each primitive increases in sequence according to the drawing sequence of the GPU 12 . That is, when two primitives overlap, the primitive drawn later is preferentially displayed in the overlapping area.
可以理解,绘图先后顺序与可视优先级之间的关系并不是固定的。在部分场景下,也可能出现越早绘制的图元,其可视优先级越高的情况,本申请实施例对此并不多作限制。It can be understood that the relationship between drawing sequence and visual priority is not fixed. In some scenarios, it may also happen that the earlier the primitives are drawn, the higher the visual priority thereof, which is not limited in this embodiment of the present application.
需要指出的是,除深度值和绘图先后顺序之外,本申请实施例中的可视优先级还可以存在多种可能的表征方式,本申请实施例对此不再一一列举。It should be pointed out that, in addition to the depth value and the drawing sequence, the visual priority in the embodiment of the present application may also have multiple possible representation modes, which are not listed one by one in the embodiment of the present application.
为了便于理解,在未特别指出的情况下,本申请实施例接下来以深度值越小,可视优先级越大的场景为例进行说明。For ease of understanding, unless otherwise specified, the following embodiments of the present application take a scenario in which the smaller the depth value is, the higher the visual priority is, as an example for description.
由于部分深度值较大的图元有可能被其它深度值较小的图元遮盖,在不考虑存在透明或半透明物体的情况下,图元中被遮盖的部分往往不需要呈现在目标图像中。因此,GPU12对图元中被遮盖部分的渲染往往是无效渲染,浪费了GPU12的运算资源。Since some primitives with larger depth values may be obscured by other primitives with smaller depth values, the occluded parts of primitives often do not need to be rendered in the target image without considering the existence of transparent or translucent objects. . Therefore, the rendering of the covered parts of the primitives by the GPU 12 is often invalid rendering, which wastes the computing resources of the GPU 12 .
有鉴于此,GPU12在对各个draw进行渲染之前,还可以分别对各个draw中的图元进行深度测试(depth-test),以筛选出每个draw中不被全部遮挡的图元进行渲染。接下来,对GPU12进行深度测试的具体实现过程作进一步的示例性说明。In view of this, before rendering each draw, the GPU 12 may further perform a depth-test (depth-test) on the primitives in each draw, so as to filter out the primitives that are not completely occluded in each draw for rendering. Next, the specific implementation process of the depth test performed by the GPU 12 is further exemplified.
示例性的,GPU12可以每接收到一个draw-call指令后,便对该draw-call指令指示的draw中的图元进行深度测试。待处理器11将目标模型对应的所有图元皆通过draw-call指令指示给GPU12后,GPU12也将同步完成对所有图元的深度测试,从而得到深度缓冲数据。Exemplarily, each time the GPU 12 receives a draw-call instruction, it may perform a depth test on the primitives in the draw indicated by the draw-call instruction. After the processor 11 indicates all the primitives corresponding to the target model to the GPU 12 through the draw-call instruction, the GPU 12 will also synchronously complete the depth test on all the primitives, thereby obtaining the depth buffer data.
以draw X为例,该draw X可以是用于生成目标图像的任一draw。具体来说,draw X中包括了一个或多个图元。针对一个目标图像,处理器11可以依次向GPU12发送多个draw-call指令。Take draw X as an example, the draw X can be any draw used to generate the target image. Specifically, draw X includes one or more primitives. For one target image, the processor 11 may send multiple draw-call instructions to the GPU 12 in sequence.
针对该目标图像,若draw X是GPU12接收到的第一个draw-call指令所指示的draw,则GPU12可以获取初始的深度缓冲数据,该初始的深度缓冲数据中每个像素的深度值皆为默认值。可以理解,该默认值不小于目标图像中可以出现的最大深度值。GPU根据draw X中一个或多个图元的深度值更新深度缓冲数据。例如,draw X中包括图元x和图元y,且图元x和图元y在像素i处重叠。其中,图元x在像素i的深度值为10,图元y在像素i的深度值为15。For the target image, if draw X is the draw indicated by the first draw-call instruction received by the GPU 12, the GPU 12 can obtain the initial depth buffer data, and the depth value of each pixel in the initial depth buffer data is Defaults. It can be understood that the default value is not less than the maximum depth value that can appear in the target image. The GPU updates the depth buffer data based on the depth values of one or more primitives in draw X. For example, draw X includes primitive x and primitive y, and primitive x and primitive y overlap at pixel i. Among them, the depth value of primitive x at pixel i is 10, and the depth value of primitive y at pixel i is 15.
在对draw X进行深度测试的过程中,GPU可以获取图元x在各个像素的深度值。GPU先根据图元x在各个像素的深度值更新深度缓冲数据。此时,深度缓冲数据中像素i的深 度值为默认值,图元x在像素i的深度值为10(小于默认值),GPU可以将深度缓冲数据中像素i的深度值更新为10。During the depth test of draw X, the GPU can obtain the depth value of the primitive x at each pixel. The GPU first updates the depth buffer data according to the depth value of the primitive x at each pixel. At this time, the depth value of pixel i in the depth buffer data is the default value, and the depth value of the primitive x in pixel i is 10 (less than the default value), and the GPU can update the depth value of pixel i in the depth buffer data to 10.
在遍历过图元x中各个像素的深度值后,GPU可以获取图元y在各个像素的深度值。GPU继续根据图元y在各个像素的深度值更新深度缓冲数据。此时,深度缓冲数据中像素i的深度值为10,图元y在像素i的深度值为15(大于10)。由于图元y在像素i的深度值大于此时深度缓冲数据中像素i的深度值,因此可以认为在像素i处图元y将会被其它图元(图元x)覆盖,GPU维持深度缓冲数据中像素i的深度值为10。After traversing the depth values of each pixel in the primitive x, the GPU can obtain the depth value of each pixel in the primitive y. The GPU continues to update the depth buffer data according to the depth value of the primitive y at each pixel. At this time, the depth value of pixel i in the depth buffer data is 10, and the depth value of primitive y in pixel i is 15 (greater than 10). Since the depth value of the primitive y at the pixel i is greater than the depth value of the pixel i in the depth buffer data at this time, it can be considered that the primitive y at the pixel i will be covered by other primitives (the primitive x), and the GPU maintains the depth buffer. The depth value of pixel i in the data is 10.
GPU12进而可以根据深度缓冲数据分别对draw X中的图元进行渲染。以图元x所覆盖的像素j为例,假设深度缓冲数据中像素j对应的深度值为15,若图元x在像素j的深度值为10,其小于深度缓冲数据中像素j对应的深度值,则说明目标图像中的像素j有可能呈现的是图元x的像素j,GPU12可以渲染图元x中的像素j,也就是在像素j上呈现图元x的像素。若图元x在像素j的深度值为20,其大于深度缓冲数据中像素j对应的深度值,则说明目标图像中的像素j有可能并未呈现图元x的像素j,GPU12可以不渲染图元j中的像素j,从而有利于节省GPU12的运算资源。The GPU 12 can then render the primitives in draw X respectively according to the depth buffer data. Taking the pixel j covered by the primitive x as an example, assuming that the depth value corresponding to the pixel j in the depth buffer data is 15, if the depth value of the primitive x in the pixel j is 10, it is smaller than the depth corresponding to the pixel j in the depth buffer data. value, it means that the pixel j in the target image may represent the pixel j of the primitive x, and the GPU 12 can render the pixel j in the primitive x, that is, the pixel of the primitive x is presented on the pixel j. If the depth value of the primitive x in the pixel j is 20, which is greater than the depth value corresponding to the pixel j in the depth buffer data, it means that the pixel j in the target image may not present the pixel j of the primitive x, and the GPU 12 may not render the pixel j. The pixel j in the primitive j is beneficial to save the computing resources of the GPU 12 .
针对该目标图像,若draw X是GPU12接收到的该目标图像对应的第n个draw-call指令所指示的draw,n为大于1的整数,则GPU12可以获取对前一个draw(第n-1个draw-call指令所指示的draw)完成深度测试后所得到的深度缓冲数据,并在此基础上继续对draw X进行深度测试。具体的深度测试过程与前述类似,不再赘述。For the target image, if draw X is the draw indicated by the nth draw-call instruction corresponding to the target image received by the GPU 12, and n is an integer greater than 1, then the GPU 12 can obtain a The depth buffer data obtained after the draw) indicated by the draw-call instruction completes the depth test, and on this basis, the depth test of draw X is continued. The specific depth testing process is similar to the above, and will not be repeated here.
一般来说,GPU可以在像素着色(pixel shader)之前执行深度测试。在执行像素着色时,可以对各个图元中未被同一个draw中的其它图元所遮挡的像素进行着色。其中,在像素着色之前执行的深度测试,也可以称为前深度测试(early-depth-test)。In general, GPUs can perform depth testing before pixel shaders. When performing pixel shading, pixels in each primitive that are not occluded by other primitives in the same draw can be shaded. Among them, the depth test performed before pixel shading may also be called early-depth-test.
在部分场景下,例如模型中存在透明或半透明物体时,像素着色会改变部分像素的深度值,因此往往需要在像素着色之后执行深度测试,该深度测试也可以称为后深度测试(late-depth-test)。In some scenes, such as when there are transparent or semi-transparent objects in the model, pixel shading will change the depth value of some pixels, so it is often necessary to perform depth testing after pixel shading, which can also be called post-depth testing (late-depth testing). depth-test).
此外,还存在一些场景,虽然部分像素的深度值受像素着色影响,但该影响是可以预知的。例如,像素着色后,部分像素的深度值能够变大。在此情况下,可以在像素着色之前执行一次前深度测试,在像素着色之后再执行一次深度测试。该深度测试方式也可以称为保守深度测试(conservative depth test)。In addition, there are some scenes where the depth value of some pixels is affected by pixel shading, but the effect is predictable. For example, after pixel shading, the depth value of some pixels can become larger. In this case, a pre-depth test can be performed before pixel shading and another depth test after pixel shading. This depth test method may also be referred to as a conservative depth test.
虽然通过上述深度测试,可以省去渲染每个draw内部分被遮挡的图元的过程。然而,不同draw之间也会存在图元重叠,如图2c所示,draw A中的图元a会部分遮挡draw B中的图元b。若处理器11先指示GPU12渲染draw B中的图元b,再指示GPU12渲染draw A中的图元a,在此情况下,便无法通过上述深度测试避免对图元b的无效渲染,造成了GPU运算资源浪费。Although by passing the above depth test, the process of rendering partially occluded primitives within each draw can be omitted. However, primitives overlap between different draws. As shown in Figure 2c, primitive a in draw A will partially occlude primitive b in draw B. If the processor 11 first instructs the GPU 12 to render the primitive b in the draw B, and then instructs the GPU 12 to render the primitive a in the draw A, in this case, the invalid rendering of the primitive b cannot be avoided through the above depth test, resulting in GPU computing resources are wasted.
有鉴于此,本申请实施例提供一种图形处理方法,可以减少图形处理过程中的无效渲染,节省GPU运算资源。需要指出的是,本申请实施例所提供的图形处理方法可以应用于分区域渲染(tile base rendering,TBR)GPU、直接渲染(immediate rendering,IMR)GPU、分区域延迟渲染(tile base deferred rendering,TBDR)GPU等多种类型的GPU中。In view of this, the embodiments of the present application provide a graphics processing method, which can reduce invalid rendering during graphics processing and save GPU computing resources. It should be pointed out that the graphics processing method provided by the embodiments of the present application can be applied to subregion rendering (tile base rendering, TBR) GPU, immediate rendering (immediate rendering, IMR) GPU, subregion deferred rendering (tile base deferred rendering, TBDR) GPU and other types of GPU.
图4示例性示出了本申请实施例提供的一种图形处理方法。如图4所示,主要包括以下步骤:FIG. 4 exemplarily shows a graphics processing method provided by an embodiment of the present application. As shown in Figure 4, it mainly includes the following steps:
S401:将待生成的目标图像的显示区域分为阵列排布的多个单元,每个单元包括至少一个像素。S401: Divide the display area of the target image to be generated into a plurality of units arranged in an array, and each unit includes at least one pixel.
S401也可以称为分区阶段(binning pass)。示例性的,如图2a和图5所示,GPU12可以将显示区域分为单元0至单元15。单元0至单元15在显示区域中阵列排布,每个单元中可以包括一个或多个阵列排布的像素。可以理解,由于目标图像包括在显示区域内重叠的多个draw,因此GPU12将显示区域划分为多个单元,也可以等效为GPU12分别将构成目标图像的多个draw划分为阵列排布的多个单元。S401 may also be referred to as a binning pass. Exemplarily, as shown in FIG. 2 a and FIG. 5 , the GPU 12 may divide the display area into units 0 to 15 . Cells 0 to 15 are arranged in an array in the display area, and each cell may include one or more pixels arranged in an array. It can be understood that since the target image includes multiple draws that overlap in the display area, the GPU12 divides the display area into multiple units, which can also be equivalent to that the GPU12 divides the multiple draws that constitute the target image into multiple draws arranged in an array. unit.
例如图2a中,目标图像包括drawA和drawB,将显示区域分为单元0至单元15,相当于GPU12分别将drawA和drawB分为单元0至单元15。又例如图5中,目标图像包括drawA、drawB、drawC和drawD,将显示区域分为单元0至单元15,相当于GPU12分别将drawA、drawB、drawC和drawD分为单元0至单元15。For example, in Fig. 2a, the target image includes drawA and drawB, and the display area is divided into units 0 to 15, which is equivalent to the GPU 12 dividing drawA and drawB into units 0 to 15 respectively. 5, the target image includes drawA, drawB, drawC and drawD, and the display area is divided into units 0 to 15, which is equivalent to the GPU 12 dividing drawA, drawB, drawC and drawD into units 0 to 15 respectively.
在本申请实施例中,每个单元皆对应有最低可视优先级,也就是目标图像在每个单元内的最低可视优先级。例如,在深度值越小,可视优先级越高的场景下,每个单元对应的最低可视优先级,也就是每个单元对应的最大深度值Dmax。每个单元对应的最大深度值Dmax可以理解为目标图像在该单元中的最大深度值。例如,单元0对应的最大深度值可以为目标图像在单元0中的最大深度值,也可以理解为,在单元0内可见的像素的最大深度值。In the embodiment of the present application, each unit corresponds to the lowest visible priority, that is, the lowest visible priority of the target image in each unit. For example, in a scene where the smaller the depth value is, the higher the visual priority is, the lowest visual priority corresponding to each unit is the maximum depth value Dmax corresponding to each unit. The maximum depth value Dmax corresponding to each unit can be understood as the maximum depth value of the target image in this unit. For example, the maximum depth value corresponding to unit 0 may be the maximum depth value of the target image in unit 0, or it may be understood as the maximum depth value of visible pixels in unit 0.
示例性的,GPU12可以通过枚举、扫描线算法、线性差值算法等方法,计算目标图像在每个单元中的最大深度值,本申请实施例对此并不多做限制。可以理解,相较于实际得到的目标图像,该计算结果有可能存在误差。有鉴于此,GPU可以在计算每个对应的最大深度值时,采用较为保守算法进行计算。以单元0为例,通过较为保守算法进行计算,在确保计算得到的单元0对应的最大深度值Dmax不小于后期实际得到的目标图像在单元0的最大深度值的基础上,使单元0对应的最大深度值Dmax尽可能接近后期实际得到的目标图像在单元0的最大深度值。Exemplarily, the GPU 12 may calculate the maximum depth value of the target image in each unit by methods such as enumeration, scan line algorithm, linear difference algorithm, etc., which is not limited in this embodiment of the present application. It can be understood that there may be errors in the calculation result compared with the actual target image obtained. In view of this, the GPU can use a more conservative algorithm to calculate each corresponding maximum depth value. Taking unit 0 as an example, the calculation is performed by a relatively conservative algorithm. On the basis of ensuring that the calculated maximum depth value Dmax corresponding to unit 0 is not less than the maximum depth value of the target image actually obtained in the later stage in unit 0, make the corresponding maximum depth value of unit 0. The maximum depth value Dmax is as close as possible to the maximum depth value of the target image in unit 0 actually obtained later.
又例如,在深度值越大,可视优先级越高的场景下,每个单元对应的最低可视优先级,也就是每个单元对应的最小深度值。每个单元对应的最小深度值可以理解为目标图像在该单元中的最小深度值。例如,单元0对应的最小深度值可以为目标图像在单元0中的最小深度值,也可以理解为,在单元0内可见的像素的最小深度值。For another example, in a scenario where the larger the depth value is, the higher the visual priority is, the lowest visual priority corresponding to each unit is the minimum depth value corresponding to each unit. The minimum depth value corresponding to each unit can be understood as the minimum depth value of the target image in this unit. For example, the minimum depth value corresponding to unit 0 may be the minimum depth value of the target image in unit 0, or it may be understood as the minimum depth value of the visible pixels in unit 0.
再例如,在按照绘制的先后顺序,每个图元的可视优先级依次升高的场景下,每个单元对应的最低可视优先级也就是目标图像在该单元内最早绘制的图元的优先级。例如目标图像中存在3个图元部分或全部位于单元0,则单元0对应的最低可视优先级为上述3个图元中最早绘制的图元的优先级。For another example, in a scenario where the visual priority of each graphic element increases in sequence according to the drawing sequence, the lowest visual priority corresponding to each unit is the earliest graphic element drawn by the target image in that unit. priority. For example, if there are 3 primitives in the target image, some or all of them are located in unit 0, and the lowest visible priority corresponding to unit 0 is the priority of the earliest drawn primitive among the above 3 primitives.
还例如,在按照绘制的先后顺序,每个图元的可视优先级依次降低的场景下,每个单元对应的最低可视优先级也就是目标图像在该单元内最晚绘制的图元的优先级。例如目标图像中存在3个图元部分或全部位于单元0,则单元0对应的最低可视优先级为上述3个图元中最早绘制的图元的优先级。Also, for example, in a scenario where the visual priority of each primitive decreases in sequence according to the drawing sequence, the lowest visual priority corresponding to each unit is the final value of the primitive drawn by the target image in the unit. priority. For example, if there are 3 primitives in the target image, some or all of them are located in unit 0, and the lowest visible priority corresponding to unit 0 is the priority of the earliest drawn primitive among the above 3 primitives.
此外,本申请实施例中每个draw还对应有多个最大可视优先级。具体来说,每个draw皆可以分为多个单元,每个draw对应的多个最大可视优先级,可以理解为该draw分别在多个单元内的最大可视优先级。In addition, each draw in the embodiment of the present application also corresponds to a plurality of maximum visual priorities. Specifically, each draw can be divided into multiple units, and the multiple maximum visual priorities corresponding to each draw can be understood as the maximum visual priorities of the draw in the multiple units respectively.
例如,在深度值越小,可视优先级越高的场景下,每个draw对应有多个最小深度值 Dmin。例如drawA包括单元0至单元15,则draw A具有与单元0至单元15分别一一对应的15个最小深度值,如DminA0至DminA15。其中,DminA0为drawA在单元0的最小深度值,DminA1为drawA在单元1的最小深度值,……,DminA15为drawA在单元15的最小深度值。For example, in a scene with a smaller depth value and a higher visual priority, each draw corresponds to multiple minimum depth values Dmin. For example, drawA includes unit 0 to unit 15, then draw A has 15 minimum depth values corresponding to unit 0 to unit 15 respectively, such as DminA0 to DminA15. Among them, DminA0 is the minimum depth value of drawA in unit 0, DminA1 is the minimum depth value of drawA in unit 1, ..., DminA15 is the minimum depth value of drawA in unit 15.
又例如,在深度值越大,可视优先级越高的场景下,每个draw对应有多个最大深度值。再例如,在按照绘制的先后顺序,每个图元的可视优先级依次升高的场景下,每个draw对应有多个最高可视优先级,也就是draw在每个单元内最晚绘制的图元的优先级。还例如,在按照绘制的先后顺序,每个图元的可视优先级依次降低的场景下,每个draw对应有多个最高可视优先级,也就是draw在每个单元内最早绘制的图元的优先级。For another example, in a scene with a larger depth value and a higher visual priority, each draw corresponds to multiple maximum depth values. For another example, in a scenario where the visual priority of each primitive increases in sequence according to the drawing sequence, each draw corresponds to multiple highest visual priorities, that is, the draw is drawn at the latest in each unit. The priority of the primitive. For another example, in a scenario where the visual priority of each primitive decreases in sequence according to the drawing sequence, each draw corresponds to multiple highest visual priorities, that is, the earliest drawing drawn by the draw in each unit. Element priority.
为了便于理解,本申请实施例以深度值越小,可视优先级越高的场景为例进行说明。需要指出的是,其它场景下可视优先级的具体实现,及优先级的高低判断皆可以在本申请所提供的以下示例的基础上作适应性调整而实现,也应包含于本申请实施例之中。For ease of understanding, the embodiment of the present application uses a scene in which the smaller the depth value is, the higher the visual priority is, as an example for description. It should be pointed out that the specific implementation of the visual priority in other scenarios and the determination of the priority level can be realized by making adaptive adjustments on the basis of the following examples provided in this application, and shall also be included in the embodiments of this application. among.
如前所述,每个单元对应的最小深度值可以理解为目标图像在该单元中的最小深度值。在一种可能的实现方式中,GPU12可以根据深度缓冲数据得到每个单元对应的最小深度值。以图5为例,假设处理器11依次向GPU12发送了draw D对应的draw-call指令1、draw C对应的draw-call指令2、draw B对应的draw-call指令3和draw C对应的draw-call指令4。GPU12还可以对draw D至draw A进行深度测试,在对draw A完成深度测试后,所得到的深度缓冲数据中每个像素所对应的深度值便可以理解为目标图像中每个像素对应的深度值。因此,可以在该深度缓冲数据的基础上分别确定每个单元对应的最大深度值。As mentioned above, the minimum depth value corresponding to each unit can be understood as the minimum depth value of the target image in this unit. In a possible implementation manner, the GPU 12 may obtain the minimum depth value corresponding to each unit according to the depth buffer data. Taking FIG. 5 as an example, it is assumed that the processor 11 sequentially sends the draw-call instruction 1 corresponding to draw D, the draw-call instruction 2 corresponding to draw C, the draw-call instruction 3 corresponding to draw B, and the draw corresponding to draw C to the GPU 12. -call instruction 4. GPU12 can also perform depth test on draw D to draw A. After completing the depth test on draw A, the depth value corresponding to each pixel in the obtained depth buffer data can be understood as the depth corresponding to each pixel in the target image. value. Therefore, the maximum depth value corresponding to each unit can be determined on the basis of the depth buffer data.
如前所述,每个draw对应有多个最大深度值。示例性的,如图5所示,draw D包括图元d1和图元d2(draw D只有一个图元或draw D具有三个及以上数量图元的情况同理)。对于显示区域中的任一单元来说,该单元的最小深度值主要存在以下几种可能出现的情况:As mentioned earlier, each draw corresponds to multiple maximum depth values. Exemplarily, as shown in Figure 5, draw D includes a primitive d1 and a primitive d2 (the same is true for the case where draw D has only one primitive or draw D has three or more primitives). For any unit in the display area, the minimum depth value of the unit mainly has the following possible situations:
情况一:图元d1的部分或全部位于该单元,图元d2全部位于该单元之外,例如图5中单元0。在此情况下,drawD在单元0的最小深度值为图元d1在单元0的最小深度值,也就是图元d1位于单元0的部分内,每个像素的深度值的最小值。Case 1: Part or all of the primitive d1 is located in the unit, and the primitive d2 is all located outside the unit, such as unit 0 in FIG. 5 . In this case, the minimum depth value of drawD in unit 0 is the minimum depth value of primitive d1 in unit 0, that is, the minimum depth value of each pixel in the part of primitive d1 located in unit 0.
情况二:图元d2的部分或全部位于该单元,图元d1全部位于该单元之外,例如图5中单元15。在此情况下,drawD在单元15的最小深度值为图元d2在单元15的最小深度值,也就是图元d2位于单元15的部分内,每个像素的深度值的最小值。Case 2: Part or all of the primitives d2 are located in this unit, and all of the primitives d1 are located outside the unit, such as unit 15 in FIG. 5 . In this case, the minimum depth value of drawD in unit 15 is the minimum depth value of primitive d2 in unit 15, that is, the minimum depth value of each pixel in the portion of primitive d2 located in unit 15.
情况三:图元d1部分或全部位于该单元,图元d2部分或全部位于该单元,例如图5中的单元9。在此情况下,假设图元d1在单元9的最小深度值为Dmind1,图元d2在单元9的最小深度值为Dmind2,则drawD在单元9的最小深度值为Dmind1和Dmind2中的最小值。Case 3: Part or all of the primitive d1 is located in this unit, and part or all of the primitive d2 is located in this unit, for example, the unit 9 in FIG. 5 . In this case, assuming that the minimum depth value of primitive d1 in unit 9 is Dmind1, and the minimum depth value of primitive d2 in unit 9 is Dmind2, the minimum depth value of drawD in unit 9 is the minimum of Dmind1 and Dmind2.
情况四:图元d1和图元d2皆全部位于该单元之外,例如图5中的单元11。在此情况下,drawD在单元11的最小深度值可以为默认值,默认值不小于目标图像中能够出现的最大深度值。Case 4: Both the primitive d1 and the primitive d2 are located outside the unit, such as unit 11 in FIG. 5 . In this case, the minimum depth value of drawD in unit 11 may be the default value, and the default value is not less than the maximum depth value that can appear in the target image.
换言之,每个单元具有与之对应的一个最大深度值Dmax,以及多个最小深度值,该多个最小深度值分别与目标图像的多个draw一一对应。例如图5中单元0具有与之对应的一个最大深度值Dmax,以及4个最小深度值Dmin。该4个最小深度值Dmin分别为drawA在单元0的最小深度值DminA0、drawB在单元0的最小深度值DminB0、drawC在单元0 的最小深度DminC0和drawD在单元0的最小深度值DminD0。In other words, each unit has a maximum depth value Dmax corresponding to it, and a plurality of minimum depth values, and the plurality of minimum depth values respectively correspond to a plurality of draws of the target image in a one-to-one manner. For example, unit 0 in FIG. 5 has one maximum depth value Dmax and 4 minimum depth values Dmin corresponding to it. The four minimum depth values Dmin are respectively the minimum depth value DminA0 of drawA in unit 0, the minimum depth value DminB0 of drawB in unit 0, the minimum depth value DminC0 of drawC in unit 0, and the minimum depth value DminD0 of drawD in unit 0.
示例性的,GPU12可以通过枚举、扫描线算法、线性差值算法等方法,计算每个单元对应的多个最小深度值,本申请实施例对此并不多做限制。Exemplarily, the GPU 12 may calculate a plurality of minimum depth values corresponding to each unit through methods such as enumeration, scan line algorithm, linear difference algorithm, etc., which is not limited in this embodiment of the present application.
S402:分别渲染多个draw。S402: Render multiple draws respectively.
S402也可以称为渲染阶段(rendering pass)。具体来说,GPU12可以按照上述多个单元分别对应的最大深度值Dmax,以及每个draw分别对应的多个最小深度值Dmin,分别渲染上述多个draw。S402 may also be referred to as a rendering pass. Specifically, the GPU 12 may render the multiple draws according to the respective maximum depth values Dmax corresponding to the multiple units and multiple minimum depth values Dmin corresponding to each draw.
以drawA为例,GPU12按照单元0至单元15的顺序依次遍历drawA中的单元。以单元0为例,在drawA在单元0中的最小深度值DminA0小于或等于单元0对应的最大深度值Dmax0时,说明在单元0处,drawA有可能不会被其它draw中的图元遮挡,因此GPU可以渲染drawA在单元0的部分。Taking drawA as an example, the GPU 12 sequentially traverses the units in drawA in the order of unit 0 to unit 15 . Taking unit 0 as an example, when the minimum depth value DminA0 of drawA in unit 0 is less than or equal to the maximum depth value Dmax0 corresponding to unit 0, it means that at unit 0, drawA may not be blocked by primitives in other draws. So the GPU can render the part of drawA in cell 0.
在drawA在单元0中的最小深度值DminA0大于单元0对应的最大深度值Dmax0时,drawA在单元0中的任何一个像素的深度值都小于目标图像在单元0的最大深度值。因此,可以认为drawA会被其它draw中的图元完全遮挡,此时对drawA的渲染便是无效渲染。为了节省GPU运算资源,在此情况下,GPU12可以不渲染drawA在单元0的部分。When the minimum depth value DminA0 of drawA in unit 0 is greater than the maximum depth value Dmax0 corresponding to unit 0, the depth value of any pixel in drawA in unit 0 is smaller than the maximum depth value of the target image in unit 0. Therefore, it can be considered that drawA will be completely occluded by the primitives in other draws, and the rendering of drawA at this time is invalid rendering. In order to save GPU computing resources, in this case, GPU 12 may not render the part of drawA in unit 0.
GPU12按照上述过程继续遍历单元1至单元15,从而完成对drawA的渲染。可以理解,由于本申请实施例中GPU12可以不渲染drawA中被完全遮挡的单元,因此经过渲染的drawA中有可能存在一个或多个单元并没有被渲染。The GPU 12 continues to traverse the unit 1 to the unit 15 according to the above process, so as to complete the rendering of drawA. It can be understood that, because the GPU 12 in this embodiment of the present application may not render the completely occluded units in drawA, there may be one or more units in the rendered drawA that have not been rendered.
GPU12对drawB、drawC和drawD的渲染与之类似,具体实现不再赘述。GPU12在对draw D至draw A完成渲染后,可以得到目标图像。如图5所示,假设draw A中的图元a的深度值大于draw B中的图元b的深度值,图元a会被图元b完全遮挡。采用本申请实施例所提供的图形处理方法,GPU12便无需响应draw A对应的draw-call指令4,既不需要配置图元a的渲染状态,更不需要对图元a进行渲染,从而有利于节省GPU12的运算资源。The rendering of drawB, drawC, and drawD by GPU12 is similar, and the specific implementation will not be repeated. After the GPU 12 completes the rendering of draw D to draw A, the target image can be obtained. As shown in Figure 5, if the depth value of primitive a in draw A is greater than the depth value of primitive b in draw B, primitive a will be completely occluded by primitive b. Using the graphics processing method provided by the embodiment of the present application, the GPU 12 does not need to respond to the draw-call instruction 4 corresponding to draw A, neither needs to configure the rendering state of the primitive a, nor does it need to render the primitive a, which is beneficial to The computing resources of the GPU 12 are saved.
可以理解,通过以上方式可以省去渲染每个draw中被其它draw遮挡的单元的过程。但在每个draw之内,也可能存在图元与图元之间的遮挡,从而浪费GPU12的运算资源。而且,若每个单元中包括的像素较多,则会增加GPU12对被遮挡图元的无效渲染,有鉴于此,本申请实施例中,每个单元可以包括至少一个阵列排布的子单元,每个子单元包括阵列排布的至少一个像素。It can be understood that in the above manner, the process of rendering the units occluded by other draws in each draw can be omitted. However, within each draw, there may also be occlusions between primitives, thereby wasting the computing resources of the GPU 12 . Moreover, if each unit includes more pixels, the invalid rendering of the occluded primitives by the GPU 12 will increase. In view of this, in the embodiment of the present application, each unit may include at least one subunit arranged in an array, Each subunit includes at least one pixel arranged in an array.
例如,显示区域可以分为16个单元(单元0至单元15)。每个单元进一步可以包括4个子单元,具体来说,单元0可以包括子单元0-0至子单元0-3,单元b1包括子单元1-4至子单元1-7,……,单元15可以包括子单元15-60至子单元15-63。For example, the display area may be divided into 16 cells (cell 0 to cell 15). Each unit may further include 4 subunits, specifically, unit 0 may include subunit 0-0 to subunit 0-3, unit b1 includes subunit 1-4 to subunit 1-7, ..., unit 15 Subunits 15-60 to 15-63 may be included.
每个子单元皆对应有最大深度值,该最大深度值为目标图像在第一子单元中的最大深度值。以单元0为例,GPU可以将子单元0-0至子单元0-3分别对应的最大深度值中的最大值,作为单元0对应的最大深度值。其它单元同理,不再赘述。Each subunit corresponds to a maximum depth value, and the maximum depth value is the maximum depth value of the target image in the first subunit. Taking unit 0 as an example, the GPU may take the maximum value among the maximum depth values corresponding to subunit 0-0 to subunit 0-3 as the maximum depth value corresponding to unit 0. The same is true for other units and will not be repeated here.
示例性的,在本申请实施例应用于TBR GPU时,单元可以是分区(tile),子单元可以是像素块(pixel block)或深度块(depth block);或者,单元可以是pixel block,子单元可以是depth block。Exemplarily, when the embodiments of the present application are applied to a TBR GPU, the unit may be a tile, and the subunit may be a pixel block or a depth block; Cells can be depth blocks.
其中,TBR GPU中的tile主要用于分区渲染。在TBR GPU渲染每个draw的过程中,TBR GPU只需要缓存渲染一个tile的过程中生成的数据,相较于传统的GPU(GPU需要 缓存渲染整个draw的过程中生成的数据),通过将显示区域分为多个tile可以大大降低GPU所需的存储空间。在本申请实施例中,可以复用TBR GPU中的tile作为本申请实施例中的单元,有利于降低对TBR GPU的改变,节省设计成本。Among them, tiles in TBR GPU are mainly used for partition rendering. In the process of rendering each draw on the TBR GPU, the TBR GPU only needs to cache the data generated in the process of rendering a tile. Compared with the traditional GPU (the GPU needs to cache the data generated in the process of rendering the entire draw), the display Dividing a region into multiple tiles can greatly reduce the storage space required by the GPU. In the embodiment of the present application, the tiles in the TBR GPU can be reused as the unit in the embodiment of the present application, which is beneficial to reduce changes to the TBR GPU and save design costs.
一般来说,tile中包括较多的像素。可以理解,若单元中像素数量较多,不利于提高本申请实施例的精细度,有可能降低本申请实施例对GPU12运算资源的优化效果。有鉴于此,本申请实施例中的单元还可以是pixel block。Generally speaking, tiles include more pixels. It can be understood that if the number of pixels in a unit is large, it is not conducive to improving the fineness of the embodiment of the present application, and may reduce the optimization effect of the embodiment of the present application on the computing resources of the GPU 12 . In view of this, the unit in this embodiment of the present application may also be a pixel block.
具体来说,如图6所示,每个tile可以包括阵列排布的多个pixel block(b0至b15)。在本申请实施例中的单元为pixel block时,子单元可以为depth block。如图7所示,每个pixel block包括4个depth block,其中,b0包括d0至d3,b1包括d4至d7,……,b15包括d60至d63。Specifically, as shown in FIG. 6 , each tile may include a plurality of pixel blocks (b0 to b15) arranged in an array. When the unit in the embodiment of the present application is a pixel block, the subunit may be a depth block. As shown in Fig. 7, each pixel block includes 4 depth blocks, wherein b0 includes d0 to d3, b1 includes d4 to d7, ..., b15 includes d60 to d63.
本申请实施例中,GPU12可以以子单元为粒度渲染每个draw。由于子单元中像素的数量不大于单元中像素的数量,因此有利于提高渲染过程中对比的精细度,有利于提高对GPU12运算资源的优化效果。In this embodiment of the present application, the GPU 12 may render each draw at the granularity of subunits. Since the number of pixels in the subunit is not greater than the number of pixels in the unit, it is beneficial to improve the fineness of the contrast in the rendering process and to improve the optimization effect of the computing resources of the GPU 12 .
具体来说,以draw X为例,该draw X可以是目标图像中的任一draw。GPU12在渲染draw X之前,可以先确定draw X中每个子单元关联的第一图元,其中,每个子单元关联的第一图元可以是部分或全部位于第一子单元的图元。图8为drawX在任一单元的图形示意图,该任一单元为pixel block。该任一单元中包括64个子单元(depth block),分别为子单元d0至子单元d63。如图8所示,子单元d48关联的第一图元包括图元x1、图元x2和图元x3。Specifically, take draw X as an example, the draw X can be any draw in the target image. Before rendering the draw X, the GPU 12 may first determine the first primitive associated with each subunit in the draw X, wherein the first primitive associated with each subunit may be a part or all of the primitives located in the first subunit. Figure 8 is a schematic diagram of drawX in any unit, and any unit is a pixel block. The any unit includes 64 sub-units (depth blocks), which are sub-unit d0 to sub-unit d63 respectively. As shown in FIG. 8 , the first primitive associated with the subunit d48 includes the primitive x1, the primitive x2 and the primitive x3.
GPU12根据图元x1、图元x2和图元x3分别在子单元d48中的最小深度值,从图元x1至图元x3中筛选出至少一个第二图元。具体来说,若图元x1在子单元d48中的最小深度值小于或等于子单元d48对应的最大深度值,则说明图元x1在子单元d48中的部分有可能不会被其它图元遮挡,因此需要渲染图元x1在子单元d48中的部分,图元x1可以作为第二图元。The GPU 12 filters out at least one second primitive from the primitive x1 to the primitive x3 according to the minimum depth values of the primitive x1, the primitive x2 and the primitive x3 in the subunit d48, respectively. Specifically, if the minimum depth value of the primitive x1 in the subunit d48 is less than or equal to the maximum depth value corresponding to the subunit d48, it means that the part of the primitive x1 in the subunit d48 may not be blocked by other primitives , so the part of the primitive x1 in the subunit d48 needs to be rendered, and the primitive x1 can be used as the second primitive.
若图元x1在子单元d48中的最小深度值小大于子单元d48对应的最大深度值,则说明图元x1在子单元d48中的部分被其它图元遮挡,因此无需渲染图元x1在子单元d48中的部分。其它图元同理,不再赘述。If the minimum depth value of the primitive x1 in the subunit d48 is smaller than the maximum depth value corresponding to the subunit d48, it means that the part of the primitive x1 in the subunit d48 is blocked by other primitives, so there is no need to render the primitive x1 in the subunit d48. Section in cell d48. The same is true for other graphic elements and will not be repeated here.
在后续渲染drawX的过程中,GPU12只需渲染第二图元在子单元d48的部分既可。GPU无需渲染在子单元d48中被完全遮挡的图元,因此有利于进一步节省GPU运算资源。In the process of subsequent rendering of drawX, the GPU 12 only needs to render the part of the second primitive in the subunit d48. The GPU does not need to render the primitives that are completely occluded in the subunit d48, so it is beneficial to further save the GPU computing resources.
在具体实现过程中,GPU可以在分区阶段确定每个draw中需要渲染的第二图元,并在多边形列表(polygon list,PL)中记录每个draw中第二图元与子单元之间的对应关系。在一些场景下,PL可以存储于PL堆(heap),PL heap中还可以包括每个draw的配置信息(例如每个draw的标识、指针)、相邻draw之间的边界标识等,具体实现可以参考现有TBR GPU,对此不再赘述。In the specific implementation process, the GPU can determine the second primitive that needs to be rendered in each draw in the partition stage, and record the difference between the second primitive and the subunit in each draw in the polygon list (PL). Correspondence. In some scenarios, the PL can be stored in the PL heap, and the PL heap can also include the configuration information of each draw (such as the identifier and pointer of each draw), the boundary identifier between adjacent draws, etc. The specific implementation You can refer to the existing TBR GPU, which will not be repeated here.
如图8所示,虽然需要渲染图元x1和图元x2,但在子单元d48中图元x2仍存在部分区域被图元x3遮挡。在此情况下,对图元x2中该部分像素的渲染便是无效渲染。为了进一步节省GPU12运算资源,以渲染图元x2在子单元d48中的部分为例,GPU12针对该部分中的每个像素,可以先确定该像素的深度值,在该像素的深度值小于或等于子单元d48对应的最大深度值时,渲染该像素;在该像素的深度值大于子单元d48对应的最大深度值时,不渲染该像素。采用以上方案,可以进一步省去对部分像素的无效渲染,有利于进一 步节省GPU12运算资源。As shown in FIG. 8 , although the primitive x1 and the primitive x2 need to be rendered, some areas of the primitive x2 in the subunit d48 are still occluded by the primitive x3. In this case, the rendering of this part of the pixels in the primitive x2 is invalid rendering. In order to further save the computing resources of the GPU 12, taking the part of the rendering primitive x2 in the subunit d48 as an example, the GPU 12 can first determine the depth value of the pixel for each pixel in this part, and the depth value of the pixel is less than or equal to When the maximum depth value corresponding to the subunit d48, the pixel is rendered; when the depth value of the pixel is greater than the maximum depth value corresponding to the subunit d48, the pixel is not rendered. By adopting the above scheme, the invalid rendering of some pixels can be further omitted, which is beneficial to further saving the computing resources of the GPU 12.
接下来,以图9为例,对本申请实施例所提供的图形处理方法作进一步的示例性说明。如图9所示,本申请实施例所提供的图形方法主要分为分区阶段(S401)和渲染阶段(S402)。具体来说,主要包括以下步骤:Next, taking FIG. 9 as an example, the graphics processing method provided by the embodiment of the present application is further exemplified. As shown in FIG. 9 , the graphics method provided by the embodiment of the present application is mainly divided into a partition stage ( S401 ) and a rendering stage ( S402 ). Specifically, it mainly includes the following steps:
S901:在接收到处理器11指示的多draw后,GPU12对显示区域进行栅格化(raserization)处理。每个draw包括一个或多个图元。通过栅格化处理,可以将显示区域分为阵列排布的多个像素。在此基础上,可以将显示区域进一步分为阵列排布的多个单元,每个单元中包括阵列排布的至少一个像素。S901: After receiving the multi-draw instruction instructed by the processor 11, the GPU 12 performs rasterization (raserization) processing on the display area. Each draw includes one or more primitives. Through the rasterization process, the display area can be divided into a plurality of pixels arranged in an array. On this basis, the display area can be further divided into a plurality of units arranged in an array, and each unit includes at least one pixel arranged in an array.
S902:确定每个单元对应的最大深度值Dmax,以及,每个draw分别在每个单元中的最小深度值Dmin。S902: Determine the maximum depth value Dmax corresponding to each unit, and the minimum depth value Dmin of each draw in each unit.
可以理解,在每个单元中只包括一个像素的情况下,每个单元对应的最大深度值Dmax也就是该像素在目标图像中的深度值。在此情况下,的每个单元对应的最大深度值Dmax也可以理解为,在对目标图像的多个draw全部完成深度测试后,所得到的深度缓冲数据中每个像素对应的深度值。例如在图5所示的场景中,依次对draw D至draw A进行深度测试,在对draw A完成深度测试后所得到的深度缓冲数据便可以作为每个单元(像素)对应的最大深度值Dmax。It can be understood that in the case that each unit includes only one pixel, the maximum depth value Dmax corresponding to each unit is the depth value of the pixel in the target image. In this case, the maximum depth value Dmax corresponding to each unit can also be understood as the depth value corresponding to each pixel in the obtained depth buffer data after completing the depth test for all the multiple draws of the target image. For example, in the scene shown in Figure 5, the depth test is performed on draw D to draw A in turn, and the depth buffer data obtained after the depth test on draw A is completed can be used as the maximum depth value Dmax corresponding to each unit (pixel). .
在每个单元中只包括一个像素的情况下,每个draw分别在每个单元中的最小深度值Dmin,也就是每个draw分别在每个像素上的深度值。例如在图5所示的场景中,draw A在单元(像素)14上的深度值,等效于draw A在单元(像素)14上的最小深度值Dmin。In the case that only one pixel is included in each unit, the minimum depth value Dmin of each draw in each unit is the depth value of each draw on each pixel. For example, in the scene shown in FIG. 5 , the depth value of draw A on unit (pixel) 14 is equivalent to the minimum depth value Dmin of draw A on unit (pixel) 14 .
S903:筛选出每个draw中的第二图元,并记录在PL中。PL可以存储于PL heap。如前所述,每个draw中可能存在图元与图元之间的遮挡。每个draw中的第二图元可以理解为未被同一个draw内的其它图元完全遮挡的图元,通过筛选每个draw中的第二图元,可以减少无效渲染,节省GPU的运算资源。S903: Filter out the second primitive in each draw and record it in the PL. PL can be stored in the PL heap. As mentioned earlier, there may be occlusions between primitives in each draw. The second primitive in each draw can be understood as a primitive that is not completely occluded by other primitives in the same draw. By filtering the second primitive in each draw, invalid rendering can be reduced and GPU computing resources can be saved .
S904:在渲染任一draw时,从PL heap中读取该draw对应的PL,以及该draw的配置信息。S904: When rendering any draw, read the PL corresponding to the draw and the configuration information of the draw from the PL heap.
S905:根据每个单元对应的最大深度值Dmax,以及该draw分别在每个单元中的最小深度值Dmin,确定是否需要渲染该draw在每个单元中的部分。如前所述,不同draw之间的图元也可能出现遮挡。在渲染之前,先筛选出每个draw中需要渲染的单元,有利于减少无效渲染,节省GPU的运算资源。S905: Determine whether the part of the draw in each unit needs to be rendered according to the maximum depth value Dmax corresponding to each unit and the minimum depth value Dmin of the draw in each unit. As mentioned earlier, occlusion may also occur between primitives between different draws. Before rendering, filter out the units that need to be rendered in each draw, which is beneficial to reduce invalid rendering and save GPU computing resources.
S906:渲染该draw在每个单元中需要渲染的部分。S906: Render the part of the draw that needs to be rendered in each unit.
经测试,在曼哈顿(Manhatten)3.0/3.1以及阿兹塔克(Aztec)等基准(benchmark)测试中,通过上述方法,在任一单元内,可以提前将超过10%的draw在该单元的部分直接丢弃,即不渲染这些draw在该单元的部分。在部分场景甚至有超过50%的draw在该单元的部分可以提前丢弃。对于很多的游戏场景也有很好的表现。After testing, in benchmark tests such as Manhattan 3.0/3.1 and Aztec, through the above method, in any unit, more than 10% of the draw can be directly placed in the part of the unit in advance. Discard, i.e. do not render the part of these draws in this unit. In some scenes, more than 50% of the draws in the unit can be discarded in advance. It also performs well for many game scenarios.
上述主要从方法实施例的角度对本申请提供的方案进行了介绍。可以理解的是,为了实现上述功能,GPU12可以包括执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算 机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。The solution provided by the present application has been described above mainly from the perspective of method embodiments. It can be understood that, in order to realize the above-mentioned functions, the GPU 12 may include corresponding hardware structures and/or software modules for performing each function. Those skilled in the art should easily realize that the present invention can be implemented in hardware or a combination of hardware and computer software in conjunction with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a function is implemented by hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
在采用集成的单元的情况下,图10示出了本申请实施例中所涉及的图形处理装置的可能的示例性框图,该图形处理装置1000可以是上述任一实施例中的GPU或其它具备图形处理功能的集成电路。图形处理装置1000可以包括:分区单元1001和渲染单元1002。In the case of using an integrated unit, FIG. 10 shows a possible exemplary block diagram of the graphics processing apparatus involved in the embodiments of the present application, and the graphics processing apparatus 1000 may be the GPU in any of the above-mentioned embodiments or other Integrated circuits for graphics processing functions. The graphics processing apparatus 1000 may include: a partition unit 1001 and a rendering unit 1002 .
具体地,在一个实施例中,分区单元1001可以将显示区域分为阵列排布的多个单元,每个单元包括至少一个像素,显示区域用于显示待生成的目标图像,目标图像包括在显示区域内重叠的多个绘图draw;渲染单元1002可以分别渲染多个draw,多个draw中的任一draw为第一draw,其中:在第一draw在第一单元中的最高可视优先级不低于第一单元对应的最低可视优先级时,渲染第一draw在第一单元的部分,第一单元为多个单元中的任一单元,第一单元对应的最低可视优先级为目标图像在第一单元内的最低可视优先级;在第一draw在第一单元中的最高可视优先级低于第一单元对应的最低可视优先级时,不渲染第一draw在第一单元的部分。Specifically, in one embodiment, the partition unit 1001 can divide the display area into a plurality of units arranged in an array, each unit includes at least one pixel, the display area is used to display the target image to be generated, and the target image is included in the display area. Multiple drawing draws that overlap in the area; the rendering unit 1002 can render multiple draws respectively, and any draw in the multiple draws is the first draw, wherein: the highest visual priority of the first draw in the first unit is not When it is lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is rendered. The first unit is any one of the multiple units, and the lowest visual priority corresponding to the first unit is the target. The lowest visual priority of the image in the first unit; when the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit, do not render the first draw in the first unit part of the unit.
其中,可视优先级为深度值或绘图顺序。Among them, the visual priority is the depth value or the drawing order.
示例性的,第一draw可以包括一个或多个图元,其中:在第一draw中存在至少一个图元的部分或全部位于第一单元时,第一draw在第一单元中的最高可视优先级,可以是上述至少一个图元分别在第一单元中的最高可视优先级的最高值;和/或,在第一draw中的一个或多个图元皆不位于第一单元时,第一draw在第一单元中的最高可视优先级可以是默认值,默认值不高于目标图像中能够出现的最低可视优先级。Exemplarily, the first draw may include one or more primitives, wherein: when a part or all of at least one primitive is located in the first unit in the first draw, the highest visible value of the first draw in the first unit is The priority, which can be the highest value of the highest visual priority of the at least one graphic element in the first unit; and/or, when one or more graphic elements in the first draw are not located in the first unit, The highest visual priority of the first draw in the first unit may be a default value, and the default value is not higher than the lowest visual priority that can appear in the target image.
在本申请实施例中,每个单元可以包括阵列排布的至少一个子单元,每个子单元可以包括阵列排布的至少一个像素。第一单元对应的最低可视优先级可以为第一单元中,至少一个子单元分别对应的最低可视优先级的最低值,其中,第一子单元对应的最低可视优先级可以为目标图像在第一子单元中的最低可视优先级,第一子单元可以为第一单元的至少一个子单元中的任一子单元。In this embodiment of the present application, each unit may include at least one subunit arranged in an array, and each subunit may include at least one pixel arranged in an array. The lowest visible priority corresponding to the first unit may be the lowest value of the lowest visible priority corresponding to at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit may be the target image The lowest visible priority in the first subunit, and the first subunit may be any subunit in at least one subunit of the first unit.
在渲染第一draw时,可以以子单元为粒度进行渲染。为了进一步节省运算资源,在一种可能的实现方式中,分区单元1001还可以确定与第一子单元关联的第一图元,第一图元为第一draw中部分或全部位于第一子单元的图元;在存在至少一个第一图元时,根据至少一个第一图元分别在第一子单元中的最高可视优先级,从至少一个第一图元中筛选出至少一个第二图元,筛选出的至少一个第二图元为最高可视优先级不低于第一子单元对应的最低可视优先级的第一图元;渲染单元1002则可以渲染至少一个第二图元位于第一子单元的部分。When rendering the first draw, it can be rendered at subunit granularity. In order to further save computing resources, in a possible implementation manner, the partitioning unit 1001 may also determine a first graphic element associated with the first subunit, where the first graphic element is partially or entirely located in the first subunit in the first draw When there is at least one first graphic element, filter out at least one second graphic element from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively element, the at least one second element screened out is the first element with the highest visible priority not lower than the lowest visible priority corresponding to the first subunit; the rendering unit 1002 can render at least one second element located in part of the first subunit.
示例性的,渲染单元1002在渲染至少一个第二图元位于第一子单元的部分时,可以针对每个第二图元,确定第一像素的可视优先级,第一像素可以为每个第二图元在第一子单元中的任一像素;在第一像素的可视优先级高于或等于第一子单元对应的最低可视优先级时,渲染第一像素;在第一像素的可视优先级低于第一子单元对应的最低可视优先级时,不渲染第一像素。Exemplarily, when rendering the part of at least one second primitive located in the first subunit, the rendering unit 1002 may determine the visual priority of the first pixel for each second primitive, and the first pixel may be each The second primitive is any pixel in the first subunit; when the visual priority of the first pixel is higher than or equal to the lowest visual priority corresponding to the first subunit, the first pixel is rendered; in the first pixel When the visible priority of the first subunit is lower than the lowest visible priority corresponding to the first subunit, the first pixel is not rendered.
参阅图11所示,为本申请提供的一种图形处理装置示意图,该图形处理装置可以是上述实施例中的GPU或其它具备图形处理功能的集成电路。该图形处理装置1100包括:存储器1101和运算电路1102。示例性的,运算电路1102可以是具有逻辑运算能力的集成电 路,可以执行本申请实施例所提供的上述图形处理方法。在一种可能的实现方式中,运算电路1102可以包括多个算数逻辑单元(arithmetic and logic unit,ALU),图形处理装置1100中的多个ALU可以并行执行逻辑运算,从而提高图形处理装置1100的运算速度。Referring to FIG. 11 , which is a schematic diagram of a graphics processing device provided by the present application, the graphics processing device may be the GPU in the above-mentioned embodiment or other integrated circuits with graphics processing functions. The graphics processing apparatus 1100 includes: a memory 1101 and an arithmetic circuit 1102 . Exemplarily, the operation circuit 1102 may be an integrated circuit with logic operation capability, and may execute the above-mentioned graphics processing method provided by the embodiments of the present application. In a possible implementation manner, the operation circuit 1102 may include multiple arithmetic and logic units (ALUs), and the multiple ALUs in the graphics processing device 1100 may perform logic operations in parallel, thereby improving the performance of the graphics processing device 1100. calculating speed.
存储器1101可以缓存运算电路1102运行时产生的数据。例如,运算电路1102可以在确定每个单元对应的最低可视优先级后,将每个单元对应的最低可视优先级写入存储器1101。在渲染阶段,运算电路1102再从存储器1101中读取每个单元对应的最低可视优先级,从而可以对每个draw进行渲染。The memory 1101 can buffer data generated when the arithmetic circuit 1102 operates. For example, the operation circuit 1102 may write the lowest visible priority corresponding to each unit into the memory 1101 after determining the lowest visible priority corresponding to each unit. In the rendering stage, the arithmetic circuit 1102 reads the lowest visual priority corresponding to each unit from the memory 1101, so that each draw can be rendered.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的保护范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the protection scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (16)

  1. 一种图形处理方法,其特征在于,包括:A graphics processing method, comprising:
    将显示区域分为阵列排布的多个单元,每个单元包括至少一个像素,所述显示区域用于显示待生成的目标图像,所述目标图像包括在所述显示区域内重叠的多个绘图draw;The display area is divided into a plurality of units arranged in an array, each unit includes at least one pixel, the display area is used to display the target image to be generated, and the target image includes a plurality of drawings overlapping in the display area draw;
    分别渲染所述多个draw,所述多个draw中的任一draw为第一draw,其中:The multiple draws are rendered respectively, and any one of the multiple draws is the first draw, where:
    在所述第一draw在第一单元中的最高可视优先级不低于所述第一单元对应的最低可视优先级时,渲染所述第一draw在所述第一单元的部分,所述第一单元为所述多个单元中的任一单元,所述第一单元对应的最低可视优先级为所述目标图像在所述第一单元内的最低可视优先级;When the highest visual priority of the first draw in the first unit is not lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is rendered, so The first unit is any one of the multiple units, and the lowest visible priority corresponding to the first unit is the lowest visible priority of the target image in the first unit;
    在所述第一draw在所述第一单元中的最高可视优先级低于所述第一单元对应的最低可视优先级时,不渲染所述第一draw在所述第一单元的部分。When the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is not rendered .
  2. 根据权利要求1所述的方法,其特征在于,所述第一draw包括一个或多个图元,其中:The method of claim 1, wherein the first draw includes one or more primitives, wherein:
    在所述第一draw中存在至少一个图元的部分或全部位于所述第一单元时,所述第一draw在所述第一单元中的最高可视优先级,为所述至少一个图元分别在所述第一单元中的最高可视优先级的最高值。When part or all of at least one primitive in the first draw is located in the first unit, the highest visual priority of the first draw in the first unit is the at least one primitive respectively the highest value of the highest visible priority in the first unit.
  3. 根据权利要求1或2所述的方法,其特征在于,每个单元包括阵列排布的至少一个子单元,每个子单元包括阵列排布的至少一个像素;The method according to claim 1 or 2, wherein each unit includes at least one subunit arranged in an array, and each subunit includes at least one pixel arranged in an array;
    所述第一单元对应的最低可视优先级为所述第一单元中,所述至少一个子单元分别对应的最低可视优先级的最低值,其中,第一子单元对应的最低可视优先级为所述目标图像在所述第一子单元中的最低可视优先级,所述第一子单元为所述第一单元的至少一个子单元中的任一子单元。The lowest visible priority corresponding to the first unit is the lowest value of the lowest visible priority corresponding to the at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit level is the lowest visible priority of the target image in the first subunit, and the first subunit is any subunit in at least one subunit of the first unit.
  4. 根据权利要求3所述的方法,其特征在于,所述第一draw包括一个或多个图元,渲染所述第一draw在所述第一单元的部分之前,还包括:The method of claim 3, wherein the first draw includes one or more primitives, and before rendering the part of the first draw in the first unit, further comprising:
    确定与所述第一子单元关联的第一图元,所述第一图元为所述第一draw中部分或全部位于所述第一子单元的图元;determining a first primitive associated with the first subunit, where the first primitive is a primitive part or all of the primitives located in the first subunit in the first draw;
    在存在至少一个第一图元时,根据所述至少一个第一图元分别在所述第一子单元中的最高可视优先级,从所述至少一个第一图元中筛选出至少一个第二图元,所述至少一个第二图元为最高可视优先级不低于所述第一子单元对应的最低可视优先级的第一图元;When there is at least one first graphic element, filter out at least one first graphic element from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively Two graphic elements, the at least one second graphic element is the first graphic element with the highest visual priority not lower than the lowest visual priority corresponding to the first subunit;
    渲染所述第一draw在所述第一单元的部分,包括:Rendering the part of the first draw in the first unit, including:
    渲染所述至少一个第二图元位于所述第一子单元的部分。Rendering the portion of the at least one second primitive located in the first subunit.
  5. 根据权利要求4所述的方法,其特征在于,渲染所述至少一个第二图元位于所述第一子单元的部分,包括:The method of claim 4, wherein rendering the portion of the at least one second primitive located in the first subunit comprises:
    针对每个第二图元,确定第一像素的可视优先级,所述第一像素为所述每个第二图元在所述第一子单元中的任一像素;For each second graphic element, determine a visual priority of a first pixel, where the first pixel is any pixel of each second graphic element in the first subunit;
    在所述第一像素的可视优先级高于或等于所述第一子单元对应的最低可视优先级时,渲染所述第一像素;rendering the first pixel when the visual priority of the first pixel is higher than or equal to the lowest visual priority corresponding to the first subunit;
    在所述第一像素的可视优先级低于所述第一子单元对应的最低可视优先级时,不渲染所述第一像素。When the visual priority of the first pixel is lower than the lowest visual priority corresponding to the first subunit, the first pixel is not rendered.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述可视优先级为深度值或绘图顺序。The method according to any one of claims 1 to 5, wherein the visual priority is a depth value or a drawing order.
  7. 一种图形处理装置,其特征在于,包括分区单元和渲染单元,其中:A graphics processing device, comprising a partition unit and a rendering unit, wherein:
    所述分区单元,用于:将显示区域分为阵列排布的多个单元,每个单元包括至少一个像素,所述显示区域用于显示待生成的目标图像,所述目标图像包括在所述显示区域内重叠的多个绘图draw;The partition unit is used for: dividing the display area into a plurality of units arranged in an array, each unit including at least one pixel, the display area is used to display the target image to be generated, and the target image is included in the Multiple drawing draws that overlap in the display area;
    所述渲染单元,用于:分别渲染所述多个draw,所述多个draw中的任一draw为第一draw,其中:The rendering unit is configured to: render the multiple draws respectively, and any draw in the multiple draws is the first draw, wherein:
    在所述第一draw在第一单元中的最高可视优先级不低于所述第一单元对应的最低可视优先级时,渲染所述第一draw在所述第一单元的部分,所述第一单元为所述多个单元中的任一单元,所述第一单元对应的最低可视优先级为所述目标图像在所述第一单元内的最低可视优先级;When the highest visual priority of the first draw in the first unit is not lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is rendered, so The first unit is any one of the multiple units, and the lowest visible priority corresponding to the first unit is the lowest visible priority of the target image in the first unit;
    在所述第一draw在所述第一单元中的最高可视优先级低于所述第一单元对应的最低可视优先级时,不渲染所述第一draw在所述第一单元的部分。When the highest visual priority of the first draw in the first unit is lower than the lowest visual priority corresponding to the first unit, the part of the first draw in the first unit is not rendered .
  8. 根据权利要求7所述的图形处理装置,其特征在于,所述第一draw包括一个或多个图元,其中:The graphics processing apparatus according to claim 7, wherein the first draw includes one or more primitives, wherein:
    在所述第一draw中存在至少一个图元的部分或全部位于所述第一单元时,所述第一draw在所述第一单元中的最高可视优先级,为所述至少一个图元分别在所述第一单元中的最高可视优先级的最高值;和/或,When part or all of at least one primitive in the first draw is located in the first unit, the highest visual priority of the first draw in the first unit is the at least one primitive the highest value of the highest visible priority in the first unit respectively; and/or,
    在所述第一draw中的一个或多个图元皆不位于所述第一单元时,所述第一draw在所述第一单元中的最高可视优先级为默认值,所述默认值不高于所述目标图像中能够出现的最低可视优先级。When one or more primitives in the first draw are not located in the first unit, the highest visual priority of the first draw in the first unit is the default value, the default value No higher than the lowest visible priority that can appear in the target image.
  9. 根据权利要求7或8所述的图形处理装置,其特征在于,每个单元包括阵列排布的至少一个子单元,每个子单元包括阵列排布的至少一个像素;The graphics processing device according to claim 7 or 8, wherein each unit includes at least one subunit arranged in an array, and each subunit includes at least one pixel arranged in an array;
    所述第一单元对应的最低可视优先级为所述第一单元中,所述至少一个子单元分别对应的最低可视优先级的最低值,其中,第一子单元对应的最低可视优先级为所述目标图像在所述第一子单元中的最低可视优先级,所述第一子单元为所述第一单元的至少一个子单元中的任一子单元。The lowest visible priority corresponding to the first unit is the lowest value of the lowest visible priority corresponding to the at least one subunit in the first unit, wherein the lowest visible priority corresponding to the first subunit level is the lowest visible priority of the target image in the first subunit, and the first subunit is any subunit in at least one subunit of the first unit.
  10. 根据权利要求9所述的图形处理装置,其特征在于,所述分区单元还用于:The graphics processing device according to claim 9, wherein the partition unit is further configured to:
    确定与所述第一子单元关联的第一图元,所述第一图元为所述第一draw中部分或全部位于所述第一子单元的图元;determining a first primitive associated with the first subunit, where the first primitive is a primitive part or all of the primitives located in the first subunit in the first draw;
    在存在至少一个第一图元时,根据所述至少一个第一图元分别在所述第一子单元中的最高可视优先级,从所述至少一个第一图元中筛选出至少一个第二图元,所述至少一个第二图元为最高可视优先级不低于所述第一子单元对应的最低可视优先级的第一图元;When there is at least one first graphic element, filter out at least one first graphic element from the at least one first graphic element according to the highest visual priority of the at least one first graphic element in the first subunit respectively Two graphic elements, the at least one second graphic element is the first graphic element with the highest visual priority not lower than the lowest visual priority corresponding to the first subunit;
    所述渲染单元具体用于:The rendering unit is specifically used for:
    渲染所述至少一个第二图元位于所述第一子单元的部分。Rendering the portion of the at least one second primitive located in the first subunit.
  11. 根据权利要求10所述的图形处理装置,其特征在于,所述渲染单元具体用于:The graphics processing apparatus according to claim 10, wherein the rendering unit is specifically configured to:
    针对每个第二图元,确定第一像素的可视优先级,所述第一像素为所述每个第二图元在所述第一子单元中的任一像素;For each second graphic element, determine a visual priority of a first pixel, where the first pixel is any pixel of each second graphic element in the first subunit;
    在所述第一像素的可视优先级高于或等于所述第一子单元对应的最低可视优先级时, 渲染所述第一像素;When the visual priority of the first pixel is higher than or equal to the lowest visual priority corresponding to the first subunit, rendering the first pixel;
    在所述第一像素的可视优先级低于所述第一子单元对应的最低可视优先级时,不渲染所述第一像素。When the visual priority of the first pixel is lower than the lowest visual priority corresponding to the first subunit, the first pixel is not rendered.
  12. 根据权利要求7至11中任一项所述的图形处理装置,其特征在于,所述可视优先级为深度值或绘图顺序。The graphics processing apparatus according to any one of claims 7 to 11, wherein the visual priority is a depth value or a drawing order.
  13. 一种图形处理装置,其特征在于,包括存储器和运算电路;A graphics processing device, comprising a memory and an arithmetic circuit;
    所述存储器,用于缓存所述运算电路的运行数据;the memory, used for buffering the operation data of the operation circuit;
    所述运算电路,用于执行如权利要求1至6中任一项所述的方法。The arithmetic circuit is used to perform the method according to any one of claims 1 to 6 .
  14. 一种电子设备,其特征在于,包括处理器和如权利要求13所述的图形处理装置,所述处理器用于指示所述图形处理装置生成所述目标图像。An electronic device, characterized by comprising a processor and a graphics processing apparatus according to claim 13, wherein the processor is used to instruct the graphics processing apparatus to generate the target image.
  15. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得计算机执行如权利要求1至6中任一项所述的方法。A computer-readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 6.
  16. 一种计算机程序产品,其特征在于,当其在计算机上运行时,使得计算机执行权利要求1至6中任一项所述的方法。A computer program product which, when run on a computer, causes the computer to perform the method of any one of claims 1 to 6.
PCT/CN2020/139783 2020-12-27 2020-12-27 Graphics processing method and apparatus and electronic device WO2022134125A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080108178.1A CN116670719A (en) 2020-12-27 2020-12-27 Graphic processing method and device and electronic equipment
PCT/CN2020/139783 WO2022134125A1 (en) 2020-12-27 2020-12-27 Graphics processing method and apparatus and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/139783 WO2022134125A1 (en) 2020-12-27 2020-12-27 Graphics processing method and apparatus and electronic device

Publications (1)

Publication Number Publication Date
WO2022134125A1 true WO2022134125A1 (en) 2022-06-30

Family

ID=82157260

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139783 WO2022134125A1 (en) 2020-12-27 2020-12-27 Graphics processing method and apparatus and electronic device

Country Status (2)

Country Link
CN (1) CN116670719A (en)
WO (1) WO2022134125A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116894906A (en) * 2023-09-11 2023-10-17 瀚博半导体(上海)有限公司 Graphics rendering method and processor hardware architecture

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060033735A1 (en) * 2004-08-10 2006-02-16 Ati Technologies Inc. Method and apparatus for generating hierarchical depth culling characteristics
CN1739117A (en) * 2002-12-20 2006-02-22 Lm爱立信电话有限公司 Graphics processing apparatus, methods and computer program products using minimum-depth occlusion culling and zig-zag traversal
US20100194747A1 (en) * 2009-02-02 2010-08-05 Microsoft Corporation Dynamic Fragment Coverage Antialiasing
CN104050705A (en) * 2013-03-13 2014-09-17 辉达公司 Handling post-z coverage data in raster operations
CN106204408A (en) * 2014-12-23 2016-12-07 联发科技股份有限公司 Drawing processes circuit and preposition depth information process method thereof
CN108280867A (en) * 2017-01-04 2018-07-13 三星电子株式会社 Graphic processing method and system
EP3598391A1 (en) * 2018-07-16 2020-01-22 Huawei Technologies Co., Ltd. Variable resolution rendering
CN112044062A (en) * 2020-08-27 2020-12-08 腾讯科技(深圳)有限公司 Game picture rendering method, device, terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1739117A (en) * 2002-12-20 2006-02-22 Lm爱立信电话有限公司 Graphics processing apparatus, methods and computer program products using minimum-depth occlusion culling and zig-zag traversal
US20060033735A1 (en) * 2004-08-10 2006-02-16 Ati Technologies Inc. Method and apparatus for generating hierarchical depth culling characteristics
US20100194747A1 (en) * 2009-02-02 2010-08-05 Microsoft Corporation Dynamic Fragment Coverage Antialiasing
CN104050705A (en) * 2013-03-13 2014-09-17 辉达公司 Handling post-z coverage data in raster operations
CN106204408A (en) * 2014-12-23 2016-12-07 联发科技股份有限公司 Drawing processes circuit and preposition depth information process method thereof
CN108280867A (en) * 2017-01-04 2018-07-13 三星电子株式会社 Graphic processing method and system
EP3598391A1 (en) * 2018-07-16 2020-01-22 Huawei Technologies Co., Ltd. Variable resolution rendering
CN112044062A (en) * 2020-08-27 2020-12-08 腾讯科技(深圳)有限公司 Game picture rendering method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN116670719A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US11682158B2 (en) Foveated rendering
US11657560B2 (en) VRS rate feedback
US9569811B2 (en) Rendering graphics to overlapping bins
US20170061680A1 (en) System, Method and Computer Program Product for Implementing Anti-Aliasing Operations Using a Programmable Sample Pattern Table
US9269180B2 (en) Computer graphics processor and method for rendering a three-dimensional image on a display screen
GB2537973A (en) Systems and methods for soft shadowing in 3-D rendering
JP2008077627A (en) Method and system for early z test in three-dimensional image rendering
WO2012158868A2 (en) Rendering tessellated geometry with motion and defocus blur
US20140176545A1 (en) System, method, and computer program product implementing an algorithm for performing thin voxelization of a three-dimensional model
CN107392836B (en) Stereoscopic multi-projection using a graphics processing pipeline
US20140063012A1 (en) Computation reduced tessellation
US20210209831A1 (en) Hybrid render with preferred primitive batch binning and sorting
TW201439975A (en) Handling post-z coverage data in raster operations
CN115147579B (en) Block rendering mode graphic processing method and system for expanding block boundary
GB2531427A (en) Graphics processing systems
US20160307365A1 (en) Optimizing shading process for mixed order-sensitive and order-insensitive shader operations
WO2022134125A1 (en) Graphics processing method and apparatus and electronic device
US11030791B2 (en) Centroid selection for variable rate shading
CN109643460B (en) Hybrid renderer with deferred primitive batch merge and classification
US20220036634A1 (en) Methods and apparatus for pixel packing
US11972518B2 (en) Hybrid binning
US11741653B2 (en) Overlapping visibility and render passes for same frame
US20220319091A1 (en) Post-depth visibility collection with two level binning
US20240020806A1 (en) System and method for dynamic binning
US20240112392A1 (en) Dynamic node traversal order for ray tracing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20966687

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202080108178.1

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20966687

Country of ref document: EP

Kind code of ref document: A1