CN108389154A - The implementation method of a kind of clipping region cutting techniques for parallel drawing in GPU - Google Patents
The implementation method of a kind of clipping region cutting techniques for parallel drawing in GPU Download PDFInfo
- Publication number
- CN108389154A CN108389154A CN201810261850.5A CN201810261850A CN108389154A CN 108389154 A CN108389154 A CN 108389154A CN 201810261850 A CN201810261850 A CN 201810261850A CN 108389154 A CN108389154 A CN 108389154A
- Authority
- CN
- China
- Prior art keywords
- cutting
- equation
- vertex
- pel
- currently
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/28—Indexing scheme for image data processing or generation, in general involving image processing hardware
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a kind of implementation methods of clipping region cutting techniques for parallel drawing in GPU, this method is by making fixed cutting face equation into parameter configuration equation, entire drawing is distinguished into several disjoint regions, these clipping regions respectively execute the operation after cutting to realize parallel drawing, it improves and draws efficiency, the implementation method of the present invention is in command process, vertex obtains, after vertex processing and pel assembly, clipping region is divided, several clipping regions are assigned to the same pel simultaneously to cut, an original cutting module is become into several cutting modules while being cut.
Description
Technical field
Present invention relates generally to GPU design fields, refer in particular to the realization field of GPU parallel drawings.
Background technology
GPU graphics rendering pipelines include command process, vertex obtain, vertex processing, pel assembly, cut, rasterisation,
The processes such as segment processing and processes pixel, it is improve GPU performances one that these processing, which all have succession requirement, parallel drawing,
Kind important process mode, but due to succession requirement, cannot be carried out parallel by rendering order or vertex according to common.
Such as the parallel drawing technology rendered based on piecemeal, point that pel is executed after cutting is needed using this concurrent technique
Block operates, and needs by piecemeal and draw the technology executed respectively.
Invention content
The problem to be solved in the present invention is that:Under the premise of not changing processing sequence requirement, a kind of use is provided
In the implementation method of the clipping region cutting techniques of parallel drawing, by being split in one direction to drawing area, point
Several disjoint regions are cut into, each region after the completion of cutting is by parallel rasterisation, segment processing and processes pixel
Complete subsequent operation.
Invention content:Drawing zone is divided into n disjoint regions using equation is cut, n is natural number, each cutting module
Cutting is respectively executed according to the parameter of configuration, each cutting module configuration parameter is different:The left and right two of X-direction is cut face to use
EquationIt indicates, the lower upper cutting face equation of Y-directionIt indicates, entirely paints
Region processed is divided into n disjoint regions:The value of cutting face parameter configuration of i-th of cutting module is:When selected X-direction
It is taken when segmentationIt is taken when selected Y-direction is dividedIt is therein
I ∈ [1, n], and be natural number;The implementation method of the present invention executes according to the following steps:
Step (1):CPU is written to vertex data by bus the corresponding address of memory, and CPU sends out configuration life by bus
It enables and drawing command, 4 component of increase n groups configures parameter { CL, CR, CB, CT, each component is single precision floating datum, every group 4
Component parameters correspond to the cutting equation parameter of a cutting module;
Step (2):After GPU receives rendering order, the operations such as command analysis, vertex acquisition, vertex processing and pel assembly are executed,
Each pixel coordinates include x, y, z, and tetra- components of w by the pel assembled while sending n cutting module;
Step (3):According to the cutting equation parameter that step (1) configures, carried out successively according to the sequence in left and right, upper and lower cutting face
It cuts, cuts process and the judgement that difference lies in vertex in clipping region of general cutting process of execution, the implementation method
Judgment method be:If current cutting face is left cutting face, if three apex coordinates that input cuts module are respectively A (x0,
y0, z0, w0), B (x1, y1, z1, w1), C (x2, y2, z2, w2), the coordinate on three vertex is substituted into cutting face side respectively when triangle
Journey Left:x+CLW=0 meets xj+CLwj>=0, wherein j ∈ [0,2] show that the point is being cut inside clipping region, otherwise the top
Point is in outside;Line segment then brings the first two vertex into above-mentioned cutting face equation, and point pel then needs to bring on first vertex
The cutting face of stating equation judges vertex with after the position relationship in the face of cutting, remaining process of cutting is according to Cohen-
The processing of Sutherland cutting process, remaining cuts the processing in face and left cutting noodles seemingly;
Step (4):After the cutting of step (3), each output for cutting module only remains the cut zone currently distributed
Interior part, rest part have been cut, and each pel for cutting module output respectively executes rasterisation, segment processing, pixel
The operations such as processing, just realize n region parallel drawing in this way.
Advantages of the present invention is that:1, this method can realize parallel drawing on the basis of not changing pel processing sequence;
2, it can facilitate and be extended parallel on single GPU.
Description of the drawings
Fig. 1 is a kind of parallel drawing implementation method divided based on clipping region that the present invention realizes;
Fig. 2 is the Drawing zone range for cutting equation when X-direction and Y-direction are divided respectively and determining;
Fig. 3 is each region drafting content schematic diagram that Drawing zone horizontal direction is divided into 4 regions.
Specific implementation mode
The present invention is described in further details below with reference to the drawings and specific embodiments.
As shown in Figure 1, when carrying out clipping region segmentation in X-direction or Y-direction, the Drawing zone range that equation determines is cut, it will
Drawing zone is divided into n disjoint regions using different cutting equations, and n is natural number, and each cutting module is according to configuration
Parameter respectively execute cutting, each cutting module configuration parameter is different:By the cutting face equation of left and right two of X-directionIt indicates, the lower upper cutting face equation of Y-directionIt indicates, entirely draws area
Domain is divided into n disjoint regions:The value of cutting face parameter configuration of i-th of cutting module is:When selected X-direction is divided
When takeIt is taken when selected Y-direction is dividedI ∈ therein
[1, n], and be natural number.
A kind of implementation method of the parallel drawing technology based on clipping region segmentation, holds according to the following steps in GPU as shown in Figure 2
Row:
The first step:CPU is written to vertex data by bus the corresponding address of memory, and CPU sends out configuration life by bus
It enables and drawing command, 4 component of increase n groups configures parameter { CL, CR, CB, CT, each component is single precision floating datum, every group 4
Component parameters correspond to the cutting equation parameter of a cutting module;
Second step:After GPU receives rendering order, the operations such as command analysis, vertex acquisition, vertex processing and pel assembly are executed,
Each pixel coordinates include x, y, z, and tetra- components of w by the pel assembled while sending n cutting module;
Third walks:According to the cutting equation parameter that the first step configures, cut out successively according to the sequence in left and right, upper and lower cutting face
It cuts, cuts process and the judgement that difference lies in vertex in clipping region of general cutting process of execution, the implementation method
Judgment method is:If current cutting face is left cutting face, if three apex coordinates that input cuts module are respectively A (x0, y0,
z0, w0), B (x1, y1, z1, w1), C (x2, y2, z2, w2), the coordinate on three vertex is substituted into cutting face equation respectively when triangle
Left:x+CLW=0 meets xj+CLwj>=0, wherein j ∈ [0,2] show that the point is being cut inside clipping region, otherwise the vertex
In outside;Line segment then brings the first two vertex into above-mentioned cutting face equation, and point pel then needs to bring on first vertex above-mentioned
Cutting face equation judges vertex with after the position relationship in the face of cutting, remaining process of cutting is according to Cohen-Sutherland
Cutting process processing, remaining cuts the processing in face and left cutting noodles seemingly;
4th step:After the cutting of third step, each output for cutting module only remains in the cut zone currently distributed
Part, rest part has been cut, and each pel for cutting module output respectively executes rasterisation, and segment is handled, at pixel
The operations such as reason, just realize n region parallel drawing in this way.
Fig. 3 is that Drawing zone is horizontally split into 4 disjoint ranges, the content that each region is drawn, wherein (1) indicates
The triangle that entire Drawing zone is drawn, (2) indicate that the content that first cut zone is drawn, (3) indicate second cut zone
The content of drafting, (4) indicate that the content that third cut zone is drawn, (5) indicate the content that the 4th cut zone is drawn.
Claims (3)
- The implementation method of a kind of clipping region cutting techniques for parallel drawing in 1.GPU, it is characterized in that:According to the following steps It executes:Step 1:Receive the primitive vertices coordinate and attribute by vertex processing and pel assembly, configuration pipeline number parameter n And the direction of Drawing zone segmentation, if three apex coordinates received are respectively,,;Step 2:The n groups cutting equation that entire drawing area is divided into n disjoint range is generated, each group of cutting equation wraps Containing left and right, upper and lower four cutting equations, for limiting each clipping region for cutting module;Step 3:Each cuts module and receives the cutting equation that respective step 2 defines, and whether first determines whether each vertex of pel In this clipping region, then handled according to Sutherland-Hodgman trimming algorithms;Step 4:Each pel for cutting module output of step 3 respectively executes rasterisation, and segment is handled, the operations such as processes pixel, N region parallel drawing is just realized in this way.
- The implementation method of a kind of clipping region cutting techniques for parallel drawing in 2.GPU, it is characterized in that:The step 2 will Drawing zone is using the method that equation is divided into the disjoint regions n is cut:(1)By the cutting face equation of left and right two of X-directionIt indicates, the lower upper cutting face of Y-direction is used EquationIt indicates;(2)Entire drawing area is divided into n disjoint regions:The value of the cutting face parameter configuration of the cutting module For:It is taken when being configured to X-direction segmentation, taken when being configured to Y-direction segmentationIt is therein, and be natural number;(3) by the cutting equation parameter of each clipping region,,,Exported respectively to corresponding cutting module.
- The implementation method of a kind of clipping region cutting techniques for parallel drawing in 3.GPU, it is characterized in that:In the step 3 Judge whether the method in clipping region is on pel each vertex:It needs to be carried out according to the cutting face being currently executing different Differentiate:(1)When executing left cutting face cutting, cutting face equation is, bring vertex x coordinate into equation, meet, show the point inside clipping region, otherwise the vertex is in outside, wherein when being currently triangle primitives, when being currently line segment pel, when being currently point pel;(2)When executing right cutting face cutting, cutting face equation is, bring vertex x coordinate into equation, it is full Foot, show the point inside clipping region, otherwise the vertex is in outside, wherein when being currently triangle primitives, when being currently line segment pel, when being currently point pel;(3)When executing lower cutting face cutting, cutting face equation is, bring vertex y-coordinate into equation, Meet, show the point inside clipping region, otherwise the vertex is in outside, wherein being currently triangle primitives When, when being currently line segment pel, when being currently point pel;(4)When cutting face cutting in execution, cutting face equation is, bring vertex y-coordinate into equation, meet, show the point inside clipping region, otherwise the vertex is in outside, wherein when being currently triangle primitives, when being currently line segment pel, when being currently point pel。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810261850.5A CN108389154B (en) | 2018-03-27 | 2018-03-27 | Method for implementing cutting area segmentation technology for parallel drawing in GPU |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810261850.5A CN108389154B (en) | 2018-03-27 | 2018-03-27 | Method for implementing cutting area segmentation technology for parallel drawing in GPU |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108389154A true CN108389154A (en) | 2018-08-10 |
CN108389154B CN108389154B (en) | 2022-12-02 |
Family
ID=63072450
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810261850.5A Active CN108389154B (en) | 2018-03-27 | 2018-03-27 | Method for implementing cutting area segmentation technology for parallel drawing in GPU |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108389154B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109712063A (en) * | 2018-12-12 | 2019-05-03 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of graphics processor Plane Crop circuit |
WO2022011841A1 (en) * | 2020-07-14 | 2022-01-20 | 长沙景嘉微电子股份有限公司 | Implementation method, apparatus, terminal for cluster in gpgpu, and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4972330A (en) * | 1988-06-01 | 1990-11-20 | Oki Electric Industry Co., Ltd. | Clipping process and processor |
JP2009073083A (en) * | 2007-09-21 | 2009-04-09 | Ricoh Co Ltd | Image forming device, image forming method, and image forming program |
CN101976432A (en) * | 2010-11-22 | 2011-02-16 | 长沙景嘉微电子有限公司 | Implementation of hierarchical cutting strategy in graphic chip design |
CN104200425A (en) * | 2014-08-22 | 2014-12-10 | 济南大学 | Device and method for entity clipping during graphic processing unit (GPU) graphic processing |
-
2018
- 2018-03-27 CN CN201810261850.5A patent/CN108389154B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4972330A (en) * | 1988-06-01 | 1990-11-20 | Oki Electric Industry Co., Ltd. | Clipping process and processor |
JP2009073083A (en) * | 2007-09-21 | 2009-04-09 | Ricoh Co Ltd | Image forming device, image forming method, and image forming program |
CN101976432A (en) * | 2010-11-22 | 2011-02-16 | 长沙景嘉微电子有限公司 | Implementation of hierarchical cutting strategy in graphic chip design |
CN104200425A (en) * | 2014-08-22 | 2014-12-10 | 济南大学 | Device and method for entity clipping during graphic processing unit (GPU) graphic processing |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109712063A (en) * | 2018-12-12 | 2019-05-03 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of graphics processor Plane Crop circuit |
CN109712063B (en) * | 2018-12-12 | 2023-03-14 | 中国航空工业集团公司西安航空计算技术研究所 | Plane clipping circuit of graphic processor |
WO2022011841A1 (en) * | 2020-07-14 | 2022-01-20 | 长沙景嘉微电子股份有限公司 | Implementation method, apparatus, terminal for cluster in gpgpu, and medium |
Also Published As
Publication number | Publication date |
---|---|
CN108389154B (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7852340B2 (en) | Scalable shader architecture | |
TWI395155B (en) | Method and system for processing rays, and computer accessible medium including associated data | |
US10204391B2 (en) | Method of and apparatus for processing graphics | |
CN100339874C (en) | Pseudo three dimensional image generating apparatus | |
JPH06223197A (en) | Method and apparatus for tesselation of graphic image | |
EP3333806B1 (en) | Tiling a primitive in a graphics processing system | |
CN109410213A (en) | Polygon pel method of cutting out, computer readable storage medium, electronic equipment based on bounding box | |
US8581937B2 (en) | Seam-based reduction and expansion of images using partial solution matrix dependent on dynamic programming access pattern | |
CN108389154A (en) | The implementation method of a kind of clipping region cutting techniques for parallel drawing in GPU | |
CN112288807B (en) | Method and device for generating intersection data in high-precision map | |
CN113077531A (en) | Tiling primitives in a graphics processing system | |
CN113221895A (en) | Small target detection method, device, equipment and medium | |
CN114764770A (en) | Wafer detection method, device, equipment and storage medium | |
CN114332086B (en) | Textile defect detection method and system based on style migration and artificial intelligence | |
CN106780393B (en) | Image de-noising method based on image set | |
US20120218261A1 (en) | Graphic system comprising a fragment graphic module and relative rendering method | |
CN105574903B (en) | A kind of geometric error modeling synthetic method and system accelerated based on GPU | |
CN103310409B (en) | A kind of Tile-based renders the fast triangle block method of framework GPU | |
CN112749423A (en) | Quick analysis method for removability of supporting structure in any direction | |
JP2013025376A (en) | Image drawing device | |
US20220207827A1 (en) | Systems and methods for distributed rendering using two-level binning | |
US11928808B2 (en) | Wafer detection method, device, apparatus, and storage medium | |
JP2002183741A (en) | Figure processing method | |
JP2010129597A (en) | Drawing method of data point distribution region in scatter diagram, and drawing program of data point distribution region in scatter diagram | |
CN103679806A (en) | Self-adaptive visual shell generation method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |