Implementation method of a graphics processor geometry engine stage selection feedback mechanism

By using a phased selection feedback mechanism in the graphics processor's geometry engine, the problem of users having difficulty selecting objects in a 3D scene is solved, enabling effective information selection and feedback rendering, and improving the accuracy and efficiency of user interaction.

CN115393468BActive Publication Date: 2026-03-27西安翔腾微电子科技有限公司
View PDF 2 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-27

AI Technical Summary

Technical Problem

In image processors, it is difficult to determine the object selected by the user in a 3D scene, especially when there are multiple rotations, movements and perspective transformations. Existing technologies are not able to effectively realize the user's selection of information in a certain area on the screen and provide feedback on the rendering calculation results.

Method used

The system employs a phase selection feedback mechanism in the graphics processor's geometry engine. Through a vertex receiving and storage unit, a GP parameter configuration unit, a core computing unit, a vertex assembly and sending unit, a selection feedback unit, a task scheduling unit, an image processing unit, a graphics function management unit, a PCIE, and an AXI write DDR3 unit, it realizes the parsing of primitive commands, parameter configuration, primitive culling, and feedback rendering, including vertex coordinate calculation, rotation direction setting, front and back face judgment, and AXI write of feedback information to DDR.

Benefits of technology

It enables users to effectively select information from a specific area on the screen and receive feedback rendering calculation results, thereby improving the accuracy and efficiency of user interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115393468B_ABST
    Figure CN115393468B_ABST
Patent Text Reader

Abstract

The application provides an implementation method of a graphics processor geometry engine stage selection feedback mechanism. The graphics processor comprises a vertex receiving storage unit, a GP parameter configuration unit, a core calculation unit, a vertex assembly sending unit, a selection feedback unit, a task scheduling unit (JSU), an image processing unit (IPU), a graphics function management unit (GFU), a PCIE and an AXI write DDR3 unit. The implementation method of the selection feedback mechanism comprises the following steps: step 1, judging a received primitive command; step 2, parameter configuration; step 3, calculating a triangle area; and step 4, primitive rejection. The application provides an implementation method of a graphics processor geometry engine stage selection feedback mechanism, which can effectively implement a geometry engine stage selection feedback mechanism and realize the function of user selection of a certain area on a screen and feedback of a rendering calculation result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer hardware, in particular to a method for implementing a selection feedback mechanism of a geometry engine stage of a graphics processor. BACKGROUND

[0002] Some graphics applications in an image processor simply draw static two-dimensional or three-dimensional object images. Some other applications allow a user to identify objects on a screen and move, change, delete the objects or perform other operations. Such applications with interactive operations are supported. Since the objects drawn on the screen generally undergo multiple rotations, movements and perspective transformations, it is difficult to determine which object is selected by a user in a three-dimensional scene. In order to achieve this purpose, a selection mechanism is used to determine which object is specified by a user in a certain area. The selection allows a user of an application to select an object drawn on a screen, and the feedback allows the user to obtain information related to the object drawn on the screen. SUMMARY

[0003] Based on the technical problems in the background art, the present application provides a method for implementing a selection feedback mechanism of a geometry engine stage of a graphics processor, which can effectively realize the functions of selection of a user on information of a certain area on a screen and feedback of a rendering calculation result.

[0004] The technical solution of the present application is a method for implementing a selection feedback mechanism of a geometry engine stage of a graphics processor, wherein the graphics processor comprises a vertex receiving and storing unit, a GP parameter configuration unit, a core calculation unit, a vertex assembling and sending unit, a selection feedback unit, a task scheduling unit (JSU), an image processing unit (IPU), a graphics function management unit (GFU), a PCIE and an AXI write DDR3 unit; and the method comprises the following steps:

[0005] Step 1: judging a received primitive command;

[0006] The vertex receiving and storing unit receives a primitive vertex command sent by a previous unit and analyzes the command, and judges whether the received primitive command is a point, a line or a triangle;

