Graphics drawing pipeline management method and graphics processor
By identifying the task type and creating the corresponding shader thread, the execution of the mesh shading task is realized, which solves the incompatibility problem of GPU products in supporting mesh shaders, improves the applicability and flexibility of the GPU, and reduces resources consumption.
Patent Information
- Application Number
- CN202310197609.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-03-02
AI Technical Summary
Existing GPU products are incompatible in supporting mesh shaders, resulting in the need to significantly adjust or re-produce the drawing pipeline, which increases resource consumption and development complexity.
By identifying the task type to which the drawing data belongs, if it is a mesh shading task, create amplification shader and mesh shader threads, schedule them in the thread manager, generate the topology of the geometric primitives, and send it to the rasterization processing unit. Implement the execution of mesh shading tasks and improve the applicability of GPU.
Without affecting the existing graphics drawing pipeline, a new graphics drawing pipeline is added to support multiple types of graphics drawing tasks, improve the applicability and flexibility of GPU products, and reduce resource consumption.
Smart Images

Figure CN116188243B
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip development technology, and in particular to a graphics rendering pipeline management method, device, computer equipment, storage medium, computer program product and graphics processor. Background Art
[0002] GPU (Graphics Processing Unit) is a special chip for graphics and image processing on computers, workstations, game consoles, mobile devices and other devices. GPU is commonly used in Windows desktop display, image editing, game entertainment, movie special effects, 3D modeling and other scenarios. As the parallel computing capability of GPU becomes more and more powerful, the application of GPU has expanded to emerging fields such as scientific computing, artificial intelligence, and autonomous driving.
[0003] Early GPUs were fixed pipelines that mainly switched various special effects through switches, and could only complete fixed functions such as viewport transformation, rasterization, and clipping, with relatively simple drawing effects. With the development of technology, users need to be able to program on GPUs to obtain better customized effects.
[0004] In 2002, DirectX9 introduced shaders, which are programs that can run on GPUs and achieve various innovative special effects through programmable pipelines. Two types of shaders were proposed at the time: Vertex Shader (VS) for processing vertex primitives and Pixel Shader (PS) for processing pixels. These two shaders make GPUs programmable, allowing users to design rendering operations by themselves, thereby achieving more gorgeous display effects.
[0005] In 2006, DirectX10 introduced a new shader: Geometry Shader GS, which can generate new primitives to make the drawing effect more realistic. In 2009, DirectX11 added two new shaders: Hull Shadder HS and Domain Shader DS, and a fixed subdivision unit TESS (Tessellator), which together constitute a complete tessellation module that can generate a large number of tessellation grids in real time to display the uneven details of the ground, hair, shells and other objects. These shaders (VS, HS, DS, GS, PS) have been integrated into the GPU's rendering pipeline and have become the basic modules of the entire drawing engine. In addition to DirectX, mainstream rendering engines such as Vulkan also support these features.
[0006] Although these added shaders can bring gorgeous drawing effects, they make software developers miserable. The constraints of various shaders themselves and the complex scheduling relationship between them will slow down the overall execution performance, and they are still not flexible enough, which makes developers often trade off between shader switching and performance. In order to solve these problems, in 2019, the new version of DirectX12 introduced new features of mesh shading tasks and added two new shaders, including the Amplifier Shader (AS) and the Mesh Shader (MS), which can replace the front-end shading stages and TESS modules such as VS, HS, DS, and GS. In addition, the new AS and MS cancel many constraints, allowing developers to implement it like writing a general compute shader CS (Compute Shader), which greatly improves flexibility.
[0007] However, some existing GPU products do not support mesh shaders, which often requires major adjustments to the existing drawing pipelines of these GPU products, or the re-production of new models of GPU products, which greatly increases resource consumption. Summary of the invention
[0008] Based on this, it is necessary to provide a graphics rendering pipeline management method, device, computer equipment, computer-readable storage medium and computer program product that can improve the applicability of GPU products in response to the above technical problems.
[0009] In a first aspect, the present application provides a graphics drawing pipeline management method. The method comprises:
[0010] Identify the task type to which the drawing data belongs; the task type is divided into non-grid coloring tasks and grid coloring tasks;
[0011] If the drawing data belongs to a mesh shading task, create at least one amplification shader thread according to the drawing data, and send the at least one amplification shader thread to a thread manager;
[0012] After detecting that at least one amplifying shader thread in the thread manager has completed execution, obtaining a mesh shader task corresponding to the at least one amplifying shader thread, creating at least one mesh shader thread according to the mesh shader task, and sending the at least one mesh shader thread to the thread manager;
[0013] After detecting that at least one mesh shader thread in the thread manager is executed, a topology structure of geometric primitives corresponding to the drawing data is created, and the topology structure is sent to a rasterization processing unit.
[0014] In one of the embodiments, before creating at least one amplification shader thread according to the drawing data, the method further includes:
[0015] Identify the task characteristics of the grid coloring task;
[0016] If the task characteristic of the mesh shading task is to enable an amplification shader, the step of creating at least one amplification shader thread according to the drawing data is performed and the execution continues.
[0017] In one embodiment, the method further comprises:
[0018] If the task characteristic of the mesh shading task is to turn off the magnification shader, create at least one mesh shader thread according to the drawing data, and send the at least one mesh shader thread to the thread manager;
[0019] After detecting that at least one mesh shader thread in the thread manager is executed, a topological structure of geometric primitives corresponding to the drawing data is created, and the topological structure of the geometric primitives corresponding to the drawing data is sent to the rasterization processing unit.
[0020] In one embodiment, creating at least one amplification shader thread according to drawing data includes:
[0021] generating at least one amplification shader working group according to the drawing data;
[0022] Creating at least one amplification shader thread according to each amplification shader work group;
[0023] Accordingly, at least one mesh shader thread is created according to the mesh shader task, including:
[0024] generating at least one mesh shader working group according to the mesh shader task;
[0025] At least one mesh shader thread is created per mesh shader work group.
[0026] In one of the embodiments, after sending at least one amplification shader thread to the thread manager, the method further comprises:
[0027] A mesh shader task is created from at least one amplified shader work group.
[0028] In one embodiment, the method further comprises:
[0029] If the drawing data belongs to a non-mesh shading task, the drawing data is sent to a vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and send the at least one vertex shader thread to a thread manager.
[0030] In a second aspect, the present application further provides a graphics processor. The graphics processor comprises:
[0031] A command stream processing unit is used to receive drawing data and identify the task type to which the drawing data belongs. If the drawing data belongs to a mesh shading task, the drawing data is sent to the amplifying shader thread construction unit; the task types are divided into non-mesh shading tasks and mesh shading tasks;
[0032] an enlarged shader thread construction unit, configured to create at least one enlarged shader thread according to drawing data, and send the at least one enlarged shader thread to the thread manager, and after detecting that at least one enlarged shader thread in the thread manager has completed execution, create a corresponding mesh shader task according to the at least one enlarged shader thread and send the task to the mesh shader thread construction unit;
[0033] A mesh shader thread construction unit is used to receive a mesh shader task, create at least one mesh shader thread according to the mesh shader task, and send at least one mesh shader thread to a thread manager. After detecting that at least one mesh shader thread in the thread manager has completed execution, a topological structure of geometric primitives corresponding to the drawing data is created, and the topological structure of the geometric primitives corresponding to the drawing data is sent to a rasterization processing unit.
[0034] In one of the embodiments, the command stream processing unit is further configured to send the drawing data to the vertex shader thread construction unit to instruct the vertex shader thread construction unit if the drawing data belongs to a non-mesh shading task;
[0035] The graphics processor also includes:
[0036] The vertex shader thread construction unit is used to create at least one vertex shader thread according to the drawing data, and send the at least one vertex shader thread to the thread manager.
[0037] In a third aspect, the present application also provides a graphics drawing pipeline management device. The device comprises:
[0038] The drawing task identification module is used to identify the task type to which the drawing data belongs; the task types are divided into non-grid coloring tasks and grid coloring tasks;
[0039] a first thread management module, configured to create at least one enlarged shader thread according to the drawing data if the drawing data belongs to a mesh shading task, and send the at least one enlarged shader thread to a thread manager;
[0040] A second thread management module is used to, after detecting that at least one amplifying shader thread in the thread manager is executed, obtain a mesh shader task corresponding to the at least one amplifying shader thread, create at least one mesh shader thread according to the mesh shader task, and send the at least one mesh shader thread to the thread manager;
[0041] The mesh shading output module is used to create a topological structure of geometric primitives corresponding to the drawing data after detecting that at least one mesh shader thread in the thread manager has completed execution, and send the topological structure to the rasterization processing unit.
[0042] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0043] Identify the task type to which the drawing data belongs; the task type is divided into non-grid coloring tasks and grid coloring tasks;
[0044] If the drawing data belongs to a mesh shading task, create at least one amplification shader thread according to the drawing data, and send the at least one amplification shader thread to a thread manager;
[0045] After detecting that at least one amplifying shader thread in the thread manager has completed execution, obtaining a mesh shader task corresponding to the at least one amplifying shader thread, creating at least one mesh shader thread according to the mesh shader task, and sending the at least one mesh shader thread to the thread manager;
[0046] After detecting that at least one mesh shader thread in the thread manager is executed, a topology structure of geometric primitives corresponding to the drawing data is created, and the topology structure is sent to a rasterization processing unit.
[0047] In a fifth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0048] Identify the task type to which the drawing data belongs; the task type is divided into non-grid coloring tasks and grid coloring tasks;
[0049] If the drawing data belongs to a mesh shading task, create at least one amplification shader thread according to the drawing data, and send the at least one amplification shader thread to a thread manager;
[0050] After detecting that at least one amplifying shader thread in the thread manager has completed execution, obtaining a mesh shader task corresponding to the at least one amplifying shader thread, creating at least one mesh shader thread according to the mesh shader task, and sending the at least one mesh shader thread to the thread manager;
[0051] After detecting that at least one mesh shader thread in the thread manager is executed, a topology structure of geometric primitives corresponding to the drawing data is created, and the topology structure is sent to a rasterization processing unit.
[0052] In a sixth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0053] Identify the task type to which the drawing data belongs; the task type is divided into non-grid coloring tasks and grid coloring tasks;
[0054] If the drawing data belongs to a mesh shading task, create at least one amplification shader thread according to the drawing data, and send the at least one amplification shader thread to a thread manager;
[0055] After detecting that at least one amplifying shader thread in the thread manager has completed execution, obtaining a mesh shader task corresponding to the at least one amplifying shader thread, creating at least one mesh shader thread according to the mesh shader task, and sending the at least one mesh shader thread to the thread manager;
[0056] After detecting that at least one mesh shader thread in the thread manager is executed, a topology structure of geometric primitives corresponding to the drawing data is created, and the topology structure is sent to a rasterization processing unit.
[0057] The above-mentioned graphics drawing pipeline management method, device, computer equipment, storage medium, computer program product and graphics processor identify the task type to which the drawing data belongs. If the drawing data belongs to a mesh shading task, at least one magnifying shader thread is created according to the drawing data, and the at least one magnifying shader thread is sent to the thread manager; after detecting that at least one magnifying shader thread in the thread manager has been executed, the mesh shader task corresponding to the at least one magnifying shader thread is obtained, at least one mesh shader thread is created according to the mesh shader task, and the at least one mesh shader thread is sent to the thread manager; after detecting that at least one mesh shader thread in the thread manager has been executed, the topological structure of the geometric primitives corresponding to the drawing data is created, and the topological structure is sent to the rasterization processing unit. A new graphics drawing pipeline can be added without affecting the existing graphics drawing pipeline, so that the GPU can perform multiple types of graphics drawing tasks and improve the applicability of GPU products. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 An application environment diagram of a graphically drawn pipeline management method in an embodiment;
[0059] Figure 2 A schematic diagram of a flow chart of a graphics drawing pipeline management method in an embodiment;
[0060] Figure 3 A schematic diagram of a process flow of a non-grid coloring task in one embodiment;
[0061] Figure 4 A schematic diagram of a process flow of a grid coloring task in one embodiment;
[0062] Figure 5 is a schematic diagram of the hardware architecture of a graphics processor in one embodiment;
[0063] Figure 6 A diagram showing an enlarged logical structure of a shader thread construction unit in one embodiment;
[0064] Figure 7 A logical structure diagram of a mesh shader thread construction unit in one embodiment;
[0065] Figure 8 A block diagram of a graphically drawn pipeline management device in one embodiment;
[0066] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0068] The graphics drawing pipeline management method provided in the embodiment of the present application can be applied to Figure 1In the computer device including GPU shown. In computer devices, GPU has become the second most important chip besides CPU. It is not only used for display and drawing, but also can perform general computing, deep reasoning and other functions. It constitutes a basic computer device with CPU, storage unit, display device, input and output unit, etc. It can be understood that the computer device can specifically be a terminal or a server. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices, portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart medical equipment, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0069] In one embodiment, Figure 2 As shown, a graphics drawing pipeline management method is provided, and the method is applied to Figure 1 The GPU in the example is used as an example to illustrate, including the following steps:
[0070] Step 202, identifying the task type to which the rendering data belongs; the task types are divided into non-grid shading tasks and grid shading tasks.
[0071] Among them, the graphics rendering pipeline consists of two parts: the front-end shading stage and the back-end shading stage. The front-end shading stage mainly processes information such as vertices and geometric primitives, while the back-end shading stage is mainly used to process imaging calculations pixel by pixel.
[0072] Non-network shading tasks refer to traditional drawing tasks that do not require mesh shaders in the front-end shading stage. Usually, the front-end shading stage includes: Vertex Shader (VS), Geometry Shader (GS), Hull Shader (HS), Domain Shader (DS), and a Tessellator (TESS). The back-end shading stage is mainly pixel shader (PS). Figure 3As shown, first the data enters the input assembly unit IAU, where the data is assembled and organized into topological structures such as triangles and input into the vertex shader VS. VS mainly completes the calculation of vertex position, initial color, texture coordinates, etc. After completion, it enters the mesh subdivision module, which includes three parts: HS, TESS, and DS. Among them, HS completes the pre-calculation process of surface subdivision, and DS is the post-processing process of subdivision. HS calculates multiple control points (CPs, Control Points) and subdivision parameters (PCs, PatchConsts) for each subdivision block (Patch). The subdivision parameters CPs are transmitted to TESS, and the two-dimensional UV coordinate values of the new vertices can be calculated; the control points PCs will be transmitted to DS, and DS interpolates the final three-dimensional coordinates and attribute information such as color based on the control points and the vertex UV coordinate values output by TS. DS then outputs the generated new vertex data to GS for later geometric processing. GS is a geometry shader that can create or delete geometric primitives, including three types of primitives: points, lines, and triangles. After the front-end shading stage is completed, it enters the hardware's rasterization component Raster, is converted into a set of pixels on the screen, and then enters the pixel shader PS for the final color calculation. After PS is completed, it enters the output merging unit OMU to perform post-calculations such as color mixing and culling, and finally outputs to the display screen. These drawing shading units can be used as needed, and the subdivision modules (HS, TESS, DS) and GS are seamlessly embedded in the graphics pipeline. Users can choose to turn on or off the subdivision module or GS. If it is turned off, the input data stream will skip the corresponding module and enter the subsequent module to continue execution, thereby seamlessly compatible with the existing drawing pipeline.
[0073] Mesh shading tasks refer to drawing tasks that require mesh shaders in the front-end shading stage. Usually, the front-end shading stage only includes the amplifier shader (AS) and mesh shader (MS). The back-end shading stage is the same as non-network shading tasks, and is mainly pixel shaders (PS). AS and MS can replace front-end shaders such as VS, HS, DS, and GS, and the new AS and MS remove many constraints, allowing developers to implement them like writing general compute shaders CS, greatly improving flexibility. Figure 3 Compared with the non-mesh shading task pipeline in , the mesh shading task pipeline is significantly simplified. Figure 4As shown, similar to CS, the enlarged shader AS processes a large number of work-groups, and each work-group can generate many sub-work-groups, which enter the mesh shader for further processing. AS is an optional shader; if AS is turned off, the command stream will enter the MS through AS to perform the work of the mesh shader. The mesh shader MS is also similar to CS. A large number of mesh work-groups can create the topological structure of geometric primitives, perform subsequent rasterization processing, and then execute pixel shaders and other tasks. Through MS and AS, program developers can completely skip the traditional front-end shading stage (including VS, HS, TESS, DS, GS), and can process batches of vertices and geometric primitives before rasterizing Raster. In addition, programmers can work as long as they write programs similar to CS, which is more flexible to use. Therefore, the new version of Vulkan has gradually added this feature of the mesh shader, and more and more GPU companies have launched products that can also support mesh shading tasks, making it a mainstream technology for drawing.
[0074] Optionally, when the command stream processing unit of the GPU receives a new drawing data stream, it checks whether the drawing data is a traditional drawing task or a mesh shading task.
[0075] Step 204 : if the drawing data belongs to a mesh shading task, create at least one enlargement shader thread according to the drawing data, and send the at least one enlargement shader thread to a thread manager.
[0076] Among them, GPU usually adopts a unified architecture, which will generate a series of threads from different types of shaders by the GPU hardware components, and be uniformly scheduled by the thread manager to run in parallel on the GPU execution unit. The basic unit of execution unit operation in GPU is thread, often called wave, which is a single instruction stream multiple data stream structure (SIMD), which often binds 16 / 32 / 64 units together for parallel execution.
[0077] Optionally, if the command stream processing unit of the GPU determines that the drawing data belongs to a mesh shading task, it will transmit the drawing data to the amplification shader thread construction unit, which will create at least one amplification shader thread and send the at least one amplification shader thread to the thread manager.
[0078] Step 206, after detecting that at least one amplification shader thread in the thread manager has completed execution, obtain the mesh shader task corresponding to the at least one amplification shader thread, create at least one mesh shader thread according to the mesh shader task, and send the at least one mesh shader thread to the thread manager.
[0079] Optionally, when the execution unit in the GPU starts to execute the enlarged shader thread, the enlarged shader thread construction unit will gradually create mesh shader tasks according to the running progress of these enlarged shader threads. After the enlarged shader thread construction unit detects that all the enlarged shader threads in the thread manager have completed execution, the created mesh shader task is sent to the mesh shader thread construction unit, and the mesh shader thread construction unit is used to create at least one mesh shader thread and send the at least one mesh shader thread to the thread manager.
[0080] Step 208 : after detecting that at least one mesh shader thread in the thread manager has finished executing, create a topology structure of geometric primitives corresponding to the drawing data, and send the topology structure to the rasterization processing unit.
[0081] Optionally, when the mesh shader thread construction unit detects that all mesh shader threads in the thread manager have completed execution, the topological structure of the geometric primitives is assembled and sent to the rasterization processing unit for further processing.
[0082] In the above-mentioned graphics drawing pipeline management method, the task type to which the drawing data belongs is identified. If the drawing data belongs to a mesh shading task, at least one amplification shader thread is created according to the drawing data, and the at least one amplification shader thread is sent to the thread manager; after detecting that at least one amplification shader thread in the thread manager has been executed, the mesh shader task corresponding to the at least one amplification shader thread is obtained, at least one mesh shader thread is created according to the mesh shader task, and the at least one mesh shader thread is sent to the thread manager; after detecting that at least one mesh shader thread in the thread manager has been executed, the topological structure of the geometric primitives corresponding to the drawing data is created, and the topological structure is sent to the rasterization processing unit. A new graphics drawing pipeline can be added without affecting the existing graphics drawing pipeline, so that the GPU can perform multiple types of graphics drawing tasks and improve the applicability of GPU products.
[0083] In one embodiment, before creating at least one magnifying shader thread according to drawing data, the method further includes: identifying the task characteristics of the mesh shading task. If the task characteristic of the mesh shading task is to enable the magnifying shader, the step of creating at least one magnifying shader thread according to the drawing data is performed and continued. If the task characteristic of the mesh shading task is to disable the magnifying shader, at least one mesh shader thread is created according to the drawing data, and at least one mesh shader thread is sent to the thread manager; after detecting that at least one mesh shader thread in the thread manager has been executed, a topological structure of the geometric primitives corresponding to the drawing data is created, and the topological structure of the geometric primitives corresponding to the drawing data is sent to the rasterization processing unit.
[0084] Optionally, after receiving the drawing data sent by the command stream processing unit, the magnifying shader thread construction unit first identifies the task characteristics and determines whether the magnifying shader is needed for this mesh shading task. If the task characteristic of this mesh shading task is to enable the magnifying shader, at least one magnifying shader thread is created according to the drawing data; if the task characteristic of this mesh shading task is to turn off the magnifying shader, the magnifying shader thread construction unit directly sends the drawing data to the mesh shader thread construction unit. The mesh shader thread construction unit uses the drawing data as a mesh shader task, creates at least one mesh shader thread according to the drawing data, and sends at least one mesh shader thread to the thread manager. When the mesh shader thread construction unit detects that all mesh shader threads in the thread manager have been executed, it assembles the topological structure of the geometric primitives and sends it to the rasterization processing unit for further processing.
[0085] In this embodiment, the task feature of the mesh shading task is identified. If the task feature of the mesh shading task is to enable the magnifying shader, the step of creating at least one magnifying shader thread according to the drawing data is performed and the execution continues. If the task feature of the mesh shading task is to disable the magnifying shader, at least one mesh shader thread is created according to the drawing data, and at least one mesh shader thread is sent to the thread manager. When the mesh shading task does not need the magnifying shader, the magnifying shader can be skipped and the mesh shader can be directly executed, thereby improving the processing efficiency of the drawing task.
[0086] In one embodiment, creating at least one enlarged shader thread according to drawing data includes: generating at least one enlarged shader work group according to the drawing data; creating at least one enlarged shader thread according to each enlarged shader work group. After sending the at least one enlarged shader thread to the thread manager, creating a mesh shader task according to the at least one enlarged shader work group.
[0087] Accordingly, creating at least one mesh shader thread according to the mesh shader task includes: generating at least one mesh shader work group according to the mesh shader task; and creating at least one mesh shader thread according to each mesh shader work group.
[0088] Optionally, the enlarged shader thread construction unit generates multiple enlarged shader work groups (also referred to as AS work groups or AS-grp) according to the drawing data, and creates multiple enlarged shader threads for each enlarged shader work group. The mesh shader thread construction unit generates multiple mesh shader work groups (also referred to as MS work groups or MS-grp) according to the mesh shader tasks, and each mesh shader work group is generated according to an enlarged shader work group. Usually, the corresponding enlarged shader work groups and mesh shader work groups are referred to as parent enlarged shader work groups and child mesh shader work groups, and then multiple enlarged shader threads are created for each enlarged shader work group.
[0089] In this embodiment, at least one enlarged shader work group is generated according to the drawing data; at least one enlarged shader thread is created according to each enlarged shader work group. After sending the at least one enlarged shader thread to the thread manager, a mesh shader task is created according to the at least one enlarged shader work group. At least one mesh shader work group is generated according to the mesh shader task; at least one mesh shader thread is created according to each mesh shader work group. A new graphics drawing pipeline can be added without affecting the existing graphics drawing pipeline, so that the GPU can perform various types of graphics drawing tasks, thereby improving the applicability of GPU products.
[0090] In one embodiment, the method further includes: if the drawing data belongs to a non-mesh shading task, sending the drawing data to a vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and sending the at least one vertex shader thread to a thread manager.
[0091] Optionally, if the command stream processing unit of the GPU determines that the drawing data belongs to a non-mesh shading task, it will transmit the drawing data to the vertex shader thread construction unit, which will create at least one vertex shader thread and send the at least one vertex shader thread to the thread manager. Figure 3 The process shown continues to execute the traditional graphics drawing pipeline.
[0092] In this embodiment, if the drawing data belongs to a non-mesh shading task, the drawing data is sent to the vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and send the at least one vertex shader thread to the thread manager. A new graphics drawing pipeline can be added without affecting the existing graphics drawing pipeline, so that the GPU can perform various types of graphics drawing tasks, thereby improving the applicability of GPU products.
[0093] In one embodiment, a graphics drawing pipeline management method is applied to Figure 5 Taking the graphics processor shown in the figure as an example, the method includes:
[0094] In the graphics processor, IAU is the command stream processing unit of GPU, which will be responsible for receiving the drawing data stream of the software, assembling geometric primitives, and then sending them to the subsequent modules. VSWC is the vertex shader thread construction unit, HSWC is the shell shader thread construction unit, DSWC is the region shader thread construction unit, GSWC is the geometry shader thread construction unit, PSWC is the pixel shader thread construction unit, ASWC is the amplification shader thread construction unit, and MSWC is the mesh shader thread construction unit. VSWC, HSWC, DSWC, GSWC, PSWC, ASWC and MSWC construct the wave threads of VS, HS, DS, GS, PS, AS and MS respectively, and send them to the thread manager WVM. The thread manager will uniformly schedule various threads, select the appropriate computing unit (ALU0~ALUn-1) from the execution unit EU, execute the simd instructions, and write the output data of each thread to the temporary cache VB for temporary storage, which will be read by the subsequent module as input data. GSWC passes the topological logical structure of geometric primitives to the rasterization module Raster, and reads the position, color and other attributes of the vertex from VB for rasterization operations. PSWC constructs the pixel wave thread based on the result of the rasterization operation, sends it to WVM for scheduling and execution, and outputs the final color to the OMU unit for post-calculations such as color mixing and culling, and finally outputs it to the display screen. The front-end stage in the graphics pipeline is very long, and various shading threads are uniformly scheduled by WVM and executed on the execution unit, without distinguishing each shading type. VSWC, HSWC, DSWC, GSWC and PSWC, connected to the Raster module, constitute the traditional drawing path, while ASWC and MSWC, connected to the Raster module, constitute a new drawing path. Both paths can work independently without affecting each other.
[0095] like Figure 5 As shown, the management method of the graphics processor for the graphics drawing pipeline is as follows:
[0096] (1) When IAU receives the command data stream, it checks whether it is a traditional drawing task or a mesh coloring task. Since the traditional drawing method and the newly added mesh coloring task cannot coexist, only one path needs to be selected for execution. If it is a traditional task including VS, HS, etc., then IAU sends the drawing data stream to VSWC; if it is a mesh coloring task, then IAU sends the drawing data stream to the ASWC module.
[0097] (2) After ASWC receives the data, if the current task requires turning off the amplification shader AS, the data will be sent directly to MSWC; if the current task requires the use of AS, multiple AS work groups (AS-grp) will be generated, each AS-grp will create multiple AS threads and send them to WVM for thread scheduling.
[0098] (3) WVM will schedule the thread of AS, allocate the corresponding ALU unit and execute it. The result of the thread of AS will be written into VB for temporary storage.
[0099] (4) After the AS thread ends, the subsequent MSWC will be notified, and multiple corresponding sub-MS working groups (MS-grp) will be generated according to multiple AS working groups (AS-grp). Each MS-grp will create multiple MS threads and send them to WVM for thread scheduling.
[0100] (5) WVM will schedule the threads of MS, allocate the corresponding ALU units and execute them. The results of the threads of MS will be written to VB for temporary storage. Note that MS, AS and PS may exist at the same time, so WVM will execute these threads in parallel according to their priority.
[0101] (6) After the MS thread ends, MSWC will assemble the topological structure of the geometric primitives and send it to the Raster module. Raster reads information such as the position and color of the vertices from VB and performs rasterization processing; when all the child MS-grps of a certain AS-grp end, MSWC will notify ASWC to release the resources of the AS-grp.
[0102] (7) The subsequent operations are consistent with the traditional method. Raster sends the rasterization result to PSWC, constructs a PS thread and sends it to WVM for scheduling and execution. Each PS output color value is sent to the OMU module for the final color and depth fusion and output results.
[0103] In a feasible implementation, the basic logical structure of ASWC is as follows: Figure 6As shown, AS_GRP is used to create an AS work group (AS-grp), AS_GPT records the basic information of the currently executing AS-grp, and AS_WV is used to create all sub-AS threads of the AS-grp. The full name of ASWC in the graphics processor is Amplification Shader Wave Constructor, which is the amplification shader thread construction unit. ASWC needs to determine whether it is an AS task or an MS task based on the type of IAU input data stream. If it is an MS task, the input data is directly transmitted to the subsequent MSWC module; if it is an AS task, ASWC creates an AS-grp group and the corresponding AS wave thread, and sends it to WVM to execute the AS thread. The input data information of the amplification shader AS is similar to that of CS, including the three-dimensional work group (Work Group) size and the number of work groups, but AS does not support work group offset. Therefore, IAU will send the following 6 32-bit data to ASWC to construct the AS thread: the three-dimensional size of the AS work-group, also known as the local size, using the triplet: (AS_WDx, AS_WDy, AS_WDz); the number of AS work-groups, also using the triplet: (AS_WCx, AS_WCy, AS_WCz).
[0104] like Figure 6 As shown in the figure, the workflow of ASWC is:
[0105] (1) ASWC receives data information from IAU and determines whether it is an AS task or an MS task. If it is an MS task, no processing is required and the data information is directly transmitted to the subsequent MSWC module.
[0106] (2) If it is an AS task, ASWC creates an AS-grp group through the AS_GRP module. AS_GRP follows a similar generation algorithm to CSgroup, and also traverses the workgroup AS-grp in the x, y, and z directions in turn to obtain each workgroup index (work-group ID), recorded as a triple: as_wgd = (as_wgdx, as_wgdy, as_wgdz) and the workgroup size (AS_WDx, AS_WDy, AS_WDz) and sends it to the AS_WV submodule to construct the sub-AS thread of the workgroup.
[0107] (3) AS_GRP needs to allocate a space from the work group status table (AS_GPT) to record the current AS-grp information, including the number, work group index, number of constructed AS threads, etc., for the sequential output and resource management of the AS-grp. The work group index table (AS_GPT) can generally record a limited number of AS-grps, for example, 64. If the AS_GPT is full, then AS_GRP needs to wait for the previous AS-grp to release resources before it can continue to create a new AS-grp work group.
[0108] (4) After receiving the AS-grp information from AS_GRP, AS_WV starts to construct all child threads of the work group. AS threads are generally organized into 32 work sets or 64 work sets, called simd32 or simd64. The construction method is similar to CS, which is also along the x, y, and z directions to traverse the work group AS-grp in turn to obtain the index (work-item ID) of each thread, recorded as a triple: as_wid = (as_widx, as_widy, as_widz), and send it and its parent AS-grp number to WVM for scheduling, and execute the AS thread in EU.
[0109] (5) When the AS thread creates a MS task during execution, WVM will notify AS_GPT to update the corresponding AS-grp status data, including whether it is completed, the size of the created MS work group, and other information.
[0110] (6) When all AS threads of AS-grp are finished, ASWC will send the mesh coloring MS tasks to the subsequent MSWC modules according to the order constructed by AS-grp.
[0111] In a feasible implementation, the basic logical structure of MSWC is as follows: Figure 7As shown, MS_GRP is used to create MS-grp, MS_GPT records the basic information of the MS-grp being executed, and MS_WV is used to create all child MS threads of the current MS-grp. MSWC is called Mesh Shader Wave Constructor, which is the mesh shader thread construction unit. MSWC needs to create MS workgroups (MS-grp) and corresponding MS wave threads based on the input information of ASWC, and send them to WVM for scheduling and execution. The input data information of MS is similar to that of AS, including the three-dimensional MS workgroup size and the number of MS workgroups. In addition, there is a corresponding AS-grp number. Therefore, ASWC will send the following 7 16-bit data to ASWC to construct the AS thread: the three-dimensional size of the MS work-group, using the triplet: (MS_WDx, MS_WDy, MS_WDz); if the AS task is closed, then the input from the IAU; the number of MS work-groups, also using the triplet: (MS_WCx, MS_WCy, MS_WCz); if the AS task is closed, then the input from the IAU; the number of the parent AS-grp of the grid shading task; if the AS task is closed, then the value is 0.
[0112] like Figure 7 As shown, similar to ASWC, the workflow of MSWC is:
[0113] (1) MSWC receives data information from ASWC and creates a MS-grp group through the MS_GRP module. MS_GRP follows a similar generation algorithm to CS group, and also traverses the workgroup MS-grp in the x, y, and z directions in turn to obtain each MS workgroup index (work-group ID), recorded as a triple: ms_wgd = (ms_wgdx, ms_wgdy, ms_wgdz) and the workgroup size (MS_WDx, MS_WDy, MS_WDz) and sends it to MS_WV for constructing the child MS thread of the workgroup.
[0114] (2) MS_GRP needs to allocate a space from the workgroup status table (MS_GPT) to record the current MS-grp information, including the number, workgroup index, the number of its parent AS-grp, the number of generated vertices and geometric primitives, etc., for the sequential output and resource management of the primitive assembly of the MS-grp. The number of MS-grps that can be recorded in the workgroup index table MS_GPT is generally limited, for example, 64. If the MS_GPT is full, then the MS_GRP needs to wait for the previous MS-grp to release resources before it can continue to create a new MS-grp workgroup.
[0115] (3) After receiving the MS-grp information from MS_GRP, MS_WV starts to construct all MS threads of the work group. MS threads are generally organized into 32 or 64 work sets, called simd32 or simd64. The construction method is similar to CS, which is also along the x, y, and z directions to traverse the work group MS-grp in turn to obtain the index (work-item ID) of each thread, recorded as a triple: ms_wid = (ms_widx, ms_widy, ms_widz), and send it and its parent MS-grp number to WVM for thread scheduling, and execute the MS thread in EU.
[0116] (4) The MS thread will determine the number of vertices and geometric primitives generated during execution, and WVM will notify MS_GPT to update the corresponding MS-grp status information.
[0117] (5) When all MS threads of MS-grp are finished, MSWC will notify the MS_PRIM submodule to construct the topological relationship between vertices and geometric primitives according to the number of vertices and geometric primitives currently generated in the order of MS-grp construction. Currently, according to design requirements, each MS-grp generates a maximum of 256 vertices and 256 geometric primitives, and only supports two types: line and triangle. However, this method is not subject to these constraints and can adjust the maximum number of supported vertices according to actual needs.
[0118] (6) Raster will read the position and other attribute data of each vertex from VB based on the received geometric metadata information, perform rasterization operations, and perform subsequent PS operations.
[0119] (7) After processing the current MS-grp, the MSWC will notify the ASWC to release the resources of the AS-grp according to the number of its parent AS-grp, and also release the resources of the MS-grp.
[0120] In this embodiment, two new units ASWC and MSWC are added to the graphics processor to construct threads of the magnification shader and the mesh shader, and the generated AS, MS workgroups and geometric primitives are sorted and resource managed to ensure the correctness of the drawing. The AS and MS threads constructed by ASWC and MSWC can be uniformly scheduled and executed in parallel by the thread management unit like other types of threads, so as to be perfectly integrated into the current GPU unified architecture. Without changing the existing graphics drawing pipeline, a new drawing path is added between the input IAU and the rasterization Raster module, which can support mesh shading tasks and is compatible with the existing graphics drawing engine.
[0121] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0122] Based on the same inventive concept, the embodiment of the present application also provides a graphics drawing pipeline management device for implementing the graphics drawing pipeline management method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more graphics drawing pipeline management device embodiments provided below can refer to the limitations of the graphics drawing pipeline management method above, and will not be repeated here.
[0123] In one embodiment, Figure 8 As shown, a graphics drawing pipeline management device 800 is provided, comprising: a drawing task identification module 801, a first thread management module 802, a second thread management module 803 and a mesh coloring output module 804, wherein:
[0124] The drawing task identification module 801 is used to identify the task type to which the drawing data belongs; the task types are divided into non-grid coloring tasks and grid coloring tasks.
[0125] The first thread management module 802 is configured to create at least one enlargement shader thread according to the drawing data if the drawing data belongs to a mesh shading task, and send the at least one enlargement shader thread to the thread manager.
[0126] The second thread management module 803 is used to obtain the mesh shader task corresponding to at least one amplification shader thread after detecting that at least one amplification shader thread in the thread manager has been executed, create at least one mesh shader thread according to the mesh shader task, and send at least one mesh shader thread to the thread manager.
[0127] The mesh shading output module 804 is used to create a topological structure of geometric primitives corresponding to the drawing data after detecting that at least one mesh shader thread in the thread manager has completed execution, and send the topological structure to the rasterization processing unit.
[0128] In one embodiment, the first thread management module 802 is further used to identify the task characteristics of the mesh shading task; if the task characteristic of the mesh shading task is to enable the magnification shader, the step of creating at least one magnification shader thread according to the drawing data is executed and the execution continues.
[0129] In one embodiment, the first thread management module 802 is further configured to create at least one mesh shader thread according to the drawing data and send the at least one mesh shader thread to the thread manager if the task feature of the mesh shading task is to turn off the magnification shader.
[0130] The second thread management module 803 is further used to create a topological structure of geometric primitives corresponding to the drawing data after detecting that at least one mesh shader thread in the thread manager has completed execution, and send the topological structure of the geometric primitives corresponding to the drawing data to the rasterization processing unit.
[0131] In one embodiment, the first thread management module 802 is further configured to generate at least one amplifying shader work group according to the drawing data; and create at least one amplifying shader thread according to each amplifying shader work group.
[0132] The second thread management module 803 is further configured to generate at least one mesh shader work group according to the mesh shader task; and create at least one mesh shader thread according to each mesh shader work group.
[0133] In one embodiment, the first thread management module 802 is further configured to create a mesh shader task according to at least one enlarged shader work group.
[0134] In one embodiment, the apparatus further comprises:
[0135] The third thread management module 805 is used to send the drawing data to the vertex shader thread construction unit if the drawing data belongs to a non-mesh shading task, so as to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and send at least one vertex shader thread to the thread manager.
[0136] Each module in the above-mentioned graphics drawing pipeline management device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0137] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store drawing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a graphics drawing pipeline management method is implemented.
[0138] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0139] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: identifying the task type to which drawing data belongs; the task types are divided into non-grid shading tasks and grid shading tasks; if the drawing data belongs to a grid shading task, creating at least one amplification shader thread according to the drawing data, and sending the at least one amplification shader thread to a thread manager; after detecting that at least one amplification shader thread in the thread manager has completed execution, obtaining a grid shader task corresponding to the at least one amplification shader thread, creating at least one grid shader thread according to the grid shader task, and sending the at least one grid shader thread to the thread manager; after detecting that at least one grid shader thread in the thread manager has completed execution, creating a topological structure of geometric primitives corresponding to the drawing data, and sending the topological structure to a rasterization processing unit.
[0140] In one embodiment, when the processor executes the computer program, the following steps are also implemented: identifying the task characteristics of the mesh shading task; if the task characteristics of the mesh shading task are to enable the magnification shader, executing the step of creating at least one magnification shader thread according to the drawing data and continuing the execution.
[0141] In one embodiment, the processor further implements the following steps when executing the computer program: if the task characteristic of the mesh shading task is to turn off the magnification shader, create at least one mesh shader thread according to the drawing data, and send at least one mesh shader thread to the thread manager; after detecting that at least one mesh shader thread in the thread manager has completed execution, create a topological structure of geometric primitives corresponding to the drawing data, and send the topological structure of the geometric primitives corresponding to the drawing data to the rasterization processing unit.
[0142] In one embodiment, when the processor executes the computer program, the following steps are also implemented: generating at least one amplification shader workgroup based on the drawing data; creating at least one amplification shader thread based on each amplification shader workgroup; accordingly, generating at least one mesh shader workgroup based on the mesh shader task; and creating at least one mesh shader thread based on each mesh shader workgroup.
[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: creating a mesh shader task according to the at least one enlarged shader work group.
[0144] In one embodiment, the processor further implements the following steps when executing the computer program: if the drawing data belongs to a non-mesh shading task, the drawing data is sent to a vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and send the at least one vertex shader thread to a thread manager.
[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: identifying the task type to which drawing data belongs; the task types are divided into non-grid shading tasks and grid shading tasks; if the drawing data belongs to a grid shading task, creating at least one amplification shader thread according to the drawing data, and sending the at least one amplification shader thread to a thread manager; after detecting that at least one amplification shader thread in the thread manager has completed execution, obtaining a grid shader task corresponding to the at least one amplification shader thread, creating at least one grid shader thread according to the grid shader task, and sending the at least one grid shader thread to the thread manager; after detecting that at least one grid shader thread in the thread manager has completed execution, creating a topological structure of geometric primitives corresponding to the drawing data, and sending the topological structure to a rasterization processing unit.
[0146] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: identifying the task characteristics of the mesh shading task; if the task characteristics of the mesh shading task are to enable the magnification shader, executing the step of creating at least one magnification shader thread according to the drawing data and continuing the execution.
[0147] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the task characteristic of the mesh shading task is to turn off the magnification shader, create at least one mesh shader thread according to the drawing data, and send at least one mesh shader thread to the thread manager; after detecting that at least one mesh shader thread in the thread manager has completed execution, create a topological structure of geometric primitives corresponding to the drawing data, and send the topological structure of the geometric primitives corresponding to the drawing data to the rasterization processing unit.
[0148] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: generating at least one amplification shader workgroup based on drawing data; creating at least one amplification shader thread based on each amplification shader workgroup; accordingly, generating at least one mesh shader workgroup based on the mesh shader task; and creating at least one mesh shader thread based on each mesh shader workgroup.
[0149] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: creating a mesh shader task according to at least one enlarged shader work group.
[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the drawing data belongs to a non-mesh shading task, the drawing data is sent to a vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and the at least one vertex shader thread is sent to a thread manager.
[0151] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: identifying the task type to which drawing data belongs; the task type is divided into a non-grid shading task and a grid shading task; if the drawing data belongs to a grid shading task, creating at least one amplification shader thread according to the drawing data, and sending the at least one amplification shader thread to a thread manager; after detecting that at least one amplification shader thread in the thread manager has completed execution, obtaining a grid shader task corresponding to the at least one amplification shader thread, creating at least one grid shader thread according to the grid shader task, and sending the at least one grid shader thread to the thread manager; after detecting that at least one grid shader thread in the thread manager has completed execution, creating a topological structure of geometric primitives corresponding to the drawing data, and sending the topological structure to a rasterization processing unit.
[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: identifying the task characteristics of the mesh shading task; if the task characteristics of the mesh shading task are to enable the magnification shader, executing the step of creating at least one magnification shader thread according to the drawing data and continuing the execution.
[0153] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the task characteristic of the mesh shading task is to turn off the magnification shader, create at least one mesh shader thread according to the drawing data, and send at least one mesh shader thread to the thread manager; after detecting that at least one mesh shader thread in the thread manager has completed execution, create a topological structure of geometric primitives corresponding to the drawing data, and send the topological structure of the geometric primitives corresponding to the drawing data to the rasterization processing unit.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: generating at least one amplification shader workgroup based on drawing data; creating at least one amplification shader thread based on each amplification shader workgroup; accordingly, generating at least one mesh shader workgroup based on the mesh shader task; and creating at least one mesh shader thread based on each mesh shader workgroup.
[0155] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: creating a mesh shader task according to at least one enlarged shader work group.
[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the drawing data belongs to a non-mesh shading task, the drawing data is sent to a vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and the at least one vertex shader thread is sent to a thread manager.
[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0159] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A graphics drawing pipeline management method, characterized in that: The method is applied to a graphics processor, wherein the graphics processor is provided with two drawing paths, the first drawing path includes a vertex shader thread construction unit, a shell shader thread construction unit, a region shader thread construction unit, a geometry shader thread construction unit and a pixel shader thread construction unit, and the second drawing path includes an amplification shader thread construction unit and a mesh shader thread construction unit, and the two drawing paths are respectively connected to a rasterization processing unit; the method includes: Identify the task type to which the drawing data belongs; the task type is divided into non-grid coloring tasks and grid coloring tasks; If the drawing data belongs to a non-mesh shading task, sending the drawing data to the vertex shader thread construction unit to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and sending the at least one vertex shader thread to the thread manager; If the drawing data belongs to a mesh shading task, transmitting the drawing data to the enlarged shader thread construction unit, instructing the enlarged shader thread construction unit to create at least one enlarged shader thread according to the drawing data, and sending the at least one enlarged shader thread to the thread manager; After detecting that the at least one amplifying shader thread in the thread manager is executed, obtaining a mesh shader task corresponding to the at least one amplifying shader thread, creating at least one mesh shader thread according to the mesh shader task, and sending the at least one mesh shader thread to the thread manager; After detecting that the at least one mesh shader thread in the thread manager is executed, a topological structure of geometric primitives corresponding to the drawing data is created, and the topological structure is sent to the rasterization processing unit.
2. The method according to claim 1, characterized in that Before creating at least one amplification shader thread according to the drawing data, the method further includes: Identifying task features of the grid coloring task; If the task feature of the mesh shading task is to enable an amplification shader, the step of creating at least one amplification shader thread according to the drawing data is performed and the execution continues.
3. The method according to claim 2, characterized in that The method further comprises: If the task characteristic of the mesh shading task is to close the magnification shader, create at least one mesh shader thread according to the drawing data, and send the at least one mesh shader thread to the thread manager; After detecting that the at least one mesh shader thread in the thread manager is executed, a topological structure of geometric primitives corresponding to the drawing data is created, and the topological structure of the geometric primitives corresponding to the drawing data is sent to a rasterization processing unit.
4. The method according to any one of claims 1 to 3, characterized in that The step of creating at least one amplification shader thread according to the drawing data comprises: generating at least one magnified shader working group according to the drawing data; Creating at least one amplification shader thread according to each amplification shader work group; Accordingly, the step of creating at least one mesh shader thread according to the mesh shader task comprises: generating at least one mesh shader working group according to the mesh shader task; At least one mesh shader thread is created per mesh shader work group.
5. The method according to claim 4, characterized in that After sending the at least one amplifying shader thread to the thread manager, the method further includes: The mesh shader task is created based on the at least one enlarged shader workgroup.
6. A graphics processor, characterized in that: The graphics processor is provided with two drawing paths, the first drawing path includes a vertex shader thread construction unit, a shell shader thread construction unit, a region shader thread construction unit, a geometry shader thread construction unit and a pixel shader thread construction unit, and the second drawing path includes an amplification shader thread construction unit and a mesh shader thread construction unit, and the two drawing paths are respectively connected to the rasterization processing unit; The graphics processor comprises: A command stream processing unit, configured to receive drawing data and identify a task type to which the drawing data belongs, and if the drawing data belongs to a mesh shading task, send the drawing data to the amplifying shader thread construction unit; the task type is divided into a non-mesh shading task and a mesh shading task; The command stream processing unit is further configured to send the drawing data to the vertex shader thread construction unit to instruct the vertex shader thread construction unit if the drawing data belongs to a non-mesh shading task; The vertex shader thread construction unit is used to create at least one vertex shader thread according to the drawing data, and send the at least one vertex shader thread to the thread manager; The enlarged shader thread construction unit is used to create at least one enlarged shader thread according to the drawing data, and send the at least one enlarged shader thread to the thread manager, and after detecting that the at least one enlarged shader thread in the thread manager is executed, create a corresponding mesh shader task according to the at least one enlarged shader thread and send it to the mesh shader thread construction unit; The mesh shader thread construction unit is used to receive the mesh shader task, create at least one mesh shader thread according to the mesh shader task, and send the at least one mesh shader thread to the thread manager. After detecting that the at least one mesh shader thread in the thread manager has completed execution, create a topological structure of the geometric primitives corresponding to the drawing data, and send the topological structure of the geometric primitives corresponding to the drawing data to the rasterization processing unit.
7. A graphics drawing pipeline management device, characterized in that: The invention is applied to a graphics processor, wherein the graphics processor is provided with two drawing paths, the first drawing path includes a vertex shader thread construction unit, a shell shader thread construction unit, a region shader thread construction unit, a geometry shader thread construction unit and a pixel shader thread construction unit, and the second drawing path includes an amplification shader thread construction unit and a mesh shader thread construction unit, and the two drawing paths are respectively connected to a rasterization processing unit; the device includes: A drawing task identification module is used to identify the task type to which the drawing data belongs; the task type is divided into non-grid coloring tasks and grid coloring tasks; a first thread management module, configured to send the drawing data to the vertex shader thread construction unit if the drawing data belongs to a non-mesh shading task, so as to instruct the vertex shader thread construction unit to create at least one vertex shader thread according to the drawing data, and send the at least one vertex shader thread to the thread manager; further configured to transmit the drawing data to the enlarged shader thread construction unit if the drawing data belongs to a mesh shading task, so as to instruct the enlarged shader thread construction unit to create at least one enlarged shader thread according to the drawing data, and send the at least one enlarged shader thread to the thread manager; a second thread management module, configured to, upon detecting that the at least one amplifying shader thread in the thread manager is completed, obtain a mesh shader task corresponding to the at least one amplifying shader thread, create at least one mesh shader thread according to the mesh shader task, and send the at least one mesh shader thread to the thread manager; The mesh shading output module is used to create a topological structure of geometric primitives corresponding to the drawing data after detecting that the at least one mesh shader thread in the thread manager has completed execution, and send the topological structure to the rasterization processing unit.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
