Bandwidth determination method, device, electronic device and computer readable medium
By obtaining and calculating the resolution parameters and data format of the rendering target of mobile game frames, and counting GPU bandwidth, it solves the problems of low performance analysis efficiency and insufficient multi-platform support in the existing technology, and achieves efficient bandwidth statistics and performance optimization.
Patent Information
- Application Number
- CN202110569120.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-25
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-05-25
AI Technical Summary
It is difficult to efficiently count and optimize the GPU bandwidth of mobile games with existing technology, resulting in low performance analysis efficiency, insufficient multi-platform support, and cumbersome debugging processes.
By obtaining the rendering targets in all rendering stages of the frame to be tested, its resolution parameters and data formats are obtained, the amount of exchanged data of each rendering target is calculated, the total bandwidth is counted, and multi-platform real-time bandwidth statistics are supported.
It implements efficient GPU bandwidth statistics and performance analysis, improves computing efficiency, supports multi-platform performance optimization, simplifies the debugging process, and reduces time consumption.
Smart Images

Figure CN113144616B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a bandwidth determination method, a bandwidth determination device, an electronic device, and a computer-readable medium. Background Art
[0002] In the development process of mobile games, game performance affects the quality of the game to a certain extent. Therefore, performance optimization is an important part of mobile game development.
[0003] As an important hardware that affects the performance of mobile games, the GPU (Graphics Processing Unit) used for graphics rendering plays an important role in the analysis and statistics of its performance indicators. Among them, GPU bandwidth has a more obvious impact on the power consumption of game operation.
[0004] In view of this, there is an urgent need in the art for a bandwidth determination method to improve the statistical efficiency and performance optimization efficiency of bandwidth.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a bandwidth determination method, a bandwidth determination device, an electronic device and a computer-readable medium, thereby improving the bandwidth determination efficiency and the performance optimization efficiency at least to a certain extent.
[0007] According to a first aspect of the present disclosure, a method for determining bandwidth is provided, comprising:
[0008] Obtaining rendering targets in all rendering stages of the frame to be tested, and obtaining resolution parameters and data formats of each rendering target;
[0009] Obtaining the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target;
[0010] The total bandwidth of the frame to be measured is obtained according to the exchange data volume of each of the rendering targets in all rendering stages of the frame to be measured.
[0011] In an exemplary embodiment of the present disclosure, obtaining the total bandwidth of the frame to be tested according to the exchanged data volume of each rendering target in all rendering stages of the frame to be tested includes:
[0012] Obtaining the operation type of each of the rendering targets in all rendering stages of the frame to be tested;
[0013] The total bandwidth of the frame to be measured is obtained according to the operation type of each rendering target and the exchange data volume of the rendering target.
[0014] In an exemplary embodiment of the present disclosure, the operation type of the rendering target includes a target operation type that generates data exchange between a register and a video memory, and obtaining the total bandwidth of the frame to be measured according to the operation type of each rendering target and the exchange data amount of the rendering target includes:
[0015] Determine the rendering target whose operation type is the target operation type as a bandwidth statistics rendering target;
[0016] The total bandwidth of the frame to be measured is obtained by summing up the exchanged data amounts of the rendering targets according to the bandwidth statistics.
[0017] In an exemplary embodiment of the present disclosure, the target operation type for generating data exchange between the register and the video memory includes a data loading operation type and a data storage operation type.
[0018] In an exemplary embodiment of the present disclosure, obtaining the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target includes:
[0019] Determining the pixel size and byte size of a rendering block in the rendering target according to a data format of the rendering target;
[0020] Determining the number of rendering blocks in the rendering target according to a resolution parameter of the rendering target and a pixel size of the rendering blocks in the rendering target;
[0021] The exchange data volume of the rendering target is obtained according to the number of rendering blocks in the rendering target and the byte size of the rendering blocks.
[0022] In an exemplary embodiment of the present disclosure, the resolution parameter of the rendering target includes a resolution width value, a resolution height value, and a resolution depth value, the pixel size of the rendering block includes a pixel width value, a pixel height value, and a pixel depth value, and determining the number of rendering blocks in the rendering target according to the resolution parameter of the rendering target and the pixel size of the rendering block in the rendering target includes:
[0023] Obtaining a width ratio of the rendering target to the rendering block according to a ratio of a resolution width value of the rendering target to a pixel width value of the rendering block;
[0024] Obtaining a height ratio of the rendering target to the rendering block according to a ratio of a resolution height value of the rendering target to a pixel height value of the rendering block;
[0025] Obtaining a depth ratio of the rendering target to the rendering block according to a ratio of a resolution depth value of the rendering target to a pixel depth value of the rendering block;
[0026] The number of rendering blocks in the rendering target is obtained according to the product of the width ratio, the height ratio and the depth ratio of the rendering target to the rendering block.
[0027] In an exemplary embodiment of the present disclosure, the obtaining of the resolution parameters and data formats of each of the rendering targets includes:
[0028] The platform type and platform version to be tested are obtained, and the resolution parameter and data format of the rendering target are determined according to the platform type and platform version.
[0029] According to a second aspect of the present disclosure, a bandwidth determination device is provided, including:
[0030] A rendering target acquisition module, used to acquire rendering targets in all rendering stages of the frame to be tested, and acquire resolution parameters and data formats of each rendering target;
[0031] An exchange data determination module, used for obtaining the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target;
[0032] The total bandwidth statistics module is used to obtain the total bandwidth of the frame to be tested according to the exchange data volume of each rendering target in all rendering stages of the frame to be tested.
[0033] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned bandwidth determination methods by executing the executable instructions.
[0034] According to a fourth aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for determining the bandwidth described in any one of the above is implemented.
[0035] The exemplary embodiments of the present disclosure may have the following beneficial effects:
[0036] In the bandwidth determination method of the example implementation of the present disclosure, all rendering targets in all rendering stages of the frame to be tested are obtained, and the exchange data volume of each rendering target is obtained according to the resolution parameters and data format of each rendering target, and then the exchange data volume of each rendering target in all rendering stages of the frame to be tested is counted to obtain the total bandwidth of the current frame to be tested. Through the bandwidth determination method of the example implementation of the present disclosure, on the one hand, the method can be written into the source code of the game engine, and only one interface needs to be called to obtain the bandwidth statistics of the current frame in real time, without additional time consumption, and the calculation efficiency is high. Further, it can also improve the efficiency of subsequent performance analysis; on the other hand, it can support real-time bandwidth statistics of multiple platforms, so it is convenient to perform performance optimization of multiple platforms.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0039] Figure 1 A schematic diagram showing a flow chart of a method for determining bandwidth according to an exemplary embodiment of the present disclosure;
[0040] Figure 2 A schematic diagram showing a flow chart of obtaining the exchange data volume of each rendering target according to an exemplary embodiment of the present disclosure;
[0041] Figure 3 A schematic diagram of a process of obtaining the total bandwidth of a frame to be measured according to the exchange data volume of each rendering target according to an exemplary embodiment of the present disclosure is shown;
[0042] Figure 4 A schematic diagram of a process of obtaining the total bandwidth of a frame to be tested according to the operation type and exchanged data volume of each rendering target in an exemplary embodiment of the present disclosure is shown;
[0043] Figure 5 A block diagram showing a bandwidth determination device according to an exemplary embodiment of the present disclosure;
[0044] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0045] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0046] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0047] Performance optimization is an important part of today's mobile games, especially the development of next-generation 3D mobile games. It determines to what extent the upper limit of the quality of the developed games can be raised under limited hardware performance conditions.
[0048] The two important hardware that affect the performance of mobile games, CPU (Central Processing Unit) and GPU (Graphics Processing Unit), play the role of logical calculation and graphics rendering respectively. Among them, CPU, as the calculation and control core of the computer system, is the final execution unit for information processing and program running. GPU, also known as display core, visual processor, display chip, is a microprocessor that specializes in image and graphics related calculations on personal computers, workstations, game consoles and some mobile devices (such as tablets, smart phones, etc.). In order to optimize the performance of the game, R&D personnel need to analyze the CPU and GPU occupancy of the game separately, and perform targeted optimization based on the analysis results.
[0049] Among them, the CPU has two important performance indicators, memory read and write and logical operations; similarly, the GPU also has two important performance indicators, GPU bandwidth and shader operations. In order to complete the directional analysis of these indicators, it is necessary to use analysis tools such as RenderDoc (an open source debugging tool) and Xcode (an integrated development tool running on the operating system Mac OS X) to obtain data. Among them, the GPU bandwidth is the most difficult to obtain and has a greater impact on performance.
[0050] The so-called GPU bandwidth refers to the amount of data transmitted between the GPU register and the video memory per unit time, which has a more obvious impact on the power consumption of game running.
[0051] In some related embodiments, the GPU bandwidth can be obtained through the XCode tool of the MAC system. XCode can compile the game engine source code and generate a complete iOS game package for frame capture analysis. However, no available tools have been found on the Android side.
[0052] However, in XCode, the method of taking screenshots of the game to analyze the GPU bandwidth has the following disadvantages:
[0053] a. Low debugging efficiency. Since XCode needs to compile the game engine source code before it can capture frames, each time bandwidth analysis is performed, the entire process of compiling the engine and packaging must be completed, which takes at least one or two hours. Depending on the compilation time of different engines, the specific debugging time may be longer, which is very unfriendly to the efficiency of performance analysis.
[0054] b. It is difficult to count. Since Xcode captures not only the GPU bandwidth but also a lot of other performance data when capturing frames, each frame capture will cause the game to freeze for a few seconds, making it difficult to observe changes in bandwidth during normal gaming. In addition, the bandwidth in XCode is displayed in the form of pictures, so it is difficult to extract specific values.
[0055] c. It is not possible to perform multi-platform statistics. XCode can only be used for bandwidth statistics on the iOS side, which is not very convenient for targeted optimization of different platforms.
[0056] Based on the above problems, this exemplary embodiment first provides a method for determining bandwidth. Figure 1 As shown, the above bandwidth determination method may include the following steps:
[0057] Step S110: Obtain rendering targets in all rendering stages of the frame to be tested, and obtain resolution parameters and data formats of each rendering target.
[0058] Step S120: Obtain the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target.
[0059] Step S130: Obtain the total bandwidth of the frame to be tested according to the exchanged data volume of each rendering target in all rendering stages of the frame to be tested.
[0060] In the bandwidth determination method of the example implementation of the present disclosure, all rendering targets in all rendering stages of the frame to be tested are obtained, and the exchange data volume of each rendering target is obtained according to the resolution parameters and data format of each rendering target, and then the exchange data volume of each rendering target in all rendering stages of the frame to be tested is counted to obtain the total bandwidth of the current frame to be tested. Through the bandwidth determination method of the example implementation of the present disclosure, on the one hand, the method can be written into the source code of the game engine, and only one interface needs to be called to obtain the bandwidth statistics of the current frame in real time, without additional time consumption, and the calculation efficiency is high. Further, it can also improve the efficiency of subsequent performance analysis; on the other hand, it can support real-time bandwidth statistics of multiple platforms, including metal, es3, vulkan and other platforms, so it is convenient to perform performance optimization on multiple platforms.
[0061] Next, combine Figures 2 to 4 The above steps of this exemplary embodiment are described in more detail.
[0062] In step S110 , rendering targets in all rendering stages of the frame to be tested are obtained, and resolution parameters and data formats of each rendering target are obtained.
[0063] In this example implementation, the frame to be measured refers to the current frame for which the GPU bandwidth needs to be statistically measured. In game rendering, each frame has multiple different rendering stages, and a rendering stage can be called a Pass, for example, a Pass for rendering special effects or a Pass for rendering models.
[0064] Render Target (RT) refers to a buffer used to record the output results after rendering, rather than drawing the frame buffer directly to the screen. One or more render target RTs may be used in a Pass, so a bandwidth needs to be defined for each Pass and set to zero before the game engine prepares the RT.
[0065] Since render targets with different data formats occupy different bandwidths when exchanging data, it is necessary to obtain the resolution parameters and data formats of each render target before counting the bandwidth. Since the supported data types vary on different platforms, or even on different versions of the same platform, the same RT may have different data types. Therefore, when counting bandwidth, it is necessary to set it according to the version of the specific platform, and try to set the smallest data type under the premise of being sufficient to reduce the GPU bandwidth usage. At the same time, the bandwidth pre-calculation should also be corrected according to these special cases.
[0066] In this example implementation, the platform type and platform version to be tested may be obtained first, and the resolution parameter and data format of the rendering target may be determined according to the platform type and platform version.
[0067] In step S120 , the exchange data volume of each rendering target is obtained according to the resolution parameter and data format of each rendering target.
[0068] In this example implementation, the size of the RT exchange data of each Pass is counted during the preparation of the RT. When all Passes are prepared, the exchange data of each RT is accumulated to obtain the total bandwidth.
[0069] In this example implementation, Figure 2 As shown, the exchange data volume of each rendering target is obtained according to the resolution parameters and data formats of each rendering target, which may specifically include the following steps:
[0070] Step S210: Determine the pixel size and byte size of the rendering block in the rendering target according to the data format of the rendering target.
[0071] Different platforms or RTs use different data formats, and different types of data formats have different sizes and structures of rendering blocks. A rendering block consists of one or more pixels. Different data types have different width and height pixel sizes (in pixels) and different number of channels. There are RGB 3-channel RTs, RGBA 4-channel RTs, or other types of RTs. These factors together determine the pixel size and byte size of the rendering block.
[0072] Step S220: Determine the number of rendering blocks in the rendering target according to the resolution parameter of the rendering target and the pixel size of the rendering blocks in the rendering target.
[0073] In this example implementation, the resolution parameter of the rendering target includes a resolution width value, a resolution height value, and a resolution depth value, and the pixel size of the rendering block includes a pixel width value, a pixel height value, and a pixel depth value. For example, the pixel size of the rendering block of the RGBA4 channel is: a pixel width value of 1, a pixel height value of 1, and a pixel depth value of 1, and its byte size is 16 bytes.
[0074] The number of rendering blocks in the rendering target is determined according to the resolution parameter of the rendering target and the pixel size of the rendering block in the rendering target. The specific method may be: according to the ratio of the resolution width value of the rendering target to the pixel width value of the rendering block, a width ratio of the rendering target to the rendering block is obtained; according to the ratio of the resolution height value of the rendering target to the pixel height value of the rendering block, a height ratio of the rendering target to the rendering block is obtained; according to the ratio of the resolution depth value of the rendering target to the pixel depth value of the rendering block, a depth ratio of the rendering target to the rendering block is obtained; and then, according to the product of the width ratio, height ratio and depth ratio of the rendering target to the rendering block, the number of rendering blocks in the rendering target is obtained.
[0075] According to the above content, the calculation formula for the number of rendering blocks in the rendering target is: number of rendering blocks N = (width value of RT resolution / pixel width value of rendering block)*(height value of RT resolution / pixel height value of rendering block)*(depth value of RT resolution / pixel depth value of rendering block).
[0076] Step S230: Obtain the exchange data volume of the rendering target according to the number of rendering blocks in the rendering target and the byte size of the rendering blocks.
[0077] After obtaining the number of rendering blocks in the rendering target, the exchange data volume of the rendering target can be obtained according to the product of the number of rendering blocks and the byte size of each rendering block.
[0078] The specific calculation formula is: the exchange data size of the rendering target size = blockBytes*N = blockBytes*(width value of RT resolution / pixel width value of rendering block)*(height value of RT resolution / pixel height value of rendering block)*(depth value of RT resolution / pixel depth value of rendering block). Wherein, blockBytes represents the byte size of the rendering block.
[0079] The calculation method of RT is similar to the method of calculating the image size. blockBytes is the byte size of each rendering block. The byte size of the rendering block multiplied by the number of rendering blocks of RT is the data size of the entire RT.
[0080] In step S130 , the total bandwidth of the frame to be tested is obtained according to the exchange data volume of each rendering target in all rendering stages of the frame to be tested.
[0081] In this example implementation, Figure 3 As shown, according to the exchange data volume of each rendering target in all rendering stages of the frame to be tested, the total bandwidth of the frame to be tested is obtained, which may specifically include the following steps:
[0082] Step S310: Obtain the operation type of each rendering target in all rendering stages of the frame to be tested.
[0083] The operation type of the rendering target includes a target operation type that generates data exchange between a register and a video memory, and specifically, may include two operation types: a data loading operation type and a data storing operation type.
[0084] There are two types of operations on RT by GPU that will generate GPU bandwidth, namely data loading operation type (LoadAction) and data storage operation type (Store Action). Among them, Load Action refers to loading RT in video memory into registers, and Store Action refers to storing data in registers into video memory.
[0085] The meaning of these two operations is that after the current Pass processes the RT, if you want to store it for the next Pass, you need to store it in the video memory first, using the Store Action. When the current Pass needs to use the RT previously stored in the video memory, you need to load the RT from the video memory to the GPU register, using the Load Action.
[0086] Some other operations, such as Discard, Clear, Memoryless, etc., directly clear the RT of the current Pass or do not operate, so they will not generate GPU bandwidth. Therefore, when counting, you only need to pay attention to the RT that the current Pass needs to load or store, and count the size of these RTs.
[0087] Step S320: Obtain the total bandwidth of the frame to be measured according to the operation type of each rendering target and the exchange data volume of the rendering target.
[0088] In this example implementation, Figure 4 As shown, according to the operation type of each rendering target and the exchange data volume of the rendering target, the total bandwidth of the frame to be measured is obtained, which may specifically include the following steps:
[0089] Step S410: Determine a rendering target whose operation type is a target operation type as a bandwidth statistics rendering target.
[0090] In this example implementation, only the rendering targets of the two operation types of Load Action and Store Action need to be counted. Therefore, the rendering targets of the two operation types are determined as the rendering targets required for bandwidth statistics.
[0091] Step S420: Calculate the sum of exchanged data volumes of the rendering targets according to the bandwidth statistics to obtain the total bandwidth of the frame to be measured.
[0092] Finally, the total bandwidth of the current frame to be measured is obtained by adding up the exchanged data volumes of the bandwidth statistics rendering targets whose operation types are Load Action and Store Action.
[0093] The bandwidth determination method of this example implementation adopts a pre-calculation method to count the GPU bandwidth. Mainly, when the engine prepares the RT, the size of each RT is calculated according to the resolution and data format of each RT, and then the Load / Store Action of each Pass is used to determine whether the RT needs to exchange data between the video memory and the register in the current Pass, and then the GPU bandwidth is counted in this way.
[0094] The calculation result of the total bandwidth is in bytes. Through actual operation tests, we can obtain that the final calculated Load Action bandwidth Load Bandwidth, Store Action bandwidth Store Bandwidth and the total bandwidth are basically consistent with the results on XCode, with only a few megabytes of error. Overall, it has little impact on performance optimization, but its operational convenience and statistical efficiency are greatly improved.
[0095] Through the bandwidth determination method in this example implementation, the game engine can realize real-time statistics of GPU bandwidth on different platforms such as PC, Android, and IOS, which greatly improves the efficiency of performance analysis of game GPUs and promotes more efficient game performance optimization.
[0096] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0097] Furthermore, the present disclosure also provides a device for determining bandwidth. Figure 5 As shown, the bandwidth determination device may include a rendering target acquisition module 510, an exchange data determination module 520, and a total bandwidth statistics module 530. Among them:
[0098] The rendering target acquisition module 510 may be used to acquire rendering targets in all rendering stages of the frame to be tested, and acquire resolution parameters and data formats of each rendering target;
[0099] The exchange data determination module 520 may be used to obtain the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target;
[0100] The total bandwidth statistics module 530 may be used to obtain the total bandwidth of the frame to be measured according to the exchanged data volume of each rendering target in all rendering stages of the frame to be measured.
[0101] In some exemplary embodiments of the present disclosure, the total bandwidth statistics module 530 may include an operation type determination unit and a total bandwidth determination unit.
[0102] The operation type determination unit may be used to obtain the operation type of each rendering target in all rendering stages of the frame to be tested;
[0103] The total bandwidth determination unit may be used to obtain the total bandwidth of the frame to be measured according to the operation type of each rendering target and the exchange data volume of the rendering target.
[0104] In some exemplary embodiments of the present disclosure, the total bandwidth determination unit may include a rendering target statistics determination unit and an exchange data volume statistics unit.
[0105] The statistical rendering target determining unit may be configured to determine a rendering target whose operation type is a target operation type as a bandwidth statistical rendering target;
[0106] The exchange data volume statistics unit may be used to calculate the sum of exchange data volumes of the rendering target according to bandwidth statistics to obtain the total bandwidth of the frame to be measured.
[0107] In some exemplary embodiments of the present disclosure, the target operation types that generate data exchange between the register and the video memory in the statistical rendering target determination unit include a data loading operation type and a data storage operation type.
[0108] In some exemplary embodiments of the present disclosure, the exchange data determination module 520 may include a rendering block parameter determination unit, a rendering block quantity determination unit, and an exchange data quantity determination unit.
[0109] The rendering block parameter determination unit may be used to determine the pixel size and byte size of the rendering block in the rendering target according to the data format of the rendering target;
[0110] The rendering block number determination unit may be configured to determine the number of rendering blocks in the rendering target according to a resolution parameter of the rendering target and a pixel size of the rendering blocks in the rendering target;
[0111] The exchange data amount determination unit may be configured to obtain the exchange data amount of the rendering target according to the number of rendering blocks in the rendering target and the byte size of the rendering blocks.
[0112] In some exemplary embodiments of the present disclosure, the rendering block number determination unit may include a width ratio determination unit, a height ratio determination unit, a depth ratio determination unit, and a rendering block number calculation unit.
[0113] The width ratio determination unit may be used to obtain a width ratio of the rendering target to the rendering block according to a ratio of a resolution width value of the rendering target to a pixel width value of the rendering block;
[0114] The height ratio determination unit may be used to obtain a height ratio of the rendering target to the rendering block according to a ratio of a resolution height value of the rendering target to a pixel height value of the rendering block;
[0115] The depth ratio determination unit may be used to obtain a depth ratio between the rendering target and the rendering block according to a ratio between a resolution depth value of the rendering target and a pixel depth value of the rendering block;
[0116] The rendering block number calculation unit may be used to obtain the number of rendering blocks in the rendering target according to the product of the width ratio, height ratio and depth ratio of the rendering target to the rendering block.
[0117] In some exemplary embodiments of the present disclosure, the rendering target acquisition module 510 may include a data format determination unit, which may be used to obtain the platform type and platform version to be tested, and determine the resolution parameter and data format of the rendering target according to the platform type and platform version.
[0118] The specific details of each module / unit in the above bandwidth determination device have been described in detail in the corresponding method embodiment part, and will not be repeated here.
[0119] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present invention is shown.
[0120] It should be noted that Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0121] like Figure 6As shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. Various programs and data required for system operation are also stored in RAM 603. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0122] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0123] In particular, according to an embodiment of the present invention, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.
[0124] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0125] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments.
[0127] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be concretized.
[0128] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0129] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for determining bandwidth, characterized in that: include: Obtaining rendering targets in all rendering stages of the frame to be tested, and obtaining resolution parameters and data formats of each rendering target, wherein each frame in the rendering has multiple different rendering stages, and each rendering stage uses one or more rendering targets; In the process of preparing the rendering targets, obtaining the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target; Obtaining the operation type of each rendering target in all rendering stages of the frame to be tested, wherein the operation type of the rendering target includes a target operation type that generates data exchange between a register and a video memory, and the target operation type that generates data exchange between a register and a video memory includes a data loading operation type and a data storage operation type; Determine the rendering target whose operation type is the target operation type as a bandwidth statistics rendering target; The total bandwidth of the frame to be measured is obtained by summing up the exchanged data amounts of the rendering targets according to the bandwidth statistics.
2. The method for determining bandwidth according to claim 1, characterized in that: The obtaining the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target includes: Determining the pixel size and byte size of a rendering block in the rendering target according to a data format of the rendering target; Determining the number of rendering blocks in the rendering target according to a resolution parameter of the rendering target and a pixel size of the rendering blocks in the rendering target; The exchange data volume of the rendering target is obtained according to the number of rendering blocks in the rendering target and the byte size of the rendering blocks.
3. The method for determining bandwidth according to claim 2, characterized in that: The resolution parameter of the rendering target includes a resolution width value, a resolution height value, and a resolution depth value, the pixel size of the rendering block includes a pixel width value, a pixel height value, and a pixel depth value, and determining the number of rendering blocks in the rendering target according to the resolution parameter of the rendering target and the pixel size of the rendering blocks in the rendering target includes: Obtaining a width ratio of the rendering target to the rendering block according to a ratio of a resolution width value of the rendering target to a pixel width value of the rendering block; Obtaining a height ratio of the rendering target to the rendering block according to a ratio of a resolution height value of the rendering target to a pixel height value of the rendering block; Obtaining a depth ratio of the rendering target to the rendering block according to a ratio of a resolution depth value of the rendering target to a pixel depth value of the rendering block; The number of rendering blocks in the rendering target is obtained according to the product of the width ratio, the height ratio and the depth ratio of the rendering target to the rendering block.
4. The method for determining bandwidth according to claim 1, characterized in that: The obtaining of the resolution parameters and data formats of each of the rendering targets includes: The platform type and platform version to be tested are obtained, and the resolution parameter and data format of the rendering target are determined according to the platform type and platform version.
5. A bandwidth determination device, characterized in that: include: A rendering target acquisition module, used to acquire rendering targets in all rendering stages of the frame to be tested, and to acquire resolution parameters and data formats of each rendering target, wherein each frame in the rendering has multiple different rendering stages, and each rendering stage uses one or more rendering targets; An exchange data determination module, used for obtaining the exchange data volume of each rendering target according to the resolution parameter and data format of each rendering target in the process of preparing the rendering target; A total bandwidth statistics module is used to obtain the operation type of each rendering target in all rendering stages of the frame to be tested, wherein the operation type of the rendering target includes a target operation type that generates data exchange between a register and a video memory, and the target operation type that generates data exchange between a register and a video memory includes a data loading operation type and a data storage operation type; the rendering target whose operation type is the target operation type is determined as a bandwidth statistics rendering target; and the total bandwidth of the frame to be tested is obtained according to the sum of the exchanged data amounts of the bandwidth statistics rendering targets.
6. An electronic device, characterized in that: include: processor; as well as A memory, used to store one or more programs, when the one or more programs are executed by the processor, enables the processor to implement the bandwidth determination method according to any one of claims 1 to 4.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the bandwidth determination method according to any one of claims 1 to 4 is implemented.