[0007] When the received primitive command is a point or a line, the command is transmitted to the vertex assembling and sending unit according to a pipeline;

[0008] When the received primitive command is a triangle, three vertex coordinates (X1, Y1), (X2, Y2) and (X3, Y3) of the triangle are taken out and sent to a lower core calculation unit, and a triangle primitive vertex boundary flag and the command are transmitted to the vertex assembling and sending unit according to the pipeline;

[0009] Step 2: parameter configuration; by GP parameter configuration unit, the rotation direction of the current triangle is configured by Opengl instruction, the front and back drawing mode and the current front, back or front and back triangle parameters are rejected.

[0010] Step 3: calculate the area of the triangle;

[0011] The above core calculation unit is to convert the product of the modulus of the surface outer normal vector of the triangle and the modulus of the view vector and the product of the cosine value of the included angle into the calculation of the area of the triangle. The triangle vertex coordinates (X1, Y1) (X2, Y2) (X3, Y3) output by the vertex receiving storage unit are calculated according to A = X1 (Y2-Y3) + X2 (Y3-Y1) + X3 (Y1-Y2) to calculate A value; At the same time, the rotation direction of the current triangle is configured by Opengl instruction, and the front and back signs of the current triangle are calculated;

[0012] Step 4: primitive rejection;

[0013] The above vertex assembly sending unit generates a rejection flag according to the front and back triangle rejection parameters configured by the GP parameter configuration unit and the front and back triangle signs judged by the core calculation unit; And according to the current triangle front and back drawing mode configured by the GP parameter configuration unit and whether it is a boundary point or a boundary edge transmitted by the vertex receiving storage unit, the primitive rejection is carried out.

[0014] The above selection feedback unit according to the mode of the current application program configured by the GP parameter configuration unit, if the current application program is drawing mode, the function code related to selection feedback received is not operated;

[0015] If the current application program is selection mode, the function code related to selection is received to perform stack initialization, stack pushing, stack popping and stack top element replacement operation on the name stack, and the name stack depth, the minimum value of the depth since the last click record, the maximum value of the depth, and the name stack element are written into DDR through AXI;

[0016] If the current application program is feedback mode, when the function code related to feedback is received, the coordinates and related attributes of the raster position are taken out from IPU and JSU and written into DDR through AXI. If the current application program is feedback mode, when the primitive vertex information is received, the primitive vertex information is written into DDR through AXI according to the current feedback type configured by the GP parameter configuration unit.

[0017] The above task scheduling unit, if the current application program is feedback mode and the function code related to feedback is received, the depth value, color and texture attribute of the raster position are taken out from the task scheduling unit.

[0018] The image processing unit retrieves the coordinates of the raster position and the valid flag from the image processing unit if the current application program is in the feedback mode and receives a function code related to feedback.

[0019] The graphic function management unit manages the graphic function code uniformly and broadcasts to each module.

[0020] The PCIE unit assigns the base address and space size of the selected feedback AXI, and returns the number of selection clicks and the number of feedback primitives to the host end.

[0021] The present application has the advantages that the present application provides an implementation method of a graphic processor geometry engine stage selection feedback mechanism, which can effectively realize the function of user selection of information of a certain area on a screen and feedback of rendering calculation results. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 is a structure diagram of a graphic processor geometry engine stage selection feedback mechanism of the present application;

[0023] Figure 2 is a vertex command format in the present application;

[0024] Figure 3 is a vertex attribute data format in the present application;

[0025] Figure 4 is a vertex command format in the simple mode in the present application;

[0026] Figure 5 is a vertex attribute data position and validity condition in the complex mode in the present application;

[0027] Figure 6 glRenderMode data path when exiting the selection mode;

[0028] Figure 7 glRenderMode data path when exiting the feedback mode. DETAILED DESCRIPTION

