A method and device for detecting overdraw of an image frame during rendering, electronic equipment and storage medium

By analyzing the transparency test enable information and material information of the rendering layer, the misuse of Alpha-Test was identified, the problem of overdraw during image frame rendering was solved, and the accurate detection and diagnosis of overdraw was achieved.

CN122115662APending Publication Date: 2026-05-29上海沐龙网络科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
上海沐龙网络科技有限公司
Filing Date
2026-02-13
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the abuse of Alpha-Test leads to Early-Z bypass, causing high overdraw and fragment shading performance bottlenecks in the Late-Z stage, and there is a lack of effective overdraw detection solutions.

Method used

By enabling information and material information based on the transparency test of the rendering layer, misuse of Alpha-Test is identified and recorded, and overdrawing of image frames during the rendering process is accurately detected. By using rendering layer splitting and material analysis, overdrawing can be accurately located and recorded at the pixel level.

Benefits of technology

It achieves accurate detection of overdraw during image frame rendering, especially overdraw caused by Alpha-Test abuse, quickly diagnoses overdraw and high GPU consumption issues caused by Late-Z, and provides pixel-level detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115662A_ABST
    Figure CN122115662A_ABST
Patent Text Reader

Abstract

The application discloses a kind of overdraw detection methods, device, electronic equipment and storage medium of image frame in rendering process, the method includes: based on the rendering result of each rendering layer corresponding to the image frame to be generated, the first attribute information of each rendering layer is determined;First attribute information includes the transparency test enablement information of rendering layer and the transparency value of pixel in rendering layer;Based on the material information associated with image frame, and the first attribute information of each rendering layer, determine the misuse result of target rendering layer;Misuse result is used to indicate that there is pixel in target rendering layer Misuse transparency test;Based on the misuse result of target rendering layer, determine the overdraw detection result of image frame;Overdraw detection result is used to indicate that the pixel corresponding to image frame is overdrawn in rendering process.The present scheme can accurately locate the overdraw caused by Alpha-Test abuse.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image rendering technology, and in particular to a method, apparatus, electronic device, and storage medium for detecting over-drawing of image frames during the rendering process. Background Technology

[0002] In modern GPU rendering pipelines, the misuse of Alpha-Test (i.e., transparency test) can lead to Early-Z rendering being bypassed, resulting in high overdraw and fragment shading performance bottlenecks in the Late-Z stage. Currently, there is a lack of solutions to detect this high overdraw situation. Summary of the Invention

[0003] This invention provides a method, apparatus, electronic device, and storage medium for detecting overdraw of image frames during the rendering process. It can accurately detect overdraw of image frames during the rendering process, and in particular, can accurately locate overdraw caused by the abuse of Alpha-Test.

[0004] In a first aspect, the present invention provides a method for detecting overdrawing of image frames during the rendering process, comprising:

[0005] Based on the rendering results of each rendering layer corresponding to the image frame to be generated, the first attribute information of each rendering layer is determined; each rendering layer is a layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer.

[0006] Based on the material information associated with the image frame and the first attribute information of each rendering layer, the misuse result of the target rendering layer is determined; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer that have been misused for transparency testing.

[0007] Based on the misuse results of the target rendering layer, the overdraw detection result of the image frame is determined; the overdraw detection result is used to indicate the situation where the pixels corresponding to the image frame are overdrawn during the rendering process.

[0008] Secondly, the present invention also provides a detection device for over-drawing of image frames during the rendering process, comprising:

[0009] The first attribute information determination module is used to determine the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated; each rendering layer is a layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer.

[0010] The misuse result determination module is used to determine the misuse result of the target rendering layer based on the material information associated with the image frame and the first attribute information of each rendering layer; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer where transparency testing has been misused.

[0011] The detection result determination module is used to determine the overdraw detection result of the image frame based on the misuse result of the target rendering layer; the overdraw detection result is used to indicate the situation where the pixels corresponding to the image frame are overdrawn during the rendering process.

[0012] Thirdly, this invention also provides an electronic device, comprising:

[0013] One or more processors;

[0014] Storage device for storing one or more programs.

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting overdrawing of image frames during rendering, as provided in any embodiment of the present invention.

[0016] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a method for detecting overdrawing of image frames during rendering, as provided in any embodiment of the present invention.

[0017] The technical solution of this invention determines the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated. Each rendering layer is a layer that needs to be drawn during the rendering process of the image frame. The first attribute information includes the transparency test enabling information of the rendering layer and the transparency value of the pixels in the rendering layer. Then, based on the material information associated with the image frame and the first attribute information of each rendering layer, the misuse result of the target rendering layer is determined. The target rendering layer is the layer among the rendering layers where the transparency test is enabled. This misuse result indicates that some pixels in the target rendering layer have had their transparency test misused. Next, based on the misuse result of the target rendering layer, the overdraw detection result of the image frame is determined. This overdraw detection result indicates that the pixels corresponding to the image frame are overdrawn during the rendering process. This solution, by splitting the rendering layers and analyzing real-world usage scenarios of Alpha-Test, determines whether any pixels in the rendering layers are being misused for transparency testing. It achieves accurate detection of overdrawing of image frames during rendering, particularly pinpointing overdrawing caused by Alpha-Test abuse. Furthermore, this solution can record Early-Z bypass behavior at the pixel level, enabling rapid diagnosis of Late-Z-induced overdraw and high GPU consumption issues without relying on invisible GPU internal states (such as precise Late-Z behavior).

[0018] The above description of the invention is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0019] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0020] Figure 1 This is a flowchart illustrating a method for detecting overdrawing of an image frame during rendering, provided in an embodiment of the present invention.

[0021] Figure 2 This is a flowchart illustrating another method for detecting overdrawing of an image frame during rendering, provided in an embodiment of the present invention.

