CN100527162C - Method and system for simplifying script file of drawing system - Google Patents

Method and system for simplifying script file of drawing system Download PDF

Info

Publication number
CN100527162C
CN100527162C CNB2007101032777A CN200710103277A CN100527162C CN 100527162 C CN100527162 C CN 100527162C CN B2007101032777 A CNB2007101032777 A CN B2007101032777A CN 200710103277 A CN200710103277 A CN 200710103277A CN 100527162 C CN100527162 C CN 100527162C
Authority
CN
China
Prior art keywords
instruction
input instruction
script file
resource
described input
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.)
Active
Application number
CNB2007101032777A
Other languages
Chinese (zh)
Other versions
CN101038663A (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.)
Weisheng Electronics (Shanghai) Co. Ltd.
Original Assignee
Via Technologies Inc
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 Via Technologies Inc filed Critical Via Technologies Inc
Priority to CNB2007101032777A priority Critical patent/CN100527162C/en
Publication of CN101038663A publication Critical patent/CN101038663A/en
Application granted granted Critical
Publication of CN100527162C publication Critical patent/CN100527162C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

Proposed is a method for simplification of a script file of a drawing system, and a system thereof. At first, the script file is received, the script file comprises a plurality of input commands of the drawing system. Then, each input command is classed to a resource and named that the input command belongs to the resource. Subsequently, a resource which belongs to a special command is found out, these input commands which belongs to the resource are kept, and other input commands are deleted. Finally, the kept input commands are optimized.

Description

