Tile distribution method and apparatus, and device, storage medium and computer program product

By allocating tiles to the processor core according to the tile load level in the TBR architecture of the graphics processor, the problem of uneven workload distribution of the processor core in the traditional architecture is solved and the rendering performance is improved.

WO2024222208A1PCT designated stage expired Publication Date: 2024-10-31MOORE THREADS TECH CO LTD

Patent Information

Application Number
PCT/CN2024/079985
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-25
Filing Date
2024-03-04
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Uneven workload distribution across processor cores in traditional tile rendering architecture results in low rendering performance.

Method used

Load balancing is ensured by determining the load level of each tile in the graphics processor's TBR architecture and targeting processor cores in at least two processor cores based on that load level.

Benefits of technology

It achieves balanced distribution of processor core load and improves the rendering performance of the graphics processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079985_31102024_PF_FP_ABST
    Figure CN2024079985_31102024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a tile distribution method and apparatus, and a device, a storage medium and a computer program product. The method comprises: determining, by means of a front-end portion of a TBR architecture, a load level corresponding to each tile among a plurality of tiles, wherein the load level is used for representing the number of primitives present in the tile; transmitting, to a rear-end portion of the TBR architecture, the load level corresponding to each tile; and for each tile, by means of the rear-end portion of the TBR architecture and on the basis of a state indicator, which corresponds to each processor core, in a state indicator group corresponding to the tile, determining, from among at least two processor cores, a target processor core corresponding to the tile, wherein the arrangement sequence of state indicators in the state indicator group corresponding to the tile is related to the load level of the tile.
Need to check novelty before this filing date? Find Prior Art

Description

Tile distribution method, device, equipment, storage medium and computer program product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] The embodiments of this application are based on the Chinese patent application with application number 202310457192.8, application date April 25, 2023, and application name “Tile Distribution Method, Device, Equipment and Storage Medium”, and claim the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to, but is not limited to, the field of image processing technology, and in particular to a tile distribution method, apparatus, device, storage medium, and computer program product. Background Art

[0004] A graphics processing unit (GPU) is a specialized graphics rendering device used to process and display computerized graphics. GPUs are built with a highly parallel architecture that provides more efficient processing of a range of complex algorithms than a typical general-purpose central processing unit (CPU). For example, these algorithms may correspond to the representation of two-dimensional or three-dimensional computerized graphics.

[0005] However, in the process of GPU rendering graphics, especially under the conditions of power and system bandwidth limitations, a tile-based rendering (TBR) scheme is usually adopted, which splits the picture into image blocks (tiles, also called tiles) so that each tile can fit into the on-chip cache. For example, if the on-chip cache can store 512kB of data, the picture can be divided into tiles so that the pixel data contained in each tile is less than or equal to 512kB. In this way, the scene can be rendered by dividing the picture into tiles that can be rendered into the on-chip cache and rendering each tile of the scene individually into the on-chip cache, storing the rendered tiles from the on-chip cache into the frame buffer, and repeating the rendering and storage for each tile of the picture. Therefore, the picture can be rendered tile by tile to render each tile of the scene. It can be understood that the TBR scheme is a mode of delayed rendering of graphics, and is widely used in mobile devices due to its low power consumption.

[0006] Currently, during the rendering process of the traditional TBR architecture, the workload of the processor cores is unevenly distributed, resulting in low overall rendering performance.

[0007] Summary of the Invention

[0008] In view of this, embodiments of the present application provide at least one tile distribution method, apparatus, device, storage medium, and computer program product.

[0009] The technical solution of the embodiment of the present application can be implemented as follows:

[0010] An embodiment of the present application provides a tile distribution method, which is applied to a graphics processor including at least two processor cores, wherein the graphics processor performs a tile distribution process based on a tile rendering TBR architecture, including: determining a load level corresponding to each of a plurality of tiles through a front-end part of the TBR architecture; the load level is used to characterize the number of primitives present in the tile; transmitting the load level corresponding to each of the tiles to a back-end part of the TBR architecture; for each tile, determining a target processor core corresponding to the tile from the at least two processor cores through the back-end part of the TBR architecture based on a status indicator corresponding to each of the processor cores (Core) in a status indicator group corresponding to the tile; wherein an arrangement order of status indicators of the status indicator group corresponding to the tile is related to the load level of the tile.

[0011] An embodiment of the present application provides a tile distribution device, which is applied to a graphics processor including at least two processor cores. The graphics processor performs a tile distribution process based on a tile rendering (TBR) architecture, including:

[0012] The front-end part is configured to determine a load level corresponding to each of the plurality of blocks; the load level is used to represent the number of primitives present in the block;

[0013] The front-end part is configured to transmit the load level corresponding to each of the tiles to the back-end part of the TBR architecture;

[0014] a backend part configured to determine, for each tile, a target processor core corresponding to the tile from the at least two processor cores based on a status indicator corresponding to each processor core in the status indicator group corresponding to the tile;

[0015] The arrangement order of the status indicators of the status indicator group corresponding to the block is related to the load level of the block.

[0016] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0017] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements some or all of the steps in the above method when executed by a processor.

[0018] An embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above method.

[0019] In the embodiment of the present application, since the load level of each tile is counted in the distribution process of the graphics processor based on the TBR architecture, and the load level of each tile is transmitted to the back-end part, the target processor core for processing the current tile is determined in at least two processor cores based on the load level. In this way, compared with the scheme in the related art that uses the tile position as the distribution basis or the scheme that uses the tile number as the distribution basis, a targeted tile distribution process can be achieved, thereby balancing the load of each processor core in the graphics processor; at the same time, in the process of determining the target processor core of the current tile based on the load level, the arrangement order of the status indicator of the status indicator group corresponding to the tile is related to the load level of the tile, so that the probability of each processor core being called with the same probability can be increased, thereby further improving the load balancing capability and enhancing the rendering performance of the graphics processor as a whole.

[0020] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] FIG1 is a schematic diagram of a typical TBR pipeline flow chart provided in an embodiment of the present application;

[0023] FIG2 is a schematic diagram of a first implementation flow of a tile distribution method provided in an embodiment of the present application;

[0024] FIG3 is a second schematic diagram of an implementation flow of a tile distribution method provided in an embodiment of the present application;

[0025] FIG4 is a third schematic diagram of an implementation flow of a tile distribution method provided in an embodiment of the present application;

[0026] FIG5A is a fourth schematic diagram of an implementation flow of a tile distribution method provided in an embodiment of the present application;

[0027] FIG5B is a fifth flowchart of an implementation method of a tile distribution method provided in an embodiment of the present application;

[0028] FIG6 is a sixth schematic diagram of an implementation flow of a tile distribution method provided in an embodiment of the present application;

[0029] FIG7 is a seventh schematic diagram of an implementation flow of a tile distribution method provided in an embodiment of the present application;

[0030] FIG8 is a schematic diagram of a traditional TBR architecture provided in an embodiment of the present application;

[0031] FIG9 is a schematic diagram of a tile distribution process in a related art according to an embodiment of the present application;

[0032] FIG10 is a schematic diagram of an actual rendering scene provided by an embodiment of the present application;

[0033] FIG11 is a schematic diagram of the execution time of each processor core in an actual rendering scenario provided by an embodiment of the present application;

[0034] FIG12 is a schematic diagram of primitive coverage provided by an embodiment of the present application;