[0022] Figure 3 This is a logical framework diagram for overdraw detection of image frames provided in an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of an image frame over-drawing detection device provided in an embodiment of the present invention;

[0024] Figure 5 This is a schematic diagram of an electronic device that implements a method for detecting overdrawing of image frames during the rendering process, as provided in an embodiment of the present invention. Detailed Implementation

[0025] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.

[0026] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0027] The term "comprising" and its variations as used herein are open-ended inclusion, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0028] It should be noted that the concepts of "first" and "second" mentioned in this invention are only used to distinguish different devices, modules, or units, and are not used to limit the order of functions performed by these devices, modules, or units or their interdependencies. The modifications of "a" and "a plurality of" mentioned in this invention are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0029] It should be noted that the names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0030] Figure 1This is a flowchart illustrating a method for detecting overdraw in an image frame during rendering, provided by an embodiment of the present invention. This embodiment is applicable to detecting whether an image frame is overdrawn during rendering. The method can be executed by an overdraw detection device for image frames during rendering. This overdraw detection device can be implemented in software and / or hardware and is generally integrated into any electronic device with network communication capabilities, such as a mobile terminal, PC, or server. Figure 1 As shown, the method for detecting overdrawing of image frames during the rendering process in this embodiment of the invention may include the following steps:

[0031] S110. Based on the rendering results of each rendering layer corresponding to the image frame to be generated, determine the first attribute information of each rendering layer; each rendering layer is the layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer.

[0032] Here, the image frame to be generated refers to the image that needs to be generated and displayed after rendering. Correspondingly, the rendering layer refers to the layer that needs to be drawn during the rendering process of this image frame. After the various rendering layers are rendered, they are composited to obtain the image frame. This image frame can be in RGBA format.

[0033] The transparency value (or alpha value) is the numerical value of a pixel on the alpha channel. Transparency values ​​quantify the degree to which light or underlying content can pass through an object or color. A higher transparency value indicates that the pixel is less transparent; for example, an alpha value of 0 represents complete transparency, and an alpha value of 1 represents complete opacity. Relatedly, alpha testing is a technique in computer graphics that determines whether to render a pixel by comparing its alpha value to a preset threshold. For example, if the alpha value of a pixel / fragment is less than or equal to the set threshold, then that pixel / fragment will not be drawn and will be discarded. Correspondingly, alpha testing enable information indicates whether alpha testing is enabled on the rendering layer.

[0034] Specifically, the rendering results of rendering layers can be captured in the intermediate rendering results of the GPU rendering pipeline. By parsing the rendering results of each rendering layer corresponding to the image frame to be generated, the transparency test enabling information of each rendering layer and the transparency value of the pixels in the rendering layer can be determined, thereby determining the first attribute information of each rendering layer. This enables the acquisition of the judgment basis in subsequent solutions and bypasses the problem that Late-Z cannot be directly detected.

[0035] S120. Based on the material information associated with the image frame and the first attribute information of each rendering layer, determine the misuse result of the target rendering layer; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer that have been misused for transparency testing.

[0036] Material information indicates the visual and optical characteristics of objects within an image frame. Simply put, material information determines the desired appearance of objects within the image frame. For example, material information could include: glass, water, trees, buildings, grass, or mist. The material information associated with an image frame is planned and set in advance based on relevant artistic requirements.

[0037] The target rendering layer is the layer among all rendering layers where alpha testing is enabled. For example, the rendering layer with alpha testing enabled can be identified as the target rendering layer by using the alpha testing enable information of each rendering layer.

[0038] It is understandable that if Alpha-Test is used for truly transparent materials (such as glass, water surfaces, etc.), the pixels corresponding to those materials will be discarded, causing Early-Z to be corrupted. This forces the GPU to enter Late-Z, resulting in overdraw during the Late-Z phase. In this embodiment, the misuse result is used to indicate that some pixels in the rendering layer have had their transparency test misused.

[0039] Specifically, based on the material information associated with the image frame and the first attribute information of each rendering layer, the usage of Alpha-Test can be detected to identify whether Alpha-Test is misused for real transparency effect in the target rendering layer, thereby determining whether there are any pixels in the target rendering layer that have been misused for transparency testing, and thus determining the misuse result of the target rendering layer.

[0040] S130. Based on the misuse results of the target rendering layer, determine the overdraw detection results of the image frame; the overdraw detection results are used to indicate the situation where the corresponding pixels of the image frame are overdrawn during the rendering process.

[0041] Specifically, based on the misuse results of the target rendering layer, it is possible to determine which pixels have been misused for transparency testing. Then, by combining this with the depth values ​​of each rendering layer, the extent and frequency of overdrawing of the relevant pixels during rendering can be determined, thus establishing the overdraw detection result for the image frame. Of course, the specific parameters used to characterize the overdraw detection result can be differentiated based on actual needs. For example, the number of times each pixel is overdrawn (overdraw count per pixel) can be used as the overdraw detection result; the total number of overdraws in the entire image frame (total overdraw count) can also be used; and areas with severe overdraw identified based on the total number of overdraws in the entire image frame can also be used as the overdraw detection result. Different parameter settings can be applied based on actual needs to determine the overdraw detection result for the image frame.