Simplify the method and the system thereof of the script file of drafting system
Technical field
The invention relates to a kind of method and system thereof of simplifying the script file (script) of drafting system, and the interior input instruction of resource of be correlated with particularly, and the short-cut method of the input instruction of these reservations of optimization and system thereof about specific playing up (rendering) instruction in a kind of reservation script file.
Background technology
Along with the development of Computer Multimedia Technology, can accurately present object bright and colourful in the real world by using a computer.By Application Program Interface (application program interface, API), programmer's designed software only needs the program in the invokes application interface, thereby automatically (for example: display card) driver is linked up, and just can start graphics processing function with hardware to allow Application Program Interface.
Generally speaking, Driver Development person can utilize register (logger) that a plurality of input instructions of drafting system are recorded as script file, reappears the program error of root in display driving software by the rendering program of playing this script file.Yet, present tri-dimensional application program, for example: big game, benchmark (benchmark), even playing up of a picture (frame) also may comprise thousands of drafting pel (primitive) instruction, and a problematic pixel rendering (rendering) may appear at after thousands of the good pixel rendering.At this moment, when the developer when playing the rendering program of script file again, must running have nothing to do in a large number: tremble look (Dithering), atomizing (FoggingHaze), eliminate edge sawtooth (Anti-Aliasing) etc. in the last color function (rendering) of problematic pixel rendering, for example.
In other words, stagger the time if the developer removes in actual graphical chip (graphic chip), owing to the working at high speed of hardware, unnecessary pixel rendering not necessarily can expend the suitable time.Yet, design time at graphic chips, the developer can use software to come the algorithm of simulation figure chip, and realize that on software model playing up of these pixels is very slowly, therefore before problematic pixel rendering instruction, turning round, these unnecessary played up instruction and can cause the exploitation of graphic chips than inefficiency.
In addition, because problematic playing up may use some textures that can play up (render-abletexture) as input, and this texture content that can play up is served as reasons and is before played up instruction institute and determine, is not simply all before to have been played up instruction to delete to save and turn round that these had before played up the time of instruction.Thereby play up at problematic, play up the instruction deletion with unnecessary, become the target that progresses greatly at present and improve with the efficient of promoting debug.
In view of this, the present invention designs a kind of reducer (simplifier) can automatically keep the problematic input instruction that is had influence on of playing up in the script file, and delete no problem object and play up, only use problematic playing up analyzed and debug, save the time of the unnecessary input instruction of running widely, the efficient of promoting exploitation.
Summary of the invention
The invention provides a kind of method of simplifying the script file of drafting system.This short-cut method is found out the resource that specific instruction belongs to again for all input instructions in the script file being classified to the resource under it earlier, and keeps the input instruction that belongs to this resource.Simplification by script file keeps the input instruction that specific instruction has influence on, and the input instruction that optimization kept, and uses effectively the input instruction of these reservations is analyzed and debug.
The present invention proposes a kind of method of simplifying the script file of drafting system.This short-cut method is to receive script file earlier, and this script file comprises a plurality of input instructions of drafting system, and each input instruction that will change the content of texture or impact damper again is classified to resource, and claims this input instruction to belong to this resource.Then, find out the specific resource that instruction belongs to of playing up, and keep the input instruction that belongs to this resource, delete remaining input instruction.At last, the input instruction that optimization kept.
The method of the script file of above-mentioned simplification drafting system also comprises in one embodiment and finds out a plurality of tinters (shader) that the input instruction that kept uses, and the instruction of playing up the tinter that instruction do not use among the input instruction that kept of deletion.
The method of the script file of above-mentioned simplification drafting system, a plurality of states that the input instruction that also comprises comparison in one embodiment and kept is correlated with, and keep up-to-date state, wherein these states comprise the arbitrary of rendering state, texture bracket state and tinter constant three.
The method of the script file of above-mentioned simplification drafting system, finding out these resources that specific instruction belongs in one embodiment, and keep in the step of the input instruction that belongs to these resources, also comprise these resources of finding out among the input instruction that is kept that instruction belongs to of playing up, and keep the input instruction that belongs to these resources.
The method of the script file of above-mentioned simplification drafting system, in one embodiment in the input instruction step that optimization kept, be included in find out among the input instruction that is kept can the whole resource content of change arbitrary input instruction, and deletion is positioned at before the input instruction of being found out and belong to the input instruction of same resource with the input instruction of being found out.
From another viewpoint, the present invention proposes a kind of system of simplifying the script file of drafting system again.This simplified system comprises register, reducer and player.Register is recorded as script file in order to a plurality of input instructions with drafting system.Reducer is in order to the classification of input instruction that script file comprised, and plays up instruction and simplify script file according to specific.Player is in order to each input instruction of the script file that obtains simplification, and it is carried out grammatical analysis, to play the input instruction of simplifying that script file was comprised.
The system of the script file of above-mentioned simplification drafting system, reducer comprises instruction classification module, instruction analysis module and instruction cancellation module in one embodiment.The instruction classification module is classified to resource under it in order to each input instruction of the content that will change texture or impact damper, and claims it to belong to these resources.The instruction analysis module is specificly played up these resources of belonging to of instruction in order to find out, and keeps the input instruction that belongs to these resources, deletes remaining input instruction.The instruction cancellation module in order to from the input instruction that keeps, find out can the whole resource content of change arbitrary input instruction, belong to the input instruction of same resource before the input instruction that deletion is found out and with the input instruction of being found out.
The system of the script file of above-mentioned simplification drafting system, reducer also comprises the tinter cancellation module in one embodiment.The tinter cancellation module is in order to the employed a plurality of tinters of the input instruction of finding out reservation (shader), and the instruction of playing up the tinter that instruction do not use in the input instruction that keeps of deletion.
The system of the script file of above-mentioned simplification drafting system, reducer also comprises the comparative analysis module in one embodiment.The comparative analysis module is in order to a plurality of states that instruction is correlated with of playing up in the input instruction that relatively keeps, and keeps up-to-date described state, and wherein these states comprise the arbitrary of rendering state, texture bracket state and tinter constant three.
The present invention automatically simplifies the script file of a plurality of input instructions of comprising drafting system because of adopting a kind of reducer, by input instruction being classified to resource under it, finding out and specificly play up all instructions that these resources that instruction belongs to and reservation belong to these resources and with optimized each step of input instruction that keeps, only keep the specific input instruction that instruction has influence on of playing up, analyzing and debug at problematic playing up, also can reduce the time of the unnecessary instruction of running, the efficient of promoting development sequence greatly.
For above and other objects of the present invention, feature and advantage can be become apparent, preferred embodiment of the present invention cited below particularly, and cooperate appended graphicly, be described in detail below.
Description of drawings
Fig. 1 illustrates the system into the script file of the simplification drafting system of one embodiment of the invention.
Fig. 2 illustrates the calcspar into reducer among embodiment of the invention Fig. 1.
Fig. 3 illustrates the method into the script file of the simplification drafting system of another embodiment of the present invention.
[main element label declaration]
101: register
102: reducer
103: player
201: the instruction classification module
202: the instruction analysis module
203: the instruction cancellation module
204: the tinter cancellation module
205: the comparative analysis module
S301~S304: the step of the method for the script file of the simplification drafting system of one embodiment of the invention
Embodiment
Fig. 1 illustrates the system into the script file of the simplification drafting system of one embodiment of the invention, and this embodiment describes in detail with the application in three-dimensional picture, but the present invention is not limited to this.Please refer to Fig. 1, this simplified system 100 comprises register 101, reducer 102 and player 103.Register 101 is recorded as script file for a plurality of input instructions with drafting system.Automatically scan this script file by reducer 102, and find out among the script file and reservation can influence the problematic input instruction of playing up, delete all the other input instructions (details aftermentioned).Wherein problematic playing up to specific plays up that instruction causes.
After reducer 102 was simplified script file, the script file that transmits simplification was to player 103, by the input instruction that script file comprised that player 103 obtains and grammatical analysis is simplified, to play the rendering program of the script file of simplifying again.Because the script file of this simplification only comprises the problematic input instruction of playing up of influence, therefore saved the time of the unnecessary input instructions of player 103 runnings, also can effectively analyze and debug problematic playing up.
Below just describe the process that reducer 102 is simplified according to the input instruction that script file comprised in detail.Fig. 2 illustrates the calcspar into reducer 102 among embodiment of the invention Fig. 1.Please refer to Fig. 2, reducer 102 comprises instruction classification module 201, instruction analysis module 202, instruction cancellation module 203, tinter cancellation module 204 and comparative analysis module 205.After instruction classification module 201 receives the script file that register 101 write down, (for example: vertex buffer, vertex index impact damper each input instruction of) content is classified to its affiliated resource, also can claim this input instruction for belonging to these resources will to change texture or impact damper.The content that wherein can change texture or impact damper be comprise play up, the loading of texture or impact damper, removing, from one texture transformation (blt) to processing such as another textures.
In addition, for instance, owing to specificly play up instruction and may use the texture (render-able texture) that to play up, and therefore the texture content that can play up must keep these relevant previous input instructions by being determined by the specific instruction input instruction (being referred to as previous input instruction) before of playing up.And instruction analysis module 202 is and finds out specific these resources that belong to of instruction of playing up, and the input instruction that will belong to these resources remains.What deserves to be mentioned is,, then find out the resource that instruction belongs to of playing up among the input instruction that is kept, also keep the input instruction that belongs to these resources if having the instruction of playing up in the input instruction that is kept.
Then by the input instruction that instructs cancellation module 203 to come optimization to keep.This optimized process is changed arbitrary input instruction of whole resource content for find out meeting from the input instruction that is kept, and deletes the input instruction of being found out belongs to same resource before with the input instruction of being found out input instruction.Because the input instruction of being found out can be changed whole resource content (for example: the loading of texture or impact damper, removing etc.), therefore need not keep the input instruction input instruction of being found out before.
In addition, tinter cancellation module 204 can be found out the tinter (shader) that the input instruction that kept uses, and the establishment instruction of playing up the tinter that instruction do not use among the input instruction that kept of deletion.Because in the rendering program of playing script file again, tinter is different from resource, can not change in case created just, need only judge whether need to use tinter, therefore with the establishment instruction deletion of playing up the tinter that instruction do not use among the input instruction that is kept.And comparative analysis module 205 is for comparing the state that instruction is correlated with of playing up in the input instruction that is kept, to keep up-to-date state.And these states be rendering state (for example: whether whether light shield open, vaporificly open, position, visual angle etc.), texture bracket state, tinter constant one of them.
As the explanation of above-mentioned embodiment, can reduce following method flow at this.Fig. 3 illustrates the method into the script file of the simplification drafting system of another embodiment of the present invention.Please refer to Fig. 3, at first, reducer 102 receives script files (step S301), this script file by register 101 write down it, and comprise a plurality of input instructions of drafting system.And reducer 102 will change the input instruction of the content of texture or impact damper and is classified to resource (step S302) under it, and is called and belongs to this resource.Then, reducer 102 is played up instruction according to specific, finds out this and specificly plays up the resource that instruction belongs to, and keep the input instruction that belongs to these resources in the script file, deletes all the other input instructions (step S303).The last input instruction (step S304) that optimization kept again.
In sum, the embodiment of the invention is the script file simplification that will comprise a plurality of input instructions of drafting system by reducer, is kept the specific input instruction that instruction has influence on of playing up, and deletes remaining input instruction.If have the instruction of playing up in the input instruction that keeps, also can from script file, delete the establishment instruction of playing up the tinter that instruction do not use and be simplified, perhaps relatively these play up the state that instruction is correlated with, and only keep last state and get final product.Therefore, the script file by simplifying is able to analyze and debug at problematic playing up, and is playing again in the rendering program process of the script file of simplifying, and more can save the time of the unnecessary instruction of running, and the efficient that promotes development sequence.
Though the present invention discloses as above with preferred embodiment; right its is not in order to limit the present invention; any those skilled in the art; without departing from the spirit and scope of the present invention; when can doing a little change and retouching, so protection scope of the present invention is as the criterion when looking appended the claim scope person of defining.

