A graphics processor with attribute-adaptive primitive assembly circuitry

By using an adaptive primitive assembly circuit, the number of assembled attributes is adaptively determined based on the validity of attributes marked by OpenGL commands. This solves the problem of low bandwidth utilization caused by random combination of attribute information in graphics processors, and improves primitive processing capability and bandwidth utilization.

CN115393160BActive Publication Date: 2026-03-17西安翔腾微电子科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-20
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In the process of primitive assembly, existing graphics processors randomly combine attribute information, resulting in low bandwidth utilization and affecting processing capabilities.

Method used

The primitive assembly circuit, which adopts a pipelined design, uses a command parsing unit, an attribute configuration unit, and an adaptive assembly unit to adaptively determine the number of attributes to be assembled based on whether the OpenGL command marks the attributes are valid, and removes invalid attributes, thereby improving primitive processing capabilities.

Benefits of technology

It improves primitive processing capabilities, reduces the workload of the graphics processor's geometry stage, and enhances bandwidth utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115393160B_ABST
    Figure CN115393160B_ABST
Patent Text Reader

Abstract

The application discloses a primitive assembly circuit of an attribute-adaptive graphics processor, which comprises a command analysis unit, an attribute configuration unit, an adaptive assembly unit and a command output unit. The command analysis unit analyzes a self-defined OpenGL command package; the attribute configuration unit sets 12 attribute mark bits corresponding to 12 attributes and marks whether attributes are valid according to the analyzed OpenGL command; the adaptive assembly unit adopts a finite state machine to adaptively assemble a primitive according to attribute valid bits, and attributes with invalid attribute marks are discarded; and the command output unit outputs the assembled command to a lower-stage pipeline of the graphics processor. The primitive assembly circuit of the attribute-adaptive graphics processor can significantly reduce the workload of a geometry stage of the graphics processor, thereby improving the primitive processing capacity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer hardware technology, and to a primitive assembly circuit, and more particularly to a primitive assembly circuit for a graphics processor with adaptive attributes. Background Technology

[0002] Primitive assembly is a crucial step in the geometry stage of a graphics processing unit (GPU) during the transformation from vertices to graphics. The OpenGL standard defines 10 primitives, which are broken down into three basic primitives—points, lines, and triangles—before being sent to the subsequent GPU pipeline to simplify processing. The primitive assembly capability directly impacts the overall processing power of the geometry stage, thus affecting the overall performance of the GPU. Since primitives carry attribute information such as vertex coordinates, color, and texture coordinates, and these attributes can be randomly combined, packaging all this information into a single command requires significant bandwidth, and the randomness of the attributes results in extremely low bandwidth utilization. Therefore, this field requires a circuit that adaptively determines the number of attributes to assemble based on the issued OpenGL commands, which can greatly improve primitive assembly processing capabilities. Summary of the Invention

[0003] To address the technical problems existing in the background art, this invention provides a primitive assembly circuit for a graphics processor with adaptive attributes. This invention adopts a pipeline design, adds and sets attribute marker bits for each vertex, parses OpenGL commands to mark attributes for primitive assembly, and outputs valid attributes to the graphics processor pipeline through an adaptive assembly finite state machine, removing attributes that do not need to be assembled, reducing the processing workload of the graphics processor's geometry stage, thereby improving primitive processing capabilities.

[0004] The technical solution of the present invention is a primitive assembly circuit for a graphics processor with adaptive attributes, characterized in that it includes a command parsing unit, an attribute configuration unit, an adaptive assembly unit, and a command output unit.

[0005] The command parsing unit described above is used to parse custom 148-bit OpenGL command packages;

[0006] The aforementioned attribute configuration unit has 12 attribute flag bits; each attribute table corresponds to one attribute; the aforementioned attribute configuration unit marks whether the attribute is valid according to the OpenGL command parsed by the command parsing unit;

[0007] The aforementioned adaptive assembly unit uses a finite state machine to sequentially determine 12-bit attribute markers. These 12-bit attribute markers include coordinates, front primary color, front secondary color, back primary color, back secondary color, fog coordinates, 0-layer texture adaptive assembly primitives, 1-layer texture adaptive assembly primitives, 2-layer texture adaptive assembly primitives, 3-layer texture adaptive assembly primitives, 4-layer texture adaptive assembly primitives, and 5-layer texture adaptive assembly primitives. When an attribute marker is invalid, the corresponding attribute is discarded, and only valid attributes are assembled.

[0008] The command output unit described above outputs the assembled simple graphics commands to the next stage pipeline of the graphics processor.

[0009] The command parsing unit mentioned above is used to receive parsing commands and, if the preceding vertex command FIFO has data, to retrieve primitive vertex commands from the command FIFO and parse them.

[0010] The above parsing command format is a custom OpenGL command. Each command consists of a 10-bit command code, a 10-bit control word, and 128 bits of data, starting from the most significant bit.