[0042] The technical solution of this invention determines the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated. Each rendering layer is a layer that needs to be drawn during the rendering process of the image frame. The first attribute information includes the transparency test enabling information of the rendering layer and the transparency value of the pixels in the rendering layer. Then, based on the material information associated with the image frame and the first attribute information of each rendering layer, the misuse result of the target rendering layer is determined. The target rendering layer is the layer among the rendering layers where the transparency test is enabled. This misuse result indicates that some pixels in the target rendering layer have had their transparency test misused. Next, based on the misuse result of the target rendering layer, the overdraw detection result of the image frame is determined. This overdraw detection result indicates that the pixels corresponding to the image frame are overdrawn during the rendering process. This solution, by splitting the rendering layers and analyzing real-world usage scenarios of Alpha-Test, determines whether any pixels in the rendering layers are being misused for transparency testing. It achieves accurate detection of overdrawing of image frames during rendering, particularly pinpointing overdrawing caused by Alpha-Test abuse. Furthermore, this solution can record Early-Z bypass behavior at the pixel level, enabling rapid diagnosis of Late-Z-induced overdraw and high GPU consumption issues without relying on invisible GPU internal states (such as precise Late-Z behavior).

[0043] Figure 2This is a flowchart illustrating another method for detecting overdraw during the rendering process of an image frame, provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining the overdraw detection result of an image frame based on the misuse result of the target rendering layer in the aforementioned embodiments, building upon the technical solution of the previous embodiments. Optionally, the overdraw detection result includes a global detection result and a local detection result; the global detection result is used to indicate the overall overdraw situation of the image frame; the local detection result is used to indicate the overdraw situation of a sub-region within the image frame; the sub-region is obtained by dividing the region corresponding to the image frame according to a preset size; correspondingly, determining the overdraw detection result of the image frame based on the misuse result of the target rendering layer includes: determining the number of overdraws corresponding to each pixel based on the drawing trajectory chain of each pixel; the drawing trajectory chain is used to indicate the drawing and coloring situation of the pixel in each rendering layer in the depth direction; based on the... The global detection result is determined by the first total count corresponding to the image frame and the second total count corresponding to the target pixel; the target pixel is a pixel that misused the transparency test; the first total count indicates the total number of times all pixels in the image frame were overdrawn; the second total count indicates the total number of times the target pixel was overdrawn; the local detection result is determined based on the third total count corresponding to the sub-region and the fourth total count corresponding to the target pixel within the sub-region; the third total count indicates the total number of times all pixels within the sub-region were overdrawn; the fourth total count indicates the total number of times the target pixel within the sub-region was overdrawn. This embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 2 As shown, the method for detecting overdrawing of image frames during the rendering process in this embodiment of the invention may include the following steps:

[0044] S210. Based on the rendering results of each rendering layer corresponding to the image frame to be generated, determine the first attribute information of each rendering layer; each rendering layer is the layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer.

[0045] For example, in this embodiment, the screen space size corresponding to each image frame is defined as... The pixels .use This represents the i-th rendering layer in the drawing order. Therefore, for each rendering layer... and pixels It can capture rendering data from each layer of the GPU rendering pipeline to collect the following data:

[0046] : Represents the color value output by the i-th rendering layer;

[0047] : Represents the depth value output by the i-th rendering layer;

[0048] : Represents the Alpha value of a pixel / fragment in the i-th rendering layer, which can be obtained from the material information or sampled from the shader;

[0049] : Indicates that the transparency test is enabled for the i-th rendered layer, where A value of 1 indicates that Alpha-Test is enabled, and a value of 0 indicates that Alpha-Test is not enabled.

[0050] : Represents the discard status of pixels / fragments in the i-th rendering layer, used to record whether Early-Z is invalid, where A value of 1 indicates that the pixel / fragment has been discarded, while a value of 0 indicates that the pixel / fragment has not been discarded.

[0051] : Indicates whether the pixels / fragments of the i-th rendering layer are written to the depth buffer, where A value of 1 indicates that the pixel / fragment has been written to the depth buffer, while a value of 0 indicates that the pixel / fragment has not been written to the depth buffer.

[0052] S220. Based on the material information associated with the image frame and the first attribute information of each rendering layer, determine the misuse result of the target rendering layer; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer that have been misused for transparency testing.

[0053] For example, in this embodiment, the following material information of the Z-BUFFER buffer (i.e., the depth buffer) can be obtained through the CommandBuffer: base color. normal line , metallicity Roughness Depth value and transparency value .

[0054] As an optional but non-limiting implementation, based on the material information associated with the image frame and the first attribute information of each rendering layer, the misuse result of the target rendering layer is determined, including: obtaining the transparency value of each pixel in the target rendering layer; and determining the misuse result of the target rendering layer based on the material information associated with the image frame, the transparency value of each pixel in the target rendering layer, and the transparency threshold. Using this optional solution, it is possible to determine whether any pixels in a rendering layer with Alpha-Test enabled have been misused by Alpha-Test, based on the material information associated with the image frame and the transparency value of each pixel.

[0055] The transparency threshold can be understood as a threshold value used for transparency testing. When the transparency value of a pixel / fragment is greater than the transparency threshold, the pixel / fragment will be retained and participate in subsequent rendering; when the transparency value of a pixel / fragment is less than or equal to the transparency threshold, the pixel / fragment will be discarded and not written to the framebuffer.

[0056] Specifically, the transparency value of each pixel in the target rendering layer can be obtained; then, based on the material information associated with the image frame, the transparency value of each pixel in the target rendering layer, and the transparency threshold, it can be identified whether the Alpha-Test was misused on a truly transparent material, thereby determining the misuse result of the target rendering layer.

[0057] As an optional but non-limiting implementation, the misuse result of the target rendering layer is determined based on the material information associated with the image frame, the transparency value and transparency threshold of each pixel in the target rendering layer, including: determining the target pixel from each pixel of the target rendering layer based on the transparency value and transparency threshold of each pixel in the target rendering layer; the transparency value of the target pixel is less than or equal to the transparency threshold; if the material information associated with the image frame is a transparent material, then it is determined that the target pixel has been misused for transparency testing.