Claims (7)

1. a method of simplifying the script file of drafting system comprises the following steps:
Receive script file, wherein this script file comprises a plurality of input instructions that can change the content of texture or impact damper;
Each described input instruction is classified to resource, and claims it to belong to this resource;
Find out this resource that belongs to as the specific instruction of playing up instruction, and keep the described input instruction that belongs to this resource, delete remaining input instruction;
In the described input instruction that is kept, find out the arbitrary input instruction that to change whole resource content; And
Deletion is positioned at before this input instruction of being found out and belongs to the described input instruction of same resource with the input instruction of being found out.
2. the method for the script file of simplification drafting system according to claim 1 also comprises the following steps:
Find out the employed a plurality of tinters of described input instruction of reservation, and delete the instruction of playing up the untapped described tinter of instruction among the described input instruction that is kept; And
A plurality of states that the described input instruction that comparison is kept is correlated with, and keep up-to-date described state.
3. the method for the script file of simplification drafting system according to claim 1, wherein said state comprise the arbitrary of rendering state, texture bracket state and tinter constant three.
4. the method for the script file of simplification drafting system according to claim 1 is wherein found out this resource that this specific instruction belongs to, and keeps the described input instruction that belongs to this resource, also comprises the following steps:
Find out the described resource that the instruction in the described input instruction that is kept belongs to, and keep the described input instruction that belongs to described resource.
5. system of simplifying the script file of drafting system comprises:
Register is recorded as script file in order to a plurality of input instructions of the instruction of the content that the meeting of drafting system changed texture or impact damper;
Reducer in order to this script file comprised described input instruction classification, and according to simplifying this script file as the specific instruction of playing up instruction, comprising:
The instruction classification module in order to each described input instruction being classified to the resource under it, and claims it to belong to this resource;
The instruction analysis module in order to finding out this resource that specific instruction belongs to, and keeps the described input instruction that belongs to this resource, deletes remaining input instruction;
The instruction cancellation module, in order to from the described input instruction that is kept, find out can the whole resource content of change arbitrary input instruction, deletion is positioned at before this input instruction of being found out and belongs to the described input instruction of same resource with the input instruction of being found out; And
Player in order to each described input instruction of this script file of obtaining simplification, and carries out grammatical analysis to it, to play the described input instruction of simplifying that this script file was comprised.
6. the system of the script file of simplification drafting system according to claim 5, wherein this reducer also comprises:
The tinter cancellation module, in order to the employed a plurality of tinters of the described input instruction of finding out reservation, and the instruction of playing up the untapped described tinter of instruction in the described input instruction of deletion reservation; And
The comparative analysis module, a plurality of states of being correlated with in order to the described input instruction that is relatively kept, and keep up-to-date described state.
7. the system of the script file of simplification drafting system according to claim 5, wherein said state comprises the arbitrary of rendering state, texture bracket state and tinter constant three.
CNB2007101032777A 2007-05-10 2007-05-10 Method and system for simplifying script file of drawing system Active CN100527162C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007101032777A CN100527162C (en) 2007-05-10 2007-05-10 Method and system for simplifying script file of drawing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007101032777A CN100527162C (en) 2007-05-10 2007-05-10 Method and system for simplifying script file of drawing system

