CN109584334B - Triangular rasterization scanning structure and rasterization scanning method based on UML - Google Patents

Triangular rasterization scanning structure and rasterization scanning method based on UML Download PDF

Info

Publication number
CN109584334B
CN109584334B CN201811355047.4A CN201811355047A CN109584334B CN 109584334 B CN109584334 B CN 109584334B CN 201811355047 A CN201811355047 A CN 201811355047A CN 109584334 B CN109584334 B CN 109584334B
Authority
CN
China
Prior art keywords
scanning
axis
triangle
rasterization
unit
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
CN201811355047.4A
Other languages
Chinese (zh)
Other versions
CN109584334A (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.)
Xian Xiangteng Microelectronics Technology Co Ltd
Original Assignee
Xian Xiangteng Microelectronics 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 Xian Xiangteng Microelectronics Technology Co Ltd filed Critical Xian Xiangteng Microelectronics Technology Co Ltd
Priority to CN201811355047.4A priority Critical patent/CN109584334B/en
Publication of CN109584334A publication Critical patent/CN109584334A/en
Application granted granted Critical
Publication of CN109584334B publication Critical patent/CN109584334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Image Generation (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a triangle rasterization scanning structure and a rasterization scanning method based on UML, comprising the following steps: the data acquisition module is used for acquiring triangular data information; the triangle scanning module is used for scanning the triangle according to the triangle data information and acquiring effective coordinate data according to the scanning result; and the triangle rasterization module is used for rasterizing the scanned triangle according to the effective coordinate data. The triangle rasterization scanning structure based on the UML is integrated with the data acquisition unit, the triangle scanning module and the triangle rasterization module, and data transmission among the data acquisition unit, the triangle scanning module and the triangle rasterization module is realized through a port of the UML, so that X-axis scanning and Y-axis stepping can be executed in parallel, the complexity of triangle rasterization is reduced, and the scanning performance and speed of the triangle rasterization scanning structure are improved.

Description

Triangle rasterization scanning structure and rasterization scanning method based on UML
Technical Field
The invention relates to the technical field of computer graphic scanning, in particular to a triangular rasterization scanning structure and a rasterization scanning method based on UML.
Background
With the increasing of graphics applications, it is difficult for the early solutions of graphics rendering by CPU (Central Processing Unit) alone to meet the graphics Processing requirements of technology growth, and thus Graphics Processing Units (GPUs) have come into play. From the first GPU product released by Nvidia in 1999 to now, the development of GPU technology mainly goes through the fixed function pipeline stage, the separate stainer architecture stage and the unified stainer architecture stage, the graphics processing capability thereof is continuously improved, and the application field is gradually expanded from the initial graphics drawing to the general computing field. The GPU has the characteristics of high speed and parallel pipeline and flexible programmability, and provides a good running platform for graphic processing and general parallel computing.
At present, the development capability of GPU chips in China is weak, and a large number of commercial GPU chips imported from abroad are adopted in display control systems in various fields. Especially in the military field, the foreign imported commercial GPU chip has hidden dangers in the aspects of safety, reliability, guarantee and the like, and cannot meet the requirements of the military environment; moreover, for political, military, economic reasons and the like, technology blocking and product monopoly are carried out in China abroad, and bottom technical data of the GPU chip, such as register data, detailed internal micro-architecture, core software source codes and the like, are difficult to obtain, so that the functions and the performances of the GPU cannot be fully exerted, and the portability is poor; the problems seriously restrict the independent development and the independent development of the display system in China, break through the key technology of the graphics processor and develop the chip of the graphics processor.
At present, the structure for triangle rasterization scanning of the GPU is realized by the Zigzag algorithm, but the structure for triangle rasterization scanning of the GPU realized by the Zigzag algorithm has the advantage that the stepping of the Y axis excessively depends on the ending position of the X-axis bidirectional scanning, so that the complexity of triangle rasterization is increased, and the scanning performance and the speed of the triangle rasterization scanning structure are influenced.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a triangular rasterization scanning structure and a rasterization scanning method based on UML.
One embodiment of the present invention provides a triangular rasterization scanning structure based on UML, including:
the data acquisition module is used for acquiring triangular data information;
the triangle scanning module is connected with the data acquisition module through a first connection port and is used for scanning the triangle according to the triangle data information and acquiring effective coordinate data according to a scanning result;
and the triangular rasterization module is connected with the triangular scanning module through a second connector and is used for rasterizing the scanned triangle according to the effective coordinate data.
In one embodiment of the present invention, the triangle scan module comprises:
the initialization unit is connected with the data acquisition unit through a first connecting port and used for acquiring an X-axis initial coordinate and a Y-axis detection range according to the triangular data information;
the Y-axis stepping unit is connected with the initialization unit and used for enabling the X-axis to be identified and stepping the detection element along the first direction according to the detection range of the Y-axis;
and the plurality of X-axis scanning units are respectively connected with the Y-axis stepping unit and used for scanning the stepped detection elements along the X axis according to the enabling identification and the X-axis initial coordinate.
In an embodiment of the present invention, the second connection port includes a plurality of sub-connection ports, and each of the X-axis scanning units is connected to the triangular rasterization module through a corresponding one of the sub-connection ports.
In one embodiment of the present invention, the X-axis scanning unit includes:
the second direction scanning unit is connected with the Y-axis stepping unit through an AND gate and is used for scanning the stepped detection elements along a second direction according to the enabling identification and the X-axis initial coordinate;
and the third direction scanning unit is connected with the Y-axis stepping unit through an AND gate and is used for scanning the stepped detection elements along the third direction according to the enabling identification and the X-axis initial coordinate.
In an embodiment of the invention, the second direction scanning unit is further configured to provide the first completion flag of the detection element to the Y-axis stepping unit through an and gate.
In an embodiment of the invention, the third direction scanning unit is further configured to provide a second completion flag of the detection element to the Y-axis stepping unit through an and gate.
In one embodiment of the invention, the data acquisition module is a FIFO.
The invention also provides a triangle rasterization scanning method based on UML, which comprises the following steps:
acquiring triangle data information;
scanning the triangle according to the triangle data information, and acquiring effective coordinate data according to a scanning result;
and rasterizing the scanned triangle according to the effective coordinate data.
In one embodiment of the present invention, scanning the triangle according to the triangle data information includes:
acquiring an X-axis initial coordinate and a Y-axis detection range according to the triangular data information;
enabling identification is carried out on an X axis, and the detection elements are stepped along a first direction according to the detection range of the Y axis;
and scanning the stepped detection elements along the X axis according to the enabling identification and the X axis initial coordinate.
In an embodiment of the present invention, the scanning the detection element after the control stepping along the X axis according to the enabling identifier and the X axis start coordinate includes:
scanning the stepped detection elements along a second direction according to the enabling identification and the X-axis initial coordinate;
and scanning the detection elements after the control stepping along a third direction according to the enabling identification and the X-axis initial coordinate.
Compared with the prior art, the invention has the beneficial effects that:
the triangle rasterization scanning structure based on the UML is integrated with a data acquisition unit, a triangle scanning module and a triangle rasterization module, and data transmission among the data acquisition unit, the triangle scanning module and the triangle rasterization module is realized through a port of the UML (Unified Modeling Language), so that X-axis scanning and Y-axis stepping can be executed in parallel, the complexity of triangle rasterization is reduced, and the scanning performance and speed of the triangle rasterization scanning structure are improved.
Drawings
Fig. 1 is a schematic diagram of a triangular rasterization scanning structure based on UML according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a triangle according to an embodiment of the present invention;
fig. 3 is a schematic diagram of another UML-based triangular rasterization scanning structure provided by the embodiment of the present invention;
fig. 4 is a schematic diagram of a further UML-based triangular rasterization scanning structure provided in an embodiment of the present invention;
fig. 5 is a schematic diagram of a triangular rasterization scanning method based on UML according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but the embodiments of the present invention are not limited thereto.
Example one
Referring to fig. 1, fig. 1 is a schematic diagram of a triangular rasterization scanning structure based on UML according to an embodiment of the present invention. The embodiment of the invention provides a triangle rasterization scanning structure based on UML, which comprises:
and the data acquisition module is used for acquiring the triangular data information.
Specifically, referring to fig. 2, the triangle data information is coordinates of three points of the triangle, which may be respectively denoted as V0 (x 0, y 0), V1 (x 1, y 1), and V2 (x 2, y 2), where the triangle used for rasterization scanning may be an acute triangle, a right triangle, and an obtuse triangle.
Preferably, the data obtaining unit is a FIFO (First Input First Output), and the FIFO can buffer the triangle data information and can perform data writing and reading operations on the triangle data information, so as to transmit the triangle data information to the initializing unit.
The triangle scanning module is connected with the data acquisition module through a first connector and is used for scanning the triangle according to the triangle data information and acquiring effective coordinate data according to the scanning result;
specifically, referring to fig. 3, the first connection port is used to implement communication between the Data acquisition module and the Triangle scanning module, and the first connection port includes a first interface and a first port, where the first interface is a Triangle2Fifo version if designed by UML, the first port is a Triangle2Fifo version xport designed by UML, the Data acquisition unit may acquire a current state of the Data acquisition unit through a Get _ Fifo _ Busy _ Status () function, then Read the Triangle Data information in the Data acquisition unit through Read _ Fifo _ version _ Data (), send the Triangle Data information to the Triangle scanning module through the Triangle2Fifo version xf and the Triangle2Fifo version xport, the Data acquisition module may become a Data recipient through the Triangle2Fifo version xp, and initiate the Triangle scanning module to acquire the Triangle Data through the Triangle2Fifo version xport and the Triangle2Fifo 2 active Triangle.
Further, referring to fig. 4, the triangle scanning module includes an initialization unit, a Y-axis stepping unit, and a plurality of X-axis scanning units:
the initialization unit is connected with the data acquisition unit through a first connector and used for acquiring an X-axis initial coordinate and a Y-axis detection range according to the triangular data information;
the initialization unit actively acquires the triangular data information from the data acquisition module through the first connecting port, so that the initialization unit acquires the X-axis initial coordinate and the Y-axis detection range according to the triangular data information, and the effect that the initialization unit actively acquires the triangular data information from the data acquisition module is achieved through the first connecting port, so that the transmission process is simplified, and the transmission rate of the triangular data information is improved.
Specifically, the initialization unit is configured to read valid data in the triangle data information, and perform data initialization operation on the read valid data, so as to determine an X-axis start coordinate and a Y-axis detection range;
further, when the minimum coordinate of the triangle Y axis is denoted as Ymin, ymin = (Y0, Y1, Y2), that is, ymin is the minimum value among Y0, Y1, and Y2, and the maximum coordinate of the triangle Y axis is Ymax, ymax = (Y0, Y1, Y2), that is, ymax is the maximum value among Y0, Y1, and Y2, and the Y axis detection range is denoted as [ Ymin, ymax ].
Further, the X-axis start coordinate (X-axis start coordinate is denoted as X _ scan _ start) is a start coordinate when scanning the X-axis of the triangle, and the X-axis start coordinate for determining rasterization of the triangle is classified into the following cases:
case 1, when y0 ≠ y1 ≠ y2, at which X _ scan _ start = X0 if Ymin = y0, X _ scan _ start = X1 if Ymin = y1, and X _ scan _ start = X2 if Ymin = y 2;
case 2, when y0= y1 ≠ y2, in this case, if Ymin = y0= y1, it is necessary to determine the sizes of X0 and X1, if X1> X0, X _ scan _ start = X0, if X1< X0, X _ scan _ start = X1, and if Ymin = y2, X _ scan _ start = X2;
case 3, when y0 ≠ y1= y2, in this case, if Ymin = y1= y2, it is necessary to determine the sizes of X1 and X2, if X2> X1, X _ scan _ start = X1, if X2< X1, X _ scan _ start = X2, and if Ymin = y0, X _ scan _ start = X0;
in case 4, when y0= y2 ≠ y1, in this case, if Ymin = y0= y2, it is necessary to determine the sizes of X0 and X2, if X2> X0, X _ scan _ start = X0, if X2< X0, X _ scan _ start = X2, and if Ymin = y1, X _ scan _ start = X1.
The X-axis initial coordinate is the initial coordinate of the X-axis scanning to start scanning the triangle after the detecting element steps along the Y-axis along the first direction by a set distance each time.
The Y-axis stepping unit is connected with the initialization unit and used for enabling the X-axis to be identified and stepping the detection elements along the first direction according to the detection range of the Y-axis;
wherein the detection elements are pixels.
Specifically, the Y-axis stepping unit can control the detection element to step along a first direction in a Y-axis detection range, the Y-axis stepping unit is further configured to receive a completion flag signal output by the X-axis scanning unit when the X-axis scanning unit finishes scanning in the Y-axis detection range, and after the Y-axis stepping unit receives the completion flag signal, the Y-axis stepping unit controls the detection element to step along the first direction by a set distance to scan an X axis corresponding to a next Y coordinate until the X axis exceeds the Y-axis detection range, and then the scanning is finished. The Y-axis stepping unit controls the X-axis scanning units together according to the received completion mark signal, so that all the X-axis scanning units can execute in parallel. The Y-axis stepping unit is internally provided with a register, the register is used for identifying an enable bit (enable) of each line of X-axis scanning, the enable bit is used for judging whether each line of X-axis is enabled or not, if the enable bit is enabled, the X-axis scanning unit starts to scan the line, if the enable bit is not enabled, the Y-axis stepping unit controls the detection element to continue stepping along the first direction, wherein if the coordinate of the X-axis of a certain line contains triangular coordinate data, the X-axis is enabled, and if the coordinate of the triangle is not contained, the X-axis is enabled.
Further, the completion flag signal includes a first completion flag and a second completion flag.
Preferably, the starting coordinate of the Y-axis step is set to Ymin and the first direction is the Y-axis forward direction, i.e. the Y-axis stepping unit controls the detecting element to step in the first direction from Ymin until it exceeds Ymax.
Preferably, the Y-axis stepping unit is a Y-axis FSM (Finite State Machine) unit, and the FSM is composed of a State register and a combinational logic circuit, can perform State transition according to a preset State according to a control signal, and is a control center for coordinating related signal actions and completing specific operations.
And the plurality of X-axis scanning units are respectively connected with the Y-axis stepping unit and used for scanning the stepped detection elements along the X axis according to the enabling identification of the X axis and the X-axis initial coordinate.
Each X-axis scanning unit comprises a second direction scanning unit and a third direction scanning unit, each second direction scanning unit is connected with the Y-axis stepping unit through an AND gate, and the second direction scanning units are used for enabling the detection elements to scan along the second direction according to the enabling identification of the X axis and the X-axis initial coordinate; and each third-direction scanning unit is connected with the Y-axis stepping unit through an AND gate and is used for scanning the detection elements along the third direction according to the enabling identification of the X axis and the X-axis initial coordinate. The second direction scanning unit and one third direction scanning unit may be performed in parallel. After stepping along the Y axis each time, the X-axis scanning unit firstly detects whether each X axis is enabled, if so, the second-direction scanning unit and the third-direction scanning unit start scanning, until the scanning is finished, the second-direction scanning unit outputs a first completion mark to the Y-axis stepping unit, the first completion mark indicates that the scanning of the X axis corresponding to the second-direction scanning unit along the second direction is finished, the third-direction scanning unit outputs a second completion mark to the Y-axis stepping unit, and the second completion mark indicates that the scanning of the X axis corresponding to the third-direction scanning unit along the third direction is finished, so that the Y-axis stepping unit obtains the condition of scanning of each row of X axes. And the Y-axis stepping unit updates the enable bit according to the first completion mark and the second completion mark, and reallocates resources to the X-axis scanning unit to enable the X-axis scanning unit to continue the X-axis scanning until the Y-axis stepping jumps out of the Y-axis detection range, so that the triangular rasterization scanning is finished.
The Y-axis stepping unit allocates resources to the X-axis scanning units so that the X-axis scanning units can execute scanning actions in parallel, and the second direction scanning unit and the third direction scanning unit in each X-axis scanning unit can execute the scanning actions in parallel. Meanwhile, the hardware resources distributed to each X-axis scanning unit by the Y-axis stepping unit can realize the scanning of the detection elements along the X-axis under different Y coordinates, if the coordinates Y1-YN all belong to [ Ymin, ymax ], the scanning of the X-axis corresponding to the coordinates Y1-YN can be simultaneously carried out according to the control of the Y-axis stepping unit, so that the X-axis scanning and the Y-axis step can be executed in parallel, the complexity of triangle rasterization is reduced, and the scanning performance and the speed of the triangle rasterization scanning structure are improved.
After the X-axis scanning data of each line, the second direction scanning unit and the third direction scanning unit output effective coordinate data so as to store and record the scanned coordinates. The effective coordinate data is the coordinate corresponding to the triangle with the detection element partially or completely positioned in the initialization, and the coordinate data is the effective coordinate data.
Preferably, the second direction is a positive X-axis direction, and the third direction is a negative X-axis direction.
For example, the number of X-axis scanning units is 4.
And the triangle rasterizing module (triangle rasterizing process) is connected with the triangle scanning module through the second connector and is used for rasterizing the scanned triangle according to the effective coordinate data.
The second connecting port comprises a plurality of sub-connecting ports, and each X-axis scanning unit is connected with the triangular rasterization module through a corresponding sub-connecting port.
Specifically, referring to fig. 3, the second connection port is used to implement communication between the X-axis scanning unit and the Triangle rasterizing module, and each sub-connection port includes a second interface and a second port, where the second port is a Triangle2 rastering [ n ] prot designed by UML, the Triangle rasterizing module can be an active initiator by the Triangle2 rastering [ n ] prot, i.e. the X-axis scanning unit actively transmits valid coordinate Data information to the Triangle rasterizing module, the second interface is a Triangle2 rastering if designed by UML, and the interface function of the Triangle2 rastering if is Send _ rastering _ Fragment _ Data (), so that the Triangle rasterizing module becomes a Data receiver, i.e. the valid coordinate Data acquired by the X-axis scanning unit is actively transmitted to the Triangle rasterizing module by the Triangle2 rastering [ n ] prot and the Triangle2 rastering if.
Further, n in the Triangle2Rasterzing [ n ] prot represents the sequencing of the sub-connectors, if the number of the sub-connectors is 4, and the Triangle2Rasterzing [4] prot is the second port of the fourth sub-connector, n =1,2,3 \8230, the Triangle2Rasterzing [ n ] prot includes Triangle2Rasterzing [1] prot, triangle2Rasterzing [2] prot to Triangle2Rasterzing [ n ] prot, and each second port corresponds to one first interface.
The X-axis scanning units actively transmit the effective coordinate data to the triangular rasterization module through the second connectors, so that the triangular rasterization module rasterizes a triangle according to the effective coordinate data, each X-axis scanning unit is independent and does not interfere with each other, the effective coordinate data of all the X-axis scanning units are not affected by sequence when being transmitted to the triangular rasterization module, the effective coordinate data can be transmitted in parallel, the X-axis scanning units actively transmit the effective coordinate data to the triangular rasterization module through the second connectors, the transmission process is simplified, and the transmission rate of the triangular data information is improved.
The triangular rasterization scanning structure of the embodiment is based on UML, which is a modeling language with good definition, easy expression, powerful function and universal applicability. It integrates the new idea, new method and new technology in the field of software engineering. Its scope is not limited to support object-oriented analysis and design, but also supports the whole process of software development where analysis of requirements begins. UML presents a set of unified modeling notation that is expected by IT professionals for many years. By using UML, these personnel are able to read and communicate system architecture and design plans.
The triangular rasterization scanning structure of the embodiment of the invention is based on UML, and the UML unifies different viewpoints of various methods for dealing with different types of systems, different development stages and different internal concepts, thereby effectively eliminating unnecessary differences among various modeling languages. UML is in fact a general modeling language that can be widely used by many users of object-oriented modeling methods.
The triangular rasterization scanning structure of the embodiment of the invention is based on UML, and the UML modeling capability is stronger than that of other object-oriented modeling methods, and the UML is not only suitable for the development of a general system, but also particularly suitable for the modeling of a parallel and distributed system.
The UML-based triangular rasterization scanning structure provided by the embodiment of the invention is integrated with a data acquisition unit, a triangular scanning module and a triangular rasterization module, and data transmission among the data acquisition unit, the triangular scanning module and the triangular rasterization module is realized through a port of UML (Unified Modeling Language), so that X-axis scanning and Y-axis stepping can be executed in parallel, the complexity of triangular rasterization is reduced, and the scanning performance and speed of the triangular rasterization scanning structure are improved.
The UML-based triangular rasterization scanning structure provided by the embodiment of the invention realizes the definition of the scanning range and the output of effective coordinate data in the triangular rasterization process, and solves the problem that the x-axis scanning and the y-axis stepping can not be executed in parallel in the triangular scanning process of the Zigzag algorithm.
The Y-axis stepping unit of the embodiment of the invention realizes the triangular raster stepping of the GPU, can allocate resources for the X-axis scanning unit, is used for controlling the scanning of the detection elements along the X axis by the second direction scanning unit and the third direction scanning unit, meets the requirement of the triangular raster scanning of the GPU, improves the performance of the triangular raster scanning of the GPU and accelerates the speed of the triangular raster scanning.
It should be noted that, in this embodiment, the first direction is set to be the positive Y-axis direction, and the first direction is set to be the negative Y-axis direction according to the structure of this embodiment, so that the GPU triangle rasterization scanning structure may also be implemented, which is not described again, and it is obvious that those skilled in the art may easily think that the first direction is set to be the negative Y-axis direction, so as to implement the GPU triangle rasterization scanning structure, without having to go through creative labor. Therefore, the present invention is not limited to the above embodiments, and those skilled in the art should make improvements and modifications within the scope of the present invention based on the disclosure of the present invention.
Example two
Referring to fig. 5, fig. 5 is a schematic diagram of a UML-based triangle rasterization scanning method according to an embodiment of the present invention. The embodiment of the present invention provides a schematic diagram of a triangular rasterization scanning method based on UML on the basis of the above embodiment, where the triangular rasterization scanning method includes:
step one, triangular data information is obtained;
specifically, referring to fig. 2, the triangle data information is coordinates of three points of the triangle, which may be respectively denoted as V0 (x 0, y 0), V1 (x 1, y 1), and V2 (x 2, y 2), wherein the triangle used for rasterization scanning may be an acute triangle, a right triangle, and an obtuse triangle.
Further, after the triangle data information is acquired, whether the area of the triangle is 0 or not is judged according to the triangle data information, if so, the triangle is not scanned, and if not, the triangle is scanned according to the triangle data information.
Secondly, scanning the triangle according to the triangle data information, and acquiring effective coordinate data according to the scanning result;
in one embodiment, the X-axis initial coordinate and the Y-axis detection range are obtained according to the triangle data information;
specifically, when the minimum coordinate of the triangle Y axis is denoted as Ymin, ymin = (Y0, Y1, Y2), that is, ymin is the minimum value among Y0, Y1, and Y2, and the maximum coordinate of the triangle Y axis is Ymax, ymax = (Y0, Y1, Y2), that is, ymax is the maximum value among Y0, Y1, and Y2, and the Y axis detection range is denoted as [ Ymin, ymax ].
Further, the X-axis start coordinate (X-axis start coordinate is denoted as X _ scan _ start) is a start coordinate when scanning the X-axis of the triangle, and the X-axis start coordinate for determining rasterization of the triangle is classified into the following cases:
case 1, when y0 ≠ y1 ≠ y2, at which X _ scan _ start = X0 if Ymin = y0, X _ scan _ start = X1 if Ymin = y1, and X _ scan _ start = X2 if Ymin = y 2;
case 2, when y0= y1 ≠ y2, in this case, if Ymin = y0= y1, it is necessary to determine the sizes of X0 and X1, if X1> X0, X _ scan _ start = X0, if X1< X0, X _ scan _ start = X1, and if Ymin = y2, X _ scan _ start = X2;
case 3, when y0 ≠ y1= y2, in this case, if Ymin = y1= y2, it is necessary to determine the sizes of X1 and X2, if X2> X1, X _ scan _ start = X1, if X2< X1, X _ scan _ start = X2, and if Ymin = y0, X _ scan _ start = X0;
in case 4, when y0= y2 ≠ y1, it is necessary to determine the sizes of X0 and X2 if Ymin = y0= y2, X _ scan _ start = X0 if X2> X0, X _ scan _ start = X2 if X2< X0, and X _ scan _ start = X1 if Ymin = y 1.
The X-axis initial coordinate is the initial coordinate of the X-axis scanning to start scanning the triangle after the detecting element steps along the Y-axis along the first direction by a set distance each time.
In one embodiment, enabling identification is carried out on an X axis, and the detection element is stepped along a first direction according to the detection range of the Y axis;
the detection element may be a fragment (tile) or a pixel.
Specifically, the start coordinate of the Y-axis stepping is set to Ymin, an enable bit (enable) of X-axis scanning in each row is identified, whether the X-axis scanning in each row is enabled or not is judged through the enable bit, if the X-axis scanning in each row is enabled, the X-axis scanning unit starts scanning the row, and if the X-axis scanning in each row is not enabled, the detection element is stepped by a set distance in the first direction, wherein if the X-axis coordinate of a certain row includes triangle coordinate data, the X-axis is enabled, and if the X-axis coordinate does not include triangle coordinate data, the X-axis is enabled.
Preferably, the first direction is a positive direction of the Y-axis.
Preferably, the distance is set to one fragment size or one pixel size.
In one embodiment, the scanning of the stepped detection element along the X axis is controlled according to the enabling identification of the X axis and the X axis starting coordinate;
specifically, if the enable bit of a certain row of the X-axis is detected to be enabled, the X-axis coordinate of the row needs to be scanned;
further, scanning the stepped detection element along the second direction according to the enabling identifier of the X axis and the X axis initial coordinate, scanning the stepped detection element along the third direction according to the enabling identifier of the X axis and the X axis initial coordinate, namely, when the enabling position of a certain line of X axis is detected to be enabled, scanning the line of X axis coordinates along the second direction according to a set distance, after the scanning of the second direction is finished, scanning the line of X axis coordinates along the third direction according to the set distance, after the scanning of the line of X axis coordinates is finished, stepping the detection element along the first direction according to the set distance, scanning the next line of X axis coordinates, judging whether the stepped Y coordinate is in the Y axis detection range or not, if the stepped Y coordinate belongs to the Y axis detection range, judging the enabling position of the line of X axis, if the enabling, scanning the X axis according to the method until the Y axis detection range is exceeded, finishing the scanning, and if the Y axis detection range is not, finishing the scanning.
Preferably, the second direction is a positive X-axis direction, and the third direction is a negative X-axis direction.
According to the UML-based triangular rasterization scanning method provided by the embodiment of the invention, X-axis scanning and Y-axis stepping can be executed in parallel, the complexity of triangular rasterization is reduced, and the scanning performance and speed of a triangular rasterization scanning structure are improved.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A UML-based triangular rasterized scanning structure, comprising:
the data acquisition module is used for acquiring triangular data information;
the triangle scanning module is connected with the data acquisition module through a first connecting port and is used for scanning the triangle according to the triangle data information and acquiring effective coordinate data according to a scanning result;
the triangular rasterization module is connected with the triangular scanning module through a second connecting port and is used for rasterizing the scanned triangle according to the effective coordinate data;
the triangle scanning module includes:
the initialization unit is connected with the data acquisition unit through a first connection port and used for acquiring X-axis initial coordinates and Y-axis detection ranges according to the triangular data information;
the Y-axis stepping unit is connected with the initialization unit and used for enabling the X-axis to be identified and stepping the detection elements along a first direction according to the detection range of the Y-axis;
the X-axis scanning units are respectively connected with the Y-axis stepping unit and used for scanning the stepped detection elements along the X axis according to the enabling identification and the X-axis initial coordinate;
the X-axis scanning unit includes:
the second direction scanning unit is connected with the Y-axis stepping unit through an AND gate and is used for scanning the stepped detection elements along a second direction according to the enabling identification and the X-axis initial coordinate;
and the third direction scanning unit is connected with the Y-axis stepping unit through an AND gate and is used for scanning the stepped detection elements along the third direction according to the enabling identification and the X-axis initial coordinate.
2. The rasterization scanning architecture of claim 1 wherein said second connection port comprises a plurality of sub-connection ports, and each of said X-axis scanning units is connected to said triangular rasterization module through a corresponding one of said sub-connection ports.
3. The rasterization scan architecture of claim 2 wherein said second direction scanning unit is further configured to provide said Y-axis stepping unit with a first completion flag for said detected element through an and gate.
4. The rasterization scan architecture of claim 2 wherein said third directional scanning unit is further configured to provide a second completion flag for said detected element to said Y-axis stepping unit through an and gate.
5. The rasterization scanning architecture of claim 1, wherein said data acquisition module is a FIFO.
6. A triangle rasterization scanning method based on UML is characterized by comprising the following steps:
acquiring triangle data information;
scanning the triangle according to the triangle data information, and acquiring effective coordinate data according to a scanning result;
rasterizing the scanned triangle according to the effective coordinate data;
scanning the triangle according to the triangle data information, and acquiring effective coordinate data according to a scanning result, including:
acquiring an X-axis initial coordinate and a Y-axis detection range according to the triangular data information;
enabling identification is carried out on the X axis, and the detection elements are stepped along the first direction according to the detection range of the Y axis;
scanning the stepped detection elements along the X axis according to the enabling identification and the X axis initial coordinate;
enabling the stepped detection elements to scan along the X axis according to the enabling identification and the X axis initial coordinate, and the method comprises the following steps:
scanning the stepped detection elements along a second direction according to the enabling identification and the X-axis initial coordinate;
and scanning the stepped detection elements along a third direction according to the enabling identification and the X-axis initial coordinate.
CN201811355047.4A 2018-11-14 2018-11-14 Triangular rasterization scanning structure and rasterization scanning method based on UML Active CN109584334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811355047.4A CN109584334B (en) 2018-11-14 2018-11-14 Triangular rasterization scanning structure and rasterization scanning method based on UML

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811355047.4A CN109584334B (en) 2018-11-14 2018-11-14 Triangular rasterization scanning structure and rasterization scanning method based on UML

Publications (2)

Publication Number Publication Date
CN109584334A CN109584334A (en) 2019-04-05
CN109584334B true CN109584334B (en) 2023-04-07

Family

ID=65922497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811355047.4A Active CN109584334B (en) 2018-11-14 2018-11-14 Triangular rasterization scanning structure and rasterization scanning method based on UML

Country Status (1)

Country Link
CN (1) CN109584334B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111091487B (en) * 2019-11-18 2023-10-20 中国航空工业集团公司西安航空计算技术研究所 TLM microstructure for GPU hardware line primitive raster scanning algorithm

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010055611A (en) * 2008-08-29 2010-03-11 Fujitsu Ltd Triangle traversing method and device in graphics rasterization
CN102004832A (en) * 2010-11-22 2011-04-06 长沙景嘉微电子有限公司 Realization of triangle rasterization based on horizontal line scanning
CN108009978A (en) * 2017-11-24 2018-05-08 中国航空工业集团公司西安航空计算技术研究所 A kind of non-parallel triangle rasterization cellular construction of obstruction
CN108022201A (en) * 2017-11-24 2018-05-11 中国航空工业集团公司西安航空计算技术研究所 A kind of triangle primitives rasterize method for sequencing parallel

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7362325B2 (en) * 2004-12-21 2008-04-22 Qualcomm Incorporated 2D/3D line rendering using 3D rasterization algorithms

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010055611A (en) * 2008-08-29 2010-03-11 Fujitsu Ltd Triangle traversing method and device in graphics rasterization
CN102004832A (en) * 2010-11-22 2011-04-06 长沙景嘉微电子有限公司 Realization of triangle rasterization based on horizontal line scanning
CN108009978A (en) * 2017-11-24 2018-05-08 中国航空工业集团公司西安航空计算技术研究所 A kind of non-parallel triangle rasterization cellular construction of obstruction
CN108022201A (en) * 2017-11-24 2018-05-11 中国航空工业集团公司西安航空计算技术研究所 A kind of triangle primitives rasterize method for sequencing parallel

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种并行扫描的三角形光栅化算法设计与实现;聂等;《信息通信》;20160315(第03期);全文 *
基于Zigzag块扫描的光栅化算法设计与实现;聂等;《科技风》;20160415(第07期);全文 *

Also Published As

Publication number Publication date
CN109584334A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
US10067797B2 (en) Application programming interfaces for data parallel computing on multiple processors
CN101739357B (en) Multi-class data cache policies
US8248401B2 (en) Accelerated data structure optimization based upon view orientation
US9495722B2 (en) Developer controlled layout
US9292965B2 (en) Accelerated data structure positioning based upon view orientation
CN108845863B (en) Communication method, device and system for virtual machine and host machine
KR100882842B1 (en) Apparatus to use a fifo as a post-vertex cache and method thereof
CN102981892A (en) Centralized device virtualization layer for heterogeneous processing units
GB2493807A (en) Multithreaded physics engine with impulse propagation
KR20120096119A (en) Graphic processor and early visibility testing method
EP2057604A1 (en) Parallel physics simulation and graphics processing
CN111667542B (en) Decompression technique for processing compressed data suitable for artificial neural network
US20130312011A1 (en) Processing posted receive commands in a parallel computer
US8174524B1 (en) Ray hit coalescing in a computer rendering program
EP4231242A1 (en) Graphics rendering method and related device thereof
CN110223216B (en) Data processing method and device based on parallel PLB and computer storage medium
EP3050605B1 (en) A method for event detection in real-time graphic applications
CN110825435B (en) Method and apparatus for processing data
CN109584334B (en) Triangular rasterization scanning structure and rasterization scanning method based on UML
US8578068B2 (en) Method of data communications with reduced latency
CN109346028B (en) TLM-based triangular raster scanning structure
US20200027189A1 (en) Efficient dependency detection for concurrent binning gpu workloads
CN109598669B (en) GPU-oriented triangular rasterization scanning system
CN112614210B (en) Engineering drawing display method, system and related device
CN111124994B (en) Data transmission method and device, GPU and readable storage medium

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