[0058] Transparent layer materials refer to materials that allow light to pass through partially or completely. Simply put, transparent layer materials are materials that ultimately present a truly transparent visual characteristic in the visual image. Examples of transparent layer materials include glass, water surfaces, gauze, and mist.

[0059] Specifically, based on the relationship between the transparency value of each pixel in the target rendering layer and the transparency threshold, target pixels can be identified from the pixels in the target rendering layer. If the transparency value of the identified target pixels is less than or equal to the transparency threshold, such target pixels will be discarded (marked as discarded) after Alpha-Test. Furthermore, if the material information associated with the image frame is a transparent material, and Alpha-Test is enabled, these target pixels will be discarded, causing Early-Z rendering to be corrupted and forcing the GPU to enter Late-Z rendering, thus triggering overdraw in the Late-Z stage. This indicates that the transparency test for the target pixels has been misused.

[0060] S230. Based on the drawing trajectory chain of each pixel, determine the number of overdraws corresponding to each pixel; the drawing trajectory chain is used to indicate the drawing and coloring of the pixel in each rendering layer in the depth direction.

[0061] The drawing trajectory chain indicates how a pixel is drawn and shaded in each rendering layer along the depth direction. Specifically, the drawing trajectory chain can be determined based on the depth value of each pixel in the rendering layer and the depth values ​​of the pixels stored in the depth buffer. For example, for a given pixel... Its depth value stored in the depth buffer is 0.3, and this pixel... In a certain rendering layer The corresponding depth value is 0.5, and this pixel... In another rendering layer If the corresponding depth value is 0.3, it means that the pixel is in the rendering layer. The middle layer is not drawn or shaded (possibly due to being discarded), while the rendering layer... The pixel in the middle is drawn and colored (having passed the depth test). Following the same principle, this allows us to determine how each pixel is drawn and colored in each rendering layer along the depth direction, thus establishing the drawing trajectory chain for each pixel. Correspondingly, the overdraw count indicates the total number of times a pixel is drawn and colored across all rendering layers along the depth direction.

[0062] Specifically, after determining the drawing trajectory chain corresponding to each pixel, the number of overdraws corresponding to each pixel can be determined based on the drawing trajectory chain of each pixel.

[0063] For example, in this embodiment, for each pixel point Construct the following drawing trajectory chain:

[0064] ;

[0065] in, Represents pixels The corresponding drawing trajectory chain; This indicates the pixel value in the nth rendering layer. The drawing and coloring situation. , This means that the pixel was drawn and colored in the nth rendering layer. This means that the pixel was not drawn or colored in the nth rendering layer.

[0066] For example, in this embodiment, the pixel point can be determined using the following formula. Corresponding overdraw count:

[0067] ;

[0068] in, Represents pixels The corresponding number of overdraws, i.e., pixels. Number of times it was overdrawn; This represents the pixel value of the i-th rendering layer. The coloring situation. , This represents the pixel value of the i-th rendering layer. Colored, This indicates that the i-th rendering layer has no pixel points. The shading is performed; n represents the total number of rendering layers. This formula can indicate how many times a pixel participates in the drawing process, even if it is only displayed once in the end, it may still consume multiple pixel shading overheads during the rendering process.

[0069] S240. Determine the global detection result based on the first total number of times corresponding to the image frame and the second total number of times corresponding to the target pixel; the target pixel is the pixel that misused the transparency test; the first total number of times is used to indicate the total number of times all pixels in the image frame were overdrawn; the second total number of times is used to indicate the total number of times the target pixel was overdrawn.

[0070] In this implementation, overdraw detection results can include global detection results and local detection results. Global and local detection results can be understood as two different dimensions of metrics used to quantify the quality of Alpha-Test usage: one is a global dimension metric, and the other is a local dimension metric. The global detection result indicates the overall overdraw situation of the image frame. It should be noted that the global detection result can be characterized by different parameter indicators set by those skilled in the art based on actual needs. For example, the global detection result can be characterized by the average number of overdraws across the entire image frame; or it can be a conclusion obtained after analyzing the total number of overdraws across the entire image frame. Any parameter indicator belonging to the global dimension of the image frame can be used as the global detection result; further details are not specified here.

[0071] Specifically, the overdraw counts for each individual pixel are summed to determine the total number of times all pixels in the image frame have been overdrawn, which is the first total count for the image frame. Then, for the target pixels, the overdraw counts are summed again to determine the total number of times each target pixel has been overdrawn, which is the second total count for the target pixel. The target pixels are those that have been misused for the transparency test; these can be identified from among the pixels based on the misuse results of the target rendering layer. Finally, the global detection result can be determined based on the first total count for the image frame and the second total count for the target pixels.

[0072] For example, in this embodiment, the second total number of times corresponding to the target pixel can be calculated using the following formula:

[0073] ;

[0074] in, This represents the second total number of times corresponding to the target pixel, which is the number of overdraws corresponding to the pixels that were misused in the Alpha-Test. This indicates the i-th rendering layer with transparency testing enabled at pixel point. The number of times the drawing is performed.

[0075] As an optional but non-limiting implementation, the global detection result is determined based on a first total number of times corresponding to the image frame and a second total number of times corresponding to the target pixel. This includes: determining the first total number of times based on the overdraw counts corresponding to each pixel; determining the global average number of times of drawing based on the first total number of times and the total number of pixels in the image frame; determining a first proportion based on the ratio between the second total number of times corresponding to the target pixel and the first total number of times corresponding to the image frame; and using the global average number of times of drawing and the first proportion as the global detection result. Using this optional scheme, the global average number of times of drawing and the first proportion can be determined based on the overdraw counts corresponding to each pixel in the image frame and the overdraw counts corresponding to the target pixel, serving as the detection result in the global dimension.

[0076] The total number of pixels refers to the total number of pixels in an image frame, which can generally be obtained by multiplying the width of the image frame by its height.

[0077] Specifically, the overdraw counts for each pixel are summed to determine the first total count. Then, the global average number of draws is determined based on the first total count and the total number of pixels in the image frame. The global average number of draws reflects the overall overdraw situation of the image frame. Next, the first proportion is determined based on the ratio between the second total count for the target pixel and the first total count for the image frame. This first proportion represents the percentage of overdraws caused by misuse of Alpha-Test in the overall overdraw count of the image frame. A higher first proportion indicates a higher overdraw ratio due to misuse of Alpha-Test and a heavier overhead for transparency processing. Finally, the global average number of draws and the first proportion are used together as the global detection result and displayed in the output.

[0078] For example, in this embodiment, the global average number of draws can be calculated using the following formula:

[0079] ;

[0080] in, This represents the global average number of renders; W represents the width of the image frame; H represents the height of the image frame. Represents pixels The corresponding number of overdraws.

[0081] For example, in this embodiment, the first proportion can be calculated using the following formula:

[0082] ;

[0083] in, Indicates the first percentage; This represents the first total number of times the image frame is overdrawn, which is the total number of times the entire image frame is overdrawn. This represents the second total number of times the target pixel is drawn, which is the sum of the number of times the pixel is overdrawn due to misuse of Alpha-Test.

[0084] S250. Based on the third total number of times corresponding to the sub-region and the fourth total number of times corresponding to the target pixel in the sub-region, determine the local detection result; the third total number of times is used to indicate the total number of times all pixels in the sub-region are overdrawn; the fourth total number of times is used to indicate the total number of times the target pixel in the sub-region is overdrawn.

[0085] In this implementation, the overdraw detection result may also include local detection results. Local detection results are used to indicate the overdraw status of sub-regions within an image frame, where the sub-regions are obtained by dividing the corresponding region of the image frame according to a preset size. For example, they can be calculated according to... or The size is used to divide the region corresponding to the image frame into multiple sub-regions.

[0086] Specifically, for a sub-region, the overdraw counts for all pixels within that sub-region are summed to determine the total number of overdraws for all pixels within the sub-region, which is the third total count for the sub-region. Then, for the target pixel within that sub-region, the overdraw counts are similarly summed to determine the total number of overdraws for the target pixel within the sub-region, which is the fourth total count for the target pixel. The same calculation principle applies to other sub-regions, which will not be elaborated upon here.

[0087] For example, in this embodiment, it can be done according to the following: The size of the screen is used to divide it into... There are 1 tile (i.e., sub-region), and the third total number of times corresponding to each sub-region is calculated using the following formula:

[0088] ;

[0089] in, This indicates the third total count corresponding to the sub-region tile; Represents pixels These are pixels belonging to the sub-region tile; Represents pixels The corresponding number of overdraws.

[0090] As an optional but non-limiting implementation, the local detection result is determined based on the third total count corresponding to the sub-region and the fourth total count corresponding to the target pixels within the sub-region. This includes: determining the target sub-region based on the third total count corresponding to each sub-region and a preset count threshold; ensuring the third total count corresponding to the target sub-region is greater than the preset count threshold; determining the local risk value corresponding to the target sub-region based on the fourth total count corresponding to the target sub-region and the total number of pixels in the target sub-region, and using the local risk value as the local detection result. Using this optional scheme, the target sub-region can be determined based on the third total count corresponding to the sub-region, and further, the local risk value corresponding to the target sub-region can be determined based on the fourth total count corresponding to the target sub-region.

[0091] The preset overdraw threshold can be understood as a threshold / critical value used to determine whether overdraw is overloaded. For example, if the number of overdraws in a sub-region exceeds the preset threshold, it means that the sub-region is overloaded; if the number of overdraws in a sub-region is less than or equal to the preset threshold, it means that the sub-region is not overloaded. The preset threshold can be set differently based on actual needs.

[0092] The local risk value can be understood as a parameter that reflects the severity of overdraw caused by Alpha-Test in a sub-region.

[0093] Specifically, the target sub-region can be determined based on the relationship between the third total number of times corresponding to each sub-region and a preset threshold number of times. The third total number of times corresponding to the determined target sub-region is greater than the preset threshold number of times. Of course, there can be at least one target sub-region. The principle for calculating the local risk value of each target sub-region is the same. Therefore, in this embodiment, only the principle for calculating the local risk value of one target sub-region will be explained, and others will not be elaborated on. Next, the local risk value of the target sub-region can be determined based on the fourth total number of times corresponding to the target sub-region (i.e., the sum of overdraw times corresponding to pixels that cause Alpha-Test misuse in the target sub-region) and the total number of pixels in the target sub-region. For example, the "fourth total number of times corresponding to the target sub-region" can be compared with the "total number of pixels in the target sub-region", and the ratio obtained can be used as the local risk value. The determined local risk value can then be used as the local detection result. It can be understood that if the local risk value is higher, it means that there are more pixels with high overdraw caused by Alpha-Test misuse in its corresponding sub-region.

[0094] For example, if a certain sub-region ,in If the value indicates a preset threshold number of draw attempts, it means that the overdraw situation in this sub-region is severe, exceeding the set threshold number, indicating overdraw overload. Next, for this sub-region, the local risk value can be calculated using the following formula:

[0095] ;

[0096] in, This represents the local risk value corresponding to a sub-region; T represents the side length (either width or height) of the sub-region. This indicates the total number of pixels in the sub-region; This indicates that it has been enabled. The pixel count is 1; This means that the fourth total count corresponding to the target sub-region is actually obtained by accumulating the count of all pixels that meet the requirements in the sub-region tile.

[0097] As an optional but non-limiting implementation, after using local risk values ​​as local detection results, the method further includes: constructing a heatmap based on the local risk values ​​corresponding to each target sub-region; and outputting and displaying the heatmap. This optional approach provides a visual output method, and the heatmap helps developers quickly identify GPU performance bottlenecks and pinpoint the specific material or object source.

[0098] Specifically, a heatmap can be constructed based on the local risk values ​​corresponding to each target sub-region. The heatmap's colors reflect the magnitude or intensity of local risk values, and color changes are achieved by mapping these local risk values ​​to predefined color gradients, thus determining the heatmap color for each target sub-region. For example, the higher the local risk value, the whiter the corresponding color in the heatmap. Once the heatmap is constructed, it can be output and displayed, helping developers quickly identify GPU performance bottlenecks and pinpoint the specific material or object source. For example... Figure 3 This is a logical framework diagram for overdraw detection of image frames provided in an embodiment of the present invention, such as... Figure 3 As shown, in the heatmap of overdraw output after detection, the whiter the color, the more severe the overdraw situation.

[0099] Optionally, in this embodiment, a high-risk sub-region can be determined by comparing the local risk value corresponding to the target sub-region with a preset risk threshold; the local risk value corresponding to the high-risk sub-region is greater than the preset risk threshold; and an information alarm is issued for the high-risk sub-region.

[0100] For example, if the local risk value of a sub-region ,in If a preset risk threshold is set (e.g., 0.5 or 50%), then the sub-region is considered a high-risk sub-region, meaning it is a high-risk area misused by Alpha-Test, and an alert needs to be issued.

[0101] Optionally, in this embodiment, based on the overdraw detection results of image frames, corresponding optimization processing can be performed to reduce overdraw and late-Z problems caused by the abuse of alpha-tests. For example, unnecessary alpha-tests can be changed to alpha blending mode; for example, the discard operation can be delayed to avoid the early-Z stage; for example, transparent objects can be sorted in layers or pre-processed with masks, etc.

[0102] The technical solution of this invention determines the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated. Each rendering layer is a layer that needs to be drawn during the rendering process of the image frame. The first attribute information includes the transparency test enabling information of the rendering layer and the transparency value of the pixels in the rendering layer. Then, based on the material information associated with the image frame and the first attribute information of each rendering layer, the misuse result of the target rendering layer is determined. The target rendering layer is the layer among the rendering layers where transparency testing is enabled. This misuse result indicates that some pixels in the target rendering layer have had their transparency test misused. Next, based on the drawing trajectory chain of each pixel, the first attribute information of each pixel is determined. The overdraw count for each pixel is used to indicate the rendering and shading of the pixel in each rendering layer in the depth direction. A global detection result is determined based on the first total count for the image frame and the second total count for the target pixel. The first total count indicates the total number of times all pixels in the image frame are overdrawn, and the second total count indicates the total number of times the target pixel is overdrawn. A local detection result is determined based on the third total count for the sub-region and the fourth total count for the target pixel within the sub-region. The third total count indicates the total number of times all pixels within the sub-region are overdrawn, and the fourth total count indicates the total number of times the target pixel within the sub-region is overdrawn. This solution, by splitting the rendering layers and analyzing real-world usage scenarios of Alpha-Test, determines whether any pixels in the rendering layers are being misused for transparency testing. It achieves accurate detection of overdrawing of image frames during rendering, particularly pinpointing overdrawing caused by Alpha-Test abuse. Furthermore, this solution can record Early-Z bypass behavior at the pixel level, enabling rapid diagnosis of Late-Z-induced overdraw and high GPU consumption issues without relying on invisible GPU internal states (such as precise Late-Z behavior).

[0103] Figure 4 This is a schematic diagram of a device for detecting overdrawing of image frames during rendering, provided in an embodiment of the present invention. This embodiment is applicable to detecting whether an image frame is overdrawn during rendering. The device for detecting overdrawing of image frames during rendering can be implemented in software and / or hardware, and is generally integrated into any electronic device with network communication capabilities, such as a mobile terminal, PC, or server. Figure 4 As shown, the image frame over-drawing detection device of this embodiment of the invention may include a first attribute information determination module 410, a misuse result determination module 420, and a detection result determination module 430. Wherein:

[0104] The first attribute information determination module 410 is used to determine the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated; each rendering layer is a layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer.

[0105] The misuse result determination module 420 is used to determine the misuse result of the target rendering layer based on the material information associated with the image frame and the first attribute information of each rendering layer; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer that have been misused for transparency testing.

[0106] The detection result determination module 430 is used to determine the overdraw detection result of the image frame based on the misuse result of the target rendering layer; the overdraw detection result is used to indicate the situation where the pixels corresponding to the image frame are overdrawn during the rendering process.

[0107] The technical solution of this invention involves a first attribute information determination module determining the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated. Each rendering layer is a layer that needs to be drawn during the rendering process of the image frame. The first attribute information includes the transparency test enabling information of the rendering layer and the transparency value of the pixels in the rendering layer. Then, a misuse result determination module determines the misuse result of the target rendering layer based on the material information associated with the image frame and the first attribute information of each rendering layer. The target rendering layer is the layer among the rendering layers where transparency testing is enabled. This misuse result indicates that some pixels in the target rendering layer have had their transparency test misused. Next, a detection result determination module determines the overdraw detection result of the image frame based on the misuse result of the target rendering layer. This overdraw detection result indicates that the pixels corresponding to the image frame are overdrawn during the rendering process. This solution, by splitting the rendering layers and analyzing real-world usage scenarios of Alpha-Test, determines whether any pixels in the rendering layers are being misused for transparency testing. It achieves accurate detection of overdrawing of image frames during rendering, particularly pinpointing overdrawing caused by Alpha-Test abuse. Furthermore, this solution can record Early-Z bypass behavior at the pixel level, enabling rapid diagnosis of Late-Z-induced overdraw and high GPU consumption issues without relying on invisible GPU internal states (such as precise Late-Z behavior).