Publications (2)

Publication Number Publication Date
CN101038663A CN101038663A (en) 2007-09-19
CN100527162C true CN100527162C (en) 2009-08-12

Family

ID=38889547

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007101032777A Active CN100527162C (en) 2007-05-10 2007-05-10 Method and system for simplifying script file of drawing system

Country Status (1)

Country Link
CN (1) CN100527162C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111179150B (en) * 2019-12-27 2020-11-03 浙江大学 Shader automatic simplification method and system based on drawing instruction stream
CN115729557B (en) * 2022-11-16 2024-01-26 格兰菲智能科技有限公司 Script processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LOD技术在实时渲染系统的应用. 郑姨婷,智,明.福建电脑,第4期. 2007 *
交互式自行车模拟器视景仿真系统开发. 何其昌,范秀敏,皮兴忠,马登哲.计算机仿真,第23卷第2期. 2006 *

Also Published As

Publication number Publication date
CN101038663A (en) 2007-09-19

Similar Documents

Publication Publication Date Title
US10282813B2 (en) Flex rendering based on a render target in graphics processing
CN106575228B (en) Post-processing object order rearrangement in graphics process
US8284207B2 (en) Method of generating digital images of objects in 3D scenes while eliminating object overdrawing within the multiple graphics processing pipeline (GPPLS) of a parallel graphics processing system generating partial color-based complementary-type images along the viewing direction using black pixel rendering and subsequent recompositing operations
KR102327144B1 (en) Graphic processing apparatus and method for performing tile-based graphics pipeline thereof
JP5866457B2 (en) Switching between direct rendering and binning in graphic processing using an overdraw tracker
US10796478B2 (en) Dynamic rendering for foveated rendering
JP4598031B2 (en) Accelerated start tile search
US7876332B1 (en) Shader that conditionally updates a framebuffer in a computer graphics system
EP2946364B1 (en) Rendering graphics data using visibility information
US7847798B1 (en) Clipping and culling artwork using a graphics processing unit
US7475197B1 (en) Cross process memory management
US8325203B1 (en) Optimal caching for virtual coverage antialiasing
US8547395B1 (en) Writing coverage information to a framebuffer in a computer graphics system
US8917281B2 (en) Image rendering method and system
US10140268B2 (en) Efficient browser composition for tiled-rendering graphics processing units
US8941669B1 (en) Split push buffer rendering for scalability
US7898549B1 (en) Faster clears for three-dimensional modeling applications
US8416241B2 (en) Efficient tile-based rasterization
US7852341B1 (en) Method and system for patching instructions in a shader for a 3-D graphics pipeline
US8773447B1 (en) Tag logic scoreboarding in a graphics pipeline
CN100527162C (en) Method and system for simplifying script file of drawing system
CN109191362B (en) Parallel scheduling method for multiple ROPs
US20070115288A1 (en) Sprite interface and code-based functions
US20200027189A1 (en) Efficient dependency detection for concurrent binning gpu workloads
JP5864474B2 (en) Image processing apparatus and image processing method for processing graphics by dividing space

Legal Events

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

Effective date of registration: 20180322

Address after: 6 floor, G District, No. 666, Beijing East Road, Huangpu District, Shanghai

Patentee after: Weisheng Electronics (Shanghai) Co. Ltd.

Address before: Taiwan County, Taipei, China

Patentee before: Weisheng Electronic Co., Ltd.