A rendering marking method and device in GPU graphics rendering, and electronic equipment

By using the coarse-grained judgment method of pixel granularity and bit granularity in GPU graphics rendering, the problem of large amount of calculation in the rendering marking process is solved, and the effect of improving GPU performance is achieved.

CN117830485BActive Publication Date: 2025-02-14MOORE THREADS TECHNOLOGY (CHENGDU) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311872776.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-02-14
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

In the GPU graphics rendering process, the rendering marking process has a large amount of calculation, which affects GPU performance.

Method used

The coarse-grained judgment method based on pixel particle size and bit particle size is used to determine whether the sampling point is located in the rectangular crop area and whether it is a preset area to be rendered, and then the rendering mark is determined.

Benefits of technology

It effectively reduces the calculation amount of the rendering marking process and improves the performance of GPU graphics rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117830485B_ABST
    Figure CN117830485B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a rendering marking method and device, and an electronic device in GPU graphics rendering. The method comprises: for any one block in a display area, judging based on pixel granularity whether each sampling point in the block is located in a rectangular clipping area, the rectangular clipping area is used to indicate the minimum circumscribed rectangle of a to-be-rendered graphic element, and the to-be-rendered graphic element is used to indicate the position mapping of a to-be-rendered scene in the display area; judging based on bit granularity whether each sampling point in the block is a preset area where graphics rendering is required; judging based on pixel granularity whether each sampling point in the block is located in the to-be-rendered graphic element; for any one sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area where graphics rendering is required, and the sampling point is located in the to-be-rendered graphic element, determining a rendering mark for the sampling point, and the rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a rendering marking method and device, and an electronic device in GPU graphics rendering. Background Art

[0002] In the design of a full-featured graphics processing unit (GPU), GPU graphics rendering is divided into the geometry shading stage (geometry) and the pixel shading stage (fragment). The geometry stage determines the primitive information of the scene to be rendered, and the fragment stage calculates the shading point (lighting) position of the primitive area and performs a rendering mark mask for the rendering position. Therefore, in order to improve the graphics rendering performance of the GPU, a fast and efficient rendering mark method in GPU graphics rendering is urgently needed. Summary of the invention

[0003] The present invention discloses a rendering marking method and device in GPU graphics rendering, and a technical solution for electronic equipment.

[0004] According to one aspect of the present disclosure, a rendering marking method in GPU graphics rendering is provided, comprising: for any one tile in a display area, based on pixel granularity, determining whether each sampling point in the tile is located in a rectangular clipping area, wherein one tile is the minimum rendering area of ​​the GPU, one tile includes multiple pixels, one pixel includes multiple sampling points, the rectangular clipping area is used to indicate the minimum circumscribed rectangle of a to-be-rendered primitive, and the to-be-rendered primitive is used to indicate a position mapping of a to-be-rendered scene in the display area; based on bit granularity, determining whether each sampling point in the tile is a preset area where graphics rendering is required; based on pixel granularity, determining whether each sampling point in the tile is located in the to-be-rendered primitive; for any one sampling point in the display area, if it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area where graphics rendering is required, and the sampling point is located in the to-be-rendered primitive, determining a rendering mark for the sampling point, wherein the rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.

[0005] In a possible implementation, judging whether each sampling point in the image block is located within the rectangular cropping area based on pixel granularity includes: iterating through each pixel point in the image block based on pixel granularity, performing a judgment process once for each pixel point, and determining whether each sampling point in the pixel point is located within the rectangular cropping area, wherein the number of iterations is equal to the number of pixels included in the image block.

[0006] In a possible implementation, each pixel point performs a judgment process to determine whether each sampling point within the pixel point is located within the rectangular cropping area, including: determining, for any pixel point in the image block, pixel point coordinates corresponding to the pixel point; determining, according to the pixel point coordinates, a first bit sequence corresponding to the pixel point; and, for any sampling point within the pixel point, determining that the sampling point is located within the rectangular cropping area when the first bit sequence indicates that the bit corresponding to the sampling point is 1.

[0007] In a possible implementation, judging whether each sampling point in the image block is a preset area requiring graphics rendering based on the bit granularity includes: reading, for any pixel point in the image block, a second bit sequence corresponding to the pixel point from a storage device; and determining, for any sampling point in the pixel point, that the sampling point is a preset area requiring graphics rendering when the second bit sequence indicates that the bit corresponding to the sampling point is 1.