[0108] As an optional but non-limiting implementation, the misuse result determination module 420 includes a transparency value unit and a misuse result determination unit. Wherein:

[0109] Transparency value unit, used to obtain the transparency value of each pixel in the target rendering layer;

[0110] The misuse result determination unit is used to determine the misuse result of the target rendering layer based on the material information associated with the image frame, the transparency value of each pixel in the target rendering layer, and the transparency threshold.

[0111] As an optional but non-limiting implementation, the misuse result determination unit is specifically used to: determine a target pixel from each pixel in the target rendering layer based on the transparency value and transparency threshold of each pixel in the target rendering layer; the transparency value of the target pixel is less than or equal to the transparency threshold; if the material information associated with the image frame is a transparent material, then it is determined that the target pixel has been misused for transparency testing.

[0112] As an optional but non-limiting implementation, the overdraw detection result includes global detection results and local detection results; the global detection result is used to indicate the overall overdraw situation of the image frame; the local detection result is used to indicate the overdraw situation of a sub-region in the image frame; the sub-region is obtained by dividing the corresponding region of the image frame according to a preset size;

[0113] Accordingly, the detection result determination module 430 includes an over-drawing count determination unit, a global detection result determination unit, and a local detection result determination unit. Wherein:

[0114] The overdraw count determination unit is used to determine the overdraw count for each pixel based on the drawing trajectory chain for each pixel; the drawing trajectory chain is used to indicate the drawing and coloring status of the pixel in each rendering layer in the depth direction.

[0115] A global detection result determination unit is used to determine the global detection result based on a first total number of times corresponding to the image frame and a second total number of times corresponding to the target pixel; the target pixel is a pixel that has misused the transparency test; the first total number of times is used to indicate the total number of times all pixels in the image frame have been overdrawn; the second total number of times is used to indicate the total number of times the target pixel has been overdrawn;

[0116] The local detection result determination unit is used to determine the local detection result based on the third total number of times corresponding to the sub-region and the fourth total number of times corresponding to the target pixel in the sub-region; the third total number of times is used to indicate the total number of times all pixels in the sub-region are overdrawn; the fourth total number of times is used to indicate the total number of times the target pixel in the sub-region is overdrawn.

[0117] As an optional but non-limiting implementation, the global detection result determination unit includes a first total number determination subunit, a global average drawing number determination subunit, a first proportion determination subunit, and a global detection result determination subunit. Wherein:

[0118] The first total number determination subunit is used to determine the first total number of times based on the overdraw number corresponding to each pixel.

[0119] The global average number of renderings determination subunit is used to determine the global average number of renderings based on the first total number of renderings and the total number of pixels in the image frame;

[0120] The first proportion determination subunit is used to determine the first proportion based on the ratio between the second total number of times corresponding to the target pixel and the first total number of times corresponding to the image frame.

[0121] The global detection result determination subunit is used to take the global average number of draws and the first proportion as the global detection result.

[0122] As an optional but non-limiting implementation, the local detection result determination unit includes a target sub-region determination sub-unit and a local risk value determination sub-unit. Wherein:

[0123] The target sub-region determination sub-unit is used to determine the target sub-region based on the third total number of times corresponding to each sub-region and a preset number of times threshold; wherein the third total number of times corresponding to the target sub-region is greater than the preset number of times threshold;

[0124] The local risk value determination subunit is used to determine the local risk value corresponding to the target sub-region based on the fourth total number of times corresponding to the target sub-region and the total number of pixels in the target sub-region, and to use the local risk value as the local detection result.

[0125] As an optional but non-limiting implementation, the local detection result determination unit further includes a heatmap construction subunit and a display subunit. Wherein:

[0126] A heatmap construction subunit is used to construct a heatmap based on the local risk value corresponding to each target sub-region;

[0127] The display subunit is used to output and display the heat map.

[0128] The image frame overdraw detection device provided in this embodiment of the invention can be used to execute the image frame overdraw detection method during the rendering process, and has the corresponding functional modules and beneficial effects of executing the image frame overdraw detection method during the rendering process.

[0129] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of the present invention.

[0130] Figure 5 This is a schematic diagram of an electronic device for implementing a method for detecting overdrawing of image frames during rendering, as provided in an embodiment of the present invention. The following refers to... Figure 5 The diagram illustrates a structural schematic of an electronic device 510 suitable for implementing embodiments of the present invention. The terminal devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0131] like Figure 5 As shown, the electronic device 510 includes at least one processor 511 and a memory, such as a read-only memory (ROM) 512 and a random access memory (RAM) 513, communicatively connected to the at least one processor 511. The memory stores computer programs executable by the at least one processor. The processor 511 can perform various appropriate actions and processes based on the computer program stored in the ROM 512 or loaded from storage unit 518 into the RAM 513. The RAM 513 may also store various programs and data required for the operation of the electronic device 510. The processor 511, ROM 512, and RAM 513 are interconnected via a bus 514. An input / output (I / O) interface 515 is also connected to the bus 514.

[0132] Multiple components in electronic device 510 are connected to input / output (I / O) interface 515, including: input unit 516, such as keyboard, mouse, etc.; output unit 517, such as various types of monitors, speakers, etc.; storage unit 518, such as disk, optical disk, etc.; and communication unit 519, such as network card, modem, wireless transceiver, etc. Communication unit 519 allows electronic device 510 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0133] Processor 511 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 511 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 511 executes the overdraw detection method for image frames during rendering provided in any embodiment of the present invention.

