Frame rate test method and device in three-dimensional rendering scene, medium and product

By loading compiled files into a 3D rendering scene, intercepting buffer swapping function calls, and using frame rate testing functions for real-time frame counting and timer timing, the applicability and accuracy issues of frame rate testing in domestic operating systems are solved, achieving efficient and stable frame rate testing.

CN121070752APending Publication Date: 2025-12-05CHINA STATE SHIPBUILDING CORP NO 707 RES INST
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511621475.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Existing frame rate testing technologies have low applicability, low accuracy, low automation, and low efficiency in domestic operating system environments, making it difficult to meet the high accuracy and high compatibility requirements of complex 3D scenes.

Method used

By loading the 3D rendering compilation file, intercepting the call request of the swap buffer function, using the frame rate test function to perform real-time frame count and timer periodic timing, and combining the native functions of the graphics rendering interface implementation library, high-precision real-time frame rate testing is achieved.

Benefits of technology

It ensures high-precision real-time acquisition of frame rate data, avoids sampling delay deviations of traditional external tools, guarantees the smoothness and stability of screen display, improves automation level and efficiency, and is suitable for 3D rendering scenarios in domestic operating system environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121070752A_ABST
    Figure CN121070752A_ABST
Patent Text Reader

Abstract

The invention discloses a frame rate testing method and device in a three-dimensional rendering scene, a medium and a product. The method comprises the steps that a three-dimensional rendering compiling file is loaded; in the process of executing the three-dimensional rendering compiling file to carry out real-time rendering of a three-dimensional image, when a calling request for an exchange buffer area function is detected, intercepting the calling request and carrying out triggering calling on a frame rate test function; in response to the calling operation through the frame rate test function, accumulating and updating the locally maintained frame count value, and triggering and calling an exchange buffer function in the function after the updating is completed; periodically timing a preset test duration by adopting a timer in the function through the frame rate test function, and automatically outputting a frame count value every time the test duration is timed; according to the test duration and the frame count value output by the frame rate test function, the three-dimensional rendering frame rate is calculated, the automation level and efficiency of frame rate test are improved, and the method is suitable for the requirements of a three-dimensional rendering scene in a domestic operating system environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of 3D scene rendering technology, and in particular to a frame rate testing method, device, medium and product for 3D rendering scenes. Background Technology

[0002] In today's rapidly evolving technological landscape, 3D technology has been deeply integrated into numerous fields, including film and television production, game development, virtual reality, industrial design, and medical imaging. As the complexity of 3D scene modeling continues to increase, users' demands for 3D system performance are becoming increasingly stringent. Frame rate, as a key indicator of 3D system performance, is increasingly becoming a focus of industry attention due to its accurate testing and monitoring.

[0003] In related technologies, frame rate measurement is mainly achieved in three ways: traditional methods rely on timers to count frames and manual counting to achieve frame rate measurement; modern methods mainly use professional frame rate detection software to achieve automated statistics; and testing methods based on system interface callbacks, which further improve the automation of testing by directly obtaining frame rate-related data.

[0004] However, existing frame rate testing technologies are ill-suited to the high precision and compatibility requirements of current 3D systems. Traditional methods combining manual counting with timers have significant errors and cannot meet the accuracy requirements of complex 3D scenes. While professional frame rate testing software automates frame rate statistics, it suffers from compatibility issues, failing to run stably on domestic operating systems and impacting 3D rendering performance. Testing methods based on system interface callbacks introduce time processing delays in frame rate data acquisition, reducing the efficiency of real-time frame rate monitoring and making it difficult to meet the real-time performance monitoring needs of dynamic 3D scenes. Summary of the Invention

[0005] This invention provides a frame rate testing method, device, medium, and product for 3D rendering scenes, in order to solve the problems of low applicability of frame rate testing methods in domestic operating system environments, as well as low accuracy, low automation level, and low efficiency of frame rate testing.

[0006] According to one aspect of the present invention, a frame rate testing method in a 3D rendering scene is provided, comprising:

[0007] Load the 3D rendering compilation file; the 3D rendering compilation file contains the native buffer swapping function and frame rate test function from the graphics rendering interface implementation library;

[0008] During the real-time rendering of 3D images using the 3D rendering compilation file, whenever a call request to the swap buffer function is detected, the call request is intercepted and the frame rate test function is triggered.

[0009] The frame rate test function is triggered to call the exchange buffer function after the frame count value maintained locally is updated and the updating is completed.

[0010] The frame rate test function is triggered to call the exchange buffer function after the frame count value maintained locally is updated and the updating is completed.

[0011] The frame rate test function is triggered to call the exchange buffer function after the frame count value maintained locally is updated and the updating is completed.

[0012] According to another aspect of the embodiment of the present application, a frame rate test device in a three-dimensional rendering scene is provided, comprising:

[0013] The loading module is configured to load a three-dimensional rendering compilation file, wherein the three-dimensional rendering compilation file contains a native exchange buffer function and a frame rate test function in a graphics rendering interface implementation library.

[0014] The intercepting module is configured to, during the process of executing the three-dimensional rendering compilation file to perform real-time rendering of a three-dimensional image, intercept a call request for the exchange buffer function and trigger a call of the frame rate test function whenever the call request is detected.

[0015] The response calling module is configured to, through the frame rate test function, update a frame count value maintained locally in response to a call operation, and trigger a call of the exchange buffer function in the function after the updating is completed.

[0016] The frame count counting module is configured to, through the frame rate test function, periodically time a preset test duration by using a timer in the function, and autonomously output a frame count value whenever the test duration is timed.

[0017] The frame rate calculating module is configured to calculate a three-dimensional rendering frame rate according to the test duration and the frame count value output by the frame rate test function.

[0018] According to another aspect of the embodiment of the present application, an electronic device is provided, comprising:

[0019] at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the frame rate test method in a three-dimensional rendering scene according to any one of the embodiments of the present application.

