CN105843603B - The method and device of graphics process - Google Patents

The method and device of graphics process Download PDF

Info

Publication number
CN105843603B
CN105843603B CN201610153078.6A CN201610153078A CN105843603B CN 105843603 B CN105843603 B CN 105843603B CN 201610153078 A CN201610153078 A CN 201610153078A CN 105843603 B CN105843603 B CN 105843603B
Authority
CN
China
Prior art keywords
program
leaf node
source code
status data
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201610153078.6A
Other languages
Chinese (zh)
Other versions
CN105843603A (en
Inventor
林作健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Guangzhou I9Game Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou I9Game Information Technology Co Ltd filed Critical Guangzhou I9Game Information Technology Co Ltd
Priority to CN201610153078.6A priority Critical patent/CN105843603B/en
Publication of CN105843603A publication Critical patent/CN105843603A/en
Application granted granted Critical
Publication of CN105843603B publication Critical patent/CN105843603B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a kind of method and devices of graphics process, are related to Internet technical field, are able to solve the lower problem of figure rendering efficiency.Method of the invention specifically includes that after receiving rendering order, obtains the status data carried in rendering order, status data is for describing initiate mode corresponding to the different renderer properties of figure to be rendered;Preset decision tree is traversed according to status data, wherein from the second node layer of decision tree, every node layer represents a kind of two states whether renderer property enables;When traversing leaf node, corresponding program object is obtained from leaf node, program object is the program for meeting combinations of states condition defined by traverse path, and program object includes compiled vertex program and compiled fragment program;Program object is sent to video card, so that video card is based on programmable rendering pipeline processing routine object, realizes figure rendering.The present invention is mainly suitable in the scene based on OpenGL ES rendering figure.

Description

The method and device of graphics process
Technical field
The present invention relates to Internet technical fields, more particularly to a kind of method and device of graphics process.
Background technique
OpenGL ES (Open Graphics Library for Embedded Systems, the open figure of embedded system Shape library) it is one embedded for mobile phone, PAD (Personal Digital Assistant, palm PC), game host etc. Equipment and the graph API designed.With the development of internet technology, OpenGL ES is gradually by fixed rendering pipeline Development is programmable rendering pipeline, i.e., developing from the mode that processing is fixed in opposite vertexes, piece member can for opposite vertexes, the progress of piece member The mode of programmed process, to improve the flexibility of graphics process.
In practical applications, although the video card based on programmable rendering pipeline is gradually replaced based on the aobvious of fixed rendering pipeline Card is widely used in equipment, but there are still some popular application programs to carry out figure by the way of fixed rendering pipeline Processing.Therefore, these are subjected to the application program of graphics process based on programmable rendering pipeline using fixed rendering pipeline When running in equipment, there can be incompatibility problem.
To solve incompatibility problem, existing processing mode are as follows: and application program (i.e. OpenGL ES client, hereinafter referred to as Client) every time to OpenGL ES server (hereinafter referred to as server) send glDraw* order when, can be by current client End state and server state are sent to server, wherein the client and server are the computer journey solidified in a device Sequence.After server receives glDraw* order, an AST is first generated according to current client state and server state (Abstract Syntax Tree, abstract syntax tree) tree, then generates corresponding vertex program and piece member journey according to the AST tree Sequence, and the vertex program and fragment program of generation are compiled, the program object that compiling obtains finally is sent to video card, with Just video card renders the correspondence figure in client based on programmable rendering pipeline.It follows that above scheme passes through root AST tree is generated according to client state and server state, and simultaneously compiler is generated based on the AST tree, obtains programmable wash with watercolours Vertex program and fragment program needed for contaminating pipeline, to solve the incompatible of fixed rendering pipeline and programmable rendering pipeline Problem.
However, general longer by the time-consuming that AST tree generates simultaneously compiler, it will usually more than 10ms, thus lead to figure The efficiency of shape rendering substantially reduces.
Summary of the invention
In view of this, the present invention provides a kind of method and device of graphics process, it is able to solve following problems: based on can When running the application program after fixed rendering pipeline rendering in the equipment of programming rendering pipeline, it is required to give birth to due to rendering every time Simultaneously compiler is generated at AST tree, and by AST tree, vertex program needed for just can get programmable rendering pipeline and piece member Program, so whole process takes a long time, the efficiency so as to cause figure rendering is substantially reduced.
According to the present invention on one side, a kind of method of graphics process is provided, which comprises
After receiving rendering order, the status data carried in the rendering order is obtained, the status data is used for Initiate mode corresponding to the different renderer properties of figure to be rendered is described;
Preset decision tree is traversed according to the status data, wherein from the second node layer of the decision tree, every layer The two states whether a kind of renderer property of node on behalf enables;
When traversing leaf node, corresponding program object is obtained from the leaf node, described program object is Meet the program of combinations of states condition defined by traverse path, and described program object includes compiled vertex program and The fragment program of compiling;
Described program object is sent to video card, handles described program pair so that the video card is based on programmable rendering pipeline As realizing figure rendering.
According to the present invention on the other hand, a kind of device of graphics process is provided, described device includes:
Acquiring unit, it is described for after receiving rendering order, obtaining the status data carried in the rendering order Status data is for describing initiate mode corresponding to the different renderer properties of figure to be rendered;
Traversal Unit, the status data for being obtained according to the acquiring unit traverse preset decision tree, wherein From the second node layer of the decision tree, every node layer represents a kind of two states whether renderer property enables;
The acquiring unit is also used to obtain from the leaf node when the Traversal Unit traverses leaf node Corresponding program object is taken, described program object is the program for meeting combinations of states condition defined by traverse path, and described Program object includes compiled vertex program and compiled fragment program;
Transmission unit, the described program object for obtaining the acquiring unit is sent to video card, so as to the video card Described program object is handled based on programmable rendering pipeline, realizes figure rendering.
By above-mentioned technical proposal, the method and device of graphics process provided by the invention can receive client After the rendering order of transmission, server first obtains the status data carried in rendering order, is then traversed according to the status data Preset decision tree, and by leaf node being obtained, finally from the leaf node with after the matched traverse path of status data It is middle to obtain corresponding program object (i.e. compiled vertex program and compiled fragment program), and the program object is sent To video card, the program object is handled so that video card is based on programmable rendering pipeline, realizes figure rendering.It follows that of the invention In each rendering, server only needs to traverse preset decision tree by the status data in rendering order, and from time Program object needed for directly acquiring programmable rendering pipeline in the leaf node gone through, it is a large amount of without spending every time Time generates AST tree, and generates simultaneously compiler based on AST tree, to improve the efficiency of figure rendering.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of flow chart of the method for graphics process provided in an embodiment of the present invention;
Fig. 2 shows a kind of structural schematic diagrams of decision tree provided in an embodiment of the present invention;
Fig. 3 shows the flow chart of the method for another graphics process provided in an embodiment of the present invention;
Fig. 4 shows a kind of composition block diagram of the device of graphics process provided in an embodiment of the present invention;
Fig. 5 shows the composition block diagram of the device of another graphics process provided in an embodiment of the present invention;
Fig. 6 shows the composition block diagram of the device of another graphics process provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
To solve to run in the equipment based on programmable rendering pipeline in the prior art after fixed rendering pipeline rendering Application program when, the lower problem of figure rendering efficiency, the embodiment of the invention provides a kind of method of graphics process, the party Method is mainly used in OpenGL ES server side, as shown in Figure 1, this method specifically includes that
101, after receiving rendering order, the status data carried in rendering order is obtained.
Wherein, status data is for describing initiate mode corresponding to the different renderer properties of figure to be rendered.In user After starting the application program (i.e. OpenGL ES client) based on fixed rendering pipeline rendering, when needing to OpenGL ES client When certain figure in end carries out rendering display, OpenGL ES client can be obtained from the data rendered based on fixed rendering pipeline Status data corresponding with the figure is taken, the rendering order for carrying the status data is then sent to OpenGL ES server, So as to OpenGL ES server vertex program compiled according to needed for the programmable rendering pipeline of the state data acquisition and The fragment program of compiling.Wherein, rendering order mainly include glDraw* order, renderer property include light, deformation, texture with And mist etc..
102, preset decision tree is traversed according to status data.
Wherein, preset decision tree is made of the different initiate modes of at least one renderer property, and decision tree have with Lower feature: from the second node layer of decision tree, every node layer represents a kind of two states whether renderer property enables.Example Such as, Fig. 2 be a decision tree, wherein the renderer property of second layer node on behalf be light, and include enable light processing and Not enabled light handles both initiate modes, and the renderer property of third layer node on behalf is texture, and includes to enable at texture It manages and does not have and enable both initiate modes of texture processing.
It should be noted that may be only comprising renderer property involved in status data in decision tree, it is also possible to both include Renderer property involved in status data, and include other renderer properties.During traversing decision tree, encounter and status number When the renderer property that each renderer property is all different in, the node that initiate mode is not enabled is directly selected.
In addition, can be begun stepping through from the root node of decision tree, successively when OpenGL ES server traverses decision tree It searches and corresponds to the matched child node of renderer property in status data, until obtaining leaf node.
103, when traversing leaf node, corresponding program object is obtained from leaf node.
Wherein, program object is the program for meeting combinations of states condition defined by traverse path, and program object includes Compiled vertex program and compiled fragment program.Wherein, since root node, traversal with wash with watercolours each in status data The dye attribute path that successively matched node is constituted is traverse path.Due to being stored in each leaf node of decision tree Corresponding program object, so can directly be obtained from the leaf node when traversing certain leaf node according to status data Take the program object of storage.
104, program object is sent to video card, so that video card is based on programmable rendering pipeline processing routine object, realized Figure rendering.
Meet combinations of states defined by traverse path when OpenGL ES server is obtained from the leaf node traversed After the program object of condition, which can be sent to video card, be somebody's turn to do so that video card is based on programmable rendering pipeline execution Compiled vertex program and compiled fragment program in program object, thus realize graphical rendering operations, Jin Er Corresponding rendering effect is shown on the interface of OpenGL ES client.
It should be noted that the application scenarios of the embodiment of the present invention can be for " in Windows operating system The application program based on fixed rendering pipeline rendering is run in Android simulator ", or " in Windows operating system In iphone simulator on application program of the operation based on fixed rendering pipeline rendering ", or other application scenarios, This is without limitation.
The method of graphics process provided in an embodiment of the present invention, can receive client transmission rendering order after, Server first obtains the status data carried in rendering order, then according to the preset decision tree of status data traversal, and By obtaining leaf node, corresponding program finally being obtained from the leaf node with after the matched traverse path of status data Object (i.e. compiled vertex program and compiled fragment program), and the program object is sent to video card, so as to video card The program object is handled based on programmable rendering pipeline, realizes figure rendering.It follows that the present invention in each rendering, takes Business device only needs to traverse preset decision tree by the status data in rendering order, and from the leaf node traversed Program object needed for directly acquiring programmable rendering pipeline generates AST tree without taking a significant amount of time every time, with And simultaneously compiler is generated based on AST tree, to improve the efficiency of figure rendering.
Further, according to above method embodiment, another embodiment of the invention additionally provides a kind of graphics process Method, as shown in figure 3, this method specifically includes that
201, after receiving rendering order, the status data carried in rendering order is obtained.
The specific implementation of this step is identical as above-mentioned steps 101, and details are not described herein.
202, preset decision tree is traversed according to status data.
Specifically, the specific implementation of traversal decision tree can be with are as follows: determine the corresponding renderer property of present node layer;From The initiate mode of renderer property is searched in status data;When traversing the corresponding node of initiate mode, repeat the above steps, after It is continuous that next stage node layer is traversed, until traversing leaf node.
Illustratively, if in status data include two kinds of renderer properties initiate mode, i.e., enabling light processing and not Texture processing is enabled, and decision tree is as shown in Fig. 2, then OpenGL ES server is according to the specific of status data traversal decision tree Implementation can be with are as follows: it is begun stepping through from root node, firstly, determine that node layer corresponding renderer property in the second level is light, from The initiate mode that light is searched in status data is to enable light processing, thus selects initiate mode from the node layer of the second level For the node for enabling light processing;Secondly, determining that the corresponding renderer property of third level node layer is texture, looked into from status data The initiate mode for looking for texture is not enabled texture processing, is then selected from the child node for the node selected in the node layer of the second level Select the node that initiate mode is not enabled texture processing;Finally, due to which the node selected from third level node layer is leaf Node, so traversal terminates.In addition, it is the node → shape for enabling light processing that the exemplary traverse path, which is root node → state, State is the node of not enabled texture processing.
203, when traversing leaf node, corresponding program object is obtained from leaf node.
The specific implementation of this step is identical as above-mentioned steps 103, and details are not described herein.
204, when the leaf node traversed is empty, the corresponding program source code of leaf node is obtained.
Wherein, program source code includes uncompiled vertex program and uncompiled fragment program.
In practical applications, obtain the corresponding program source code of leaf node specific implementation can there are many, below It is introduced in following two mode as an example:
Mode one: the combinations of states condition generator source code according to defined by traverse path.
Wherein, after OpenGL ES server has traversed decision tree, it can get and match traverse path with status data and limited Fixed combinations of states condition, and program source code is generated based on technologies such as mesa.In practical applications, it is limited according to traverse path Combinations of states condition generator source code specific implementation can according to combinations of states item defined by traverse path Part first generates AST tree, then generates program source code by AST tree, or other modes, it is not limited here.
Mode two: the corresponding pre- program source code write of leaf node is obtained.
Since program source code is the program about the initiate mode of various renderer properties, thus programmer can be directed to it is various Combinations of states condition is write corresponding program source code in advance, and is saved to default memory space.When OpenGL ES server traverses When to certain leaf node, program source code corresponding with the leaf node can be searched directly from default memory space, and to lookup To program source code be compiled, obtain program object.
In addition, OpenGL ES server can also obtain program source code by the mode that above two mode combines.Specifically , OpenGL ES server can first search the corresponding pre- program source code write of leaf node;If finding leaf node pair The pre- program source code write answered, then directly acquire the program source code found;If not finding, leaf node is corresponding to prelist The program source code write, then the combinations of states condition generator source code according to defined by traverse path.
205, acquisition program object is compiled to program source code.
Further, due to compiling source code needs take a significant amount of time, so for convenient for it is subsequent render the figure again when, Rendering efficiency is improved, OpenGL ES server can be after being compiled acquisition program object to program source code, by program pair As being stored in the corresponding leaf node of traverse path.
206, program object is sent to video card, so that video card is based on programmable rendering pipeline processing routine object, realized Figure rendering.
The specific implementation of this step is identical as the step 104 in above-described embodiment, and details are not described herein.
By being discussed in detail it is found that after the starting of OpenGL ES server to the present embodiment, leaf section can be first constructed Point is empty initial decision tree;When OpenGL ES server for the first time renders certain figure, can traverse for the first time corresponding Leaf node can first obtain the corresponding program source code of the leaf node at this time, then be compiled acquisition to the program source code Program object, and save program object is obtained into the leaf node;When OpenGL ES server again carries out the figure When rendering, the leaf node can be traversed again, can obtain programmable rendering pipeline institute directly from the leaf node at this time The program object needed, without being compiled to program source code, to improve the efficiency of figure rendering.
Further, according to above method embodiment, another embodiment of the invention additionally provides a kind of graphics process Device, as shown in figure 4, the device mainly includes acquiring unit 31, Traversal Unit 32 and transmission units 33.Wherein,
Acquiring unit 31, for obtaining the status data carried in rendering order, status number after receiving rendering order According to for describing initiate mode corresponding to the different renderer properties of figure to be rendered;
Wherein, rendering order includes mainly glDraw* order, and renderer property includes light, deformation, texture and mist etc..
Traversal Unit 32, the status data for being obtained according to acquiring unit 31 traverse preset decision tree, wherein from certainly The second node layer of plan tree rises, and every node layer represents a kind of two states whether renderer property enables;
It should be noted that may be only comprising renderer property involved in status data in decision tree, it is also possible to both include Renderer property involved in status data, and include other renderer properties.
Acquiring unit 31 is also used to obtain from leaf node corresponding when Traversal Unit 32 traverses leaf node Program object, program object is the program for meeting combinations of states condition defined by traverse path, and program object includes having compiled The vertex program translated and compiled fragment program;
Transmission unit 33, the program object for will acquire the acquisition of unit 31 are sent to video card, so that video card is based on to compile Journey rendering pipeline processing routine object realizes figure rendering.
The device of graphics process provided in an embodiment of the present invention, can receive client transmission rendering order after, Server first obtains the status data carried in rendering order, then according to the preset decision tree of status data traversal, and By obtaining leaf node, corresponding program finally being obtained from the leaf node with after the matched traverse path of status data Object (i.e. compiled vertex program and compiled fragment program), and the program object is sent to video card, so as to video card The program object is handled based on programmable rendering pipeline, realizes figure rendering.It follows that the present invention in each rendering, takes Business device only needs to traverse preset decision tree by the status data in rendering order, and from the leaf node traversed Program object needed for directly acquiring programmable rendering pipeline generates AST tree without taking a significant amount of time every time, with And simultaneously compiler is generated based on AST tree, to improve the efficiency of figure rendering.
Further, acquiring unit 31 when being also sky with the leaf node traversed when Traversal Unit 32, obtain leaf section The corresponding program source code of point, program source code includes uncompiled vertex program and uncompiled fragment program;
As shown in figure 5, the device further comprises:
Compilation unit 34, the program source code for obtaining to acquiring unit 31 are compiled acquisition program object.
Further, as shown in figure 5, the device further comprises:
Storage unit 35, for compilation unit 34 program source code is compiled obtain program object after, by program Object is stored in the corresponding leaf node of traverse path.
Further, as shown in figure 5, acquiring unit 31 includes:
Generation module 311 is used for the combinations of states condition generator source code according to defined by traverse path;
Module 312 is obtained, for obtaining the corresponding pre- program source code write of leaf node.
Further, as shown in figure 5, the device further comprises:
Construction unit 36, for after server starting, building leaf node to be empty initial decision tree.
Further, as shown in figure 5, Traversal Unit 32 includes:
Determining module 321, for determining the corresponding renderer property of present node layer;
Searching module 322, for searching the initiate mode of renderer property from status data;
Spider module 323, for repeating the above steps, continuing to next when traversing the corresponding node of initiate mode Grade node layer is traversed, until traversing leaf node.
Further, as an implementation of the above method, another embodiment of the invention additionally provides at a kind of figure The device of reason, as shown in fig. 6, the device includes: transceiver 61, processor 62, video card 63, memory 64 and bus 65;Its In,
Transceiver 61 is configured as receiving render instruction;
Processor 62, is configured as:
The status data carried in rendering order is obtained, status data is used to describe the different renderer properties of figure to be rendered Corresponding initiate mode;
Preset decision tree is traversed according to status data, wherein from the second node layer of decision tree, every node layer is represented A kind of two states whether renderer property enables;
When Traversal Unit traverses leaf node, corresponding program object is obtained from leaf node, program object is Meet the program of combinations of states condition defined by traverse path, and program object includes compiled vertex program and compiled Fragment program;
Transceiver 61 is additionally configured to for program object to be sent to video card 63;
Video card 63 is configured as realizing figure rendering based on programmable rendering pipeline processing routine object;
Memory 64 is configured as the executable instruction of storage processor 62;
Bus 65 is configured as coupling transceiver 61, processor 62, video card 63 and memory 64.
Further, processor 62 is also configured to
When the leaf node that Traversal Unit traverses is empty, the corresponding program source code of leaf node, program source code are obtained Including uncompiled vertex program and uncompiled fragment program;
Acquisition program object is compiled to program source code.
Further, memory 64 is also configured to
After being compiled acquisition program object to program source code, program object is stored in the corresponding leaf of traverse path In child node.
Further, processor 62 is also configured to
The combinations of states condition generator source code according to defined by traverse path;
Obtain the corresponding pre- program source code write of leaf node.
Further, processor 62 is also configured to
After server starting, building leaf node is empty initial decision tree.
Further, processor 62 is also configured to
Determine the corresponding renderer property of present node layer;
The initiate mode of renderer property is searched from status data;
When traversing the corresponding node of initiate mode, repeats the above steps, continues to traverse next stage node layer, Until traversing leaf node.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, reference can be made to the related descriptions of other embodiments.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment " first ", " second " etc. be and not represent the superiority and inferiority of each embodiment for distinguishing each embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed Meaning one of can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize the denomination of invention according to an embodiment of the present invention (as determined in website The device of Hyperlink rank) in some or all components some or all functions.The present invention is also implemented as being used for Some or all device or device programs of method as described herein are executed (for example, computer program and calculating Machine program product).It is such to realize that program of the invention can store on a computer-readable medium, or can have one Or the form of multiple signals.Such signal can be downloaded from an internet website to obtain, or be provided on the carrier signal, Or it is provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.

Claims (18)

1. a kind of method of graphics process, which is characterized in that the described method includes:
After receiving rendering order, the status data carried in the rendering order is obtained, the status data is for describing Initiate mode corresponding to the different renderer properties of figure to be rendered;
Preset decision tree is traversed according to the status data, wherein from the second node layer of the decision tree, every node layer Represent a kind of two states whether renderer property enables;
When traversing leaf node, corresponding program object is obtained from the leaf node, described program object is to meet The program of combinations of states condition defined by traverse path, and described program object includes compiled vertex program and compiled Fragment program;
Described program object is sent to video card, handles described program object so that the video card is based on programmable rendering pipeline, Realize figure rendering.
2. the method according to claim 1, wherein the method further includes:
When the leaf node traversed is empty, the corresponding program source code of the leaf node is obtained, described program source code includes Uncompiled vertex program and uncompiled fragment program;
Acquisition program object is compiled to described program source code.
3. according to the method described in claim 2, it is characterized in that, being compiled acquisition program to described program source code described After object, the method further includes:
The program object for being compiled acquisition to described program source code is stored in the corresponding leaf node of the traverse path.
4. according to the method described in claim 2, it is characterized in that, described obtain the corresponding program source code packet of the leaf node It includes:
Described program source code is generated according to combinations of states condition defined by the traverse path;
Or obtain the corresponding pre- program source code write of the leaf node.
5. method according to any one of claim 2 to 4, which is characterized in that the method further includes:
After server starting, building leaf node is empty initial decision tree.
6. the method according to claim 1, wherein described traverse preset decision tree according to the status data Include:
Determine the corresponding renderer property of present node layer;
The initiate mode of the renderer property is searched from the status data;
When traversing the corresponding node of the initiate mode, repeat to determine the corresponding renderer property of present node layer and from described The step of initiate mode of the renderer property is searched in status data continues to traverse next stage node layer, until time It goes through until leaf node.
7. a kind of device of graphics process, which is characterized in that described device includes:
Acquiring unit, for after receiving rendering order, obtaining the status data carried in the rendering order, the state Data are for describing initiate mode corresponding to the different renderer properties of figure to be rendered;
Traversal Unit, the status data for being obtained according to the acquiring unit traverse preset decision tree, wherein from institute The second node layer for stating decision tree rises, and every node layer represents a kind of two states whether renderer property enables;
The acquiring unit is also used to when the Traversal Unit traverses leaf node, the acquisition pair from the leaf node The program object answered, described program object are the program for meeting combinations of states condition defined by traverse path, and described program Object includes compiled vertex program and compiled fragment program;
Transmission unit, the described program object for obtaining the acquiring unit are sent to video card, so that the video card is based on Programmable rendering pipeline handles described program object, realizes figure rendering.
8. device according to claim 7, which is characterized in that the acquiring unit is also used to when the Traversal Unit time When the leaf node gone through is empty, the corresponding program source code of the leaf node is obtained, described program source code includes uncompiled Vertex program and uncompiled fragment program;
Described device further comprises:
Compilation unit, the described program source code for obtaining to the acquiring unit are compiled acquisition program object.
9. device according to claim 8, which is characterized in that described device further comprises:
Storage unit, for the compilation unit described program source code is compiled obtain program object after, will be to institute It states program source code and is compiled the program object of acquisition and be stored in the corresponding leaf node of the traverse path.
10. device according to claim 8, which is characterized in that the acquiring unit includes:
Generation module generates described program source code for the combinations of states condition according to defined by the traverse path;
Module is obtained, for obtaining the corresponding pre- program source code write of the leaf node.
11. the device according to any one of claim 8 to 10, which is characterized in that described device further comprises:
Construction unit, for after server starting, building leaf node to be empty initial decision tree.
12. device according to claim 7, which is characterized in that the Traversal Unit includes:
Determining module, for determining the corresponding renderer property of present node layer;
Searching module, for searching the initiate mode of the renderer property from the status data;
Spider module determines the corresponding wash with watercolours of present node layer for repeating when traversing the corresponding node of the initiate mode Dye attribute and the step of search the initiate mode of the renderer property from the status data, continue to next stage node layer into Row traversal, until traversing leaf node.
13. a kind of device of graphics process, which is characterized in that described device includes:
Transceiver is configured as receiving render instruction;
Processor is configured as:
The status data carried in the rendering order is obtained, the status data is used to describe the different renderings of figure to be rendered Initiate mode corresponding to attribute;
Preset decision tree is traversed according to the status data, wherein from the second node layer of the decision tree, every node layer Represent a kind of two states whether renderer property enables;
The processor includes Traversal Unit, when the Traversal Unit traverses leaf node, is obtained from the leaf node Corresponding program object is taken, described program object is the program for meeting combinations of states condition defined by traverse path, and described Program object includes compiled vertex program and compiled fragment program;
The transceiver is additionally configured to described program object being sent to video card;
Video card is configured as handling described program object based on programmable rendering pipeline, realizes figure rendering;
Memory is configured as storing the executable instruction of the processor;
Bus is configured as coupling the transceiver, the processor, the video card and the memory.
14. device according to claim 13, which is characterized in that the processor is also configured to
When the leaf node that the Traversal Unit traverses is empty, the corresponding program source code of the leaf node is obtained, it is described Program source code includes uncompiled vertex program and uncompiled fragment program;
Acquisition program object is compiled to described program source code.
15. device according to claim 14, which is characterized in that the memory is also configured to
After being compiled acquisition program object to described program source code, the journey of acquisition will be compiled to described program source code Ordered pair is as being stored in the corresponding leaf node of the traverse path.
16. device according to claim 14, which is characterized in that the processor is also configured to
Described program source code is generated according to combinations of states condition defined by the traverse path;
Obtain the corresponding pre- program source code write of the leaf node.
17. device described in any one of 4 to 16 according to claim 1, which is characterized in that the processor is also configured to
After server starting, building leaf node is empty initial decision tree.
18. device according to claim 13, which is characterized in that the processor is also configured to
Determine the corresponding renderer property of present node layer;
The initiate mode of the renderer property is searched from the status data;
When traversing the corresponding node of the initiate mode, repeat to determine the corresponding renderer property of present node layer and from described The step of initiate mode of the renderer property is searched in status data continues to traverse next stage node layer, until time It goes through until leaf node.
CN201610153078.6A 2016-03-17 2016-03-17 The method and device of graphics process Expired - Fee Related CN105843603B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610153078.6A CN105843603B (en) 2016-03-17 2016-03-17 The method and device of graphics process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610153078.6A CN105843603B (en) 2016-03-17 2016-03-17 The method and device of graphics process

Publications (2)

Publication Number Publication Date
CN105843603A CN105843603A (en) 2016-08-10
CN105843603B true CN105843603B (en) 2019-08-16

Family

ID=56588394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610153078.6A Expired - Fee Related CN105843603B (en) 2016-03-17 2016-03-17 The method and device of graphics process

Country Status (1)

Country Link
CN (1) CN105843603B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569816B (en) * 2016-10-26 2020-03-31 搜游网络科技(北京)有限公司 Rendering method and device
CN107845144B (en) * 2017-07-21 2021-04-02 浙江科澜信息技术有限公司 Method for efficiently organizing and switching OpenGL rendering states
CN112969175B (en) * 2019-11-28 2022-12-06 中国电信股份有限公司 Network access method, device and computer readable storage medium

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7430723B2 (en) * 2001-11-29 2008-09-30 Gse Advanced Industrial Technologies, Gmbh System and method for implementing a three-dimensional graphic user interface
GB0425204D0 (en) * 2004-11-15 2004-12-15 Falanx Microsystems As Processing of 3-dimensional graphics
US7940279B2 (en) * 2007-03-27 2011-05-10 Utah State University System and method for rendering of texel imagery
KR20090077432A (en) * 2008-01-11 2009-07-15 엠텍비젼 주식회사 Method of processing opengl programmable shader by using off-line compiling
US8314813B1 (en) * 2008-03-31 2012-11-20 The Mathworks, Inc. Object trees for multiprocessor systems
CN101819530A (en) * 2010-04-30 2010-09-01 山东中创软件工程股份有限公司 Program object generation method and device and computer
US8914773B2 (en) * 2010-06-02 2014-12-16 Allen Learning Technologies Logic table
CN102169596B (en) * 2011-03-09 2013-08-14 深圳市酷开网络科技有限公司 Method and device for realizing 3D rendering on embedded device
CN102385515B (en) * 2011-10-21 2014-03-26 广州市久邦数码科技有限公司 GO image animation engine based on android system
CN107832277B (en) * 2012-03-13 2021-12-24 谷歌有限责任公司 System and method for providing binary representation of web page
CN103679799A (en) * 2012-09-25 2014-03-26 中国航天科工集团第二研究院二〇七所 A method for fast generating an optical starry sky background
US8941676B2 (en) * 2012-10-26 2015-01-27 Nvidia Corporation On-chip anti-alias resolve in a cache tiling architecture
CN103853649B (en) * 2012-11-28 2018-09-04 百度在线网络技术(北京)有限公司 A kind of test method and system of application program
CN104050190B (en) * 2013-03-14 2018-11-23 腾讯科技(上海)有限公司 A kind of method and system of relation chain data processing, client
GB2524287B (en) * 2014-03-19 2020-07-01 Advanced Risc Mach Ltd Graphics processing systems
US9754402B2 (en) * 2014-05-13 2017-09-05 Mediatek Inc. Graphics processing method and graphics processing apparatus
CN104168417B (en) * 2014-05-20 2019-09-13 腾讯科技(深圳)有限公司 Image processing method and device

Also Published As

Publication number Publication date
CN105843603A (en) 2016-08-10

Similar Documents

Publication Publication Date Title
US20170344604A1 (en) Source code search engine
US10402208B2 (en) Adaptive portable libraries
US8310484B2 (en) Efficient processing of operator graphs representing three-dimensional character animation
US10228920B2 (en) Automatic selection of an abstract data type
CN105843603B (en) The method and device of graphics process
US10102015B1 (en) Just in time GPU executed program cross compilation
US10068370B2 (en) Render-time linking of shaders
EP2700005A1 (en) Method and apparatus for generating resource efficient computer program code
US10747921B2 (en) Software tool for simulating operation of hardware and software systems
Wolff OpenGL 4 Shading Language Cookbook: Build high-quality, real-time 3D graphics with OpenGL 4.6, GLSL 4.6 and C++ 17
US10216489B2 (en) Selecting COBOL perform statements for inlining
JP4837634B2 (en) Memory access method using three-dimensional address mapping
US20170132748A1 (en) Method and apparatus for processing graphics commands
CN105204907B (en) Browser starts method and apparatus
CN109885991A (en) A kind of encryption method based on mobile application data fluid, electronic equipment and medium
EP3776182B1 (en) Compound conditional reordering for faster short-circuiting
WO2021047662A1 (en) Method and apparatus for enabling autonomous acceleration of dataflow ai applications
CN113391813A (en) Program compiling method and device, storage medium and electronic equipment
US20210157654A1 (en) Dynamic distribution of loads across heterogenous computing structures in computational rendering
JP2022542007A (en) Automated verification of high-level construct optimizations using test vectors
Sons et al. shade. js: Adaptive Material Descriptions
US10120968B1 (en) System and method for hierarchical library searching
CN106604129B (en) The method and apparatus for detecting video broadcasting condition
CN111259047A (en) Data loading method, device, equipment and storage medium thereof
CN116578343B (en) Instruction compiling method and device, graphic processing device, storage medium and terminal equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200526

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 510640 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping radio square B tower 13 floor 02 unit self

Patentee before: GUANGZHOU UCWEB COMPUTER TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190816

Termination date: 20200317

CF01 Termination of patent right due to non-payment of annual fee