Distributed rendering method and apparatus
By splitting the set of rendering instructions into subsets and executing them on different devices, the low real-time performance caused by serial processing of rendering tasks in existing technologies is solved, achieving more efficient distributed rendering.
Patent Information
- Application Number
- CN202110430082.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-21
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-04-21
AI Technical Summary
In existing distributed rendering technologies, the serial processing of rendering tasks results in low real-time performance and makes it impossible to achieve higher rendering efficiency.
The rendering instruction set is split into multiple rendering instruction subsets and sent to different devices for processing. Distributed rendering is performed by taking advantage of the differences in rendering capabilities of the devices, ensuring that the execution state on which the rendering instruction subsets depend is processed on the same device.
It improves rendering efficiency and real-time performance, avoids errors in the execution of rendering instructions, and achieves more efficient distributed rendering.
Smart Images

Figure CN115222869B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a distributed rendering method and apparatus. Background Technology
[0002] With the development of communication technology, cloud technology is increasingly supported. For example, cloud gaming, based on cloud computing technology, allows games to run on remote servers. End users don't need to download or install anything, nor do they need to consider their device configuration; they can play large-scale games as long as they have an internet connection. Similarly, there are cloud phones. Cloud gaming and cloud phones are both scenarios involving heavy rendering, which involves corresponding rendering technologies.
[0003] Rendering refers to the process of generating images from models. A model is a rigorously defined description of a 3D object or virtual scene using a language or data structure, including information such as geometry, viewpoint, texture, lighting, and shadows. Traditional rendering techniques include Virtual Network Computing (VNC), where all rendering tasks are completed and compressed in the cloud, then decompressed and displayed on the device (video compression). This cloud-based approach only utilizes the video decoding capabilities of the device, not its rendering capabilities. However, many cloud-based clients still run on common platforms (such as mobile phones, PCs, and tablets), and these devices still possess considerable rendering capabilities. Utilizing this edge computing power can reduce the demand for cloud-side rendering computational power. To achieve this, rendering tasks can be divided and executed on both ends, then merged to implement distributed rendering technology.
[0004] This distributed rendering technology typically divides rendering tasks into multiple time-series tasks, and then assigns the rendering tasks within each time-series to various nodes to achieve distributed processing. However, this distributed processing method still involves serial processing of the rendering tasks within each time-series by a single cloud or edge device, resulting in low real-time performance and failing to achieve higher distributed rendering efficiency. Summary of the Invention
[0005] This application provides a distributed rendering method and apparatus, which splits the rendering instruction set of each image into multiple rendering instruction subsets and sends the rendering instruction subsets to different devices for processing, thereby achieving more efficient distributed rendering and improving rendering real-time performance.
[0006] A first aspect provides a distributed rendering method, the method comprising: acquiring a set of rendering instructions for rendering a first image, the set of rendering instructions including multiple rendering instructions, each rendering instruction including instructions and parameters for performing rendering, or further including rendering preparation instructions; performing empty rendering on some or all of the rendering instructions in the set of rendering instructions to obtain the execution states corresponding to some or all of the rendering instructions; wherein, empty rendering refers to only obtaining changes in the execution states of the rendering instructions without performing actual rendering; sending the execution states of a second subset of rendering instructions and a first subset of rendering instructions to a first device; wherein, the set of rendering instructions includes a first subset of rendering instructions and a second subset of rendering instructions, the first subset of rendering instructions and the second subset of rendering instructions each including one or more rendering instructions, the execution of the first subset of rendering instructions depending on the execution state of the second subset of rendering instructions; the first device executing one or more rendering instructions in the first subset of rendering instructions according to the execution state of the second subset of rendering instructions; and sending the second subset of rendering instructions to a second device, the second device executing the second subset of rendering instructions.
[0007] In this embodiment, the rendering instruction set of the first image is divided into subsets to obtain rendering instructions. The execution states of these subsets, along with the execution states of other rendering instruction subsets they depend on, are then sent to the same device for execution. This allows the device to execute the rendering instructions within the subset and obtain the corresponding rendering results. During this process, different subsets of rendering instructions are executed on different devices, achieving distributed rendering of the first image and improving the efficiency and real-time performance of image rendering. Distributing the execution states of other rendering instruction subsets to the same device also helps prevent errors from occurring during the execution of rendering instructions.
[0008] In this application, "rendering instruction" can refer to any instruction used to perform rendering (including parameters if applicable). Some rendering instructions also include rendering preparation instructions for preparing for rendering. The aforementioned "set of rendering instructions for rendering the first image" can refer to instructions that simply perform rendering, or it can refer to such rendering instructions that include rendering preparation instructions. In this application, the rendering result of a rendering instruction can be considered as a layer of the first image.
[0009] The method provided in the first aspect can be executed by a first device, a second device, or another third device. When the execution subject is a second device, sending the second subset of rendering instructions to the second device means that the module performing this step sends the second subset of rendering instructions to the rendering module (e.g., GPU) of the second device for rendering.
[0010] In one possible example, performing empty rendering on some or all of the rendering instructions in the rendering instruction set to obtain the execution state corresponding to some or all of the rendering instructions includes: inputting some or all of the rendering instructions in the rendering instruction set into a state machine, and having the state machine execute some or all of the rendering instructions; determining the set of global parameter values in the context of a rendering instruction as the execution state of the rendering instruction when the state machine has completed the execution of a rendering instruction.
[0011] In one possible example, when the second subset of rendering instructions includes a single rendering instruction, the execution state of the second subset of rendering instructions is the execution state of the rendering instruction; when the second subset of rendering instructions includes multiple sequentially executed rendering instructions, the execution state of the second subset of rendering instructions is the execution state of the last rendering instruction executed among the multiple rendering instructions.
[0012] In one possible example, the rendering instruction subset is divided according to the rendering capabilities of the device, which includes a first device and a second device. The rendering instruction subset includes a first rendering instruction subset and a second rendering instruction subset. The rendering capability is proportional to the efficiency of the device in executing the rendering tasks in the rendering instructions.
[0013] In this embodiment of the application, the rendering instruction subset is divided according to the rendering capability of the device, so that the rendering instruction subsets sent to different devices can complete the execution of one or more rendering instructions in the rendering instruction subset in similar or even the same time, thereby further ensuring the efficiency of distributed rendering.
[0014] In one possible example, before the first device executes one or more rendering instructions in the first rendering instruction subset according to the execution status of the second rendering instruction subset, and before the second device executes the second rendering instruction subset, the method further includes: obtaining resource creation instructions and / or resource destruction instructions for the first image, wherein the resource creation instructions are used to create parameters and the resource destruction instructions are used to destroy the parameters created by the resource creation instructions; and distributing the resource creation instructions and / or resource destruction instructions to the first device and the second device.
[0015] In one possible example, before distributing resource creation instructions and / or resource destruction instructions to the first device and the second device, the method further includes: determining that the execution of the first rendering instructions and the second rendering instructions is dependent on the parameters created by the resource creation instructions.
[0016] In one possible example, the method further includes: obtaining a first rendering result from a first device, the first rendering result being the result of the first device executing a subset of first rendering instructions; and / or obtaining a second rendering result from a second device, the second rendering result being the result of the second device executing a subset of second rendering instructions; and combining the first rendering result and the second rendering result to obtain a rendering result of the first image.
[0017] In one possible example, the method further includes: instructing a first device to acquire a second rendering result from a second device, and instructing the first device to synthesize the first rendering result and the second rendering result; or instructing the second device to acquire a first rendering result from a first device, and instructing the second device to synthesize the first rendering result and the second rendering result, wherein the first rendering result is the result after the first device executes a subset of the first rendering instructions; and the second rendering result is the result after the second device executes a subset of the second rendering instructions.
[0018] In one possible example, compositing the first rendering result and the second rendering result includes: compositing the first rendering result and the second rendering result according to the execution order of the first and second subsets of rendering instructions when the rendering instruction set is executed serially.
[0019] In this embodiment of the application, the rendering instruction set of the first image is divided into a subset of rendering instructions, and the subset of rendering instructions is sent to different devices for distributed processing. Then, the rendering results obtained by each device are combined. During the combination process, the rendering instructions are executed in the order they were executed in a serial manner, which can ensure the accuracy of the combined rendering results.
[0020] Secondly, a distributed rendering apparatus is provided, the apparatus comprising:
[0021] The acquisition module is used to acquire a set of rendering instructions for rendering the first image. The set of rendering instructions includes multiple rendering instructions, which include instructions and parameters for executing the rendering, or may also include rendering preparation instructions.
[0022] The rendering module is used to perform empty rendering on some or all of the rendering instructions in the rendering instruction set in order to obtain the execution status of some or all of the rendering instructions; where empty rendering means only obtaining the changes in the execution status of the rendering instructions, without performing actual rendering.
[0023] A sending module is used to send the execution status of a second subset of rendering instructions and a first subset of rendering instructions to a first device; wherein the set of rendering instructions includes a first subset of rendering instructions and a second subset of rendering instructions, the first subset of rendering instructions and the second subset of rendering instructions each include one or more rendering instructions, and the execution of the first subset of rendering instructions depends on the execution status of the second subset of rendering instructions; the first device is used to execute one or more rendering instructions in the first subset of rendering instructions according to the execution status of the second subset of rendering instructions;
[0024] The sending module is also used to send a second subset of rendering instructions to a second device, which is used to execute the second subset of rendering instructions.
[0025] In one possible example, the rendering module is specifically used to: input some or all of the rendering instructions from the set of rendering instructions into the state machine, and have the state machine execute some or all of the rendering instructions; and determine the set of global parameter values in the context of the rendering instruction as the execution state of the rendering instruction when the state machine has completed the execution of a rendering instruction.
[0026] In one possible example, when the second subset of rendering instructions includes a single rendering instruction, the execution state of the second subset of rendering instructions is the execution state of the rendering instruction; when the second subset of rendering instructions includes multiple sequentially executed rendering instructions, the execution state of the second subset of rendering instructions is the execution state of the last rendering instruction executed among the multiple rendering instructions.
[0027] In one possible example, the rendering instruction subset is divided according to the rendering capabilities of the device, which includes a first device and a second device. The rendering instruction subset includes a first rendering instruction subset and a second rendering instruction subset. The rendering capability is proportional to the efficiency of the device in executing the rendering tasks in the rendering instructions.
[0028] In one possible example, the acquisition module is further configured to: acquire resource creation instructions and / or resource destruction instructions of the first image, wherein the resource creation instructions are used to create parameters and the resource destruction instructions are used to destroy the parameters created by the resource creation instructions; the sending module is further configured to: distribute the resource creation instructions and / or resource destruction instructions to the first device and the second device.
[0029] In one possible example, before distributing resource creation instructions and / or resource destruction instructions to the first device and the second device, the sending module is further configured to: determine whether the execution of the first rendering instructions and the second rendering instructions is dependent on the parameters created by the resource creation instructions.
[0030] In one possible example, the apparatus further includes a compositing module, specifically configured to: obtain a first rendering result from a first device, the first rendering result being the result of the first device executing a subset of first rendering instructions; and / or obtain a second rendering result from a second device, the second rendering result being the result of the second device executing a subset of second rendering instructions; and compose the first rendering result and the second rendering result to obtain a rendering result of the first image.
[0031] In one possible example, the device further includes an instruction module, specifically configured to: instruct the first device to acquire the second rendering result of the second device, and instruct the first device to synthesize the first rendering result and the second rendering result; or instruct the second device to acquire the first rendering result of the first device, and instruct the second device to synthesize the first rendering result and the second rendering result, wherein the first rendering result is the result after the first device executes a subset of the first rendering instructions; and the second rendering result is the result after the second device executes a subset of the second rendering instructions.
[0032] In one possible example, compositing the first rendering result and the second rendering result includes: compositing the first rendering result and the second rendering result according to the execution order of the first and second subsets of rendering instructions when the rendering instruction set is executed serially.
[0033] Thirdly, embodiments of this application provide an electronic device including a communication interface and a processor. The communication interface is used for communication between the device and other devices, such as distributing the execution status of a second rendering instruction and a pair of first rendering instructions to a first device. Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface, and the other devices may be network devices. The processor is used to invoke a set of programs, instructions, or data to execute the method described in the first aspect. The device may further include a memory for storing programs, instructions, or data invoked by the processor. The memory is coupled to the processor, and when the processor executes the instructions or data stored in the memory, it can implement the method described in the first aspect.
[0034] Fourthly, this application also provides an electronic device, characterized in that the communication device includes a processor, a transceiver, a memory, and computer-executable instructions stored in the memory and executable on the processor, wherein when the computer-executable instructions are executed, the electronic device performs the method as described in the first aspect or any possible implementation thereof.
[0035] Fifthly, this application also provides a computer-readable storage medium storing computer-readable instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect or any possible implementation thereof.
[0036] Sixthly, embodiments of this application provide a chip system, which includes a processor and may also include a memory, for implementing the methods in the first aspect or any possible implementation of the first aspect. The chip system may be composed of chips or may include chips and other discrete devices.
[0037] Optionally, the chip system may also include a transceiver.
[0038] In a seventh aspect, this application also provides a computer program product, including instructions that, when run on a computer, cause the computer to perform the method as described in the first aspect or any possible implementation thereof. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly described below.
[0040] Figure 1 A distributed rendering system architecture diagram provided in this application embodiment;
[0041] Figure 2A A flowchart of a distributed rendering method provided in an embodiment of this application;
[0042] Figure 2B A schematic diagram of a set of rendering instructions for a first image provided in an embodiment of this application;
[0043] Figure 2C This is a schematic diagram illustrating the expansion of rendering instructions provided in an embodiment of this application;
[0044] Figure 2D A schematic diagram illustrating a process for obtaining the execution status of a subset of rendering instructions, provided in an embodiment of this application;
[0045] Figure 2E A schematic diagram illustrating a subset of rendering instructions provided in an embodiment of this application;
[0046] Figure 2F This application provides a schematic diagram of the rendering instruction subset partitioning of a first device according to an embodiment of the present application.
[0047] Figure 2G A schematic diagram illustrating another subset of rendering instructions provided in an embodiment of this application;
[0048] Figure 2H A flowchart illustrating the rendering result of a synthesized first image provided in this application embodiment;
[0049] Figure 3A A structural block diagram of a distributed rendering device provided in an embodiment of this application;
[0050] Figure 3B Another distributed rendering device structure diagram provided in the embodiments of this application;
[0051] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0052] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to these processes, methods, products, or devices.
[0053] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0054] "Multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0055] First, the terminology and application scenarios that may be involved in the embodiments of this application will be introduced.
[0056] Rendering is the final step in computer graphics (CG) production; it's the process of generating images from software models. Specifically, it involves using a program to calculate the geometry, vertices, and other information of the graphics to be drawn, resulting in an image.
[0057] When performing rendering tasks, computer hardware can be divided into a central processing unit (CPU) and a graphics processing unit (GPU). Enabling rendering acceleration on the GPU can effectively improve rendering speed, thus enabling GPU rendering to handle computationally intensive applications.
[0058] This application provides a distributed rendering system architecture in its embodiments. Please refer to [link / reference]. Figure 1The system architecture includes a cloud-side server 100 and multiple terminal devices 110 forming an edge-side component. All servers and terminal devices can function as a distributed device, and both can execute rendering tasks. The server 100 consists of software and hardware modules. The software modules primarily comprise a distributed rendering library, specifically including an instruction grouping engine 101, an instruction parallelization module 102, a local rendering library 103, and a remote rendering library 104. The instruction grouping engine 101 groups rendering instructions according to certain instruction grouping rules; the instruction parallelization module 102 parallelizes the grouped rendering instructions; the local rendering library 103 executes rendering instructions on the cloud-side server to render images; and the remote rendering library 104 distributes rendering instructions to the edge-side for execution and can also retrieve the rendered results from the edge-side. The hardware modules may include a physical graphics card 105 and a network interface card (NIC) 106. The physical graphics card 105 can also be used to process image rendering instructions, and the NIC is used for communication between the cloud-side server and the edge-side, including distributing rendering instructions and retrieving rendering results. Cloud-based applications can complete all rendering tasks by calling a distributed rendering library.
[0059] The terminal device 110 on the endpoint may include a local rendering library 111 and a network interface card (NIC) 112. When the terminal device 110 receives a rendering command through the NIC 112, it completes the rendering task. The terminal device 110 may also include a physical graphics card 113 for processing image rendering commands.
[0060] The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0061] Please see Figure 2A , Figure 2A A flowchart of a distributed rendering method provided in an embodiment of this application is shown below. Figure 2A As shown, the method includes the following steps:
[0062] 201. Obtain a set of rendering instructions for rendering the first image. The set of rendering instructions includes multiple rendering instructions. Each rendering instruction includes instructions and parameters for performing rendering, or may also include rendering preparation instructions. In this embodiment, the rendering result of a rendering instruction is considered to correspond to one of the multiple layers of the first image.
[0063] The first image is a single frame corresponding to a model or animation. Since rendering a single frame often requires multiple rendering passes, the first image corresponds to a set of rendering instructions. This set includes multiple rendering instructions; for example, the set of rendering instructions for the first image might be {rendering instruction 1, rendering instruction 2, ..., rendering instruction n}. Each rendering instruction includes an instruction to perform the rendering, such as the glDraw instruction in the OpenGLes graphics library, which instructs the graphics processing unit (GPU) to perform the actual rendering work. The rendering instruction is often based on corresponding parameters, so each rendering instruction also includes parameters. Furthermore, before performing the rendering work, the rendering instruction often needs to perform rendering preparation; these preparation instructions are called rendering preparation instructions. In other words, each rendering instruction may also include rendering preparation instructions.
[0064] Specifically, the set of rendering instructions for the first image can be referred to Figure 2B , Figure 2B This is a schematic diagram of a set of rendering instructions for a first image provided in an embodiment of this application, such as... Figure 2B As shown, the rendering instructions included in this set are specifically the `glDrawArrays` and `glDrawElements` instructions, used to render images using different modes. Additionally, the set includes the `glclear` instruction to destroy resources created during previous image rendering processes. Correspondingly, the set may also include the `create` instruction to create parameters that may be used during the execution of rendering instructions. Figure 2B It also includes information such as geometry and vertices. For example, glDrawArrays 2261874vertices,4unique indices indicates that the rendering instruction on line 226187 of the code is executed, which corresponds to the number of vertices processed being 4, and the corresponding unique index is also 4.
[0065] Figure 2B The table below provides a list of rendering instructions for the first image (the ellipsis indicates that there are several more rendering instructions, not all of which are shown). In fact, before the rendering instructions, there are rendering preparation instructions; please refer to [link to relevant documentation]. Figure 2C ,like Figure 2C As shown, between two adjacent rendering instructions, there are also rendering preparation instructions, such as... Figure 2BIn the code, `glDrawAarrays 226175` and `glDrawArrays 226187` are two adjacent instructions that perform rendering. Lines 226176 to 226186 also contain other instructions, such as `glUniformMatrix4fv()`, which passes the value of a uniform variable (a variable modified by `uniform`) to the rendering pipeline; `glActiveTexture()`, which sets the active texture unit; and `glBindTexture()`, which binds the name of a texture to the target texture. These instructions all prepare for the rendering of `glDrawArrays 226187`, and are therefore called rendering preparation instructions.
[0066] Additionally, after the rendering instructions are expanded, such as glDrawArrays 226187 being expanded, as... Figure 2C As shown, `glDrawArrays(mode=GL_TRIANGLE_STRIP, first=0, count=4)` indicates that the drawing type is to draw triangles between every three vertices, starting from the 0th position in the array buffer, with a total of 4 vertices. The parameters in parentheses are those corresponding to the rendering instruction `glDrawArrays 226187`.
[0067] Therefore, a rendering instruction includes instructions to perform the rendering, and may also include corresponding parameters, rendering preparation instructions, etc., corresponding to... Figure 2C In the code, lines 226176 to 226187 contain a rendering instruction and its parameters. This single rendering instruction renders a layer, which can be referred to as the first layer.
[0068] Additionally, the rendering instruction set for the first image may be followed by eglSwapBuffer instructions, which typically indicate the end of a frame's rendering instructions. Therefore, the rendering instruction set for the first image can be divided based on eglSwapBuffer instructions.
[0069] 202. Perform empty rendering on some or all of the rendering instructions in the rendering instruction set to obtain the execution status of some or all of the rendering instructions; where empty rendering means only obtaining the changes in the execution status of the rendering instructions without performing actual rendering.
[0070] Typically, all rendering instructions in the rendering instruction set for the first image are executed serially. This allows for the sequential rendering of each layer of the first image, with each layer's rendering result being superimposed on the previous rendering results. This ensures that the desired rendering result is obtained after executing all rendering instructions. However, this serial execution method may suffer from low rendering efficiency and poor real-time performance due to limitations in device rendering capabilities. Executing multiple rendering instructions in the rendering instruction set for the first image in a distributed manner can improve rendering efficiency.
[0071] To achieve distributed execution of multiple rendering instructions in the rendering instruction set of the first image, the multiple rendering instructions are divided into multiple subsets. For example, if the aforementioned rendering instruction set is {rendering instruction 1, rendering instruction 2, ..., rendering instruction n}, it can be divided into multiple subsets, namely the first rendering instruction subset {rendering instruction 1} and the second rendering instruction subset {rendering instruction 2, ..., rendering instruction n}. Each subset can include one or more rendering instructions. Then, each rendering instruction subset is sent to different devices for execution. Finally, the rendering results obtained by the different devices from executing the rendering instruction subsets are combined to obtain the rendering result of the first image.
[0072] In the above process, since the rendering instructions in the rendering instruction set of the first image are executed serially, there may be dependencies between the preceding and following rendering instructions. For example, the execution state of a previous rendering instruction may be used to prepare the environment for the next rendering instruction. Therefore, when the rendering instructions in the rendering instruction set are split into different subsets of rendering instructions and sent to different devices for execution, the execution states of the previously executed subsets of rendering instructions that each subset depends on must also be sent to the device corresponding to that subset of rendering instructions so that the subset of rendering instructions can be executed correctly.
[0073] Specifically, in this embodiment, empty rendering is performed on all or part of the rendering instructions in the rendering instruction set of the first image. That is, for a rendering instruction (the instruction to execute rendering, the rendering preparation instruction, and the parameters), it is input into the state machine, and the state corresponding to the state machine of the rendering instruction is obtained (only the changes in the state of the rendering instruction are processed, without actual rendering), which is used as the execution state of the rendering instruction. In fact, by executing the rendering preparation instruction in the state set, the environment required for the final execution of the rendering instruction can be obtained. Therefore, the rendering preparation instruction can be actually executed. For the rendering instruction, such as the glDraw instruction, only the OpenGL state machine is used to determine the layer state corresponding to the parameters after rendering, without actually calling the glDraw instruction. Since the execution of the rendering preparation instruction consumes less computational resources, while the rendering instruction, which consumes more computational resources, is not actually executed, the empty rendering process is highly efficient on the central processing unit (CPU) and consumes little time.
[0074] Optionally, empty rendering can be performed on some or all of the rendering instructions in the rendering instruction set to obtain the execution state corresponding to some or all of the rendering instructions. This includes: inputting some or all of the rendering instructions in the rendering instruction set into the state machine, and having the state machine execute some or all of the rendering instructions; determining the set of global parameter values in the context of a rendering instruction as the execution state of the rendering instruction when the state machine has completed the execution of a rendering instruction.
[0075] The context of a rendering instruction refers to the external environment variables used during the execution of that instruction. After a blank rendering operation, the changed values of these external environment variables can be obtained. Local variables, since they are only used within the scope of the current rendering instruction, do not need to be recorded as part of the execution state. However, global parameter values may be used within the scope of the current rendering instruction and can also serve as external environment variables for other rendering instructions. Therefore, the set of all parameter values can be recorded as the execution state of the rendering instruction. Furthermore, the input state machine for blank rendering may contain all rendering instructions from the first image's rendering instruction set, or it may contain only a portion of them. In the former case, the execution state of all rendering instructions can be obtained, allowing for efficient access when the execution state of any rendering instruction is dependent on the execution of other rendering instructions. Alternatively, only the execution state of some rendering instructions can be obtained. These execution states are guaranteed to be accessed by other rendering instructions, thus reducing the processing cost associated with acquiring unaccessible execution states.
[0076] Optionally, when the second subset of rendering instructions includes one rendering instruction, the execution state of the second subset of rendering instructions is the execution state of the rendering instruction; when the second subset of rendering instructions includes multiple rendering instructions executed sequentially, the execution state of the second subset of rendering instructions is the execution state of the last rendering instruction executed among the multiple rendering instructions.
[0077] In other words, if a subset of rendering instructions includes a single rendering instruction, its execution state can be obtained by inputting that instruction into the state machine, and this execution state is used as the execution state for the subset. If a subset of rendering instructions includes multiple rendering instructions, all of these instructions can be input into the state machine, but the final result is the execution state of the last rendered instruction executed, which is used as the execution state for the subset. The execution states of the intermediate rendered instructions are treated as transparent states and are not output. This is because the multiple rendering instructions in a subset are executed sequentially, and the output execution state of the last executed instruction is actually the set of global parameter values after all rendering instructions in the subset have been executed. Therefore, it is not necessary to separately record the execution states of the other intermediate rendered instructions.
[0078] For details on obtaining the execution status of each subset of rendering instructions, please refer to [link / reference]. Figure 2D , Figure 2D This application provides a schematic diagram illustrating a process for obtaining the execution status of a subset of rendering instructions, as shown in the embodiments of this application. Figure 2D As shown, the process includes the following steps:
[0079] 220. Group the set of rendering instructions for the first image to obtain several subsets of rendering instructions;
[0080] 221. Obtain the last executed rendering instruction in each subset of rendering instructions and form an instruction set. All rendering instructions in this instruction set are critical nodes.
[0081] 222. Input all rendering instructions from the rendering instruction set of the first image into the empty rendering OpenGL state machine for execution in sequence;
[0082] 223. Determine whether the currently executed rendering instruction is a critical node;
[0083] 224. If so, record the state machine state of the key node.
[0084] The above process is the process of obtaining the execution status of the last executed rendering instruction in each subset of rendering instructions. Similarly, the process of grouping rendering instruction pairs to obtain several rendering instruction pairs can be replaced by grouping all rendering instructions of the first image to obtain several rendering instruction groups, and then recording the execution status of the last rendering instruction in each rendering instruction group.
[0085] As can be seen, in this embodiment of the application, by grouping the rendering instruction set of the first image, multiple rendering instruction subsets are obtained. Then, the execution state of the last executed rendering instruction in each rendering instruction subset is taken as the execution state of the rendering instruction set. This allows other devices that depend on some or all of the execution states of the rendering instructions in the rendering instruction subset to obtain the required execution state, thereby improving the efficiency of obtaining the dependent execution state.
[0086] 203. Send the execution status of the second rendering instruction subset and the first rendering instruction subset to the first device; wherein, the rendering instruction set includes the first rendering instruction subset and the second rendering instruction subset, the first rendering instruction subset and the second rendering instruction subset each include one or more rendering instructions, the execution of the first rendering instruction subset depends on the execution status of the second rendering instruction subset; the first device is used to execute one or more rendering instructions in the first rendering instruction subset according to the execution status of the second rendering instruction subset; send the second rendering instruction subset to the second device, the second device is used to execute the second rendering instruction subset.
[0087] As described above, in this embodiment, a distributed processing method is used to process multiple rendering instructions in the rendering instruction set of the first image. Specifically, multiple distributed devices are used to process the rendering instructions in each subset after the rendering instruction set is divided into subsets. In addition, each subset of rendering instructions may depend on the execution status of other subsets of rendering instructions. Therefore, it is necessary to send the execution status of the subset of rendering instructions and the other subsets of rendering instructions that it depends on to the same device for execution.
[0088] Assuming the subset of rendering instructions includes one rendering instruction, details on sending the subset of rendering instructions to the distributed device can be found in [link to documentation]. Figure 2E , Figure 2E This is a schematic diagram illustrating a subset of rendering instructions provided in an embodiment of this application, such as... Figure 2EAs shown, rendering instructions 1 to 3 correspond to rendering instruction subsets 1 to 3, respectively (each subset includes one rendering instruction). Empty rendering is performed on rendering instructions 1 to 3 to obtain the execution state of each instruction. Rendering instruction 2 depends on the execution state of rendering instruction 1, and rendering instruction 3 depends on both the execution states of rendering instruction 1 and rendering instruction 2. Therefore, the execution state of rendering instruction 1 and rendering instruction 2 can be sent to the first device, rendering instruction 1 can be sent to the second device, and the execution states of rendering instruction 1, rendering instruction 2, and rendering instruction 3 can be sent to the Xth device.
[0089] As can be seen, in this embodiment, by dividing the set of rendering instructions for the first image, one rendering instruction is obtained from each subset of rendering instructions. The execution status of each rendering instruction and its dependent rendering instructions are then sent to the corresponding distributed device, enabling the distributed device to execute the single rendering instruction and obtain the corresponding rendering result. During this process, each rendering instruction is executed on a separate device, achieving distributed rendering of the first image and improving the efficiency and real-time performance of image rendering. Furthermore, distributing the execution status of the other rendering instructions that each rendering instruction depends on to the same device together avoids errors during the execution of the rendering instructions.
[0090] In some cases, a subset of rendering instructions may include multiple rendering instructions, allowing a single distributed device to execute multiple rendering instructions from a subset. This enables more scientific and efficient distributed rendering when distributed devices are limited, individual rendering instructions consume little computational power, or individual devices have high rendering efficiency.
[0091] For details on the process of dividing the rendering instruction set of the first image into a subset of rendering instructions, please refer to [link / reference]. Figure 2F , Figure 2F This is a schematic diagram illustrating the partitioning of a rendering instruction subset for a first device according to an embodiment of this application, as shown below. Figure 2F As shown, the method includes:
[0092] 210. Determine if there are any first devices that have not yet been assigned rendering tasks;
[0093] 211. If so, obtain the first threshold of rendering instructions that the first device can receive, and initialize the subset of rendering instructions of the first device;
[0094] 212. Determine if there are any unassigned rendering instructions;
[0095] 213. If so, process each rendering instruction sequentially and add the first-ordered rendering instruction to the first device's rendering instruction subset.
[0096] 214. Determine whether the number of rendering instructions in the first device rendering instruction subset exceeds the first threshold;
[0097] 215. If the first threshold is exceeded, it is determined that the allocation of the subset of rendering instructions for the first device is complete. If the number of rendering instructions allocated to all distributed devices reaches their corresponding first threshold, the remaining rendering instructions can be allocated to the local server for execution.
[0098] As described above, the first device is divided into a subset of rendering instructions based on a first threshold of the rendering instructions it can receive. The first threshold can be determined based on the rendering capability of the first device or based on a comparison of the rendering capabilities of the first device with other distributed devices. For example, if the rendering capability of the i-th distributed device is twice that of the (i+1)-th distributed device among K distributed devices, then the first threshold of the i-th distributed device is twice the first threshold of the (i+1)-th distributed device.
[0099] In this embodiment, the rendering capability is related to and directly proportional to the efficiency of the device in executing the rendering tasks in the rendering instructions. Specifically, the rendering tasks in the rendering instructions include drawing triangles. The size of the rendering task corresponding to each rendering instruction may be different. If the rendering task corresponding to rendering instruction 1 is to draw 100 triangles, while the rendering task corresponding to rendering instruction 2 is to draw 10 triangles, and the first device executes rendering instruction 1 and the second device executes rendering instruction 2 in the same amount of time, it means that the first device is more efficient in executing the rendering task and has a stronger rendering capability.
[0100] When the subset of rendering instructions includes multiple rendering instructions, the specific process of sending the subset of rendering instructions to the distributed device can be found in [reference needed]. Figure 2G , Figure 2G A schematic diagram illustrating another subset of rendering instructions provided in an embodiment of this application, as shown below. Figure 2G As shown, rendering instruction 1 corresponds to rendering instruction subset 1, rendering instructions 2 and 3 correspond to rendering instruction subset 2, and rendering instruction 4 corresponds to rendering instruction subset 3. Empty rendering is performed on rendering instruction subsets 1 through 3 to obtain their corresponding execution states. Rendering instructions 2 and 3 are grouped into the same rendering instruction subset. During the execution of rendering instruction 3, the execution states of rendering instructions 1 and 2 are used. However, since the execution state of rendering instruction 2 is an intermediate execution state within this subset, the server does not record the execution state of rendering instruction 2 when performing empty rendering on this subset; it only records the execution state of rendering instruction 3. Therefore, when rendering instruction subset 2 (composed of rendering instructions 2 and 3) is sent to the second device, the execution state of rendering instruction 1, which they depend on, is also distributed to the second device, without needing to send the execution state of rendering instruction 2.
[0101] As can be seen, in this embodiment, by dividing the rendering instruction set of the first image into a subset of rendering instructions, with each subset including multiple rendering instructions, the execution state of the last executed rendering instruction in each subset is taken as the execution state of that subset. Then, the subset of rendering instructions and its dependent execution states are sent to a distributed device so that the distributed device can execute multiple rendering instructions within the subset. This process sends multiple rendering instructions to the same device for execution, reducing the number of devices required. Furthermore, by considering the rendering capabilities of the devices when dividing the rendering instructions into subsets, the efficiency of distributed rendering is guaranteed.
[0102] It should be noted that in step 203 above, the execution status of the second subset of rendering instructions and the first subset of rendering instructions are sent to the first device; the second subset of rendering instructions is sent to the second device. Both the first device and the second device are distributed devices, and the distributed devices may also include a third device, a fourth device, ..., an Xth device, etc. Furthermore, the execution subject in this embodiment can be the first device, the second device, or a third device other than the first and second devices. The first device, the second device, the third device..., the Xth device may all be a server or a terminal. If the execution subject in this embodiment is the first device (or the second device), after completing the division of the rendering instruction set of the first image and sending the second subset of rendering instructions to the second device, the first device will also send the execution status of the first subset of rendering instructions and the second subset of rendering instructions to its own rendering module (processor or local rendering library), which will then execute the rendering instructions to obtain the rendering result.
[0103] Optionally, before the first device executes one or more rendering instructions in the first rendering instruction subset according to the execution status of the second rendering instruction subset, and before the second device executes the second rendering instruction subset, the method further includes: obtaining resource creation instructions and / or resource destruction instructions for the first image, wherein the resource creation instructions are used to create parameters and the resource destruction instructions are used to destroy the parameters created by the resource creation instructions; and distributing the resource creation instructions and / or resource destruction instructions to the first device and the second device.
[0104] During the rendering process, resources such as vertex sets and index sets are created for use by subsequent commands. These created resources can also be destroyed to release the space they occupy. For example... Figure 2BIn the corresponding description, resource creation instructions include the `create` instruction, and resource destruction instructions include the `glclear` instruction. For a resource creation or destruction instruction within the scope of a rendering instruction (from the completion of the previous rendering instruction to the completion of this rendering instruction), when partitioning rendering instruction subsets, it can be placed in the same subset as the rendering instruction itself. The rendering instruction will then be aware that a resource has been created or destroyed during its execution. However, if a resource creation or destruction instruction is outside the scope of a rendering instruction, and the rendering instruction is partitioned to other distributed devices, it still needs to be aware of the created or destroyed resources. That is, resource creation and / or resource destruction instructions need to be specifically sent to the distributed device for execution along with the rendering instructions. For example, for... Figure 2B The resource destruction instruction glClear225797 is not within the scope of glDrawElements 226199. Before sending glDrawElements 226199 to the corresponding distributed device and executing the rendering instruction, glClear 225797 should also be sent to that distributed device so that glDrawElements 226199 can execute correctly. Alternatively, the glClear 225797 instruction can be added directly before glDrawElements 226199 and then sent together to the corresponding distributed device, which will then execute the instructions in sequence.
[0105] Optionally, before distributing the resource creation instruction and / or resource destruction instruction to the first device and the second device, the method further includes: determining that the execution of the first rendering instruction and the second rendering instruction is dependent on the parameters created by the resource creation instruction.
[0106] In other words, for rendering instructions that do not use parameters created by resource creation instructions, the creation or destruction of the corresponding parameter is not considered during the execution of the rendering instruction. Therefore, when sending such rendering instructions, irrelevant resource creation instructions and / or resource destruction instructions can be avoided.
[0107] After sending a subset of rendering instructions to the distributed devices, the first device executes the rendering instructions in the first subset of rendering instructions, the second device executes the rendering instructions in the second subset of rendering instructions, and the other devices execute the received rendering instructions accordingly, thereby completing the execution of all rendering instructions in the rendering instruction set of the first image.
[0108] However, after each distributed device completes the execution of a subset of rendering instructions, it can only obtain the rendering result corresponding to that subset of instructions. For example, the first device obtains the first rendering result, and the second device obtains the second rendering result. Finally, the rendering results obtained by each distributed device need to be combined to obtain the rendering result corresponding to the first image.
[0109] Specifically, please refer to Figure 2H , Figure 2H A flowchart of a synthetic first image rendering result provided in an embodiment of this application is shown below. Figure 2H As shown, the process includes the following steps:
[0110] 230. Send a subset of rendering instructions to a compositing device and other devices, wherein the compositing device may be a device that divides the set of rendering instructions into subsets of rendering instructions and distributes the subsets of rendering instructions, or other devices that receive subsets of rendering instructions;
[0111] 231. The compositing device executes the rendering instructions in the received subset of rendering instructions to obtain the corresponding rendering result. If the subset of rendering instructions includes one rendering instruction, the rendering result is a single-layer rendering result. If the subset of rendering instructions includes multiple rendering instructions, the rendering result is a multi-layer rendering result.
[0112] 232. Other devices execute the rendering instructions in the received subset of rendering instructions to obtain the corresponding rendering results;
[0113] 233. The compositing device receives rendering results sent by other devices;
[0114] 234. The compositing device combines its own rendering result with the received rendering result to obtain the rendering result of the first image.
[0115] In the above process, assuming the device distributing the subset of rendering instructions is a first device or a second device, and the first device or the second device also performs a compositing process of multiple rendering results (compositing device), then the first device or the second device can directly obtain the rendering results of the rendering instructions sent to other devices and compose them with the rendering results obtained by executing the rendering instructions itself. This is illustrated in steps 230-234 above. Step 231 can be executed before or after step 233; this embodiment does not impose any restrictions.
[0116] Assuming the device distributing the subset of rendering instructions is the third device, and the third device is a device that does not execute the rendering instructions in the subset of rendering instructions, then after the first device, the second device, and other distributed devices have completed the execution of the rendering instructions, the third device can instruct one of the distributed devices to act as a compositing device, obtain the rendering results of the other devices, and compose the rendering results obtained from the other devices and the rendering results obtained by itself from executing the rendering instructions to obtain the rendering result of the first image.
[0117] Alternatively, suppose a third device distributes a subset of rendering instructions, does not execute the rendering instructions in the subset, and acts as a compositing device to obtain the rendering results corresponding to the subset of rendering instructions from other distributed devices. Then, it combines multiple rendering results to obtain the rendering result of the first image.
[0118] The above process yields the rendering result of the first image. Furthermore, the compositing device needs to synthesize the rendering results in a specific order. For example, for the rendering of the first image, the rendering results corresponding to each subset of rendering instructions can be synthesized according to the order in which the rendering instruction set of the first image is executed serially. For instance, if the rendering instruction set is divided into a first subset and a second subset, and the rendering instructions in the first subset are executed before those in the second subset during serial execution, then the rendering result of the first image is synthesized in the order of the rendering results of the first subset first, followed by the rendering results of the second subset.
[0119] In the above process, the cloud-side server distributes the subset of rendering instructions. The server can proactively distribute rendering tasks to the client-side devices, or it can distribute rendering tasks based on requests from other terminal devices. Assuming the compositing device is the cloud server, the server obtains the rendering results of the subset of rendering instructions from other client-side devices, and then combines these rendering results with the rendering results corresponding to the subset of rendering instructions it executed (or it may not execute any rendering instructions, and all rendering results of the subset of rendering instructions are obtained from the client-side devices) to obtain the rendering result of the first image. The server then sends the rendered image or video to the client-side devices, which can be one of the distributed devices that performed distributed rendering, or other devices. Assuming the compositing device is the target device among the client-side devices, the server can instruct the target device among the client-side terminal devices to composite the rendering results of the subset of rendering instructions. After the target device completes the compositing, if the target device is the terminal device that obtains the rendered image or video, no further image or video transmission is required. If the target device is not the terminal device that obtains the rendered image or video, the target device sends the rendered image or video to the designated terminal device according to the server's instructions.
[0120] As can be seen, in this embodiment, the rendering instruction set of the first image is divided into multiple rendering instruction subsets, and each rendering instruction subset is sent to different distributed devices for distributed processing to obtain the rendering result corresponding to each rendering instruction subset. These rendering results are then synthesized. During the synthesis process, the rendering instructions in the first image's rendering instruction set are executed in the same order as when they were executed serially, ensuring the accuracy of the synthesized rendering result. Furthermore, the synthesis process can be executed on a server to utilize its efficient data processing capabilities. Alternatively, the synthesis process can be executed on the client side that needs to obtain the first image rendering result, reducing the transmission process of the first image rendering result and improving the efficiency of the client in obtaining the first image rendering result.
[0121] Figure 3A A distributed rendering apparatus 300 provided in this application embodiment can be used to perform the above-described... Figures 2A to 2G Distributed rendering apparatus and specific embodiments. In one possible implementation, such as Figure 3A As shown, the device 300 includes an acquisition module 301, a rendering module 302, and a sending module 303.
[0122] The acquisition module 301 is used to acquire a set of rendering instructions for rendering the first image. The set of rendering instructions includes multiple rendering instructions. Each rendering instruction includes instructions and parameters for executing rendering, or may also include rendering preparation instructions. The rendering instructions are used to render the first layer among multiple layers of the first image.
[0123] The rendering module 302 is used to perform empty rendering on some or all of the rendering instructions in the rendering instruction set to obtain the execution status of some or all of the rendering instructions; where empty rendering means only obtaining the changes in the execution status of the rendering instructions, without performing actual rendering.
[0124] The sending module 303 is used to send the execution status of the second rendering instruction subset and the first rendering instruction subset to the first device; wherein, the rendering instruction set includes the first rendering instruction subset and the second rendering instruction subset, the first rendering instruction subset and the second rendering instruction subset each include one or more rendering instructions, and the execution of the first rendering instruction subset depends on the execution status of the second rendering instruction subset; the first device is used to execute one or more rendering instructions in the first rendering instruction subset according to the execution status of the second rendering instruction subset;
[0125] The sending module 303 is also used to send a second subset of rendering instructions to a second device, which is used to execute the second subset of rendering instructions.
[0126] Optionally, the rendering module 302 is specifically used to: input some or all of the rendering instructions from the set of rendering instructions into the state machine, and have the state machine execute some or all of the rendering instructions; and determine the set of global parameter values in the context of the rendering instruction as the execution state of the rendering instruction when the state machine has completed the execution of a rendering instruction.
[0127] Optionally, when the second subset of rendering instructions includes one rendering instruction, the execution state of the second subset of rendering instructions is the execution state of the rendering instruction; when the second subset of rendering instructions includes multiple rendering instructions executed sequentially, the execution state of the second subset of rendering instructions is the execution state of the last rendering instruction executed among the multiple rendering instructions.
[0128] Optionally, the rendering instruction subset is divided according to the rendering capability of the device. The device includes a first device and a second device, and the rendering instruction subset includes a first rendering instruction subset and a second rendering instruction subset. The rendering capability is proportional to the efficiency of the device in executing the rendering tasks in the rendering instructions.
[0129] Optionally, the acquisition module 301 is further configured to: acquire a resource creation instruction and / or a resource destruction instruction of the first image, wherein the resource creation instruction is used to create parameters and the resource destruction instruction is used to destroy the parameters created by the resource creation instruction; the sending module is further configured to: distribute the resource creation instruction and / or the resource destruction instruction to the first device and the second device.
[0130] Optionally, before distributing the resource creation instruction and / or resource destruction instruction to the first device and the second device, the sending module 303 is further configured to: determine whether the execution of the first rendering instruction and the second rendering instruction is dependent on the parameters created by the resource creation instruction.
[0131] Optionally, such as Figure 3A As shown, the device 300 also includes a compositing module 304, specifically used for: obtaining a first rendering result from a first device, the first rendering result being the result after the first device executes a subset of the first rendering instructions; and / or obtaining a second rendering result from a second device, the second rendering result being the result after the second device executes a subset of the second rendering instructions; and compositing the first rendering result and the second rendering result to obtain a rendering result of the first image.
[0132] Optionally, such as Figure 3B As shown, the device 300 also includes an instruction module 305, specifically used for: instructing the first device to obtain the second rendering result of the second device, and instructing the first device to synthesize the first rendering result and the second rendering result; or instructing the second device to obtain the first rendering result of the first device, and instructing the second device to synthesize the first rendering result and the second rendering result, wherein the first rendering result is the result after the first device executes a subset of the first rendering instructions; and the second rendering result is the result after the second device executes a subset of the second rendering instructions.
[0133] Optionally, the compositing module 304 is specifically used to: compose the first rendering result and the second rendering result according to the execution order of the first and second subsets of rendering instructions when the rendering instruction set is executed serially.
[0134] Optionally, the above-mentioned acquisition module 301, rendering module 302, and sending module 303, wherein the rendering module 302 may be a central processing unit (CPU), or a graphics processing unit (GPU), or a combination of CPU and GPU, which can be used for image rendering. This application does not impose specific limitations.
[0135] Optionally, the distributed rendering apparatus 300 may also include interface circuitry or a transceiver for acquiring data or receiving instructions from other electronic devices, or sending data or instructions to other electronic devices. For example, the above-described process of distributing rendering instructions may send the execution status of a first rendering instruction and a second rendering instruction to the first device.
[0136] Optionally, the distributed rendering apparatus 300 may further include a storage module (not shown in the figure), which can be used to store data and / or signaling. The storage module may be coupled to the acquisition module 301, the rendering module 302, and the sending module 303. For example, the acquisition module 301 may be used to read data and / or signaling from the storage module, so that the empty rendering process of the rendering instructions in the foregoing method embodiments is executed.
[0137] like Figure 4 As shown, Figure 4 A schematic diagram of the hardware structure of an electronic device according to an embodiment of this application is shown. The structure of the distributed rendering device 300 can be referenced. Figure 4 The structure shown is that of an electronic device 800, which includes a memory 801, a processor 802, a communication interface 803, a bus 804, and a graphics card 805. The memory 801, processor 802, communication interface 803, and graphics card 805 are interconnected via the bus 804.
[0138] The memory 801 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 801 may store a program. When the program stored in the memory 801 is executed by the processor 802, the processor 802 and the communication interface 803 are used to execute the various steps of the distributed rendering method of the embodiments of this application.
[0139] The processor 802 may be a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), GPU, or one or more integrated circuits, used to execute related programs to implement the functions required by the acquisition module 301, rendering module 302, and sending module 303 in the distributed rendering apparatus 300 of this application embodiment, or to execute the distributed rendering method of this application method embodiment.
[0140] The processor 802 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the distributed rendering method of this application can be completed by the integrated logic circuits in the hardware of the processor 802 or by instructions in software form. The aforementioned processor 802 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 801. The processor 802 reads the information in the memory 801 and, in conjunction with its hardware, performs the functions required by the modules included in the distributed rendering apparatus 300 of this application embodiment, or executes the distributed rendering method of this application method embodiment.
[0141] The communication interface 803 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the electronic device 800 and other devices or communication networks. For example, the communication interface 803 can be used to obtain defined segmentation targets and / or candidate target bounding boxes. The bus 804 may include pathways for transmitting information between various components of the electronic device 800 (e.g., memory 801, processor 802, communication interface 803).
[0142] The physical graphics card 805 is used to process rendering instructions.
[0143] It should be noted that, although Figure 4The illustrated electronic device 800 only shows the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, the electronic device 800 may also include other components necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the electronic device 800 may also include hardware components for implementing other additional functions. Moreover, those skilled in the art should understand that the electronic device 800 may only include the components necessary for implementing the embodiments of this application, and may not necessarily include... Figure 4 All the devices shown.
[0144] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0145] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0146] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0147] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0148] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0149] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0150] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A distributed rendering method, characterized in that, The method includes: Obtain a set of rendering instructions for rendering a first image, the set of rendering instructions including multiple rendering instructions, the rendering instructions being instructions for performing rendering, or the rendering instructions including instructions for performing rendering and rendering preparation instructions for preparing for rendering; Perform empty rendering on some or all of the rendering instructions in the set of rendering instructions to obtain the execution status corresponding to the some or all of the rendering instructions; wherein, empty rendering means only obtaining the change in the execution status of the rendering instructions, without performing actual rendering. The execution status of the second subset of rendering instructions and the first subset of rendering instructions are sent to the first device; wherein the set of rendering instructions includes the first subset of rendering instructions and the second subset of rendering instructions, the first subset of rendering instructions and the second subset of rendering instructions each include one or more rendering instructions, and the execution of the first subset of rendering instructions depends on the execution status of the second subset of rendering instructions; the first device is used to execute the one or more rendering instructions in the first subset of rendering instructions according to the execution status of the second subset of rendering instructions; wherein when the second subset of rendering instructions includes one rendering instruction, the execution status of the second subset of rendering instructions is the execution status of the rendering instruction; when the second subset of rendering instructions includes multiple sequentially executed rendering instructions, the execution status of the second subset of rendering instructions is the execution status of the last rendering instruction executed among the multiple rendering instructions; The second subset of rendering instructions is sent to the second device, which is used to execute the second subset of rendering instructions.
2. The method according to claim 1, characterized in that, The step of performing empty rendering on some or all of the rendering instructions in the rendering instruction set to obtain the execution status corresponding to the some or all rendering instructions includes: By inputting some or all of the rendering instructions from the set of rendering instructions into the state machine, the state machine executes some or all of the rendering instructions. When a rendering instruction is completed by the state machine, the set of global parameter values in the context of the rendering instruction serves as the execution state of the rendering instruction.
3. The method according to claim 1 or 2, characterized in that, The rendering instruction subset is divided according to the rendering capabilities of the device. The device includes the first device and the second device. The rendering instruction subset includes the first rendering instruction subset and the second rendering instruction subset. The rendering capability is proportional to the efficiency of the device in executing the rendering tasks in the rendering instructions.
4. The method according to claim 1 or 2, characterized in that, Before the first device executes one or more rendering instructions in the first rendering instruction subset according to the execution state of the second rendering instruction subset, and before the second device executes the second rendering instruction subset, the method further includes: Obtain the resource creation instruction and / or resource destruction instruction of the first image, wherein the resource creation instruction is used to create parameters, and the resource destruction instruction is used to destroy the parameters created by the resource creation instruction; Send the resource creation command and / or resource destruction command to the first device and the second device.
5. The method according to claim 4, characterized in that, Before distributing the resource creation instruction and / or resource destruction instruction to the first device and the second device, the method further includes: It is determined that the execution of the first rendering instruction and the second rendering instruction are dependent on the parameters created by the resource creation instruction.
6. The method according to claim 1, characterized in that, The method further includes: Obtain a first rendering result from the first device, wherein the first rendering result is the result of the first device executing a subset of the first rendering instructions; and / or A second rendering result is obtained from the second device, wherein the second rendering result is the result after the second device executes the subset of the second rendering instructions; The first rendering result is obtained by combining the first rendering result with the second rendering result.
7. The method according to claim 1, characterized in that, The method further includes: Instruct the first device to acquire the second rendering result from the second device, and instruct the first device to synthesize the first rendering result and the second rendering result; or The device is instructed to acquire the first rendering result of the first device, and to synthesize the first rendering result and the second rendering result, wherein the first rendering result is the result of the first device executing a subset of the first rendering instructions; and the second rendering result is the result of the second device executing a subset of the second rendering instructions.
8. The method according to claim 6 or 7, characterized in that, The synthesis of the first rendering result and the second rendering result includes: synthesizing the first rendering result and the second rendering result according to the execution order of the first rendering instruction subset and the second rendering instruction subset when the rendering instruction set is executed in a serial manner.
9. A distributed rendering device, characterized in that, The device includes: The acquisition module is used to acquire a set of rendering instructions for rendering a first image. The set of rendering instructions includes multiple rendering instructions, which are instructions for performing rendering, or the rendering instructions include instructions for performing rendering and rendering preparation instructions for preparing for rendering. The rendering module is used to perform empty rendering on some or all of the rendering instructions in the rendering instruction set to obtain the execution status corresponding to the some or all of the rendering instructions; wherein, the empty rendering refers to only obtaining the changes in the execution status of the rendering instructions without performing actual rendering. A sending module is configured to send the execution status of a second subset of rendering instructions and a first subset of rendering instructions to a first device; wherein the set of rendering instructions includes the first subset of rendering instructions and the second subset of rendering instructions, the first subset of rendering instructions and the second subset of rendering instructions each include one or more rendering instructions, and the execution of the first subset of rendering instructions depends on the execution status of the second subset of rendering instructions; the first device is configured to execute the one or more rendering instructions in the first subset of rendering instructions according to the execution status of the second subset of rendering instructions; wherein when the second subset of rendering instructions includes one rendering instruction, the execution status of the second subset of rendering instructions is the execution status of the rendering instruction; when the second subset of rendering instructions includes multiple sequentially executed rendering instructions, the execution status of the second subset of rendering instructions is the execution status of the last rendering instruction executed among the multiple rendering instructions; The sending module is further configured to send the second subset of rendering instructions to the second device, and the second device is configured to execute the second subset of rendering instructions.
10. The apparatus according to claim 9, characterized in that, The rendering module is specifically used for: By inputting some or all of the rendering instructions from the set of rendering instructions into the state machine, the state machine executes some or all of the rendering instructions. When a rendering instruction is completed by the state machine, the set of global parameter values in the context of the rendering instruction serves as the execution state of the rendering instruction.
11. The apparatus according to claim 9 or 10, characterized in that, The rendering instruction subset is divided according to the rendering capabilities of the device. The device includes the first device and the second device. The rendering instruction subset includes the first rendering instruction subset and the second rendering instruction subset. The rendering capability is proportional to the efficiency of the device in executing the rendering tasks in the rendering instructions.
12. The apparatus according to claim 9 or 10, characterized in that, The acquisition module is also used for: Obtain the resource creation instruction and / or resource destruction instruction of the first image, wherein the resource creation instruction is used to create parameters, and the resource destruction instruction is used to destroy the parameters created by the resource creation instruction; The sending module is further configured to: distribute the resource creation instruction and / or resource destruction instruction to the first device and the second device.
13. The apparatus according to claim 12, characterized in that, Before distributing the resource creation instruction and / or resource destruction instruction to the first device and the second device, the sending module is further configured to: It is determined that the execution of the first rendering instruction and the second rendering instruction are dependent on the parameters created by the resource creation instruction.
14. The apparatus according to claim 9, characterized in that, The device further includes a synthesis module, specifically used for: A first rendering result is obtained from the first device, wherein the first rendering result is the result of the first device executing the first subset of rendering instructions; and / or A second rendering result is obtained from the second device, wherein the second rendering result is the result after the second device executes the subset of the second rendering instructions; The first rendering result is obtained by combining the first rendering result with the second rendering result.
15. The apparatus according to claim 9, characterized in that, The device further includes an indication module, specifically used for: The first device is instructed to acquire the second rendering result from the second device, and the first device is instructed to synthesize the first rendering result and the second rendering result. or The second device is instructed to acquire the first rendering result of the first device, and the second device is instructed to synthesize the first rendering result and the second rendering result, wherein the first rendering result is the result of the first device executing the subset of the first rendering instructions; The second rendering result is the result after the second device executes the subset of the second rendering instructions.
16. The apparatus according to claim 14 or 15, characterized in that, The synthesis of the first rendering result and the second rendering result includes: synthesizing the first rendering result and the second rendering result according to the execution order of the first rendering instruction subset and the second rendering instruction subset when the rendering instruction set is executed in a serial manner.
17. An electronic device, characterized in that, The electronic device includes a processor, a transceiver, a memory, and computer-executable instructions stored in the memory and executable on the processor, which, when executed, cause the electronic device to perform the method as described in any one of claims 1 to 8.
18. A computer program product comprising instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 8.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a communication device, cause the communication device to perform the method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Image remote projection method and related device
CN104618733A
GUI rendering display method, terminal, server, electronic equipment and storage medium
CN112614202A