Graphics processor, graphics drawing method, chip and electronic device

By designing a geometry processing pipeline that combines the first task generation pipeline and the second task generation pipeline, the performance bottleneck problem caused by the serial processing of the VTG rendering pipeline and the mesh shading rendering pipeline is solved, and automatic hardware alignment and efficient parallel computing are achieved.

CN119809912BActive Publication Date: 2025-09-05MOORE THREADS TECHNOLOGY (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411997324.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-09-05
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The geometry processing pipelines of the VTG rendering pipeline and the mesh shading rendering pipeline in existing graphics processors are processed serially, resulting in low parallel computing efficiency and prone to performance bottlenecks.

Method used

A geometry processing pipeline is designed, which combines the first task generation pipeline and the second task generation pipeline. It can process the geometry processing parts of different rendering pipelines in single-pipeline or dual-pipeline mode, and achieves natural hardware alignment through the task control unit to avoid additional synchronization operations.

Benefits of technology

Improved graphics processor performance, enabling the mixing of VTG rendering pipelines and mesh shading rendering pipelines without the need for additional synchronization operations, achieving automatic hardware alignment and improving parallel computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119809912B_ABST
    Figure CN119809912B_ABST
Patent Text Reader

Abstract

The present application discloses a graphics processor, a graphics drawing method, a chip, and an electronic device, belonging to the field of chips. The graphics processor includes a geometry processing pipeline, which includes a first task generation pipeline, a task control unit, a second task generation pipeline, and a task execution unit; the task control unit is used to obtain a first shading result based on the received first task information in a single-pipeline mode, and output the first shading result to the pipeline after the geometry processing pipeline; and, in a dual-pipeline mode, obtain a first shading result based on the received first task information, control the first shading result to enter the second task generation pipeline; and obtain a second shading result based on the received second task information, and output the second shading result to the pipeline after the geometry processing pipeline. The geometry processing pipeline of the present application can combine the geometry processing parts of different rendering pipelines into the same data stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chips, and in particular to a graphics processor, a graphics rendering method, a chip, and an electronic device. Background Art

[0002] The graphics processing unit (GPU) provides a VTG rendering pipeline. The geometry processing pipeline in the VTG rendering pipeline consists of vertex shaders, tessellation shaders (including shell shaders, tessellation stages, and domain shaders), and geometry shaders. In the VTG rendering pipeline, vertex shaders and geometry shaders are processed serially, which limits the efficiency of parallel computing and can easily lead to performance bottlenecks.

[0003] The graphics processor in the related art also provides a mesh shading rendering pipeline. The geometry processing pipeline in the mesh shading rendering pipeline includes an amplification shader and a mesh shader. The mesh shader can process multiple vertices and fragments in parallel, thereby improving the performance of the graphics processor.

[0004] In the related art, a solution is provided for simultaneously setting up an independent VTG rendering pipeline and a mesh shading rendering pipeline on a graphics processor, so that the VTG rendering pipeline and the mesh shading rendering pipeline can be used in a mixed manner. Summary of the Invention

[0005] The present application provides a graphics processor, a graphics drawing method, a chip, and an electronic device. The geometry processing pipeline provided by the present application can combine the geometry processing parts of different rendering pipelines into the same data stream.

[0006] According to one aspect of the present application, a graphics processor is provided, comprising a geometry processing pipeline, the geometry processing pipeline comprising a first task generation pipeline, a task control unit, a second task generation pipeline, and a task execution unit, wherein the first task generation pipeline is configured to generate a first shader task corresponding to a first shader and first task information of the first shader task, and the second task generation pipeline is configured to generate a second shader task corresponding to a second shader and second task information of the second shader task;

[0007] a task execution unit, configured to receive and execute a first shader task in a single-pipeline mode to obtain a first shading result; and to receive and execute the first shader task and the second shader task in a dual-pipeline mode to obtain a first shading result and a second shading result, respectively;

[0008] a task control unit, configured to obtain a first shading result based on the received first task information in a single pipeline mode, and output the first shading result to a pipeline subsequent to the geometry processing pipeline;

[0009] Also, in the dual-pipeline mode, based on the received first task information, a first shading result is obtained, and the first shading result is controlled to enter the second task generation pipeline; and, based on the received second task information, a second shading result is obtained, and the second shading result is output to the pipeline after the geometry processing pipeline.

[0010] According to one aspect of the present application, a graphics rendering method is provided. The method is applied to a graphics processor, wherein the graphics processor includes a geometry processing pipeline, the geometry processing pipeline includes a first task generation pipeline, a task control unit, a second task generation pipeline, and a task execution unit. The method includes:

[0011] The first task generation pipeline generates a first shader task corresponding to the first shader and first task information of the first shader task;

[0012] The first task generation pipeline sends the first shader task to the task execution unit and sends the first task information to the task control unit; the task execution unit executes the first shader task to obtain a first shading result;

[0013] In the single pipeline mode, the task control unit obtains a first shading result based on the first task information, and outputs the first shading result to a pipeline following the geometry processing pipeline;

[0014] In the dual-pipeline mode, the task control unit obtains the first shading result based on the first task information, and outputs the first shading result to the second task generation pipeline. The second task generation pipeline generates a second shader task corresponding to the second shader and the second task information of the second shader task based on the first shading result; the second task generation pipeline sends the second shader task to the task execution unit, and sends the second task information to the task control unit; the task execution unit executes the second shader task to obtain the second shading result; the task control unit obtains the second shading result based on the second task information, and outputs the second shading result to the pipeline after the geometry processing pipeline.

[0015] According to one aspect of the present application, a chip is provided, which includes the above-mentioned graphics processor.

[0016] According to one aspect of the present application, a server is provided, and the server includes the above-mentioned graphics processor.

[0017] According to one aspect of the present application, an electronic device is provided, and the electronic device includes the above-mentioned graphics processor.

[0018] The beneficial effects brought about by the technical solutions provided in the embodiments of the present application include at least the following.

[0019] Through the design of the first task generation pipeline, the second task generation pipeline and the task control unit, the geometry processing pipeline provided by this application can combine the geometry processing parts in different rendering pipelines and implement them as the same data stream. At this time, the first task generation pipeline can be configured to generate shader tasks for different rendering pipelines, and the second task generation pipeline can also be configured to generate shader tasks for different rendering pipelines. Compared with the related art, this application does not set up two geometry processing pipelines for the VTG rendering pipeline and the mesh shading rendering pipeline respectively, but only uses one geometry processing pipeline.

[0020] Furthermore, in dual-pipeline mode, the first shader task and the second shader task can be generated by the first task generation pipeline and the second task generation pipeline, respectively. This allows shader applications that use a mix of the VTG rendering pipeline and the mesh shading rendering pipeline to achieve natural alignment without the need for additional synchronization and alignment operations. The hardware can distribute the alignment naturally: the first shader task generated by the first task generation pipeline in the VTG rendering pipeline and the mesh shading rendering pipeline are aligned, and the second shader task generated by the second task generation pipeline are aligned. Furthermore, regardless of whether it is the VTG rendering pipeline or the mesh shading rendering pipeline, the rendering order of the second shader task generated by the second task generation pipeline is naturally after the rendering order of the first shader task generated by the first task generation pipeline, meaning the rendering order is naturally guaranteed by the hardware. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] Figure 1 This is a schematic diagram of a geometry processing pipeline provided by an embodiment of the present application.