[0020] According to another aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer instructions for causing a processor to implement the frame rate test method in a three-dimensional rendering scene according to any of the embodiments of the present application when executed.

[0021] According to another aspect of the embodiments of the present application, a computer program product is also provided, which comprises a computer program for implementing the steps of the method according to any of the embodiments of the present application when executed by a processor.

[0022] The technical solution of the embodiments of the present application loads a three-dimensional rendering compilation file; in the process of executing the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, whenever a call request for an exchange buffer function is detected, the call request is intercepted and a frame rate test function is triggered for call; the frame rate test function responds to the call operation to update a frame count value maintained locally, and after the update is completed, the exchange buffer function is triggered for call within the function; the frame rate test function uses a timer within the function to periodically time a preset test duration, and whenever the test duration is timed, the frame count value is autonomously output; and the three-dimensional rendering frame rate is calculated according to the test duration and the frame count value output by the frame rate test function. Through the frame rate test function, the rendering buffer exchange request at the completion of each frame is immediately intercepted and the frame count is counted, ensuring high-precision real-time collection of frame rate data and avoiding sampling delay deviation of traditional external tools; the frame rate test function calls the native function after counting, without interrupting the rendering process, thereby ensuring the smoothness and stability of the picture display and avoiding stuttering caused by the test operation; the timer within the function periodically times the preset test duration, autonomously completes the frame count output and frame rate calculation, and improves the automation level and efficiency of the frame rate test; the native function interception is implemented based on the graphics rendering interface implementation library, and relies on the cross-platform compatibility, and is suitable for three-dimensional rendering scenes in a domestic operating system environment with high requirements for real-time performance and stability.

[0023] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0025] Figure 1is a flow chart of a frame rate test method in a three-dimensional rendering scene according to an embodiment of the present application;

[0026] Figure 2 is a flow chart of another frame rate test method in a three-dimensional rendering scene according to another embodiment of the present application;

[0027] Figure 3 is a flow chart of yet another frame rate test method in a three-dimensional rendering scene according to yet another embodiment of the present application;

[0028] Figure 4 is a schematic diagram of a frame rate test in a three-dimensional rendering scene according to an embodiment of the present application;

[0029] Figure 5 is a structural schematic diagram of a frame rate test device in a three-dimensional rendering scene according to an embodiment of the present application;

[0030] Figure 6 is a structural schematic diagram of an electronic device implementing a frame rate test method in a three-dimensional rendering scene according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0032] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0033] Embodiment one

[0034] Figure 1A flowchart of a frame rate testing method in a three-dimensional rendering scene is provided for an embodiment of the present application. The embodiment can be applied to testing frame rate in a three-dimensional rendering scene. The method can be executed by a frame rate testing device in a three-dimensional rendering scene. The frame rate testing device can be implemented in the form of hardware and / or software and can be generally configured in an electronic device. As shown in FIG. 8, the method comprises the following steps. Figure 1

[0035] S110, loading a three-dimensional rendering compilation file.

[0036] The three-dimensional rendering compilation file contains a native swap buffer function and a frame rate testing function in a graphics rendering interface implementation library.

[0037] In the embodiment of the present application, the three-dimensional rendering compilation file can be specifically understood as a directly executable file generated by compilation. The three-dimensional rendering compilation file integrates related codes such as a three-dimensional rendering program, frame rate testing logic and a graphics rendering interface, and is a carrier for implementing three-dimensional image rendering and frame rate testing. The graphics rendering interface implementation library can be specifically understood as a library file containing various graphics rendering functions (such as a swap buffer function) and complying with a graphics rendering interface standard (such as an Open Graphics Library (OpenGL)). The graphics rendering interface implementation library is used to convert rendering instructions at the software level into hardware executable operations.

[0038] The native swap buffer function can be specifically understood as a basic function (such as a double-buffer swap function glXSwapBuffers of OpenGL) in the graphics rendering interface implementation library for completing the exchange between front and back buffers to display a new rendering frame. The native swap buffer function is a final link of a three-dimensional rendering process. The frame rate testing function can be specifically understood as a custom function with built-in frame count logic for intercepting the call of the native swap buffer function and counting frame rate to implement frame rate testing.

[0039] Optionally, in the loading of the three-dimensional rendering compilation file, the frame rate testing function and the swap buffer function have the same name, and the execution priority of the frame rate testing function is higher than that of the swap buffer function.

[0040] Specifically, in the loading of the three-dimensional rendering compilation file, the frame rate testing function and the swap buffer function have the same name, such as glXSwapBuffers. The execution priority of the frame rate testing function is higher than that of the swap buffer function. That is, when the program calls a target function, such as glXSwapBuffers, the system preferentially executes the frame rate testing function compared with the native swap buffer function.

[0041] ​In one specific example, a pre-interception function module can be designed, which uses the dynamic linking mechanism of the operating system to pre-set the linking library, adjust the shared library loading order and symbol resolution priority of the three-dimensional rendering program, so that the frame rate test function, such as the custom glXSwapBuffers function, can be executed before the system's original swap buffer function.

[0042] A frame rate test function module can also be designed, which internally defines the same name function of the original swap buffer function (such as glXSwapBuffers), initializes the pointer to the original swap buffer function at the function entry, and implements timer setting and frame number increment logic inside the function. When the current frame rendering and display of the picture is completed, the system will execute the same name function of the frame rate test module first, complete the frame number statistics, and then call the system's original swap buffer function through the pointer to the original swap buffer function, which realizes real-time testing of frame rate, ensures normal operation of the rendering process, and gives developers the ability to flexibly control the interception logic.

[0043] The module can be understood as a set of related codes encapsulated to achieve a specific function. The pre-interception module can be understood as a module that modifies program function call rules, used to adjust the shared library loading order and symbol resolution logic of dynamic linking, and to give high priority to the same name frame rate test function. The dynamic linking mechanism can be understood as a mechanism for dynamically associating functions in shared libraries when the operating system loads the program. By modifying its rules, the priority of function calls can be changed.