[0029] The technical solutions of the present application are clearly and completely described below in combination with the drawings and specific embodiments. The described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0030] The application discloses an implementation method of a graphics processor geometry engine stage selection feedback mechanism, and relates to the technical field of graphics processors.

[0031] Step 1: judging received primitive commands;

[0032] The vertex receiving and storing unit receives and analyzes the primitive vertex commands sent by the previous unit, judges whether the currently received primitive command is a point, a line or a triangle, and transmits the command to the vertex assembling and sending unit according to the pipeline.

[0033] When the received primitive command is a point or a line, the command is transmitted to the vertex assembling and sending unit according to the pipeline;

[0034] When the received primitive command is a triangle, the values of the three vertex coordinates (X1, Y1), (X2, Y2) and (X3, Y3) of the triangle are taken out and sent to the lower core calculation unit, and the triangle primitive vertex boundary flag and the command are transmitted to the vertex assembling and sending unit according to the pipeline.

[0035] Step 2: parameter configuration; the GP parameter configuration unit is configured by the Opengl instruction to configure the rotation direction of the current triangle, the front and back surface drawing mode and the triangle parameters of the current front surface, back surface or front and back surface.

[0036] Step 3: calculating the area of the triangle;

[0037] The core calculation unit is equivalent to convert the product of the modulus of the surface outer normal vector of the triangle and the modulus of the view vector and the product of the cosine value of the included angle into the calculation of the area of the triangle, calculates the A value according to A=X1(Y2-Y3)+X2(Y3-Y1)+X3(Y1-Y2) according to the triangle vertex coordinates (X1, Y1), (X2, Y2) and (X3, Y3) output by the vertex receiving and storing unit, and calculates the front and back surface flags of the current triangle in combination with the Opengl instruction configured rotation direction of the current triangle.

[0038] Step 4: primitive rejection;

[0039] The vertex assembling and sending unit generates a rejection flag according to the rejection front and back surface triangle parameters configured by the GP parameter configuration unit and the front and back surface triangle flags judged by the core calculation unit, and performs primitive rejection according to the current front and back surface drawing mode configured by the GP parameter configuration unit and whether it is a boundary point or a boundary edge transmitted by the vertex receiving and storing unit.

[0040] The selection feedback unit is configured according to the mode of the current application program configured by the GP parameter configuration unit, if the current application program is a drawing mode, no operation is performed on the received selection feedback related function code;

[0041] If the current application program is a selection mode, the name stack is initialized, stacked, de-stacked and the top element is replaced when the selection related function code is received, and the name stack depth, the minimum value of the depth since the last click record, the maximum value of the depth, and the name stack element are written into the DDR through AXI;

[0042] If the current application program is a feedback mode, the coordinates and related attributes of the raster position are taken out from the IPU and the JSU and written into the DDR through AXI when the feedback related function code is received, and if the current application program is a feedback mode, the primitive vertex information is written into the DDR through AXI according to the current feedback type configured by the GP parameter configuration unit when the primitive vertex information is received.

[0043] The task scheduling unit takes the depth value, color and texture attribute of the raster position from the task scheduling unit if the current application program is a feedback mode and the feedback related function code is received.

[0044] The image processing unit takes the coordinates and effective flag of the raster position from the image processing unit if the current application program is a feedback mode and the feedback related function code is received.

[0045] The graphic function management unit uniformly manages the graphic function code and broadcasts and sends to each module.

[0046] The PCIE unit is configured with the base address and space size of the selection feedback AXI, and returns the number of selection click records and the number of feedback primitives to the host end.

[0047] It needs to be further explained that: referring to Figures 1-7 As shown in the figure, a structure diagram of a selection feedback mechanism implementation of a geometry engine stage of a graphics processor, including a vertex receiving and storing unit, a GP parameter configuration unit, a core calculation unit, a vertex assembling and sending unit, a selection feedback unit, a task scheduling unit (JSU), an image processing unit (IPU), a graphic function management unit (GFU), a PCIE and an AXI write DDR3 unit.