[0134] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing a method for detecting overdraw of image frames during rendering as shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 519, or installed from storage unit 518, or installed from read-only memory (ROM) 512. When the computer program is executed by processor 511, it performs the functions defined in the method for detecting overdraw of image frames during rendering according to embodiments of the present invention.

[0135] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0136] The electronic device provided in this embodiment of the invention and the method for detecting over-drawing of image frames during rendering provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0137] This invention provides a computer storage medium storing a computer program that, when executed by a processor, implements the method for detecting over-drawing of image frames during the rendering process provided in the above embodiments.

[0138] It should be noted that the computer-readable medium described above in this invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0139] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0140] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0141] 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 invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated 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, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0142] The units described in the embodiments of the present invention can be implemented in software or in hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0143] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field-Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Products (ASSPs), Systems-on-Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on. In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0144] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0145] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0146] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for detecting overdrawing of image frames during rendering, characterized in that, The method includes: Based on the rendering results of each rendering layer corresponding to the image frame to be generated, the first attribute information of each rendering layer is determined; each rendering layer is a layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer. Based on the material information associated with the image frame and the first attribute information of each rendering layer, the misuse result of the target rendering layer is determined; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer that have been misused for transparency testing. Based on the misuse results of the target rendering layer, the overdraw detection result of the image frame is determined; the overdraw detection result is used to indicate the situation where the pixels corresponding to the image frame are overdrawn during the rendering process.

2. The method according to claim 1, characterized in that, The determination of the misuse result of the target rendering layer based on the material information associated with the image frame and the first attribute information of each rendering layer includes: Obtain the transparency value of each pixel in the target rendering layer; Based on the material information associated with the image frame, the transparency value and transparency threshold of each pixel in the target rendering layer, the misuse result of the target rendering layer is determined.

3. The method according to claim 2, characterized in that, The determination of the misuse result of the target rendering layer based on the material information associated with the image frame, the transparency value and transparency threshold of each pixel in the target rendering layer, includes: Based on the transparency value and transparency threshold of each pixel in the target rendering layer, a target pixel is determined from each pixel in the target rendering layer; the transparency value of the target pixel is less than or equal to the transparency threshold. If the material information associated with the image frame is transparent, then it is determined that the target pixel has been misused for transparency testing.

4. The method according to claim 1, characterized in that, The overdraw detection results include global detection results and local detection results; the global detection results are used to indicate the overall overdraw situation of the image frame; the local detection results are used to indicate the overdraw situation of a sub-region in the image frame; the sub-region is obtained by dividing the corresponding region of the image frame according to a preset size; Accordingly, determining the overdraw detection result of the image frame based on the misuse result of the target rendering layer includes: Based on the drawing trajectory chain of each pixel, the number of overdraws corresponding to each pixel is determined; the drawing trajectory chain is used to indicate the drawing and coloring status of each pixel in each rendering layer in the depth direction. The global detection result is determined based on the first total count corresponding to the image frame and the second total count corresponding to the target pixel; the target pixel is the pixel that misused the transparency test; the first total count is used to indicate the total number of times all pixels in the image frame were overdrawn; the second total count is used to indicate the total number of times the target pixel was overdrawn. The local detection result is determined based on the third total number of times corresponding to the sub-region and the fourth total number of times corresponding to the target pixel in the sub-region; the third total number of times is used to indicate the total number of times all pixels in the sub-region are overdrawn; the fourth total number of times is used to indicate the total number of times the target pixel in the sub-region is overdrawn.

5. The method according to claim 4, characterized in that, The determination of the global detection result based on the first total number of times corresponding to the image frame and the second total number of times corresponding to the target pixel includes: The first total number of times is determined based on the number of overdraws corresponding to each pixel; The global average number of rendering attempts is determined based on the first total number of times and the total number of pixels in the image frame; The first proportion is determined based on the ratio between the second total number of times corresponding to the target pixel and the first total number of times corresponding to the image frame; The global average number of renderings and the first percentage are used as the global detection result.

6. The method according to claim 4, characterized in that, The determination of the local detection result based on the third total count corresponding to the sub-region and the fourth total count corresponding to the target pixel within the sub-region includes: The target sub-region is determined based on the third total number of times corresponding to each sub-region and a preset number threshold; the third total number of times corresponding to the target sub-region is greater than the preset number threshold. Based on the fourth total number of times corresponding to the target sub-region and the total number of pixels in the target sub-region, the local risk value corresponding to the target sub-region is determined, and the local risk value is used as the local detection result.

7. The method according to claim 6, characterized in that, After using the local risk value as the local detection result, the method further includes: A heatmap is constructed based on the local risk values ​​corresponding to each target sub-region; The heat map is then output and displayed.

8. A device for detecting overdrawing of image frames during rendering, characterized in that, The device includes: The first attribute information determination module is used to determine the first attribute information of each rendering layer based on the rendering results of each rendering layer corresponding to the image frame to be generated; each rendering layer is a layer that needs to be drawn during the rendering process of the image frame; the first attribute information includes the transparency test enable information of the rendering layer and the transparency value of the pixels in the rendering layer. The misuse result determination module is used to determine the misuse result of the target rendering layer based on the material information associated with the image frame and the first attribute information of each rendering layer; the target rendering layer is the layer among the rendering layers where transparency testing is enabled; the misuse result is used to indicate that there are pixels in the target rendering layer where transparency testing has been misused. The detection result determination module is used to determine the overdraw detection result of the image frame based on the misuse result of the target rendering layer; the overdraw detection result is used to indicate the situation where the pixels corresponding to the image frame are overdrawn during the rendering process.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting overdrawing of image frames during rendering as described in any one of claims 1-7.

10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the method for detecting overdrawing of an image frame during rendering as described in any one of claims 1-7.