[0044] Through the same name and high priority features, the frame rate test logic can be strongly bound to the buffer exchange operation completed with each frame rendering, ensuring that it is intercepted and counted immediately when each frame is completed, avoiding the counting omission or delay caused by the inaccurate capture timing of traditional external tools, and improving the real-time and accuracy of frame rate statistics. The frame rate test function only intervenes in the test operation before the execution of the original function, and then calls the original function to ensure the original process of buffer exchange and picture display without interruption, without changing the function of the original function, avoiding rendering lag or delay, and ensuring the smoothness and stability of three-dimensional rendering. Without modifying the original code of the rendering program, it can adapt to all three-dimensional rendering scenarios that rely on the swap buffer function, improving the universality and scalability of the solution.

[0045] S120, in the process of executing the three-dimensional rendering compilation file for real-time rendering of the three-dimensional image, whenever a call request for the swap buffer function is detected, the call request is intercepted and a trigger call for the frame rate test function is made.

[0046] Specifically, in the process of executing the three-dimensional rendering compilation file for real-time rendering, the program will continuously generate new three-dimensional frame images, and the swap buffer function, such as glXSwapBuffers, will be called for each frame rendering to display the new frame from the background buffer to the screen. The system detects in real time and when a call request for the swap buffer function is detected, the native function is not directly executed, but the request is first intercepted, and the frame rate test function is triggered for execution. The frame rate test function can be bound to the end of each frame rendering, and the frame rate test operation can be completed synchronously without interrupting the native rendering process, ensuring that the frame rate test related operation is triggered once for each frame generated, realizing the real-time linkage of the rendering process and the frame rate statistics.

[0047] S130, through the frame rate test function, the frame number count value maintained locally is updated and added, and after the update is completed, the swap buffer function is triggered and called in the function.

[0048] In the embodiment of the application, the frame number count value maintained locally can be understood as a variable stored in the local memory space of the frame rate test function, which is used to record the number of intercepted frames, and each frame corresponds to an addition, which is independent and does not interfere with other program data.

[0049] Specifically, after the frame rate test function is triggered by intercepting the call of the swap buffer function, the frame number count value maintained locally is updated and added (each call of the frame rate test function corresponds to an addition of 1, representing one frame), to record the number of frames that have been completed rendering; after the counting is updated, the native swap buffer function is called in the function, such as through the pointer in the function to call the native swap buffer function, to perform the buffer exchange operation to display the current frame, which ensures that the frame rate is counted synchronously when each frame is rendered, and the native function is called internally to ensure the integrity of the rendering process, realizing the parallelism of the frame rate test and the three-dimensional rendering without conflict.

[0050] S140, through the frame rate test function, the frame number count value maintained locally is updated and added, and after the update is completed, the swap buffer function is triggered and called in the function.

[0051] Specifically, the frame rate test function is integrated with a timer. Correspondingly, the frame rate test function intercepts the swap buffer call of each frame rendering and accumulates the frame number, while the integrated timer periodically counts the preset test duration (e.g., 1 second). During the three-dimensional rendering process, every time the preset test duration is completed (e.g., 1 second), the frame rate test function automatically outputs the accumulated frame count value (i.e., the total frame number counted in the period) in this period. Then the timer is reset and prepares to start the next round of timing, and the frame count value is also reset to the initial value (e.g., 0) to prepare for the new cycle statistics. Through the periodic work of the timer in the function and the real-time counting logic of each frame, the frame number and time in each statistical period are strictly corresponding, realizing the function of automatically counting and outputting the frame number in a fixed period.

[0052] S150, according to the test duration and the frame count value output by the frame rate test function, calculating the three-dimensional rendering frame rate.

[0053] Specifically, the frame count value (i.e., the number of rendering frames completed in this period) output by the frame rate test function in the test duration is divided by the test duration, and the frame number per unit time is obtained, that is, the three-dimensional rendering frame rate. For example, if the test duration is 1 second and the output frame count value is 60, the frame rate is 60 frames per second, which reflects the real-time smoothness of three-dimensional rendering.

[0054] Optionally, on the basis of each of the above embodiments, the calculation result of the three-dimensional rendering frame rate can be output and displayed in a preset template, for example: "[frame number] frames in [test duration] seconds = [frame rate value] FPS", for example, "300 frames in 5.0 seconds = 59.924 FPS". By explicitly giving the frame number and test duration (in seconds), and then calculating and outputting the corresponding frame rate (unit: frames per second (FPS)), the frame rate calculation result of three-dimensional rendering is intuitively presented.

[0055] The technical scheme of the embodiment of the present application loads a three-dimensional rendering compilation file; in the process of executing the three-dimensional rendering compilation file to perform real-time rendering of a three-dimensional image, whenever a call request for an exchange buffer function is detected, the call request is intercepted and a frame rate test function is triggered for call; the frame rate test function responds to the call operation to accumulate and update a frame count value maintained locally, and after the update is completed, the exchange buffer function is triggered for call within the function; the frame rate test function uses a timer within the function to periodically time a preset test duration, and whenever the test duration is timed, the frame count value is autonomously output; and the three-dimensional rendering frame rate is calculated according to the test duration and the frame count value output by the frame rate test function. Through the frame rate test function, the exchange request of the buffer at the completion of each frame rendering is immediately intercepted and the frame count is counted, ensuring high-precision real-time acquisition of frame rate data and avoiding sampling delay deviation of traditional external tools; the frame rate test function calls the native function after counting, without interrupting the rendering process, thereby ensuring the smoothness and stability of the picture display and avoiding the lag caused by the test operation; the timer within the function periodically times the preset test duration, autonomously completes the frame count output and the frame rate calculation, and improves the automation level and efficiency of the frame rate test; the native function interception is implemented based on the graphics rendering interface implementation library, and relies on the cross-platform compatibility, and is suitable for three-dimensional rendering scenes in a domestic operating system environment with high requirements for real-time performance and stability.

[0056] Embodiment Two