[0048] The vertex receiving and storing unit receives the primitive command from the upper stream water unit and decodes and analyzes it, wherein the primitive command format is as shown in Figure 2As shown, including a 17-bit command packet header and six 128-bit attribute data bits, the command packet header structure is shown in Table 1, by parsing the 7-9 bit command packet header to determine the current received primitive command is a point, line or triangle. According to the number of vertices carrying attributes (coordinates, front main color, front auxiliary color, back main color, back auxiliary color, 6 texture and fog coordinates) as Figure 3 As shown, the vertex command format is divided into simple mode and complex mode as Figure 4 and Figure 5 As shown. If the current received is a point and line, no processing is done, directly according to the pipeline to the command transmission to the primitive vertex command assembly and sending unit; if the current received is a triangle primitive, the coordinates of the three vertices of the triangle primitive and the boundary flag are extracted, the (X, Y) coordinates of the three vertices of the triangle are output to the A value (area) calculation unit, and the vertex boundary edge and boundary point flag of the triangle primitive carried by the command packet header and the attribute carried by the vertex are sent to the primitive vertex command assembly and sending unit according to the pipeline length.

[0049] The GP parameter configuration unit configures the rotation direction of the current triangle, the front and back drawing mode and the current front, back or front and back triangle parameters according to the Opengl instruction.

[0050] The core calculation unit is the equivalent conversion of the product of the modulus of the surface outer normal vector of the triangle and the modulus of the view vector and the product of the cosine value of the included angle, the A value calculation unit receives the coordinate values of the three vertices of the triangle output from the vertex receiving and storing unit, and calculates the A value according to the formula A = X1(Y2-Y3) + X2(Y3-Y1) + X3(Y1-Y2). After calculating the A value of the triangle area, the GP parameter configuration unit Opengl instruction configuration of the rotation direction of the triangle is combined to determine the front and back of the current triangle. When the configured triangle rotation direction is counterclockwise and the calculated A value is greater than 0, it is considered to be a front, otherwise it is considered to be a back; when the configured triangle rotation direction is clockwise and the received A value is less than 0, it is considered to be a front, otherwise it is considered to be a back.

[0051] The vertex assembly sending unit judges the front and back of the triangle according to the core computing unit, and then generates a rejection flag according to the front and back rejection of the triangle configured by the GP parameter configuration unit according to the Opengl instruction. Then, the front and back drawing modes configured by the GP parameter configuration unit and whether the point is a boundary point or a boundary edge transmitted by the vertex receiving and storing unit are combined to perform primitive rejection. When the calculated triangle is a front face and is not rejected, according to the front drawing mode of the Opengl instruction configuration, the front drawing mode is a dot or a line, and the boundary point and boundary edge flag transmitted by the vertex receiving and storing unit, the triangle is split into corresponding points and lines and sent to the lower stage of the pipeline unit. If the boundary point and boundary edge flag is invalid, the triangle primitive is rejected and no command is output to the lower stage of the pipeline. When the front drawing mode of the Opengl instruction configuration is a fill mode, the original primitive command is transmitted to the lower stage of the pipeline according to the reception. When the calculated triangle is a front face and is rejected, the triangle is directly rejected and no command is output to the lower stage. When the calculated triangle is a back face, the processing mode is the same as the front face.