[0008] In a possible implementation, the method further includes: for any pixel point in the image block, receiving the second bit sequence corresponding to the pixel point set by a user; and storing the second bit sequence corresponding to the pixel point in the storage device.

[0009] In a possible implementation, the determining, based on pixel granularity, whether each sampling point in the image block is located within the image primitive to be rendered comprises: iterating through each pixel in the image block based on pixel granularity, performing a determination process once for each pixel to determine whether each sampling point within the pixel is located within the image primitive to be rendered, wherein the number of iterations is equal to the number of pixels included in the image block.

[0010] In a possible implementation, each pixel point performs a judgment process to determine whether each sampling point within the pixel point is located within the primitive to be rendered, including: for any pixel point in the block, determining the pixel point coordinates corresponding to the pixel point; determining whether the pixel point coordinates are located within the edge equation corresponding to the primitive to be rendered; and when the pixel point coordinates are located within the edge equation corresponding to the primitive to be rendered, determining that each sampling point within the pixel point is located within the primitive to be rendered.

[0011] According to one aspect of the present disclosure, a rendering marking device in GPU graphics rendering is provided, comprising: a first judgment module, for judging, based on pixel granularity, whether each sampling point in any one block in a display area is located in a rectangular clipping area, wherein one block is the minimum rendering area of ​​the GPU, one block includes a plurality of pixels, one pixel includes a plurality of sampling points, the rectangular clipping area is used to indicate the minimum circumscribed rectangle of a to-be-rendered primitive, and the to-be-rendered primitive is used to indicate the position mapping of a to-be-rendered scene in the display area; a second judgment module, for judging, based on bit granularity, Determine whether each sampling point in the image block is a preset area that needs to be rendered; a third judgment module is used to determine whether each sampling point in the image block is located in the to-be-rendered graphic element based on pixel granularity; a rendering mark determination module is used to determine a rendering mark for any sampling point in the display area when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area that needs to be rendered, and the sampling point is located in the to-be-rendered graphic element, wherein the rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.

[0012] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0013] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.

[0014] In the embodiment of the present disclosure, for any tile in the display area, it is determined based on the pixel granularity whether each sampling point in the tile is located in the rectangular clipping area corresponding to the to-be-rendered primitive, so that the number of calculation iterations can be reduced compared with the judgment method of the sampling point granularity; it is determined based on the bit granularity whether each sampling point in the tile is a preset area where graphics rendering is required, so that the calculation process can be reduced compared with the judgment method of the sampling point granularity; it is determined based on the pixel granularity whether each sampling point in the tile is located in the to-be-rendered primitive, so that the number of calculation iterations can be reduced compared with the judgment method of the sampling point granularity; further, for any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area where graphics rendering is required, and the sampling point is located in the to-be-rendered primitive, a rendering mark for indicating that the sampling point needs to be rendered is determined for the sampling point; the three-step judgment process adopts the coarse-grained judgment methods of pixel granularity and bit granularity respectively, which can effectively reduce the amount of calculation in the rendering mark process compared with the fine-grained judgment method of the sampling point, thereby improving the GPU performance in the GPU graphics rendering process.

[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0017] Figure 1 A schematic diagram showing a primitive to be rendered and a rectangular clipping area according to an embodiment of the present disclosure.

[0018] Figure 2 A flowchart of a rendering marking method in GPU graphics rendering according to an embodiment of the present disclosure is shown.

[0019] Figure 3 A block diagram of a rendering marking device in GPU graphics rendering according to an embodiment of the present disclosure is shown.

[0020] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0021] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0022] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0023] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0024] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0025] The fragment stage of GPU graphics rendering requires the rendering position of the display area to be marked. For example, for a display screen with a resolution of 1920x1080, a 1-bit mark is set for each pixel in the display area. A mark of 0 represents a non-rendering mark, and a mark of 1 represents a rendering mark. In actual applications, GPU graphics rendering uses the Tile Base Deferred Render (TBRD) architecture, which means that the display area is divided into multiple tiles, and then the tiles are divided into microtiles, and then each pixel in the microtile is rendered with microtile as the minimum processing granularity.

[0026] In addition, in the GPU graphics rendering process, the Multi Sample Anti-Aliasing (MSAA) mode is usually used for rendering. In one example, the MSAA mode is 1×, that is, each pixel includes 1 sampling point, and the microtile size is 4×4. At this time, a microtile includes 16 sampling points, and a 1-bit mark bit is set for each sampling point for rendering marking, that is, 16 bits of mark bits are required to mark a microtile for rendering. In actual application scenarios, the MSAA mode also has 2× (each pixel includes 2 sampling points), 4× (each pixel includes 4 sampling points), 8× (each pixel includes 8 sampling points), and 16× (each pixel includes 16 sampling points). The corresponding tile size, microtile size, etc. are also different. Therefore, the number of mark bits required to mark a microtile for rendering is also different. Table 1 shows various situations of tile size, microtile size, sampling point, and mark bit under different MSAA modes.

[0027] MSAA Mode Tile size microtile size Sampling point Mark bit MSAA 1× 32×32 4×4 1×1 16 MSAA 2× 32×32 4×4 2×1 32 MSAA 4× 32×16 4×2 2×2 32 MSAA 8× 16×16 2×2 2×4 32 MSAA 16× 16×16 2×1 4×4 32

[0028] Table 1

[0029] In addition to using the examples in Table 1 above, different MSAA modes and their corresponding tile sizes, microtile sizes, sampling points, and marker bits can also be flexibly set according to actual conditions, and the present disclosure does not make specific limitations on this.

[0030] The geometry stage of GPU graphics rendering determines the primitives to be rendered and the rectangular clipping area (scissor) corresponding to the primitives to be rendered based on the position mapping of the scene to be rendered in the display area. Figure 1 A schematic diagram showing a primitive to be rendered and a rectangular clipping area according to an embodiment of the present disclosure is shown. Figure 1 As shown, the triangular area is the primitive to be rendered, and the gray shadow area is the rectangular clipping area corresponding to the primitive to be rendered.

[0031] After determining the primitive to be rendered and its corresponding rectangular clipping area, microtile is used as the smallest processing unit, and each sampling point in a microtile is marked for rendering. This process requires three steps of judgment.

[0032] Step 1: Determine whether the sampling point is within the rectangular clipping area.

[0033] In the related art, each sampling point is judged based on the sampling point granularity. For example, when the MSAA mode is 4x, each pixel point includes 4 sampling points. According to the sampling point granularity, each sampling point in the same pixel point needs to be traversed and iterated 4 times.

[0034] First, take microtile as the smallest processing unit and obtain the sampling point mark corresponding to a microtile, which can be called pixels_mask here. For example, when MSAA4× and microtile 4×2, pixels_mask is a 32-bit mark sequence, including the sampling point mark corresponding to each sampling point. When the sampling point mark is 0, it indicates that it is located in the rectangular clipping area, and when the sampling point mark is 1, it indicates that it is not located in the rectangular clipping area. For a pixel point in the microtile, first calculate a pixel index pixel_index based on the pixel coordinates of the pixel point, and then shift pixels_mask right by pixel_index*samples to see if the sampling point mark is equal to 1, so as to determine whether it is within the rectangular clipping area. The calculation process is: bool valid=((pixels_mask>>(pixel_index*samples)))&(1< <samples-1)。

[0035] Step 2: Determine whether the sampling point is the preset area where graphics rendering is required.

[0036] In the related technology, each sampling point is judged based on the sampling point granularity. When processing each tile, the preset sampling point mark, referred to as user_mask here, is read from the storage device. The storage device here can be GPU memory, and the sampling point mark can be pre-specified by the user. At the microtile granularity, taking MSAA 4× as an example, the sampling point index sample_index is first calculated according to the sampling point coordinates sample(x,y), and then sample_index is used to match the user_mask read from the storage device to confirm whether the sampling point is the preset area that needs to be rendered. The calculation process is: bool valid=user_mask>>sample_index.

[0037] Step 3: Determine whether the sampling point is within the primitive to be rendered.

