Graph rendering resource management method and device, related equipment and rendering method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies involve complex management of GPU hardware resources in multi-rendering scenarios, resulting in high development resource and conversion overhead, impacting CPU performance and increasing maintenance difficulty.
By unifying the pre-defined hardware resource interface functions, the calling interface functions of different rendering programs are converted into unified interface functions, reducing the design of conversion logic at the API level. Hardware resources are managed using rendering resource objects, including interface function conversion relationships and driver conversion relationships.
It reduces the complexity and difficulty of rendering resource management, reduces CPU load, improves performance, and enhances the accuracy and versatility of hardware resource management.
Smart Images

Figure CN121646786A_ABST
Abstract
Description
Management method, device and related equipment of graphic rendering resources, and rendering method TECHNICAL FIELD
[0001] The present application relates to the field of chip design, in particular to a management method, device and related equipment of graphic rendering resources, and a rendering method. BACKGROUND
[0002] Currently, some electronic devices need to support different rendering programs, for example, a device loaded with a Windows (a kind of computer operating system) system needs to support D3D (Direct 3D, three-dimensional drawing programming interface), Vulkan (a kind of drawing application programming interface) and OpenGL (Open Graphics Library, open graphics library) and other rendering programs.
[0003] For different rendering programs, each rendering program converts its own calling function into its own API (Application Programming Interface, application programming interface), and then calls the GPU (Graphics Processing Unit, graphics processing unit) through the API to perform rendering. Currently, each rendering program has a set of API interface code designed for the management of GPU hardware resources, and the GPU required by different rendering programs is the same, the only difference is the API naming and definition, therefore, for different rendering programs, API interface conversion is needed to enable each rendering program to call and manage the same GPU, for example, the API of D3D and other rendering programs is currently converted into the API of Vulkan.
[0004] The above-mentioned method is relatively complex when maintaining, testing, repairing and other management of GPU hardware resources, for example, when the interface of the GPU needs to be modified, the API code of Vulkan and D3D needs to be modified, and the conversion relationship between the Vulkan API and the D3D API also needs to be modified. In particular, the process of calling and converting the API interface is complex, for example, each D3D driver API interface needs to be implemented using one or several Vulkan driver APIs, and the input parameters of the D3D API need to be converted into the input parameters of the Vulkan, and the output results of the Vulkan API need to be converted into the output results required by D3D. In some extreme cases, some D3D API interface functions cannot be directly called by Vulkan, and some delay call processing needs to be done.
[0005] [Corrected according to Rule 91 on 07.01.2025] The above manner makes the management of GPU hardware resources more complex, which requires more development resources and conversion overhead, and has high maintenance and testing difficulty. In addition, since the above conversion process is performed by the CPU (Central Processing Unit, or Central Processing Unit), the complex conversion work may affect the CPU overhead and the overall performance of the device.
[0006] SUMMARY
[0007] Therefore, the present application aims to provide a graphics rendering resource management method, device and related equipment, and a rendering method to reduce the difficulty and cost of hardware resource management in a multi-rendering program scenario.
[0008] In a first aspect, an embodiment of the present application provides a graphics rendering resource management method applied to a central processing unit, wherein the central processing unit is connected with a graphics processing unit, the central processing unit is configured with at least two different rendering programs, and the graphics processing unit is used to provide hardware resources for graphics rendering for the rendering programs; the graphics rendering resource management method comprises: in response to a management instruction generated in the running process of at least one rendering program, determining a hardware resource object for calling graphics rendering based on the management instruction and an interface function conversion relationship and a driver conversion relationship in a rendering resource object of the corresponding rendering program of the management instruction; and managing the hardware resources required for graphics rendering according to the determined hardware resource object and the management instruction; wherein each rendering program is separately configured with a corresponding rendering resource object, each rendering resource object comprises the interface function conversion relationship and the driver conversion relationship; the interface function conversion relationship comprises a conversion relationship between a preset hardware resource interface function and a target interface function required for calling graphics rendering; the preset hardware resource interface function in the rendering resource objects corresponding to different rendering programs is the same; the target interface function in the rendering resource objects corresponding to different rendering programs is different, and the target interface function in each rendering resource object is a calling interface function of the graphics rendering resource for the rendering program corresponding to the rendering resource object; the driver conversion relationship comprises a conversion relationship between the preset hardware resource interface function and the hardware resource object, and the hardware resource object is used to call the hardware resources for graphics rendering.
[0009] In the embodiments of the present application, for different rendering programs, the respective calling interface functions are all converted into a unified preset hardware resource interface function. In this way, the rendering programs do not need to convert the calling interface functions to the respective corresponding APIs, and thus do not need to perform mutual conversion at the API level, so that there is no need to design code conversion logic between the respective calling interface functions and the APIs of the rendering programs, and there is no need to design mutual conversion logic between the APIs of different rendering programs. Compared with the conversion between the APIs of different rendering programs, the conversion of the calling interface functions has lower complexity, which can effectively reduce the complexity and difficulty in design. In addition, when the code needs to be maintained and tested, there is no need to maintain and test the conversion at the API level, which reduces the management difficulty. Since the conversion of the calling interface functions is simpler, the load of the central processing unit can also be reduced, and the performance of the central processing unit during work can be improved.
[0010] [According to Rule 91 correction 07.01.2025] In an embodiment, the preset hardware resource interface function is different from the target interface function of all the rendering programs configured in the central processing unit.
[0011] [According to Rule 91 correction 07.01.2025] In the embodiments of the present application, the preset hardware resource interface function is different from the target interface function of all the rendering programs in the central processing unit, that is, the preset hardware resource interface function can be a set of interface functions written separately or a target interface function of a rendering program not configured in the central processing unit. In this way, the target interface functions of all the rendering programs in the central processing unit are converted into the preset interface function to perform management of the graphic rendering resources, and there is no need to perform conversion between the calling interfaces of the configured rendering programs, which can make the graphic rendering resource management method applicable to more scenarios and improve the universality.
[0012] [Rule 91 correction 07.01.2025] In an embodiment, the central processing unit further comprises a driver layer and a driver unit corresponding to each of the rendering programs; the preset hardware resource interface function is the same as the target interface function of the preset rendering program; the preset rendering program is any one of the rendering programs in the central processing unit; the preset rendering program corresponds to a preset driver unit; before the hardware resource object for calling the graphic rendering is determined based on the management instruction and the interface function conversion relationship and the driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instruction, the method further comprises: in response to the running of a rendering program other than the preset rendering program, calling the preset driver unit to create an initial rendering resource object of the rendering program based on the driver unit of the rendering program, the initial rendering resource object comprising the preset hardware resource interface function; controlling the preset driver unit to create the interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program in the initial rendering resource object based on the driver unit of the rendering program, to obtain the rendering resource object corresponding to the rendering program.
[0013] [Rule 91 correction 07.01.2025] In the embodiments of the present application, the preset hardware resource interface function is the calling interface function of any one of the rendering programs (i.e. the preset rendering program) in the central processing unit to the graphic processing unit, i.e. the calling interface function of other rendering programs to the graphic processing unit is converted to the calling interface function of the preset rendering program to the graphic processing unit, and the two share a set of rendering resource management code, without the need to additionally set a third set of code of the preset hardware resource interface function, which can further reduce complexity, and when the management instruction of the preset rendering program is received, there is no need to convert the API of the preset rendering program, reducing the workload of the central processing unit. At the same time, compared to the conversion of the API, the functions of different rendering programs are similar, and their rendering resource management codes are usually similar, and the conversion between them is easier to implement, effectively reducing the complexity of the conversion, thereby reducing the difficulty and cost of rendering resource management, and reducing the cost and difficulty of development, testing, maintenance, etc. Under this condition, when creating the rendering resource object corresponding to other rendering programs, the preset driver unit of the preset rendering program can be reused to create the initial rendering resource object corresponding to other rendering programs, thereby simplifying the design complexity, reducing the code overhead, and reducing the management difficulty.
[0014] In an embodiment, the rendering resource object further comprises calling information of the hardware resource for the graphic rendering of the rendering program corresponding to the rendering resource object; the calling information comprises at least one of the identification information of the hardware resource object and the access address of the hardware resource corresponding to the hardware resource object in the graphic processing unit.
[0015] The identification information or the access information is used to determine the required hardware resource in the graphics processing unit, and has high accuracy. In the embodiment of the present application, the identification information or the access address of the hardware resource in the graphics processing unit is configured in the calling information, so that the accuracy of the management device for managing the hardware resource of the graphics processing unit is effectively improved.
[0016] In an embodiment, the hardware resource object for calling the graphics rendering is determined based on the management instruction and the interface function conversion relationship and the driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instruction, and the method comprises the following steps: in response to the received management instruction, at least one of the access address and the identification information of the hardware resource required by the rendering program is obtained from the rendering resource object corresponding to the rendering program; and the hardware resource object is determined based on at least one of the access address and the identification information of the hardware resource.
[0017] In the embodiment of the present application, when rendering, the access address or the identification information of the hardware resource of the graphics processing unit can be quickly obtained through the rendering resource object, and the access address or the identification information does not need to be obtained after the hardware resource object is determined, so that the efficiency of the rendering can be effectively improved.
[0018] In an embodiment, the hardware resource required by each rendering program for graphics rendering is of multiple types; the preset hardware resource interface function comprises preset hardware resource interface sub-functions respectively corresponding to the hardware resources of the multiple types; the initial rendering resource object of the rendering program is created by the preset driver unit based on the driver unit of the rendering program, which comprises the following steps: in response to the running of other rendering programs except the preset rendering program, the hardware resources of the multiple types required by the rendering program are obtained; the preset driver unit is called based on the driver unit of the rendering program, so that the preset driver unit creates the initial rendering resource objects respectively corresponding to the hardware resources of the multiple types required by the rendering program; the initial rendering resource objects respectively corresponding to the hardware resources of the multiple types comprise the preset hardware resource interface sub-functions respectively corresponding to the hardware resources of the multiple types; the interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program is created in the initial rendering resource object by the preset driver unit based on the driver unit of the rendering program, so as to obtain the rendering resource object corresponding to the rendering program, which comprises the following steps: for each initial rendering resource object, the interface function conversion relationship between the preset hardware resource interface sub-function and the target interface function of the rendering program is created in the initial rendering resource object by the preset driver unit based on the driver unit of the rendering program, so as to obtain the rendering resource object corresponding to the rendering program.
[0019] In the embodiments of the present application, different rendering resource objects corresponding to different types of graphic processing unit hardware resources required by the rendering program are configured respectively, so that different rendering resource objects can be used to manage different hardware resources, and in subsequent testing and maintenance, different hardware resources can be managed by using different rendering resource objects, thereby improving the effectiveness and accuracy of management of hardware resources required for image rendering.
[0020] In an embodiment, after obtaining the rendering resource object corresponding to the rendering program, the method further includes: in response to the stop of running of any other rendering program except the preset rendering program, destroying the rendering resource object corresponding to the rendering program.
[0021] In an embodiment, after determining the hardware resource object for calling the graphic rendering based on the management instruction and the interface function conversion relationship and the driver conversion relationship in the rendering resource object of the management instruction corresponding rendering program, the method further includes: in response to the calling of the hardware resource of the graphic rendering by any rendering program, synchronizing the data read and write in the central processing unit and the graphic processing unit based on the resource synchronization unit of the preset rendering program.
[0022] In the embodiments of the present application, the resource synchronization unit can be called by different rendering programs to synchronize the data read and write between the central processing unit and the graphic processing unit, thereby improving the accuracy of hardware resource management in the multi-rendering program scenario. At the same time, the resource synchronization unit of the preset rendering program can be called by any rendering program, so that the resource synchronization unit does not need to be separately set in other rendering programs, thereby reducing the code overhead and design difficulty, and reducing the difficulty and cost of testing, maintenance and other management work.
[0023] In a second aspect, the embodiments of the present application provide a graphics rendering resource management apparatus, applied to a central processing unit, connected with a graphics processing unit, the central processing unit being configured with at least two different rendering programs, and the graphics processing unit being configured to provide hardware resources for graphics rendering for the rendering programs; the graphics rendering resource management apparatus comprises: at least two rendering program modules, different rendering program modules running different rendering programs respectively; a driver layer, configured to determine a hardware resource object for calling graphics rendering based on a management instruction generated in the running process of at least one rendering program, an interface function conversion relationship and a driver conversion relationship in a rendering resource object of the corresponding rendering program of the management instruction; the driver layer is further configured to manage hardware resources for graphics rendering required by the management instruction according to the determined hardware resource object and the management instruction; wherein the driver layer is separately configured with a corresponding rendering resource object for each rendering program, each rendering resource object comprising the interface function conversion relationship and the driver conversion relationship; the interface function conversion relationship comprises a conversion relationship between a preset hardware resource interface function and a target interface function of hardware resources required for calling graphics rendering; the preset hardware resource interface function in the rendering resource object corresponding to different rendering programs is the same; the target interface function in the rendering resource object corresponding to different rendering programs is different, and the target interface function in each rendering resource object is a calling interface function of the graphics rendering resource for the rendering program corresponding to the rendering resource object; the driver conversion relationship comprises a conversion relationship between the preset hardware resource interface function and the hardware resource object, and the hardware resource object is used for calling hardware resources for graphics rendering.
[0024] In an embodiment, the preset hardware resource interface function in each rendering resource object is different from a calling interface function used by the rendering program corresponding to each rendering program module.
[0025] In an embodiment, each of the rendering program modules comprises a driver unit corresponding to a respective rendering program; the preset hardware resource interface function in each of the rendering resource objects is identical to a target interface function of a preset rendering program; the preset rendering program is any one of the rendering programs corresponding to the rendering program modules; a preset rendering program module of the preset rendering program comprises a preset driver unit; and each of the rendering program modules other than the preset rendering program module is configured to, in response to running of the rendering program, call the preset driver unit to create an initial rendering resource object of the rendering program based on a driver unit of the rendering program, the initial rendering resource object comprising the preset hardware resource interface function; and the driver unit corresponding to the rendering program is further configured to control the preset driver unit to create an interface function conversion relationship between the preset hardware resource interface function and a target interface function of the rendering program in the initial rendering resource object, to obtain a rendering resource object corresponding to the rendering program.
[0026] In an embodiment, the rendering resource object further comprises calling information of a hardware resource required by a rendering program corresponding to the rendering resource object for performing graphic rendering; and the calling information comprises at least one of identification information of the hardware resource and an access address of the hardware resource in the graphic processing unit.
[0027] In an embodiment, each of the rendering program modules is configured to, in response to a management instruction of a rendering program running in the rendering program module, acquire at least one of an access address and identification information of a hardware resource required by the rendering program from a rendering resource object corresponding to the rendering program running in the rendering program module, and determine the hardware resource object based on at least one of the access address and the identification information of the hardware resource.
[0028] In an embodiment, the hardware resources of a graphics processing unit (GPU) required by each rendering program are of multiple types; the preset hardware resource interface functions include preset hardware resource interface sub-functions corresponding to each type of hardware resource; the driver layer is further configured to: in response to running of a rendering program in any of the rendering program modules, acquire each type of hardware resource required by the rendering program of the rendering program module; based on the corresponding driver unit of the rendering program module, call the preset driver unit to enable the preset rendering program to drive the preset driver layer to create initial rendering resource objects corresponding to each type of hardware resource required by the rendering program, and each type of hardware resource includes a preset hardware resource interface sub-function corresponding to each type of hardware resource in the initial rendering resource object; the driver layer is further configured to: for each initial rendering resource object corresponding to a rendering program, based on the corresponding driver unit of the rendering program, control the preset driver unit to create an interface function conversion relationship between the preset hardware resource interface sub-function and a target interface function of the rendering program of the rendering program module in the initial rendering resource object, to obtain a rendering resource object corresponding to the rendering program.
[0029] In an embodiment, in addition to the preset rendering program module, other rendering program modules further include a destruction unit; the other rendering program modules are further configured to, in response to stopping of running of a rendering program of the rendering program module, drive the destruction unit to destroy a rendering resource object corresponding to the rendering program in the driver layer.
[0030] In an embodiment, the preset rendering program module further includes a resource synchronization unit, and the resource synchronization unit is configured to, in a case where a rendering program in any of the rendering program modules calls a hardware resource of the graphics processing unit, synchronize data reading and writing in the central processing unit and the graphics processing unit.
[0031] [According to Rule 91 Correction 07.01.2025] In a third aspect, the application provides an electronic device, including: a central processing unit, a memory; the memory stores a program; the central processing unit is configured to run the program to implement the management method of the graphic rendering resource according to any one of the first aspect; a graphics processing unit connected with the central processing unit, configured to provide a graphics rendering hardware resource for execution of a rendering program in the central processing unit.
[0032] In a fourth aspect, the embodiments of the application provide a computer readable storage medium, and the readable storage medium stores a computer program, and when the computer program runs on a computer, the computer program enables the computer to implement the management method of the graphic rendering resource according to any one of the first aspect.
[0033] In a fifth aspect, the embodiments of the present application provide a rendering method, comprising: in a case where a rendering instruction of an arbitrary rendering program is received, determining, according to an interface function conversion relationship in a rendering resource object corresponding to the rendering program, a target interface function in the rendering instruction corresponding to an intermediate interface function under a preset hardware resource interface function type; the rendering resource object comprises the interface function conversion relationship and a driver conversion relationship; the interface function conversion relationship comprises a conversion relationship between a preset hardware resource interface function and a target interface function of a hardware resource for calling a graphic rendering; the preset hardware resource interface functions in the rendering resource objects corresponding to different rendering programs are the same; the target interface functions in the rendering resource objects corresponding to different rendering programs are different, and the target interface functions in each of the rendering resource objects are calling interface functions of the graphic rendering resource for a rendering program corresponding to the rendering resource object; converting the intermediate interface function into a hardware resource object corresponding to the rendering instruction by using the driver conversion relationship; the driver conversion relationship comprises a conversion relationship between the preset hardware resource interface function and the hardware resource object, and the hardware resource object is used for calling a hardware resource for graphic rendering; sending the rendering instruction to the graphic processing unit, and using the hardware resource object to call a hardware resource of the graphic processing unit to execute the rendering instruction. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0035] FIG. 1 is a schematic diagram of a graphic rendering resource management device provided by an embodiment of the present application;
[0036] FIG. 2 is an expanded schematic diagram of a graphic rendering resource management device provided by an embodiment of the present application;
[0037] FIG. 3 is a flow chart of a graphic rendering resource management method provided by an embodiment of the present application;
[0038] FIG. 4 is a schematic diagram of a rendering program calling a GPU in the prior art;
[0039] FIG. 5 is a schematic diagram of a rendering program calling a GPU according to an embodiment of the present application;
[0040] FIG. 6 is a structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0041] FIG. 7 is a flow chart of a rendering method provided by an embodiment of the present application.
[0042] Icon: graphic rendering resource management device 100; first rendering program module 110; second rendering program module 120; driver layer 130; electronic device 600; central processing unit 610; memory 620; graphic processing unit 630. DETAILED DESCRIPTION
[0043] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application
[0044] In the embodiments of the present application, a graphic rendering resource management device 100 is provided, which can be applied to a central processing unit, which can be a CPU. The central processing unit can be configured with rendering programs, and the central processing unit is connected with a graphic processing unit, which can be a GPU, NPU, etc. Thus, the central processing unit can call the graphic processing unit for rendering when the rendering program is executed. In the following, the embodiments of the present application will be described with the graphic processing unit as GPU and the central processing unit as CPU.
[0045] [According to Rule 91, correct on 07.01.2025] Please refer to FIG. 1, which is a schematic diagram of the graphic rendering resource management device 100 provided by an embodiment of the present application. The graphic rendering resource management device 100 includes a plurality of rendering program modules and a driver layer. In the following, two rendering program modules will be taken as an example for description, and actually, more rendering program modules can be set in the central processing unit, which will not be further expanded here. Among them, in order to distinguish, the two rendering program modules are respectively a first rendering program module and a second rendering program module, which are any two different rendering program modules in the central processing unit. That is, in the embodiments of the present application, the graphic rendering resource management device includes a first rendering program module 110, a second rendering program module 120 and a driver layer 130.
[0046] The rendering program running in the first rendering program module 110 can be referred to as a first rendering program, and the rendering program running in the second rendering program module 120 can be referred to as a second rendering program. The first rendering program and the second rendering program are different rendering programs. For example, the first rendering program can be Vulkan, and the second rendering program can be D3D or openGL.
[0047] In the embodiments of the present application, each rendering program module comprises a running environment unit and a driving unit of the corresponding rendering program. For example, refer to FIG. 2, which is a schematic diagram of an extended structure of the management apparatus 100 of the graphic rendering resource provided in an embodiment of the present application. The first rendering program module 110 can comprise a first rendering program running environment unit and a first driving unit. The first rendering program running environment unit is configured to configure the Runtime (running environment) of the first rendering program, and the first driving unit is configured with the driving program corresponding to the first rendering program. The driving program is used to enable the rendering program to call the graphic processing unit GPU. The first rendering program can call the first driving unit through the Runtime provided by the first rendering program running environment unit, and then call the graphic processing unit GPU through the first driving unit.
[0048] Similarly to the first rendering program module 110, in the present embodiment, the second rendering program module 120 can comprise a second rendering program running environment unit and a second driving unit. The second rendering program running environment unit is configured to configure the Runtime of the second rendering program, and the second driving unit is configured with the driving program corresponding to the first rendering program. Thus, the second rendering program can call the second driving unit through the Runtime provided by the second rendering program running environment unit, and then call the graphic processing unit GPU through the second driving unit.
[0049] The driving layer 130 is configured to configure the rendering resource objects corresponding to the respective rendering programs, for example, the respective rendering resource objects of the first rendering program and the second rendering program.
[0050] Next, the management method of the graphic rendering resource of the present application will be described in combination with the above management apparatus of the graphic rendering resource.
[0051] Refer to FIG. 3, which is a flowchart of the management method of the graphic rendering resource provided in an embodiment of the present application. The management method of the graphic rendering resource can also be applied to the central processing unit. The central processing unit is connected with the graphic processing unit. The central processing unit is configured with at least two different rendering programs, and the graphic processing unit is used to provide the hardware resource of the graphic rendering for the rendering program. The management method of the graphic rendering resource comprises the following steps:
[0052] S310, in response to the received management instruction generated in the running process of the at least one rendering program, determining the hardware resource object used to call the graphic rendering based on the management instruction and the interface function conversion relationship and the driving conversion relationship in the rendering resource object of the rendering program corresponding to the management instruction.
[0053] S320, managing the hardware resource of the graphic rendering required by the management instruction according to the determined hardware resource object and the management instruction.
[0054] For the S310, in the embodiments of the present application, the driving layer respectively configures a rendering resource object corresponding to different rendering programs, each rendering resource object includes an interface function conversion relationship between a preset hardware resource interface function and a target interface function, the preset hardware resource interface functions in the interface function conversion relationships of the rendering resource objects corresponding to different rendering programs are the same, the target interface functions in the rendering resource objects corresponding to different rendering programs are different, the target interface function is a calling interface function of a graphics processing unit GPU for the rendering program corresponding to the rendering resource object, and the preset hardware resource interface function can be a set of calling interface functions defined separately and used for calling a hardware resource object. That is, the calling interface functions of the graphics processing unit GPU corresponding to different rendering programs are converted into the same preset hardware resource interface function.
[0055] Taking the first rendering program as Vulkan and the second rendering program as D3D as an example, the rendering resource object corresponding to the first rendering program includes a conversion relationship between a preset hardware resource interface function and a Vulkan calling interface function, and the rendering resource object corresponding to the second rendering program includes a conversion relationship between a preset hardware resource interface function and a D3D calling interface function.
[0056] Please refer to FIG. 4, which is a schematic diagram of the rendering program calling the GPU in the prior art. The calling function of each rendering program is first converted into an application programming interface API, so as to call the GPU HW Resource object (a hardware resource object of the graphics processing unit GPU) through the application programming interface API. When the first rendering program Vulkan is taken as the bottom layer driving, the calling interface function of the second rendering program D3D is converted into the application programming interface API, and then the application programming interface D3D API of the second rendering program is converted into the application programming interface Vulkan API of the first rendering program, so as to call the hardware resource object.
[0057] As shown in FIG. 5, which is a schematic diagram of the rendering program calling the GPU in the embodiments of the present application. In the embodiments of the present application, for different rendering programs, the respective calling interface functions are all converted into a unified preset hardware resource interface function. Thus, each rendering program can reduce the process of converting the calling interface function into the respective corresponding API, and does not need to perform the conversion at the API level, so as to not need to design the API code corresponding to each rendering program, and not need to design the conversion logic of the API between different rendering programs, effectively reducing the complexity and difficulty in design. In addition, when the code needs to be maintained and tested, the conversion at the API level does not need to be maintained and tested, reducing the management difficulty.
[0058] [Rule 91 correction 07.01.2025] In an embodiment of the present application, the preset hardware resource interface function is different from the target interface function of all rendering programs configured in the central processing unit.
[0059] [Rule 91 correction 07.01.2025] For example, two rendering programs, D3D and Vulkan, are provided in the central processing unit, and the preset hardware resource interface function can be the calling interface function of the rendering program OpenGL to the graphics rendering resource, or the preset hardware resource interface function can also be a separately configured set of calling interface functions to the graphics rendering resource. The separately configured calling interface function can not be the calling interface function of any existing rendering program. In this way, the management method of the graphics rendering resource can be more universal and can be applied to more rendering programs, rather than being limited to the conversion of calling interface functions between two rendering programs.
[0060] [Rule 91 correction 07.01.2025] In other embodiments, the preset hardware resource interface function is the same as the target interface function of the preset rendering program; wherein the preset rendering program is any rendering program in the central processing unit, for example, the first rendering program is the preset rendering program, the first rendering program module is the preset rendering program module, the target interface function of the first rendering program is the preset hardware resource interface function, and if the first rendering program is Vulkan, the preset hardware resource interface function is the calling interface function of Vulkan.
[0061] Thus, during development, for the preset rendering program, there is no need to build a conversion relationship between the preset rendering program and the preset hardware resource interface function, and the calling interface function of the preset rendering program is directly used and converted into a calling interface to the hardware resource object. Thus, only the conversion of the calling interface function corresponding to the preset rendering program by other rendering programs needs to be designed, thereby reducing code overhead and design difficulty, wherein the calling interface function is not the API of each rendering program, i.e., in the embodiments of the present application, the calling interface function is not converted into an API, and there is no mutual conversion between APIs of different rendering programs.
[0062] In the present embodiment, the first rendering program can be Vulkan, and the rendering program Vulkan allows the calling interface function to be bound to any hardware resource object. On this basis, if the calling interface function of Vulkan is used as the preset hardware resource interface function, the abnormality that can occur when the relationship between the hardware resource object and the preset hardware resource interface function is established and released during the creation and destruction of the rendering resource object can be effectively reduced, thereby improving the accuracy of the management of the graphics processing unit GPU hardware resource.
[0063] In the driving layer 130, a driving conversion relationship between the preset hardware resource interface function and a hardware resource object of the graphics processing unit GPU is also included, wherein the hardware resource object is used to call the hardware resource of the graphics processing unit GPU, and the hardware resource object can refer to the prior art and will not be described here.
[0064] In the embodiment, each rendering resource object further includes calling information of the hardware resource of the graphics processing unit GPU required by the rendering program corresponding to the rendering resource object, and the required hardware resource of the graphics processing unit GPU includes but is not limited to GPU memory, special acceleration data structure of GPU hardware, etc., for example, the calling information can be an access address of the hardware resource of the graphics processing unit GPU in the GPU, handle (a kind of identification information), etc.
[0065] Through the rendering resource object configured as described above, in the case that the driving layer 130 receives a management instruction generated in the running process of any rendering program, the process of S310 described above can be executed, that is, the hardware resource object corresponding to the management instruction can be determined based on the management instruction and the interface function conversion relationship in the rendering resource object of the rendering program corresponding to the management instruction and the driving conversion relationship, and the driving layer 130 can further execute S320 to manage the hardware resource of the graphics rendering required by the management instruction according to the determined hardware resource object and the management instruction.
[0066] In some embodiments, before receiving the management instruction, the rendering resource object needs to be configured, and the configuration process can include: in response to the running of the other rendering program of the non-preset rendering program, calling the preset driving unit to create the initial rendering resource object of the rendering program based on the driving unit of the rendering program, and the initial rendering resource object includes the preset hardware resource interface function; controlling the preset driving unit to create the interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program in the initial rendering resource object based on the driving unit of the rendering program, to obtain the rendering resource object corresponding to the rendering program.
[0067] As described above, each rendering program module includes a driving unit of a corresponding rendering program, and in the embodiment, the preset driving unit is the driving unit of the preset rendering program, for example, if the first rendering program is the preset rendering program, the driving unit of the first rendering program is the preset driving unit, and if the preset rendering program is Vulkan, the preset driving unit is the driving unit of Vulkan.
[0068] Similarly, for the management apparatus of the graphics rendering resource, the rendering resource object is created by the rendering program module driving the driver layer 130. In the case that the preset hardware resource interface function is the target interface function of the preset rendering program, the preset rendering program module does not need to configure the relationship between the preset hardware interface function and the target interface function, but can directly build the driving conversion relationship between the target interface function and the hardware resource object. The rendering program module other than the preset rendering program module is configured to: in response to the running of the rendering program, call the preset driving unit based on the driving unit of the rendering program, so that the preset driving unit creates the initial rendering resource object of the rendering program, and the initial rendering resource object includes the preset hardware resource interface function; control the preset driving layer to create the interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program in the initial rendering resource object, to obtain the rendering resource object corresponding to the rendering program.
[0069] Each target interface function includes a plurality of calling interface functions of the rendering program to the graphics processing unit GPU, that is, each target interface function is a set, and the set includes a plurality of calling interface functions.
[0070] Taking the second rendering program as D3D, the first rendering program as Vulkan, and the first rendering program as the preset rendering program as an example, the second driving unit of the second rendering program D3D is the UMD (User Mode Driver, a driving mode of D3D) driving. Specifically, the process can include: first, the second driving unit UMD driving of the second rendering program module 120 calls the first rendering program Vulkan driving to create an initial rendering resource object, and the information in the initial rendering resource object is empty. The driving of the first rendering program Vulkan will call the first target interface function of the first rendering program and configure it into the initial rendering resource object. Then, the second driving unit UMD driving drives the driver layer 130 to create the second target interface function corresponding to the second rendering program, and according to the functions between the calling interface functions, establishes the corresponding relationship between the calling interface functions with the same function, obtains the interface function conversion relationship including the corresponding relationship between the plurality of groups of calling interface functions, and further obtains the rendering resource object corresponding to the second rendering program.
[0071] In the embodiments of the present application, the rendering resource object further includes calling information of the hardware resource by the graphic rendering of the rendering program corresponding to the rendering resource object, and the calling information of the hardware resource includes at least one of the identification information of the hardware resource or the access address of the hardware resource in the graphic processing unit GPU. Wherein, after the rendering resource object is created, the corresponding hardware resource object can be allocated to the rendering resource object, that is, the driving conversion relationship is established. Each hardware resource object has the identification information and the access address corresponding in the graphic processing unit GPU, and after all the rendering programs allocate the hardware resource objects, the identification information and the access address in each hardware resource object can be fed back to the rendering program module corresponding to each hardware resource object or the corresponding rendering resource object, and the calling information of the hardware resource of the graphic processing unit GPU required by the second rendering program is generated.
[0072] The hardware resource of the graphic processing unit GPU required by each rendering program is of multiple types, for example, the display memory resource, the special acceleration structure and the like, and further, for the display memory, different resources in the rendering can need to use different display memories for storage, for example, the texture resource, the color buffer and the depth buffer used in the rendering need to be stored in a Vulkan Image, and the vertex buffer and the index buffer need to be stored in another Vulkan Buffer, therefore, the corresponding initial rendering resource object needs to be created for different hardware resources, and the relationship between each hardware resource object is established.
[0073] Therefore, the initial rendering resource object of the rendering program is created based on the preset driving unit calling the driving unit of the rendering program, which can include: in response to the running of other rendering programs of the non-preset rendering program, obtaining each type of hardware resource required by the rendering program; based on the preset driving unit calling the driving unit of the rendering program, the preset driving unit is used to create the initial rendering resource object corresponding to each type of hardware resource required by the rendering program; the initial rendering resource object corresponding to each type of hardware resource includes the preset hardware resource interface sub-function corresponding to each type of hardware resource.
[0074] In addition, the rendering resource object is obtained based on the initial rendering resource object, which can include: for each initial rendering resource object, the preset driving unit is controlled by the driving unit of the rendering program to create the interface function conversion relationship between the preset hardware resource interface sub-function and the target interface function of the rendering program in the initial rendering resource object, and the rendering resource object corresponding to the rendering program is obtained.
[0075] Corresponding to the management device of the graphic rendering resource, the above-mentioned method can be executed by the driver layer, that is, the driver layer 130 can be specifically used for: in response to the running of the rendering program in any rendering program module, determining the various types of hardware resources required by the rendering program corresponding to the rendering program module; calling a preset driver unit based on the driver unit of the rendering program, so that the preset driver unit respectively creates initial rendering resource objects corresponding to the various types of hardware resources required by the rendering program, and the initial rendering resource objects corresponding to the various types of hardware resources include the preset hardware resource interface sub-function corresponding to the hardware resource; for each initial rendering resource object, based on the driver unit of the rendering program module, control the preset driver layer to create an interface function conversion relationship between the preset hardware resource interface sub-function and the target interface function of the rendering program in the initial rendering resource object, and obtain the rendering resource object corresponding to the rendering program.
[0076] Exemplarily, taking the second rendering program as D3D and the first rendering program as Vulkan, the first rendering program is a preset rendering program. In this example, the UMD driver can call the first rendering program Vulkan driver to create a plurality of initial rendering resource objects, such as the initial rendering resource objects corresponding to the first rendering program image Vulkan Image and the first rendering program buffer Vulkan Buffer. The initial rendering resource object of the Vulkan Image includes the first target interface function of the texture resource, the color buffer, and the depth buffer. The initial rendering resource object corresponding to the Vulkan Buffer includes the first target interface function of the vertex buffer and the index buffer. The corresponding relationship between the respective first interface functions of the Vulkan Image and the Vulkan Buffer and the second target interface function is established to obtain the rendering resource object. Finally, the initial rendering resource objects corresponding to the Vulkan Image and the Vulkan Buffer are respectively allocated with corresponding hardware resource objects, such as the corresponding video memory, and the corresponding identification information and access address are returned to the rendering resource object.
[0077] Since the rendering resource object corresponding to the rendering program is configured with the access address and the identification information of the hardware resource of the GPU, during rendering, the corresponding calling information can be directly obtained from the rendering resource object, and the required hardware resource is obtained by accessing the GPU through the calling information. Therefore, in the embodiments of the present application, the process of determining the hardware resource object can include: in response to the received management instruction, obtaining at least one of the access address and the identification information of the hardware resource required by the rendering program from the rendering resource object corresponding to the rendering program; determining the hardware resource object based on at least one of the access address and the identification information of the hardware resource.
[0078] As described above, the calling information of the hardware resource, such as the identification information or the access address, is included in the hardware resource object, and after the hardware resource object is constructed, the calling information is returned to the corresponding rendering resource object. Therefore, in the embodiment of the present application, the calling information can be obtained from the rendering resource object, and the corresponding hardware resource object and the required hardware resource can be determined according to the calling information.
[0079] Specifically, in the management apparatus corresponding to the graphic rendering resource, the process of determining the hardware resource object can be performed by each rendering program module, that is, each rendering program module is configured to: in response to the management instruction of the rendering program running in the rendering program module, obtain at least one of the access address and the identification information of the hardware resource required by the rendering program from the rendering resource object corresponding to the rendering program running in the rendering program module, and determine the hardware resource object based on at least one of the access address and the identification information of the hardware resource.
[0080] In the above manner, after receiving the management instruction of the rendering program requiring the rendering resource, at least one of the corresponding access address or the identification information can be directly obtained through the rendering resource object, and then the corresponding management instruction can be executed by accessing the graphic processing unit GPU according to at least one of the access address or the identification information.
[0081] In an embodiment of the present application, after obtaining the rendering resource object corresponding to the rendering program, the rendering resource object corresponding to the rendering program can also be destroyed in response to the stop running of any other rendering program except the preset rendering program.
[0082] The destruction can be realized by a destruction unit, that is, the other rendering program modules except the preset rendering program module also include the destruction unit, and the driving unit of the other rendering program module is further configured to: in response to the stop running of the rendering program corresponding to the rendering program module, drive the destruction unit to destroy the rendering resource object corresponding to the rendering program in the driving layer 130.
[0083] In the embodiment, the destruction unit is provided, which can facilitate the management of the life cycle of the rendering resource object, so that the rendering resource object can be quickly destroyed by the destruction unit when adjustment, maintenance and testing are required, so as to facilitate the modification of the code and the troubleshooting.
[0084] The destruction unit can be configured with multiple destruction interfaces for different types of hardware resources of the graphic processing unit GPU, for example, the destruction unit can include the destruction interfaces corresponding to the Vulkan Image and the Vulkan Buffer, so as to destroy the corresponding rendering resource object through different destruction interfaces.
[0085] The rendering involves data interaction between a graphics processing unit (GPU) and a central processing unit (CPU). In order to ensure accurate rendering, data read and write in the central processing unit and the graphics processing unit need to be synchronized during the rendering process.
[0086] In the rendering program, a resource synchronization module is usually set. In the embodiment of the present application, the resource synchronization unit can be configured only in the preset rendering program module. Thus, in response to a call of a hardware resource of a graphics rendering by any rendering program, the data read and write in the central processing unit and the graphics processing unit are synchronized based on the resource synchronization unit of the preset rendering program.
[0087] Since the calling interface function of other rendering programs is converted into the calling interface function of the preset rendering program, the resource synchronization unit can be reused in the embodiment. That is, the other rendering program module is also used to call the resource synchronization unit in the preset rendering program module based on the driving unit of the rendering program, so as to synchronize the data read and write in the central processing unit (CPU) and the graphics processing unit (GPU) in the case that the hardware resource of the GPU is called by the rendering program corresponding to the rendering program module.
[0088] Through reuse of the resource synchronization unit, the data read and write in the graphics processing unit (GPU) and the central processing unit (CPU) can also be synchronized when the rendering is performed by other rendering programs. Since the resource synchronization unit does not need to be separately set in the other rendering program module, the code overhead and design difficulty can be reduced, and the difficulty and cost of management work such as testing and maintenance can be reduced.
[0089] It can be understood that the content implemented by the graphics rendering resource management method is similar to the function of the graphics rendering resource management device 100, which will not be expanded here.
[0090] [According to Rule 91 correction 07.01.2025] Please refer to FIG. 6. Based on the same inventive concept, the embodiment of the present application further provides an electronic device 600, which comprises a central processing unit 610, a memory 620 connected in communication with the central processing unit 610, and a graphics processing unit 630 connected in communication with the central processing unit 610. The central processing unit can be a CPU, and the graphics processing unit can be a GPU.
[0091] [According to Rule 91 correction 07.01.2025] In the embodiment of the present application, a program is stored in the memory; the central processing unit is used to run the program to implement the graphics rendering resource management method provided in the foregoing embodiments, or, in the embodiment of the present application, the memory stores the program of the graphics rendering resource management device 100 provided in any of the foregoing embodiments; the central processing unit is used to run the program to implement the function of the graphics rendering resource management device 100.
[0092] [correction according to Rule 91 07.01.2025] a graphics processing unit, connected to the central processing unit, for providing graphics processing unit hardware resources for execution of a rendering program in the central processing unit.
[0093] The memory 620 can include, but is not limited to, a RAM (Random Access Memory), a ROM (Read Only Memory), a PROM (Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory), an EEPROM (Electric Erasable Programmable Read-Only Memory), and the like.
[0094] It can be understood that the electronic device 600 can further include more general modules required by itself, which are not described one by one in the embodiments of the present application.
[0095] Based on the same inventive concept, the embodiments of the present application also provide a computer readable storage medium having a computer program stored thereon, when the computer program runs on a computer, the computer is caused to implement the management method of the graphic rendering resource provided by any one of the above embodiments, or the computer is caused to be configured as the management device 100 of the graphic rendering resource provided by any one of the above embodiments.
[0096] The storage medium can be any available medium that the computer can access or a data storage device such as a server, data center, etc. integrated with one or more available medium sets. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD (Solid State Disk)), etc.
[0097] In the embodiments provided in the present application, it should be understood that the disclosed method and device can also be implemented by other means. The device embodiments described above are only schematic. The function modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0098] The functions, if implemented in the form of software function modules and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts of the prior art that make contributions or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various program code storage media.
[0099] [Corrected according to Rule 91 on 07.01.2025] Based on the same inventive concept, the embodiments of the present application also provide a rendering method, which can be applied to a central processing unit that can implement the above-mentioned graphic rendering resource management method, or a central processing unit configured with the graphic rendering resource management device provided by any of the preceding embodiments. Please refer to FIG. 7, which is a flowchart of the rendering method provided by an embodiment of the present application. The rendering method comprises:
[0100] S610, in the case of receiving a rendering instruction of any rendering program, determining the intermediate interface function corresponding to the target interface function under the preset hardware resource interface function type according to the interface function conversion relationship in the rendering resource object corresponding to the rendering program.
[0101] Among them, the rendering resource object includes the interface function conversion relationship and the driver conversion relationship; the interface function conversion relationship includes the conversion relationship between the preset hardware resource interface function and the target interface function of the hardware resource calling graphic rendering; the preset hardware resource interface functions in the rendering resource objects corresponding to different rendering programs are the same; the target interface functions in the rendering resource objects corresponding to different rendering programs are different, and the target interface functions in each rendering resource object are the calling interface functions of the graphic rendering resource for the rendering program corresponding to the rendering resource object.
[0102] S620, converting the intermediate interface function into the hardware resource object corresponding to the rendering instruction by using the driver conversion relationship.
[0103] Among them, the driver conversion relationship includes the conversion relationship between the preset hardware resource interface function and the hardware resource object, and the hardware resource object is used to call the hardware resource of graphic rendering.
[0104] S630, sending the rendering instruction to the graphic processing unit, and using the hardware resource object to call the hardware resource of the graphic processing unit to execute the rendering instruction.
[0105] In the rendering method, the hardware resource object corresponding to the rendering instruction can be quickly rendered and called by using the rendering resource object corresponding to the rendering program issuing the rendering instruction and the second conversion relationship without converting the rendering instruction at the API level, thereby reducing the power consumption of the central processing unit caused by the execution of the API and improving the performance of the central processing unit when executing rendering.
[0106] The technical features of the above embodiments can be freely combined without conflict, and the embodiments obtained by the combination are within the protection scope of the present application.
[0107] The above is merely specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be limited by the protection scope of the claims.
[0108] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
Claims
1. A method for managing graphics rendering resources, characterized in that, It is applied to a central processing unit, which is connected to a graphics processing unit, and the central processing unit is configured with at least two different rendering programs. The graphics processing unit is used to provide hardware resources for graphics rendering for the rendering programs. The method for managing graphics rendering resources includes: In response to a management instruction received during the execution of at least one rendering program, a hardware resource object for calling graphics rendering is determined based on the management instruction and the interface function conversion relationship and driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instruction. Manage the hardware resources required for graphics rendering based on the identified hardware resource object and the management instruction; Each of the rendering programs is configured with a corresponding rendering resource object, and each rendering resource object includes the interface function conversion relationship and the driver conversion relationship; The interface function conversion relationship includes the conversion relationship between the preset hardware resource interface function and the target interface function for calling the hardware resources required for graphics rendering; the preset hardware resource interface function is the same in the rendering resource objects corresponding to different rendering programs; the target interface function is different in the rendering resource objects corresponding to different rendering programs, and the target interface function in each rendering resource object is the calling interface function of the rendering program corresponding to the rendering resource object for the graphics rendering resource; The driver conversion relationship includes the conversion relationship between the preset hardware resource interface function and the hardware resource object, whereby the hardware resource object is used to call hardware resources for graphics rendering.
2. [Corrected from Rule 91, 07.01.2025] The method for managing graphics rendering resources according to claim 1 is characterized in that, The preset hardware resource interface function is different from the target interface function of all the rendering programs configured in the central processing unit.
3. [Corrected from Rule 91, 07.01.2025] The method for managing graphics rendering resources according to claim 1 is characterized in that, The central processing unit also includes a driver layer and driver units corresponding to different rendering programs. The preset hardware resource interface function is the same as the target interface function of the preset rendering program; the preset rendering program is any one of the rendering programs in the central processing unit; the preset rendering program corresponds to the preset driver unit. Before determining the hardware resource object for calling graphics rendering based on the management instructions and the interface function conversion relationship and driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instructions, the method further includes: In response to the execution of other rendering programs that are not the preset rendering program, the driver unit of the rendering program calls the preset driver unit to create an initial rendering resource object for the rendering program, the initial rendering resource object including the preset hardware resource interface function; Based on the driver unit of the rendering program, the preset driver unit controls the initial rendering resource object to create an interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program, thereby obtaining the rendering resource object corresponding to the rendering program.
4. The method for managing graphics rendering resources according to claim 3, characterized in that, The rendering resource object also includes the hardware resource call information of the rendering program corresponding to the rendering resource object for graphics rendering; the call information includes at least one of the identification information of the hardware resource object and the access address of the hardware resource corresponding to the hardware resource object in the graphics processing unit.
5. The method for managing graphics rendering resources according to claim 4, characterized in that, The hardware resource object used to call graphics rendering is determined based on the management instructions and the interface function conversion relationship and driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instructions, including: In response to the received management command, at least one of the access address and identification information of the hardware resources required by the rendering program is obtained from the rendering resource object corresponding to the rendering program. The hardware resource object is determined based on at least one of the access address of the hardware resource and the identification information.
6. The method for managing graphics rendering resources according to claim 3, characterized in that, Each rendering program requires multiple types of hardware resources for graphics rendering; the preset hardware resource interface functions include preset hardware resource interface sub-functions corresponding to each type of hardware resource. The step of the driver unit based on the rendering program calling the preset driver unit to create the initial rendering resource object of the rendering program includes: In response to the execution of other rendering programs that are not the preset rendering program, various hardware resources required by the rendering program are obtained; the driver unit of the rendering program calls the preset driver unit so that the preset driver unit creates initial rendering resource objects corresponding to various hardware resources required by the rendering program; the initial rendering resource objects corresponding to various hardware resources include preset hardware resource interface sub-functions corresponding to various hardware resources. The driver unit based on the rendering program controls the preset driver unit to create an interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program in the initial rendering resource object, thereby obtaining the rendering resource object corresponding to the rendering program, including: For each initial rendering resource object, the driver unit of the rendering program controls the preset driver unit to create an interface function conversion relationship between the preset hardware resource interface sub-function and the target interface function of the rendering program in the initial rendering resource object, thereby obtaining the rendering resource object corresponding to the rendering program.
7. The method for managing graphics rendering resources according to claim 3, characterized in that, After obtaining the rendering resource object corresponding to the rendering program, the method further includes: In response to the termination of any other rendering program besides the preset rendering program, the rendering resource object corresponding to that rendering program is destroyed.
8. The method for managing graphics rendering resources according to claim 3, characterized in that, After determining the hardware resource object for calling graphics rendering based on the management instructions and the interface function conversion relationship and driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instructions, the method further includes: In response to any rendering program's call to the hardware resources of the graphics rendering, the resource synchronization unit based on the preset rendering program synchronizes the data read and write operations in the central processing unit and the graphics processing unit.
9. A management device for graphics rendering resources, characterized in that, It is applied to a central processing unit, which is connected to a graphics processing unit, and the central processing unit is configured with at least two different rendering programs. The graphics processing unit is used to provide hardware resources for graphics rendering for the rendering programs. The graphics rendering resource management device includes: At least two rendering modules, each of which runs a different rendering program; The driver layer is used to respond to management instructions generated during the execution of at least one rendering program, and to determine the hardware resource object for calling graphics rendering based on the management instructions and the interface function conversion relationship and driver conversion relationship in the rendering resource object of the rendering program corresponding to the management instructions. The driver layer is also used to manage the hardware resources for graphics rendering required by the management instruction based on the determined hardware resource object and the management instruction; The driver layer separately configures each rendering program with a corresponding rendering resource object, and each rendering resource object includes the interface function conversion relationship and the driver conversion relationship; The interface function conversion relationship includes the conversion relationship between the preset hardware resource interface function and the target interface function for calling the hardware resources required for graphics rendering; the preset hardware resource interface function is the same in the rendering resource objects corresponding to different rendering programs; the target interface function is different in the rendering resource objects corresponding to different rendering programs, and the target interface function in each rendering resource object is the calling interface function of the rendering program corresponding to the rendering resource object for the graphics rendering resource; The driver conversion relationship includes the conversion relationship between the preset hardware resource interface function and the hardware resource object, whereby the hardware resource object is used to call hardware resources for graphics rendering.
10. The graphics rendering resource management device according to claim 9, characterized in that, The preset hardware resource interface functions in each of the rendering resource objects are different from the calling interface functions used by the rendering programs corresponding to each of the rendering program modules.
11. The graphics rendering resource management device according to claim 9, characterized in that, Each of the different rendering program modules includes a driver unit corresponding to its respective rendering program; The preset hardware resource interface function in each of the rendering resource objects is the same as the target interface function of the preset rendering program; the preset rendering program is any rendering program corresponding to any of the rendering program modules; the preset rendering program module of the preset rendering program includes a preset driver unit; Other rendering program modules besides the preset rendering program module are configured to: in response to the operation of the rendering program, call the preset driver unit based on the driver unit of the rendering program to create the initial rendering resource object of the rendering program, the initial rendering resource object including the preset hardware resource interface function; The driver unit corresponding to the rendering program is also used to control the preset driver unit to create an interface function conversion relationship between the preset hardware resource interface function and the target interface function of the rendering program in the initial rendering resource object, so as to obtain the rendering resource object corresponding to the rendering program.
12. The graphics rendering resource management device according to claim 11, characterized in that, The rendering resource object also includes the hardware resource call information of the rendering program corresponding to the rendering resource object for graphics rendering; the call information includes at least one of the identification information of the hardware resource and the access address of the hardware resource in the graphics processing unit.
13. The graphics rendering resource management device according to claim 12, characterized in that, Each of the rendering program modules is configured to: in response to a management instruction of a rendering program running in the rendering program module, obtain at least one of the access address and identification information of the hardware resources required by the rendering program from the rendering resource object corresponding to the rendering program running in the rendering program module, and determine the hardware resource object based on at least one of the access address and the identification information of the hardware resources.
14. The graphics rendering resource management device according to claim 11, characterized in that, The graphics processing unit (GPU) hardware resources required by each rendering program are of multiple types; the preset hardware resource interface functions include preset hardware resource interface sub-functions corresponding to each type of hardware resource. The driver layer is also used to: in response to the operation of the rendering program in any of the rendering program modules, obtain various hardware resources required by the rendering program of the rendering program module; and call the preset driver unit based on the driver unit corresponding to the rendering program module, so that the preset rendering program drives the preset driver layer to create initial rendering resource objects corresponding to various hardware resources required by the rendering program, wherein the initial rendering resource objects corresponding to various hardware resources include preset hardware resource interface sub-functions corresponding to various hardware resources. The driver layer is further configured to: for each initial rendering resource object corresponding to the rendering program, based on the driver unit corresponding to the rendering program, control the preset driver unit to create an interface function conversion relationship between the preset hardware resource interface sub-function and the target interface function of the rendering program corresponding to the rendering program module in the initial rendering resource object, so as to obtain the rendering resource object corresponding to the rendering program.
15. The graphics rendering resource management device according to claim 11, characterized in that, In addition to the preset rendering program module, other rendering program modules also include a destruction unit; the other rendering program modules are also used to drive the destruction unit to destroy the rendering resource object corresponding to the rendering program in the driver layer in response to the rendering program of the rendering program of the rendering program of the rendering program module stopping running.
16. The graphics rendering resource management device according to claim 11, characterized in that, The preset rendering program module further includes a resource synchronization unit, which is used to synchronize data read and write in the central processing unit and the graphics processing unit when the rendering program in any of the rendering program modules calls the hardware resources of the graphics processing unit.
17. [Corrected from Rule 91, 07.01.2025] An electronic device, characterized in that, include: A central processing unit and a memory; the memory stores a program; the processing unit is used to run the program to implement the graphics rendering resource management method as described in any one of claims 1-8; A graphics processing unit, connected to the central processing unit, is used to provide hardware resources for graphics rendering for the execution of the rendering program in the central processing unit.
18. A computer-readable storage medium, characterized in that, The readable storage medium stores a computer program that, when run on a computer, causes the computer to implement the graphics rendering resource management method as described in any one of claims 1-8.
19. A rendering method, characterized in that, include: Upon receiving a rendering instruction from any rendering program, the intermediate interface function corresponding to the target interface function in the rendering instruction is determined based on the interface function conversion relationship in the rendering resource object corresponding to the rendering program, under the preset hardware resource interface function type. The rendering resource object includes the interface function conversion relationship and the driver conversion relationship; the interface function conversion relationship includes the conversion relationship between the preset hardware resource interface function and the target interface function that calls the hardware resource of graphics rendering; the preset hardware resource interface function is the same in the rendering resource objects corresponding to different rendering programs; the target interface function is different in the rendering resource objects corresponding to different rendering programs, and the target interface function in each rendering resource object is the calling interface function of the rendering program corresponding to the rendering resource object for the graphics rendering resource; The intermediate interface function is converted into a hardware resource object corresponding to the rendering instruction using the driver conversion relationship; the driver conversion relationship includes the conversion relationship between the preset hardware resource interface function and the hardware resource object, and the hardware resource object is used to call the hardware resources for graphics rendering; The rendering instruction is sent to the graphics processing unit, and the hardware resource object is used to call the hardware resources of the graphics processing unit to execute the rendering instruction.