GPU rendering efficiency determination method, model building method, device, medium and equipment

By obtaining drawing instructions and data, calculating the complexity parameters and weight values ​​of the GPU, and directly evaluating the drawing efficiency of the GPU, solving the problem of time-consuming drawing efficiency evaluation in the prior art, and achieving fast and accurate efficiency evaluation.

CN115131481BActive Publication Date: 2024-11-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110315356.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-24
Publication Date
2024-11-26
Estimated Expiration
2041-03-24

AI Technical Summary

Technical Problem

In the prior art, it takes a long time to determine the GPU drawing efficiency because the GPU needs to draw based on drawing instructions and drawing data to acquire images, resulting in a lot of time evaluating efficiency.

Method used

By obtaining the drawing instructions and drawing data for prediction, the numerical values ​​of complexity parameters are determined, and the processing load of the GPU during vertex processing, chip processing and shader call is calculated based on the weight value obtained by training, and the drawing efficiency is directly calculated to avoid Participation in the actual drawing process.

Benefits of technology

The time to determine the GPU drawing efficiency is significantly reduced, and the evaluation efficiency is improved. An accurate drawing efficiency evaluation can be obtained without the actual drawing operation of the GPU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115131481B_ABST
    Figure CN115131481B_ABST
Patent Text Reader

Abstract

The present application discloses a method for determining GPU drawing efficiency, a model building method, a device, a storage medium and an electronic device. The method includes: obtaining drawing instructions and drawing data for prediction; determining the numerical value of a parameter that can be used to determine the complexity according to the drawing instructions and drawing data; obtaining a weight value corresponding to a predetermined parameter that can be used to determine the complexity, and the weight value is obtained by fitting the time required for the GPU to draw based on the drawing instructions and drawing data for training according to the numerical value and the weight value; calculating the first complexity, the second complexity and the third complexity according to the numerical value and the weight value; determining the drawing efficiency of the GPU for the drawing instructions and drawing data for prediction according to the first complexity, the second complexity and the third complexity. The present application can reduce the time required to determine the drawing efficiency of a GPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electronic technology, and in particular, relates to a method for determining GPU rendering efficiency, a model building method, a device, a storage medium, and an electronic device. Background Art

[0002] For video applications, game applications, and other applications that require dynamic image rendering, their running quality is closely related to the drawing efficiency of the Graphics Processor Unit (GPU). Therefore, when these applications cannot run smoothly, it is necessary to determine the drawing efficiency of the GPU to determine whether the low drawing efficiency of the GPU causes these applications to fail to run smoothly.

[0003] In the related art, the GPU is usually required to perform drawing based on drawing instructions and drawing data to obtain an image for display, and the drawing efficiency of the GPU is determined by determining the time required for the GPU to perform drawing based on the drawing instructions and drawing data to obtain an image for display. However, in the related art, since the GPU needs to perform drawing based on the drawing instructions and drawing data to obtain an image for display in order to determine the drawing efficiency of the GPU, it takes a long time to determine the drawing efficiency of the GPU. Summary of the invention

[0004] Embodiments of the present application provide a method for determining GPU rendering efficiency, a model building method, an apparatus, a storage medium, and an electronic device, which can reduce the time required to determine the rendering efficiency of a GPU.

[0005] In a first aspect, an embodiment of the present application provides a method for determining GPU rendering efficiency, comprising:

[0006] Get drawing instructions and drawing data for prediction;

[0007] Determining, according to the drawing instruction and the drawing data, a value of a parameter that can be used to determine complexity;

[0008] Obtaining a weight value corresponding to a predetermined parameter that can be used to determine the complexity, wherein the weight value is obtained by fitting the time required for a GPU that needs to determine the drawing efficiency to perform drawing based on the drawing instructions and drawing data used for training;

[0009] Calculate a first complexity, a second complexity, and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in the vertex processing stage, the second complexity is used to characterize the processing load of the GPU in the fragment processing stage, and the third complexity is used to characterize the processing load of the GPU when the shader is called;

[0010] A drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is determined according to the first complexity, the second complexity, and the third complexity.

[0011] In a second aspect, an embodiment of the present application provides a model building method, comprising:

[0012] Determining initial training values ​​of parameters that can be used to determine complexity according to the drawing instructions and drawing data used for training;

[0013] Adjusting the initial training value multiple times to obtain multiple adjusted training values;

[0014] Determine the drawing instructions and drawing data corresponding to each adjusted training value;

[0015] Determine the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times;

[0016] Performing fitting processing on the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity;

[0017] According to the parameters that can be used to determine the complexity and their corresponding weight values, a model that can be used to determine the complexity is constructed.

[0018] In a third aspect, an embodiment of the present application provides a device for determining GPU rendering efficiency, comprising:

[0019] A first acquisition module, used for acquiring drawing instructions and drawing data for prediction;

[0020] A first determining module, used to determine a value of a parameter that can be used to determine complexity according to the drawing instruction and the drawing data;

[0021] A second acquisition module is used to acquire a weight value corresponding to a predetermined parameter that can be used to determine the complexity, wherein the weight value is obtained by fitting the time required for a GPU that needs to determine the drawing efficiency to perform drawing based on the drawing instructions and drawing data used for training;

[0022] a calculation module, configured to calculate a first complexity, a second complexity, and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in a vertex processing stage, the second complexity is used to characterize the processing load of the GPU in a fragment processing stage, and the third complexity is used to characterize the processing load of the GPU when a shader is called;

[0023] The second determination module is used to determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction according to the first complexity, the second complexity and the third complexity.

[0024] In a fourth aspect, an embodiment of the present application provides a model building device, comprising:

[0025] A third determination module, used to determine an initial training value of a parameter that can be used to determine complexity according to the drawing instruction and drawing data used for training;

[0026] An adjustment module, used for adjusting the initial training value multiple times to obtain multiple adjusted training values;

[0027] A fourth determination module, used to determine the drawing instructions and drawing data corresponding to each adjusted training value;

[0028] a fifth determination module, configured to determine the time required for the GPU for which drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain a training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain a corresponding image, so as to obtain a plurality of drawing times;

[0029] A processing module, configured to perform fitting processing on the initial training value, the plurality of adjusted training values, and the plurality of drawing times, to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity;

[0030] The construction module is used to construct a model that can be used to determine the complexity according to the parameters that can be used to determine the complexity and their corresponding weight values.

[0031] In a fifth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the process in the GPU drawing efficiency determination method or the process in the model building method provided in the embodiment of the present application.

[0032] In a sixth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the processor is used to execute the process in the GPU drawing efficiency determination method or the process in the model building method provided in the embodiment of the present application by calling a computer program stored in the memory.

[0033] In an embodiment of the present application, by obtaining drawing instructions and drawing data for prediction; determining the numerical value of a parameter that can be used to determine the complexity based on the drawing instructions and drawing data; obtaining a weight value corresponding to the predetermined parameter that can be used to determine the complexity, and the weight value is obtained by fitting the time required for a GPU that determines the drawing efficiency as needed to perform drawing based on the drawing instructions and drawing data used for training; according to the numerical value and the weight value, calculating a first complexity, a second complexity and a third complexity, the first complexity being used to characterize the processing load of the GPU in the vertex processing stage, the second complexity being used to characterize the processing load of the GPU in the fragment processing stage, and the third complexity being used to characterize the The processing load of the GPU when the shader is called; according to the first complexity, the second complexity and the third complexity, the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is determined. Since the scheme of the present application can determine multiple complexities according to the numerical values ​​of the parameters used to determine the complexity and the weight values ​​corresponding to the parameters used to determine the complexity, the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction can be determined according to the multiple complexities. There is no need for the GPU to determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction based on the drawing instructions and drawing data used for prediction. Therefore, the present application can reduce the time required to determine the drawing efficiency of the GPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The technical solution and beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0035] Figure 1 This is a first flow chart of the method for determining GPU rendering efficiency provided in an embodiment of the present application.

[0036] Figure 2 This is a second flow chart of the method for determining GPU rendering efficiency provided in an embodiment of the present application.

[0037] Figure 3 It is a flow chart of the model building method provided in the embodiment of the present application.

[0038] Figure 4 It is a structural schematic diagram of a GPU rendering efficiency determination device provided in an embodiment of the present application.

[0039] Figure 5 It is a structural schematic diagram of the model building device provided in the embodiment of the present application.

[0040] Figure 6 This is a schematic diagram of the first structure of an electronic device provided in an embodiment of the present application.

[0041] Figure 7This is a second structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] Please refer to the drawings, where the same component symbols represent the same components. The principle of the present application is illustrated by implementing it in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application, which should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.