[0038] In related technologies, each sampling point is judged based on the sampling point granularity. According to the microtile granularity processing, taking MSAA 4x as an example, the four sampling points included in a pixel point correspond to the same pixel coordinate pixel(x,y), and then for each sampling point, pixel(x,y) is used to judge whether it is within the edge equation to confirm whether the sampling point is within the primitive to be rendered. The calculation process is: bool valid=(A*pixel_x+B*pixle_y+C)>0.

[0039] For any sampling point, only when the above three judgment steps are passed, that is, it is determined that the sampling point is located in the rectangular clipping area, the sampling point is the preset area that needs to be rendered, and the sampling point is located in the primitive to be rendered, can it be determined that the sampling point needs to be rendered.

[0040] Based on the above, it can be known that in the related art, the above three-step judgment is performed on each sampling point based on the sampling point granularity, and the number of loop iterations required for a microtile is equal to the number of sampling points included in the microtile. Taking MSAA 4× and microtile 4×2 as an example, the number of loop iterations corresponding to the microtile is 32 times. However, there are performance issues in the judgment based on the sampling point granularity, which will affect the GPU performance during the GPU graphics rendering process.

[0041] In order to solve the above technical problems, the present disclosure provides a rendering marking method in GPU graphics rendering, which can effectively reduce the computational complexity of the rendering marking process, thereby improving the GPU performance in the GPU graphics rendering process. The rendering marking method in GPU graphics rendering in the present disclosure embodiment is described in detail below.

[0042] Figure 2 A flowchart of a rendering marking method in GPU graphics rendering according to an embodiment of the present disclosure is shown. The method can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the method can be executed by a server. Figure 2 As shown, the method includes:

[0043] In step S21 , for any image block in the display area, based on the pixel granularity, it is determined whether each sampling point in the image block is located within the rectangular cropping area.

[0044] Among them, a tile is the minimum rendering area of ​​the GPU, a tile includes multiple pixels, a pixel includes multiple sampling points, the rectangular cropping area is used to indicate the minimum circumscribed rectangle of the to-be-rendered primitive, and the to-be-rendered primitive is used to indicate the position mapping of the to-be-rendered scene in the display area.

[0045] In step S22, based on the bit granularity, it is determined whether each sampling point in the image block is a preset area that needs to be rendered.

[0046] In step S23, based on the pixel granularity, it is determined whether each sampling point in the block is located within the primitive to be rendered.

[0047] In step S24, for any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area that needs to be rendered, and the sampling point is located in the primitive to be rendered, a rendering mark is determined for the sampling point.

[0048] The rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.

[0049] In the embodiment of the present disclosure, for any tile in the display area, it is determined based on the pixel granularity whether each sampling point in the tile is located in the rectangular clipping area corresponding to the to-be-rendered primitive, so that the number of calculation iterations can be reduced compared with the judgment method of the sampling point granularity; it is determined based on the bit granularity whether each sampling point in the tile is a preset area where graphics rendering is required, so that the calculation process can be reduced compared with the judgment method of the sampling point granularity; it is determined based on the pixel granularity whether each sampling point in the tile is located in the to-be-rendered primitive, so that the number of calculation iterations can be reduced compared with the judgment method of the sampling point granularity; further, for any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area where graphics rendering is required, and the sampling point is located in the to-be-rendered primitive, a rendering mark for indicating that the sampling point needs to be rendered is determined for the sampling point; the three-step judgment process adopts the coarse-grained judgment methods of pixel granularity and bit granularity respectively, which can effectively reduce the amount of calculation in the rendering mark process compared with the fine-grained judgment method of the sampling point, thereby improving the GPU performance in the GPU graphics rendering process.

[0050] Among them, the block mentioned in the embodiment of the present disclosure is the smallest rendering area of ​​the GPU, which can be a tile or a microtile according to actual conditions, and the present disclosure does not make any specific limitations on this.

[0051] The order of the three judgment steps from step S21 to step S23 can be parallel or serial, and the judgment order can be flexibly set according to actual conditions, which is not limited in the present disclosure.

[0052] In a possible implementation, based on the pixel granularity, determining whether each sampling point in the tile is located within the rectangular cropping region includes: based on the pixel granularity, iterating through each pixel in the tile, performing a determination process once for each pixel, and determining whether each sampling point within the pixel is located within the rectangular cropping region, wherein the number of iterations is equal to the number of pixels included in the tile.