[0023] Figure 2 This is a schematic diagram of an allocation scheme for different shader combinations provided by an embodiment of the present application.

[0024] Figure 3 This is a schematic diagram of a geometry processing pipeline provided by an embodiment of the present application.

[0025] Figure 4 This is a schematic diagram of a geometry processing pipeline provided by an embodiment of the present application.

[0026] Figure 5 This is a schematic diagram of a task control unit provided in one embodiment of the present application.

[0027] Figure 6 This is a schematic diagram of a task control unit provided in one embodiment of the present application.

[0028] Figure 7 This is a schematic diagram of a task control unit provided in one embodiment of the present application.

[0029] Figure 8 This is a structural block diagram of an electronic device provided by an embodiment of the present application.

[0030] Figure 9 This is a schematic diagram of the structure of a server provided in one embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0032] First, some terms in the embodiments of this application are introduced:

[0033] Geometry Processing Pipeline: The graphics processor consists of two main parts: the geometry processing pipeline and the pixel processing pipeline. The geometry processing pipeline is mainly used to process the geometric coordinates and shapes of the graphics, while the pixel processing pipeline is mainly used to perform pixel operations on the graphics. In the VTG rendering pipeline proposed by DX11.3, the geometry processing pipeline includes the vertex shader, the tessellation shader (including the hull shader, the tessellation stage (Tessellator), and the domain shader), and the geometry shader. In the mesh shading rendering pipeline proposed by DX12, the geometry processing pipeline includes the amplification shader and the mesh shader.

[0034] In the geometry processing pipeline of the VTG rendering pipeline, after receiving the drawing instruction, the initial drawing data first enters the vertex shader. The vertex shader completes the coordinate transformation of the vertex. The vertex shader is processed based on the vertex as the basic unit. After the vertex shader is completed, it will enter the tessellation shader. The tessellation shader is an optional shader. In the tessellation shader, the shell shader completes the pre-calculation process of the tessellation. The tessellation parameters output by the shell shader enter the tessellation stage. The tessellation stage calculates the new vertices after tessellation based on the tessellation parameters. The domain shader adjusts and calculates the coordinates of the new vertices. The domain shader inputs all vertices into the geometry shader. The geometry shader adds, deletes, and modifies the vertices. The geometry shader is also an optional shader.

[0035] In the geometry processing pipeline of the mesh shading rendering pipeline, the magnification shader amplifies the received drawing data to generate more drawing data. The magnification shader is an optional shader. After the mesh shader receives all the drawing data, it processes the drawing data of the entire mesh. The mesh shader can process the data of the entire mesh at once, thus achieving large-scale geometry data generation and processing.

[0036] Figure 1 1 is a schematic diagram of a geometry processing pipeline provided by an exemplary embodiment of the present application. The geometry processing pipeline 100 includes a first task generation pipeline 110, a task control unit 120, a second task generation pipeline 130, and a task execution unit 140. The first task generation pipeline 110 is used to generate a first shader task corresponding to a first shader, where the first shader task is a task used to implement the functionality of the first shader, and to generate first task information corresponding to the first shader task, where the first task information is related to the first shader task. The second task generation pipeline 130 is used to generate a second shader task corresponding to a second shader, where the second shader task is a task used to implement the functionality of the second shader, and to generate second task information corresponding to the second shader task, where the second task information is related to the second shader task. The task control unit 120 and the task execution unit 140 are connected to the first task generation pipeline 110 and the second task generation pipeline 130, respectively.