[0035] FIG13 is a schematic diagram of load interval division provided in an embodiment of the present application;

[0036] FIG14 is a structural diagram of a state machine provided in an embodiment of the present application;

[0037] FIG15 is a schematic diagram of a tile distribution process according to an embodiment of the present application;

[0038] FIG16 is a schematic diagram of the structure of a tile distribution device provided in an embodiment of the present application;

[0039] FIG17 is a schematic diagram of a hardware entity of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0041] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or sequence of "first / second / third" may be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.

[0043] Tile-based rendering is a process that subdivides a computer graphics image into a regular grid in optical space and renders each portion of the grid (grid) or tile separately. The advantage of this design is that it reduces memory and bandwidth consumption compared to immediate mode rendering systems that draw the entire frame at once. This makes tile rendering systems common in low-power hardware devices. Tile rendering is sometimes also called a sort middle architecture because it sorts geometry in the middle of the graphics pipeline rather than near the end. TBR is the most common architecture for mobile GPUs and has significant advantages in reducing power consumption.

[0044] A typical TBR pipeline process is shown in Figure 1. The TBR pipeline process is divided into a front-end part 110 and a back-end part 120, wherein the front-end part 110 includes a vertex processing part 111, a graphics processing part 112 and a tiling part 113; the back-end part 120 includes a rasterization part 121, a hidden surface removal (HSR) part 122, a pixel shading part 123 and an output merging part 124.

[0045] The front-end 110 performs vertex and primitive transformations (vertex processing), graphics processing (including clipping / culling, etc.), and then completes screen segmentation in the tiling phase, records the graphics data covering the tiles, and writes the generated information to the system memory 130. In this way, the system memory 130 can store tile information (primitive list) and vertex information (vertex data). The primitive list is a fixed-length array with a length of tiles. Each element in the array is a linked list that stores pointers to all triangles that intersect the current tile. The pointers point to the vertex data; the vertex data stores vertex and vertex attribute data.

[0046] The backend 120 performs operations such as rasterization, depth testing, and pixel shading, and finally outputs the result to the render target. For each tile, since the amount of data is small, the required depth data, texture data, or color data can be loaded into the GPU's on-chip static random-access memory (SRAM), i.e., the on-chip memory 140 in the figure. For example, the hidden surface removal section 122 can store depth data in the depth buffer in the on-chip memory 140, the pixel shading section 123 can store texture data in the texture buffer in the on-chip memory 140, and the output merging section 124 can store color data in the color buffer in the on-chip memory 140.

[0047] During the rendering process, the rendering object (image) is divided into multiple tiles, so that the on-chip memory 140 can accommodate all the data for each tile. After at least one drawing instruction arrives at the GPU, the front-end 110 processes each drawing instruction in turn and stores the corresponding tile information and vertex information in the system memory 130 until the data stored in the system memory 130 reaches a preset threshold or at least one drawing instruction has been processed. The back-end 120 reads the corresponding vertex information from the system memory 130 in units of tiles and performs subsequent processing. In this way, since the back-end 120 accesses the system memory 130 instead of accessing the on-chip memory 140, rendering efficiency can be improved.

[0048] TBR GPUs typically use universal shader cores for fragment shading. Specifically, each universal shader core is responsible for shading the fragments of a small screen tile. Each tile constructs a primitive list to record which primitives cover that tile's area. Therefore, the size of each tile's primitive list determines the workload of that tile's rendering task. However, within a complete screen, the primitive lists for each tile vary in size, resulting in an uneven workload among the universal shader cores.

[0049] Based on this, an embodiment of the present application provides a tile distribution method that can be executed by a processor of a computer device. The computer device may refer to a server, laptop, tablet computer, desktop computer, smart TV, set-top box, mobile device (such as a mobile phone, portable video player, personal digital assistant, dedicated messaging device, portable gaming device), or other device with data processing capabilities.

[0050] FIG2 is a schematic diagram of a first implementation flow of a tile distribution method provided in an embodiment of the present application. The method may be executed by a processor of a computer device and will be described in conjunction with the steps shown in FIG2 .

[0051] Step S201: Determine a load level corresponding to each of a plurality of tiles through a front-end portion of the TBR architecture; the load level is used to represent the number of primitives in the tile.

[0052] In some embodiments, the front-end portion of the TBR architecture may include the vertex processing portion 111, the graphics processing portion 112, and the tile portion 113 in Figure 1. The aforementioned multiple tiles are obtained after the front-end portion tiles the screen. Generally speaking, the tile range of each tile on the screen is the same, and the tile size must meet the storage requirements of the on-chip memory.

[0053] In some embodiments, for each tile, the load level corresponding to the tile is used to represent the number of primitives present in the tile. Since the front-end can determine the position of each primitive on the screen and, after completing the segmentation, can also obtain the tile range corresponding to each tile, the number of primitives present in each tile can be determined. Therefore, the load level corresponding to the tile can be obtained based on the number of primitives corresponding to the tile.

[0054] In some embodiments, the number of primitives falling into a tile can be directly used as the load level. For example, if 2 primitives fall into the first tile and 5 primitives fall into the second tile, the load level of the first tile can be directly set to 2, the load level of the second tile can be set to 5, and so on. In other embodiments, a quantity interval can be set for each load level, and the load level corresponding to the quantity interval to which the number of primitives falling into the tile belongs is used as the load level of the tile.

[0055] Step S202: delivering the load level corresponding to each tile to the backend of the TBR architecture.

[0056] In some embodiments, the load level corresponding to each tile can be stored in the system memory by the front-end part of the TBR architecture, and then, the back-end part of the TBR architecture can obtain the load level corresponding to each tile from the system memory.

[0057] Step S203 : For each tile, determine, by the backend portion of the TBR architecture, a target processor core corresponding to the tile from the at least two processor cores based on the status indicator corresponding to each processor core in the status indicator group corresponding to the tile.

[0058] In some embodiments, for each tile, the status indicator group corresponding to the tile includes a status indicator corresponding to each processor core, and the indicator code of the status indicator corresponding to each processor core is used to represent the operating state of the processor core. Exemplarily, the operating state of the processor core may include an idle state and a busy state. In the process of determining the target processor core from the at least two processor cores, the processor core in the idle state may be selected as the target processor core based on the operating state of each processor core.

[0059] In other embodiments, for each of the blocks, within the state indicator group corresponding to the block, the multiple state indicators have a fixed arrangement order. In the process of determining the target processor core from the at least two processor cores, the state indicators can be sequentially traversed according to the fixed arrangement order of the multiple state indicators, and the first processor core whose operating state is idle is selected as the target processor core.

[0060] In some embodiments, the target processor core is used to process the rendering task corresponding to the tile.

[0061] The arrangement order of the status indicators of the status indicator group corresponding to the block is related to the load level of the block.

[0062] In some embodiments, status indicator groups corresponding to different load levels have status indicators corresponding to processor cores in different arrangement orders. For example, see Table 1, which shows the arrangement order of status indicators corresponding to multiple status indicator groups.

[0063] Table 1

[0064] The order of the processor cores in the status indicator group corresponding to load level 1 is "1432," the order of the processor cores in the status indicator group corresponding to load level 2 is "2143," the order of the processor cores in the status indicator group corresponding to load level 3 is "3214," and the order of the processor cores in the status indicator group corresponding to load level 4 is "4321." It can be seen that the order of the status indicators corresponding to the processor cores in the status indicator group for each load level is different.