[0011] The above command code adopts a 4+6 structure, with the high 4 bits being the serial number and the low 6 bits being the command number;

[0012] The functions of the aforementioned control words are related to commands, and can obtain detailed information about the command.

[0013] The above data can be divided into four 32-bit data sets, each containing the specific parameter values ​​carried by the command.

[0014] The attribute markers in the aforementioned attribute configuration unit include valid markers and invalid markers; the valid markers are 12-bit data.

[0015] When the attribute configuration unit receives the glVertex command, it sets the valid bit

[11] of the coordinate attribute to 1;

[0016] When lighting is enabled, the effective positions bit[10:7] corresponding to the front primary color, front secondary color, back primary color, and back secondary color attributes of the vertex are set to 1;

[0017] When lighting is off, the valid bit[6] of the color attribute is set to 1;

[0018] When the glActiveTexture command is received and glEnable is enabled for any of the 1D, 2D, 3D, or CUBE parameters, the effective texture is determined according to the glActiveTexture parameters. Then, the corresponding effective bits in bit[5:0] are marked as 1. The storage order from high to low is as follows: coordinates, front primary color, front secondary color, back primary color, back secondary color, fog coordinates, 0-layer texture adaptive assembly primitive, 1-layer texture adaptive assembly primitive, 2-layer texture adaptive assembly primitive, 3-layer texture adaptive assembly primitive, 4-layer texture adaptive assembly primitive, and 5-layer texture adaptive assembly primitive.

[0019] The aforementioned adaptive assembly unit uses an adaptive assembly finite state machine to determine the valid bits of the 12-bit attribute tags from high to low based on the valid tag. When a tag is valid, the corresponding attribute data is assembled into the vertex command packet; when an attribute tag is invalid, the corresponding attribute data is discarded.

[0020] The aforementioned adaptive assembly unit reassembles 10 primitives into three simple shapes: points, lines, and triangles. Assembling a point requires one vertex, a line segment requires two vertices, and a triangle requires three vertices. Since lighting is either on or off, the color attribute and the set of attributes (front primary color, front secondary color, back primary color, and back secondary color) cannot be effective simultaneously. Therefore, a vertex can carry a maximum of 11 attributes and a minimum of 2 attributes. Thus, all graphic command packages range from 2 to 33 command packages to assemble one primitive.

[0021] The aforementioned command output unit is responsible for sending primitive vertex commands and contains a FIFO storage; the aforementioned output commands include pass-through OpenGL commands, assembled vertex attribute commands, and raster commands;

[0022] The above output command format consists of a command code, a control word, and data. The output command code is bits 147-138 of the output command. The command code structure adopts a 4+6 format. The first four bits are the serial number, which is used to represent the unique number of each pipeline process in the graphics processor. The last six bits represent the command code used to indicate the attribute label of the primitive. The control word is bits 137-128 of the output command, including the attribute end marker, drawing mode, vertex type, and perspective correction flag.

[0023] The control word bit[9] indicates whether the attribute carried by the current command is the last attribute of the current vertex, and bit[5:3] indicates the type of the vertex being transmitted;

[0024] bit[2] indicates the start marker of application-level primitives;

[0025] Using 0 in line drawing mode: indicates that the primitive carried by this command is not the beginning of an application-level primitive;

[0026] 1: This indicates that the graphic element carried by this command is the beginning of the application-level graphic element;

[0027] The above data represents vertex attribute data.

[0028] The advantages and effects of this invention are:

[0029] A graphics processor attribute adaptive primitive assembly circuit is provided, which can adaptively output vertex-carrying attributes according to received commands, and directly remove invalid attributes from the pipeline, thereby greatly reducing the workload of graphics processing in the geometry stage and improving primitive processing performance. Attached Figure Description

[0030] Figure 1 This is a general block diagram of a graphics processor attribute adaptive primitive assembly circuit according to the present invention;

[0031] Figure 2 This is a schematic diagram of the adaptive assembly state machine in this invention. Detailed Implementation

[0032] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.

[0033] like Figure 1 As shown, a primitive assembly circuit for an attribute-adaptive graphics processor includes a command parsing unit, an attribute configuration unit, an adaptive assembly unit, and a command output unit.

[0034] The command parsing unit is used to parse custom 148-bit OpenGL command packages;

[0035] The attribute configuration unit has 12 attribute flag bits; each attribute table corresponds to one attribute; the attribute configuration unit marks whether the attribute is valid according to the OpenGL command parsed by the command parsing unit;

[0036] The adaptive assembly unit uses a finite state machine to sequentially evaluate 12-bit attribute markers. These 12-bit attribute markers include coordinates, front primary color, front secondary color, back primary color, back secondary color, fog coordinates, 0-layer texture adaptive assembly primitives, 1-layer texture adaptive assembly primitives, 2-layer texture adaptive assembly primitives, 3-layer texture adaptive assembly primitives, 4-layer texture adaptive assembly primitives, and 5-layer texture adaptive assembly primitives. When an attribute marker is invalid, the corresponding attribute is discarded, and only valid attributes are assembled.