[0043] See also Figure 1 , Figure 1 This is a schematic diagram of a first process flow of a method for determining GPU rendering efficiency provided in an embodiment of the present application. The process flow may include:

[0044] 101. Obtain drawing instructions and drawing data for prediction.

[0045] For video applications, game applications, and other applications that require dynamic image rendering, their running quality is closely related to the drawing efficiency of the Graphics Processor Unit (GPU). Therefore, when these applications cannot run smoothly, it is necessary to determine the drawing efficiency of the GPU to determine whether the low drawing efficiency of the GPU causes these applications to fail to run smoothly. If the GPU is not sufficient to support the smooth running of these applications, the GPU can be improved so that the improved GPU can support the smooth running of these applications.

[0046] In the embodiment of the present application, the electronic device may obtain the drawing instruction and drawing data for prediction. It is understandable that the GPU may perform drawing based on the drawing instruction and drawing data to obtain an image for display.

[0047] 102. Determine, according to the drawing instruction and drawing data used for prediction, a value of a parameter that can be used to determine complexity.

[0048] It can be understood that the drawing instructions may include specific drawing requirements, such as the vertex coordinates of the triangle to be drawn, the order of drawing the vertices of a triangle, i.e. the index, when to call the shader, etc.; the drawing data may include specific data, such as the primitives that need to be pasted into the drawn triangle, i.e. the primitives of the texture map, etc.

[0049] For example, after obtaining the drawing instructions and drawing data for prediction, the electronic device can determine the numerical value of the number of triangles, the numerical value of the number of vertices, the numerical value of the number of indices, the numerical value of the number of primitives of the texture map, the numerical value of the number of pixels, the numerical value of the number of shader calls, the numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions, etc., according to the drawing instructions and drawing data. The above numerical values ​​can be used as the numerical values ​​of parameters that can be used to determine the complexity. The above-mentioned number of triangles, the number of vertices, the number of indices, the number of primitives of the texture map, the number of pixels, the number of shader calls, the number of operation instructions, and the number of memory interaction instructions can be used as parameters that can be used to determine the complexity.

[0050] 103. Obtain a predetermined weight value corresponding to a parameter that can be used to determine complexity, where the weight value is obtained by fitting the time required for a GPU that needs to determine drawing efficiency to perform drawing based on drawing instructions and drawing data used for training.

[0051] It is understandable that, before process 101, the electronic device may obtain drawing instructions and drawing data for training. The GPU may draw a frame of image that can be used for display based on the drawing instructions and drawing data for training. The electronic device may determine the values ​​of parameters that can be used to determine the complexity, such as the value of the number of triangles, the value of the number of primitives of the texture map, and the value of the number of operation instructions, based on the drawing instructions and drawing data for training. Among them, the value of the number of triangles can be used as the initial value of the number of triangles, the value of the number of primitives of the texture map can be used as the initial value of the number of primitives of the texture map, and the value of the number of operation instructions can be used as the initial value of the number of operation instructions.

[0052] Subsequently, the electronic device may adjust the initial value of the number of triangles multiple times to obtain multiple adjusted values ​​of the number of triangles. For example, the electronic device may increase the value of the number of triangles by 2, 3, 10, 20, decrease it by 2, 5, 10, 30, etc., to obtain multiple adjusted values ​​of the number of triangles.

[0053] Next, the electronic device can determine the corresponding drawing instructions and drawing data based on each adjusted value of the number of triangles, the initial value of the number of primitives in the texture map, and the initial value of the number of operation instructions, and obtain the drawing instructions and drawing data corresponding to each adjusted value of the number of triangles.

[0054] Afterwards, the electronic device can control the GPU of model A to draw based on the drawing instructions and drawing data used for training, to obtain a frame of training image for display, and determine the time required for the GPU of model A to draw based on the drawing instructions and drawing data used for training to obtain one frame of training image; the electronic device can also control the GPU of model A to draw based on the drawing instructions and drawing data corresponding to each adjusted value of the number of triangles, to obtain multiple frames of adjusted images for display, and determine the time required for the GPU of model A to draw based on the drawing instructions and drawing data corresponding to each adjusted value of the number of triangles to obtain each frame of adjusted image, and obtain multiple drawing times.

[0055] Based on the above process, the electronic device can obtain an initial value of the number of triangles and its corresponding drawing time and multiple adjusted values ​​of the number of triangles and their corresponding drawing times. The electronic device can fit the initial value of the number of triangles and its corresponding drawing time and the multiple adjusted values ​​of the number of triangles and their corresponding drawing times by a linear regression method to obtain a weight value corresponding to the parameter of the number of triangles.

[0056] By analogy, according to the same process as the above process, the electronic device can obtain the weight value corresponding to the parameter of the number of primitives of the texture map and the weight value corresponding to the parameter of the number of operation instructions. The above weight values ​​can be used as the weight values ​​corresponding to the GPU of model A.

[0057] By analogy, through the same process as the above process, the electronic device can also obtain the weight values ​​corresponding to other models of GPUs.

[0058] In the embodiment of the present application, after determining the value of the parameter that can be used to determine the complexity, the electronic device can obtain the predetermined weight value corresponding to the parameter that can be used to determine the complexity. When it is necessary to determine the rendering efficiency of the GPU of model A, the weight value corresponding to the parameter that can be used to determine the complexity is the weight value corresponding to the GPU of model A.

[0059] 104. Calculate a first complexity, a second complexity, and a third complexity based on numerical values ​​of parameters that can be used to determine complexity and weight values ​​corresponding to the parameters that can be used to determine complexity, wherein the first complexity is used to characterize the processing load of a GPU that needs to determine drawing efficiency at a vertex processing stage, the second complexity is used to characterize the processing load of a GPU that needs to determine drawing efficiency at a fragment processing stage, and the third complexity is used to characterize the processing load of a GPU that needs to determine drawing efficiency when a shader is called.

[0060] The rendering process of the GPU can be roughly divided into three stages: the vertex processing stage, the rasterization stage, and the fragment processing stage. The processing load of the GPU in the vertex processing stage and the fragment processing stage can affect the drawing efficiency of the GPU. At the same time, since the vertex processing stage and the fragment processing stage are both completed in the shader, the processing load of the GPU when the shader is called can also affect the drawing efficiency of the GPU. Then, after obtaining the numerical value of the parameter that can be used to determine the complexity and the weight value corresponding to the parameter that can be used to determine the complexity, the electronic device can calculate the complexity of the processing load of the GPU in the vertex processing stage that needs to determine the drawing efficiency, the complexity of the processing load of the GPU in the fragment processing stage that needs to determine the drawing efficiency, and the complexity of the processing load of the GPU in the shader call that needs to determine the drawing efficiency according to the numerical value of the parameter that can be used to determine the complexity and the weight value corresponding to the parameter that can be used to determine the complexity.

[0061] For example, the electronic device can calculate the complexity of the processing load of the GPU that needs to determine the drawing efficiency at the vertex processing stage, the complexity of the processing load of the GPU that needs to determine the drawing efficiency at the fragment processing stage, and the complexity of the processing load of the GPU that needs to determine the drawing efficiency when calling the shader based on the numerical value of the number of triangles and the weight value corresponding to the number of triangles, the numerical value of the number of primitives and the weight value corresponding to the number of primitives, and the numerical value of the number of operation instructions and the weight value corresponding to the number of operation instructions.

[0062] 105. Determine, according to the first complexity, the second complexity, and the third complexity, a drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction.

[0063] In an embodiment of the present application, after obtaining the first complexity, i.e., the complexity of the processing load of the GPU that needs to determine the drawing efficiency in the vertex processing stage, the second complexity, i.e., the complexity of the processing load of the GPU that needs to determine the drawing efficiency in the fragment processing stage, and the third complexity, i.e., the complexity of the processing load of the GPU that needs to determine the drawing efficiency during shader calls, the electronic device can determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction based on the first complexity, the second complexity and the third complexity.

[0064] For example, after obtaining the first complexity, the second complexity and the third complexity, the electronic device can determine whether the maximum complexity among the first complexity, the second complexity and the third complexity or the average of the first complexity, the second complexity and the third complexity is greater than the first preset complexity. If the maximum complexity among the first complexity, the second complexity and the third complexity or the average of the first complexity, the second complexity and the third complexity is greater than the first preset complexity, the electronic device can determine that the GPU has low drawing efficiency for drawing instructions and drawing data used for prediction. If the maximum complexity among the first complexity, the second complexity and the third complexity or the average of the first complexity, the second complexity and the third complexity is not greater than the first preset complexity, the electronic device can determine that the GPU has high drawing efficiency for drawing instructions and drawing data used for prediction. Among them, the first preset complexity can be set according to actual conditions, and no specific restrictions are made here.