[0053] Regarding the judgment in step S21, compared with the judgment method based on fine-grained sampling points in the related art, the embodiment of the present disclosure adopts a judgment method based on coarse-grained pixels, that is, only one judgment process needs to be performed on one pixel point, thereby reducing the number of iterations and effectively reducing the amount of calculation in the rendering and marking process.

[0054] Taking MSAA 4× and microtile 4×2 as examples, the number of loop iterations corresponding to the microtile based on the fine-grained judgment method of sampling points in the related art is 32 times, while the number of loop iterations corresponding to the microtile based on the fine-grained judgment method of pixel points in the embodiment of the present disclosure is 8 times.

[0055] In a possible implementation, a judgment process is performed on each pixel to determine whether each sampling point within the pixel is located within the rectangular cropping area, including: for any pixel in the image block, determining the pixel coordinates corresponding to the pixel; determining a first bit sequence corresponding to the pixel according to the pixel coordinates; for any sampling point within the pixel, when the first bit sequence indicates that the bit corresponding to the sampling point is 1, determining that the sampling point is located within the rectangular cropping area.

[0056] Take the tile as the minimum processing unit and obtain the sampling point mark corresponding to a tile. According to the pixel coordinates corresponding to each pixel in the tile, determine the first bit sequence corresponding to the pixel from the sampling point mark corresponding to the tile. Taking MSAA 4× and tile 4×2 as an example, obtain the 32-bit sequence corresponding to the tile, and according to the pixel coordinates corresponding to each pixel in the tile, determine the first bit sequence corresponding to the pixel from the 32-bit sequence: 4-bit sequence.

[0057] Taking the first bit sequence corresponding to a pixel point as 0011 as an example, according to the first bit sequence 0011, it can be known that the sampling point corresponding to the bit position 1 is located in the rectangular cropping area, and the sampling point corresponding to the bit position 0 is not located in the rectangular cropping area.

[0058] In a possible implementation, based on the bit granularity, determining whether each sampling point in the image block is a preset area that needs to be rendered graphics includes: for any pixel point in the image block, reading a second bit sequence corresponding to the pixel point from a storage device; for any sampling point in the pixel point, when the second bit sequence indicates that the bit corresponding to the sampling point is 1, determining that the sampling point is a preset area that needs to be rendered graphics.

[0059] Regarding the judgment in step S22, compared with the judgment method based on fine-grained sampling points in the related art, the embodiment of the present disclosure adopts a judgment method based on coarse-grained bits, that is, directly reading the second bit sequence corresponding to the pre-set pixel points from the storage device, without iteratively calculating the sampling point index and matching, effectively reducing the calculation amount of the rendering marking process.

[0060] The storage device here can be a GPU memory or other storage device, which is not specifically limited in the present disclosure. A second bit sequence corresponding to each pixel point is pre-set in the storage device to indicate whether each sampling point in the pixel point is a preset area that needs to be rendered.

[0061] In a possible implementation, the method further includes: for any pixel point in the image block, receiving a second bit sequence corresponding to the pixel point set by a user; and storing the second bit sequence corresponding to the pixel point in a storage device.

[0062] For any pixel in the block, the second bit sequence corresponding to the pixel can be preset by the user according to actual needs, and stored in the storage device before determining the rendering mark, so that it can be directly read from the storage device when the rendering mark is determined later.

[0063] For example, in the case of MSAA 1×, the second bit sequence corresponding to each pixel is a 1-bit sequence (for example, 0, 1); in the case of MSAA 2×, the second bit sequence corresponding to each pixel is a 2-bit sequence (for example, 00, 01, 10, 11); in the case of MSAA 4×, the second bit sequence corresponding to each pixel is a 4-bit sequence (for example, 0000, 0001, 0010, etc.); in the case of MSAA 8×, the second bit sequence corresponding to each pixel is an 8-bit sequence (for example, 00000000, 00000001, etc.); in the case of MSAA 16×, the second bit sequence corresponding to each pixel is a 1-bit sequence (for example, 0000000000000000, 000000000000001, etc.).