[0037] In single-pipeline mode, the first task generation pipeline 110 generates a first shader task and first task information. The first task generation pipeline 110 sends the first shader task to the task execution unit 140, and sends the first task information to the task control unit 120. The task execution unit 140 receives the first shader task, executes the first shader task, and obtains a first shading result. The task control unit 120 receives the first task information, which includes the storage location and storage format of the first shading result. The task control unit 120 obtains the first shading result according to the instructions of the first task information and outputs the first shading result to the pipeline after the geometry processing pipeline. Single-pipeline mode refers to a mode in which only the first shader processing pipeline is started. The first shader processing pipeline includes the first task generation pipeline 110 and the task execution unit 140. The first shader processing pipeline is used to implement the function of the first shader.

[0038] In the present application, in single-pipeline mode, the type of the first shader is configurable. In one embodiment, in single-pipeline mode, the first shader can be at least one shader in the geometry processing portion of the VTG rendering pipeline, that is, the first shader can be at least one of a vertex shader, a geometry shader, a shell shader, and a domain shader. Alternatively, the first shader can be a mesh shader in the geometry processing portion of the mesh shading rendering pipeline. In single-pipeline mode, only the functionality of the first shader is implemented.

[0039] In dual-pipeline mode, the first task generation pipeline 110 generates a first shader task and first task information. The first task generation pipeline 110 sends the first shader task to the task execution unit 140 and sends the first task information to the task control unit 120. The task execution unit 140 executes the first shader task to obtain a first shading result. The task control unit 120 obtains the first shading result according to the instruction of the first task information and controls the first shader task to enter the second task generation pipeline 130. Optionally, the first task information includes the storage location and storage format of the first shading result.

[0040] The second task generation pipeline 130 passes the second shader task generated based on the first shading result to the task execution unit 140, and passes the second task information corresponding to the second shader task to the task control unit 120; the task execution unit 140 executes the second shader task to obtain a second shading result; the task control unit 120 obtains the second shading result according to the instruction of the second task information, and controls the output of the second shading result to the pipeline after the geometry processing pipeline 100. Optionally, the second task information includes the storage location and storage format of the second shading result. The dual pipeline mode refers to a mode in which a first shader processing pipeline and a second shader processing pipeline are started. The first shader processing pipeline includes the first task generation pipeline 110 and the task execution unit 140, and the second shader processing pipeline includes the second task generation pipeline 130 and the task execution unit 140. The first shader processing pipeline is used to implement the function of the first shader, and the second shader processing pipeline is used to implement the function of the second shader.

[0041] In the present application, in dual-pipeline mode, the types of the first shader and the second shader are configurable. In one embodiment, in dual-pipeline mode, the first shader may be at least one shader in the geometry processing part of the VTG rendering pipeline, and the second shader may be at least one shader in the geometry processing part of the VTG rendering pipeline that is different from the first shader, that is, the first shader and the second shader include at least two of a vertex shader, a geometry shader, a shell shader, and a domain shader. Alternatively, in dual-pipeline mode, the first shader is an amplification shader in the geometry processing part of the mesh shading rendering pipeline, and the second shader is a mesh shader in the geometry processing part of the mesh shading rendering pipeline.

[0042] In one embodiment, the hardware units on the first task generation pipeline 110 and the hardware units on the second task generation pipeline 130 are different, that is, the two pipelines are completely independent. In another embodiment, the hardware units on the first task generation pipeline 110 and the hardware units on the second task generation pipeline 130 are partially the same, that is, the two processing pipelines have some shared hardware units.

[0043] In one embodiment, the first shading result or the second shading result output by the geometry processing pipeline enters the pixel processing pipeline. The pixel processing pipeline includes a rasterization stage, a pixel shader, and an output blending portion. Optionally, the pixel processing pipeline can be a pixel processing pipeline using tile rendering, a tile-based pixel processing pipeline with deferred rendering, etc. In other words, the geometry processing pipeline provided in this application is applicable to any type of pixel processing pipeline, that is, the geometry processing pipeline provided in this application has wide applicability.

[0044] To sum up, the present application provides a geometry processing pipeline that can mix and use the geometry processing parts in different rendering pipelines. The geometry processing pipeline provided by the present application can combine the geometry processing parts in different rendering pipelines and implement them as the same data stream. In single-pipeline mode or dual-pipeline mode, the relevant shader in the present application can be a shader in the VTG rendering pipeline or a shader in the mesh shading rendering pipeline. At this time, the present application does not set up two geometry processing pipelines for the VTG rendering pipeline and the mesh shading rendering pipeline respectively, but uses one geometry processing pipeline to support the geometry processing parts in the VTG rendering pipeline and the mesh shading rendering pipeline at the same time.

[0045] Moreover, in the dual-pipeline mode, the first shader task and the second shader task can be generated by the first task generation pipeline and the second task generation pipeline respectively. In this way, for a shader application that uses a mixture of the VTG rendering pipeline and the mesh shading rendering pipeline, there is no need to perform additional synchronization alignment operations. The hardware distribution can naturally align the first shader task generated by the first task generation pipeline in the VTG rendering pipeline and the mesh shading rendering pipeline, and the second shader task generated by the second task generation pipeline in the VTG rendering pipeline and the mesh shading rendering pipeline is aligned.