[0052] The selection feedback unit completes the corresponding selection feedback function according to the mode of the current application program. When the current application program is in the selection mode and receives the initial_name function code sent by the graphic function management unit, the name stack with a depth of 64 is initialized, and the stack content is emptied. When the push_name function code sent by the graphic function management unit is received, a new name element is pushed into the name stack. If the current name stack is full (the name stack depth is 64), the glPushName will cause a stack overflow error. When the pop_name function code sent by the graphic function management unit is received, the element at the top of the name stack is popped out of the stack. If the current name stack is empty, the glPopName will cause a stack underflow error. When the load_name function code sent by the graphic function management unit is received, the top element of the name stack is replaced with a new name element. If the current name stack is empty, the glloadName will cause an invalid operation error. At the same time, the minimum and maximum values of the depth values of the received primitive vertices after entering the selection mode are calculated. Finally, when the selection mode is exited, the depth of the name stack, the minimum and maximum values of the primitive vertex depth, and the stack elements are written into the DDR3 through the AXI bus, and then returned to the host end through the PCIE. The glRenderMode data path when the selection mode is exited is as follows: Figure 6 .

[0053] When the current application is in the feedback mode and receives the primitive vertex information of the complex mode, if the feedback type at this time is GL_2D, the token value of the primitive type flag and the X, Y of the primitive vertex coordinates are written into the DDR3 through the AXI bus; if the feedback type at this time is GL_3D, the token value of the primitive type flag and the X, Y, Z of the primitive vertex coordinates are written into the DDR3 through the AXI bus; if the feedback type at this time is GL_3D_COLOR, the token value of the primitive type flag, the X, Y, Z of the primitive vertex coordinates and the front main color R, G, B, A are written into the DDR3 through the AXI bus; if the feedback type at this time is GL_3D_COLOR_TEXTURE, the token value of the primitive type flag, the X, Y, Z of the primitive vertex coordinates, the front main color R, G, B, A and the S, T, R, Q of the 0th texture are written into the DDR3 through the AXI bus; if the feedback type at this time is GL_4D_COLOR_TEXTURE, the token value of the primitive type flag, the X, Y, Z, W of the primitive vertex coordinates, the front main color R, G, B, A and the S, T, R, Q of the 0th texture are written into the DDR3 through the AXI bus. If the feedback primitive type is triangle, a data 3 is returned after the primitive type flag. Finally, the information in the DDR is returned to the host end through the PCIE.

[0054] When the current application is in the feedback mode and receives the glbitmap, gldrawpixel, glcopypixel function codes sent by the graphics function management unit, the X, Y coordinates of the current raster position and the raster position valid flag are read back from the IPU, the Z, W coordinates of the current raster position, the front main color R, G, B, A and the 0th texture S, T, R, Q information are read back from the JSU, and finally written into the DDR3 through the AXI bus and returned to the host end through the PCI. The glRenderMode data path when exiting the feedback mode is as follows: Figure 7 .

[0055] When the current application is in the drawing mode, the name stack related function codes and the glbitmap, gldrawpixel, glcopypixel function codes are received, no operation is performed. When the selection mode is exited, the data of the click record is returned to the host end, and when the feedback mode is exited, the number of feedback primitives is returned to the host end.

[0056] It needs to be further explained that:

[0057] If the current application program is the drawing mode, no operation is performed on the received function code related to the selection feedback; if the current application program is the selection mode, the received function code related to the selection is used to perform the stack initialization, stack pushing, stack popping and stack top element replacing operations on the name stack, and the name stack depth, the minimum value of the depth since the last click record, the maximum value of the depth, and the name stack elements are written into the DDR through AXI; if the current application program is the feedback mode, the received function code related to the feedback is used to take out the coordinates and attributes of the raster position from the IPU and the JSU and write them into the DDR through AXI; if the current application program is the feedback mode, the received vertex information of the primitive is written into the DDR through AXI according to the current feedback type configured by the GP parameter configuration unit.