[0037] The command output unit outputs the assembled simple graphics commands to the next stage pipeline of the graphics processor.

[0038] The command parsing unit is used to receive parsing commands and, if the preceding vertex command FIFO has data, to retrieve primitive vertex commands from the command FIFO and parse them.

[0039] The parsing command format is a custom OpenGL command. Each command consists of a 10-bit command code, a 10-bit control word, and 128 bits of data, starting from the most significant bit.

[0040] The command code adopts a 4+6 structure, with the high 4 bits being the serial number and the low 6 bits being the command number;

[0041] The function of a control word is related to a command, and it can provide detailed information about that command.

[0042] The data can be divided into four 32-bit data sets, each containing the specific parameter values ​​carried by the command. The attribute flags in the attribute configuration unit include valid and invalid flags; the valid flags are 12-bit data.

[0043] When the attribute configuration unit receives the glVertex command, it sets the valid bit

[11] of the coordinate attribute to 1;

[0044] When lighting is enabled, the effective positions bit[10:7] corresponding to the front primary color, front secondary color, back primary color, and back secondary color attributes of the vertex are set to 1;

[0045] When lighting is off, the valid bit[6] of the color attribute is set to 1;

[0046] When the glActiveTexture command is received and glEnable is enabled for any of the 1D, 2D, 3D, or CUBE parameters, the effective texture is determined according to the glActiveTexture parameters. Then, the corresponding effective bits in bit[5:0] are marked as 1. The storage order from high to low is as follows: coordinates, front primary color, front secondary color, back primary color, back secondary color, fog coordinates, 0-layer texture adaptive assembly primitive, 1-layer texture adaptive assembly primitive, 2-layer texture adaptive assembly primitive, 3-layer texture adaptive assembly primitive, 4-layer texture adaptive assembly primitive, and 5-layer texture adaptive assembly primitive.

[0047] The aforementioned adaptive assembly unit uses an adaptive assembly finite state machine to determine the valid bits of the 12-bit attribute tags from high to low based on the valid tag. When a tag is valid, the corresponding attribute data is assembled into the vertex command packet; when an attribute tag is invalid, the corresponding attribute data is discarded.

[0048] The adaptive assembly unit reassembles 10 primitives into three simple shapes: points, lines, and triangles. Assembling a point requires one vertex, a line segment requires two vertices, and a triangle requires three vertices. Since lighting is either on or off, the color attribute and the set of attributes (front primary color, front secondary color, back primary color, and back secondary color) cannot be effective simultaneously. Therefore, a vertex can carry a maximum of 11 attributes and a minimum of 2 attributes. Thus, all graphic command packages range from 2 to 33 command packages to assemble one primitive.

[0049] The command output unit is responsible for sending primitive vertex commands and contains a FIFO storage; the output commands include pass-through OpenGL commands, assembled vertex attribute commands, and raster commands.

[0050] The output command format consists of a command code, a control word, and data. The output command code is bits 147-138 of the output command. The command code structure adopts a 4+6 format, with the first four bits being a serial number, used to represent the unique number of each pipeline process in the graphics processor, and the last six bits representing the command code used to indicate the attribute marker of the primitive. The control word is bits 137-128 of the output command, including the attribute end marker, drawing mode, vertex type, and perspective correction flag.

[0051] The control word bit[9] marks whether the attribute carried by the current command is the last attribute of the current vertex, and bit[5:3] indicates the type of the vertex being transmitted;

[0052] bit[2] indicates the start marker of application-level primitives;

[0053] Using 0 in line drawing mode: indicates that the primitive carried by this command is not the beginning of an application-level primitive;

[0054] 1: This indicates that the graphic element carried by this command is the beginning of the application-level graphic element;

[0055] The above data represents vertex attribute data.

[0056] More specifically: a graphics processor primitive attribute adaptive assembly circuit overall structure, comprising four parts: command parsing unit, attribute configuration unit, adaptive assembly unit, and command output unit.

[0057] When the command receiving and parsing unit determines that the preceding FIFO empty signal is 0, indicating that a command needs to be processed, it outputs the rden signal as 1, indicating that a read operation is initiated. It receives the vertex command cmd signal from the graphics processor's preceding pipeline for parsing. After the data output signal vout1 is active high (indicating confirmation that the next-level unit has acquired the data, i.e., rout1 signal is high), the data output signal is withdrawn. The command code (code), control word (ctrl), and data from the cmd signal are sent to the attribute configuration stage. First, the preceding pipeline commands are parsed. The parsed commands are divided into three main categories: pass-through commands, raster position commands, and primitive type commands.