[0065] For another example, the electronic device may pre-set a mapping relationship between complexity and drawing efficiency to obtain a first preset mapping relationship between complexity and drawing efficiency. After obtaining the first complexity, the second complexity, and the third complexity, the electronic device may determine the drawing efficiency corresponding to the largest complexity among the first complexity, the second complexity, and the third complexity or the average of the first complexity, the second complexity, and the third complexity according to the first preset mapping relationship, and use it as the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction.

[0066] For example, when the complexity is less than the second preset complexity, the drawing efficiency can be set to 100%, when the complexity is not less than the second preset complexity and less than the third preset complexity, the drawing efficiency is 75%, when the complexity is not less than the third preset complexity and less than the fourth preset complexity, the drawing efficiency is 50%, and when the complexity is not less than the fourth preset complexity, the drawing efficiency is 25%. When the largest complexity among the first complexity, the second complexity and the third complexity or the average of the first complexity, the second complexity and the third complexity is less than the second preset complexity, the electronic device can determine that the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is 100%.

[0067] The second preset complexity is less than the third preset complexity, and the third preset complexity is less than the fourth preset complexity. The second preset complexity, the third preset complexity, and the fourth preset complexity can be set according to actual conditions and are not specifically limited here.

[0068] In some embodiments, the method may further include:

[0069] Obtain multiple sets of drawing instructions and drawing data for prediction;

[0070] According to each group of drawing instructions and drawing data for prediction, calculating a first complexity, a second complexity, and a third complexity corresponding to each group of drawing instructions and drawing data for prediction;

[0071] The drawing efficiencies of the GPU for which drawing efficiency determination is required for the plurality of sets of drawing instructions and drawing data for prediction are determined according to the first complexity, the second complexity and the third complexity corresponding to each set of drawing instructions and drawing data for prediction.

[0072] In the related art, when multiple sets of drawing instructions and drawing data for prediction are obtained, the GPU can draw based on each set of drawing instructions and drawing data for prediction to obtain multiple frames of images for display. The electronic device can determine the time required for the GPU to draw each frame of image based on each set of drawing instructions and drawing data for prediction, and determine the GPU drawing efficiency based on the time.

[0073] In an embodiment of the present application, when multiple groups of drawing instructions and drawing data for prediction are obtained, for each group of drawing instructions and drawing data for prediction, the electronic device may calculate the first complexity, second complexity and third complexity corresponding to each group of drawing instructions and drawing data for prediction according to the methods provided in processes 101 to 105, and determine the drawing efficiency of the GPU for which the drawing efficiency needs to be determined for the multiple groups of drawing instructions and drawing data for prediction based on the first complexity, second complexity and third complexity corresponding to each group of drawing instructions and drawing data for prediction.

[0074] In some embodiments, determining the drawing efficiency of the GPU for the plurality of sets of drawing instructions and drawing data for prediction according to the first complexity, the second complexity, and the third complexity corresponding to each set of drawing instructions and drawing data for prediction includes:

[0075] Determine the maximum complexity among the first complexity, the second complexity and the third complexity corresponding to each group of drawing instructions and drawing data for prediction, and obtain multiple maximum complexities;

[0076] The drawing efficiency of the GPU for the plurality of groups of drawing instructions and drawing data for prediction is determined according to an average of the plurality of maximum complexities or a maximum complexity among the plurality of maximum complexities.

[0077] For example, after obtaining multiple maximum complexities, the electronic device can determine whether the average of the multiple maximum complexities or the maximum complexity among the multiple maximum complexities is greater than the fifth preset complexity. If the average of the multiple maximum complexities or the maximum complexity among the multiple maximum complexities is greater than the fifth preset complexity, the electronic device can determine that the GPU has low drawing efficiency for multiple groups of drawing instructions and drawing data for prediction. If the average of the multiple maximum complexities or the maximum complexity among the multiple maximum complexities is not greater than the fifth preset complexity, the electronic device can determine that the GPU has high drawing efficiency for multiple groups of drawing instructions and drawing data for prediction. Among them, the fifth preset complexity can be set according to actual conditions, and no specific restrictions are made here.

[0078] For another example, the electronic device may pre-set a mapping relationship between complexity and drawing efficiency to obtain a second preset mapping relationship between complexity and drawing efficiency. After obtaining multiple maximum complexities, the electronic device may determine the average of the multiple maximum complexities or the drawing efficiency corresponding to the maximum complexity among the multiple maximum complexities according to the preset mapping relationship, and use it as the drawing efficiency of the GPU for multiple groups of drawing instructions and drawing data for prediction.

[0079] For example, when the complexity is less than the sixth preset complexity, the drawing efficiency can be set to 100%, when the complexity is not less than the sixth preset complexity and less than the seventh preset complexity, the drawing efficiency is 75%, when the complexity is not less than the seventh preset complexity and less than the eighth preset complexity, the drawing efficiency is 50%, and when the complexity is not less than the eighth preset complexity, the drawing efficiency is 25%. When the average of multiple maximum complexities and the maximum complexity of the multiple maximum complexities are less than the sixth preset complexity, the electronic device can determine that the drawing efficiency of the GPU for multiple groups of drawing instructions and drawing data for prediction is 100%.

[0080] Among them, the sixth preset complexity is less than the seventh preset complexity, and the seventh preset complexity is less than the eighth preset complexity. The sixth preset complexity, the seventh preset complexity and the eighth preset complexity can be set according to actual conditions and are not specifically limited here.

[0081] See also Figure 2 , Figure 2 A second flow chart of the method for determining GPU rendering efficiency provided in an embodiment of the present application. The method may include:

[0082] 201. Obtain drawing instructions and drawing data for prediction.

[0083] In the embodiment of the present application, the electronic device may obtain the drawing instruction and drawing data for prediction. It is understandable that the GPU may perform drawing based on the drawing instruction and drawing data to obtain an image for display.

[0084] 202. Determine, based on the drawing instructions and the drawing data, the values ​​of the parameters that can be used to determine the complexity, wherein the parameters that can be used to determine the complexity include the number of triangles, the number of vertices, the number of indices, the number of primitives of the texture map, the number of pixels, the number of shader calls, the number of operation instructions, and the number of memory interaction instructions.

[0085] It can be understood that the drawing instructions may include specific drawing requirements, such as the vertex coordinates of the triangle to be drawn, the order of drawing the vertices of a triangle, i.e. the index, when to call the shader, etc.; the drawing data may include specific data, such as the primitives that need to be pasted into the drawn triangle, i.e. the primitives of the texture map, etc.

[0086] For example, after obtaining the drawing instructions and drawing data for prediction, the electronic device can determine the numerical value of the number of triangles, the numerical value of the number of vertices, the numerical value of the number of indices, the numerical value of the number of primitives of the texture map, the numerical value of the number of pixels, the numerical value of the number of shader calls, the numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions, etc., according to the drawing instructions and drawing data. The above numerical values ​​can be used as the numerical values ​​of parameters that can be used to determine the complexity. The above-mentioned number of triangles, the number of vertices, the number of indices, the number of primitives of the texture map, the number of pixels, the number of shader calls, the number of operation instructions, and the number of memory interaction instructions can be used as parameters that can be used to determine the complexity.

[0087] 203. Obtain a predetermined weight value corresponding to a parameter that can be used to determine complexity, where the weight value is obtained by fitting the time required for a GPU that needs to determine drawing efficiency to perform drawing based on drawing instructions and drawing data used for training.

[0088] It is understandable that before process 201, the following steps may also be included:

[0089] The electronic device determines an initial training value of a parameter that can be used to determine the complexity according to the drawing instruction and drawing data used for training;

[0090] The electronic device adjusts the initial training value multiple times to obtain multiple adjusted training values;

[0091] The electronic device determines the drawing instruction and drawing data corresponding to each adjusted training value;

[0092] The electronic device determines the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data used for training to obtain the training image, and determines the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times;

[0093] The electronic device performs fitting processing on the initial training value, the plurality of adjusted training values ​​and the plurality of drawing times to obtain training weight values ​​corresponding to the parameters that can be used to determine the complexity;

[0094] The electronic device uses the training weight value as a predetermined weight value corresponding to a parameter that can be used to determine the complexity.

[0095] For example, the electronic device may obtain drawing instructions and drawing data for training. The GPU may draw an image based on the drawing instructions and drawing data for training. The electronic device may determine the numerical value of the number of triangles, the numerical value of the number of vertices, the numerical value of the number of indices, the numerical value of the number of primitives of the texture map, the numerical value of the number of pixels, the numerical value of the number of shader calls, the numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions, etc., according to the drawing instructions and drawing data for training. Among them, the numerical value of the number of triangles can be used as the initial training numerical value of the number of triangles, the numerical value of the number of vertices can be used as the initial training numerical value of the number of vertices, the numerical value of the number of indices can be used as the initial training numerical value of the number of indices, the numerical value of the number of primitives of the texture map can be used as the initial training numerical value of the number of primitives of the texture map, the numerical value of the number of pixels can be used as the initial training numerical value of the number of pixels, the numerical value of the number of shader calls can be used as the initial training numerical value of the number of shader calls, the numerical value of the number of operation instructions can be used as the initial training numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions can be used as the initial training numerical value of the memory interaction instructions.