[0046] Figure 2 It shows that when the graphics processor uses various shader combinations, the first task generation pipeline and the second task generation pipeline are each responsible for generating shader tasks. Figure 2 It can be seen that when the graphics processor is set to use only vertex shaders, or vertex shaders plus geometry shaders, or mesh shaders, the single pipeline mode is started and all shader tasks are generated by the first task generation pipeline.

[0047] When the graphics processor is set to use vertex shaders, shell shaders and domain shaders, the dual pipeline mode is started, and the first task generates the pipeline to generate shader tasks for vertex shaders and shell shaders, and the second task generates the pipeline to generate shader tasks for domain shaders; when the graphics processor is set to use vertex shaders, shell shaders, domain shaders and geometry shaders, the dual pipeline mode is started, and the first task generates the pipeline to generate shader tasks for vertex shaders and shell shaders, and the second task generates the pipeline to generate shader tasks for domain shaders and geometry shaders; when the graphics processor is set to use magnification shaders and mesh shaders, the dual pipeline mode is started, and the first task generates the pipeline to generate shader tasks for magnification shaders, and the second task generates the pipeline to generate shader tasks for mesh shaders.

[0048] In actual processing by the graphics processor, the functions of the vertex shader and the domain shader are similar, and the functions of the shell shader and the geometry shader are similar, that is, Figure 2 In the shader allocation method shown, the shader tasks generated by the first task generation pipeline and the second task generation pipeline are similar. Therefore, the first task generation pipeline and the second task generation pipeline can be instantiated from the same pipeline. At this time, even if two task generation pipelines are used, the application does not need to spend more costs on pipeline development, and two task generation pipelines can be instantiated from the same task generation pipeline.

[0049] Figure 3A schematic diagram of a geometry processing pipeline provided by an exemplary embodiment of the present application is shown. The geometry processing pipeline 100 includes a first task generation pipeline 110, a task control unit 120, a second task generation pipeline 130, and a task execution unit 140. The first task generation pipeline 110 includes a first task generation unit 101, a first shader engine 102, and a shader task construction unit 103. The second task generation pipeline 130 includes a first blending unit 104, a second shader engine 105, and a shader task construction unit 103. In single-pipeline mode, the task execution unit 140 receives a first shader task generated by the first task generation pipeline 110, executes the first shader task, and obtains a first shading result. The task control unit 120 receives first task information corresponding to the first shader task, obtains a first shading result based on the first task information, and outputs the first shading result to the pipeline following the geometry processing pipeline.

[0050] In the dual-pipeline mode, the task execution unit 140 receives the first shader task generated by the first task generation pipeline 110, the task execution unit 140 executes the first shader task to obtain a first shading result, the task control unit 120 receives the first task information corresponding to the first shader task, the task control unit 120 obtains the first shading result based on the first task information, controls the first shading result to enter the second task generation pipeline 130, the second task generation pipeline 130 generates a second shader task and second task information corresponding to the second shader task based on the first shading result, the second task generation pipeline 130 sends the second shader task to the task execution unit 140, and sends the second task information to the task control unit 120, the task execution unit 140 executes the second shader task to obtain a second shading result, the task control unit 120 obtains the second shading result based on the second task information, and outputs the second shading result to the pipeline after the geometry processing pipeline.

[0051] Generate pipeline 110 for the first task

[0052] The first task generation unit 101, based on the received drawing instruction, splits the drawing instruction into multiple first task packets and sends the multiple first task packets to the first shader engine 102. The drawing instruction includes at least one of a Draw instruction and a Dispatchmesh instruction. The Draw instruction is a drawing instruction for the VTG rendering pipeline, and the Dispatchmesh instruction is a drawing instruction for the mesh shading rendering pipeline.

[0053] In one embodiment, a drawing instruction instructs drawing a first number of triangles, each of the plurality of first task packages includes at least one first task, and each first task instructs drawing one triangle. For example, the drawing instruction instructs drawing 100 triangles, which are divided into 50 first task packages, each of which includes two first tasks, and each of which instructs drawing one triangle.

[0054] The first shader engine 102 generates a first shader task corresponding to the first shader and sends the first shader task to the shader task construction unit 103. After receiving multiple first task packages, the first shader engine 102 assembles the multiple first task packages to generate the first shader task corresponding to the first shader. For example, the first task generation pipeline 110 is used to generate a shader task for a vertex shader, and the first shader engine 102 assembles the shader task for the vertex shader from the multiple first task packages. The first shader engine 102 is used to add first resource requirement information to the generated first shader task. The first resource requirement information is used to indicate the resources required to implement the first shader task, for example, the address of the result storage unit, the address of the temporary storage unit, the storage location of the first shading result, the storage format, etc.

[0055] The shader task construction unit 103 is configured to allocate resources to the first shader task generated by the first shader engine 102. For example, based on the first resource requirement information, the shader task construction unit 103 allocates address information of a temporary storage unit and address information of a result storage unit to the first shader task. The temporary storage unit is configured to temporarily store data read and written during the execution of the first shader task, and the result storage unit is configured to store the execution results of the first shader task. The shader task construction unit 103 transmits the first shader task after resource allocation to the task control unit 120.

[0056] The shader task construction unit 103 is further configured to generate first task information corresponding to the first shader task, where the first task information is information about resources allocated to the first shader task.