[0065] In other embodiments, the status indicator groups corresponding to different load levels and the status indicators corresponding to the processor cores within the status indicator groups may be arranged in the same order or in a different order. For example, see Table 2, which shows the arrangement order of the status indicators corresponding to multiple status indicator groups.

[0066] Table 2

[0067] The order of the processor cores in the status indicator groups corresponding to load levels 1 and 3 is "12," and the order of the processor cores in the status indicator groups corresponding to load levels 2 and 4 is "21." It can be seen that the order of the status indicators corresponding to the processor cores in the status indicator groups of different load levels can be the same or different.

[0068] In some embodiments, the method further includes: obtaining, by a backend portion of the TBR architecture, a state machine based on a load level corresponding to each tile; the state machine includes a state indicator group corresponding to each load level.

[0069] The backend has multiple state machines pre-set, each corresponding to a different number of load levels. After the backend of the TBR architecture determines the load level corresponding to each tile, it can retrieve the state machine corresponding to the current number of load levels from the pre-set multiple state machines based on the number of load levels.

[0070] For example, there may be a first state machine, a second state machine, and a third state machine; wherein the first state machine corresponds to 2 load levels, the second state machine corresponds to 4 load levels, and the third state machine corresponds to 8 load levels. In the case of obtaining 8 tiles, wherein the load levels corresponding to the tiles are (2, 3, 1, 2, 4, 2, 3, 4), it can be seen that the number of load levels of the tiles is 4. Therefore, the second state machine can be selected, that is, 4 load levels and a state indicator group corresponding to each of the 4 load levels.

[0071] It should be noted that the status indicator groups corresponding to each load level in different state machines can be the same or different. In other words, the status indicator group corresponding to load level 1 in the first state machine, the status indicator group corresponding to load level 1 in the second state machine, and the status indicator group corresponding to load level 1 in the third state machine can be the same or different.

[0072] In the embodiment of the present application, since the load level of each tile is counted in the distribution process of the graphics processor based on the TBR architecture, and the load level of each tile is transmitted to the back-end part, the target processor core for processing the current tile is determined in at least two processor cores based on the load level. In this way, compared with the scheme in the related art that uses the tile position as the distribution basis or the scheme that uses the tile number as the distribution basis, a targeted tile distribution process can be achieved, thereby balancing the load of each processor core in the graphics processor; at the same time, in the process of determining the target processor core of the current tile based on the load level, the arrangement order of the status indicators of the status indicator group corresponding to the tile is related to the load level of the tile, which can increase the probability of each processor core being called with the same probability, thereby further improving the load balancing capability and enhancing the rendering performance of the graphics processor as a whole.

[0073] In some embodiments, the arrangement order of the status indicators includes a bit sequence of the status indicator corresponding to each of the processor cores. For each bit sequence, the number of processor cores in the set of processor cores corresponding to the bit sequence is the same, and the set of processor cores corresponding to the bit sequence includes the processor cores corresponding to the bit sequence in the status indicator group corresponding to each load level.

[0074] For example, referring to Table 2, although the arrangement order of the processor cores in the status indicator groups corresponding to load levels 1 and 3 is "12," and the arrangement order of the processor cores in the status indicator groups corresponding to load levels 2 and 4 is "21," that is, there are cases where the arrangement order of the processor cores in the status indicator groups is the same, for the two existing bit orders (including "1" and "2"), the number of processor cores 1 and 2 in the processor core set corresponding to bit order "1" (processor core 1, processor core 2) is 2; and the number of processor cores 1 and 2 in the processor core set corresponding to bit order "2" (processor core 1, processor core 2) is 2. Thus, during the execution of step S203, the probability of each processor core being called is the same, which improves the load balancing capability of the image processor to a certain extent.

[0075] FIG3 is a second flow chart of the implementation process of the tile distribution method provided in an embodiment of the present application, which can be executed by a processor of a computer device. Based on FIG2 , step S201 in FIG2 can be updated to S301 to S302 , which will be explained in conjunction with the steps shown in FIG3 .

[0076] Step S301 : For each of the tiles, the front end of the TBR architecture determines the number of tiles that fall within the tile range based on the positions of the tiles and the tile range of the tile.

[0077] In some embodiments, after the front-end processes the geometry data and obtains the corresponding primitive data, the position of each primitive can be obtained. Furthermore, after the front-end performs block processing, the tile range corresponding to each tile can also be obtained. Subsequently, for each tile, based on the position of each primitive and the tile range of that tile, the number of primitives falling within the tile range can be obtained. The position of the primitive is expressed in the form of a trilateral equation.

[0078] Step S302: Determine the load level corresponding to each of the blocks based on the number of graphics elements corresponding to each of the blocks.

[0079] In some embodiments, the number of primitives that fall directly into a tile may be used as the load level of the tile.

[0080] In some embodiments, the above-mentioned determination of the load level corresponding to each of the blocks based on the number of graphics elements corresponding to each of the blocks can be achieved through steps S3021 to S3022.

[0081] Step S3021: Acquire multiple preset levels and the quantity interval corresponding to each preset level.

[0082] In some embodiments, the number of the plurality of preset levels is fixed. In other embodiments, the number of the plurality of preset levels is dynamically changed and is related to the rendering condition parameters of the current rendering environment. Please refer to the implementation process provided in the embodiment of FIG4 .

[0083] Step S3022: For each of the blocks, a preset level corresponding to a quantity interval into which the number of graphics elements corresponding to the block falls is used as the load level corresponding to the block.

[0084] Exemplarily, the multiple preset levels obtained include a first preset level and a second preset level, wherein the quantity interval corresponding to the first preset level is [0,4], and the quantity interval corresponding to the second preset level is (4,+∞). When 2 graphic elements fall into the first block and 5 graphic elements fall into the second block, the load level of the first block can be directly set to the first preset level, and the load level of the second block can be set to the second preset level.

[0085] In an embodiment of the present application, after obtaining the number of primitives in each tile, that is, after determining the rendering workload borne by each tile, the load conditions of each tile are graded based on the number of primitives. Then, in the subsequent process of distributing the tiles to the processor core, the workload conditions of each tile can be taken into consideration, thereby improving the load balancing capability of the graphics processor.

[0086] FIG4 is a third flow chart of the implementation process of the tile distribution method provided in an embodiment of the present application, which can be executed by a processor of a computer device. Based on FIG3 , step S3021 in FIG3 can be updated to S401 to S403 , which will be explained in conjunction with the steps shown in FIG4 .

[0087] Step S401: Obtain rendering condition parameters of the current rendering environment.

[0088] In some embodiments, the rendering condition parameters include at least one of the following: hardware parameters and rendering target parameters, the hardware parameters are used to characterize the hardware performance of the graphics processor, and the rendering target parameters are used to characterize the computational complexity of the rendering object.

[0089] In some embodiments, the hardware parameters include at least one of the following: the number of processor cores and the read and write speed of the memory.

[0090] In some embodiments, the rendering target parameters include at least one of the following: the size of the rendering object and the number of tiles.

[0091] Step S402: Determine the number of the plurality of preset levels based on the rendering condition parameters.

[0092] In some embodiments, when the hardware parameters represent better hardware performance of the graphics processor, the number of the multiple preset levels is greater; when the hardware parameters represent worse hardware performance of the graphics processor, the number of the multiple preset levels is less.