[0057] Figure 2 The flowchart of another frame rate test method in a three-dimensional rendering scene provided for the second embodiment of the present application, and the embodiment is a refinement of the frame rate test method in a three-dimensional rendering scene in the above-mentioned embodiment. As shown in the figure, Figure 2 the method comprises:

[0058] S210, in response to a preloading instruction, obtaining a three-dimensional rendering program and a frame rate test function, and loading a graphics rendering interface implementation library in a compiler.

[0059] In the embodiment of the present application, the preloading instruction can be specifically understood as an instruction for triggering a preparation compilation process, and is used to start the operation of obtaining related programs, functions and loading library files. The three-dimensional rendering program can be specifically understood as a program for realizing three-dimensional scene modeling, calculation and image generation, and is an implementation carrier of the rendering function.

[0060] S220, the three-dimensional rendering program, the frame rate test function and the preset configuration parameter are transmitted into the compiler for joint compilation and linking, and a three-dimensional rendering compilation file precompiled synchronously is generated.

[0061] In the embodiment of the present application, the joint compilation and linking can be understood as follows: the process of integrating a plurality of source code files (such as a three-dimensional rendering program and a frame rate test function) and dependent libraries, and generating a single executable file through a compiler.

[0062] Specifically, in response to the preloading instruction, the system acquires the three-dimensional rendering program and the frame rate test function, and loads a graphics rendering interface implementation library (providing a native swap buffer function) in the compiler. The three-dimensional rendering program, the frame rate test function, and preset configuration parameters, such as a compilation rule (such as setting a processing specification of the compiler for the source code, or presetting a test duration through a macro compilation parameter) and a linking mode (such as setting a logic of the linker for integrating target files and library files, or specifying a library search path to ensure that the linker finds the dependent library), are transmitted into the compiler for joint compilation and linking to generate a three-dimensional rendering compilation file precompiled synchronously. Through synchronous precompilation, the frame rate test function and the three-dimensional rendering program are hard-bound, that is, the rendering function, the test function, and the underlying dependent library are integrated into a single file, so that the frame rate test function becomes a built-in component of the three-dimensional rendering program rather than an independent shared resource, which limits the action range of the interception operation, and only takes effect with the loading of the three-dimensional rendering program, does not interfere with the normal operation of other programs in the system, and ensures the synergy of the rendering and frame rate test functions.

[0063] In a specific example, the pre-interception module, the frame rate test module, and the three-dimensional rendering program are integrated into a single file through synchronous precompilation, so that the interception module cannot be independently run, and the action range of the interception operation is limited, and the interception operation and the corresponding frame rate test function only take effect with the loading of the three-dimensional rendering program.

[0064] Optionally, on the basis of each of the above embodiments, the configuration parameters can include a first configuration parameter for setting the symbol visibility of the frame rate test function to a private state, and a second configuration parameter for specifying a linking path of the swap buffer function.

[0065] In the embodiment of the present application, the symbol visibility can be understood as follows: the range of a compiled function or variable that can be accessed externally, and specifically can include two states of public (externally accessible) and private (only internally accessible), which are controlled by a compiler parameter. The private state can be understood as follows: the function can only be identified and called within the program generated by the current compilation, and cannot be accessed by other programs or modules in the system. The first configuration parameter is a compiler parameter for setting the symbol visibility of the frame rate test function to a private state, which limits the action range of the frame rate test function.

[0066] The linking path of the swap buffer function can be understood as the specific address or search path of the native swap buffer function (such as glXSwapBuffers) in the system shared library, which corresponds to the way the program finds the corresponding implementation code when calling the function. The second configuration parameter can be understood as a linker parameter for specifying the linking path of the swap buffer function, which ensures that the frame rate test function can accurately find and call the native swap buffer function.

[0067] Specifically, the configuration parameters can include: a first configuration parameter for setting the symbol visibility of the frame rate test function to a private state, such as -fvisibility=hidden in GCC (GNU Compiler Collection), which ensures that the function can only be identified and called within the target three-dimensional rendering program and will not be exposed to other programs in the system; and a second configuration parameter for specifying the linking path of the swap buffer function, such as -Wl, --defsym, which explicitly specifies the specific search path of the native swap buffer function in the system shared library, ensuring that the frame rate test function can correctly locate and call the native function to perform buffer swapping after completing the frame count, ensuring the integrity of the three-dimensional rendering process.

[0068] wherein GCC can be understood as a compiler tool chain, -fvisibility is a parameter in the GCC compiler for controlling symbol visibility, hidden means hidden, i.e., only visible in the executable file generated by the current synchronization pre-compile. -Wl is a flag in GCC for forwarding subsequent parameters (–defsym) to the linker, such as --defsym=glXSwapBuffers=original function address, which ensures that the frame rate test function can accurately find and call the native function after completing the count, ensuring that the rendering process is not interrupted.

[0069] By setting the symbol visibility of the frame rate test function to private through the first configuration parameter, the identification information of the function is only visible within the three-dimensional rendering program, avoiding being identified and called by other programs or shared libraries in the system, blocking the possibility of function call conflicts from the compilation stage, strictly defining the scope of the test function, and improving the system security and isolation in a multi-program concurrent scenario; by specifying the linking path of the swap buffer function through the second configuration parameter, the frame rate test function can locate and call the native swap buffer function after completing the count logic, ensuring the stability of three-dimensional rendering; the two types of parameters work together to enable the frame rate test to be integrated into the rendering process to ensure statistical accuracy, while maintaining low invasiveness to the system and target program, improving the reliability and practicality of the scheme.

[0070] S230, loading a three-dimensional rendering compilation file.

[0071] The three-dimensional rendering compilation file contains a native swap buffer function and a frame rate test function in the graphic rendering interface implementation library.

[0072] S240, in the process of executing the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, whenever a call request for the swap buffer function is detected, the call request is intercepted and a trigger call for the frame rate test function is made.

[0073] S250, the frame rate test function responds to the call operation by updating the locally maintained frame count value, and after the update is completed, the swap buffer function is triggered within the function.