[0096] Subsequently, the electronic device may adjust the initial training value of the number of triangles multiple times to obtain multiple adjusted training values ​​of the number of triangles. For example, the electronic device may increase the value of the number of triangles by 2, 3, 10, 20, decrease it by 2, 5, 10, 30, etc., to obtain multiple adjusted training values ​​of the number of triangles.

[0097] Then, the electronic device can determine the corresponding drawing instructions and drawing data based on each adjusted training value of the number of triangles, the initial training value of the number of vertices, the initial training value of the number of indices, the initial training value of the number of primitives of the texture map, the initial training value of the number of pixels, the initial training value of the number of shader calls, the initial training value of the number of operation instructions, and the initial training value of the number of memory interaction instructions, and obtain the drawing instructions and drawing data corresponding to each adjusted training value of the number of triangles.

[0098] Afterwards, the electronic device can control the GPU of model A to draw based on the drawing instructions and drawing data used for training, to obtain a frame of training image for display, and determine the time required for the GPU of model A to draw based on the drawing instructions and drawing data used for training to obtain one frame of training image; the electronic device can also control the GPU of model A to draw based on the drawing instructions and drawing data corresponding to each adjusted training value of the number of triangles, to obtain multiple frames of adjusted images for display, and determine the time required for the GPU of model A to draw based on the drawing instructions and drawing data corresponding to each adjusted training value of the number of triangles to obtain each frame of adjusted image, and obtain multiple drawing times.

[0099] Based on the above process, the electronic device can obtain an initial training value of the number of triangles and its corresponding drawing time and multiple adjusted training values ​​of the number of triangles and their corresponding drawing times. The electronic device can fit the initial training value of the number of triangles and its corresponding drawing time and multiple adjusted training values ​​of the number of triangles and their corresponding drawing times by a linear regression method to obtain a weight value corresponding to the parameter of the number of triangles.

[0100] By analogy, following the same process as above, the electronic device can obtain the weight value corresponding to the parameter of the number of vertices, the weight value corresponding to the parameter of the number of indices, the weight value corresponding to the parameter of the number of primitives of the texture map, the weight value corresponding to the parameter of the number of pixels, the weight value corresponding to the parameter of the number of shader calls, the weight value corresponding to the parameter of the number of operation instructions, and the weight value corresponding to the parameter of the number of memory interaction instructions. The above weight values ​​can be used as the weight values ​​corresponding to the GPU of model A.

[0101] By analogy, through the same process as the above process, the electronic device can also obtain the weight values ​​corresponding to other models of GPUs.

[0102] In the embodiment of the present application, after determining the value of the parameter that can be used to determine the complexity, the electronic device can obtain the predetermined weight value corresponding to the parameter that can be used to determine the complexity. When it is necessary to determine the rendering efficiency of the GPU of model A, the weight value corresponding to the parameter that can be used to determine the complexity is the weight value corresponding to the GPU of model A.

[0103] 204. Calculate the product of the value of the number of triangles and the weight value corresponding to the number of triangles to obtain the first sub-complexity.

[0104] 205. Calculate the product of the value of the number of vertices and the weight value corresponding to the number of vertices to obtain the second sub-complexity.

[0105] 206. Calculate the product of the value of the number of indexes and the weight value corresponding to the number of indexes to obtain the third sub-complexity.

[0106] 207. Calculate the sum of the first sub-complexity, the second sub-complexity, and the third sub-complexity to obtain a first complexity, where the first complexity is used to characterize the processing load of the GPU in the vertex processing stage.

[0107] The greater the first complexity, the greater the processing load of the GPU in the vertex processing stage; the smaller the first complexity, the smaller the processing load of the GPU in the vertex processing stage.

[0108] For example, the first complexity = the numerical value of the number of triangles × the weight value corresponding to the number of triangles + the numerical value of the number of vertices × the weight value corresponding to the number of vertices + the numerical value of the number of indices × the weight value corresponding to the number of indices.

[0109] For example, assuming that the value of the number of triangles is 100, the weight value corresponding to the number of triangles is 0.3, the value of the number of vertices is 300, the weight value corresponding to the number of vertices is 0.4, the value of the number of indices is 100, and the weight value corresponding to the number of indices is 0.3, then the first complexity is 180.

[0110] 208. Calculate the product of the value of the number of primitives and the weight value corresponding to the number of primitives to obtain the fourth sub-complexity.

[0111] 209. Calculate the product of the value of the number of pixel points and the weight value corresponding to the number of pixel points to obtain the fifth sub-complexity.

[0112] 210. Calculate the sum of the fourth sub-complexity and the fifth sub-complexity to obtain a second complexity, where the second complexity is used to characterize the processing load of the GPU in the fragment processing stage.

[0113] Among them, the larger the second complexity, the greater the processing load of the GPU in the fragment processing stage; the smaller the second complexity, the smaller the processing load of the GPU in the fragment processing stage.

[0114] For example, the second complexity=the value of the number of primitives in the texture map×the weight value corresponding to the number of primitives in the texture map+the value of the number of pixels×the weight value corresponding to the number of pixels.

[0115] For example, assuming that the value of the number of primitives in the texture map is 200, the weight value corresponding to the number of primitives in the texture map is 0.6, the value of the number of pixels is 800, and the weight value corresponding to the number of pixels is 0.4, then the second complexity is 440.

[0116] 211. Calculate the product of the value of the number of shader calls and the weight value corresponding to the number of shader calls to obtain the sixth sub-complexity.

[0117] 212. Calculate the product of the numerical value of the number of operation instructions and the weight value corresponding to the number of operation instructions to obtain the seventh sub-complexity.

[0118] 213. Calculate the product of the numerical value of the number of memory interaction instructions and the weight value corresponding to the number of memory interaction instructions to obtain the eighth sub-complexity.

[0119] 214. Calculate the sum of the sixth sub-complexity, the seventh sub-complexity, and the eighth sub-complexity to obtain a third complexity, where the third complexity is used to characterize the processing load of the GPU when the shader is called.

[0120] Among them, the larger the third complexity is, the greater the processing load of the GPU when the shader is called; the smaller the third complexity is, the smaller the processing load of the GPU when the shader is called.

[0121] For example, the third complexity = the value of the number of shader calls × the weight value corresponding to the number of shader calls + the value of the number of operation instructions × the weight value corresponding to the number of operation instructions + the value of the number of memory interaction instructions × the weight value corresponding to the number of memory interaction instructions.

[0122] For example, the value of the shader call times is 300, the weight value corresponding to the shader call times is 0.2, the value of the number of operation instructions is 200, the weight value corresponding to the number of operation instructions is 0.4, the value of the number of memory interaction instructions is 200, and the weight value corresponding to the number of memory interaction instructions is 0.4, then the third complexity is 220.

[0123] 215. Determine a drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction according to a maximum complexity among the first complexity, the second complexity, and the third complexity.

[0124] For example, assuming that the first complexity is 180, the second complexity is 440, and the third complexity is 220, the electronic device may determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction according to the second complexity.

[0125] For example, assuming that the second complexity is the largest complexity among the first complexity, the second complexity and the third complexity, the electronic device can determine whether the second complexity is greater than the first preset complexity. If the second complexity is greater than the first preset complexity, the electronic device can determine that the GPU has low drawing efficiency for the drawing instructions and drawing data used for prediction. If the second complexity is not greater than the first preset complexity, the electronic device can determine that the GPU has high drawing efficiency for the drawing instructions and drawing data used for prediction. Among them, the first preset complexity can be set according to actual conditions and is not specifically limited here.

[0126] For another example, the electronic device may pre-set a mapping relationship between complexity and drawing efficiency to obtain a first preset mapping relationship between complexity and drawing efficiency. Assuming that the second complexity is the largest complexity among the first complexity, the second complexity, and the third complexity, the electronic device may determine the drawing efficiency corresponding to the second complexity according to the first preset mapping relationship, and use it as the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction.

[0127] For example, when the complexity is less than the second preset complexity, the drawing efficiency can be set to 100%, when the complexity is not less than the second preset complexity and less than the third preset complexity, the drawing efficiency is 75%, when the complexity is not less than the third preset complexity and less than the fourth preset complexity, the drawing efficiency is 50%, and when the complexity is not less than the fourth preset complexity, the drawing efficiency is 25%. Assuming that the second complexity is the largest complexity among the first complexity, the second complexity and the third complexity, when the second complexity is less than the second preset complexity, the electronic device can determine that the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is 100%.