[0057] Generate pipeline 130 for the second task

[0058] The first blending unit 104 performs tessellation or derives a mesh shader thread group based on the first shading result generated by the task execution unit 140, obtains first output data, and sends the first output data to the second shader engine 105. If the first shading result is the shading result of a shell shader, the first blending unit 104 performs tessellation to obtain the first output data. The shading result of the shell shader includes tessellation parameters, and the first blending unit 104 performs tessellation based on the tessellation parameters. If the first shading result is the shading result of an amplification shader, and the shading result of the amplification shader includes a dispatchmesh parameter, the first blending unit 104 generates a mesh shader thread group based on the dispatchmesh parameter. The dispatchmesh parameter is used to indicate the number of mesh shader thread groups to be generated.

[0059] The second shader engine 105 generates a second shader task corresponding to the second shader and sends the second shader task to the shader task construction unit 103. After receiving the first output data, the second shader engine 105 generates a second shader task corresponding to the second shader. For example, the second task generation pipeline 130 is used to generate a domain shader task, and the second shader engine 105 generates the domain shader task based on the result of the surface tessellation; for example, the second task generation pipeline is used to generate a mesh shader task, and the second shader engine 105 generates the mesh shader task based on the mesh shader thread group. The second shader engine 105 is used to add second resource requirement information to the generated second shader task. The second resource requirement information is used to indicate the resources required to implement the second shader task, such as the address information of the result storage unit, the address information of the temporary storage unit, the storage location of the second shading result, the storage format of the second shading result, etc.

[0060] The shader task construction unit 103 is configured to allocate resources to the second shader task generated by the second shader engine 105. For example, based on the second resource requirement information, the shader task construction unit 103 allocates address information of a temporary storage unit and address information of a result storage unit to the second shader task. The temporary storage unit is configured to temporarily store data read and written during the execution of the second shader task, and the result storage unit is configured to store the execution results of the second shader task. The shader task construction unit 103 transmits the second shader task after resource allocation to the task execution unit 120.

[0061] The shader task construction unit 103 is further configured to generate second task information corresponding to the second shader task, where the second task information is information about resources allocated to the second shader task.

[0062] In the above embodiment, the first task generation pipeline 110 and the second task generation pipeline 130 have their own shader engines and a shared shader task construction unit. The sharing of the shader task construction unit can save hardware usage and reduce the hardware density on the graphics processor. Figure 2 In the shader task allocation method shown, the shader tasks to be generated by the first shader engine 102 and the second shader engine 105 are relatively similar. Therefore, the first shader engine 102 and the second shader engine 105 can be instantiated by the same hardware, which can save hardware development costs.

[0063] Figure 4 A schematic diagram of a geometry processing pipeline provided by another exemplary embodiment of the present application is shown. The geometry processing pipeline 100 includes a first shader processing pipeline, a task control unit 120, and a second shader processing pipeline. The first shader processing pipeline includes a first task generation pipeline 110, a task execution unit 140, a temporary storage unit 150, and a result storage unit 160. The first task generation pipeline 110 includes a first task generation unit 101, a first shader engine 102, and a shader task construction unit 103.

[0064] The second shader processing pipeline includes a second task generation pipeline 130 , a task execution unit 140 , a temporary storage unit 150 and a result storage unit 160 . The second task generation pipeline 130 includes a first blending unit 104 , a second shader engine 105 and a shader task construction unit 103 .

[0065] In single-pipeline mode, the task control unit 120 receives the first task information generated by the first shader processing pipeline. The task control unit 120 obtains the first shading result generated by the first shader processing pipeline based on the first task information and outputs the first shading result to the pipeline after the geometry processing pipeline. In dual-pipeline mode, the task control unit 120 receives the first task information generated by the first shader processing pipeline. The task control unit 120 obtains the first shading result generated by the first shader processing pipeline based on the first task information and controls the first shading result to enter the second shader processing pipeline. The second shader processing pipeline generates a second shader task and second task information based on the first shading result. The second shader processing pipeline runs the second shader task to generate a second shading result. The second shader processing pipeline transmits the second task information to the task control unit 120. The task control unit 120 obtains the second shading result based on the second task information and outputs the second shading result to the pipeline after the geometry processing pipeline.

[0066] For the first shader processing pipeline

[0067] The related introduction of the first task generation pipeline 110 and the task execution unit 140 can be found above and will not be repeated here.

[0068] When executing the first shader task, the task execution unit 140 obtains the required read and write data from the temporary storage unit 150. Optionally, the temporary storage unit 150 is an on-chip storage space of the graphics processor. Optionally, the temporary storage unit 150 is an off-chip storage space of the graphics processor.

[0069] The task execution unit 140 sends the execution result of the first shader task, i.e., the first shading result, to the result storage unit 160. Optionally, the result storage unit 160 is a vertex buffer. The task control unit 120 is connected to the result storage unit 160. When in dual-pipeline mode, the task control unit 120 retrieves the first shading result from the result storage unit 160 and sends the first shading result to the first blending unit 104. When in single-pipeline mode, the task control unit 120 retrieves the first shading result from the result storage unit 160 and sends the first shading result to the pipeline after the geometry processing pipeline 100.

[0070] For the second shader processing pipeline

[0071] The relevant introduction of the second task generation pipeline 130 and the task execution unit 140 can be found above and will not be repeated here.

