Rendering instruction processing method and device, electronic equipment and storage medium
Through the combination of the engine layer and the target interface layer, the differences in the graphics driver interface are blocked, and rendering instructions are obtained and optimized, which solves the problem of rendering results not meeting expectations and redundancy, and realizes cross-platform rendering instructions processing.
Patent Information
- Application Number
- CN202410194900.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2025-08-22
AI Technical Summary
In the prior art, the rendering results do not meet expectations and rendering link redundancy problems, and different graphics driver interfaces need to be targeted at different implementation solutions, which are not very versatile.
The original rendering instruction sequence is sent to the target interface layer through the engine layer, mask the differences in the graphics driver interface, obtain the rendering instruction parameters and content, update the rendering instruction parameters to optimize the rendering instruction, and use the target interface layer to block the differences in different graphics driver interfaces to realize cross-platform calls.
Improve the universality of the rendering instruction acquisition scheme, simplifies the rendering instruction acquisition and optimization process, and quickly locate and optimize rendering problems.
Smart Images

Figure CN120526013A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to computer technology, and more particularly to a method, device, electronic device, and storage medium for processing rendering instructions. Background Art
[0002] Rendering refers to the process of calculating and combining at least two of the elements such as models, light sources, materials or textures in a 3D scene to generate a 2D image.
[0003] Currently, in rendering scenarios, some frames may not meet expectations, or there may be issues such as rendering link redundancy. Therefore, it is necessary to obtain and analyze rendering instructions to identify rendering issues. However, the instruction acquisition methods used in related technologies require different implementations for different graphics driver interfaces, resulting in limited versatility. Summary of the Invention
[0004] Embodiments of the present disclosure provide a method, device, electronic device, and storage medium for processing rendering instructions, which can be applied to obtaining rendering instructions corresponding to different graphics driver interfaces.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing a rendering instruction, comprising:
[0006] Obtaining an original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces;
[0007] Obtaining parameters corresponding to rendering instructions in the original rendering instruction sequence, and storing the parameters in association with the rendering instructions;
[0008] Determining a target rendering instruction in the original rendering instruction sequence, obtaining rendering target content corresponding to the target rendering instruction, and storing the rendering target content and the target rendering instruction in association;
[0009] Parameters associated with the rendering instruction are updated based on the render target content and the target rendering instruction to optimize the rendering instruction.
[0010] In a second aspect, an embodiment of the present disclosure further provides a device for processing a rendering instruction, the device comprising:
[0011] An instruction acquisition module is used to acquire an original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield the interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces;
[0012] a parameter acquisition module, configured to acquire parameters corresponding to rendering instructions in the original rendering instruction sequence, and associate and store the parameters with the rendering instructions;
[0013] a content acquisition module, configured to determine a target rendering instruction in the original rendering instruction sequence, acquire rendering target content corresponding to the target rendering instruction, and associate and store the rendering target content with the target rendering instruction;
[0014] An instruction optimization module is used to update parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the rendering instruction method as described in any embodiment of the present disclosure.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the rendering instruction method as described in any embodiment of the present disclosure.
[0020] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for processing rendering instructions, which obtain the original rendering instruction sequence sent by the engine layer to the target interface layer, obtain the parameters corresponding to the rendering instructions in the original rendering instruction sequence, and obtain the rendering target content generated by the graphics driver interface in response to the target rendering instruction, and update the parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction. Since the target interface layer shields the interface differences between different graphics driver interfaces, the method of obtaining rendering instructions based on the target interface layer can be applied to various graphics driver interfaces, and there is no need to design instruction acquisition methods separately for various graphics driver interfaces, which solves the problem that related technologies need to design different instruction acquisition schemes for different graphics driver interfaces, improves the versatility of the rendering instruction acquisition scheme, and simplifies the rendering instruction acquisition scheme. Since the rendering target content and the target rendering instruction are combined, the rendering instruction corresponding to the rendering problem can be quickly located, and then the rendering instruction corresponding to the rendering problem is optimized, which simplifies the rendering instruction optimization scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0022] Figure 1 A schematic diagram of a processing flow of a rendering instruction provided by an embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of a preset location for adding rendering instructions provided in an embodiment of the present disclosure;
[0024] Figure 3 A system architecture diagram for implementing a method for processing rendering instructions provided by an embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram of the structure of a rendering instruction processing device provided by an embodiment of the present disclosure;
[0026] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0034] Figure 1 This is a schematic diagram of a rendering instruction processing flow provided by an embodiment of the present disclosure. This embodiment of the present disclosure is applicable to scenarios involving rendering instruction acquisition, such as acquiring and optimizing rendering instructions in a game or special effects rendering scenario, or acquiring rendering instructions in a game or special effects rendering scenario to troubleshoot rendering effect issues. This method can be executed by a rendering instruction processing device, which can be implemented in software and / or hardware, and optionally by an electronic device, such as a mobile terminal, PC, or server.
[0035] like Figure 1 As shown, the method includes:
[0036] S110: Obtain an original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces.
[0037] In the embodiment of the present disclosure, the engine layer is used to control the graphics driver interface to render the graphics data in the 3D scene onto the 2D screen. The graphics data includes models, light sources, materials, and textures. For example, the engine layer includes a game engine or a special effects engine. The graphics driver interface represents a computer function used to drive hardware devices such as a graphics processor GPU. For example, the graphics driver interface includes computer graphics program interfaces such as GLES (Open GL for Embedded Systems, which is a subset of the Open GL three-dimensional graphics API), Metal (a rendering application programming interface that provides the lowest level required by the software to ensure that the software can move on different graphics chips), D3D (Direct 3D, mainly responsible for the display of 3D effects) and Vulkan (provides a display driver abstraction layer that directly controls and accesses the underlying GPU).
[0038] For example, different graphics driver interfaces are encapsulated and abstracted to obtain a target interface layer. Program codes developed based on the target interface layer can be applied to different platforms and different graphics driver interfaces, thus enabling cross-platform calls to graphics driver interfaces.
[0039] Interface differences represent the differences between different graphics driver interfaces. For example, interface differences include differences in interface functions, applicable platforms, and applicable operating systems.
[0040] The original rendering instruction sequence represents the rendering instructions sorted in the order of calling. Among them, the rendering instructions are used to describe instructions on how to convert graphics data into images or videos. Optionally, the rendering instructions can be divided into: setting rendering target class instructions, clearing rendering target class instructions, rendering 3D object class instructions, rendering 2D image class instructions and copying 2D image class instructions, etc. according to different uses. For different graphics driver interfaces in the graphics driver layer, the above rendering instruction categories correspond to different instruction implementation methods. Different graphics driver interfaces are encapsulated and abstracted through the target interface layer to shield the interface differences between different graphics driver interfaces. Therefore, applications developed based on the target interface layer can run on different platforms and different graphics driver interfaces.
[0041] Exemplarily, the acquisition engine layer sends an original rendering instruction sequence to the target interface layer, including:
[0042] Obtain a candidate rendering instruction sequence sent by the engine layer to the target interface layer; filter the rendering instructions in the candidate rendering instruction sequence according to a target instruction range to obtain an original rendering instruction sequence, wherein the target instruction range represents at least one instruction acquisition range corresponding to a rendering effect.
[0043] In some embodiments, a target instruction range needs to be pre-set to specify a desired rendering instruction range. Optionally, the target instruction range is determined by obtaining instruction range configuration information and determining the target instruction range according to the instruction range configuration information.
[0044] For example, if you want to obtain all rendering instructions within a certain frame, you can specify the target instruction range as the frame through the interactive page. If you want to obtain rendering instructions for a certain rendering effect, you can specify the target instruction range as the rendering instructions corresponding to the specific rendering effect through the interactive page. If you want to obtain rendering instructions for multiple rendering effects, you can specify the target instruction range as the rendering instructions corresponding to multiple rendering effects through the interactive page. For example, if there are rendering effects for parts such as eyes, ears, and hair, and you want to obtain the rendering effects for the eyes and hair, you can specify the target instruction range as the rendering instructions corresponding to the eyes and hair.
[0045] Optionally, the target instruction range may include at least one group of rendering instructions, each rendering instruction group having a group name for analyzing the rendering instructions in each group. The rendering instructions may be grouped in advance based on the rendering effect, so that rendering instructions for achieving the same rendering effect are grouped together. Alternatively, rendering instructions for achieving similar rendering effects may be defined as a group, and rendering subgroups may be further divided within the group based on the specific rendering effects. For example, if special effects rendering is required for a pair of eyes, the rendering instructions for rendering the eyes may be divided into a group, and then the rendering instructions for rendering the left eye may be divided into the left eye rendering subgroup, and the rendering instructions for rendering the right eye may be divided into the right eye rendering subgroup.
[0046] In some embodiments, a communication connection is established between the client and the server. For example, if the game account is successfully logged in, a communication connection is established between the game client and the game engine. Alternatively, if it is detected that the special effects function is turned on or it is detected that the page to be displayed is a special effects page with special effects, a communication connection is established between the client and the special effects engine. If the client has a graphic display requirement, a rendering request is sent to the server. For example, if the client has a requirement to add special effects to the original image, a rendering request is sent to the special effects engine. The engine layer then parses the rendering request to obtain the request parameters, and then determines the candidate rendering instruction sequence based on the request parameters, and calls the interface provided by the target interface layer to send the candidate rendering instruction sequence to the target interface layer.
[0047] If the disclosed embodiment detects that an interface of the target interface layer is being called by the engine layer, the virtual GPU device is used to obtain the candidate rendering instruction sequence sent by the engine layer through the interface of the target interface layer. The virtual GPU device is used to obtain all interface calls of the target interface layer, record the relevant call parameters, and forward the call to the corresponding graphics driver interface. For example, the call parameters may include the color of the Clear instruction.
[0048] After obtaining the candidate rendering instruction sequence sent by the engine layer to the target interface layer, the rendering instructions in the candidate rendering instruction sequence are filtered based on the association between the target instruction range and the rendering instructions to obtain the original rendering instruction sequence that matches the target instruction range.
[0049] S120: Obtain parameters corresponding to rendering instructions in the original rendering instruction sequence, and store the parameters in association with the rendering instructions.
[0050] Exemplarily, the rendering instruction is parsed to obtain parameters corresponding to the rendering instruction, wherein the parameters corresponding to the rendering instruction include call parameters, and then the obtained call parameters are associated with the rendering instruction for subsequent instruction analysis.
[0051] S130: Determine a target rendering instruction in the original rendering instruction sequence, obtain rendering target content corresponding to the target rendering instruction, and store the rendering target content and the target rendering instruction in an associated manner.
[0052] The target rendering instruction may represent an instruction for updating a rendering target, for example, a target rendering instruction may include an instruction for clearing a rendering target, an instruction for rendering a 3D object, and an instruction for rendering a 2D image.
[0053] A render target represents a buffer into which the GPU draws the scene's pixels. Typically, a render target is a back buffer, physically representing a block of video memory containing information to be drawn for the next frame. The render target content represents the contents within the render target. To use a render target, create a render target object with a specified height and width. Set the render target directive to make the created render target the current render target. Subsequently, any calls to the target render directive will draw into the current render target.
[0054] Exemplarily, determining the target rendering instruction in the original rendering instruction sequence includes:
[0055] If the type of the rendering instruction in the original rendering instruction sequence meets a preset type condition, the rendering instruction is determined as a target rendering instruction, wherein the preset type condition represents an instruction type that calls a graphics driver interface to update the content of a rendering target.
[0056] Optionally, for each rendering instruction in the original rendering instruction sequence, if the rendering instruction type is an instruction type for clearing a render target, since executing the instruction for clearing a render target will clear the contents of the current render target, the rendering instruction is determined to be a target rendering instruction. Alternatively, if the rendering instruction type is an instruction type for rendering a 3D object and there is a write to the current render target, the rendering instruction is determined to be a target rendering instruction.
[0057] Optionally, a mapping table between rendering instruction types and rendering instructions can be pre-stored and maintained on the server to record the rendering instructions corresponding to each rendering instruction type. The rendering instructions and / or rendering instruction types in the mapping table can be updated according to the development of rendering technology.
[0058] In some embodiments, obtaining the rendering target content corresponding to the target rendering instruction includes: adding a preset acquisition instruction to the original rendering instruction sequence to obtain a target rendering instruction sequence, and sending the target rendering instruction sequence to the target interface layer; forwarding the target rendering instruction sequence to the corresponding graphics driver interface through the target interface layer; updating the rendering target based on the target rendering instruction sequence through the graphics driver interface, and obtaining the rendering target content through the preset acquisition instruction.
[0059] Among them, the preset acquisition instruction represents an instruction for acquiring the content of the rendering target after the rendering operation is performed based on the target rendering instruction to update the rendering target. For example, the preset acquisition instruction may include a snapshot instruction, etc. A snapshot is generated for the rendering result after the target rendering instruction is executed by the snapshot instruction. The parameters of the preset acquisition instruction include a content storage address, which is used to store the rendering target content according to the content storage address after the graphics driver interface executes the preset acquisition instruction to obtain the rendering target content, so that the engine layer can read the rendering target content from the content storage address. The target rendering instruction sequence represents the instruction sequence after the preset acquisition instruction is added to the original rendering instruction sequence.
[0060] Optionally, adding the preset acquisition instruction to the original rendering instruction sequence to obtain the target rendering instruction sequence includes: determining the adding position of the preset acquisition instruction corresponding to the target rendering instruction according to the position of the target rendering instruction in the original rendering instruction sequence; adding the preset acquisition instruction to the original rendering instruction sequence according to the adding position to obtain the target rendering instruction sequence.
[0061] To promptly obtain the rendering result of the target rendering instruction through a preset acquisition instruction after the target rendering instruction is executed, thereby preventing the execution of the next rendering instruction from affecting the current rendering result, a preset acquisition instruction corresponding to the target rendering instruction is inserted between the target rendering instruction and the next rendering instruction. The next rendering instruction can be either a target rendering instruction or a non-target rendering instruction. Optionally, the preset acquisition instruction is inserted between the target rendering instruction and the adjacent next rendering instruction.
[0062] Figure 2 This is a schematic diagram of a preset location for obtaining rendering instructions provided by an embodiment of the present disclosure. Figure 2 As shown, original rendering instruction sequence 200 includes set render target instruction 210, clear render target instruction 220, render 3D object A instruction 230, render 3D object B instruction 240, and render 2D image C instruction 250. Preset get instruction 260 is inserted after clear render target instruction 220, render 3D object A instruction 230, render 3D object B instruction 240, and render 2D image C instruction 250, respectively, to obtain target rendering instruction sequence 270.
[0063] In some embodiments, during the execution of a target rendering instruction sequence, the rendering target content after execution of each target rendering instruction is obtained, and the rendering target content and the target rendering instruction are stored in association.
[0064] S140: Update parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction.
[0065] Exemplarily, based on the rendering target content whose rendering effect does not meet the preset effect, a target rendering instruction to be optimized is determined; based on the instruction acquisition range corresponding to the target rendering instruction to be optimized, a target rendering instruction group is determined; and parameters associated with the rendering instructions in the target rendering instruction group are updated to optimize the rendering instructions.
[0066] Among them, the target rendering instruction to be optimized represents the target rendering instruction associated with the rendering target content whose rendering effect does not meet the preset effect. The target rendering instruction group represents the instruction acquisition range corresponding to the target rendering instruction to be optimized. That is, the target rendering instruction group is determined based on the instruction acquisition range corresponding to the target rendering instruction to be optimized. The target rendering instruction group includes the target rendering instruction to be optimized and other rendering instructions. For example, the rendering instruction for rendering a 3D object is the target rendering instruction to be optimized, and the target rendering instruction group to which the rendering instruction for rendering the 3D object belongs is obtained. Assuming that the target rendering instruction group also includes rendering instructions such as setting the rendering target and rendering a 2D image, the rendering instructions included in the target rendering instruction group are analyzed to determine the rendering instruction to be optimized that causes the rendering effect of the rendering target content to not meet the preset effect. Then, the parameters associated with the rendering instruction to be optimized in the target rendering instruction group are updated to optimize the rendering instruction.
[0067] Optionally, optimizing rendering instructions further includes deleting redundant rendering instructions, or adjusting the calling order of rendering instructions, etc.
[0068] Optionally, the rendering instructions are grouped according to the instruction acquisition ranges included in the target instruction range, and the rendering instructions are displayed in groups. In response to the interactive operation on the rendering instructions in the rendering instruction group, the parameters associated with the rendering instructions are displayed. If the rendering instruction is a target rendering instruction, the parameters associated with the rendering instruction and the rendering target content are displayed. For example, if the rendering target content does not meet the rendering expectations, it is necessary to analyze whether the parameter settings of the rendering instructions in the corresponding target rendering instruction group are reasonable, so as to locate the abnormal rendering instructions with unreasonable parameter settings. Alternatively, by analyzing the rendering instructions in the target rendering instruction group one by one, it is possible to determine redundant instructions that have no effect on pixels, and / or determine rendering instructions with unreasonable calling orders.
[0069] Figure 3 This is a system architecture diagram of a method for processing rendering instructions provided by an embodiment of the present disclosure. Figure 3 As shown, a virtual GPU device 320 is added between the engine layer 310 and the target interface layer 330 to obtain all calls to the target interface layer 330, record the parameters corresponding to the rendering instructions in the original rendering instruction sequence, and insert a preset acquisition instruction after the target rendering instruction to obtain a target rendering instruction sequence. Then, the target rendering instruction sequence is sent to the target interface layer 330. The target interface layer 330 forwards the target rendering instruction sequence to the corresponding graphics driver interface in the graphics driver layer 340.
[0070] In some embodiments, if the engine layer calls the target interface layer, the virtual GPU device obtains a candidate rendering instruction sequence sent by the engine layer to the target interface layer. The candidate rendering instruction sequence is then filtered based on the target instruction range to obtain an original rendering instruction sequence. The rendering instructions in the original rendering instruction sequence are the rendering instructions desired to be obtained. The virtual GPU device obtains parameters for the rendering instructions in the original rendering instruction sequence and establishes an association between the rendering instruction parameters and the corresponding rendering instruction.
[0071] The virtual GPU device then determines the target rendering instruction in the original rendering instruction sequence based on the type of rendering instruction. The virtual GPU device determines the preset acquisition instruction corresponding to the target rendering instruction based on the content storage address agreed upon with the engine layer. Based on the position of the target rendering instruction in the original rendering instruction sequence, the virtual GPU device determines the location to add the preset acquisition instruction corresponding to the target rendering instruction. The virtual GPU device inserts the preset acquisition instruction into the original rendering instruction sequence based on the addition location, thereby obtaining the target rendering instruction sequence. The virtual GPU device sends the target rendering instruction sequence to the target interface layer. The target interface layer forwards the target rendering instruction sequence to the corresponding graphics driver interface in the graphics driver layer. The rendering instructions in the target rendering instruction sequence (including the target rendering instruction) are executed via the graphics driver interface. While executing the target rendering instruction, the graphics driver interface writes to the currently set rendering target. After the target rendering instruction is executed, the preset acquisition instruction corresponding to the target rendering instruction is executed to obtain the content within the currently set rendering target (i.e., the rendering target content). The rendering target content is then cached based on the content storage address. Consequently, the engine layer can read the rendering target content after each target rendering instruction is executed from the content storage address. The rendering target content is then associated with the target rendering instruction.
[0072] Then, the rendering instructions and render target content are displayed in groups on an interactive page. If the rendering effect of the render target content does not meet the preset effect, the target rendering instruction corresponding to the render target content is determined as the target rendering instruction to be optimized. The rendering instruction group to which the target rendering instruction to be optimized belongs is used as the target rendering instruction group. The rendering instructions in the target rendering instruction group are analyzed to perform at least one of updating rendering instruction parameters, deleting redundant rendering instructions, and adjusting the order of rendering instructions.
[0073] The technical solution of the embodiment of the present disclosure obtains the original rendering instruction sequence sent by the engine layer to the target interface layer, obtains the parameters corresponding to the rendering instructions in the original rendering instruction sequence, and obtains the rendering target content generated by the graphics driver interface in response to the target rendering instruction, and updates the parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction. Since the target interface layer shields the interface differences between different graphics driver interfaces, the method of obtaining rendering instructions based on the target interface layer can be applied to various graphics driver interfaces, and there is no need to design instruction acquisition methods separately for various graphics driver interfaces. This solves the problem that related technologies need to design different instruction acquisition schemes for different graphics driver interfaces, improves the versatility of the rendering instruction acquisition scheme, and simplifies the rendering instruction acquisition scheme. Since the rendering target content and the target rendering instruction are combined, the rendering instruction corresponding to the rendering problem can be quickly located, and then the rendering instruction corresponding to the rendering problem is optimized, which simplifies the rendering instruction optimization scheme.
[0074] Figure 4 This is a structural diagram of a processing device for rendering instructions provided in an embodiment of the present disclosure. The device can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server, etc.
[0075] like Figure 4 As shown, the apparatus includes: an instruction acquisition module 410 , a parameter acquisition module 420 , a content acquisition module 430 and an instruction optimization module 440 .
[0076] The instruction acquisition module 410 is used to acquire the original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield the interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces;
[0077] A parameter acquisition module 420 is configured to acquire parameters corresponding to rendering instructions in the original rendering instruction sequence, and store the parameters in association with the rendering instructions;
[0078] A content acquisition module 430 is configured to determine a target rendering instruction in the original rendering instruction sequence, acquire rendering target content corresponding to the target rendering instruction, and associate and store the rendering target content with the target rendering instruction;
[0079] The instruction optimization module 440 is configured to update parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction.
[0080] Optionally, the content acquisition module 430 is specifically configured to:
[0081] If the type of the rendering instruction in the original rendering instruction sequence meets a preset type condition, the rendering instruction is determined as a target rendering instruction, wherein the preset type condition represents an instruction type that calls a graphics driver interface to update the content of a rendering target.
[0082] Optionally, the content acquisition module 430 is specifically configured to:
[0083] Adding a preset acquisition instruction to the original rendering instruction sequence to obtain a target rendering instruction sequence, and sending the target rendering instruction sequence to the target interface layer;
[0084] Forwarding the target rendering instruction sequence to the corresponding graphics driver interface through the target interface layer;
[0085] The rendering target is updated based on the target rendering instruction sequence through the graphics driver interface, and the rendering target content is acquired through the preset acquisition instruction.
[0086] Optionally, the adding of the preset acquisition instruction to the original rendering instruction sequence to obtain the target rendering instruction sequence includes:
[0087] Determining, according to the position of the target rendering instruction in the original rendering instruction sequence, an adding position of a preset acquisition instruction corresponding to the target rendering instruction;
[0088] The preset acquisition instruction is added to the original rendering instruction sequence according to the adding position to obtain a target rendering instruction sequence.
[0089] Optionally, the instruction acquisition module 410 is specifically configured to:
[0090] Obtaining a candidate rendering instruction sequence sent by the engine layer to the target interface layer;
[0091] The rendering instructions in the candidate rendering instruction sequence are filtered according to a target instruction range to obtain an original rendering instruction sequence, wherein the target instruction range represents at least one instruction acquisition range corresponding to a rendering effect.
[0092] Optionally, the target instruction range is determined by:
[0093] Acquire instruction range configuration information, and determine a target instruction range according to the instruction range configuration information.
[0094] Optionally, the instruction optimization module 440 is specifically configured to:
[0095] Determining target rendering instructions to be optimized based on rendering target content whose rendering effect does not meet the preset effect;
[0096] Determining a target rendering instruction group based on an instruction acquisition range corresponding to the target rendering instruction to be optimized;
[0097] Parameters associated with the rendering instructions in the target rendering instruction group are updated to optimize the rendering instructions.
[0098] The rendering instruction processing device provided in the embodiments of the present disclosure can execute the rendering instruction processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0099] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0100] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg Figure 5 The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0101] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0102] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0103] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0104] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0105] The electronic device provided by the embodiment of the present disclosure and the method for processing rendering instructions provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0106] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the method for processing the rendering instruction provided in the above embodiment is implemented.
[0107] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0108] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0109] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0110] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0111] Obtaining an original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces;
[0112] Obtaining parameters corresponding to rendering instructions in the original rendering instruction sequence, and storing the parameters in association with the rendering instructions;
[0113] Determining a target rendering instruction in the original rendering instruction sequence, obtaining rendering target content corresponding to the target rendering instruction, and storing the rendering target content and the target rendering instruction in association;
[0114] Parameters associated with the rendering instruction are updated based on the render target content and the target rendering instruction to optimize the rendering instruction.
[0115] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0118] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0119] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0120] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0121] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0122] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for processing a rendering instruction, characterized in that: include: Obtaining an original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces; Obtaining parameters corresponding to rendering instructions in the original rendering instruction sequence, and storing the parameters in association with the rendering instructions; Determining a target rendering instruction in the original rendering instruction sequence, obtaining rendering target content corresponding to the target rendering instruction, and storing the rendering target content and the target rendering instruction in association; Parameters associated with the rendering instruction are updated based on the render target content and the target rendering instruction to optimize the rendering instruction.
2. The method according to claim 1, characterized in that The determining of the target rendering instruction in the original rendering instruction sequence includes: If the type of the rendering instruction in the original rendering instruction sequence meets a preset type condition, the rendering instruction is determined as a target rendering instruction, wherein the preset type condition represents an instruction type that calls a graphics driver interface to update the content of a rendering target.
3. The method according to claim 1, characterized in that The obtaining of the rendering target content corresponding to the target rendering instruction includes: Adding a preset acquisition instruction to the original rendering instruction sequence to obtain a target rendering instruction sequence, and sending the target rendering instruction sequence to the target interface layer; Forwarding the target rendering instruction sequence to the corresponding graphics driver interface through the target interface layer; The rendering target is updated based on the target rendering instruction sequence through the graphics driver interface, and the rendering target content is acquired through the preset acquisition instruction.
4. The method according to claim 3, characterized in that The step of adding the preset acquisition instruction to the original rendering instruction sequence to obtain a target rendering instruction sequence includes: Determining, according to the position of the target rendering instruction in the original rendering instruction sequence, an adding position of a preset acquisition instruction corresponding to the target rendering instruction; The preset acquisition instruction is added to the original rendering instruction sequence according to the adding position to obtain a target rendering instruction sequence.
5. The method according to claim 1, characterized in that The acquisition engine layer sends an original rendering instruction sequence to the target interface layer, including: Obtaining a candidate rendering instruction sequence sent by the engine layer to the target interface layer; The rendering instructions in the candidate rendering instruction sequence are filtered according to a target instruction range to obtain an original rendering instruction sequence, wherein the target instruction range represents at least one instruction acquisition range corresponding to a rendering effect.
6. The method according to claim 5, characterized in that Methods for determining the target instruction range include: Acquire instruction range configuration information, and determine a target instruction range according to the instruction range configuration information.
7. The method according to claim 5, characterized in that The updating of parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction includes: Determining target rendering instructions to be optimized based on rendering target content whose rendering effect does not meet the preset effect; Determining a target rendering instruction group based on an instruction acquisition range corresponding to the target rendering instruction to be optimized; Parameters associated with the rendering instructions in the target rendering instruction group are updated to optimize the rendering instructions.
8. A rendering instruction processing device, characterized in that: include: An instruction acquisition module is used to acquire an original rendering instruction sequence sent by the engine layer to the target interface layer, wherein the target interface layer is used to shield the interface differences between different graphics driver interfaces and send corresponding rendering instructions to different graphics driver interfaces; a parameter acquisition module, configured to acquire parameters corresponding to rendering instructions in the original rendering instruction sequence, and associate and store the parameters with the rendering instructions; a content acquisition module, configured to determine a target rendering instruction in the original rendering instruction sequence, acquire rendering target content corresponding to the target rendering instruction, and associate and store the rendering target content with the target rendering instruction; An instruction optimization module is used to update parameters associated with the rendering instruction based on the rendering target content and the target rendering instruction to optimize the rendering instruction.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the rendering instruction method according to any one of claims 1 to 7.
10. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the rendering instruction method according to any one of claims 1 to 7.