[0074] S260, the frame rate test function uses a timer within the function to periodically time a preset test duration, and whenever the test duration is timed, the frame count value is autonomously output.

[0075] S270, according to the test duration and the frame count value output by the frame rate test function, the three-dimensional rendering frame rate is calculated.

[0076] The technical scheme of the embodiment of the application, by responding to the preloading instruction, obtaining a three-dimensional rendering program and a frame rate test function, and loading a graphic rendering interface implementation library in a compiler; the three-dimensional rendering program, the frame rate test function and the preset configuration parameters are transmitted into the compiler for joint compilation and linking to generate a three-dimensional rendering compilation file precompiled synchronously, so that the frame rate test logic is integrated as a built-in component of the target program, avoiding conflicts such as loading delay and interface adaptation of external plug-in tools; the preset configuration parameters limit the scope of the frame rate test function to the target program, preventing it from being exposed as a system global resource, avoiding interference with the calling of other programs to the graphic rendering interface, and improving the security in a multi-program concurrent scenario; the graphic rendering interface implementation library is directly loaded during compilation, so that the generated file is natively bound to the underlying interface, relying on the cross-platform compatibility of the interface to ensure that the frame rate test function can run stably with the target program in different domestic environments. Load the three-dimensional rendering compilation file; in the process of executing the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, whenever a call request for the swap buffer function is detected, the call request is intercepted and a trigger call for the frame rate test function is made; the frame rate test function responds to the call operation by updating the locally maintained frame count value, and after the update is completed, the swap buffer function is triggered within the function; the frame rate test function uses a timer within the function to periodically time a preset test duration, and whenever the test duration is timed, the frame count value is autonomously output; according to the test duration and the frame count value output by the frame rate test function, the three-dimensional rendering frame rate is calculated, improving the automation level and efficiency of frame rate testing.

[0077] Embodiment three

[0078] Figure 3 This is a flowchart of another frame rate testing method in a 3D rendering scene provided in Embodiment 3 of the present invention. This embodiment is a refinement of the above embodiment's "accumulating and updating the locally maintained frame count value in response to the call operation of the frame rate testing function" and the frame rate testing method in a 3D rendering scene. Figure 3 As shown, the method includes:

[0079] S310, Load the 3D rendering compilation file.

[0080] The 3D rendering compilation file includes native buffer swapping functions and frame rate testing functions from the graphics rendering interface implementation library.

[0081] S320. During the real-time rendering of 3D images using the 3D rendering compilation file, whenever a call request to the swap buffer function is detected, the call request is intercepted and the frame rate test function is triggered.

[0082] S330. When the timer is not in the timing state within the frame rate test function, the timer is initialized and started to perform periodic timing. The locally maintained frame count value is then incremented and updated. After the update is completed, the function to call the swap buffer function is triggered within the function.

[0083] In this embodiment of the invention, "the timer inside the function is not in a timing state" can be understood as follows: the timer inside the frame rate test function is not currently started (e.g., when the frame rate test function is called for the first time) or has completed one round of timing and been reset (e.g., after the previous cycle of timing has ended), and is in a non-running state. Initializing the timer can be understood as: setting initial parameters (e.g., preset test duration) for the timer inside the function, so that it has the conditions to start timing.

[0084] Specifically, when the frame rate test function is triggered by intercepting the buffer swap call, it first checks whether the internal timer is in a timing state. If the timer is not in a timing state (e.g., during the first run or after the previous cycle has ended), it initializes the timer (setting parameters such as the test duration) and starts the timer to begin periodic timing. Then, the function increments the locally maintained frame count value (incrementing by 1 each time the frame rate test function is called to record the current frame). After the frame count is updated, the function internally triggers a call to the native buffer swap function to ensure that the current frame is displayed correctly.

[0085] S340: The frame rate test function uses an internal timer to periodically time the preset test duration, and automatically outputs the frame count value whenever the test duration is reached.

[0086] Optionally, on the basis of each of the above embodiments, the preset test duration is periodically timed by a function internal timer through the frame rate test function, which can include:

[0087] The frame rate test function is used to determine whether the timing value of the timer reaches the reference timing value in real time.

[0088] When it is determined that the timing value of the timer reaches the reference timing value through the frame rate test function, the timing count value is accumulated, and when the product of the accumulated timing count value and the reference timing value is less than the test duration, the timer timing state is reset; otherwise, it is determined that the timing reaches the test duration, and the timing count value is reset.

[0089] In the embodiments of the present application, the reference timing value can be understood as the minimum timing unit of the timer, which is used for phased detection to avoid errors caused by direct long-time timing. The timing value can be understood as the current accumulated timing duration of the timer. The timing count value can be understood as a variable that records the number of times the reference timing value is triggered (e.g., the count value is incremented by 1 every time the reference timing value is reached).

[0090] Specifically, the timer does not directly wait for the preset test duration (e.g., 1 second), but determines in real time whether the current accumulated timing value reaches the reference timing value (e.g., 10 milliseconds) to perform phased detection. When the timing value reaches the reference timing value, the timer first accumulates the timing count value, and then calculates the accumulated timing count value x reference timing value (i.e., the total duration currently accumulated), and if the product is less than the preset test duration, it means that the complete cycle has not been reached, at which time the timer timing state is reset (so that the timing value starts to accumulate the next reference timing value from 0) and the cycle continues. Otherwise, it is determined that the timing reaches the test duration, and the timing count value is reset (e.g., zeroed) to prepare for the timing of the next cycle.