[0058] After the attribute configuration unit completes the marking of the attributes carried by the vertices, it confirms that the data output signal is valid (vout2 signal is high) and that the first-level unit has obtained the data (rout2 signal is high), then cancels the data output signal. The command packet `data` is sent to the adaptive assembly stage. Vertex attribute commands are used to specify 12 attributes of a vertex, where `glVertex` must be between `glBegin` and `glEnd`. When such a command is received, its carried vertex attributes are first written into the current attribute register group. When the `glVertex` command is received, the vertex coordinates are stored in the current attribute register group, indicating that all attributes of a vertex have been received. Raster operation commands are directly output after modifying the command code, and then the corresponding color values ​​in the current attribute group are assembled and output. The attribute end bit of the output `glRasterPos` command is invalid; when outputting color commands, the attribute end bit is valid. Stack operation commands receive `glPushAttrib` and `glPopAttribute` commands, parse them, and perform corresponding operations on the attributes that need to be pushed onto or popped from the stack for primitive assembly based on the enable of the attribute group, and configure the corresponding attribute and parameter registers. If an overflow or underflow error occurs during push or pop operations, no stack operations are performed. Pass-through commands, except for the previous four types, output all other commands directly without any modification.

[0059] After receiving a vertex command, the adaptive assembly unit parses the header attribute markers and stores the vertex-carried attributes in the vertex buffer register. Then, based on the command encoding, it determines whether the vertex command belongs to a point, line, or triangle primitive. It reads the command from the vertex buffer register and performs adaptive assembly via a finite state machine. Once the data output signal is valid (vout2 signal is high), and the subsequent unit has confirmed that it has obtained the data (rout2 signal is high), the data output signal is withdrawn. The command packet `data` is then sent to the command output stage. Figure 2 As shown, when a vertex attribute command or rasterization command is parsed, it is sent through the marked attribute. The command is assembled according to the primitive type, and 2 to 33 commands are packaged into one primitive.