[0093] The greater the number of processor cores, the better the GPU hardware performance; the faster the memory read and write speed, the better the GPU hardware performance, and accordingly, the greater the number of preset levels. In this case, while increasing the number of preset levels will bring a certain degree of hardware load compared to a smaller number of levels, due to the better hardware performance of the GPU, the tile load can be divided more finely without affecting other rendering tasks, thereby achieving a more balanced distribution of tiles to the GPU cores.

[0094] In some embodiments, when the hardware parameters represent a greater amount of computational effort in rendering an object, the number of the plurality of preset levels is greater; and when the hardware parameters represent a lesser amount of hardware performance of a graphics processor, the number of the plurality of preset levels is less.

[0095] The greater the number of tiles, the greater the computational effort required to render the object; the larger the size of the rendering object, the greater the computational effort required to render the object, and accordingly, the greater the number of preset levels. Compared to a solution employing a smaller number of levels, this can reduce the load imbalance caused by the large overall computational effort required to render the object, which can prevent the inability of a smaller number of levels to effectively differentiate between a large number of tiles / primitives. In other words, the above embodiment can improve the level of detail in tile load partitioning, thereby enabling a more balanced distribution of tiles to the processor cores of the graphics processor.

[0096] Step S403: Based on the number of the plurality of preset levels, obtain the plurality of preset levels and the number interval corresponding to each of the preset levels.

[0097] In some embodiments, the number of the preset levels may be 2 to the power of n, where n is a positive integer. For example, the number of the preset levels may be 2, 4, 8, ..., and so on.

[0098] For each number of preset levels, a set of quantity intervals corresponding to each preset level can be preset, and the set of quantity intervals includes the quantity intervals corresponding to each preset level. For example, if the number of preset levels is "2", the first preset level and the second preset level corresponding to the number "2" can be preset, as can the first quantity interval corresponding to the first preset level and the second quantity interval corresponding to the second preset level. For example, if the number of preset levels is "4", the first preset level and the first quantity interval corresponding to the number "2", the second preset level and the second quantity interval corresponding to the second preset level, the third preset level and the third quantity interval corresponding to the number "2", and the fourth preset level and the fourth quantity interval corresponding to the fourth preset level can be preset.

[0099] In an embodiment of the present application, by obtaining the rendering condition parameters of the current rendering environment, combining the hardware parameters and the rendering target parameters, the number of multiple preset levels is determined, and then the number of load levels is dynamically changed, thereby achieving adaptive adjustment of the load level division accuracy. As a result, a trade-off can be made between load balancing capability and rendering speed, thereby improving rendering efficiency as a whole.

[0100] FIG5A is a fourth flow chart of the implementation process of the tile distribution method provided in an embodiment of the present application, which can be executed by a processor of a computer device. Based on FIG2 , S202 in FIG2 can be updated to S501 to S502 , which will be described in conjunction with the steps shown in FIG5A .

[0101] Step S501 : When the front end of the TBR architecture writes the tile information of each tile into the system memory, the load level corresponding to each tile is written into the tile header information of the corresponding tile information.

[0102] Step S502: For each of the tiles, in response to a rendering event for the tile, read tile header information of the tile information corresponding to the tile from the system memory through the backend part of the TBR architecture, and obtain the load level corresponding to the tile from the tile header information.

[0103] In some embodiments, please refer to Figure 5B, which shows a flowchart diagram 5 of the tile distribution method provided in an embodiment of the present application. Based on Figure 5A, before step S501, the method may also include step S503. Accordingly, steps S501 to S502 can be updated to S504 to S505, which will be explained in conjunction with the steps shown in Figure 5A.

[0104] Step S503: Encode the load level corresponding to each of the tiles through the front end of the TBR architecture to obtain a coding value of at least one bit.

[0105] In some embodiments, the load level may be binary-encoded to obtain the encoded value of the at least one bit. For example, when the load levels include 1 and 2, encoding the load levels may yield two encoded values, 00 and 01, respectively; when the load levels include 1, 2, 3, and 4, encoding the load levels may yield four encoded values, 00, 01, 10, and 11, respectively, and so on.

[0106] Step S504 : When the front end of the TBR architecture writes the tile information of each tile into the system memory, the encoding value of at least one bit corresponding to each tile is written into the tile header information of the corresponding tile information.

[0107] Step S505: For each of the tiles, in response to a rendering event for the tile, the tile header information of the tile information corresponding to the tile is read from the system memory through the back-end part of the TBR architecture, and the encoded value of at least one bit in the tile header information is decoded to obtain the load level corresponding to the tile.

[0108] In some embodiments, decoding the encoded value of at least one bit in the tile header information to obtain the load level corresponding to the tile is the inverse process of encoding the load level to obtain the encoded value of at least one bit. Based on the above example, when the encoded values ​​are 00 and 01, after decoding the encoded values, load levels 1 and 2 can be obtained respectively; when the encoded values ​​are 00, 01, 10, and 11, after decoding the encoded values, load levels 1, 2, 3, and 4 can be obtained respectively.

[0109] In the embodiment of the present application, by encoding the load level, the transmission cost can be reduced as much as possible during the process of transmitting the load level to the back-end part, the transmission efficiency can be improved, and the rendering efficiency can be improved.

[0110] FIG6 is a sixth schematic diagram of the implementation flow of the tile distribution method provided in an embodiment of the present application, which can be executed by a processor of a computer device. Based on any of the above embodiments, taking FIG2 as an example, S203 in FIG2 can be updated to S601 to S602, which will be explained in conjunction with the steps shown in FIG6.

[0111] Step S601: traverse the status indicators according to the arrangement order of the status indicators corresponding to the tiles through the backend part of the TBR architecture.

[0112] For example, please refer to the arrangement order of status indicators corresponding to multiple status indicator groups shown in Table 1. When the block belongs to load level 2, the processor cores corresponding to the four processor cores can be traversed in the order of processor core 2, processor core 1, processor core 4, and processor core 3.

[0113] Each status indicator may be configured as a first value, the first value being used to indicate that the processor core corresponding to the status indicator is in an idle state (dispatching state); each status indicator may be configured as a second value, the second value being used to indicate that the processor core corresponding to the status indicator is in a busy state (non-dispatching state). In some embodiments, the initial state of each status indicator is configured as the first value.

[0114] In some embodiments, the first value may be set to 0, and the second value may be set to 1. This application does not limit this.

[0115] Step S602: The processor core corresponding to the first status indicator having a first value is used as the target processor core.

[0116] In some embodiments, the method further includes steps S603 to S604.

[0117] Step S603: Allocate the rendering task corresponding to the tile to the target processor core.

[0118] Step S604 : In response to allocating the rendering task corresponding to the tile to the target processor core, updating the status indicator corresponding to the target processor core in the status indicator group corresponding to the tile to the second value.

[0119] For example, please refer to Table 3, which shows a status table of a status indicator group. The status table corresponds to Table 1.

[0120] Table 3

[0121] If the current tile belongs to load level 2, the processor cores corresponding to these four processor cores can be traversed in the order of processor core 2, processor core 1, processor core 4, and processor core 3. At this time, the first status indicator with the first value is the status indicator corresponding to processor core 1, and the rendering task corresponding to the current tile is assigned to processor core 1. In response to the assignment of the rendering task corresponding to the current tile to processor core 1, the status indicator corresponding to processor core 1 corresponding to the tile is updated to the second value.

[0122] In some embodiments, the method further includes step S605.