[0091] By determining in real time whether the timing value reaches the reference timing value with the reference timing value as the minimum unit, compared with directly setting a timer with the same length as the test duration, the accumulated error of long-time timing can be reduced, the upper limit of the deviation of single small unit timing is only the reference timing value, and the total timing can be closer to the preset test duration through subsequent accumulation correction, providing a reliable time reference for frame rate calculation, improving the timing accuracy, adapting to different length requirements by modifying the test duration, and being compatible with test scenarios with non-integer multiples of the reference value, thereby enhancing the adaptability to various test requirements. The timer is reset to continue the next minimum unit timing when the test duration is not reached, and the timing count value is reset to prepare for the next round of closed-loop mechanism when the test duration is reached, ensuring the continuity of the timing process without interruption, meeting the real-time and continuous test requirements of frame rate in the three-dimensional rendering continuous frame generation scenario, ensuring the stability and continuity of the test process, and improving the accuracy and reliability of the frame rate test.

[0092] Optionally, on the basis of each of the above embodiments, the timer is initialized by a frame rate test function, which can include:

[0093] The timer is enabled to have an interrupt function by the frame rate test function.

[0094] Correspondingly, when the timer value reaches the reference timer value, the frame rate test function accumulates the timer count value, and when the product of the accumulated timer count value and the reference timer value is less than the test duration, the timer counting state is reset; otherwise, it is determined that the timer has counted to the test duration, and the timer count value is reset. Specifically, it can include:

[0095] The interrupt service program is triggered, and by executing the interrupt service program, the accumulated timer count value is accumulated, and when the product of the accumulated timer count value and the reference timer value is less than the test duration, the timer counting state is reset; otherwise, it is determined that the timer has counted to the test duration, and the timer count value is reset.

[0096] In the embodiment of the application, the interrupt function can be understood as a working mode of the timer. When the timer value reaches the reference timer value, an interrupt signal is automatically triggered, the current operation of the main program is paused and the preset interrupt processing logic is executed, and then the main program is returned to avoid the main program being blocked due to waiting for timing. The interrupt service program can be understood as a special program executed in response to the interrupt signal, which is used to process the logic after the timer reaches the reference value (such as accumulating the timer count value and judging whether the test duration is reached).

[0097] Specifically, the initialization of the timer by the frame rate test function includes enabling the interrupt function of the timer, that is, after the clock source and reference timer value and other parameters of the timer are configured, the interrupt is enabled: when the timer value reaches the reference timer value, an interrupt signal is automatically triggered, without the need for the main program (three-dimensional rendering program) to actively wait or query, ensuring that the main program can continue to execute the rendering logic and is not blocked by the timing operation.

[0098] When the timer value reaches the reference timer value, the interrupt signal is triggered, the system pauses the current main program, and executes the interrupt service program: accumulates the timer count value, and when the product of the accumulated timer count value and the reference timer value is less than the test duration, the timer counting state is reset; otherwise, it is determined that the timer has counted to the test duration, and the timer count value is reset.

[0099] The interrupt function is enabled when the timer is initialized by the frame rate test function, so that the interrupt signal is triggered actively when the timer reaches the reference timing value, thereby avoiding that the main program is blocked due to waiting for timing, reducing the interference of the timing operation on the rendering main process, and improving the running efficiency and fluency of the three-dimensional rendering program; when the timing value reaches the reference timing value, the interrupt service program is triggered to execute the accumulated timing count value and judge whether the test duration is reached, thereby reducing the timing deviation, avoiding the cross interference between the rendering logic and the timing logic, and ensuring the stability of the timing and the accumulated timing duration calculation; the logic based on the interrupt service program can be realized by modifying the software code, without relying on hardware adjustment, and can quickly adapt to the needs of different test periods or reference units, has stronger flexibility and scalability, and can adapt to the frame rate test in various three-dimensional rendering scenes. Through the synergistic effect of improving the rendering efficiency, ensuring the timing accuracy and enhancing the adaptability, high-precision and high-flexibility real-time frame rate statistics without affecting the rendering fluency are realized, and reliable support is provided for three-dimensional rendering performance evaluation.

[0100] S350, resetting the locally maintained frame count value by the frame rate test function.

[0101] Specifically, after the timer in the function automatically outputs the accumulated frame count value in the preset test duration, the frame rate test function resets the locally maintained frame count value to the initial state (such as zero), so as to prepare for the frame count statistics in the next timing period.

[0102] S360, calculating the three-dimensional rendering frame rate according to the test duration and the frame count value output by the frame rate test function.

[0103] Figure 4 is a schematic diagram of a frame rate test in a three-dimensional rendering scene to which the embodiment of the application is applicable, as shown in Figure 4 After the user initiates a preloading instruction, the dynamic link module performs a preloading operation, registers a frame rate test function to the frame rate test module, and loads a graphic rendering interface (such as OpenGL) implementation library; after starting the three-dimensional rendering program, the swap buffer function (such as glXSwapBuffers) called in the rendering process is intercepted by the frame rate test module, and the frame rate test function is called instead, the frame rate test module records the current frame number (1 is added each time the frame rate test function is called), and then the original swap buffer function is called; the graphic rendering interface implementation library completes the bottom layer rendering processing based on the original function, and after the three-dimensional rendering program submits a frame, the rendering result is finally displayed on the screen, forming a closed loop process of interception, counting, rendering and display.

[0104] The real end point of a frame processing period is captured through a buffer exchange link, errors such as a display vertical synchronization and a display card instruction buffer are avoided, and the actual frame rate can be accurately reflected; the timer module based on an interrupt mechanism supports software logic adjustment of timing test duration (such as 1 second period), high-precision timing is ensured, the main program is avoided from being blocked, and multiple scenes such as a movie game, a virtual reality and an industrial design are adapted; relying on an extension implementation of an OpenGL graphics library, domestic system architectures such as X86 (32-bit architecture), X64 (64-bit extended x86 architecture) and arm (Advanced RISC Machines, Advanced RISC Machines) architecture are compatible, the demand for self-controllability is met, and reliable data support is provided for device hardware upgrade and software optimization.