[0128] In some embodiments, the electronic device may determine the drawing efficiency of different models of GPUs for the predicted drawing instructions and drawing data through the above process. The electronic device may score different models of GPUs according to the drawing efficiency of different models of GPUs for the predicted drawing instructions and drawing data, and obtain scores of different models of GPUs. The larger the score, the higher the drawing efficiency of the model of GPU corresponding to the score for the predicted drawing instructions and drawing data.

[0129] For example, assuming that the drawing efficiency corresponding to the GPU model A is 50%, the drawing efficiency corresponding to the GPU model B is 75%, and the drawing efficiency corresponding to the GPU model C is 100%, the score of the GPU model A may be 50, the score of the GPU model B may be 75, and the score of the GPU model C may be 100. It can be determined that the GPU model C has the highest drawing efficiency for the drawing instructions and drawing data used for prediction.

[0130] In other embodiments, since the larger the first complexity is, the larger the processing load of the GPU in the vertex processing stage is, therefore, a complexity can be pre-set, and when the first complexity is greater than the complexity, the GPU that needs to determine the drawing efficiency can be improved so that the first complexity corresponding to the improved GPU is not greater than the complexity. Similarly, since the larger the second complexity is, the larger the processing load of the GPU in the fragment processing stage is, therefore, a complexity can be pre-set, and when the second complexity is greater than the complexity, the GPU that needs to determine the drawing efficiency can be improved so that the second complexity corresponding to the improved GPU is not greater than the complexity. Since the larger the third complexity is, the larger the processing load of the GPU when calling the shader is, therefore, a complexity can be pre-set, and when the third complexity is greater than the complexity, the GPU that needs to determine the drawing efficiency can be improved so that the third complexity corresponding to the improved GPU is not greater than the complexity.

[0131] In some embodiments, the drawing instructions and drawing data used for prediction may be drawing instructions and drawing data corresponding to the game image, that is, the GPU performs drawing based on the drawing instructions and drawing data to obtain a frame of game image for display.

[0132] For example, the electronic device may obtain the drawing instructions and drawing data corresponding to 30 frames of game images corresponding to a certain game application. Among them, the 30 frames of game images are the 30 frames of game images with the longest drawing time required for the GPU to draw in the game images corresponding to the game application. Then, the electronic device may determine the numerical value of the parameter that can be used to determine the complexity corresponding to each frame of the game image according to the drawing instructions and drawing data corresponding to each frame of the game image. Then, the electronic device may obtain the weight value corresponding to the predetermined parameter that can be used to determine the complexity. Among them, when it is necessary to determine the drawing efficiency of the GPU of model B, the weight value corresponding to the GPU of model B may be obtained as the weight value corresponding to the parameter that can be used for complexity. Subsequently, the electronic device may calculate the first complexity, the second complexity and the third complexity corresponding to each frame of the game image according to the numerical value of the parameter that can be used to determine the complexity corresponding to each frame of the game image and the predetermined weight value corresponding to the parameter that can be used to determine the complexity. Then, the electronic device may determine the drawing time corresponding to each frame of the game image according to the mapping relationship between the first complexity, the second complexity and the third complexity corresponding to each frame of the game image and the pre-set complexity and drawing time. Afterwards, the electronic device can calculate the sum of the rendering time corresponding to multiple frames of game images to obtain the total rendering time. When the total rendering time is less than 1 second, the electronic device can determine that the rendering efficiency of the GPU model B is high and can support the smooth operation of the game application.

[0133] See also Figure 3 , Figure 3A schematic diagram of a process of a model building method provided in an embodiment of the present application, the process may include:

[0134] 301. Determine initial training values ​​of parameters that can be used to determine complexity according to drawing instructions and drawing data used for training.

[0135] It is understandable that the drawing instruction may include specific drawing requirements, such as the vertex coordinates of the triangle to be drawn, the order of drawing the vertices of a certain triangle, that is, the index, when to call the shader, etc.; the drawing data may include specific data, such as the primitives to be pasted into the drawn triangle, that is, the primitives of the texture map, etc. The GPU draws based on the corresponding drawing instructions and drawing data, and obtains a frame of image for display.

[0136] In this embodiment, after obtaining the drawing instructions and drawing data for training, the electronic device can determine the numerical value of the number of triangles, the numerical value of the number of vertices, the numerical value of the number of indices, the numerical value of the number of primitives of the texture map, the numerical value of the number of pixels, the numerical value of the number of shader calls, the numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions, etc. according to the drawing instructions and drawing data. Any of the above numerical values ​​can be used as a training value of a parameter that can be used to determine complexity. The number of triangles, the number of vertices, the number of indices, the number of primitives of the texture map, the number of pixels, the number of shader calls, the number of operation instructions, or the number of memory interaction instructions can be used as a parameter that can be used to determine complexity.

[0137] 302. Adjust the initial training value multiple times to obtain multiple adjusted training values.

[0138] For example, assuming that the parameter that can be used to determine the complexity includes the number of triangles, the electronic device can adjust the initial value of the number of triangles multiple times to obtain multiple adjusted training values ​​of the number of triangles. For example, the electronic device can increase the value of the number of triangles by 2, 3, 10, 20, decrease it by 2, 5, 10, 30, etc., to obtain multiple adjusted training values ​​of the number of triangles.

[0139] 303. Determine the drawing instruction and drawing data corresponding to each adjusted training value.

[0140] For example, the electronic device can determine the corresponding drawing instructions and drawing data based on each adjusted training value of the number of triangles, the initial training value of the number of vertices, the initial training value of the number of indices, the initial training value of the number of texture primitives, the initial training value of the number of pixels, the initial training value of the number of shader calls, the initial training value of the number of operation instructions, and the initial training value of the number of memory interaction instructions, and obtain the drawing instructions and drawing data corresponding to each adjusted training value of the number of triangles.

[0141] 304. Determine the time required for a GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data used for training to obtain a training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain a corresponding image, so as to obtain multiple drawing times.

[0142] For example, assuming that the GPU whose drawing efficiency needs to be determined is a GPU of model A, the electronic device can control the GPU of model A to draw based on the drawing instructions and drawing data used for training, to obtain a frame of training image for display, and determine the time required for the GPU of model A to draw based on the drawing instructions and drawing data used for training to obtain one frame of training image; the electronic device can also control the GPU of model A to draw based on the drawing instructions and drawing data corresponding to each adjusted training value of the number of triangles, to obtain multiple frames of adjusted images for display, and determine the time required for the GPU of model A to draw based on the drawing instructions and drawing data corresponding to each adjusted training value of the number of triangles to obtain each frame of adjusted image, and obtain multiple drawing times.

[0143] 305. Perform fitting processing on the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity.

[0144] For example, the electronic device can fit the initial training values ​​of the number of triangles and their corresponding drawing times and multiple adjusted training values ​​of the number of triangles and their corresponding drawing times through a linear regression method to obtain a weight value corresponding to the number of triangles, a parameter that can be used to determine complexity.

[0145] 306. Based on the parameters that can be used to determine the complexity and their corresponding weight values, a model that can be used to determine the complexity is constructed.

[0146] It is understandable that, according to the same process as processes 301 to 305, the electronic device can obtain the weight value corresponding to the parameter of the number of vertices, the weight value corresponding to the parameter of the number of indices, the weight value corresponding to the parameter of the number of primitives of the texture map, the weight value corresponding to the parameter of the number of pixels, the weight value corresponding to the parameter of the number of shader calls, the weight value corresponding to the parameter of the number of operation instructions, and the weight value corresponding to the parameter of the number of memory interaction instructions. The above weight values ​​can be used as the weight values ​​corresponding to the GPU of model A.

[0147] Afterwards, the electronic device can construct a model that can be used to determine complexity based on the number of triangles, the weight values ​​corresponding to the number of triangles, the number of vertices, the weight values ​​corresponding to the number of vertices, the number of indices, the weight values ​​corresponding to the number of indices, the number of primitives, the weight values ​​corresponding to the number of primitives, the number of pixels, the weight values ​​corresponding to the number of pixels, the number of shader calls, the weight values ​​corresponding to the number of shader calls, the number of computing instructions, the weight values ​​corresponding to the number of computing instructions, the number of memory interaction instructions, and the weight values ​​corresponding to the number of memory interaction instructions.

[0148] For example, the input parameters in the model that can be used to determine the complexity can be: the numerical value of the number of triangles, the numerical value of the number of vertices, the numerical value of the number of indices, the numerical value of the number of primitives of the texture map, the numerical value of the number of pixels, the numerical value of the number of shader calls, the numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions. The output result of the model that can be used to determine the complexity can be a first complexity for characterizing the processing load of the GPU in the vertex processing stage, a second complexity for characterizing the processing load of the GPU in the fragment processing stage, and a third complexity for characterizing the processing load of the GPU when the shader is called. Among them, the first complexity can be obtained by calculating the product of the numerical value of the number of triangles and the weight value corresponding to the number of triangles, the product of the numerical value of the number of vertices and the weight value corresponding to the number of vertices, and the product of the numerical value of the number of indices and the weight value corresponding to the number of indices, and then adding them. The second complexity can be obtained by calculating the product of the numerical value of the number of primitives of the texture map and the weight value corresponding to the number of primitives of the texture map, and the numerical value of the number of pixels and the weight value corresponding to the number of pixels, and then adding them. The third complexity can be obtained by calculating the product of the numerical value of the shader call number and the weight value corresponding to the shader call number, the product of the numerical value of the number of operation instructions and the weight value corresponding to the number of operation instructions, and the product of the numerical value of the number of memory interaction instructions and the weight value corresponding to the number of memory interaction instructions, and then adding them together.

[0149] In some embodiments, after obtaining the drawing instructions and drawing data used for prediction, the electronic device can determine the numerical value of the number of triangles, the numerical value of the number of vertices, the numerical value of the number of indices, the numerical value of the number of primitives in the texture map, the numerical value of the number of pixels, the numerical value of the number of shader calls, the numerical value of the number of operation instructions, and the numerical value of the number of memory interaction instructions based on the drawing instructions and drawing data; then, the electronic device can input the above numerical values ​​into the model constructed by the above process that can be used to determine the complexity, and obtain a first complexity for characterizing the processing load of the GPU in the vertex processing stage, a second complexity for characterizing the processing load of the GPU in the fragment processing stage, and a third complexity for characterizing the processing load of the GPU during shader calls; then, the electronic device can determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction based on the first complexity, the second complexity, and the third complexity.

[0150] Specifically, how to determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction according to the first complexity, the second complexity, and the third complexity can be found in the GPU drawing efficiency determination method embodiment, which will not be described in detail in this embodiment.

[0151] See also Figure 4 , Figure 4 The schematic diagram of the structure of the GPU rendering efficiency determination device provided in the embodiment of the present application includes: a first acquisition module 401 , a first determination module 402 , a second acquisition module 403 , a calculation module 404 and a second determination module 405 .

[0152] The first acquisition module 401 is used to acquire drawing instructions and drawing data for prediction.

[0153] The first determination module 402 is used to determine the value of a parameter that can be used to determine the complexity according to the drawing instruction and the drawing data.

[0154] The second acquisition module 403 is used to obtain a weight value corresponding to a predetermined parameter that can be used to determine the complexity, wherein the weight value is obtained by fitting the time required for a GPU that needs to determine the drawing efficiency to perform drawing based on the drawing instructions and drawing data used for training.

[0155] The calculation module 404 is used to calculate a first complexity, a second complexity and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in the vertex processing stage, the second complexity is used to characterize the processing load of the GPU in the fragment processing stage, and the third complexity is used to characterize the processing load of the GPU during shader calling.

[0156] The second determination module 405 is configured to determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction according to the first complexity, the second complexity, and the third complexity.

[0157] In some embodiments, the parameters that can be used to determine the complexity include the number of triangles, the number of vertices and the number of indices, and the calculation module 404 can be used to: calculate the product of the numerical value of the number of triangles and the weight value corresponding to the number of triangles to obtain a first sub-complexity; calculate the product of the numerical value of the number of vertices and the weight value corresponding to the number of vertices to obtain a second sub-complexity; calculate the product of the numerical value of the number of indices and the weight value corresponding to the number of indices to obtain a third sub-complexity; calculate the sum of the first sub-complexity, the second sub-complexity and the third sub-complexity to obtain a first complexity.

[0158] In some embodiments, the parameters that can be used to determine the complexity include the number of primitives and the number of pixels of the texture map, and the calculation module 404 can be used to: calculate the product of the numerical value of the number of primitives and the weight value corresponding to the number of primitives to obtain a fourth sub-complexity; calculate the product of the numerical value of the number of pixels and the weight value corresponding to the number of pixels to obtain a fifth sub-complexity; calculate the sum of the fourth sub-complexity and the fifth sub-complexity to obtain a second complexity.

[0159] In some embodiments, the parameters that can be used to determine the complexity include the number of shader calls, the number of operation instructions and the number of memory interaction instructions. The calculation module 404 can be used to: calculate the product of the numerical value of the shader call number and the weight value corresponding to the number of shader calls to obtain the sixth sub-complexity; calculate the product of the numerical value of the number of operation instructions and the weight value corresponding to the number of operation instructions to obtain the seventh sub-complexity; calculate the product of the numerical value of the number of memory interaction instructions and the weight value corresponding to the number of memory interaction instructions to obtain the eighth sub-complexity; calculate the sum of the sixth sub-complexity, the seventh sub-complexity and the eighth sub-complexity to obtain the third complexity.

[0160] In some embodiments, the second determination module 405 may be configured to determine a drawing efficiency of the GPU for drawing instructions and drawing data used for prediction according to a maximum complexity among the first complexity, the second complexity and the third complexity.

[0161] In some embodiments, the second determination module 405 can be used to: obtain multiple groups of drawing instructions and drawing data for prediction; calculate the first complexity, second complexity and third complexity corresponding to each group of drawing instructions and drawing data for prediction according to each group of drawing instructions and drawing data for prediction; determine the drawing efficiency of the GPU for multiple groups of drawing instructions and drawing data for prediction according to the first complexity, second complexity and third complexity corresponding to each group of drawing instructions and drawing data for prediction.

[0162] In some embodiments, the determination module 405 can be used to: determine the maximum complexity of the first complexity, the second complexity and the third complexity corresponding to each group of drawing instructions and drawing data for prediction, and obtain multiple maximum complexities; determine the drawing efficiency of the GPU for multiple groups of drawing instructions and drawing data for prediction based on the average of the multiple maximum complexities or the maximum complexity of the multiple maximum complexities.

[0163] In some embodiments, the first acquisition module 401 can be used to: determine the initial training values ​​of the parameters that can be used to determine the complexity based on the drawing instructions and drawing data used for training; adjust the initial training values ​​multiple times to obtain multiple adjusted training values; determine the drawing instructions and drawing data corresponding to each adjusted training value; determine the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data used for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times; fit the initial training values, the multiple adjusted training values ​​and the multiple drawing times to obtain the training weight values ​​corresponding to the parameters that can be used to determine the complexity; and use the training weight values ​​as the predetermined weight values ​​corresponding to the parameters that can be used to determine the complexity.

[0164] See also Figure 5 , Figure 5 The schematic diagram of the structure of the model building device provided in the embodiment of the present application is as follows: The model building device 500 comprises: a third determination module 501 , an adjustment module 502 , a fourth determination module 503 , a fifth determination module 504 , a processing module 505 and a building module 506 .

[0165] A third determining module 501 is used to determine an initial training value of a parameter that can be used to determine complexity according to the drawing instruction and drawing data used for training;

[0166] An adjustment module 502 is used to adjust the initial training value multiple times to obtain multiple adjusted training values;

[0167] A fourth determining module 503 is used to determine the drawing instructions and drawing data corresponding to each adjusted training value;

[0168] A fifth determining module 504 is used to determine the time required for the GPU for which drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times;

[0169] A processing module 505 is used to perform fitting processing on the initial training value, the multiple adjusted training values ​​and the multiple drawing times to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity;

[0170] The construction module 506 is used to construct a model that can be used to determine the complexity according to the parameters that can be used to determine the complexity and their corresponding weight values.

[0171] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed on a computer, the computer executes a process in a method for determining GPU rendering efficiency or a process in a model building method as provided in the present embodiment.

[0172] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the processor is used to execute the process in the GPU drawing efficiency determination method or the process in the model construction method provided in this embodiment by calling a computer program stored in the memory.

[0173] See also Figure 6 , Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0174] The electronic device 600 may include components such as a memory 601 and a processor 602. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0175] The memory 601 may be used to store applications and data. The applications stored in the memory 601 include executable codes. The applications may be composed of various functional modules. The processor 602 executes various functional applications and data processing by running the applications stored in the memory 601.

[0176] The processor 602 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing applications stored in the memory 601 and calling data stored in the memory 601, thereby monitoring the electronic device as a whole.

[0177] In this embodiment, the processor 602 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 601 according to the following instructions, and the processor 602 will run the application program stored in the memory 601, so as to realize the process:

[0178] Get drawing instructions and drawing data for prediction;

[0179] Determining, according to the drawing instruction and the drawing data, a value of a parameter that can be used to determine complexity;

[0180] Obtaining a weight value corresponding to a predetermined parameter that can be used to determine the complexity, wherein the weight value is obtained by fitting the time required for a GPU that needs to determine the drawing efficiency to perform drawing based on the drawing instructions and drawing data used for training;

[0181] Calculate a first complexity, a second complexity, and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in the vertex processing stage, the second complexity is used to characterize the processing load of the GPU in the fragment processing stage, and the third complexity is used to characterize the processing load of the GPU when the shader is called;

[0182] A drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is determined according to the first complexity, the second complexity, and the third complexity.

[0183] In this embodiment, the processor 602 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 601 according to the following instructions, and the processor 602 will run the application program stored in the memory 601, and can also implement the process:

[0184] Determining initial training values ​​of parameters that can be used to determine complexity according to the drawing instructions and drawing data used for training;

[0185] Adjusting the initial training value multiple times to obtain multiple adjusted training values;

[0186] Determine the drawing instructions and drawing data corresponding to each adjusted training value;

[0187] Determine the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times;

[0188] Performing fitting processing on the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity;

[0189] According to the parameters that can be used to determine the complexity and their corresponding weight values, a model that can be used to determine the complexity is constructed.

[0190] See also Figure 7 The electronic device 700 may include components such as a memory 701, a processor 702, an input unit 703, and an output unit 704.

[0191] The memory 701 may be used to store applications and data. The applications stored in the memory 701 include executable codes. The applications may be composed of various functional modules. The processor 702 executes various functional applications and data processing by running the applications stored in the memory 701.

[0192] Processor 702 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing applications stored in memory 401 and calling data stored in memory 701, thereby monitoring the electronic device as a whole.

[0193] The input unit 703 may be used to receive input numbers, character information or user feature information (such as fingerprints), and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0194] The output unit 704 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. The output unit can include a display panel.

[0195] In this embodiment, the processor 702 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 701 according to the following instructions, and the processor 702 will run the application program stored in the memory 701, so as to realize the process:

[0196] Get drawing instructions and drawing data for prediction;

[0197] Determining, according to the drawing instruction and the drawing data, a value of a parameter that can be used to determine complexity;

[0198] Obtaining a weight value corresponding to a predetermined parameter that can be used to determine the complexity, wherein the weight value is obtained by fitting the time required for a GPU that needs to determine the drawing efficiency to perform drawing based on the drawing instructions and drawing data used for training;

[0199] Calculate a first complexity, a second complexity, and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in the vertex processing stage, the second complexity is used to characterize the processing load of the GPU in the fragment processing stage, and the third complexity is used to characterize the processing load of the GPU when the shader is called;

[0200] A drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is determined according to the first complexity, the second complexity, and the third complexity.

[0201] In some embodiments, the parameters that can be used to determine the complexity include the number of triangles, the number of vertices, and the number of indices. When the processor 702 executes the calculation of the first complexity based on the numerical values ​​and the weight values, it can perform: calculating the product of the numerical value of the number of triangles and the weight value corresponding to the number of triangles to obtain the first sub-complexity; calculating the product of the numerical value of the number of vertices and the weight value corresponding to the number of vertices to obtain the second sub-complexity; calculating the product of the numerical value of the number of indices and the weight value corresponding to the number of indices to obtain the third sub-complexity; calculating the sum of the first sub-complexity, the second sub-complexity, and the third sub-complexity to obtain the first complexity.

[0202] In some embodiments, the parameters that can be used to determine the complexity include the number of primitives and the number of pixels of the texture map. When the processor 702 executes the calculation of the second complexity based on the numerical value and the weight value, it can perform: calculating the product of the numerical value of the number of primitives and the weight value corresponding to the number of primitives to obtain a fourth sub-complexity; calculating the product of the numerical value of the number of pixels and the weight value corresponding to the number of pixels to obtain a fifth sub-complexity; calculating the sum of the fourth sub-complexity and the fifth sub-complexity to obtain the second complexity.

[0203] In some embodiments, the parameters that can be used to determine the complexity include the number of shader calls, the number of operation instructions, and the number of memory interaction instructions. When the processor 702 executes the calculation of the third complexity based on the numerical values ​​and the weight values, it can perform: calculating the product of the numerical value of the number of shader calls and the weight value corresponding to the number of shader calls to obtain the sixth sub-complexity; calculating the product of the numerical value of the number of operation instructions and the weight value corresponding to the number of operation instructions to obtain the seventh sub-complexity; calculating the product of the numerical value of the number of memory interaction instructions and the weight value corresponding to the number of memory interaction instructions to obtain the eighth sub-complexity; calculating the sum of the sixth sub-complexity, the seventh sub-complexity, and the eighth sub-complexity to obtain the third complexity.

[0204] In some embodiments, when the processor 702 determines the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction based on the first complexity, the second complexity, and the third complexity, it can execute: determining the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction based on the maximum complexity of the first complexity, the second complexity, and the third complexity.

[0205] In some embodiments, the processor 702 may further execute: obtaining multiple groups of drawing instructions and drawing data for prediction; calculating, based on each group of drawing instructions and drawing data for prediction, a first complexity, a second complexity, and a third complexity corresponding to each group of drawing instructions and drawing data for prediction; and determining, based on the first complexity, the second complexity, and the third complexity corresponding to each group of drawing instructions and drawing data for prediction, the drawing efficiency of the GPU for the multiple groups of drawing instructions and drawing data for prediction.

[0206] In some embodiments, when the processor 702 executes the determination of the drawing efficiency of the GPU for multiple groups of drawing instructions and drawing data for prediction based on the first complexity, the second complexity, and the third complexity corresponding to each group of drawing instructions and drawing data for prediction, it can execute: determining the maximum complexity among the first complexity, the second complexity, and the third complexity corresponding to each group of drawing instructions and drawing data for prediction to obtain multiple maximum complexities; determining the drawing efficiency of the GPU for multiple groups of drawing instructions and drawing data for prediction based on the average of the multiple maximum complexities or the maximum complexity among the multiple maximum complexities.

[0207] In some embodiments, before the processor 702 executes the acquisition of drawing instructions and drawing data for prediction, it can also execute: determining an initial training value of a parameter that can be used to determine complexity based on the drawing instructions and drawing data for training; adjusting the initial training value multiple times to obtain multiple adjusted training values; determining the drawing instructions and drawing data corresponding to each adjusted training value; determining the time required for a GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain a training image, and determining the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain a corresponding image, so as to obtain multiple drawing times; fitting the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain training weight values ​​corresponding to the parameters that can be used to determine complexity; and using the training weight values ​​as predetermined weight values ​​corresponding to the parameters that can be used to determine complexity.

[0208] In this embodiment, the processor 702 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 701 according to the following instructions, and the processor 702 will run the application program stored in the memory 701, and can also implement the process:

[0209] Determining initial training values ​​of parameters that can be used to determine complexity according to the drawing instructions and drawing data used for training;

[0210] Adjusting the initial training value multiple times to obtain multiple adjusted training values;

[0211] Determine the drawing instructions and drawing data corresponding to each adjusted training value;

[0212] Determine the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times;

[0213] Performing fitting processing on the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity;

[0214] According to the parameters that can be used to determine the complexity and their corresponding weight values, a model that can be used to determine the complexity is constructed.

[0215] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the GPU drawing efficiency determination method or model construction method above, which will not be repeated here.

[0216] The GPU drawing efficiency determination device provided in the embodiment of the present application and the GPU drawing efficiency determination method in the above embodiment belong to the same concept. Any method provided in the GPU drawing efficiency determination method embodiment can be run on the GPU drawing efficiency determination device. The specific implementation process is detailed in the GPU drawing efficiency determination method embodiment, which will not be repeated here.

[0217] The model building device provided in the embodiment of the present application belongs to the same concept as the model building method in the above embodiment. Any method provided in the model building method embodiment can be run on the model building device. The specific implementation process is detailed in the model building method embodiment and will not be repeated here.

[0218] It should be noted that, for the GPU drawing efficiency determination method or model building method described in the embodiment of the present application, ordinary technicians in this field can understand that all or part of the process of implementing the GPU drawing efficiency determination method or model building method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as stored in a memory, and executed by at least one processor, and the execution process may include the process of the embodiment of the GPU drawing efficiency determination method or model building method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), etc.

[0219] For the GPU drawing efficiency determination or model building device of the embodiment of the present application, its various functional modules can be integrated into one processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.