[0123] Step S605: In response to each of the status indicators in the status indicator group corresponding to the tile being at the second value, reset each of the status indicators in the status indicator group corresponding to the tile to the first value.

[0124] If the current tile belongs to load level 3, the status indicators corresponding to the four processor cores can be traversed in the order of processor core 3, processor core 2, processor core 1, and processor core 4. In this case, the first status indicator with the first value is the status indicator corresponding to processor core 4, and the rendering task corresponding to the current tile is assigned to processor core 4. In response to the assignment of the rendering task corresponding to the current tile to processor core 4, the status indicator corresponding to processor core 4 corresponding to the tile is updated to the second value.

[0125] At this time, a state table of a state indicator group as shown in Table 4 can be obtained.

[0126] Table 4

[0127] Since the status indicators corresponding to the four processor cores corresponding to load level 3 are all the second value "1" at this time, the status indicators corresponding to the four processor cores corresponding to load level 3 are reset to the first value "0", and a status table of a status indicator group is obtained as shown in Table 5.

[0128] Table 5

[0129] In the embodiment of the present application, the method for updating each status indicator in the above status indicator group can reduce the load imbalance problem caused by the continuous distribution of tiles to a certain processor core.

[0130] Considering that two bits are reserved in the tile header information of each tile during the process of storing the tile information of each tile in the system memory at the front end, FIG7 is a flowchart of the tile distribution method provided in an embodiment of the present application. The method can be executed by a processor of a computer device. The steps shown in FIG7 will be described below.

[0131] Step S301 : For each of the tiles, the front end of the TBR architecture determines the number of tiles that fall within the tile range based on the positions of the tiles and the tile range of the tile.

[0132] Step S701: Obtain a first preset level and a corresponding first quantity interval, a second preset level and a corresponding second quantity interval, a third preset level and a corresponding third quantity interval, and a fourth preset level and a corresponding fourth quantity interval.

[0133] Step S702: For each of the tiles, based on the number of graphics elements corresponding to the tile, determine a target preset level from the first preset level, the second preset level, the third preset level, and the fourth preset level as the load level corresponding to the tile.

[0134] The target preset level is a preset level corresponding to a quantity interval into which the number of graphic elements corresponding to the block falls.

[0135] Step S703: Encode the load level corresponding to each tile through the front end of the TBR architecture to obtain a two-bit encoding value.

[0136] Step S704: Write the two-bit code value corresponding to each tile into the reserved bit in the tile header information of the tile information of each tile.

[0137] Step S705: For each of the tiles, read the tile header information of the tile information of the tile from the system memory through the back-end part of the TBR architecture, and decode the two-bit encoding value of the reserved bit in the tile header information to obtain the load level corresponding to the tile.

[0138] Step S203 : For each tile, determine, by the backend portion of the TBR architecture, a target processor core corresponding to the tile from the at least two processor cores based on the status indicator corresponding to each processor core in the status indicator group corresponding to the tile.

[0139] Here, the above-mentioned step S301 and step 203 correspond to step S301 in the embodiment of FIG. 3 and step 203 in the embodiment of FIG. 2 , respectively. When implementing, reference may be made to the specific implementation manner in the above-mentioned embodiment.

[0140] In an embodiment of the present application, considering that in the process of storing the tile information of each tile in the system memory in the front-end part, there are two bits of reserved bits in the tile header information of the tile information of each tile, the number of load levels is set to 4, and the load level is encoded to obtain a 2-bit encoding value, so that the above-mentioned reserved bits can be effectively utilized. Compared with the existing TBR architecture, the embodiment of the present application will not affect the reading and writing process of the system memory.

[0141] The following describes the application of the tile distribution method provided by the embodiment of the present application in a practical scenario, mainly involving an image processor including four processor cores. Of course, the embodiment of the present application does not limit the number of processor cores of the image processor, and the following embodiment is only for the purpose of more clearly describing the implementation process of the present application.

[0142] In a traditional TBR architecture, the front-end (FrontEnd) 810 generates primitive rendering data and writes it to memory 840. The back-end (BackEnd) 820 splits the tiles and distributes them to different GPU cores. Each GPU core reads the primitive metadata from memory for the corresponding tile, as shown in Figure 8. Load balancing across different GPU cores is closely related to the tile distribution strategy. The tile distributor 830 should not only distribute tiles to different GPU cores as evenly as possible but also control the operating time of each GPU core through tile distribution, thereby reducing GPU performance degradation caused by some GPU cores operating too long while others operate too short.

[0143] For tile distribution, existing designs usually divide the screen into tiles first, and then assign a fixed area on the screen (containing several tiles) to a GPU core for processing. In fact, this is to establish a mapping relationship between each area divided by the screen and each GPU core and use this as the basis for tile distribution.

[0144] Please refer to Figure 9, which is a schematic diagram of the tile distribution process in the related art. First, the screen is divided into 16 tiles, t0 to t15. These tiles are then grouped, as shown in Figure 9, with every 4 tiles being grouped together. Tiles in the same group are distributed to the same GPU core. Therefore, for the distribution process shown in Figure 9, the tile division results are shown in Table 6:

[0145] Table 6

[0146] The above tile distribution ensures that each GPU core processes the same number of tiles, thereby balancing the workload of each GPU core. However, this approach has significant limitations because it only considers spatial averaging and does not take into account the influence of time (or load).

[0147] Taking the actual rendering scene shown in Figure 10 as an example, Figure 10 shows the triangles that each tile should render. Different tiles have different loads. Among them, t0 to t3 have a large load, and the load from t4 to t15 is relatively sparse. According to the above distribution algorithm, t0 to t3 are sent to the same GPU core (that is, GPU 0), resulting in the overall load of GPU0 being much larger than that of other GPU cores. As a result, the execution time of the GPU core is extremely unbalanced and performance issues are prominent.

[0148] Please refer to Figure 11, which shows the execution time of each processor core in an actual rendering scenario. Among them, the execution time of GPU0 far exceeds the execution time of GPU1, GPU2 and GPU3.

[0149] The embodiments of the present application improve the screen-based tile distribution algorithm in the related art and propose a tile load-based distribution algorithm. The algorithm design introduces the calculation of the tile load factor and uses it as an influencing factor in the tile distribution process to adjust the tile distribution strategy, thereby improving the load balance of multiple GPU cores on the TBR architecture, thereby achieving overall performance improvement.

[0150] The embodiment of the present application is based on the TBR architecture. By adding a load statistics part to the TBR front end and utilizing the existing tile header transmission mechanism, the load information is sent from the TBR front end to the TBR back end. Then, in the tile distribution stage, the load information is used to reasonably distribute the tiles to each GPU core for execution.

[0151] In some embodiments, the front-end counts the number of times each tile is covered by a primitive when performing block division. As shown in FIG12 , the loads of tiles covered by each primitive are calculated based on the three-sided equation of the graph, thereby counting the loads of tiles T0 to T8, where the load of T0 is 1 (including P3), the load of T1 is 2 (including P0 and P3), the load of T2 is 2 (including P0 and P3), the load of T3 is 2 (including P0 and P3), the load of T4 is 4 (including P0, P1, P2, and P3), the load of T5 is 2 (including P1 and P2), the load of T6 is 1 (including P0), the load of T7 is 3 (including P0, P1, and P2), and the load of T8 is 2 (including P1 and P2).