[0072] When executing the second shader task, the task execution unit 140 retrieves the required read and write data from the temporary storage unit 150 and sends the execution result of the second shader task to the result storage unit 160. Optionally, the temporary storage unit 150 is on-chip memory space of the graphics processor. Optionally, the temporary storage unit 150 is off-chip memory space of the graphics processor. When in dual-pipeline mode, after the second shader task is executed, the task control unit 120 may send the execution result of the second shader task, i.e., the second shading result, to the pipeline after the geometry processing pipeline 100.

[0073] In an embodiment of the present application, the first shader processing pipeline and the second shader processing pipeline will share the result storage unit and the temporary storage unit. The sharing of the result storage unit and the temporary storage unit can save hardware usage and reduce the hardware density on the graphics processor.

[0074] In one embodiment, in single-pipeline mode, the first task generation pipeline also sends the first shader task to the task control unit. The task control unit receives the first shader task and controls the first shader task to be output to the pipeline after the geometry processing pipeline. The first shader task is used to indicate the pipeline after the geometry processing pipeline, the shader task corresponding to the first shading result; optionally, the task control unit synchronously sends the first shader task and the first shading result to the pipeline after the geometry processing pipeline.

[0075] Furthermore, in dual-pipeline mode, the first task generation pipeline also sends the first shader task to the task control unit. The task control unit receives the first shader task and controls the first shader task to enter the second task generation pipeline. The first shader task is used to instruct the second task generation pipeline to generate the shader task corresponding to the first shading result. Optionally, the task control unit synchronously sends the first shader task and the first shading result to the second task generation pipeline. It is understandable that, based on the first shader task, the second task generation pipeline knows the shader task corresponding to the received first shading result, the second task generation pipeline knows the type of shader task to be generated, and avoids conflicts between the generated second shader task and the first shader task.

[0076] The second task generation pipeline also sends the second shader task to the task control unit. The task control unit receives the second shader task and controls the second shader task to be output to the pipeline after the geometry processing pipeline. The second shader task is used to indicate the pipeline after the geometry processing pipeline, the shader task corresponding to the second shading result; optionally, the task control unit synchronously sends the second shader task and the second shading result to the pipeline after the geometry processing pipeline.

[0077] The task control unit will control the direction of the two shader tasks. The first shader task generated by the first task generation pipeline can be sent to the pipeline after the geometry processing pipeline, or it can be sent to the second task generation pipeline. The second shader task generated by the second task generation pipeline can only be sent to the pipeline after the geometry processing pipeline.

[0078] like Figure 5As shown, there are two FIFOs (First Input First Output) in the task control unit. The first FIFO 510 is used to store the first shader task, and the second FIFO 520 is used to store the second shader task. The first FIFO 510 is used to store the first shader task sent by the first task generation pipeline in single-pipeline mode and dual-pipeline mode; the second FIFO 520 is used to store the second shader task sent by the second task generation pipeline in dual-pipeline mode. In single-pipeline mode, the task control unit directly sends the first shader task in the first FIFO 510 to the pipeline after the geometry processing pipeline; in dual-pipeline mode, the task control unit sends the first shader task in the first FIFO 510 to the second task generation pipeline, and sends the second shader task in the second FIFO 520 to the pipeline after the geometry processing pipeline.

[0079] In the above embodiment, the task control unit will also route the first shader task and the second shader task. The geometry processing pipeline provided by this application can support both the geometry processing part of the VTG rendering pipeline and the geometry processing part of the mesh shading rendering pipeline. When supporting the geometry processing part of the VTG rendering pipeline, it may be necessary to implement the functions of up to four serial shaders (vertex shader, shell shader, domain shader and geometry shader) at the same time. At this time, the functions supported by the geometry processing pipeline are more complex. This application will route the shader tasks so that the next processing flow can know the specific task corresponding to the previous processing action. In complex processing scenarios, the stable and accurate operation of each part of the geometry processing pipeline can also be achieved.

[0080] In one embodiment, the user can set the shader used by the graphics processor in the shader application, such as using only the vertex shader, the vertex shader plus the geometry shader, etc. When the graphics processor switches from dual-pipeline mode to single-pipeline mode, a control flag will be inserted after the first shader task in the dual-pipeline mode, such as Figure 6 As shown, a first control mark 610 is inserted between the first shader task 1 and the first shader task 2. The first shader task 1 is the first shader task in the dual-pipeline mode, and the first shader task 2 is the first shader task in the single-pipeline mode.

[0081] When the task control unit detects the first control tag 610 after the first shader task 1 in the dual pipeline mode, it blocks the first shader task 2 after the first control tag 610. The first shader task 1 and the first control tag 610 will be sent to the second task generation pipeline, and the first control tag 610 will be transparently transmitted back to the task control unit in the second task generation pipeline and transformed into the second control tag 620, and the first shader task 1 will be transformed into the second shader task and enter the task control unit. Figure 6 As shown, when the task control unit detects the second control tag 620 after the second shader task, it unblocks the first shader task 2 after the first control tag 610 and outputs the first shader task 2 after the first control tag 610 to the pipeline after the geometry processing pipeline.

[0082] Optional, combined with reference Figure 3 The first control tag after the first shader task 1 is inserted by the first task generation unit 101, the first control tag 610 will be transparently transmitted in the first shader engine 102 and the shader task construction unit 103, and the first control tag 610 will enter the task control unit 120.