[0064] Taking the second bit sequence corresponding to a pixel point as 0101 as an example, according to the second bit sequence 0101, it can be known that the sampling point corresponding to the bit position 1 is the preset area that needs to be rendered, and the sampling point corresponding to the bit position 0 is not the preset area that needs to be rendered.

[0065] In one possible implementation, based on the pixel granularity, determining whether each sampling point in the tile is located within the primitive to be rendered includes: based on the pixel granularity, iterating through each pixel in the tile, performing a determination process once for each pixel to determine whether each sampling point within the pixel is located within the primitive to be rendered, wherein the number of iterations is equal to the number of pixels included in the tile.

[0066] Regarding the judgment in step S21, compared with the judgment method based on fine-grained sampling points in the related art, multiple sampling points within a pixel correspond to the same pixel coordinates, and iterative judgment causes redundant operations. The embodiment of the present disclosure adopts a judgment method based on coarse-grained pixels, that is, a pixel point only needs to perform one judgment process to determine whether each sampling point within the pixel point is located in the primitive to be rendered, thereby reducing the number of iterations and effectively reducing the amount of calculation in the rendering marking process.

[0067] Taking MSAA 4× and microtile 4×2 as examples, the number of loop iterations corresponding to the microtile based on the fine-grained judgment method of sampling points in the related art is 32 times, while the number of loop iterations corresponding to the microtile based on the fine-grained judgment method of pixel points in the embodiment of the present disclosure is 8 times.

[0068] In one possible implementation, a judgment process is performed on each pixel point to determine whether each sampling point within the pixel point is located within the primitive to be rendered, including: for any pixel point in the tile, determining the pixel point coordinates corresponding to the pixel point; determining whether the pixel point coordinates are located within the edge equation corresponding to the primitive to be rendered; and when the pixel point coordinates are located within the edge equation corresponding to the primitive to be rendered, determining that each sampling point within the pixel point is located within the primitive to be rendered.

[0069] Taking the block as the smallest processing unit, for the pixel coordinates corresponding to each pixel in the block, it is determined whether the pixel coordinates are located within the edge equation corresponding to the to-be-rendered primitive, so that for the same pixel, after one judgment, it is possible to determine whether each sampling point in the pixel is located within the to-be-rendered primitive.

[0070] For any sampling point in the display area, if the sampling point passes all the judgments based on the above steps S21 to S23, that is, it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area that needs to be rendered, and the sampling point is located in the primitive to be rendered, a rendering flag is determined for the sampling point. For example, the 1-bit flag corresponding to the sampling point is determined to be 1.

[0071] For any sampling point in the display area, if at least one of the judgments based on the above steps S21 to S23 at the sampling point fails, that is, if it is determined that the sampling point is not located in the rectangular clipping area, or the sampling point is not in the preset area where graphics rendering is required, or the sampling point is not located in the primitive to be rendered, the rendering flag is not determined for the sampling point. For example, the 1-bit flag corresponding to the sampling point is determined to be 0.

[0072] According to an embodiment of the present disclosure, for any tile in the display area, it is determined based on the pixel granularity whether each sampling point in the tile is located in the rectangular clipping area corresponding to the to-be-rendered primitive, so that the number of calculation iterations can be reduced compared with the judgment method of the sampling point granularity; it is determined based on the bit granularity whether each sampling point in the tile is a preset area where graphics rendering is required, so that the calculation process can be reduced compared with the judgment method of the sampling point granularity; it is determined based on the pixel granularity whether each sampling point in the tile is located in the to-be-rendered primitive, so that the number of calculation iterations can be reduced compared with the judgment method of the sampling point granularity; further, for any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area where graphics rendering is required, and the sampling point is located in the to-be-rendered primitive, a rendering mark for indicating that the sampling point needs to be rendered is determined for the sampling point; the three-step judgment process adopts the coarse-grained judgment methods of pixel granularity and bit granularity respectively, which can effectively reduce the amount of calculation in the rendering mark process compared with the fine-grained judgment method of the sampling point, thereby improving the GPU performance in the GPU graphics rendering process.

[0073] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.

[0074] In addition, the present disclosure also provides rendering tags, electronic devices, computer-readable storage media, and programs in GPU graphics rendering, all of which can be used to implement any rendering method in GPU graphics rendering provided by the present disclosure. The corresponding technical solutions and descriptions are referred to in the corresponding records of the method part and will not be repeated here.

[0075] Figure 3 A block diagram of a rendering device in GPU graphics rendering according to an embodiment of the present disclosure is shown. Figure 3 As shown, the device 30 includes:

[0076] A first judgment module 31 is used to judge, for any tile in the display area, whether each sampling point in the tile is located in a rectangular clipping area based on pixel granularity, wherein a tile is the minimum rendering area of ​​the GPU, a tile includes multiple pixels, a pixel includes multiple sampling points, the rectangular clipping area is used to indicate the minimum circumscribed rectangle of the to-be-rendered primitive, and the to-be-rendered primitive is used to indicate the position mapping of the to-be-rendered scene in the display area;

[0077] A second judgment module 32 is used to judge whether each sampling point in the block is a preset area that needs to be rendered based on the bit granularity;

[0078] A third judgment module 33 is used to judge whether each sampling point in the block is located within the primitive to be rendered based on the pixel granularity;

[0079] The rendering mark determination module 34 is used to determine a rendering mark for any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area that needs to be rendered, and the sampling point is located in the primitive to be rendered, wherein the rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.

[0080] In a possible implementation, the first determination module 31 is specifically configured to:

[0081] Based on the pixel granularity, each pixel in the tile is iterated, and a judgment process is performed on each pixel to determine whether each sampling point in the pixel is located in the rectangular cropping area, where the number of iterations is equal to the number of pixels included in the tile.

[0082] In a possible implementation, the first determination module 31 is specifically configured to:

[0083] For any pixel in the image block, determine the pixel coordinates corresponding to the pixel;

[0084] Determine a first bit sequence corresponding to the pixel point according to the pixel point coordinates;

[0085] For any sampling point in the pixel, when the first bit sequence indicates that the bit corresponding to the sampling point is 1, it is determined that the sampling point is located in the rectangular cropping area.

[0086] In a possible implementation, the second determination module 32 is specifically configured to:

[0087] For any pixel point in the image block, read a second bit sequence corresponding to the pixel point from a storage device;

[0088] For any sampling point within the pixel, when the second bit sequence indicates that the bit corresponding to the sampling point is 1, the sampling point is determined to be a preset area that needs to be rendered.

[0089] In a possible implementation, the device 30 further includes:

[0090] A receiving module, used for receiving, for any pixel point in the image block, a second bit sequence corresponding to the pixel point set by the user;

[0091] The storage module is used to store the second bit sequence corresponding to the pixel point in the storage device.

[0092] In a possible implementation, the third determination module 33 is specifically configured to:

[0093] Based on the pixel granularity, each pixel in the tile is iterated, and a judgment process is performed on each pixel to determine whether each sampling point in the pixel is located in the primitive to be rendered, where the number of iterations is equal to the number of pixels included in the tile.

[0094] In a possible implementation, the third determination module 33 is specifically configured to:

[0095] For any pixel point in the image block, determine the pixel point coordinates corresponding to the pixel point;

[0096] Determine whether the pixel coordinates are within the edge equation corresponding to the primitive to be rendered;

[0097] When the coordinates of the pixel point are located within the edge equation corresponding to the primitive to be rendered, it is determined that each sampling point within the pixel point is located within the primitive to be rendered.

[0098] This method has a specific technical connection with the internal structure of the computer system, and can solve the technical problem of how to improve the hardware computing efficiency or execution effect (including reducing the amount of data storage, reducing the amount of data transmission, increasing the hardware processing speed, etc.), thereby obtaining the technical effect of improving the internal performance of the computer system in accordance with the laws of nature.

[0099] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0100] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0101] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.

[0102] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0103] The electronic device may be provided as a terminal, a server, or a device in other forms.

[0104] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 4 , the electronic device 1900 can be provided as a server or a terminal device. Figure 4 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0105] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM ), a graphical user interface operating system launched by Apple (Mac OS X TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.

[0106] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0107] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0108] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0109] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0110] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0111] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0112] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0113] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0114] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0115] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.