[0152] In some embodiments, the tile payload isn't simply recorded as a value and transmitted to the backend. A large payload would occupy many bits, requiring not only increased storage space but also increased memory read and write bandwidth. To reduce unnecessary hardware overhead, the tile payload is encoded after the last primitive in the tile is counted.

[0153] By testing and statistically analyzing a large number of benchmark points, we extracted four load intervals (corresponding to the numerical intervals in the above embodiment). See Figure 13 for a schematic diagram of the load interval divisions. The load conditions of less than or equal to threshold 1 and greater than threshold 3 are rare, while the loads of most tiles fall within the middle two load intervals. The corresponding codes for the four load intervals are shown in Table 7.

[0154] Table 7

[0155] As shown in Table 7, the encoded tile payload only occupies 2 bits, which can be easily stuffed into the tile header and then written to memory.

[0156] In some embodiments, the TBR backend reads each tile header from memory, decodes the workload of the tile, and distributes the workload to different GPU cores based on this workload.

[0157] Based on the above implementation scenario, the following test platform uses a system with four GPU cores. In the tile dispatcher, a state machine is constructed based on the tile workload (TWL). This state machine contains four 4-bit 0-1 status indicator groups. The four groups represent the number of TWLs encoded, which is 4 (including status indicator group 0: TWL_00, status indicator group 1: TWL_01, status indicator group 2: TWL_10, and status indicator group 3: TWL_11). The 4 bits represent the number of cores in the system. The cores are swizzled between status indicator groups to ensure that the same number of tiles is sent to each core. The structure of this state machine is shown in Figure 14.

[0158] After reading a tile's header and parsing its workload encoding value, the corresponding group is found based on the encoding value. The indicator bits of each core are then traversed from left to right. If the indicator of a core is 0, the tile can be distributed to this core, and then the core indicator is set to 1. When the indicators of all cores in a group have been set to 1, they are all reset to 0 to prepare for the next round of distribution.

[0159] Please refer to Figure 15 for a schematic diagram of the tile distribution process. The screen in Figure 15 includes 16 tiles (t0 to t15). If tiles 0 to 3 are simply sent to core 0, tiles 4 to 7 are sent to core 1, tiles 8 to 9 are sent to core 2, and tiles 10 to 15 are sent to core 3, then the load on core 0 and core 3 will be too light, while the load on core 1 and core 2 will be too heavy, resulting in extremely unbalanced distribution of rendering tasks. When using the tile distribution method provided in the above embodiment, the distribution process from t0 to t15 may include:

[0160] T0: TWL = TWL_00, check the indicator code of status indicator group 0 (group0_core_mask), select core0 as the distribution target, and set group0_core_mask = 1000b;

[0161] T1: TWL = TWL_01, check the indicator code of status indicator group 1 (group1_core_mask), select core1 as the distribution target, and set group1_core_mask = 1000b;

[0162] T2: TWL = TWL_01, check the indicator code of status indicator group 1 (group1_core_mask), select core2 as the distribution target, and set group1_core_mask = 1100b;

[0163] T3: TWL = TWL_01, check the indicator code of status indicator group 1 (group1_core_mask), select core3 as the distribution target, and set group0_core_mask = 1110b;

[0164] T4: TWL=TWL_10, check the indicator code of status indicator group 2 (group2_core_mask), select core2 as the distribution target, and set group2_core_mask=1000b;

[0165] T5: TWL=TWL_11, check the indicator code of status indicator group 3 (group3_core_mask), select core3 as the distribution target, and set group3_core_mask=1000b;

[0166] T6: TWL=TWL_11, check the indicator code of status indicator group 3 (group3_core_mask), select core0 as the distribution target, and set group3_core_mask=1100b;

[0167] T7: TWL=TWL_10, check the indicator code of status indicator group 2 (group2_core_mask), select core3 as the distribution target, and set group2_core_mask=1100b;

[0168] T8: TWL=TWL_10, check the indicator code of status indicator group 2 (group2_core_mask), select core0 as the distribution target, and set group2_core_mask=1110b;

[0169] T9: TWL=TWL_10, check the indicator code (group2_core_mask) of status indicator group 2, select core1 as the distribution object, set group2_core_mask=1111b, and reset group2_core_mask=0000b;

[0170] T10: TWL=TWL_10, check the indicator code of status indicator group 3 (group3_core_mask), select core1 as the distribution target, and set group3_core_mask=1110b;

[0171] T11: TWL=TWL_11, check the indicator code of status indicator group 2 (group2_core_mask), select core3 as the distribution target, and set group2_core_mask=1111b;

[0172] T12: TWL=TWL_01, check the indicator code (group1_core_mask) of status indicator group 1, select core0 as the distribution target, set group1_core_mask=1111b, and reset group1_core_mask=0000b;

[0173] T13: TWL=TWL_00, check the indicator code of status indicator group 0 (group0_core_mask), select core1 as the distribution target, and set group0_core_mask=1100b;

[0174] T14: TWL=TWL_01, check the indicator code of status indicator group 1 (group1_core_mask), select core1 as the distribution target, and set group1_core_mask=1000b;

[0175] T15: TWL=TWL_01, check the indication code (group1_core_mask) of the status indicator group 1, select core2 as the distribution object, and set group1_core_mask=1100b.

[0176] In the end, the four cores are allocated the same number of tiles, and after comparison, it can be concluded that the load of the four cores is not much different.

[0177] In actual application testing, we've found that with larger render targets and / or more tiles, increasing the number of TWL codes results in finer tile load partitioning and more balanced tile distribution. This increased code size also comes with certain memory overhead and changes in the dispatcher schedule. In actual hardware, this trade-off can be made based on factors such as memory read / write capacity and the number of cores.

[0178] This embodiment of the application focuses on balancing the runtime of all GPU cores. By adding a load statistics function to the tiler stage, the TWL load of each core within the current frame is counted and encoded, and then sent to the backend, which uses this load information to distribute tiles. This algorithm avoids the drawbacks of traditional algorithms that use tile number as the basis for distribution. At minimal cost, the tile distributor identifies tile load and distributes it in a targeted manner, essentially achieving load balancing across all GPU cores, thereby enhancing the GPU's rendering performance overall.

[0179] Compared with related technical solutions, the embodiments of the present application achieve the statistics and transmission of the load of each tile at a very low cost; at the same time, the load is introduced as an influencing factor when distributing tiles, so that the working time of some GPU cores will not be too long or too short, thereby improving the utilization efficiency of the hardware; at the same time, a new group-core distribution arrangement is proposed to further reduce the load imbalance problem caused by the continuous distribution of tiles to a certain core.

[0180] Based on the aforementioned embodiments, an embodiment of the present application provides a tile distribution device, which includes various parts included and can be implemented by a processor in a computer device; of course, it can also be implemented by a detailed logic circuit.

[0181] FIG16 is a schematic diagram of the structure of a tile distribution device provided in an embodiment of the present application. As shown in FIG16 , the tile distribution device 1600 includes: a front-end part 1610 and a back-end part 1620 , wherein:

[0182] The front-end portion 1610 is configured to determine a load level corresponding to each of the plurality of tiles; the load level is used to represent the number of primitives present in the tile;

[0183] The front-end part 1610 is configured to transmit the load level corresponding to each tile to the back-end part of the TBR architecture;