[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for implementing a selection feedback mechanism in the geometry engine stage of a graphics processing unit (GPU), wherein the GPU includes a vertex receiving and storage unit, a GP parameter configuration unit, a core computing unit, a vertex assembly and sending unit, a selection feedback unit, a task scheduling unit (JSU), an image processing unit (IPU), a graphics function management unit (GFU), a PCIe interface, and an AXI write DDR3 unit; characterized in that: The method includes the following steps: Step 1: Determine the received graphic element command; The vertex receiving and storage unit receives and parses the primitive vertex commands sent by the previous unit, and determines whether the currently received primitive command is a point, a line, or a triangle. When the received primitive command is a point or a line, the command is transmitted to the vertex assembly and sending unit according to the pipeline step-by-step process. When the received primitive command is a triangle, the coordinates of the three vertices of the triangle (X1,Y1), (X2,Y2), and (X3,Y3) are extracted and sent to the next-level core computing unit. At the same time, the vertex boundary markers of the triangle primitive and the command are transmitted to the vertex assembly and sending unit according to the pipeline. Step 2: Parameter configuration; The rotation direction, front and back drawing mode, and parameters for culling the current front, back, or front and back triangles are configured by OpenGL instructions through the GP parameter configuration unit. Step 3: Calculate the area of ​​the triangle; The core calculation unit converts the product of the magnitude of the triangle's surface normal vector and the magnitude of the line-of-sight vector, along with the product of the cosine of the included angle, into the calculation of the triangle's area. It calculates the value A from the triangle vertex coordinates (X1,Y1)(X2,Y2)(X3,Y3) output by the vertex receiving and storage unit according to A = X1(Y2-Y3) + X2(Y3-Y1) + X3(Y1-Y2). Simultaneously, it combines OpenGL instructions to configure the current triangle's rotation direction and calculates the front and back face markings of the current triangle. Step 4: Primitive removal; The vertex assembly and sending unit generates a culling flag based on the culling parameters of the front and back triangles configured by the GP parameter configuration unit and the front and back triangle flags determined by the core calculation unit; then, it performs primitive culling based on the current triangle front and back drawing mode configured by the GP parameter configuration unit and whether it is a boundary point or boundary edge transmitted by the vertex receiving and storage unit.

2. The method for implementing a stage selection feedback mechanism in a graphics processor geometry engine according to claim 1, characterized in that: The selection feedback unit configures the current application mode according to the GP parameter configuration unit. If the current application is in drawing mode, it does not perform any operation when it receives the function code related to selection feedback. If the current application is in selection mode, the function code related to selection is received to perform stack initialization, push, pop and replace the top element of the name stack. At the same time, the name stack depth, the minimum depth since the last click record, the maximum depth, and the name stack elements are written to DDR via AXI. If the current application is in feedback mode, when a function code related to feedback is received, the coordinates and related attributes of the raster position are retrieved from the IPU and JSU and written to the DDR via AXI. If the current application is in feedback mode, when primitive vertex information is received, the primitive vertex information is written to the DDR via AXI according to the current feedback type configured by the GP parameter configuration unit.

3. The method for implementing a stage selection feedback mechanism in a graphics processor geometry engine according to claim 1, characterized in that: If the current application is in feedback mode and a function code related to feedback is received, the task scheduling unit retrieves the depth value, color, and texture attributes of the raster position from the task scheduling unit.

4. The method for implementing a stage selection feedback mechanism in a graphics processor geometry engine according to claim 1, characterized in that: If the current application is in feedback mode and a function code related to feedback is received, the image processing unit retrieves the coordinates of the raster position and the valid flag from the image processing unit.

5. The method for implementing a stage selection feedback mechanism in a graphics processor geometry engine according to claim 1, characterized in that: The graphics function management unit manages the graphics function codes in a unified manner and broadcasts them to each module.

6. The method for implementing a stage selection feedback mechanism in a graphics processor geometry engine according to claim 1, characterized in that: The PCIE unit allocates the base address and space size for the selection feedback AXI, and returns the number of selection click records and the number of feedback primitives to the host.

Citation Information

Patent Citations

  • Communicating secondary selection feedback

    CN102456067A

  • Clipping method and clipping module with effective area and multiplex function in embedded GPU (Graphics Processing Unit)

    CN103400338A