[0060] Implemented using a finite state machine, it mainly consists of three parts: raster commands, primitive commands, and pass-through commands. Upon receiving a new command, if it's a pass-through command, it's output directly without entering the state machine. Otherwise, the command is parsed and classified into raster and primitive types. Idle state STAT_IDLE: Entered after reset cancellation. If the raster flag is 1, it enters STAT_RAST_V; if it's a triangle primitive, it enters SEND_1; if it's a line primitive, it enters SEND_13; if it's a point primitive, it enters SEND_25; otherwise, it enters the idle state. Triangle vertex 1 coordinate valid state SEND_1: Entered when the current command is a primitive, the output is a triangle primitive, and the coordinate attributes are valid. If the frontal main color is valid, it enters SEND_2; otherwise, if the color attribute is valid, it enters SEND_6; otherwise, it remains in SEND_1. Triangle vertex 1 frontal main color valid state SEND_2: Entered when the current command is a primitive, the output is a triangle primitive, and the frontal main color attribute is valid. If the transmission is valid, enter the SEND_3 state; otherwise, remain in the SEND_2 state. Triangle Vertex 1 Front Secondary Color Valid State (SEND_3): Enters this state when the current command is a primitive, the output is a triangle primitive, and the front secondary color attribute is valid. If the transmission is valid, enter the SEND_4 state; otherwise, remain in the SEND_3 state. Triangle Vertex 1 Backside Primary Color Valid State (SEND_4): Enters this state when the current command is a primitive, the output is a triangle primitive, and the backside primary color attribute is valid. If the transmission is valid, enter the SEND_5 state; otherwise, remain in the SEND_4 state. Triangle Vertex 1 Backside Secondary Color Valid State (SEND_5): Enters this state when the current command is a primitive, the output is a triangle primitive, and the backside secondary color attribute is valid. If the transmission is valid, enters the SEND_7 state if 0-layer texture is valid, enters the SEND_8 state if 1-layer texture is valid, enters the SEND_9 state if 2-layer texture is valid, enters the SEND_10 state if 3-layer texture is valid, enters the SEND_11 state if 4-layer texture is valid, and enters the SEND_12 state if 5-layer texture is valid. If the current state is a primitive command, the output is a triangle primitive, and the color attribute is valid, then enter this state. If the current state is valid, enter SEND_7 if the current state is 0-layer texture, enter SEND_8 if the current state is 1-layer texture, enter SEND_9 if the current state is 2-layer texture, enter SEND_10 if the current state is 3-layer texture, enter SEND_11 if the current state is 4-layer texture, enter SEND_12 if the current state is 5-layer texture, otherwise enter SEND_13. If the current state is invalid, then remain in SEND_6.Triangle Vertex 1 Texture 0 Valid State SEND_7: Entering this state when the current primitive command is valid, the output is a triangle primitive, and the texture 0 attribute is valid. If the send is valid, a 1-layer texture is valid, entering SEND_8; a 2-layer texture is valid, entering SEND_9; a 3-layer texture is valid, entering SEND_10; a 4-layer texture is valid, entering SEND_11; a 5-layer texture is valid, entering SEND_12; otherwise, entering SEND_13. If the send is invalid, it remains in SEND_7. Triangle Vertex 1 Texture 1 Valid State SEND_8: Entering this state when the previous primitive command is valid, the output is a triangle primitive, and the texture 1 attribute is valid. If the send is valid, a 2-layer texture is valid, entering SEND_9; a 3-layer texture is valid, entering SEND_10; a 4-layer texture is valid, entering SEND_11; a 5-layer texture is valid, entering SEND_12; otherwise, entering SEND_13. If the send is invalid, it remains in SEND_8. Triangle Vertex 1 Texture 2 Valid State SEND_9: The current primitive command, outputting a triangle primitive, and with texture 2 being valid, enters this state. If the transmission is valid, a 3-layer texture is valid, entering SEND_10; a 4-layer texture is valid, entering SEND_11; a 5-layer texture is valid, entering SEND_12; otherwise, entering SEND_13. If the transmission is invalid, it remains in SEND_9. Triangle vertex 1 texture 3 valid state SEND_10: The current primitive command, outputting a triangle primitive, and with texture 3 being valid, enters this state. If the transmission is valid, a 4-layer texture is valid, entering SEND_11; a 5-layer texture is valid, entering SEND_12; otherwise, entering SEND_13. If the transmission is invalid, it remains in SEND_10. Triangle vertex 1 texture 4 valid state SEND_11: The current primitive command, outputting a triangle primitive, and with texture 4 being valid, enters this state. If the transmission is valid, a 4-layer texture is valid, entering SEND_11; a 5-layer texture is valid, entering SEND_12; otherwise, entering SEND_13. If the transmission is invalid, it remains in SEND_10. If the texture is valid, enter SEND_12; otherwise, enter SEND_13. If the transmission is invalid, remain in SEND_11. Triangle vertex 1 texture 5 valid state SEND_12: This state is entered when the current primitive command outputs a triangle primitive and texture 5 is valid. If the transmission is valid, enter SEND_13; otherwise, remain in SEND_12. Triangle vertex 2 coordinates valid state / Line vertex 1 coordinates valid state SEND_13: This state is entered when the current primitive command outputs a triangle or line primitive and coordinate attributes are valid. If the main color is valid, enter SEND_14; otherwise, if the color attribute is valid, enter SEND_18; otherwise, remain in SEND_13.Triangle Vertex 2 Frontal Primary Color Valid State / Line Vertex 1 Frontal Primary Color Valid State SEND_14: Enters this state when the current element command is a triangle or line element and the frontal primary color attribute is valid. If the sending is valid, it enters the SEND_15 state; otherwise, it remains in the SEND_14 state. Triangle Vertex 2 Frontal Secondary Color Valid State / Line Vertex 1 Frontal Secondary Color Valid State SEND_15: Enters this state when the current element command is a triangle or line element and the frontal secondary color attribute is valid. If the sending is valid, it enters the SEND_16 state; otherwise, it remains in the SEND_15 state. Triangle Vertex 2 Backward Primary Color Valid State / Line Vertex 1 Backward Primary Color Valid State SEND_16: Enters this state when the current element command is a triangle or line element and the backward primary color attribute is valid. If the sending is valid, it enters the SEND_17 state; otherwise, it remains in the SEND_16 state. Triangle vertex 2 backface color valid state / Line vertex 1 backface color valid state SEND_17: Enters this state when the current primitive command is active, the output is a triangle or line primitive, and the backface color attribute is valid. If the send is valid, enters SEND_19 if 0-layer texture is valid, SEND_20 if 1-layer texture is valid, SEND_21 if 2-layer texture is valid, SEND_22 if 3-layer texture is valid, SEND_23 if 4-layer texture is valid, and SEND_24 if 5-layer texture is valid; otherwise, enters SEND_25. The state remains in SEND_17 if the send is invalid; SEND_18: Enters this state when the current primitive command outputs a triangle or line primitive and the color attribute is valid. If the send is valid, it enters SEND_19 if 0 textures are valid, SEND_20 if 1 texture is valid, SEND_21 if 2 textures are valid, SEND_22 if 3 textures are valid, SEND_23 if 4 textures are valid, and SEND_24 if 5 textures are valid. If the current state is a primitive command, the output is a triangle or line primitive, and the texture 0 attribute is valid, then enter the SEND_18 state. If the send is valid, enter the SEND_20 state if the 1st texture is valid, enter the SEND_21 state if the 2nd texture is valid, enter the SEND_22 state if the 3rd texture is valid, enter the SEND_23 state if the 4th texture is valid, and enter the SEND_24 state if the 5th texture is valid. Otherwise, enter the SEND_25 state. If the send is invalid, continue to stay in the SEND_19 state.Triangle vertex 2 texture 1 valid state / Line vertex 1 texture 1 valid state SEND_20: Enters this state when the current primitive command is valid, the output is a triangle or line primitive, and the texture 1 attribute is valid. If the send is valid, a 2-layer texture is valid, entering SEND_21; a 3-layer texture is valid, entering SEND_22; a 4-layer texture is valid, entering SEND_23; a 5-layer texture is valid, entering SEND_24; otherwise, entering SEND_25. If the send is invalid, it remains in SEND_20. Triangle vertex 2 texture 2 valid state / Line vertex 1 texture 2 valid state SEND_21: Enters this state when the current primitive command is valid, the output is a triangle or line primitive, and the texture 2 attribute is valid. If the send is valid, a 3-layer texture is valid, entering SEND_22; a 4-layer texture is valid, entering SEND_23; a 5-layer texture is valid, entering SEND_24; otherwise, entering SEND_25. If the send is invalid, it remains in SEND_21. Triangle vertex 2 texture 3 valid state / Line vertex 1 texture 3 valid state SEND_22: Enters this state when the current primitive command is valid, the output is a triangle or line primitive, and the texture 3 attribute is valid. If the send is valid, a 4-fold texture is valid, entering the SEND_23 state; if a 5-fold texture is valid, entering the SEND_24 state; otherwise, entering the SEND_25 state. If the send is invalid, it remains in the SEND_23 state. Triangle vertex 2 texture 4 valid state / Line vertex 1 texture 4 valid state SEND_23: Enters this state when the current primitive command is valid, the output is a triangle or line primitive, and the texture 4 attribute is valid. If the send is valid, a 5-fold texture is valid, entering the SEND_24 state; otherwise, entering the SEND_25 state. If the send is invalid, it remains in the SEND_23 state. Triangle vertex 2 texture 5 valid state / Line vertex 1 texture 5 valid state SEND_24: Enters this state when the current primitive command is valid, the output is a triangle or line primitive, and the texture 5 is valid. If the attribute is valid, enter this state. If the transmission is valid, enter the SEND_25 state; if the transmission is invalid, remain in the SEND_24 state. Triangle vertex 3 coordinates valid state / Line vertex 2 coordinates valid state / Point vertex 2 coordinates valid state SEND_25: The current element command, output is a triangle, line, or point element, and the coordinate attribute is valid, enter this state. If the main color is valid, enter the SEND_26 state; otherwise, if the color attribute is valid, enter the SEND_30 state; otherwise, remain in the SEND_25 state. Triangle vertex 3 main color valid state / Line vertex 2 main color valid state / Point vertex 1 main color valid state SEND_26: The current element command, output is a triangle, line, or point element, and the main color attribute is valid, enter this state. If the transmission is valid, enter the SEND_27 state; otherwise, remain in the SEND_26 state.Triangle vertex 3 frontal secondary color valid state / Line vertex 2 frontal secondary color valid state / Point vertex 1 frontal secondary color valid state SEND_27: The current primitive command, output is a triangle, line or point primitive and the frontal secondary color attribute is valid, enters this state. If the transmission is valid, enter the SEND_28 state; otherwise, stay in the SEND_27 state. Triangle vertex 3 backside primary color valid state / Line vertex 2 backside primary color valid state / Point vertex 1 backside primary color valid state SEND_28: The current primitive command, output is a triangle, line or point primitive and the backside primary color attribute is valid, enters this state. If the transmission is valid, enter the SEND_29 state; otherwise, stay in the SEND_28 state. Triangle vertex 3 backside secondary color valid state / Line vertex 2 backside secondary color valid state / Point vertex 1 backside secondary color valid state SEND_29: The current primitive command, output is a triangle, line or point primitive and the backside secondary color attribute is valid, enters this state. At this time, the transmission is completed and enters the SEND_IDLE state; otherwise, if the transmission is valid, 0-layer texture is valid and enters the SEND_31 state. If a double texture is valid, the system enters the SEND_32 state; if a 2-layer texture is valid, it enters the SEND_33 state; if a 3-layer texture is valid, it enters the SEND_34 state; if a 4-layer texture is valid, it enters the SEND_35 state; if a 5-layer texture is valid, it enters the SEND_36 state; otherwise, it enters the SEND_IDLE state. If the transmission is invalid, it remains in the SEND_29 state. SEND_30: This state is entered when the current primitive command outputs a triangle, line, or point primitive with valid color attributes. After transmission is complete, it enters the SEND_IDLE state. Otherwise, if the transmission is valid, it enters the SEND_31 state if a 0-layer texture is valid; the SEND_32 state if a 1-layer texture is valid; the SEND_33 state if a 2-layer texture is valid; the SEND_34 state if a 3-layer texture is valid; and the SEND_35 state if a 4-layer texture is valid. The SEND_31 state is determined by the following conditions: 5-layer texture is valid, entering SEND_36; otherwise, entering SEND_IDLE. If the transmission is invalid, it remains in SEND_30. The SEND_31 state is determined by the following conditions: Triangle vertex 3 textures 0 valid; Line vertex 2 textures 0 valid; Point vertex 1 texture 0 valid. If the current primitive command is valid, the output is a triangle, line, or point primitive, and texture 0 is valid, this state is entered. After transmission, it enters SEND_IDLE. Otherwise, if transmission is valid, 1-layer texture is valid, entering SEND_32; 2-layer texture is valid, entering SEND_33; 3-layer texture is valid, entering SEND_34; 4-layer texture is valid, entering SEND_35; 5-layer texture is valid, entering SEND_36; otherwise, entering SEND_IDLE. If the transmission is invalid, it remains in SEND_31.Triangle vertex 3 texture 1 valid state / Line vertex 2 texture 1 valid state / Point vertex 1 texture 1 valid state SEND_32: Enters this state when the current primitive command is a triangle, line, or point primitive and the texture 1 attribute is valid. After sending, it enters the SEND_IDLE state. Otherwise, if the sending is valid, it enters the SEND_33 state when 2 textures are valid, the SEND_34 state when 3 textures are valid, the SEND_35 state when 4 textures are valid, and the SEND_36 state when 5 textures are valid. If the current primitive command is active and the output is a triangle, line, or point primitive with a valid texture 2 attribute, then the send is complete and the SEND_IDLE state is entered. Otherwise, if the send is invalid, the SEND_IDLE state is entered. If the send is valid, the SEND_IDLE state is entered. Otherwise, if the send is valid, the SEND_IDLE state is entered. If the send is valid, the SEND_IDLE state is entered. If the send is valid, the SEND_IDLE state is entered. If the send is valid, the SEND_IDLE state is entered. If the send is valid, the SEND_IDLE state is entered. If the send is valid, the SEND_IDLE state is entered. If the send is invalid, the SEND_IDLE state is entered. If the send is invalid, the SEND_IDLE state is entered. If the send is valid ... Valid state SEND_34: Enters this state when the current primitive command outputs a triangle, line, or point primitive and texture 3 is valid. After sending, it enters the SEND_IDLE state. Otherwise, if the sending is valid, it enters the SEND_35 state if a 4-layer texture is valid, and the SEND_36 state if a 5-layer texture is valid. Otherwise, it enters the SEND_IDLE state. If the sending is invalid, it remains in the SEND_34 state. Triangle vertex 3 texture 4 valid state / Line vertex 2 texture 4 valid state / Point vertex 1 texture 4 valid state SEND_35: Enters this state when the current primitive command outputs a triangle, line, or point primitive and texture 4 is valid. After sending, it enters the SEND_IDLE state. Otherwise, it enters the SEND_IDLE state. If the texture is valid, enter the SEND_36 state; otherwise, enter the SEND_IDLE state. If the transmission is invalid, remain in the SEND_35 state. SEND_36: This state is entered when the current primitive command outputs a triangle, line, or point primitive with valid texture 5. After transmission is complete, enter the SEND_IDLE state; otherwise, if the transmission is valid, enter the SEND_IDLE state; if invalid, remain in the SEND_36 state. START_RAST_V: This state is entered when the current raster command outputs raster position coordinates.Raster color valid state START_RAST_V: Currently a raster command is in effect. Entering this state will change the raster position color. Afterwards, the system enters the idle state SEND_IDLE. The command packet is then packaged and output to the next stage of the graphics processor pipeline based on the current state.