[0184] The back-end part 1620 is configured to determine, for each of the tiles, a target processor core corresponding to the tile from the at least two processor cores based on the status indicators corresponding to each of the processor cores in the status indicator group corresponding to the tile; wherein the arrangement order of the status indicators of the status indicator group corresponding to the tile is related to the load level of the tile.

[0185] In this embodiment and other embodiments, "part" can be part of a circuit, part of a processor, part of a program or software, etc., and of course it can also be a unit, a module, or a non-modular one.

[0186] In some embodiments, the arrangement order of the status indicators includes the bit sequence of the status indicator corresponding to each of the processor cores; for each of the bit sequences, the number of processor cores in the processor core set corresponding to the bit sequence is the same, and the processor core set corresponding to the bit sequence includes the processor core corresponding to the bit sequence in the status indicator group corresponding to each of the load levels.

[0187] In some embodiments, the front-end part 1610 is further configured to: for each of the tiles, determine the number of graphics elements that fall within the tile range based on the position of each graphics element and the tile range of the tile; and determine the load level corresponding to each of the tiles based on the number of graphics elements corresponding to each of the tiles.

[0188] In some embodiments, the front-end part 1610 is further configured to: obtain multiple preset levels and the quantity interval corresponding to each preset level; for each of the tiles, the preset level corresponding to the quantity interval into which the number of graphic elements corresponding to the tile falls is used as the load level corresponding to the tile.

[0189] In some embodiments, the front-end part 1610 is further configured to: obtain rendering condition parameters of the current rendering environment; the rendering condition parameters include at least one of the following: hardware parameters and rendering target parameters, the hardware parameters are used to characterize the hardware performance of the graphics processor, and the rendering target parameters are used to characterize the computational amount of the rendering object; based on the rendering condition parameters, determine the number of the multiple preset levels; based on the number of the multiple preset levels, obtain the multiple preset levels and the number interval corresponding to each of the preset levels.

[0190] In some embodiments, the hardware parameters include at least one of the following: the number of processor cores and the read and write speed of the memory; the rendering target parameters include at least one of the following: the size of the rendering object and the number of tiles.

[0191] In some embodiments, the front-end part 1610 is further configured to: in the process of writing the tile information of each of the tiles into the system memory, write the load level corresponding to each of the tiles into the tile header information of the corresponding tile information; the back-end part 1620 is further configured to: for each of the tiles, in response to the rendering event for the tile, read the tile header information of the tile information corresponding to the tile from the system memory, and obtain the load level corresponding to the tile from the tile header information.

[0192] In some embodiments, the front-end part 1610 is further configured to: encode the load level corresponding to each of the tiles to obtain a coding value of at least one bit; write the coding value of at least one bit corresponding to each of the tiles into the tile header information of the corresponding tile information; the back-end part 1620 is further configured to: read the tile header information of the tile information corresponding to the tile from the system memory, and decode the coding value of at least one bit in the tile header information to obtain the load level corresponding to the tile.

[0193] In some embodiments, the backend part 1620 is further configured to: traverse each of the status indicators according to the arrangement order of the status indicators corresponding to the tiles; and use the processor core corresponding to the first status indicator with the first value as the target processor core.

[0194] In some embodiments, the back-end part 1620 is further configured to: assign the rendering task corresponding to the tile to the target processor core; in response to assigning the rendering task corresponding to the tile to the target processor core, update the status indicator corresponding to the target processor core in the status indicator group corresponding to the tile to the second value.

[0195] In some embodiments, the back-end portion 1620 is further configured to: in response to each status indicator in the status indicator group corresponding to the tile being the second value, reset each status indicator in the status indicator group corresponding to the tile to the first value.

[0196] In some embodiments, the backend portion 1620 is further configured to: obtain a state machine based on a load level corresponding to each of the tiles; the state machine includes a state indicator group corresponding to each of the load levels.

[0197] In some embodiments, the front-end part 1610 is further configured to: obtain a first preset level and a corresponding first quantity interval, a second preset level and a corresponding second quantity interval, a third preset level and a corresponding third quantity interval, a fourth preset level and a corresponding fourth quantity interval; for each of the tiles, based on the number of graphic elements corresponding to the tile, determine a target preset level among the first preset level, the second preset level, the third preset level and the fourth preset level as the load level corresponding to the tile; the target preset level is the preset level corresponding to the quantity interval into which the number of graphic elements corresponding to the tile falls.

[0198] In some embodiments, the front-end portion 1610 is further configured to: encode the load level corresponding to each tile to obtain a two-bit encoded value; and write the two-bit encoded value corresponding to each tile into a reserved bit in the tile header information of the tile information of each tile. The back-end portion 1620 is further configured to, for each tile, read the tile header information of the tile information of the tile from the system memory, and decode the two-bit encoded value of the reserved bit in the tile header information to obtain the load level corresponding to the tile.

[0199] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. In some embodiments, the functions or parts included in the device provided in the embodiments of the present application can be configured to perform the methods described in the above method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.

[0200] It should be noted that, in the embodiment of the present application, if the above-mentioned tile distribution is implemented in the form of a software function module and is sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software and firmware.

[0201] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0202] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.

[0203] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0204] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.

[0205] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.

[0206] Figure 17 is a schematic diagram of the hardware entity of a computer device provided in an embodiment of the present application. As shown in Figure 17, the hardware entity of the computer device 1700 includes: a processor 1701 and a memory 1702, wherein the memory 1702 stores a computer program that can be run on the processor 1701, and when the processor 1701 executes the program, the steps in the method of any of the above embodiments are implemented.

[0207] The memory 1702 stores computer programs that can be run on the processor. The memory 1702 is configured to store instructions and applications executable by the processor 1701. It can also cache data to be processed or processed by the processor 1701 and various parts of the computer device 1700 (for example, image data, audio data, voice communication data, and video communication data). This can be implemented through flash memory (FLASH) or random access memory (RAM).

[0208] When the processor 1701 executes the program, the steps of any of the above tile distribution methods are implemented. The processor 1701 generally controls the overall operation of the computer device 1700.

[0209] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the tile distribution method of any of the above embodiments.

[0210] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0211] The processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device that implements the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiments of the present application.

[0212] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0213] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution. The execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application mentioned above are for description and do not represent the advantages and disadvantages of the embodiments.

[0214] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0215] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are schematic. For example, the division of the units is a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0216] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0217] In addition, the functional units in the embodiments of the present application can all be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units. It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the above-mentioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), magnetic disks or optical disks.

[0218] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0219] The above is merely an embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability

[0220] In this embodiment, since the load level of each tile is counted in the distribution process of the graphics processor based on the TBR architecture, and the load level of each tile is transmitted to the back-end part, the target processor core for processing the current tile is determined in at least two processor cores based on the load level. In this way, compared with the scheme in the related art that uses the tile position as the distribution basis or the scheme that uses the tile number as the distribution basis, a targeted tile distribution process can be achieved, thereby balancing the load of each processor core in the graphics processor; at the same time, in the process of determining the target processor core of the current tile based on the load level, the arrangement order of the status indicators of the status indicator group corresponding to the tile is related to the load level of the tile, so that the probability of each processor core being called with the same probability can be increased, thereby further improving the load balancing capability and enhancing the rendering performance of the graphics processor as a whole.

Claims