[0220] The above is a detailed introduction to a GPU drawing efficiency determination method, model building method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for determining GPU rendering efficiency, characterized in that: include: Get drawing instructions and drawing data for prediction; Determine, according to the drawing instruction and the drawing data, values ​​of parameters that can be used to determine complexity, wherein the parameters that can be used to determine complexity include the number of triangles, the number of vertices, the number of indices, the number of primitives of texture mapping, the number of pixels, the number of shader calls, the number of operation instructions, and the number of memory interaction instructions; Obtaining a weight value corresponding to a predetermined parameter capable of determining complexity, wherein the weight value is obtained by fitting an initial training value, a plurality of adjusted training values, and a plurality of drawing times of the parameter capable of determining complexity, wherein the plurality of drawing times include a time required for a GPU for determining drawing efficiency to draw a training image based on a drawing instruction and drawing data for training, and a time required for the GPU to draw a corresponding image based on a drawing instruction and drawing data corresponding to each of the plurality of adjusted training values, wherein the plurality of adjusted training values ​​are obtained by adjusting the initial training value multiple times, and the initial training value is determined according to the drawing instruction and drawing data for training; Calculate a first complexity, a second complexity, and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in the vertex processing stage, the second complexity is used to characterize the processing load of the GPU in the fragment processing stage, and the third complexity is used to characterize the processing load of the GPU when the shader is called; A drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction is determined according to the first complexity, the second complexity, and the third complexity.

2. The method for determining GPU rendering efficiency according to claim 1, characterized in that: The parameters that can be used to determine the complexity include the number of triangles, the number of vertices, and the number of indices, and the first complexity is calculated according to the numerical values ​​and the weight value, including: Calculate the product of the value of the number of triangles and the weight value corresponding to the number of triangles to obtain a first sub-complexity; Calculate the product of the value of the number of vertices and the weight value corresponding to the number of vertices to obtain a second sub-complexity; Calculate the product of the value of the index number and the weight value corresponding to the index number to obtain a third sub-complexity; The sum of the first sub-complexity, the second sub-complexity and the third sub-complexity is calculated to obtain a first complexity.

3. The method for determining GPU rendering efficiency according to claim 1, characterized in that: The parameters that can be used to determine the complexity include the number of primitives and the number of pixels of the texture map, and the second complexity is calculated according to the numerical values ​​and the weight value, including: Calculate the product of the value of the number of graphic elements and the weight value corresponding to the number of graphic elements to obtain a fourth sub-complexity; Calculate the product of the value of the number of pixels and the weight value corresponding to the number of pixels to obtain a fifth sub-complexity; The sum of the fourth sub-complexity and the fifth sub-complexity is calculated to obtain a second complexity.

4. The method for determining GPU rendering efficiency according to claim 1, characterized in that: The parameters that can be used to determine the complexity include the number of shader calls, the number of operation instructions, and the number of memory interaction instructions. The third complexity is calculated according to the numerical values ​​and the weight value, including: Calculate the product of the value of the number of shader calls and the weight value corresponding to the number of shader calls to obtain a sixth sub-complexity; Calculate the product of the numerical value of the number of operation instructions and the weight value corresponding to the number of operation instructions to obtain the seventh sub-complexity; Calculate the product of the value of the number of memory interaction instructions and the weight value corresponding to the number of memory interaction instructions to obtain an eighth sub-complexity; The sum of the sixth sub-complexity, the seventh sub-complexity and the eighth sub-complexity is calculated to obtain a third complexity.

5. The method for determining GPU rendering efficiency according to claim 1, characterized in that: The determining, according to the first complexity, the second complexity, and the third complexity, a drawing efficiency of the GPU for the drawing instruction and the drawing data used for prediction includes: A drawing efficiency of the GPU for the drawing instruction and drawing data used for prediction is determined according to a maximum complexity among the first complexity, the second complexity, and the third complexity.

6. The method for determining GPU rendering efficiency according to claim 1, characterized in that: The method further comprises: Obtain multiple sets of drawing instructions and drawing data for prediction; According to each group of drawing instructions and drawing data for prediction, calculating a first complexity, a second complexity, and a third complexity corresponding to each group of drawing instructions and drawing data for prediction; The drawing efficiency of the GPU for the multiple groups of drawing instructions and drawing data for prediction is determined according to the first complexity, the second complexity and the third complexity corresponding to each group of drawing instructions and drawing data for prediction.

7. The method for determining GPU rendering efficiency according to claim 6, characterized in that: The determining, according to the first complexity, the second complexity, and the third complexity corresponding to each group of drawing instructions and drawing data for prediction, the drawing efficiency of the GPU for the plurality of groups of drawing instructions and drawing data for prediction includes: Determine the maximum complexity among the first complexity, the second complexity and the third complexity corresponding to each group of drawing instructions and drawing data for prediction, and obtain multiple maximum complexities; The drawing efficiency of the GPU for the plurality of groups of drawing instructions and drawing data for prediction is determined according to an average of the plurality of maximum complexities or a maximum complexity among the plurality of maximum complexities.

8. The method for determining GPU rendering efficiency according to claim 1, characterized in that: Before obtaining the drawing instruction and drawing data for prediction, the method further includes: Determining initial training values ​​of parameters that can be used to determine complexity according to the drawing instructions and drawing data used for training; Adjusting the initial training value multiple times to obtain multiple adjusted training values; Determine the drawing instructions and drawing data corresponding to each adjusted training value; Determine the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times; Performing fitting processing on the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain training weight values ​​corresponding to parameters that can be used to determine complexity; The training weight value is used as a predetermined weight value corresponding to a parameter that can be used to determine complexity.

9. A model building method, characterized in that: include: Determining initial training values ​​of parameters that can be used to determine complexity according to the drawing instructions and drawing data used for training; Adjusting the initial training value multiple times to obtain multiple adjusted training values; Determine the drawing instructions and drawing data corresponding to each adjusted training value; Determine the time required for the GPU whose drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain the training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain the corresponding image, so as to obtain multiple drawing times; Performing fitting processing on the initial training value, the multiple adjusted training values, and the multiple drawing times to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity; According to the parameters that can be used to determine the complexity and their corresponding weight values, a model that can be used to determine the complexity is constructed.

10. A GPU rendering efficiency determination device, characterized in that: include: A first acquisition module, used for acquiring drawing instructions and drawing data for prediction; A first determination module is used to determine the values ​​of parameters that can be used to determine the complexity according to the drawing instructions and the drawing data, wherein the parameters that can be used to determine the complexity include the number of triangles, the number of vertices, the number of indices, the number of primitives of texture mapping, the number of pixels, the number of shader calls, the number of operation instructions, and the number of memory interaction instructions; a second acquisition module, for acquiring a weight value corresponding to a predetermined parameter capable of determining complexity, the weight value being obtained by fitting an initial training value, a plurality of adjusted training values, and a plurality of drawing times of the parameter capable of determining complexity, the plurality of drawing times comprising a time required for a GPU for determining drawing efficiency to draw a training image based on drawing instructions and drawing data for training, and a time required for the GPU to draw a corresponding image based on drawing instructions and drawing data corresponding to each of the plurality of adjusted training values, the plurality of adjusted training values ​​being obtained by adjusting the initial training value multiple times, the initial training value being determined according to the drawing instructions and drawing data for training; a calculation module, configured to calculate a first complexity, a second complexity, and a third complexity according to the numerical value and the weight value, wherein the first complexity is used to characterize the processing load of the GPU in a vertex processing stage, the second complexity is used to characterize the processing load of the GPU in a fragment processing stage, and the third complexity is used to characterize the processing load of the GPU when a shader is called; The second determination module is used to determine the drawing efficiency of the GPU for the drawing instructions and drawing data used for prediction according to the first complexity, the second complexity and the third complexity.

11. A model building device, characterized in that: include: A third determination module, used to determine an initial training value of a parameter that can be used to determine complexity according to the drawing instruction and drawing data used for training; An adjustment module, used for adjusting the initial training value multiple times to obtain multiple adjusted training values; A fourth determination module, used to determine the drawing instructions and drawing data corresponding to each adjusted training value; a fifth determination module, configured to determine the time required for the GPU for which drawing efficiency needs to be determined to draw based on the drawing instructions and drawing data for training to obtain a training image, and determine the time required for the GPU to draw based on the drawing instructions and drawing data corresponding to each adjusted training value to obtain a corresponding image, so as to obtain a plurality of drawing times; A processing module, configured to perform fitting processing on the initial training value, the plurality of adjusted training values, and the plurality of drawing times, to obtain weight values ​​corresponding to the parameters that can be used to determine the complexity; The construction module is used to construct a model that can be used to determine the complexity according to the parameters that can be used to determine the complexity and their corresponding weight values.

12. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 9.

13. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 by calling the computer program stored in the memory.