[0061] During the command output phase, an empty signal is output to the next-level pipeline of the graphics processor. When a read request (rden) is received from the next-level pipeline, the assembled command (data) is sent to the next-level pipeline of the graphics processor. The output command code adopts a 4+6 format. The first four bits are the pipeline unit number named this command, and the last six bits represent the command code. The lower 6 bits of the command code represent the command code, that is, the attribute type carried by this command. 0b000000 is the world coordinate of the vertex, 0b000100 is the primary color of the vertex's front face (used when lighting is enabled), 0b000101 is the secondary color of the vertex's front face (used when lighting is enabled), and 0b000110 is the secondary color of the vertex's front face (used when lighting is enabled). 0b000111 is the primary back face color of the vertex (used when lighting is enabled), 0b001000 is the secondary back face color of the vertex (used when lighting is enabled), 0b001000 is the vertex color (used when lighting is disabled), 0b110000 is the 0th texture, 0b110010 is the 1st texture, 0b110100 is the 2nd texture, 0b110110 is the 3rd texture, 0b111000 is the 4th texture, and 0b111010 is the 5th texture. The control word is bits 137-128 of the output command, including the attribute end flag, drawing mode, vertex type, and perspective correction flag. The attribute end flag is the command code [9], which marks whether the attribute carried by the current command is the last attribute of the current vertex. The vertex type is command code [5:3], which indicates the type of vertex being transmitted. 0b000 represents a point, 0b001 represents the start point of a line, 0b010 represents the end point of a line, 0b011 represents the start point of a triangle, 0b100 represents the midpoint of a triangle, and 0b101 represents the end point of a triangle. PsFlag is command code [2], which is the start flag for application-level primitives. In line drawing mode, 0 indicates that the primitive carried by this command is not the start of an application-level primitive; 1 indicates that the primitive carried by this command is the start of an application-level primitive.