1. A tile distribution method, applied to a graphics processor including at least two processor cores, wherein the graphics processor performs a tile distribution process based on a tile rendering TBR architecture, the method comprising: Determining, by a front end portion of the TBR architecture, a load level corresponding to each of a plurality of tiles; The load level is used to characterize the number of primitives present in the tile; Transmitting the load level corresponding to each of the tiles to a backend portion of the TBR architecture; For each of the tiles, determining, by a backend part of the TBR architecture, a target processor core corresponding to the tile from the at least two processor cores based on a status indicator corresponding to each of the processor cores in the status indicator group corresponding to the tile; The arrangement order of the status indicators of the status indicator group corresponding to the block is related to the load level of the block.

2. The method according to claim 1, wherein: The arrangement order of the status indicators includes the bit sequence of the status indicators corresponding to each of the processor cores; for each of the bit sequences, the number of processor cores in the processor core set corresponding to the bit sequence is the same, and the processor core set corresponding to the bit sequence includes the processor core corresponding to the bit sequence in the status indicator group corresponding to each of the load levels.

3. The method according to claim 1, wherein: The determining, by the front end part of the TBR architecture, a load level corresponding to each of the plurality of tiles, comprises: For each of the tiles, determining, by a front end portion of the TBR architecture, a number of primitives that fall within the tile range based on positions of each primitive and the tile range of the tile; Based on the number of graphics elements corresponding to each of the graphics blocks, a load level corresponding to each of the graphics blocks is determined.

4. The method according to claim 3, wherein: The determining, based on the number of graphics elements corresponding to each of the graphics blocks, a load level corresponding to each of the graphics blocks, includes: Obtaining a plurality of preset levels and a quantity interval corresponding to each of the preset levels; For each of the blocks, a preset level corresponding to a quantity interval into which the number of graphics elements corresponding to the block falls is used as the load level corresponding to the block.

5. The method according to claim 4, wherein: The obtaining of a plurality of preset levels and a quantity interval corresponding to each preset level includes: Acquire rendering condition parameters of the current rendering environment; the rendering condition parameters include at least one of the following: hardware parameters and rendering target parameters, the hardware parameters are used to characterize the hardware performance of the graphics processor, and the rendering target parameters are used to characterize the computational amount of the rendering object; Based on the rendering condition parameter, determining the number of the plurality of preset levels; Based on the number of the plurality of preset levels, the plurality of preset levels and the number interval corresponding to each of the preset levels are acquired.

6. The method according to claim 5, wherein: The hardware parameters include at least one of the following: the number of processor cores and the read and write speed of the memory; the rendering target parameters include at least one of the following: the size of the rendering object and the number of tiles.

7. The method according to any one of claims 1 to 6, wherein: The step of transmitting the load level corresponding to each of the tiles to the backend of the TBR architecture comprises: In the process of writing the block information of each of the blocks into the system memory at the front end of the TBR architecture, writing the load level corresponding to each of the blocks into the block header information of the corresponding block information; For each of the tiles, in response to a rendering event for the tile, tile header information of tile information corresponding to the tile is read from the system memory through the backend part of the TBR architecture, and a load level corresponding to the tile is obtained from the tile header information.

8. The method according to claim 7, wherein: The method further includes: encoding the load level corresponding to each of the tiles through the front end portion of the TBR architecture to obtain a coded value of at least one bit; Writing the load level corresponding to each of the tiles into the tile header information of the corresponding tile information includes: writing the encoding value of at least one bit corresponding to each of the tiles into the tile header information of the corresponding tile information; The step of reading the tile header information of the tile information corresponding to the tile from the system memory through the back-end part of the TBR architecture, and obtaining the load level corresponding to the tile from the tile header information, includes: reading the tile header information of the tile information corresponding to the tile from the system memory through the back-end part of the TBR architecture, and decoding the encoded value of at least one bit in the tile header information to obtain the load level corresponding to the tile.

9. The method according to any one of claims 1 to 6, wherein: The determining, by the backend part of the TBR architecture, a target processor core corresponding to the tile from the at least two processor cores based on a status indicator corresponding to each of the processor cores in the status indicator group corresponding to the tile, comprises: Traversing each of the status indicators according to the arrangement order of each of the status indicators corresponding to the tile through the backend part of the TBR architecture; The processor core corresponding to the first status indicator having the first value is used as the target processor core.

10. The method according to claim 9, wherein: The method further comprises: Allocating the rendering task corresponding to the tile to the target processor core; In response to allocating the rendering task corresponding to the tile to the target processor core, updating the status indicator corresponding to the target processor core in the status indicator group corresponding to the tile to a second value.

11. The method according to claim 10, wherein: The method further comprises: In response to each of the status indicators in the status indicator group corresponding to the image block being the second value, each of the status indicators in the status indicator group corresponding to the image block is reset to the first value.

12. The method according to any one of claims 1 to 6, wherein: The method further comprises: A state machine is obtained through the backend part of the TBR architecture based on the load level corresponding to each of the tiles; the state machine includes a state indicator group corresponding to each of the load levels.

13. The method according to claim 3, wherein: The determining, based on the number of graphics elements corresponding to each of the graphics blocks, a load level corresponding to each of the graphics blocks, includes: Obtaining a first preset level and a corresponding first quantity interval, a second preset level and a corresponding second quantity interval, a third preset level and a corresponding third quantity interval, and a fourth preset level and a corresponding fourth quantity interval; For each of the blocks, based on the number of graphics elements corresponding to the block, a target preset level is determined among the first preset level, the second preset level, the third preset level and the fourth preset level as the load level corresponding to the block; the target preset level is a preset level corresponding to the number interval into which the number of graphics elements corresponding to the block falls.

14. The method according to claim 13, wherein: The step of transmitting the load level corresponding to each of the tiles to the backend of the TBR architecture comprises: Encoding the load level corresponding to each of the tiles through the front end of the TBR architecture to obtain a two-bit encoding value; Writing the two-bit encoding value corresponding to each of the tiles into the reserved bit in the tile header information of the tile information of each of the tiles; For each of the tiles, the tile header information of the tile information of the tile is read from the system memory through the back-end part of the TBR architecture, and the encoded value of the two bits of the reserved bits in the tile header information is decoded to obtain the load level corresponding to the tile.

15. A tile distribution device, applied to a graphics processor including at least two processor cores, wherein the graphics processor performs a tile distribution process based on a tile rendering TBR architecture, the device comprising: A front end part is configured to determine a load level corresponding to each of the plurality of tiles; The load level is used to characterize the number of primitives present in the tile; The front-end part is configured to transmit the load level corresponding to each of the tiles to the back-end part of the TBR architecture; The back-end part is configured to determine, for each of the tiles, a target processor core corresponding to the tile from the at least two processor cores based on a status indicator corresponding to each of the processor cores in the status indicator group corresponding to the tile; The arrangement order of the status indicators of the status indicator group corresponding to the block is related to the load level of the block.

16. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 14 when executing the program.

17. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method according to any one of claims 1 to 14 when executed by a processor.

18. A computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Graphics processing units and methods using render progression checks

    CN112017102A

  • Parallel processing method and device of graph assembly line and readable storage medium

    CN114463160A

  • Image block distribution method and device, equipment and storage medium

    CN116188244A

  • Dynamic load balancing apparatus and method for graphic processing unit (GPU)

    US20130293546A1

  • Graphics processing units and methods using cost indications for sets of tiles of a rendering space

    US20180197271A1

Cited By

  • Task allocation method and device, electronic equipment and storage medium

    CN120523611A

  • Chip element task processing method and device, equipment, storage medium and program product

    CN120823089A