[0105] The technical scheme of the embodiment of the application loads a three-dimensional rendering compilation file; in the process of executing the three-dimensional rendering compilation file to perform real-time rendering of a three-dimensional image, whenever a call request for an exchange buffer function is detected, the call request is intercepted and a frame rate test function is triggered and called; the frame rate test function initializes a timer in the function when it is determined that the timer is not in a timing state, starts the timer to periodically time, and after the update is completed, the exchange buffer function is triggered and called in the function; the frame rate test function periodically times a preset test duration using the timer in the function, and autonomously outputs a frame count value whenever the test duration is timed, and the frame count value maintained locally is reset by the frame rate test function, which ensures that the frame count per unit time always corresponds to the latest rendering state, improves the timeliness and accuracy of frame rate calculation, and enables multiple rounds of continuous testing without external intervention, ensures that each round of data is independent and interference-free, is especially suitable for long-time three-dimensional rendering scenes, and enhances the practicality and stability of the scheme. The three-dimensional rendering frame rate is calculated according to the test duration and the frame count value output by the frame rate test function. The automation level and efficiency of frame rate testing are improved; the native function interception of the library based on the graphics rendering interface is realized, and relying on the cross-platform compatibility, the three-dimensional rendering scene in the domestic operating system environment with high requirements for real-time performance and stability is applicable.

[0106] Embodiment four

[0107] Figure 5 A structural schematic diagram of a frame rate test device in a three-dimensional rendering scene provided by the fourth embodiment of the application is shown in FIG. 5. Figure 5 As shown in the figure, the device comprises a loading module 510, an interception module 520, a response call module 530, a frame count module 540 and a frame rate calculation module 550, wherein:

[0108] The loading module 510 is configured to load a three-dimensional rendering compilation file; and the three-dimensional rendering compilation file contains a native swap buffer function and a frame rate test function in a graphics rendering interface implementation library.

[0109] The intercepting module 520 is configured to, during execution of the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, intercept a call request for the swap buffer function and trigger a call of the frame rate test function each time the call request is detected.

[0110] The response module 530 is configured to, in response to the call operation through the frame rate test function, update a frame count value maintained locally in an accumulated manner, and trigger a call of the swap buffer function in the function after the update is completed.

[0111] The frame count module 540 is configured to, through the frame rate test function, periodically time a preset test duration by using a timer in the function, and autonomously output the frame count value each time the test duration is timed.

[0112] The frame rate calculation module 550 is configured to calculate a three-dimensional rendering frame rate according to the test duration and the frame count value output by the frame rate test function.

[0113] The technical scheme of the embodiment of the application comprises the following steps: loading a three-dimensional rendering compilation file; during execution of the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, intercepting a call request for a swap buffer function and triggering a call of a frame rate test function each time the call request is detected; in response to the call operation through the frame rate test function, updating a frame count value maintained locally in an accumulated manner, and triggering a call of the swap buffer function in the function after the update is completed; through the frame rate test function, periodically timing a preset test duration by using a timer in the function, and autonomously outputting the frame count value each time the test duration is timed; and calculating a three-dimensional rendering frame rate according to the test duration and the frame count value output by the frame rate test function. Through the frame rate test function, the instant interception of a buffer swap request when each frame is rendered and the frame count are realized, the high-precision real-time acquisition of frame rate data is ensured, and the sampling delay deviation of a traditional external tool is avoided. The native function is called after the counting by the frame rate test function, the rendering process is not interrupted, the smoothness and stability of picture display are ensured, and the lag caused by the test operation is avoided. The preset test duration is periodically timed by the timer in the function, the frame count output and the frame rate calculation are autonomously completed, and the automation level and efficiency of frame rate test are improved. The native function is intercepted based on the graphics rendering interface implementation library, and the cross-platform compatibility is relied on, so the three-dimensional rendering scene in a domestic operating system environment with high requirements for real-time performance and stability is applicable.

[0114] On the basis of the above embodiments, in the loading of the three-dimensional rendering compilation file, the frame rate test function and the exchange buffer function have the same name, and the execution priority of the frame rate test function is higher than that of the exchange buffer function.

[0115] Further, on the basis of the above embodiments, the frame rate test device in the three-dimensional rendering scene can further include a preloading module and a synchronous pre-compilation module, wherein:

[0116] The preloading module is configured to, before loading the three-dimensional rendering compilation file, acquire the three-dimensional rendering program and the frame rate test function in response to a preloading instruction, and load a graphic rendering interface implementation library in a compiler.

[0117] The synchronous pre-compilation module is configured to input the three-dimensional rendering program, the frame rate test function, and preset configuration parameters into the compiler for joint compilation and linking to generate a synchronous pre-compiled three-dimensional rendering compilation file.

[0118] On the basis of the above embodiments, the configuration parameters include a first configuration parameter for setting the symbol visibility of the frame rate test function to a private state, and a second configuration parameter for specifying the linking path of the exchange buffer function.

[0119] On the basis of the above embodiments, the calling module 530 is specifically configured to:

[0120] The frame rate test function is configured to initialize the timer when it is determined that the timer is not in a timing state, and to accumulate and update the frame count value maintained locally after starting the timer to perform periodic timing.

[0121] Correspondingly, on the basis of the above embodiments, the frame rate test device in the three-dimensional rendering scene can further include a resetting module, wherein:

[0122] The resetting module is configured to reset the frame count value maintained locally by the frame rate test function after the frame rate test function autonomously outputs the frame count value when timing to the test duration.

[0123] On the basis of the above embodiments, the frame count module 540 is specifically configured to:

[0124] The frame rate test function is configured to determine whether the timing value of the timer reaches the reference timing value in real time.

[0125] The frame rate test function is configured to, when it is determined that the timing value of the timer reaches the reference timing value, accumulate the timing count value, and reset the timer timing state when the product of the accumulated timing count value and the reference timing value is less than the test duration; otherwise, it is determined that the timer is timed to the test duration, and the timing count value is reset.

[0126] On the basis of each of the above embodiments, the response calling module 530 is further used for:

[0127] The interrupt function of the timer is started through the frame rate test function;

[0128] Correspondingly, on the basis of each of the above embodiments, the frame number counting module 540 is further used for:

