Image block scanning method and device, electronic device, storage medium and program product
Patent Information
- Application Number
- CN202610985387.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-03
- Publication Date
- 2026-08-28
AI Technical Summary
在目前的实际应用中,在积累的图元数量超出单次扫描所选定的图元数量时,需要对图像块进行多次扫描,每次对图像块进行扫描时都需要对图像块包含的所有扫描块进行扫描,导致对图像块进行扫描的效率较低,降低后续分块渲染的效率
[0010] The embodiments provided in this disclosure enable that, during the image block scanning stage, each scan of an image block only scans the first scan block with a valid scan flag, identifies the second scan block that is not covered by any primitive corresponding to a primitive in subsequent scan rounds, and sets the scan flag of the identified second scan block to invalid. Thus, in subsequent scan rounds, the scanning of the second scan block can be skipped, eliminating the need to scan every scan block in the image block, reducing the number of scan blocks that need to be scanned, thereby improving the efficiency of scanning the image block and further improving the efficiency of subsequent block rendering.
Smart Images

Figure CN122657342A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to an image block scanning method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] In a Tile-Based Deferred Rendering (TBDR) architecture, a Graphics Processing Unit (GPU) generally splits a scene into tiles and generates a primitive list for each tile. Before entering the shader stage, the GPU generally divides a tile into a plurality of scan blocks, and then scans each scan block separately. In current practical applications, when the accumulated number of primitives exceeds the number of primitives selected for a single scan, multiple scans of the tile are required, and all scan blocks included in the tile need to be scanned each time the tile is scanned, which leads to low scanning efficiency of the tile and reduces the efficiency of subsequent tiled rendering. Summary of the Invention
[0003] The present disclosure provides an image block scanning method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] In a first aspect, the present disclosure provides an image block scanning method, comprising:
[0005] in an n-th scan of an image block scanning stage, scanning a first scan block in an image block to determine a second scan block in the first scan block that satisfies a skip determination condition; wherein the first scan block is a scan block with a valid scanning flag among a plurality of scan blocks of the image block, the skip determination condition comprises: the scan block is not covered by any primitive among primitives corresponding to an (n+1)-th scan to an N-th scan; 1≤n<N, and n and N are integers; setting the scanning flag of the second scan block to be invalid.
[0006] In a second aspect, the present disclosure provides an image block scanning apparatus, comprising: a scanning module configured to, in an n-th scan of an image block scanning stage, scan a first scan block in an image block and determine a second scan block in the first scan block that satisfies a skip determination condition; wherein the first scan block is a scan block with a valid scanning flag among a plurality of scan blocks of the image block, the skip determination condition comprises: the scan block is not covered by any primitive among primitives corresponding to an (n+1)-th scan to an N-th scan; 1≤n<N, and n and N are integers; a setting module configured to set the scanning flag of the second scan block to be invalid.
[0007] Thirdly, this disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the image block scanning method described above.
[0008] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described image block scanning method.
[0009] Fifthly, this disclosure provides a computer program product including computer-readable code, which, when executed in a processor of an electronic device, causes the processor in the electronic device to perform the image block scanning method described above.
[0010] The embodiments provided in this disclosure enable that, during the image block scanning stage, each scan of an image block only scans the first scan block with a valid scan flag, identifies the second scan block that is not covered by any primitive corresponding to a primitive in subsequent scan rounds, and sets the scan flag of the identified second scan block to invalid. Thus, in subsequent scan rounds, the scanning of the second scan block can be skipped, eliminating the need to scan every scan block in the image block, reducing the number of scan blocks that need to be scanned, thereby improving the efficiency of scanning the image block and further improving the efficiency of subsequent block rendering.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0013] Figure 1 A flowchart of an image block scanning method provided in an embodiment of this disclosure.
[0014] Figure 2 This is a schematic diagram of an image block scanning method provided in an embodiment of the present disclosure.
[0015] Figure 3This is a block diagram of an image block scanning device provided in an embodiment of the present disclosure.
[0016] Figure 4 This is a block diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0017] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0018] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0019] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0020] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0021] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0022] Before detailing the embodiments of this disclosure, some related concepts will be explained for clarity.
[0023] Render Target: This can refer to the object to be rendered, which can be a part of the virtual scene to be rendered, or an image or video frame to be rendered.
[0024] Primitives: These can refer to the basic geometric shapes that make up a graphic, such as points, lines, and triangles. For example, a graphic drawn by an application can be represented in the computer by a combination of many basic geometric shapes.
[0025] The rendering pipeline is a key concept in computer graphics. It's a stage within the graphics processing unit (GPU) responsible for processing and transforming graphics data for rendering. The primary task of the rendering pipeline is to convert input geometric primitives (such as points, lines, and triangles) into pixels visible on the screen. The goal of the rendering pipeline is to process graphics efficiently and generate the final image. Through parallel processing and specialized hardware support, the GPU can perform these calculations rapidly to achieve real-time graphics rendering.
[0026] In the field of computer graphics rendering, GPUs, as the core processors, are widely used to perform complex shading calculations and image generation tasks. To improve rendering efficiency, tile-based rendering techniques are commonly used. This technique divides the screen or rendering object into multiple smaller tile blocks and performs geometric processing and shading operations independently on each tile, thereby optimizing data locality and the utilization of parallel computing resources.
[0027] In a tile-based rendering process, when the GPU starts shading a tile, it typically needs to perform multiple scans to output the pixels covered by all the geometric primitives accumulated within that tile to the shader.
[0028] However, in real-world applications, due to significant variations in the spatial distribution and coverage characteristics of geometric primitives, only a few scan blocks are often covered by geometric primitives and require output to the shader during a single scan. This situation means that the processing cycle of the image block scanning phase is often closely related to the total number of scan blocks marked during the primitive accumulation phase, and less so to the actual number of scan blocks that need to be output. Therefore, the rendering pipeline may consume considerable computational resources for covering scan blocks that do not require output, leading to a delay in the image block scanning phase and potentially impacting overall rendering performance.
[0029] The image block scanning method according to the embodiments of the present disclosure, in the image block scanning stage, for each scanning of the image block, only the first scanning blocks with valid scanning flags are scanned, the second scanning blocks that are not covered by any primitive among the primitives corresponding to subsequent scanning rounds are determined, and the scanning flags of the determined second scanning blocks are set to invalid. Therefore, in subsequent scanning rounds, the scanning of the second scanning blocks can be skipped, and it is not necessary to scan each scanning block in the image block, which reduces the number of scanning blocks that need to be scanned, thereby improving the efficiency of scanning image blocks and further improving the efficiency of subsequent block rendering. Primitive coverage information of scanning blocks is obtained by scanning image blocks, and the primitive coverage information is output to a shader, so that the shader performs shading processing on the scanning blocks according to the primitive coverage information, which reduces scanning delay and improves rendering efficiency.
[0030] The image block scanning method according to the embodiments of the present disclosure may be executed by electronic equipment such as a terminal device or a server. The terminal device may be an in-vehicle device, User Equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, an in-vehicle device, a wearable device, etc. The method may be implemented by a processor calling a computer-readable program instruction stored in a memory. Alternatively, the method may be executed by a server.
[0031] Figure 1 It is a flowchart of an image block scanning method provided by an embodiment of the present disclosure. See Figure 1 , the method specifically includes the following steps:
[0032] Step 102: In the n-th scanning of the image block scanning stage, scan the first scanning blocks in the image block, and determine the second scanning blocks that satisfy the skip determination condition in the first scanning blocks, wherein the first scanning blocks are scanning blocks with valid scanning flags among the plurality of scanning blocks of the image block, and the skip determination condition includes: the scanning block is not covered by any primitive among the primitives corresponding to the (n+1)-th scanning to the N-th scanning; 1≤n<N and both n and N are integers.
[0033] Step 104: Set the scanning flag of the second scanning block to invalid.
[0034] Specifically, the image block scanning method provided by the embodiments of the present disclosure is applied to a tile-based deferred rendering scenario, the image block is one of a plurality of image blocks of a rendering object for TBDR, and each image block is covered by at least one primitive among the plurality of primitives of the rendering object.
[0035] In practical applications, before scanning the divided image blocks, the GPU needs to determine the primitives to be scanned in each scan round. The primitives to be scanned in each scan round can be customized by the user. For example, the user can determine the number of primitives the GPU can scan in each scan round, and the primitives that need to be scanned, based on the device's performance. The scan round is determined based on the number of primitives to be scanned in each scan round and the total number of primitives accumulated in the image block. After initiating the shading process for the image block, the GPU scans the image block according to the primitives corresponding to each scan round.
[0036] The image patch scanning phase refers to the stage where the GPU scans image patches. An image patch is divided into multiple scan blocks, each with a corresponding scan flag. The scan flag indicates whether the scan block is valid and needs to be scanned. The first scan block refers to the scan block whose scan flag is valid among the multiple scan blocks of the image patch during the nth scan of the image patch scanning phase. The second scan block refers to the scan block whose scan flag is changed from valid to invalid during the nth scan of the image patch scanning phase. Invalid scan blocks include scan blocks not covered by any primitive in the primitives corresponding to the (n+1)th to Nth scans, and / or scan blocks completely covered by at least one primitive in the primitives corresponding to the previous n scans. It can also be scan blocks that, as determined during the primitive accumulation phase, are not covered by any primitive pixels. The Nth scan is the last round of scanning the image patch. Skip conditions include the scan block not being covered by any of the primitives in the primitives corresponding to the (n+1)th to the Nth scan, and / or the scan block being completely covered by at least one primitive in the primitives corresponding to the previous n scans.
[0037] Specifically, in the image block scanning stage of scanning the image block, in the nth scan, the first scan block in the image block with a valid scan flag is scanned, and the second scan block in the image block is determined according to whether the scan block is covered by the primitives corresponding to subsequent scan rounds, and the scan flag of the second scan block is set to invalid.
[0038] As mentioned above, the skipping determination condition also includes that the scan block is completely covered by at least one of the primitives corresponding to the previous n scans. Therefore, during the nth scan of the image block, a second scan block that is completely covered by at least one of the primitives corresponding to the previous n scans can also be identified. Since these scan blocks have been scanned in the previous n scans, there is no need to scan them again.
[0039] In practical applications, before the image block scanning stage, the image block needs to go through the primitive accumulation stage. In the primitive accumulation stage, the initial value of the scanning flag of each scanning block is determined. The initial value of the scanning flag of each scanning block is determined based on whether each scanning block is eventually covered by at least one pixel by a primitive. If the scanning block is covered by at least one pixel by a primitive, its initial value of the scanning flag is valid (e.g., 1). If the scanning block is not covered by any primitive, its initial value of the scanning flag is invalid (e.g., 0).
[0040] In the image block scanning stage, this embodiment scans only the first scan block with a valid scanning flag in each scanning round, identifies the second scan block that meets the skip condition, and sets the scanning flag of the second scan block to invalid. Thus, in subsequent scanning rounds, the second scan block does not need to be scanned and can be skipped directly, reducing the number of scan blocks that need to be scanned in the image block and improving the scanning efficiency of the image block.
[0041] See Figure 2 , Figure 2 This is a schematic diagram of an image block scanning method provided in an embodiment of the present disclosure, as shown below. Figure 2 The image shown is a block of images to be scanned. This block contains 64 scan blocks, and six primitives are accumulated within it: primitive 0, primitive 1, primitive 2, primitive 3, primitive 4, and primitive 5. The order in which primitives 0 to 5 are accumulated is also primitive 0, primitive 1, primitive 2, primitive 3, primitive 4, and primitive 5, respectively. Primitives 0 to 5 are all non-transparent primitives. Figure 2 The graphic elements shown are for illustrative purposes only. Taking the example that two graphic elements need to be scanned in each scan round, the image block needs to be scanned three times. The first scan round scans graphic elements 0 and 1, the second scan round scans graphic elements 2 and 3, and the third scan round scans graphic elements 4 and 5. It should be noted that the scanning order of the graphic elements can also be customized by the user. This embodiment does not limit the scanning order of the graphic elements; the graphic element scanning order described above is for illustrative purposes only.
[0042] See also Figure 2 In the first scan round, primitives 0 and 1 need to be scanned. During the scanning process of the image block, it can be determined that scan blocks 0, 1, 2, 8, 9, 10, 17, and 19 are only covered by primitives 0 and 1 and are not covered by other primitives, thus meeting the skip condition. After the scan is completed, the scan flag of these scan blocks is set to invalid, for example, to 0. Therefore, in the second scan round, there is no need to scan the above 8 scan blocks again; they can be skipped directly.
[0043] Similarly, in the second scan round, primitives 2 and 3 need to be scanned. During the scanning of the image block, it can be determined that scan blocks 3, 4, 5, 6, 7, 11, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, 37, 38, 39, 46, 47, and 55 are only covered by primitives 0, 1, 2, and 3, and are not covered by primitives 4 and 5 in the subsequent third scan round. This satisfies the skip condition. After the second scan round is completed, the scan flag of these scan blocks is set to invalid. Therefore, in the third scan round, there is no need to scan the above 24 scan blocks again; they can be skipped directly.
[0044] In the third scan round, primitives 4 and 5 need to be scanned, and in this process, only the remaining scan blocks need to be scanned.
[0045] In this embodiment of the disclosure, after each pair of image blocks has been scanned, the primitive coverage information obtained by the scan can be sent to the shader so that the shader can perform color processing on the image blocks.
[0046] Based on this, in a specific embodiment provided in this disclosure, the method further includes: in the nth scan, scanning the first scan block to determine a third scan block in the first scan block that is covered by at least one of the first primitives corresponding to the nth scan; sending primitive coverage information of the nth scan to the shader, the primitive coverage information of the nth scan including: primitive parameters of the first primitive, and pixel information of the pixels covered by the first primitive in the third scan block.
[0047] The third scan block refers to the scan block covered by at least one primitive from the primitives corresponding to the nth scan. Primitive parameters include primitive identifier, vertex attribute data (such as position, normal, color, etc.) and vertex index data; pixel information includes depth, stencil value and related material index.
[0048] Specifically, during the nth scan, the first scan block in the image block is scanned to determine the third scan block covered by at least one primitive in the primitives corresponding to the nth scan. After the scan is completed, the primitive coverage information obtained in this scan is sent to the shader, so that the image block can be colored during the coloring stage.
[0049] This embodiment of the present disclosure obtains the primitive coverage information for each scanning round by scanning the scan block covered by the primitives corresponding to each scanning round, and sends the obtained primitive coverage information to the shader to ensure the synchronization of the shading process and improve the rendering efficiency.
[0050] It should be noted that the primitive coverage information is determined in the primitive accumulation stage before the image block scanning stage. Since the primitive coverage information determined in the primitive accumulation stage is stored in memory, such as DRAM (Dynamic Random-Access Memory), it is slow to retrieve the primitive coverage information directly from memory. Therefore, by scanning the image block to determine which scan blocks in the image block are covered by the primitives in this scan, the output efficiency of the scan blocks covered by the primitives can be greatly improved.
[0051] Furthermore, as mentioned above, primitives are accumulated in the image block during the primitive accumulation stage. In practical applications, a scan block may be covered by multiple primitives or may not be covered by primitives. During the image block scanning stage, the primitives corresponding to the pixels in a scan block are determined based on the primitives that ultimately cover the pixels in the scan block during the primitive accumulation stage.
[0052] In one specific embodiment provided in this disclosure, each scan block of the image block includes multiple pixels, and the method further includes: when the i-th pixel is accumulated in the pixel accumulation phase, determining a target pixel in the multiple scan blocks that is covered by the i-th pixel, where i ≥ 1 and i is an integer; updating the visibility information of the target pixel according to the pixel identifier of the i-th pixel; and when the pixel accumulation phase is completed, determining the pixel coverage information of the image block according to the visibility information of the pixels in the multiple scan blocks.
[0053] Visibility information is used to characterize whether pixels in an image patch are covered by primitives. In other words, visibility information can be used to determine whether a pixel is covered by a particular primitive.
[0054] Specifically, during the primitive accumulation phase, when the primitives in the image block have accumulated to the i-th primitive, the target pixels covered by the i-th primitive in multiple scan blocks of the image block are determined, and the visibility information of the target pixels is updated according to the primitive identifier of the i-th primitive. When the primitive accumulation phase is completed, the primitive coverage information of the image block is determined according to the visibility information of the pixels in multiple scan blocks of the image block.
[0055] In the primitive accumulation stage of this disclosure, the visibility information of each pixel in the scan block is updated in real time according to the accumulation status of primitives. When the primitive accumulation stage is completed, the primitive coverage information of the image block is determined according to the pixel visibility information. This allows the image block scanning stage to determine whether each scan block is valid and whether it can be scanned based on the primitive coverage information of the image block, thereby improving the efficiency of the image block scanning stage.
[0056] In practical applications, each pixel in a scan block can correspond to an identifier value. If the pixel is covered by a primitive, its corresponding identifier will be set to 1; if the pixel is not covered by a primitive, its corresponding identifier will be set to 0. Based on this, the specific implementation of scanning the scan block will be explained.
[0057] See also Figure 2 Taking a 4×4 scan block 0 as an example, if scan block 0 is completely covered by primitive 0 and primitive 1, then the flag bit corresponding to each pixel in scan block 0 is set to 1, meaning all 16 bits in the scan block are 1, indicating that scan block 0 is completely covered by primitives, and the initial value of the scan flag for scan block 0 is 1. In the first scan round, the flag bits corresponding to all 16 pixels of scan block 0 are 1. Based on the pixel visibility information, it can be determined that 14 pixels of scan block 0 are covered by primitive 0, and 2 pixels are covered by primitive 1. Scanning scan block 0 in the first scan round, since the primitives corresponding to the first scan round are primitive 0 and primitive 1, all 16 pixels in scan block 0 will be scanned. After scanning scan block 0 is completed, it does not need to participate in subsequent scan rounds, and scan block 0 is determined to be the second scan block. The scan flag for scan block 0 is then set to invalid.
[0058] Further, see also Figure 2 Taking scan block 3 as an example, since scan block 3 is completely covered by primitive 1 and primitive 2, the flag bit corresponding to each pixel in scan block 3 is set to 1. That is, all 16 bits in the scan block are 1, indicating that scan block 3 is completely covered by primitives, and the initial value of the scan flag of scan block 3 is 1. In the first scan round, the flag bits corresponding to all 16 pixels of scan block 3 are 1. Based on the pixel visibility information, it can be determined that 13 pixels of scan block 3 are covered by primitive 1, and 3 pixels are covered by primitive 2. Scanning scan block 3 in the first scan round, since the primitives corresponding to the first scan round are primitive 0 and primitive 1, only 13 pixels of the 16 pixels in scan block 3 will be scanned. The other 3 pixels will be scanned in the second scan round. That is, scan block 3 needs to be scanned in the second scan round.
[0059] This embodiment of the present disclosure achieves that, in the image block scanning stage, for each scan of an image block, only the first scan block with a valid scan flag is scanned, and a second scan block that is not covered by any primitive corresponding to the primitive in subsequent scan rounds is identified. The scan flag of the identified second scan block is then set to invalid. Thus, in subsequent scan rounds, the scanning of the second scan block can be skipped, eliminating the need to scan every scan block in the image block. This reduces the number of scan blocks that need to be scanned, thereby improving the efficiency of scanning the image block and further improving the efficiency of subsequent block rendering.
[0060] It can be understood that, without conflicting with the principle and logic, the foregoing various method embodiments mentioned in the present disclosure may be combined with each other to form combined embodiments. Limited by space, the present disclosure will not repeat them here. It can be understood by those skilled in the art that in the above method of the specific embodiment, the specific execution sequence of each step should be determined based on its function and possible internal logic.
[0061] In addition, the present disclosure further provides an image block scanning apparatus, an electronic device, and a computer-readable storage medium, all of which can be used to implement the image block scanning method provided by the present disclosure. For corresponding technical solutions and descriptions, reference may be made to the corresponding records in the method section, which will not be repeated here.
[0062] Figure 3 is a block diagram of an image block scanning apparatus provided according to an embodiment of the present disclosure.
[0063] See Figure 3 , an embodiment of the present disclosure provides an image block scanning apparatus, the image block scanning apparatus includes:
[0064] a scanning module 302, configured to scan a first scanning block in an image block and determine a second scanning block that meets a skip determination condition in the first scanning block in an n-th scanning of an image block scanning stage;
[0065] wherein the first scanning block is a scanning block with a valid scanning flag among a plurality of scanning blocks of the image block, and the skip determination condition includes: the scanning block is not covered by any primitive among the primitives corresponding to the (n+1)-th scanning to the N-th scanning; 1≤n<N, and n and N are integers;
[0066] a setting module 304, configured to set the scanning flag of the second scanning block to invalid.
[0067] Optionally, the apparatus further includes a sending module configured to:
[0068] in the n-th scanning, scan the first scanning block and determine a third scanning block covered by at least one primitive in a first primitive corresponding to the n-th scanning in the first scanning block;
[0069] send primitive coverage information of the n-th scanning to a shader, where the primitive coverage information of the n-th scanning includes: primitive parameters of the first primitive, and pixel information of pixels covered by the first primitive in the third scanning block.
[0070] Optionally, the primitive coverage information of the image block is determined in a primitive accumulation stage before the image block scanning stage.
[0071] Optionally, the initial values of the scan flags of the plurality of scan blocks are determined in a primitive accumulation stage before the image block scanning stage.
[0072] Optionally, the apparatus further comprises a skipping module configured to:
[0073] In the n-th scan, skip a fourth scan block with an invalid scan flag among the plurality of scan blocks of the image block.
[0074] Optionally, the skipping determination condition further comprises: the scan block is completely covered by at least one primitive in second primitives corresponding to the previous n scans.
[0075] Optionally, each scan block of the image block comprises a plurality of pixels, and the apparatus further comprises a primitive accumulation module configured to:
[0076] In a case where the i-th primitive is accumulated in the primitive accumulation stage, determine a target pixel covered by the i-th primitive among the plurality of scan blocks, wherein i≥1 and i is an integer;
[0077] Update visibility information of the target pixel according to a primitive identifier of the i-th primitive;
[0078] In a case where the primitive accumulation stage is completed, determine primitive coverage information of the image block according to visibility information of pixels in the plurality of scan blocks.
[0079] Optionally, the apparatus is applied to tile-based deferred rendering (TBDR), and the image block is one of a plurality of image blocks of a rendering object of TBDR, and each image block is covered by at least one primitive among a plurality of primitives of the rendering object.
[0080] An image block scanning apparatus provided by an embodiment of the present disclosure comprises: a scanning module configured to scan a first scan block in an image block in an n-th scan of an image block scanning stage, and determine a second scan block satisfying a skipping determination condition in the first scan block; wherein the first scan block is a scan block with a valid scan flag among a plurality of scan blocks of the image block, the skipping determination condition comprises: the scan block is not covered by any primitive among primitives corresponding to the (n+1)-th scan to the N-th scan; 1≤n<N and both n and N are integers; a setting module configured to set a scan flag of the second scan block to invalid.
[0081] This embodiment of the present disclosure enables the scanning of only the first scan block with a valid scanning flag during each scan of an image block in the image block scanning stage. It then identifies the second scan block that is not covered by any primitive corresponding to primitives in subsequent scan rounds, and sets the scanning flag of the identified second scan block to invalid. Therefore, in subsequent scan rounds, the scanning of the second scan block can be skipped, eliminating the need to scan every scan block in the image block. This reduces the number of scan blocks that need to be scanned, thereby improving the efficiency of image block scanning and further improving the efficiency of subsequent block rendering.
[0082] Figure 4 This is a block diagram of an electronic device provided in an embodiment of the present disclosure.
[0083] See Figure 4 This disclosure provides an electronic device 400, which includes: at least one processor 401; at least one memory 402; and one or more I / O interfaces 403 connected between the processor 401 and the memory 402; wherein the memory 402 stores one or more computer programs that can be executed by the at least one processor 401, and the one or more computer programs are executed by the at least one processor 401 to enable the at least one processor 401 to perform the above-described image block scanning method.
[0084] This disclosure also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the image block scanning method described above. The computer-readable storage medium may be volatile or non-volatile.
[0085] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the above-described image block scanning method.
[0086] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0087] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0088] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0089] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0090] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0091] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0092] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0093] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0095] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. An image block scanning method, characterized in that, Comprising: in an n-th scan of a tile scanning stage, scanning a first scanning tile in an image tile, and determining a second scanning tile that satisfies a skip determination condition in the first scanning tile; wherein the first scanning tile is a scanning tile with a valid scanning flag among a plurality of scanning tiles of the image tile, and the skip determination condition comprises: the scanning tile is not covered by any primitive among primitives corresponding to an (n+1)-th scan to an N-th scan; 1≤n<N, and n and N are integers; setting the scanning flag of the second scanning tile to be invalid.
2. The method as described in claim 1, characterized in that, the method further comprises: in the n-th scan, scanning the first scanning tile, and determining a third scanning tile covered by at least one primitive in a first primitive corresponding to the n-th scan in the first scanning tile; sending primitive coverage information of the n-th scan to a shader, wherein the primitive coverage information of the n-th scan comprises: primitive parameters of the first primitive, and pixel information of pixels covered by the first primitive in the third scanning tile.
3. The method as described in claim 2, characterized in that, the primitive coverage information of the image tile is determined in a primitive accumulation stage before the image tile scanning stage.
4. The method as described in claim 1, characterized in that, initial values of scanning flags of the plurality of scanning tiles are determined in a primitive accumulation stage before the image tile scanning stage.
5. The method as described in claim 1, characterized in that, the method further comprises: in the n-th scan, skipping a fourth scanning tile with an invalid scanning flag among the plurality of scanning tiles of the image tile.
6. The method as described in claim 1, characterized in that, the skip determination condition further comprises: the scanning tile is completely covered by at least one primitive among a second primitive corresponding to the first n scans.
7. The method as described in claim 1, characterized in that, each scanning tile of the image tile comprises a plurality of pixels, and the method further comprises: in a case where an i-th primitive is accumulated in a primitive accumulation stage, determining a target pixel covered by the i-th primitive among the plurality of scanning tiles, wherein i≥1 and i is an integer; updating visibility information of the target pixel according to a primitive identifier of the i-th primitive; in a case where the primitive accumulation stage is completed, determining primitive coverage information of the image tile according to visibility information of pixels in the plurality of scanning tiles.
8. The method as described in claim 1, characterized in that, the method is applied to tile-based deferred rendering (TBDR), the image tile is one of a plurality of image tiles of a rendering object of TBDR, and each image tile is covered by at least one primitive among a plurality of primitives of the rendering object.
9. An image block scanning device, characterized in that, comprising: a scanning module, configured to, in an n-th scan of an image tile scanning stage, scan a first scanning tile in an image tile, and determine a second scanning tile that satisfies a skip determination condition in the first scanning tile; wherein the first scanning tile is a scanning tile with a valid scanning flag among a plurality of scanning tiles of the image tile, and the skip determination condition comprises: the scanning tile is not covered by any primitive among primitives corresponding to an (n+1)-th scan to an N-th scan; 1≤n<N, and n and N are integers; a setting module, configured to set the scanning flag of the second scanning tile to be invalid.
10. An electronic device, characterized in that, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein The memory stores one or more computer programs that can be executed by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-8.
12. A computer program product, characterized in that, Includes computer-readable code, which, when executed in a processor of an electronic device, causes the processor in the electronic device to perform the method as described in any one of claims 1-8.