[0062] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A primitive assembly circuit of an attribute adaptive graphics processor, characterized in that: comprising a command parsing unit, an attribute configuration unit, an adaptive assembly unit and a command output unit; the command parsing unit is used for parsing a custom 148-bit OpenGL command packet; the attribute configuration unit is provided with 12 attribute mark bits; each attribute mark bit corresponds to one attribute; the attribute configuration unit marks whether the attribute is valid according to the parsed OpenGL command issued by the command parsing unit; the adaptive assembly unit adopts a finite state machine to sequentially judge 12 attribute marks; the 12 attribute marks respectively include a coordinate, a front main color, a front auxiliary color, a back main color, a back auxiliary color, a fog coordinate, a 0-weight texture adaptive assembly primitive, a 1-weight texture adaptive assembly primitive, a 2-weight texture adaptive assembly primitive, a 3-weight texture adaptive assembly primitive, a 4-weight texture adaptive assembly primitive and a 5-weight texture adaptive assembly primitive; when the attribute mark is invalid, the corresponding attribute is discarded, and only the valid attribute is assembled; the command output unit outputs the assembled simple graphics command to a lower stage pipeline of the graphics processor; the command parsing unit is used for receiving a parsing command and is responsible for taking out a primitive vertex command from a command FIFO for parsing when there are a plurality of vertex commands in a front stage vertex command FIFO; the parsing command format is a custom OpenGL command, each command sequentially includes a 10-bit command code, a 10-bit control word and a 128-bit data from high bits; the command code adopts a 4+6 structure, the high 4 bits are a pipeline stage number, and the low 6 bits are a command number; the function of the control word is related to the command, and detailed information of the command can be obtained; the data can be divided into four 32-bit data, and the content is a specific parameter value carried by the command; the attribute mark in the attribute configuration unit includes a valid mark and an invalid mark; the valid mark is 12-bit data; when the attribute configuration unit receives a glVertex command, a coordinate attribute valid bit bit[11] is set to 1; when lighting is turned on, front main color, front auxiliary color, back main color and back auxiliary color attributes of a vertex correspond to valid bit positions bit[10:7] positions 1; when lighting is not turned on, a color attribute valid bit bit[6] is set to 1; when a glActiveTexture command is received, and glEnable enables any one of 1D, 2D, 3D and CUBE parameters, it is determined which weight texture is valid according to the glActiveTexture parameter, and then the corresponding valid bit mark in bit[5:0] is set to 1 attribute; the storage order from high to low is coordinate, front main color, front auxiliary color, back main color, back auxiliary color, fog coordinate, 0-weight texture adaptive assembly primitive, 1-weight texture adaptive assembly primitive, 2-weight texture adaptive assembly primitive, 3-weight texture adaptive assembly primitive, 4-weight texture adaptive assembly primitive and 5-weight texture adaptive assembly primitive. ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ 2. The attribute-adaptable graphics processor primitive assembly circuit of claim 1, wherein: The adaptive assembly unit adopts an adaptive assembly finite state machine according to the effective mark of the assembly attribute, and then judges the effective bit from high to low according to the 12-bit attribute mark; when the mark bit is effective, the corresponding attribute data is assembled into the vertex command packet; when the attribute mark bit is invalid, the corresponding attribute data is discarded; The adaptive assembly unit reassembles 10 kinds of graphics primitives into three simple graphics of points, lines and triangles; one point needs one vertex, one line segment needs two vertices, and one triangle needs three vertices; since the light is in an on or off state, the color attribute and the front main color, the front auxiliary color, the back main color and the back auxiliary color cannot be effective at the same time, so a vertex carries at most 11 attributes and at least 2 attributes; therefore, the range of all graphics command packets is 2-33 command packets to assemble a primitive.

3. The attribute-adaptable graphics processor primitive assembly circuit of claim 2, wherein: The command output unit is responsible for sending the graphics primitive vertex command and includes a FIFO storage; the output command includes the transparent OpenGL command, the assembled vertex attribute command and the raster command; The output command format is composed of a command code, a control word and data; the command code is 147-138 bits of the output command, the command code structure adopts a 4+6 format, the first four bits are a flow number, which is used to indicate the unique number of the flow water processing in the graphics processor, and the last six bits indicate the command code to indicate the attribute mark of the primitive; the control word is 137-128 bits of the output command, including an attribute end mark, a drawing mode, a vertex type and a perspective correction mark; The control word bit[9] marks whether the attribute carried by the current command is the last attribute of the current vertex, and bit[5:3] indicates the type of the transmitted vertex; bit[2] indicates the application level primitive start mark; The line drawing mode uses 0: indicating that the primitive carried by the current command is not the start of the application level primitive; 1: indicating that the primitive carried by the current command is the start of the application level primitive; The data indicates the vertex attribute data.