[0129] Triggering the interrupt service program, and through executing the interrupt service program, executing the operation of accumulating the timing count value, and when the product result of the accumulated timing count value and the reference timing value is less than the test duration, resetting the timer timing state;Otherwise, determining that the timing reaches the test duration, and resetting the timing count value.

[0130] The frame rate test device in the three-dimensional rendering scene provided by the embodiment of the application can execute the frame rate test method in the three-dimensional rendering scene provided by any embodiment of the application, and has the corresponding function modules and beneficial effects of the execution method.

[0131] In the technical solution of the disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations, and do not violate public order and good customs.

[0132] Embodiment five

[0133] Figure 6 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the applications described and / or claimed in this document.

[0134] As Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0135] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0136] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the frame rate test method in a three-dimensional rendering scene, that is:

[0137] loading a three-dimensional rendering compilation file; wherein the three-dimensional rendering compilation file contains a native swap buffer function and a frame rate test function in a graphics rendering interface implementation library;

[0138] In the process of executing the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, whenever a call request for the swap buffer function is detected, the call request is intercepted and the frame rate test function is triggered for call;

[0139] The frame rate test function responds to the call operation by updating a frame count value maintained locally, and after the update is completed, the swap buffer function is triggered for call within the function;

[0140] The frame rate test function uses a timer within the function to periodically time a preset test duration, and whenever the test duration is timed, the frame count value is autonomously output.

[0141] The three-dimensional rendering frame rate is calculated according to the frame count value output by the test duration and frame rate test function.

[0142] In some embodiments, the frame rate test method in a three-dimensional rendering scene can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the frame rate test method in a three-dimensional rendering scene as described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the frame rate test method in a three-dimensional rendering scene by way of other any suitable means, such as by way of firmware.

[0143] The various implementations of the system and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0144] Computer programs used to implement the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, and partially on a machine or entirely on a remote machine or server.

[0145] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0146] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0147] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), blockchain network, and the Internet.

[0148] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0149] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, each step described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which is not limited herein.

[0150] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method of frame rate testing in a three-dimensional rendered scene, characterized by, The method comprises the following steps: loading a three-dimensional rendering compilation file; wherein the three-dimensional rendering compilation file contains a native swap buffer function and a frame rate test function in a graphics rendering interface implementation library; during the execution of the three-dimensional rendering compilation file for real-time rendering of a three-dimensional image, whenever a call request for the swap buffer function is detected, the call request is intercepted and a trigger call for the frame rate test function is made; in response to the call operation, the frame rate test function updates a locally maintained frame count value by accumulation, and after the update is completed, the frame rate test function triggers a call for the swap buffer function within the function; the frame rate test function uses a timer within the function to periodically count a preset test duration, and whenever the test duration is counted, the frame rate test function autonomously outputs the frame count value; based on the test duration and the frame count value output by the frame rate test function, the three-dimensional rendering frame rate is calculated.

2. The method of claim 1, wherein, In the loading of the three-dimensional rendering compilation file, the frame rate test function and the swap buffer function have the same name, and the execution priority of the frame rate test function is higher than that of the swap buffer function.

3. The method of claim 1 or 2, wherein, Before loading the three-dimensional rendering compilation file, the method further comprises the following steps: in response to a preloading instruction, obtaining a three-dimensional rendering program and a frame rate test function, and loading a graphics rendering interface implementation library in a compiler; transmitting the three-dimensional rendering program, the frame rate test function and preset configuration parameters into the compiler for joint compilation and linking to generate a three-dimensional rendering compilation file after synchronization pre-compilation.

4. The method of claim 3, wherein, The configuration parameters include a first configuration parameter for setting the symbol visibility of the frame rate test function to a private state, and a second configuration parameter for specifying the link path of the swap buffer function.

5. The method of claim 1, wherein, In response to the call operation, the frame rate test function updates a locally maintained frame count value by accumulation, specifically including: When it is determined that the timer within the function is not in a counting state, the frame rate test function initializes the timer and starts the timer for periodic counting, and then updates the locally maintained frame count value by accumulation; Correspondingly, after the frame rate test function autonomously outputs the frame count value whenever the test duration is counted, the method further comprises the following steps: the frame rate test function resets the locally maintained frame count value.

6. The method of claim 5, wherein, The frame rate test function uses a timer within the function to periodically count a preset test duration, including: the frame rate test function determines whether the timer value reaches a benchmark timer value in real time; when it is determined that the timer value reaches the benchmark timer value, the frame rate test function accumulates a timer count value, and when the product of the accumulated timer count value and the benchmark timer value is less than the test duration, the timer counting state is reset; otherwise, it is determined that the test duration is counted, and the timer count value is reset.

7. The method of claim 6, wherein, The frame rate test function initializes the timer, including: the frame rate test function enables the interrupt function of the timer; Correspondingly, when it is determined that the timer value reaches the benchmark timer value, the frame rate test function accumulates a timer count value, and when the product of the accumulated timer count value and the benchmark timer value is less than the test duration, the timer counting state is reset; otherwise, it is determined that the test duration is counted, and the timer count value is reset, specifically including: The interrupt service program is triggered, and by executing the interrupt service program, the accumulated timing count value is executed, and the product result of the accumulated timing count value and the reference timing value is less than the test duration, the timer timing state is reset; otherwise, it is determined that the timing is to the test duration, and the operation of resetting the timing count value.

8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the frame rate test method in the three-dimensional rendering scene according to any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to execute when the three-dimensional rendering scene frame rate test method according to any one of claims 1-7 is implemented.

10. A computer program product, characterised in that, The computer program product comprises a computer program, which, when executed by the processor, implements the frame rate test method in the three-dimensional rendering scene according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and system for acquiring FPS (Frames Per Second) value based on Android Device

    CN104572086A

  • Method and device for determining screen refreshing rate

    CN106294098A

  • Dynamic frame rate acquisition method and system

    CN106371786A

  • Function data processing method and device, computer equipment and storage medium

    CN110362356A

  • ECU test method and device, first frame message test system and storage medium

    CN119536208A