[0083] In the above embodiment, when the dual-pipeline mode is switched to the single-pipeline mode, when the task control unit detects the first control mark, it will first block the first shader task 2 in the single-pipeline mode. When the second shader task in the dual-pipeline mode returns to the task control unit, the first shader task 2 in the single-pipeline mode will be routed. At this time, all shader tasks in the dual-pipeline mode have been correctly routed, and then the shader tasks in the single-pipeline mode are routed. That is, the alignment and synchronization of the dual-pipeline mode and the single-pipeline mode can be achieved through the control mark, and the task control unit will not route the shader tasks of the dual-pipeline mode and the single-pipeline mode at the same time. At this time, the correctness of the rendering results can be guaranteed.

[0084] In one embodiment, when the GPU switches from single-pipeline mode to dual-pipeline mode, the task control unit only needs to continue routing shader tasks in order without additional synchronization operations. Figure 7 As shown, the first shader task 1 is the first shader task in the single-pipeline mode, and the first shader task 2 is the first shader task in the dual-pipeline mode. The task control unit sends the first shader task 1 to the pipeline after the geometry processing pipeline. After that, the task control unit sends the first shader task 2 to the second task generation pipeline. The second task generation pipeline will generate a second shader task based on the first shader task 2. The second task generation pipeline sends the second shader task to the task control unit, and the task control unit sends the second shader task to the pipeline after the geometry processing pipeline.

[0085] At this time, when switching from single-pipeline mode to dual-pipeline mode, the task control unit does not need to do additional waiting and synchronization, and only needs to route the first shader task and the second shader task in sequence. At this time, the hardware naturally ensures that the routing operations in single-pipeline mode and dual-pipeline mode are separate. The routing operation in dual-pipeline mode is executed only after the routing operation in single-pipeline mode is completed. At this time, it is guaranteed that the shader tasks sent to the pipeline after the geometry processing pipeline meet user expectations.

[0086] Figure 8 FIG. 8 is a block diagram of an electronic device 800 according to an exemplary embodiment of the present application. Optionally, the electronic device 800 includes a graphics processor according to an embodiment of the present application.

[0087] Alternatively, the electronic device may be a portable mobile terminal, such as a smartphone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, or a desktop computer. The electronic device 800 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal, or other similar names. Generally, the electronic device 800 includes a processor 801 and a memory 802.

[0088] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0089] The memory 802 may include one or more computer-readable storage media, which may be non-transitory, and may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.

[0090] In some embodiments, the electronic device 800 may further include: a peripheral device interface 803 and at least one peripheral device. Figure 8 The structure shown in the figure does not constitute a limitation on the electronic device 800, and the electronic device 800 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0091] The present application also provides a chip, which includes the graphics processor described in the above embodiment.

[0092] The present application also provides a graphics card, which includes a graphics processor as described in the above embodiment.

[0093] The present application also provides a server, which includes a graphics processor as described in the above embodiment.

[0094] Figure 9A schematic diagram of the structure of a server provided by an exemplary embodiment of the present application is shown. The server 900 includes multiple graphics processors 901. At least one of the multiple graphics processors 901 includes the graphics processor introduced in the above embodiment of the present application.

[0095] The present application also provides a computing cluster, which includes multiple servers, at least one of which includes a graphics processor as described in the above embodiment.

Claims

1. A graphics processor, characterized in that: The graphics processor includes a geometry processing pipeline, the geometry processing pipeline including a first task generation pipeline, a task control unit, a second task generation pipeline, and a task execution unit, the first task generation pipeline being configured to generate a first shader task corresponding to a first shader and first task information of the first shader task, the second task generation pipeline being configured to generate a second shader task corresponding to a second shader and second task information of the second shader task; The task execution unit is configured to receive and execute the first shader task in a single-pipeline mode to obtain a first shading result; and receiving and executing the first shader task and the second shader task in a dual-pipeline mode to obtain the first shading result and the second shading result, respectively; The task control unit is configured to obtain the first shading result based on the received first task information in the single-pipeline mode, and output the first shading result to a pipeline subsequent to the geometry processing pipeline; and, in the dual-pipeline mode, obtaining the first shading result based on the received first task information, and controlling the first shading result to enter the second task generation pipeline; And, based on the received second task information, obtaining the second shading result, and outputting the second shading result to a pipeline following the geometry processing pipeline.

2. The graphics processor according to claim 1, wherein: The first task generation pipeline includes a first shader engine, the second task generation pipeline includes a second shader engine, and the first shader engine and the second shader engine are hardware units independent of each other; The first shader engine is configured to generate the first shader task in the single-pipeline mode or the dual-pipeline mode; The second shader engine is configured to generate the second shader task in the dual-pipeline mode.

3. The graphics processor according to claim 2, wherein: The first task generation pipeline further includes a first task generation unit; The first task generating unit is configured to split the received drawing instruction into a plurality of first task packets in the single-pipeline mode or the dual-pipeline mode, and send the plurality of first task packets to the first shader engine.

4. The graphics processor according to claim 2, wherein: The second task generation pipeline further includes a first mixing unit; The first mixing unit is used to perform surface subdivision or derive a mesh shader thread group operation based on the first shading result in the dual-pipeline mode, obtain first output data, and send the first output data to the second shader engine.