[0116] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0117] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0118] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0119] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A rendering marking method in GPU graphics rendering, characterized in that: include: For any tile in the display area, based on the pixel granularity, determine whether each sampling point in the tile is located in a rectangular clipping area, wherein a tile is the minimum rendering area of ​​the GPU, a tile includes multiple pixels, and a pixel includes multiple sampling points. The rectangular clipping area is used to indicate the minimum circumscribed rectangle of the to-be-rendered primitive, and the to-be-rendered primitive is used to indicate the position mapping of the to-be-rendered scene in the display area; Based on the bit granularity, determining whether each sampling point in the image block is a preset area that needs to be rendered; Based on the pixel granularity, determining whether each sampling point in the image block is located within the image primitive to be rendered; For any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area that needs to be rendered, and the sampling point is located in the to-be-rendered primitive, a rendering mark is determined for the sampling point, wherein the rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.

2. The method according to claim 1, characterized in that The step of determining whether each sampling point in the image block is located within a rectangular clipping area based on the pixel granularity includes: Based on the pixel granularity, each pixel point in the image block is iterated, and a judgment process is performed on each pixel point to determine whether each sampling point in the pixel point is located in the rectangular cropping area, wherein the number of iterations is equal to the number of pixels included in the image block.

3. The method according to claim 2, characterized in that The judgment process is performed once for each pixel point to determine whether each sampling point in the pixel point is located in the rectangular clipping area, including: For any pixel point in the image block, determine the pixel point coordinates corresponding to the pixel point; Determine a first bit sequence corresponding to the pixel point according to the pixel point coordinates; For any sampling point within the pixel point, when the first bit sequence indicates that the bit corresponding to the sampling point is 1, it is determined that the sampling point is located within the rectangular cropping area.

4. The method according to claim 1, characterized in that: The step of judging whether each sampling point in the block is a preset area requiring graphics rendering based on the bit granularity includes: For any pixel point in the image block, read a second bit sequence corresponding to the pixel point from a storage device; For any sampling point within the pixel point, when the second bit sequence indicates that the bit corresponding to the sampling point is 1, the sampling point is determined to be a preset area that needs to be rendered.

5. The method according to claim 4, characterized in that The method further comprises: For any pixel point in the image block, receiving the second bit sequence corresponding to the pixel point set by a user; The second bit sequence corresponding to the pixel point is stored in the storage device.

6. The method according to claim 1, characterized in that The determining, based on the pixel granularity, whether each sampling point in the block is located within the to-be-rendered primitive comprises: Based on the pixel granularity, each pixel point in the block is iterated, and a judgment process is performed on each pixel point to determine whether each sampling point in the pixel point is located in the to-be-rendered primitive, wherein the number of iterations is equal to the number of pixels included in the block.

7. The method according to claim 6, characterized in that The step of performing a judgment process once on each pixel point to determine whether each sampling point within the pixel point is located within the primitive to be rendered includes: For any pixel point in the image block, determine the pixel point coordinates corresponding to the pixel point; Determine whether the pixel point coordinates are within the edge equation corresponding to the primitive to be rendered; In a case where the pixel point coordinates are located within the edge equation corresponding to the to-be-rendered primitive, it is determined that each sampling point within the pixel point is located within the to-be-rendered primitive.

8. A rendering marking device in GPU graphics rendering, characterized in that: include: A first judgment module is used to judge, for any one block in the display area, whether each sampling point in the block is located in a rectangular clipping area based on pixel granularity, wherein a block is a minimum rendering area of ​​a GPU, a block includes a plurality of pixels, a pixel includes a plurality of sampling points, the rectangular clipping area is used to indicate a minimum circumscribed rectangle of a to-be-rendered primitive, and the to-be-rendered primitive is used to indicate a position mapping of a to-be-rendered scene in the display area; A second judgment module is used to judge whether each sampling point in the block is a preset area that needs to be rendered based on the bit granularity; A third judgment module, used for judging whether each sampling point in the image block is located within the image primitive to be rendered based on pixel granularity; A rendering mark determination module is used to determine a rendering mark for any sampling point in the display area, when it is determined that the sampling point is located in the rectangular clipping area, the sampling point is a preset area that needs to be rendered, and the sampling point is located in the to-be-rendered primitive, wherein the rendering mark corresponding to the sampling point is used to indicate that the sampling point needs to be rendered.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Graphics processing methods and systems

    CN113256474A