Graphics processor, tile processing method and electronic device
By using a time-division multiplexed collection unit in the graphics processor to determine the initial identification information, the inefficiency caused by empty tiles in primitive screen mapping is solved, achieving efficient primitive screen mapping and low-power rendering, which is particularly suitable for sparse primitive sets.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MOORE THREADS TECH CO LTD
- Filing Date
- 2026-06-01
- Publication Date
- 2026-07-03
AI Technical Summary
In graphics processors, the existence of empty tiles (tiles not covered by primitives) in the existing technology leads to low efficiency and long latency in primitive screen mapping processing, especially when primitives are sparsely distributed.
The time-division multiplexing collection unit determines the initial identification information while collecting graphic elements. By reusing one-time hardware resources for graphic element reception, it accurately indicates whether the graphic block is covered, avoids traversing row by row and column by column, and improves the efficiency of graphic element screen mapping.
It improves the efficiency of primitive screen mapping processing, reduces latency, reduces global memory access frequency and memory bandwidth consumption, and reduces GPU power consumption. It is suitable for primitive sets with sparse primitive distribution.
Smart Images

Figure CN122335523A_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of graphics processing technology, and in particular to a graphics processor, a tile processing method, and an electronic device. Background Technology
[0002] Graphics Processing Units (GPUs) that use a tile-based rendering (TBR) architecture require primitive screen mapping before rendering.
[0003] In related technologies, there may be some empty tiles (i.e., tiles not covered by primitives) among all the tiles in the entire screen. For example, there may be empty rows (i.e., all tiles in the row are empty tiles) or empty columns (i.e., all tiles in the column are empty tiles). If the subsequent tiles are traversed by traversing each tile one by one, or by traversing a row of tiles and a column of tiles based on the identification information collected, there are problems such as low processing efficiency and high latency. Summary of the Invention
[0004] This application provides a graphics processor, a tile processing method, and an electronic device.
[0005] The technical solution of this application embodiment is implemented as follows: This application provides a graphics processor, including: The collection unit is used to jointly determine the initial identification information corresponding to the current screen based on the current primitive set received in time-division multiple times over at least two clock cycles; wherein the current screen is divided into multiple tiles, the multiple tiles include at least two rows of tiles and at least two columns of tiles, and the initial identification information is used to indicate whether each row of tiles in the at least two rows of tiles is covered by primitives in the current primitive set and / or to indicate whether each column of tiles in the at least two columns of tiles is covered by primitives in the current primitive set; The processing unit is used to perform mapping processing between the current primitive set and the current screen based on the initial identification information.
[0006] This application provides a tile processing method applied in a graphics processor. The tile processing method includes: Based on the current primitive set received in time-division multiple times over at least two clock cycles, the initial identification information corresponding to the current screen is jointly determined; wherein, the current screen is divided into multiple tiles, the multiple tiles include at least two rows of tiles and at least two columns of tiles, and the initial identification information is used to indicate whether each row of tiles in the at least two rows of tiles is covered by primitives in the current primitive set and / or to indicate whether each column of tiles in the at least two columns of tiles is covered by primitives in the current primitive set; Based on the initial identification information, perform mapping processing between the current primitive set and the current screen.
[0007] This application provides an electronic device including the aforementioned graphics processor.
[0008] The embodiments of this application have the following beneficial effects: On the one hand, the time-division multiplexing collection unit determines the initial identification information while collecting graphic elements. In other words, the collection unit uses the delay of the input data to complete the collection of the initial identification information. Moreover, by reusing the hardware resources of one clock cycle to receive graphic elements in multiple clock cycles, compared with receiving all graphic elements in one clock cycle, it not only reduces resource consumption but also reduces timing risks, and has the advantages of being resource-friendly and timing-friendly. On the other hand, the processing unit performs subsequent primitive screen mapping based on the pre-determined initial identification information. Since the initial identification information can accurately indicate whether each row and / or column of tiles is covered by primitives in the current primitive set, the traversal of empty rows and columns can be quickly skipped. In other words, this application does not require traversing row by row and column by column, nor does it require traversing a row and column of tiles first to collect identification information. Therefore, this application greatly improves the acceleration of the primitive screen mapping process, improves the processing efficiency of primitive screen mapping, and reduces latency. It is especially suitable for primitive sets with sparse primitive distribution. This not only speeds up the transition from vertex processing to rasterization and improves the overall rendering throughput, but also reduces the frequency of global memory access, reduces memory bandwidth consumption and invalid computation, and thus significantly reduces the power consumption of the GPU. Attached Figure Description
[0009] Figure 1 A schematic diagram of a typical TBR pipeline process provided for an embodiment of this application; Figure 2 A schematic diagram of the composition structure of a graphics processor provided in an embodiment of this application; Figure 3 A schematic diagram of a screen provided for an embodiment of this application; Figure 4 A schematic diagram of a graphic element provided in an embodiment of this application; Figure 5 A schematic diagram of the implementation process of a block processing method provided in this application embodiment. Figure 1 ; Figure 6 This application provides an illustration of tile traversal in a related art. Figure 1 ; Figure 7 This application provides an illustration of tile traversal in a related art. Figure 2 ; Figure 8This is a schematic diagram of a tile traversal provided in an embodiment of this application; Figure 9 A schematic diagram of the composition structure of a collection unit provided in an embodiment of this application; Figure 10 A schematic diagram of the implementation process of a block processing method provided in this application embodiment. Figure 2 .
[0010] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] In the following description, references are made to “some embodiments,” which 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.
[0013] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0014] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0015] TBR is a process that subdivides a computer graphics image into a regular grid in optical space and renders each part of the grid or tile separately. The advantage of this design is that it reduces memory and bandwidth consumption compared to Immediate Mode Rendering (IMR), which renders the entire frame immediately. This makes TBR widely used in low-power hardware devices. Figure 1 A schematic diagram of a typical TBR pipeline process provided in this disclosure embodiment is shown below. Figure 1As shown, the TBR pipeline process is divided into front-end module 110 (also known as the geometry stage) and back-end module 120 (also known as the 3D stage), wherein: The front-end module 110 includes a vertex processing module, a graphics processing module, and a tile module. The vertex processing module is used to perform vertex and primitive transformations on the graphics data 150. The graphics processing module is used to perform primitive culling, clipping, and other processing. The tile module is used to complete the screen segmentation, record the graphics data covered by the tiles, and write the generated information such as the primitive list and vertex data into the system memory 130. The primitive list is a fixed-length array of length tile. Each element in the array is a linked list that stores pointers to all triangles that intersect with the current tile. The pointers point to the vertex data. The vertex data stores vertex and vertex attribute data.
[0016] The backend module 120 includes a rasterization module, a hidden surface removal (HSR) module, a pixel shading module, and an output merging module. The rasterization module is used to convert primitives into a two-dimensional image. Each point in the two-dimensional image contains color, depth, and texture data. This point and its related information are called a fragment. The HSR module is used to remove occluded triangles. The pixel texture shading module is used to shading pixels. The output merging module is used to merge multiple patches and output them to the RT.
[0017] For each tile, since its data volume is small, the required depth data, texture data, and color data can be loaded into the GPU's on-chip static random-access memory (SRAM), i.e., on-chip memory 140. For example, the hidden surface removal module can store depth data in the depth buffer in on-chip memory 140, the pixel shading module can store texture data in the texture buffer in on-chip memory 140, and the output merging module can store color data in the color buffer in on-chip memory 140.
[0018] In the rendering process, the on-chip memory 140 can hold all the data for a single tile. After at least one drawing instruction reaches the GPU, the front-end module 110 processes each drawing instruction sequentially and stores the corresponding tile 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 module 120 then reads the corresponding vertex information from the system memory 130 on a tile-by-tile basis and performs subsequent processing. Thus, by changing the back-end module 120's access to the system memory 130 to its access to the on-chip memory 140, rendering efficiency can be improved.
[0019] In TBR architecture GPUs, primitive screen mapping is required before graphics rendering. Primitive screen mapping is the final step in the geometry stage of the GPU rendering pipeline. It is responsible for transforming and projecting vertex coordinates from clip space to screen space, determining the specific position of primitives (such as triangles, line segments, etc.) on screen pixels, and providing basic data for the subsequent rasterization stage.
[0020] In related technologies, due to storage space limitations, primitive screen mapping processing divides the screen into multiple rows and columns of tiles. It requires identifying which tiles are covered by which primitives within the primitive set to complete the primitive screen mapping process. When some tiles are not covered by primitives (e.g., empty rows or columns), traversing all tiles within the screen range row by row and column by column, or using the identifiers obtained from traversing the first row and column first, results in processing many empty tiles. This inefficient traversal process leads to a long processing time and significant latency in finding all tiles covered by primitives.
[0021] This application provides a graphics processor that, on the one hand, uses a time-division multiplexing collection unit to determine initial identification information while collecting graphics elements. In other words, the collection unit uses the delay of the input data to complete the collection of initial identification information, and by reusing one block of hardware resources to receive graphics elements in multiple blocks, compared with receiving all graphics elements in one block, it not only reduces resource consumption, but also reduces timing risks, and has the advantages of being resource-friendly and timing-friendly. On the other hand, the processing unit performs subsequent primitive screen mapping based on the pre-determined initial identification information. Since the initial identification information can accurately indicate whether each row and / or column of tiles is covered by primitives in the current primitive set, the traversal of empty rows and columns can be quickly skipped. In other words, this application does not require traversing row by row and column by column, nor does it require traversing a row and column of tiles first to collect identification information. Therefore, this application greatly improves the acceleration of the primitive screen mapping process, improves the processing efficiency of primitive screen mapping, and reduces latency. It is especially suitable for primitive sets with sparse primitive distribution. This not only speeds up the transition from vertex processing to rasterization and improves the overall rendering throughput, but also reduces the frequency of global memory access, reduces memory bandwidth consumption and invalid computation, and thus significantly reduces the power consumption of the GPU.
[0022] The technical solutions in the embodiments of this application will now be clearly and completely described with reference to the accompanying drawings.
[0023] Figure 2 This is a schematic diagram of the composition structure of a graphics processor provided in an embodiment of this application, such as... Figure 2 As shown, the graphics processor 20 includes a collection unit 21 and a processing unit 22, wherein: The collection unit 21 is used to jointly determine the initial identification information corresponding to the current screen based on the current primitive set received in time-division multiple times over at least two clock cycles; wherein the current screen is divided into multiple tiles, the multiple tiles include at least two rows of tiles and at least two columns of tiles, and the initial identification information is used to indicate whether each row of tiles in the at least two rows of tiles is covered by primitives in the current primitive set and / or to indicate whether each column of tiles in the at least two columns of tiles is covered by primitives in the current primitive set; The processing unit 22 is used to perform mapping processing between the current primitive set and the current screen based on the initial identification information.
[0024] Here, the collection unit can be any suitable hardware unit capable of implementing this function, such as digital circuits, analog circuits, or mixed-signal circuits. In some implementations, the collection unit may include at least a collection circuit, an OR gate, or a flip-flop (such as a D flip-flop). The collection circuit is mainly used to determine the identification information corresponding to one clock cycle (or clock tick). A clock cycle refers to one complete oscillation cycle of the GPU core clock signal, which is the most basic time unit for GPU operation. The processing unit can be any suitable hardware unit capable of implementing this function, such as digital circuits, analog circuits, or mixed-signal circuits.
[0025] The current primitive set can include the primitives received in each clock cycle. Primitives are the basic units that make up a graphic, representing the smallest graphic element that can be manipulated independently, such as points, lines, surfaces, rectangles, circles, etc. In implementation, this collection unit can receive N (a positive integer) primitives in one clock cycle, that is, the collection unit can receive primitives at a rate of N. It can be understood that the current primitive set can be the primitive set of the image to be rendered. The current primitive set can be a sparsely distributed primitive set or a non-sparsely distributed primitive set.
[0026] The current screen refers to the screen corresponding to the image to be rendered. The current screen can be the initial screen or a processed version of the initial screen. In practice, the current screen is no larger than the initial screen. It is understood that different images to be rendered can correspond to the same or different current screens.
[0027] The initial screen refers to the screen displaying the image to be rendered. During implementation, the initial screen can be divided according to a partitioning strategy to obtain multiple tiles. The partitioning strategy can include, but is not limited to, partitioning method, partition length, and number of partitions. The partitioning method can include, but is not limited to, uniform partitioning, random partitioning, and non-uniform partitioning. For example, the initial screen can be uniformly divided into 5*10 tiles. Another example is dividing the initial screen according to any suitable preset size (e.g., 16*16, 32*32, etc.) to obtain multiple tiles.
[0028] The current screen can be determined in any suitable way. For example, it can be a custom current screen or the default screen can be used. Another example is determining the current screen in real-time based on the current primitive set. Figure 3 As shown, the initial screen 31 is divided into 7 rows * 12 columns of tiles, while the current screen 32 only includes 5 rows * 8 columns of tiles.
[0029] In some implementations, the processing unit 22 is also used to use the initial screen as the current screen. In practice, the initial screen may not be processed in any way (e.g., zoomed out), and it can be directly used as the current screen. This ensures the accuracy of the current screen while reducing the computational load of determining the current screen, thereby reducing hardware consumption.
[0030] In some implementations, the processing unit 22 is also configured to determine the current screen based on the current primitive set.
[0031] Here, the current screen can be the same as or smaller than the initial screen. In some implementations, the current screen can be initially set as the initial screen and then dynamically updated based on the current primitive set. Different primitive sets can determine the same or different current screens.
[0032] The current screen can be determined in any suitable way. In some implementations, the current screen can be determined based on the position information of each element in the current primitive set. The position information of the elements can include the coordinates of each vertex in the element. In some implementations, the minimum and maximum elements can be determined based on the coordinates of each vertex of each element, with the tile covered by the smallest vertex of the minimum element being taken as the minimum tile, and the tile covered by the largest vertex of the maximum element being taken as the maximum tile. In some implementations, the minimum and maximum tiles can be determined based on the coordinates of each vertex of each element and the coordinates of each tile. In practice, the area formed by the minimum and maximum tiles is taken as the current screen, with the minimum and maximum tiles being the two vertex tiles of that area. It is understood that when the origin of the coordinate system is in the upper left corner, the minimum tile usually refers to the tile in the upper left corner of the area, and the maximum tile usually refers to the tile in the lower right corner of the area.
[0033] In this embodiment, the current screen is dynamically determined based on the current primitive set, which narrows the traversal range and further improves the processing efficiency of primitive screen mapping while shortening the processing time.
[0034] Initial identification information may include, but is not limited to, at least one of the following: initial row identification information (init_row_mask), initial column identification information (init_col_mask).
[0035] `init_row_mask` is used to indicate whether each row of tiles in at least two rows of tiles in the current screen is covered by tiles in the current primitive set. `init_row_mask` can include at least two row identifiers, which indicate whether the corresponding row of tiles is covered by tiles in the current primitive set. The number of row identifiers is not less than the number of rows in the current screen and not greater than the number of rows in the initial screen. `init_col_mask` is used to indicate whether each column of tiles in at least two columns of tiles in the current screen is covered by tiles in the current primitive set. `init_col_mask` can include at least two column identifiers, which indicate whether the corresponding column of tiles is covered by tiles in the current primitive set. The number of column identifiers is not less than the number of columns in the current screen and not greater than the number of columns in the initial screen.
[0036] like Figure 4 As shown, the number of bits in `init_row_mask` can be no less than 5 bits and no more than 7 bits, and the number of bits in `init_col_mask` can be no less than 8 bits and no more than 12 bits. The current primitive set 43 includes primitives 431, 432, and 433. Primitive 431 is located within tile (1, 8) of the current screen 42, primitive 432 is located within tile (5, 1) of the current screen 42, and primitive 433 is located within tile (5, 7) of the current screen 42. Therefore: The `init_row_mask` can be 10001 and the `init_col_mask` can be 10000011; or, the `init_row_mask` can be 0100010 and the `init_col_mask` can be 010000011000. Here, 1 indicates that a row or column is covered by a primitive, and 0 indicates that a row or column is not covered by a primitive. In implementation, those skilled in the art can also choose any other suitable representation to indicate whether it is covered by a primitive, such as F and T, and this application embodiment does not limit this. It is understood that the representations of `init_row_mask` and `init_col_mask` can be the same or different.
[0037] In some implementations, the number of bits in `init_row_mask` can be the number of rows in the current screen, and the number of bits in `init_col_mask` can be the number of columns in the current screen. This reduces the number of bits in the identifier, thereby reducing storage requirements and optimizing hardware resources.
[0038] The initial identification information can be determined in any suitable manner. In some embodiments, the initial identification information can be determined based on the identification information corresponding to each clock cycle, where the identification information corresponding to each clock cycle is determined based on the received graphical elements. In some embodiments, the initial identification information can be determined based on the identification information corresponding to the last clock cycle; for example, the identification information corresponding to the last clock cycle can be used as the initial identification information. It is understood that the identification information corresponding to the last clock cycle can be determined based on the identification information corresponding to previous clock cycles.
[0039] In some implementations, the collection unit can determine only the `init_row_mask` while receiving primitives. In this case, the `init_col_mask` can be determined in real-time during subsequent traversal. For example, the `init_col_mask` can be obtained after traversing the first row of primitives.
[0040] In some implementations, the collection unit can determine only the init_col_mask while receiving primitives. In this case, the init_row_mask can be determined in real time during subsequent traversal. For example, the init_row_mask can be obtained after traversing the first column of primitives.
[0041] In some implementations, the collection unit can determine init_row_mask and init_col_mask while receiving primitives.
[0042] In some implementations, init_row_mask and init_col_mask can be represented separately, or they can be concatenated using any suitable concatenation operator, placeholder, or other appropriate concatenation method. For example, the initial identifier information can be 10001+10000001.
[0043] The mapping process includes determining a subset of primitives corresponding to a target tile. The target tile can be any tile on the current screen, and there can be at least one target tile.
[0044] In some implementations, the target tile includes at least an initial tile (or a first tile). The initial tile may be the tile corresponding to the starting point of the primitive screen mapping traversal. In some implementations, the initial tile may be a preset tile, for example, the tile in the upper left corner of the initial screen or the current screen may be used as the initial tile. In some implementations, the initial tile may be determined in real time based on initial identification information. For example, the tile located in the row corresponding to the least significant bit (LSB) and in the column corresponding to the LSB may be used as the initial tile. The row corresponding to the LSB is found from init_row__mask, and the column corresponding to the LSB is found from init_col_mask. In implementation, those skilled in the art can independently set the method for determining the initial tile according to actual needs, and the embodiments of this application do not limit this.
[0045] In some implementations, the target tile may also include other tiles besides the initial tile. These other tiles may or may not be adjacent to the initial tile. There may be at least one other tile. The other tiles are tiles located in the target row and target column. The target row containing the other tiles may be the same as or different from the row containing the initial tile. The target row may be at least one row above, at least one row below, or the row containing the initial tile. The target column containing the other tiles may be the same as or different from the column containing the initial tile. The target column may be at least one column before, at least one column after, or the column containing the initial tile. The determination of other tiles can be any suitable method. In some implementations, other tiles can be determined based on current identification information, which is determined based on the initial identification information. In some implementations, other tiles can be determined based on the initial identification information and the current traversal method. This traversal method may include, but is not limited to, row traversal and column traversal. During implementation, this traversal method may remain constant or change dynamically during the mapping process.
[0046] The subset of primitives corresponding to the target tile can be empty or include at least one tile from the current primitive set. It is understood that the target tile can be a tile not covered by primitives, or a tile covered by at least one primitive. In implementation, traversal of empty tiles should be minimized as much as possible.
[0047] The subset of primitives corresponding to the target tile can be determined in any suitable way. In some implementations, the subset of primitives corresponding to the target tile can be determined based on the position information of each primitive and the position information of the target tile. The position information of a primitive can refer to the vertex information of the primitive, which can characterize the coverage area of the primitive. For example, bounding box calculations can be performed on each primitive to determine whether it intersects with the target tile. Alternatively, equations for each edge of the primitive can be established based on the vertex information of the primitive, and the equations of each edge can be used to determine whether a pixel within the target tile is located inside the primitive.
[0048] In this embodiment, on the one hand, the time-division multiplexing collection unit determines the initial identification information while collecting graphic elements. That is, the collection unit uses the delay of the input data to complete the collection of the initial identification information, and by reusing the hardware resources of one clock cycle to receive graphic elements in multiple clock cycles, compared with receiving all graphic elements in one clock cycle, it not only reduces resource consumption, but also reduces timing risks, and has the advantages of being resource-friendly and timing-friendly. On the other hand, the processing unit performs subsequent primitive screen mapping based on the pre-determined initial identification information. Since the initial identification information can accurately indicate whether each row and / or column of tiles is covered by primitives in the current primitive set, the traversal of empty rows and columns can be quickly skipped. In other words, this application does not require traversing row by row and column by column, nor does it require traversing a row and column of tiles first to collect identification information. Therefore, this application greatly improves the acceleration of the primitive screen mapping process, improves the processing efficiency of primitive screen mapping, and reduces latency. It is especially suitable for primitive sets with sparse primitive distribution. This not only speeds up the transition from vertex processing to rasterization and improves the overall rendering throughput, but also reduces the frequency of global memory access, reduces memory bandwidth consumption and invalid computation, and thus significantly reduces the power consumption of the GPU.
[0049] In some implementations, the current primitive set includes primitives received in each clock cycle; the collection unit 21 is used to determine the identification information corresponding to the clock cycle based on the primitives received in the clock cycle for each clock cycle; and to determine the initial identification information based on the identification information corresponding to the last clock cycle.
[0050] Here, the current primitive set can be collected in at least one clock cycle. It is understood that the first quantity can be greater than, equal to, or less than the second quantity, where the first quantity is the number of primitives included in the current primitive set, and the second quantity is the number of primitives that the collection unit can receive in one clock cycle. In implementation, when the first quantity is not greater than the second quantity, the collection of the current primitive set can be completed in just one clock cycle; when the first quantity is greater than the second quantity, then M (first quantity / second quantity) clock cycles are needed to receive the first quantity of primitives.
[0051] The third quantity (i.e., the number of primitives actually received within one clock cycle) is no greater than the second quantity. It can be understood that the third quantity is a positive integer, meaning that at least one primitive can be received within one clock cycle.
[0052] The identifier information corresponding to each clock cycle can be the same or different. The number of bits in the identifier information corresponding to this clock cycle can be the same or different from the initial identifier information. For example, the number of bits in the identifier information corresponding to the clock cycle may be adapted to the initial screen, and the number of bits in the initial identifier information may be adapted to the current screen. For example, in... Figure 3 In the screen shown, the identification information corresponding to the clock cycle can be 19 bits (7 bits per row + 12 bits per column), while the initial identification information can be either 19 bits or 13 bits (5 bits per row + 8 bits per column). In some embodiments, the identification information corresponding to the clock cycle may include row identification information and / or column identification information. The row identification information is used to indicate whether each row of tiles in the initial screen is covered by the primitives received in that clock cycle, and the column identification information is used to indicate whether each column of tiles in the initial screen is covered by the primitives received in that clock cycle.
[0053] The identification information corresponding to this clock cycle can be determined in any suitable way. In some embodiments, the identification information corresponding to this clock cycle can be determined based on the coordinates of the graphic elements received in this clock cycle. In some embodiments, the identification information corresponding to this clock cycle can be determined based on the coordinates of the graphic elements received in this clock cycle and the identification information corresponding to the previous clock cycle.
[0054] The identification information corresponding to the last clock cycle can be determined in any suitable way. In some implementations, the identification information corresponding to all cycles can be ORed to obtain the identification information corresponding to the last clock cycle. In some implementations, the identification information corresponding to the last clock cycle can be obtained by performing an OR operation on each cycle.
[0055] The method for determining this initial identification information can be any suitable method.
[0056] In some implementations, the identification information corresponding to the last clock cycle can be directly used as the initial identification information, in which case the number of bits of the initial identification information is the same as the number of bits of the identification information corresponding to the clock cycle.
[0057] In some implementations, the identifier information corresponding to the last clock cycle can be reduced to obtain the initial identifier information. In this case, the number of bits in the initial identifier information is no greater than the number of bits in the identifier information corresponding to the last clock cycle. Reduction processing refers to removing some empty rows and / or some empty columns from the identifier information corresponding to the last clock cycle, i.e., removing invalid bits before the first valid bit and / or invalid bits after the last valid bit. Valid bits refer to the bits of valid identifiers, and invalid bits refer to the bits of invalid identifiers. For example, if the identifier information corresponding to the last clock cycle is 0100010 and 001111000, where 1 represents a valid identifier and 0 represents an invalid identifier, then after reduction processing, "0100010" can be "10001", "0100001", or "100010", and "001111000" can be "1111", "001111", or "1111000".
[0058] It is understandable that the representation of the identification information corresponding to the clock cycle can be the same as or different from the representation of the initial identification information. For example, the representation of the identification information corresponding to the clock cycle can be F (not covered by primitives) and T (covered by primitives), while the representation of the initial identification information can be 1 (covered by primitives) and 0 (not covered by primitives).
[0059] In this embodiment, on the one hand, the collection unit determines the identification information of a single frame based on the primitives received within the frame, and completes the collection of the identification information of the single frame during the delay of reusing the input data of the single frame. This time-dimensional hardware reuse policy can better balance the load, reduce contention, and improve processing efficiency and resource utilization. On the other hand, the initial identification information is determined based on the identification information corresponding to the last frame, which improves the flexibility and accuracy of the initial identification information.
[0060] In some implementations, the collection unit 21 is configured to determine the identification information corresponding to the clock cycle based on the coordinates of the graphic elements received in the clock cycle when the clock cycle is the first clock cycle; and to determine the identification information corresponding to the clock cycle based on the coordinates of the graphic elements received in the clock cycle and the identification information corresponding to the previous clock cycle when the clock cycle is any other clock cycle besides the first clock cycle.
[0061] Here, for the first clock cycle, since there is no previous clock cycle, the corresponding identification information can be determined directly based on the coordinates of the primitives received in the clock cycle.
[0062] The identification information corresponding to the clock cycle can be determined in any suitable way.
[0063] In some implementations, the identification information corresponding to all primitives within a single clock cycle can be ORed to obtain the identification information corresponding to the clock cycle. The number of bits in the identification information corresponding to a primitive can be the same as the number of bits in the identification information corresponding to the clock cycle. The number of bits in the identification information corresponding to a primitive is determined based on the coordinates of the primitive.
[0064] In some implementations, the identifier information corresponding to the graphic element can be determined based on the coordinates of the graphic element and the identifier information corresponding to the previous graphic element. In other words, the identifier information corresponding to the clock cycle can be obtained by performing an OR operation on each graphic element.
[0065] In some implementations, the coordinates of a graphic element can be compared with the coordinate range of each block to determine the block covered by the graphic element. The row identifier corresponding to the row containing the covered block and the column identifier corresponding to the column containing the covered block are both set to the first identifier. It is understood that if the row identifier corresponding to the row containing the block is the first identifier, then the first identifier can remain unchanged; if the row identifier corresponding to the row containing the block is the second identifier, then the second identifier can be set to the first identifier. The first identifier can be any suitable identifier representing that the graphic element is covered, such as "1", "T", etc. The first identifier can also be called the valid identifier. The second identifier differs from the first identifier. The second identifier can be any suitable identifier representing that the graphic element is not covered, such as "0", "-1", "F", etc. The second identifier can also be called the invalid identifier.
[0066] In some implementations, to shorten the comparison time, the coverage area of a primitive can be determined first based on its vertices. This coverage area can include both horizontal and vertical coordinate coverage. Then, the coverage area of the primitive is compared with the coordinate ranges of each block to determine whether the primitive covers the block. For example, if the coordinates of the three vertices of a primitive are (10, 20), (30, 50), and (40, 15), then the horizontal coordinate coverage area of the primitive's vertices is 10 < horizontal coordinate < 40, and the vertical coordinate coverage area is 15 < vertical coordinate < 50. In practice, if at least one pixel within the coverage area of a primitive is located within the coordinate range of a block, then the block is determined to be covered by the primitive.
[0067] For other clock cycles, the corresponding identifier information can be determined based on the coordinates of the primitives received in the current clock cycle and the identifier information from the previous clock cycle. In other words, the identifier information can be initially determined based on the coordinates of the primitives received in the current clock cycle, and then updated based on the identifier information from the previous clock cycle to obtain the final identifier information. For example, performing an OR operation between the identifier information from the previous clock cycle and the initially determined identifier information yields the final identifier information. For instance, if the initially determined identifier information is 010001 (row identifier information) and 1000010 (column identifier information), and the identifier information from the previous clock cycle is 110000 (row identifier information) and 0000010 (column identifier information), then the final identifier information could be 110001 (OR operation between 010001 and 110000) and 1000010 (OR operation between 1000010 and 0000010).
[0068] In this embodiment, the identification information corresponding to the current time step is determined based on the primitive received at the current time step, thereby binding primitive processing to the clock cycle, realizing pipeline-level synchronization and load balancing, and thus improving the efficiency of the GPU.
[0069] In some implementations, the identification information corresponding to the clock cycle includes row identification information and column identification information. The row identification information includes the row identifier of each row of at least two rows of tiles, which is used to indicate whether the corresponding row of tiles is covered by a primitive. The initial column identification information includes the column identifier of each column of at least two columns of tiles, which is used to indicate whether the corresponding column of tiles is covered by a primitive. The coordinates of the primitive include the row coordinates of the primitive and the column coordinates of the primitive. The collection unit 21 is used to set the row identifier corresponding to the row coordinates of the primitive in the row identification information as a first identifier and to set the column identifier corresponding to the column coordinates of the primitive in the column identification information as a first identifier.
[0070] Here, the row coordinates of a primitive include the row coordinates of its vertices, and the column coordinates of a primitive include the column coordinates of its vertices. A primitive can cover at least one set of tiles. In implementation, the row coordinates of each vertex of the primitive are compared with the row coordinate range of each tile, and the column coordinates of each vertex of the primitive are compared with the column coordinate range of each tile to determine the tile to which each vertex belongs. Therefore, the row and column identifiers corresponding to the tile are both set to the first identifier. For example, in... Figure 4 Since the coordinates of each vertex of primitive 431 are all located within the block (1,8), the row identifier and column identifier corresponding to the block (1,8) can be set to the first identifier, that is: the row identifier corresponding to the first row and the column identifier corresponding to the eighth column can be set to the first identifier.
[0071] In some implementations, the identifier information corresponding to the clock cycle can be initialized as a second identifier, and then updated in real time according to the coordinates of the graphic element.
[0072] In this embodiment, the identification information is reset based on the row and column coordinates of the graphic element, thereby improving the accuracy of the identification information.
[0073] In some implementations, the mapping process includes determining at least one subset of primitives corresponding to a target tile, where the target tile is one of a plurality of tiles; and processing unit 22 is configured to determine the target tile based on initial identification information and to determine the subset of primitives corresponding to the target tile based on the current primitive set.
[0074] Here, the number of target tiles can be at least one. A target tile includes at least the initial tile. For example, the target tile may only include the initial tile. Alternatively, the target tile may include the initial tile and at least one other tile, where the other tile is a tile different from the initial tile.
[0075] The target tile can be determined in any suitable way.
[0076] In some implementations, the initial tile can be a preset tile or determined based on initial identification information. For example, the smallest tile (xmin, ymin) can be used as the initial tile, where xmin represents the smallest column of the current screen and ymin represents the smallest row of the current screen.
[0077] In some implementations, for non-initial blocks, the target block can be determined based on the current identification information, which is determined based on the initial identification information.
[0078] In some implementations, the target tile can be determined based on initial identification information.
[0079] For example, the valid bits in the initial row identifier information can be combined with the valid bits in the initial column identifier information to obtain a tile sequence (including at least one target tile). Target tiles are then selected sequentially according to the order of the target tiles in the tile sequence. For instance, if the tile sequence includes {tile 1, tile 2, tile 3}, then tile 1 can be selected as the target tile first, followed by tile 2, and finally tile 3; alternatively, tile 3 can be selected as the target tile first, followed by tile 2, and finally tile 1.
[0080] For example, the target tile can be determined based on the initial identification information, the previous target tile, and traversal information. Traversal information may include, but is not limited to, traversal method and traversal direction. Traversal method may include, but is not limited to, row traversal and column traversal. Traversal direction may include, but is not limited to, left to right, right to left, top to bottom, bottom to top, and zigzag.
[0081] For example, if the initial identifier information is 10001 and 100101, meaning that rows 1 and 5 are covered by primitives, and columns 1, 4, and 6 are covered by primitives, then: If the traversal method is row traversal and the traversal direction is from left to right, then the tile located in the 1st row and 1st column (i.e., the initial tile) can be used as the target tile first, then the tile located in the 1st row and 4th column can be used as the target tile, then the tile located in the 1st row and 6th column can be used as the target tile, then the tile located in the 5th row and 1st column can be used as the target tile, then the tile located in the 5th row and 4th column can be used as the target tile, and finally the tile located in the 5th row and 6th column can be used as the target tile.
[0082] If the traversal method is column traversal and the traversal direction is from top to bottom, then the tile located in the 1st row and 1st column (i.e., the initial tile) can be used as the target tile first, then the tile located in the 5th row and 1st column can be used as the target tile, then the tile located in the 1st row and 4th column can be used as the target tile, then the tile located in the 5th row and 4th column can be used as the target tile, then the tile located in the 1st row and 6th column can be used as the target tile, and finally the tile located in the 5th row and 6th column can be used as the target tile.
[0083] The subset of primitives corresponding to the target tile is either empty or includes at least one primitive from the current primitive set. In some implementations, the subset of primitives corresponding to each target tile can be initially empty, and then updated based on the current primitive set. In some implementations, bounding box calculations can be performed on each primitive to determine whether it intersects with the target tile. If a bounding box overlaps with the target tile, that primitive is included as a primitive in the subset of primitives corresponding to the target tile. In some implementations, equations for each edge of a primitive can be established based on its vertex information, and the equations can be used to determine whether a pixel within the target tile is located inside the primitive. If a pixel within the target tile is located inside the primitive, that primitive is included as a primitive in the subset of primitives corresponding to the target tile.
[0084] In implementation, the target tile may or may not be the last tile. Therefore, after determining the subset of primitives corresponding to the target tile, we can first determine whether the target tile is the last tile. If it is the last tile, it indicates that the primitive screen mapping of the current screen is complete; if it is not the last tile, a new target tile needs to be determined, and this process is repeated until the last tile. It is understood that the last tile refers to the tile corresponding to the end point of the primitive screen mapping traversal. The last tile and the initial tile are different tiles. In some implementations, the last tile can be a tile located at a vertex of the current screen. For example, ... Figure 4 As shown, if primitive 433 is located in tile (5,8), then the last tile can be the tile (5,8) at the bottom right corner of the current screen 32. In some implementations, the last tile can be one where both the identifiers corresponding to the last row and column are valid; that is, the last tile does not have to be a tile located at a vertex of the current screen. For example, Figure 4 When primitive 433 is located in tile (5,7), although tile (5,7) is not located at the vertex of the current screen 32, tile (5,7) can still be regarded as the last tile. Therefore, the entire primitive screen mapping process does not necessarily have to be processed to the largest tile (xmax,ymax) before it ends. Here, xmax represents the largest column of the current screen and ymax represents the largest row of the current screen.
[0085] In this embodiment, on the one hand, each target tile is determined based on the initial identification information, reducing the possibility that the target tile is an empty tile, thereby facilitating the quick skipping of empty rows and columns, improving the processing efficiency of primitive mapping and shortening the processing time. On the other hand, a subset corresponding to the tile is determined based on the primitive set, quickly eliminating tiles not covered by primitives, laying the foundation for subsequent rasterization and pixel rendering, thereby improving the overall rendering efficiency.
[0086] In some implementations, the processing unit is configured to, when the target block is an initial block, use a preset block as the initial block, or determine the initial block based on initial identification information; when the target block is not an initial block, determine the target block based on current identification information, wherein the current identification information is determined based on the initial identification information.
[0087] Here, the preset tile can be any suitable tile. For example, a tile at a vertex (such as the top left corner, bottom right corner, bottom left corner, top right corner, etc.), a tile at the center, etc. For example, the tile at the bottom right corner of the initial screen or the current screen can be used as the initial tile.
[0088] The initial tile can be determined in any suitable way. In some implementations, the initial identifier information can be parsed to obtain the row corresponding to the LSB, the column corresponding to the LSB, the row corresponding to the MSB (Most Significant Bit), and the column corresponding to the MSB. Then, the initial tile can be determined based on the row and column corresponding to the LSB / MSB. For example, the tile located in the row and column corresponding to the LSB can be used as the initial tile. Another example is using the tile located in the row and column corresponding to the MSB. Yet another example is using the tile located in the row and column corresponding to the MSB.
[0089] The current identification information can be updated in real time. In implementation, the current identification information can be initialized to initial identification information and updated in real time during the mapping process. In some embodiments, the current identification information may include, but is not limited to, at least one of tile identification information, screen identification information, etc. Tile identification information is used to indicate whether each row of tiles in at least two rows needs to be traversed and / or to indicate whether each column of tiles in at least two columns needs to be traversed. Screen identification information is used to indicate whether each tile in a row of tiles needs to be traversed and / or to indicate whether each tile in a column of tiles needs to be traversed.
[0090] The target tile can be determined in any suitable way.
[0091] In some implementations, the target row and target column can be determined first based on the tile identifier information and the screen identifier information, and then the tile located in the target row and the target column can be used as the target tile.
[0092] In some implementations, the target tile to be processed can be determined based on the current identification information, the previous target tile, and traversal information.
[0093] For example, when the current traversal method is row traversal, the current identifier information can be used to determine whether the previous target tile is the last tile in the current row. If it is not the last tile in the current row, a tile in the same row as the previous target tile (i.e., both the row and column identifiers are valid) can be selected as the target tile based on the valid bits in the current identifier information. In this case, the target tile is in the same row as the previous target tile but in a different column. If it is the last tile in the current row, a tile in a different row from the previous target tile (i.e., both the row and column identifiers are valid) can be selected as the target tile based on the valid bits in the current identifier information. In this case, the target tile is in a different row from the previous target tile but can be in the same or different columns.
[0094] For example, when the current traversal method is column traversal, the current identifier information can be used to determine whether the previous target tile is the last tile in the column. If it is not the last tile in the column, a tile in the same column as the previous target tile (i.e., both the row and column identifiers are valid) can be selected as the target tile based on the valid bits in the current identifier information. In this case, the target tile is in the same column as the previous target tile but in a different row. If it is the last tile in the column, a tile in a different column than the previous target tile (i.e., both the row and column identifiers are valid) can be selected as the target tile based on the valid bits in the current identifier information. In this case, the target tile is in a different column than the previous target tile but can be in the same row or a different row.
[0095] In this embodiment, on the one hand, a preset tile is directly used as the initial tile, saving the time of dynamic determination and improving initialization efficiency. On the other hand, the initial tile is dynamically determined based on the initial identification information, reducing the possibility that the initial tile is an empty tile, thereby further accelerating the primitive screen mapping process. Furthermore, other tiles are dynamically determined based on the identification information to quickly skip empty rows and columns, thereby improving the processing efficiency of primitive mapping and shortening the processing time.
[0096] In some implementations, the current identification information includes tile identification information and screen identification information. The tile identification information is used to indicate whether each row of tiles in at least two rows of tiles needs to be traversed and / or to indicate whether each column of tiles in at least two columns of tiles needs to be traversed. The screen identification information is used to indicate whether each tile in a row of tiles needs to be traversed and / or to indicate whether each tile in a column of tiles needs to be traversed. The processing unit 22 is used to determine the target row and target column based on the tile identification information and the screen identification information. The tile located in the target row and the target column is taken as the target tile.
[0097] Here, the tile identification information may include, but is not limited to, at least one of the following: tile row identification information (row_mask) and tile column identification information (col_mask). `row_mask` indicates whether each row of tiles in at least two rows needs to be traversed. The number of bits in `row_mask` is the same as the number of bits in the initial row identification information. `col_mask` indicates whether each column of tiles in at least two columns needs to be traversed. The number of bits in `col_mask` is the same as the number of bits in the initial column identification information. In implementation, `row_mask` can be initialized to `init_row_mask`, and `col_mask` can be initialized to `init_col_mask`.
[0098] Screen identification information may include, but is not limited to, at least one of screen row identification information (vld_x_mask) and screen column identification information (vld_y_mask). vld_x_mask indicates whether each tile in a row needs to be traversed; the number of bits in vld_x_mask is the same as the number of bits in the initial column identification information. vld_y_mask indicates whether each tile in a column needs to be traversed; the number of bits in vld_y_mask is the same as the number of bits in the initial row identification information. In implementation, vld_x_mask can be initialized to init_col_mask, and vld_y_mask can be initialized to init_row_mask.
[0099] The target row can be at least one row above the row containing the previous target tile, at least one row below the current row, or the current row itself. For example, if the previous target tile is not the last valid tile in the row, then the target row is the row containing the previous target tile; if the previous target tile is the last valid tile in the row, then the target row is at least one row above / below the row containing the previous target tile.
[0100] The target row can be determined in any suitable way. In some implementations, the target row can be determined based on tile row identifier information or screen column identifier information, for example, the row corresponding to the LSB / MSB of row_mask or vld_y_mask can be used as the target row. In some implementations, the target row can be determined based on the current traversal method and the screen column identifier information. The current traversal method can be a fixed traversal method or a dynamically changing one.
[0101] The target column can be at least one column before the column containing the previous target tile, at least one column after the column containing the previous target tile, or the column containing the previous target tile. For example, if the previous target tile is not the last valid tile in the column, then the target column is the column containing the previous target tile; if the previous target tile is the last valid tile in the column, then the target column is at least one column before / after the column containing the previous target tile.
[0102] The target column can be determined in any suitable way. In some implementations, the target column can be determined based on tile column identifier information or screen row identifier information; for example, the column corresponding to the LSB / MSB of col_mask or vld_x_mask can be used as the target column. In some implementations, the target column can be determined based on the current traversal method and the screen row identifier information.
[0103] For example, in Figure 4In this example, `init_row_mask=10001` and `init_col_mask=10000011`. We can first initialize `row_mask` and `vld_y_mask` to 10001, and `col_mask` and `vld_x_mask` to 10000011. Then, during the mapping process, the target row can include row 1 and row 5, and the target column can include column 1, column 7, and column 8. For example, first use row 1 as the target row and column 1 as the target column; then use row 1 as the target row and column 7 as the target column; then use row 1 as the target row and column 8 as the target column; then use row 5 as the target row and column 1 as the target column; then use row 5 as the target row and column 7 as the target column; finally, use row 5 as the target row and column 8 as the target column. Therefore, it can be seen that this application only needs to traverse 6 tiles to complete the primitive screen mapping. Compared with the related technologies that require traversing 40 (5*8) tiles or 13 tiles (8 in the first row + 4 in the first column + 1 in the fifth row and eighth column), the number of traversals is greatly reduced, thereby further reducing the traversal time.
[0104] In this embodiment, the target row and target column are determined based on the tile identifier information and the screen identifier information, which improves the accuracy of the target row and column, thereby ensuring the accuracy and effectiveness of the tile screen mapping.
[0105] In some implementations, the tile identification information includes tile row identification information and tile column identification information, and the screen identification information includes screen row identification information and screen column identification information. The processing unit 22 is configured to determine the target row based on the tile row identification information or the screen column identification information when the current traversal method is row traversal, and to determine the target column based on the screen row identification information; and to determine the target row based on the screen column identification information when the current traversal method is column traversal, and to determine the target column based on the tile column identification information or the screen row identification information.
[0106] Here, the current traversal method can be either row-based or column-based. This traversal method can be dynamically changed. In some implementations, before performing mapping processing, the processing unit can also determine the traversal method based on the initial identifier information or the current screen. For example, if the number of digits in the initial row identifier information is much greater than the number of digits in the initial column identifier information, a row-based traversal method can be selected; if the number of digits in the initial row identifier information is much less than the number of digits in the initial column identifier information, a column-based traversal method can be selected; if the number of digits in the initial row identifier information is close to the number of digits in the initial column identifier information, either a row-based or column-based traversal method can be selected. Similarly, if the number of rows in the current screen is much greater than the number of columns, a row-based traversal method can be selected; if the number of rows in the current screen is much less than the number of columns, a column-based traversal method can be selected; if the number of rows in the current screen is close to the number of columns, either a row-based or column-based traversal method can be selected. This ensures the accuracy of the traversal method while improving its flexibility, thereby enhancing the processor's compatibility and versatility.
[0107] The target row can be determined in any suitable way. In some implementations, if the current traversal method is row traversal, the row corresponding to the LSB / MSB of row_mask or vld_y_mask can be used as the target row; if the current traversal method is column traversal, the column corresponding to the LSB / MSB of vld_y_mask can be used as the target row. For example, if the current traversal method is row traversal and row_mask=10001, then the first row can be used as the target row, or the fifth row can be used as the target row; if the current traversal method is row traversal and vld_y_mask=100111, then the first row can be used as the target row, or the sixth row can be used as the target row.
[0108] The target column can be determined in any suitable way. In some implementations, if the current traversal method is row traversal, the column corresponding to the LSB / MSB of vld_x_mask can be used as the target column; if the current traversal method is column traversal, the column corresponding to the LSB / MSB of col_mask or vld_x_mask can be used as the target column. For example, if vld_x_mask = 1010001, then the first column can be used as the target column, or the seventh column can be used as the target column.
[0109] In the embodiments of this application, a differentiated approach is adopted to determine the target row and column based on different traversal methods, thereby improving the efficiency and accuracy of the target row and column determination and achieving a balance between efficiency, accuracy and energy consumption.
[0110] In some implementations, the processing unit 22 is further configured to update the current identification information based on the coordinates of the target tile, and the updated current identification information is used to determine the next target tile.
[0111] Here, after determining the subset of primitives corresponding to the target tile, it is necessary to update the current identification information to ensure that subsequent traversals will not enter rows or columns without valid tiles.
[0112] The update of current identification information may include, but is not limited to, the update of tile identification information and the update of screen identification information.
[0113] Updating tile identifier information may include, but is not limited to, resetting the identifier of a row in the tile row identifier information or resetting the identifier of a column in the tile column identifier information. During implementation, after traversing a row and / or a column, the identifier corresponding to that row / column needs to be set to a second identifier to dynamically reduce the screen traversal range.
[0114] Updating screen identifier information can include, but is not limited to, resetting a row identifier of screen row identifier information, resetting a column identifier of screen column identifier information, or resetting the entire screen identifier information. During implementation, after traversing a row and / or a column, the screen identifier information needs to be reset to tile identifier information; after traversing a target tile (not a row and not a column), a row identifier of screen row identifier information or a column identifier of screen column identifier information needs to be reset.
[0115] The coordinates of the target tile may include, but are not limited to, the row coordinates and column coordinates of the target tile. The row coordinates of the target tile can be used to determine the column identifiers that need to be reset in the tile column identifier information and / or the row identifiers that need to be reset in the screen row identifier information. The column coordinates of the target tile can be used to determine the row identifiers that need to be reset in the tile row identifier information and / or the column identifiers that need to be reset in the screen column identifier information.
[0116] In some implementations, the processing unit 22 is configured to, when the target tile is the last tile in a row, set the row identifier in the tile row identifier information that matches the row coordinates of the target tile to a second identifier, reset the screen row identifier information to the updated tile column identifier information, and reset the screen column identifier information to the updated tile row identifier information.
[0117] Here, after traversing a row of tiles, the corresponding row identifier in the tile row identifier information needs to be reset to an invalid identifier. For example, in... Figure 4In the process, after traversing tile (1,8), the row identifier corresponding to row 1 in row_mask can be set to 0. During implementation, after traversing one row, a new row or column is traversed again; therefore, the screen identifier information needs to be reset to the new tile identifier information. By promptly setting the row identifier in the tile row identifier information to an invalid identifier, it ensures that subsequent traversals will not re-enter that row, effectively avoiding duplicate traversals and resource waste, reducing unnecessary computational overhead and memory access, and improving overall processing efficiency.
[0118] In some implementations, the processing unit 22 is configured to, when the target tile is the last tile in a column, set the column identifier in the tile column identifier information that matches the column coordinates of the target tile to a second identifier, reset the screen row identifier information to the updated tile column identifier information, and reset the screen column identifier information to the updated tile row identifier information.
[0119] Here, after traversing a column of tiles, the corresponding column identifier in the tile column identifier information needs to be reset to an invalid identifier. For example, in Figure 4 In the process, after traversing the tile (5,1), the row identifier corresponding to the first column in col_mask can be set to 0.
[0120] During implementation, after traversing one column, a new column or a new row is traversed again. Therefore, the screen identification information needs to be reset to the new tile identification information.
[0121] In this way, by promptly setting the column identifier in the tile column identifier information to an invalid identifier, it is ensured that subsequent traversals will not enter that column again, effectively avoiding repeated traversals and resource waste, reducing unnecessary computational overhead and memory access, and improving overall processing efficiency.
[0122] In some implementations, the processing unit 22 is configured to update the screen row identifier information or the screen column identifier information based on the current traversal method and the coordinates of the target tile when the target tile is not the last tile in a row and not the last tile in a column.
[0123] Here, if a row or column has not been traversed completely, it is necessary to continue traversing the current row or column.
[0124] The current traversal method can include, but is not limited to, row traversal and column traversal. During implementation, different traversal methods can update different objects. For example, if the current traversal method is row traversal, then the screen row identifier information is updated; if the current traversal method is column traversal, then the screen column identifier information is updated.
[0125] In this way, by updating the screen row or column identifier information in a timely manner, it is ensured that subsequent traversals will not re-enter tiles that have already been traversed, effectively avoiding repeated traversals and resource waste, reducing unnecessary computational overhead and memory access, and improving overall processing efficiency.
[0126] In some implementations, the processing unit 22 is configured to, when the current traversal mode is row traversal mode, set the row identifier of the screen row identifier information that matches the column coordinates of the target tile to the second identifier; and when the current traversal mode is column traversal mode, set the column identifier of the screen column identifier information that matches the row coordinates of the target tile to the second identifier.
[0127] Here, if traversing by row, after traversing a tile in a row (not the last tile), the row identifier that matches the column coordinates of that tile in `vld_x_mask` can be set to invalid. For example, in... Figure 4 In the middle, after traversing the tile (1,7), the row identifier in vld_x_mask that matches the 7th column can be set to 0, that is, 00000011 is updated to "00000001".
[0128] Similarly, if traversing by column, after traversing a tile in a column (not the last tile), the column identifier that matches the row coordinates of that tile in `vld_y_mask` can be set to invalid. For example, in... Figure 4 In the process, after traversing the tile (1,7), the row identifier in vld_y_mask that matches the first row can be set to 0, that is, 10001 is updated to "00001". In this way, by using a differentiated approach to update screen identifier information based on different traversal methods, the efficiency and accuracy of updating screen identifier information are improved, providing a reliable basis for effectively avoiding repeated traversal in the future.
[0129] The following is based on Figure 4 For example, if we initialize row_mask and vld_y_mask to init_row_mask(10001) and initialize col_mask and vld_x_mask to init_col_mask(10000011), then: First, take tile (1,1) as the target tile. After determining the subset of primitives corresponding to tile (1,1), since tile (1,1) is neither the last tile in the first row nor the last tile in the first column, the tile identification information can remain unchanged. Update the screen identification information according to tile (1,1), that is: if it is a row traversal method, then update vld_x_mask to 00000011; Next, take tile (1,7) as the target tile. After determining the subset of primitives corresponding to tile (1,7), since tile (1,7) is neither the last tile in the first row nor the last tile in the first column, the tile identification information can remain unchanged. Update the screen identification information according to tile (1,7), that is: if it is a row traversal method, then update vld_x_mask to 00000001; Next, take tile (1,8) as the target tile. After determining the primitive subset corresponding to tile (1,8), since tile (1,8) is the last tile in the first row, update row_mask to 00001 according to tile (1,1), and reset vld_y_mask to row_mask (00001) and vld_x_mask to col_mask (10000011). Next, take tile (5,1) as the target tile. After determining the subset of primitives corresponding to tile (5,1), since tile (5,1) is the last tile in the first column, update col_mask to 00000011 according to tile (5,1), and reset vld_y_mask to row_mask (00001) and vld_x_mask to col_mask (00000011). Next, take the tile (5,7) as the target tile. After determining the subset of primitives corresponding to the tile (5,7), since the tile (5,7) is the last tile in the 7th column, update col_mask to 00000001 according to the tile (5,7), and reset vld_y_mask to row_mask (00001) and vld_x_mask to col_mask (00000001).
[0130] Finally, tile (5,8) is selected as the target tile. After determining the subset of primitives corresponding to tile (5,8), since tile (5,8) is the last tile in row 5 and the last tile in column 8, row_mask is updated to 00000 and col_mask to 00000000 based on tile (5,8), and vld_y_mask is reset to row_mask (00000) and vld_x_mask is reset to col_mask (00000000). In practice, since tile (5,8) is the last valid tile, updating the current identifier information is not necessary.
[0131] In some implementations, the traversal method can be changed or maintained after traversing a row and / or a column. For example, after traversing a row, the original row traversal method can be switched to column traversal method; after traversing a column, the original column traversal method can be switched to row traversal method. Alternatively, either row traversal method or column traversal method can be maintained throughout the entire mapping process.
[0132] In this embodiment, the current identification information is updated in a timely manner according to the target block to narrow the screen traversal range, providing a high-precision basis for determining the next target block. This reduces the determination time of the next target block and also reduces the possibility of errors in the next target block.
[0133] In some implementations, the processing unit 22 is further configured to determine the next traversal method based on the current traversal method when the target tile is the last tile in a row and / or the target tile is the last tile in a column.
[0134] Here, the traversal method can be updated after traversing a row and / or a column. In practice, the next traversal method will differ from the current one. For example, if the current traversal method is row-based, it can be switched to column-based traversal after traversing a row. Similarly, if the current traversal method is column-based, it can be switched to row-based traversal after traversing a column. It can be understood that when both a row and a column are traversed, only the current traversal method needs to be switched to another. For example, in... Figure 4 In the process, once the subset of primitives corresponding to the tile (1,8) is determined, the row traversal method can be switched to the column traversal method; once the subset of primitives corresponding to the tile (5,1) is determined, the column traversal method can be switched to the row traversal method.
[0135] In this embodiment, the traversal method is dynamically switched after each row and / or column is traversed, which improves the flexibility of screen traversal and provides a basis for the gradual reduction of the subsequent screen traversal range.
[0136] In some implementations, the processing unit is configured to determine a subset of elements corresponding to a target element based on the position information of at least one element in the current element set and the position information of the target element; wherein the subset of elements corresponding to the target element is empty or includes at least one element in the current element set.
[0137] Here, the location information of a primitive can refer to the vertex information of the primitive, which can represent the coverage area of the primitive. In some implementations, each primitive is traversed sequentially, and the coordinate range of the target block is compared with the vertex information of each primitive being traversed. If the comparison result indicates that the primitive covers at least one pixel of the target block, the primitive is included as a primitive in a subset of primitives, until the last primitive. In some implementations, the sequential traversal of each primitive can first determine the coverage area of the primitive based on the vertex information of the primitive, and then compare the coverage area of the primitive with the coordinate range of the target block to determine whether there is an intersection. If there is an intersection, the primitive is included as a primitive in a subset of primitives, until the last primitive.
[0138] In this embodiment, the position information of primitives and the position information of blocks are used to accurately and quickly determine whether they intersect, which can quickly remove primitives that do not cover the target block and avoid redundant calculations in the subsequent rasterization and fragment coloring stages.
[0139] Based on the above embodiments, this application also provides a tile processing method, which is executed by any of the aforementioned GPUs, such as... Figure 5 As shown, the tile processing method includes steps S51 and S52, wherein: Step S51: Based on the current primitive set received in time-division multiplexing over at least two clock cycles, jointly determine the initial identification information corresponding to the current screen; wherein, the current screen is divided into multiple tiles, the multiple tiles include at least two rows of tiles and at least two columns of tiles, and the initial identification information is used to indicate whether each row of tiles in the at least two rows of tiles is covered by primitives in the current primitive set and / or to indicate whether each column of tiles in the at least two columns of tiles is covered by primitives in the current primitive set; Step S52: Based on the initial identification information, perform mapping processing between the current primitive set and the current screen.
[0140] Here, the current primitive set can include primitives received in each clock cycle.
[0141] The current screen refers to the screen corresponding to the image to be rendered. The current screen can be the initial screen or a screen that has been processed from the initial screen.
[0142] The initial identification information may include, but is not limited to, at least one of init_row_mask, init_col_mask, etc. In implementation, the process for determining this initial identification information can be found in the specific implementation details of the aforementioned processor embodiments.
[0143] The mapping process includes determining at least one subset of primitives corresponding to a target tile. This subset of primitives corresponding to the target tile may be empty or may include at least one tile from the current primitive set. In implementation, the process for determining the subset of primitives corresponding to the target tile can be found in the specific implementation details of the foregoing processor embodiments.
[0144] In this embodiment, on the one hand, the time-division multiplexing collection unit determines the initial identification information while collecting graphic elements. That is, the collection unit uses the delay of the input data to complete the collection of the initial identification information, and by reusing the hardware resources of one clock cycle to receive graphic elements in multiple clock cycles, compared with receiving all graphic elements in one clock cycle, it not only reduces resource consumption, but also reduces timing risks, and has the advantages of being resource-friendly and timing-friendly. On the other hand, subsequent primitive screen mapping is performed based on pre-determined initial identification information. Since this initial identification information can accurately indicate whether each row and / or column of tiles is covered by primitives in the current primitive set, the traversal of empty rows and columns can be quickly skipped. In other words, this application does not require traversing row by row and column by column, nor does it require traversing a row and column of tiles first to collect identification information. Therefore, this application greatly improves the acceleration of the primitive screen mapping process, improves the processing efficiency of primitive screen mapping, and reduces latency. It is especially suitable for primitive sets with sparse primitive distribution. This not only speeds up the transition from vertex processing to rasterization and improves the overall rendering throughput, but also reduces the frequency of global memory access, reduces memory bandwidth consumption and invalid computation, and thus significantly reduces the power consumption of the GPU.
[0145] In some implementations, step S51 includes: for each clock cycle, determining identification information corresponding to the clock cycle based on the primitives received in the clock cycle; and determining initial identification information based on the identification information corresponding to the last clock cycle.
[0146] In some implementations, "determining the identification information corresponding to the clock cycle based on the primitives received in the clock cycle" includes: when the clock cycle is the first clock cycle, determining the identification information corresponding to the clock cycle based on the coordinates of the primitives received in the clock cycle; when the clock cycle is any other clock cycle besides the first clock cycle, determining the identification information corresponding to the clock cycle based on the coordinates of the primitives received in the clock cycle and the identification information corresponding to the previous clock cycle.
[0147] In some implementations, the identification information corresponding to the clock cycle includes row identification information and column identification information. The row identification information includes the row identifier of each row of at least two rows of tiles, which is used to indicate whether the corresponding row of tiles is covered by a primitive. The initial column identification information includes the column identifier of each column of at least two columns of tiles, which is used to indicate whether the corresponding column of tiles is covered by a primitive. The coordinates of the primitive include the row coordinates of the primitive and the column coordinates of the primitive. "Determining the identification information corresponding to the clock cycle based on the coordinates of the primitive received in the clock cycle" includes: setting the row identifier in the row identification information corresponding to the row coordinates of the primitive as a first identifier; and setting the column identifier in the column identification information corresponding to the column coordinates of the primitive as a first identifier.
[0148] In some implementations, the mapping process includes determining at least one subset of primitives corresponding to a target tile, where the target tile is one of a plurality of tiles; step S52 includes: determining the target tile based on initial identification information; and determining the subset of primitives corresponding to the target tile based on the current primitive set.
[0149] In some implementations, "determining the target block based on initial identification information" includes: if the target block is an initial block, using a preset block as the initial block, or determining the initial block based on initial identification information; if the target block is not an initial block, determining the target block based on current identification information, wherein the current identification information is determined based on the initial identification information.
[0150] In some implementations, the current identification information includes tile identification information and screen identification information. The tile identification information is used to indicate whether each row of tiles in at least two rows of tiles needs to be traversed and / or to indicate whether each column of tiles in at least two columns of tiles needs to be traversed. The screen identification information is used to indicate whether each tile in a row of tiles needs to be traversed and / or to indicate whether each tile in a column of tiles needs to be traversed. "Determining the target tile based on the current identification information" includes: determining the target row and target column based on the tile identification information and the screen identification information; and selecting the tile located in the target row and the target column as the target tile.
[0151] In some implementations, the tile identification information includes tile row identification information and tile column identification information, and the screen identification information includes screen row identification information and screen column identification information; "determining the target row and target column based on the tile identification information and screen identification information" includes: when the current traversal method is row traversal, determining the target row based on the tile row identification information or the screen column identification information, and determining the target column based on the screen row identification information; wherein, the tile row identification information is used to indicate whether each row of tiles in at least two rows of tiles needs to be traversed, the screen row identification information is used to indicate whether each tile in a row of tiles needs to be traversed, and the screen column identification information is used to indicate whether each tile in a column of tiles needs to be traversed; when the current traversal method is column traversal, determining the target row based on the screen column identification information, and determining the target column based on the tile column identification information or the screen row identification information; wherein, the tile column identification information is used to indicate whether each column of tiles in at least two columns of tiles needs to be traversed.
[0152] In some implementations, the tile processing method further includes: updating the current identification information based on the coordinates of the target tile, and using the updated current identification information to determine the next target tile.
[0153] In some implementations, the tile identification information includes tile row identification information and tile column identification information; the screen identification information includes screen row identification information and screen column identification information; the coordinates of the target tile include the row coordinates of the target tile and the column coordinates of the target tile; "updating the current identification information based on the coordinates of the target tile" includes: when the target tile is the last tile in a row, setting the row identifier in the tile row identification information that matches the row coordinates of the target tile to the second identifier, resetting the screen row identification information to the updated tile column identification information, and setting the screen column... The identifier information is reset to the updated tile row identifier information; if the target tile is the last tile in a column, the column identifier in the tile column identifier information that matches the column coordinates of the target tile is set to the second identifier, and the screen row identifier information is reset to the updated tile column identifier information and the screen column identifier information is reset to the updated tile row identifier information; if the target tile is neither the last tile in a row nor the last tile in a column, the screen row identifier information or the screen column identifier information is updated based on the current traversal method and the coordinates of the target tile.
[0154] In some implementations, "updating screen row identifier information or screen column identifier information based on the current traversal method and the coordinates of the target tile" includes: when the current traversal method is row traversal, setting the row identifier of the screen row identifier information that matches the column coordinates of the target tile to the second identifier; when the current traversal method is column traversal, setting the column identifier of the screen column identifier information that matches the row coordinates of the target tile to the second identifier.
[0155] In some implementations, the tile processing method further includes: determining the next traversal method based on the current traversal method when the target tile is the last tile in a row and / or the target tile is the last tile in a column.
[0156] In some implementations, "determining the subset of elements corresponding to the target tile based on the current element set" includes: determining the subset of elements corresponding to the target tile based on the position information of at least one element in the current element set and the position information of the target tile; wherein the subset of elements corresponding to the target tile is empty or includes at least one element in the current element set.
[0157] In some implementations, the tile processing method further includes: determining the current screen based on the current primitive set; or, using the initial screen as the current screen.
[0158] The description of the above method embodiments is similar to that of the above processor embodiments, and has similar beneficial effects. For technical details not disclosed in the method embodiments of this application, please refer to the description of the processor embodiments of this application for understanding.
[0159] The technical solution of this application is described in detail below.
[0160] A crucial step in GPU graphics rendering is primitive screen mapping. Typically, due to chip storage limitations, primitive screen mapping divides the screen into N tiles of a certain size. By traversing all tiles within the screen area, it identifies which primitives in the current primitive set cover each tile, thus completing the primitive screen mapping process.
[0161] The common approach is to traverse each tile row-by-row and column-by-column across the entire screen to map each primitive to each tile. Another approach is to first identify a smaller screen area where primitives might exist, and then traverse each tile row-by-row and column-by-column within that smaller area. However, this approach involves a lot of unnecessary work when dealing with sparsely distributed primitives, as it also processes many empty tiles that are not covered by primitives. The traversal process is inefficient, making the process of finding all tiles covered by primitives time-consuming, resulting in significant processing latency and impacting performance.
[0162] This application optimizes the inefficiency and high latency of related solutions, which can accelerate the screen mapping process of various graphic elements, eliminate the processing of most empty tiles, and improve processing performance.
[0163] This application aims to improve the processing efficiency of primitive screen mapping, reduce processing latency, and enhance processing performance. Considering the resource consumption and timing issues of hardware implementation, a time-division multiplexed mask collection circuit is adopted, using 1 / M of circuit resources to implement the fast traversal scheme of this application with a timing-friendly circuit design.
[0164] by Figure 6 Taking the primitive distribution shown as an example, for a primitive set containing 3 sparsely distributed small primitives, tile traversal and mapping are performed within the reduced screen area of its merged bounding box (the dashed box in the image) with a size of 10*5 tiles. In the example, the traversed screen area contains a total of 50 tiles.
[0165] An additional check is performed to determine whether there are any elements in the current primitive set that cover the current row and column. If there are no elements in the current row and column, the mapping process of these empty tiles can be skipped, and the mapping process can be directly skipped to the tile with elements, thereby accelerating the traversal and mapping process.
[0166] according to Figure 6 The basic traversal method shown requires a delay of 50 cycles to complete the mapping process between these tiles and the primitive set. However, only 3 tiles are actually covered by primitives, and the mapping process of most tiles results in empty output, which is actually a waste of time. according to Figure 7 The accelerated traversal method shown requires traversing the first row and first column tile by tile to obtain the complete row_mask and rolcol_mask before empty tiles can be removed in subsequent traversals. It still requires traversing 15 tiles, which improves the processing speed by 70% compared to the basic traversal method.
[0167] According to Figure 8 The accelerated traversal method of this application, as shown, completes the collection of initial row_mask (i.e., init_row_mask) and initial col_mask (i.e., init_col_mask) during primitive set data input. It also supports dynamic updates of row_mask and col_mask after traversal begins, effectively eliminating most empty tiles and requiring only traversal of 4 tiles, resulting in a significantly faster processing speed compared to traditional methods. Figure 6 The basic traversal method shown is 92% faster than... Figure 7 The accelerated traversal method shown further improves performance by 73%, significantly enhancing traversal processing performance. Verified through examples, for actual supported 32K (32*1024) large screens, this application can eliminate over 99% of empty tiles when processing screen traversal of multiple primitive sets, greatly improving processing performance.
[0168] This application uses a time-division multiplexing circuit to synchronously collect the initial row_mask and col_mask when inputting primitive coordinate data.
[0169] like Figure 9 As shown, suppose a primitive set contains P primitives. The circuit (corresponding to the aforementioned collection unit) inputs primitive coordinate data at a rate of N primitive_data / cycle (N primitives per cycle) while simultaneously acquiring the row_mask and col_mask of N primitives. During the entire primitive set data input process of P / N=M cycles, the collection of all primitive row_mask and col_mask is completed in M cycles, thus obtaining the row_mask and col_mask of the entire primitive set.
[0170] For a 32K screen, the number of tiles in the x / y direction can range from 1 to 2. 11 The width of row_mask and col_mask is 2048 bits (2^2048). 11 If we directly compare P primitive coordinate values (taking 16.8 precision int data format as an example), there are 4x24 bits (i.e., xmin, ymin, ymax, and ymax each occupy 24 bits) and 2x2048 bits (i.e., the bit width of row_mask and col_mask is 2048 bits), which poses a significant timing risk.
[0171] The time-division multiplexing circuit of this application uses only 1 / M of resources to collect row_mask and col_mask by multiplexing the delay of input data, which has the advantages of being resource-friendly and timing-friendly.
[0172] like Figure 10 As shown, the traversal processing flow (i.e., the tile processing method) includes steps S81 to S810, wherein: Step S81: Initialization; Here, based on the collected `init_row_mask` (initial row identifier information) and `init_col_mask` (initial column identifier information), starting from (xmin, ymin) within the screen traversal range (i.e., `tile_x=xmin`, `tile_y=ymin`), the traversal proceeds row-by-row in the default direction (i.e., `dir=0`) (corresponding to the aforementioned traversal method). The tile identifier information is initialized: `row_mask=init_row_mask`, `col_mask=init_col_mask`. The screen identifier information is initialized: `vld_x_mask=init_col_mask`, `vld_y_mask=init_row_mask`.
[0173] Step S82: Begin PB traversal; Step S83: Determine if this is the last tile. If yes, proceed to step S84; otherwise, proceed to step S85. Step S84, Hold; Step S85: Determine whether a row and / or column has been traversed. If yes, proceed to step S86; otherwise, proceed to step S87. Here, it means traversing a row and a column (row_done&col_done), or traversing a row (~dir&row_done), or traversing a column (dir&col_done).
[0174] Step S86: Update the direction, tile identifier information and screen identifier information, and proceed to step S810; Here, if a row and a column have been traversed, the next direction `n_dir` is set to `~dir`, and the tile identifier information is cleared according to the tile's coordinates (i.e., `clear col_mask[tile_x]` and `clear row_mask[tile_y]`), and the screen identifier information is set to the tile identifier information (i.e., `reset vld_x_mask as col_mask`, `reset vld_y_mask as row_mask`). If a row has been traversed, the next direction `n_dir` is set to `~dir`, and the tile row identifier information is cleared according to the tile's y-coordinate (i.e., `clear row_mask[tile_y]`), and the screen identifier information is set to the tile identifier information (i.e., `reset vld_x_mask as col_mask`, `reset vld_y_mask as row_mask`). If a row is traversed, the next direction n_dir is set to ~dir, the tile column identifier information is cleared according to the tile's horizontal coordinate (i.e., clear col_mask[tile_x]), and the screen identifier information is set to the tile identifier information (i.e., reset vld_x_mask as col_mask, reset vld_y_mask as row_mask).
[0175] Step S87: Determine if the direction is 0. If yes, proceed to step S88; otherwise, proceed to step S89. Step S88: Update vld_x_mask, proceed to step S810; Here, the screen row identifier information is cleared based on the vertical coordinate of the tile (i.e., clear vld_x_mask[tile_x]).
[0176] Step S89: Update vld_y_mask, proceed to step S810.
[0177] Here, the screen column identifier information is cleared based on the horizontal coordinate of the tile (i.e., clear vld_y_mask[tile_y]).
[0178] Step S810: Determine the next block and proceed to step S83.
[0179] The entire process starts at (xmin, ymin) of the screen traversal range, moves row by row in the default direction, finds the valid row and column x / y coordinates of the LSB in row_mask and col_mask, and uses this position as the tile coordinate value to jump to in the next step, directly skipping all empty tiles.
[0180] During the traversal, the stepping direction is changed after each row / column is traversed, which can dynamically shrink the screen traversal range and dynamically update row_mask and col_mask to ensure that subsequent traversals will not enter rows or columns without valid tiles. The screen mapping of this primitive set can be ended when all valid tiles in the current screen traversal range have been traversed, without necessarily processing to the (xmax, ymax) boundary.
[0181] The technical solution of this application brings the following benefits: it improves the processing efficiency of primitive screen mapping, reduces processing latency, and improves processing performance. Considering the timing issues of hardware implementation, a time-division multiplexed mask collection circuit is adopted, using 1 / M of circuit resources, to implement the fast traversal scheme of this application with a timing-friendly circuit design.
[0182] It should be noted that, in the embodiments of this application, if the above methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of software products. These software products are stored in a storage medium and include several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0183] This application provides an electronic device including the aforementioned graphics processor. The electronic device can be various types of terminals such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), or it can be implemented as a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0184] It should be noted that the description of the above device embodiments is similar to the description of the above processor embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the processor embodiments of this application for understanding.
[0185] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0186] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0187] 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 merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0188] The units described above as separate components may or may not be physically separate. The components shown 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 to achieve the purpose of this embodiment according to actual needs.
[0189] In addition, each functional unit in the embodiments of this application can 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 integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0190] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0191] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.
[0192] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A graphics processor, comprising: The graphics processor includes: A collection unit is configured to jointly determine initial identification information corresponding to the current screen based on the current primitive set received in a time-division manner over at least two clock cycles; wherein the current screen is divided into multiple tiles, the multiple tiles including at least two rows of tiles and at least two columns of tiles, and the initial identification information is used to indicate whether each row of tiles in the at least two rows of tiles is covered by primitives in the current primitive set and / or to indicate whether each column of tiles in the at least two columns of tiles is covered by primitives in the current primitive set; The processing unit is used to perform mapping processing between the current primitive set and the current screen based on the initial identification information.
2. The graphics processor according to claim 1, characterized in that, The current primitive set includes primitives received in each clock cycle; The collection unit is configured to, for each clock cycle, determine the identification information corresponding to the clock cycle based on the primitives received in the clock cycle; and determine the initial identification information based on the identification information corresponding to the last clock cycle.
3. The graphics processor according to claim 2, characterized in that, The collection unit is used to determine the identification information corresponding to the clock cycle based on the coordinates of the graphic elements received in the clock cycle when the clock cycle is the first clock cycle. When the clock cycle is any clock cycle other than the first clock cycle, the identification information corresponding to the clock cycle is determined based on the coordinates of the primitives received in the clock cycle and the identification information corresponding to the previous clock cycle.
4. The graphics processor according to claim 3, characterized in that, The identification information corresponding to the clock cycle includes row identification information and column identification information. The row identification information includes the row identifier of each row of the at least two rows of tiles, which is used to indicate whether the corresponding row of tiles is covered by the element. The column identification information includes the column identifier of each column of the at least two columns of tiles, which is used to indicate whether the corresponding column of tiles is covered by the element. The coordinates of the element include the row coordinates and the column coordinates of the element. The collection unit is used to set the row identifier corresponding to the row coordinate of the graphic element in the row identifier information as the first identifier; Set the column identifier in the column identifier information that corresponds to the column coordinate of the graphic element as the first identifier.
5. The graphics processor according to claim 1, characterized in that, The mapping process includes determining at least one subset of primitives corresponding to a target tile, wherein the target tile is one of the plurality of tiles; The processing unit is used to determine the target map block based on the initial identification information; Based on the current primitive set, determine the primitive subset corresponding to the target primitive.
6. The graphics processor according to claim 5, characterized in that, The processing unit is configured to, when the target tile is an initial tile, use a preset tile as the initial tile, or, determine the initial tile based on the initial identification information; If the target tile is not the initial tile, the target tile is determined based on the current identification information, which is determined based on the initial identification information.
7. The graphics processor according to claim 6, characterized in that, The current identification information includes tile identification information and screen identification information. The tile identification information is used to indicate whether each row of tiles in the at least two rows of tiles needs to be traversed and / or to indicate whether each column of tiles in the at least two columns of tiles needs to be traversed. The screen identification information is used to indicate whether each tile in a row of tiles needs to be traversed and / or to indicate whether each tile in a column of tiles needs to be traversed. The processing unit is configured to determine the target row and target column based on the tile identification information and the screen identification information; and to designate the tile located in the target row and the target column as the target tile.
8. The graphics processor according to claim 7, characterized in that, The tile identification information includes tile row identification information and tile column identification information; the screen identification information includes screen row identification information and screen column identification information; the processing unit is used for: When the current traversal method is row traversal, the target row is determined based on the tile row identifier information or the screen column identifier information, and the target column is determined based on the screen row identifier information; wherein, the tile row identifier information is used to indicate whether each row of tiles in the at least two rows of tiles needs to be traversed, the screen row identifier information is used to indicate whether each tile in a row of tiles needs to be traversed, and the screen column identifier information is used to indicate whether each tile in a column of tiles needs to be traversed; When the current traversal method is column traversal, the target row is determined based on the screen column identifier information, and the target column is determined based on the tile column identifier information or the screen row identifier information; wherein, the tile column identifier information is used to indicate whether each of the at least two columns of tiles needs to be traversed.
9. The graphics processor according to claim 7, characterized in that, The processing unit is further configured to update the current identification information based on the coordinates of the target tile, and the updated current identification information is used to determine the next target tile.
10. The graphics processor according to claim 9, characterized in that, The tile identification information includes tile row identification information and tile column identification information; the screen identification information includes screen row identification information and screen column identification information; the coordinates of the target tile include the row coordinates of the target tile and the column coordinates of the target tile; the processing unit is used for: When the target tile is the last tile in a row, the row identifier in the tile row identifier information that matches the row coordinates of the target tile is set as the second identifier, the screen row identifier information is reset to the updated tile column identifier information, and the screen column identifier information is reset to the updated tile row identifier information; When the target tile is the last tile in a column, the column identifier in the tile column identifier information that matches the column coordinates of the target tile is set as the second identifier, and the screen row identifier information is reset to the updated tile column identifier information and the screen column identifier information is reset to the updated tile row identifier information. If the target tile is not the last tile in a row and not the last tile in a column, update the screen row identifier information or the screen column identifier information based on the current traversal method and the coordinates of the target tile.
11. The graphics processor according to claim 10, characterized in that, The processing unit is configured to, when the current traversal method is row traversal, set the row identifier of the screen row identifier information that matches the column coordinates of the target tile to a second identifier; and when the current traversal method is column traversal, set the column identifier of the screen column identifier information that matches the row coordinates of the target tile to a second identifier.
12. The graphics processor according to claim 10, characterized in that, The processing unit is further configured to determine the next traversal method based on the current traversal method when the target tile is the last tile in a row and / or the target tile is the last tile in a column.
13. The graphics processor according to claim 5, characterized in that, The processing unit is configured to determine a subset of elements corresponding to the target element based on the position information of at least one element in the current element set and the position information of the target element; wherein the subset of elements corresponding to the target element is empty or includes at least one element in the current element set.
14. The graphics processor according to any one of claims 1 to 13, characterized in that, The processing unit is further configured to determine the current screen based on the current primitive set; or to use the initial screen as the current screen.
15. A method for processing image blocks, characterized in that, Applied in a graphics processor, the tile processing method includes: Based on the current primitive set received in time-division multiplexing over at least two clock cycles, initial identification information corresponding to the current screen is jointly determined; wherein, the current screen is divided into multiple tiles, the multiple tiles including at least two rows of tiles and at least two columns of tiles, and the initial identification information is used to indicate whether each row of tiles in the at least two rows of tiles is covered by primitives in the current primitive set and / or to indicate whether each column of tiles in the at least two columns of tiles is covered by primitives in the current primitive set; Based on the initial identification information, a mapping process is performed between the current primitive set and the current screen.
16. An electronic device, characterized in that, The graphics processor included in any one of claims 1 to 14.