5. The graphics processor according to claim 2, wherein: The first task generation pipeline and the second task generation pipeline share a shader task construction unit; The shader task construction unit is configured to allocate resources to the first shader task in the single-pipeline mode, and send the resource-allocated first shader task to the task control unit; In the dual-pipeline mode, resources are allocated to the first shader task, and the first shader task after resource allocation is sent to the task control unit; and resources are allocated to the second shader task, and the second shader task after resource allocation is sent to the task control unit.

6. The graphics processor according to any one of claims 1 to 5, characterized in that: The geometry processing pipeline further includes a result storage unit; The result storage unit is used to store the execution result of the first shader task in the single-pipeline mode; and to store the execution result of the first shader task and the execution result of the second shader task in the dual-pipeline mode.

7. The graphics processor according to any one of claims 1 to 5, characterized in that: The geometry processing pipeline further includes a temporary storage unit; The temporary storage unit is used to temporarily store data read and written when executing the first shader task in the single pipeline mode; and temporarily store data read and written when executing the first shader task and data read and written when executing the second shader task in the dual pipeline mode.

8. The graphics processor according to any one of claims 1 to 5, characterized in that: In any of the following situations, the single pipeline mode is started; The graphics processor is configured to use a vertex shader; The graphics processor is configured to use the vertex shader and geometry shader; The graphics processor is configured to use a mesh shader.

9. The graphics processor according to any one of claims 1 to 5, characterized in that: In any of the following situations, the dual pipeline mode is started; The graphics processor is configured to use a vertex shader, a shell shader, and a domain shader; The graphics processor is configured to use the vertex shader, the shell shader, the domain shader, and the geometry shader; The graphics processor is configured to use an amplification shader and a mesh shader.

10. The graphics processor according to claim 9, wherein: In a case where the graphics processor is configured to use the vertex shader, the hull shader, and the domain shader, the first shader includes the vertex shader and the hull shader, and the second shader includes the domain shader.

11. The graphics processor according to claim 9, wherein: In a case where the graphics processor is configured to use the vertex shader, the hull shader, the domain shader, and the geometry shader, the first shader includes the vertex shader and the hull shader, and the second shader includes the domain shader and the geometry shader.

12. The graphics processor according to claim 9, wherein: In a case where the graphics processor is configured to use the magnification shader and the mesh shader, the first shader includes the magnification shader, and the second shader includes the mesh shader.

13. The graphics processor according to any one of claims 1 to 5, characterized in that: The task control unit includes a first first-in first-out queue and a second first-in first-out queue; The first first-in-first-out queue is used to store the first shader task sent by the first task generation pipeline in the single-pipeline mode and the dual-pipeline mode; The second first-in-first-out queue is used to store the second shader task sent by the second task generation pipeline in the dual-pipeline mode.

14. The graphics processor according to any one of claims 1 to 5, characterized in that: The task control unit is further configured to receive the first shader task in the single-pipeline mode, and control the first shader task to be output to a pipeline subsequent to the geometry processing pipeline.

15. The graphics processor according to any one of claims 1 to 5, characterized in that: The task control unit is also used to receive the first shader task in the dual-pipeline mode, control the first shader task to enter the second task generation pipeline, the first shader task is used to instruct the second task generation pipeline, and the shader task corresponding to the first shading result; receive the second shader task, and control the second shader task to output to the pipeline after the geometry processing pipeline.

16. The graphics processor according to any one of claims 1 to 5, characterized in that: The task control unit is further configured to, when the dual-pipeline mode is switched to the single-pipeline mode, block a first shader task following the first control flag when a first control flag is detected, wherein the first shader task following the first control flag is the first shader task in the single-pipeline mode, and the first shader task before the first control flag is the first shader task in the dual-pipeline mode; When a second control flag is detected, a first shader task following the first control flag is unblocked and output to a pipeline following the geometry processing pipeline, wherein the second control flag is located after a second shader task.

17. A graphics drawing method, characterized in that: The method is applied to a graphics processor, the graphics processor including a geometry processing pipeline, the geometry processing pipeline including a first task generation pipeline, a task control unit, a second task generation pipeline, and a task execution unit; the method includes: The first task generation pipeline generates a first shader task corresponding to a first shader and first task information of the first shader task; The first task generation pipeline sends the first shader task to the task execution unit, and sends the first task information to the task control unit; the task execution unit executes the first shader task to obtain a first shading result; In the single-pipeline mode, the task control unit obtains the first shading result based on the first task information, and outputs the first shading result to a pipeline subsequent to the geometry processing pipeline; In the dual-pipeline mode, the task control unit obtains the first shading result based on the first task information, and outputs the first shading result to the second task generation pipeline. The second task generation pipeline generates a second shader task corresponding to the second shader and second task information of the second shader task based on the first shading result. The second task generation pipeline sends the second shader task to the task execution unit, and sends the second task information to the task control unit. The task execution unit executes the second shader task to obtain a second shading result. The task control unit obtains the second shading result based on the second task information, and outputs the second shading result to the pipeline after the geometry processing pipeline.

18. A chip, characterized in that: The chip includes the graphics processor according to any one of claims 1 to 16.

19. A server, characterized in that: The server includes the graphics processor according to any one of claims 1 to 16.

20. An electronic device, characterized in that: The electronic device comprises the graphics processor according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Geometric processing device, graphics processor and electronic equipment

    CN117557444A

  • Apparatus and method for a programmable depth stencil graphics pipeline stage

    US20190066356A1