Graphics processor, system, device, equipment and method
By processing texture space shading and pixel space shading in parallel in the graphics processor, memory overhead is reduced, and performance reduction caused by the sampling feedback of texture space shading objects under the tile rendering architecture is solved, which improves processing performance.
Patent Information
- Application Number
- CN202210414557.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-20
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-04-20
AI Technical Summary
Under the tile-based rendering architecture, the sampling feedback function of texture space shading objects leads to additional memory interaction delay and bandwidth, resulting in reduced performance, especially when there are more texture space shading objects in the image frame.
By introducing rasterization processing module, geometry processing module and tile division module into the graphics processor, rasterization processing of the primitives is performed tiles one by one, reading the primitive information and determining the texture coordinates of the sample feedback pixels, reducing the texture space Separate splitting and geometric coordinate transformation of shading objects realize parallel processing of texture space shading and pixel space shading.
It reduces the memory overhead brought by multiple drawing pipelines, improves processing performance, avoids the separate splitting and geometric coordinate transformation of texture space shading objects, and improves the efficiency of sampling feedback function.
Smart Images

Figure CN116958375B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image rendering technology, and in particular to a GPU (Graphics Processing Unit), a system, an electronic device, an electronic device, and a graphics processing method. Background Art
[0002] Sampling feedback is a new feature of DirectX 12 Ultimate. The sampling feedback feature can record the texture coordinates required for texture sampling into the sampler feedback map when the object is rendered. Sampling feedback can optimize the efficiency of texture space shading. For example, you can skip the invisible areas on the screen of objects that need texture space shading (texture space shading objects), thereby improving the utilization of video memory.
[0003] One possible approach to implementing sampling feedback in an existing tile-based rendering architecture is as follows:
[0004] The objects to be shaded in texture space are separated from other objects in an image frame. A separate rendering instruction is submitted for the texture space shaded object to realize the conversion from 3D coordinates to texture coordinates, and sampling feedback is performed for texture space shader; then a rendering instruction is submitted for all objects displayed in the image frame for display output.
[0005] The above solution requires executing a separate 3D rendering pipeline for each texture space shading object, which brings additional memory interaction delay and bandwidth. When there are many texture space shading objects in an image frame, the performance degradation is more obvious under the tile-based rendering architecture. Summary of the invention
[0006] The purpose of the present disclosure is to provide a graphics processor, a graphics processing system, an electronic device, an electronic device and a graphics processing method, so as to achieve performance optimization when a graphics processor using a tile-based rendering architecture implements a sampling feedback function.
[0007] According to one aspect of the present disclosure, a graphics processor is provided, which adopts a tile-based rendering architecture, and the graphics processor at least includes:
[0008] The rasterization processing module is configured to: perform rasterization processing on primitives one by one, the primitives comprising first primitives and second primitives, the first primitives comprising primitives identified as belonging to texture space shading objects, and the second primitives comprising primitives identified as belonging to pixel space shading objects;
[0009] The rasterization processing of the first primitive includes: reading primitive information of the first primitive, determining texture coordinates corresponding to sampling feedback pixels covered by the first primitive, outputting the texture coordinates to the sampling feedback map, and performing at least one pixel test on the first primitive according to the primitive information of the first primitive;
[0010] The rasterization processing of the second primitive includes: reading primitive information of the second primitive, and performing at least one pixel test on the second primitive according to the primitive information of the second primitive.
[0011] In the present disclosure, reading the primitive information of the first primitive is performed after determining the texture coordinates corresponding to the sampled feedback pixels covered by the first primitive.
[0012] Optionally, the rasterization processing module is further configured to:
[0013] First primitive identification information is read from the tile buffer, and a primitive indicated by the first primitive identification information is identified as a first primitive, and a non-first primitive is identified as a second primitive.
[0014] Optionally, the first primitive identification information includes a primitive index pointing to a first storage space, the first storage space is used to store primitive information of the first primitive, and the primitive information of the second primitive is stored in a second storage space.
[0015] Based on any of the above graphics processor embodiments, the graphics processor further includes a geometry processing module and a tile partitioning module.
[0016] The geometry processing module is configured to: perform geometry processing on objects in the image frame according to the drawing instruction, wherein the objects in the image frame include texture space shading objects and pixel space shading objects;
[0017] The block division module is configured to: perform block division processing on the object in the image frame, and save the block division processing result to the block buffer, wherein the block division processing result includes the primitive index of the primitive covering the block;
[0018] The block division module is further configured to: save the first primitive identification information to the block buffer, where the first primitive identification information is determined according to the first primitive identification information indicated by the drawing instruction.
[0019] Based on any of the above graphics processor embodiments, the pixel processing module is further configured to: identify the screen visible pixels and corresponding texture coordinates covered by the first primitive according to the pixel test result of the first primitive, and save the mapping relationship between the screen visible pixels and texture coordinates.
[0020] Furthermore, the graphics processor may also include a pixel processing module configured to: perform pixel processing on the texture space shading object to which the first primitive belongs according to the sampling feedback map.
[0021] According to another aspect of the present disclosure, a graphics processing system is provided. The graphics processing system includes the graphics processor described in any one of the above embodiments.
[0022] According to another aspect of the present disclosure, an electronic device is provided, comprising the graphics processing system described in the above embodiment.
[0023] According to another aspect of the present disclosure, an electronic device is provided, comprising the electronic device described in the above embodiment.
[0024] According to another aspect of the present disclosure, a graphics processing method is provided, which adopts a tile-based rendering architecture, and the method comprises at least the following steps:
[0025] rasterizing the primitives tile by tile, the primitives comprising first primitives and second primitives, the first primitives comprising primitives identified as belonging to texture space shaded objects, and the second primitives comprising primitives identified as belonging to pixel space shaded objects;
[0026] The rasterization processing of the first primitive includes: reading primitive information of the first primitive, determining texture coordinates corresponding to sampling feedback pixels covered by the first primitive, outputting the texture coordinates to the sampling feedback map, and performing at least one pixel test on the first primitive according to the primitive information of the first primitive;
[0027] The rasterization processing of the second primitive includes: reading primitive information of the second primitive, and performing at least one pixel test on the second primitive according to the primitive information of the second primitive.
[0028] Optionally, the method provided by the embodiment of the present disclosure further includes:
[0029] The first primitive identification information is read from the tile buffer, the primitive indicated by the first primitive identification information is identified as the first primitive, and the non-first primitive is identified as the second primitive.
[0030] Furthermore, the first primitive identification information may include a primitive index pointing to a first storage space, the first storage space is used to store primitive information of the first primitive, and the primitive information of the second primitive is stored in a second storage space.
[0031] Based on any of the above method embodiments, the above method may further include:
[0032] In response to the drawing instruction, geometric processing is performed on objects in the image frame, where the objects in the image frame include texture space shading objects and pixel space shading objects;
[0033] Performing a block division process on the object in the image frame, and saving the block division process result to a block buffer, wherein the block division process result includes a primitive index of a primitive covering the block;
[0034] The first primitive identification information is saved in the tile buffer, where the first primitive identification information is determined according to the first primitive identification information indicated by the drawing instruction.
[0035] Based on any of the above method embodiments, the method provided by the embodiment of the present disclosure may further include:
[0036] The screen visible pixels covered by the first picture element and the corresponding texture coordinates are identified according to the pixel test result of the first picture element, and the mapping relationship between the screen visible pixels and the texture coordinates is saved.
[0037] Furthermore, the above method may also include:
[0038] Pixel processing is performed on the texture space shaded object to which the first primitive belongs according to the sampled feedback map. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of the structure of a graphics processing system according to an embodiment of the present disclosure;
[0040] Figure 2A A schematic diagram of the visibility of a texture space colored object in an object space according to an embodiment of the present disclosure;
[0041] Figure 2B A sampling feedback map of a texture space shading object according to an embodiment of the present disclosure;
[0042] Figure 2C A schematic diagram of screen visible pixels of a texture space colored object according to an embodiment of the present disclosure;
[0043] Figure 3 A flowchart of a graphics processing method according to an embodiment of the present disclosure is provided;
[0044] Figure 4 The figure is a flowchart of a graphics processing method according to another embodiment of the present invention. DETAILED DESCRIPTION
[0045] Before introducing the embodiments of the present disclosure, it should be noted that:
[0046] Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be given sequential step numbers, the operation steps therein may be implemented in parallel, concurrently or simultaneously.
[0047] In the embodiments of the present disclosure, the terms "first", "second", etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used only to distinguish one feature from another.
[0048] The term “and / or” may be used in embodiments of the present disclosure. “And / or” includes any and all combinations of one or more of the associated features listed.
[0049] It should be understood that when describing the connection or communication relationship between two components, unless it is explicitly stated that the two components are directly connected or directly communicating, the connection or communication between the two components can be understood as direct connection or communication, or as indirect connection or communication through an intermediate component.
[0050] In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the exemplary embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0051] The purpose of the present disclosure is to provide a GPU using a tile-based rendering architecture, which performs both sampling feedback of texture space shading objects and shading of pixel space shading objects during the rendering process of an image frame, and does not require separate splitting of texture space shading objects and separate geometric coordinate transformation processes, thereby reducing the memory overhead caused by multiple drawing pipelines, thereby improving processing performance. Among them, GPU refers to a processor with computing functions implemented by hardware, which includes components such as a computing unit, a cache, etc., and can be a GPGPU (general-purpose graphics processing unit) or a GPU.
[0052] The graphics processor provided in the embodiments of the present disclosure is applicable to any tile-based rendering architecture, for example, TBR (Tile Based Rendering), TBDR (Tile Based Deferred Rendering), etc.
[0053] An embodiment of the present disclosure provides a graphics processor, which adopts a tile-based rendering architecture and includes at least a geometry processing module, a tile partitioning module, a rasterization processing module, and a pixel processing module.
[0054] The geometry processing module is configured to: perform geometry processing on objects in the image frame according to the drawing instruction, wherein the objects in the image frame include texture space shading objects and pixel space shading objects;
[0055] The tile division module is configured to: perform tile division processing on the object in the image frame, and save the tile division processing result to a tile buffer (tile buffer), wherein the tile division processing result includes a primitive index of a primitive covering the tile;
[0056] The rasterization processing module is configured to: perform rasterization processing on primitives tile by tile, the primitives comprising first primitives and second primitives, the first primitives comprising primitives identified as belonging to texture space shading objects, and the second primitives comprising primitives identified as belonging to pixel space shading objects;
[0057] The rasterization processing of the first primitive includes: reading primitive information of the first primitive, determining texture coordinates corresponding to sampling feedback pixels covered by the first primitive, outputting the texture coordinates to the sampling feedback map, and performing at least one pixel test on the first primitive according to the primitive information of the first primitive;
[0058] The pixel processing for the second picture element includes: reading picture element information of the second picture element, and performing at least one pixel test on the second picture element according to the picture element information of the second picture element;
[0059] The pixel processing module is configured to perform pixel processing on the primitives one tile at a time.
[0060] In the present disclosure, a texture space shading object refers to an object processed using texture space shading technology, which remains relatively unchanged in multiple image frames and does not require complex pixel calculations in subsequent image frames. It only needs to be mapped according to the previous shading results.
[0061] In the present disclosure, pixel space rendering objects refer to objects other than texture space rendering objects in an image frame.
[0062] In the present disclosure, the sampled feedback pixel refers to the pixel of the visible part of the texture space shading object in the screen space. It should be noted that after reading the primitive information of the first primitive, the process of determining the texture coordinates corresponding to the above-mentioned sampled texture pixels and outputting them to the sampled feedback map and the process of performing at least one pixel test on the first primitive according to the primitive information of the first primitive can be executed in parallel. That is, in the present disclosure, when determining the sampled feedback pixel, it is not dependent on the pixel test results to identify which pixels of the texture space shading object belong to the visible pixels in the screen space. In the present disclosure, by way of example and not limitation, the visible part of the texture space shading object in the screen space can be indicated by software, and then the sampled feedback pixel can be determined.
[0063] In the present disclosure, texture coordinates may be but are not limited to u,v coordinates.
[0064] In the present disclosure, the sampling feedback graph may be stored in the system memory. In one embodiment, a storage space for storing the sampling feedback graph is allocated in the system memory.
[0065] In the present disclosure, the geometry processing module is implemented by hardware, and based on different rendering architectures, the functions implemented by the geometry processing module are different, and the geometry processing module can be composed of a single hardware module or multiple hardware modules.
[0066] In the present disclosure, the tile partitioning module is implemented by hardware.
[0067] In the present disclosure, the rasterization module is implemented by hardware, and based on different rendering architectures, the functions implemented by the rasterization processing module are different. The rasterization processing module can be composed of a single hardware module or multiple hardware modules, but no matter which rendering architecture is adopted, the rasterization processing module can determine the texture coordinates corresponding to the sampled feedback pixels covered by the first primitive before the pixel test, and output the texture coordinates to the sampled feedback map.
[0068] In the present disclosure, the pixel processing module is implemented by hardware, and based on different rendering architectures, the functions implemented by the pixel processing module are different. The pixel processing module can be composed of a single hardware module or multiple hardware modules.
[0069] By way of example and not limitation, in one embodiment, the geometry processing module includes a vertex shader and a geometry shader. The vertex shader obtains the geometry information of each object in the image frame and transmits the geometry information of these objects to the geometry shader. The geometry shader uses the geometry information of each object to convert the three-dimensional coordinates of each object into the unfolded texture coordinates (u, v), and the geometry information of the object includes the three-dimensional coordinates of the object.
[0070] As mentioned above, in actual applications, the functions of the above-mentioned vertex shader and geometry shader can also be implemented by a single hardware module.
[0071] Furthermore, the software marks the texture space colored objects in the image frame, and the disclosure does not limit the marking method. As an example but not limitation, the first primitive identification information can be indicated in the drawing instruction, and the first primitive can also be marked by other instructions.
[0072] In one embodiment, the tile partitioning module may be further configured to: save the first primitive identification information to the tile buffer.
[0073] The first graphic element identification information is used to identify the first graphic element. The embodiment of the present disclosure does not limit the specific form of the first graphic element identification information.
[0074] As an example but not a limitation, in one embodiment, in the tile buffer, each primitive index corresponds to a flag bit, and the flag bit takes a first specified value (for example, a value of 1), which indicates that the primitive corresponding to the primitive index is the first primitive, and accordingly, the flag bit taking the first specified value is the first primitive identification information. Correspondingly, the flag bit takes a second specified value (for example, a value of 0), which indicates that the primitive corresponding to the primitive index is the second primitive. The pixel processing module can identify the first primitive and the second primitive according to the value of the flag bit.
[0075] Correspondingly, the first graphic element identification information is determined according to the first graphic element identification information indicated by the drawing instruction.
[0076] As an example but not limitation, in another embodiment, different storage spaces are pre-allocated for the primitive information of the first primitive and the second primitive, wherein the primitive information of the first primitive is stored in the first storage space, and the primitive information of the second primitive is stored in the second storage space. In this case, the software does not need to additionally mark the first primitive and the second primitive, and accordingly, the first primitive identification information includes a primitive index. If the primitive index points to the first storage space, then the corresponding primitive is the first primitive, and if the primitive index points to the second storage space, then the corresponding primitive is the second primitive.
[0077] Regardless of the specific expression method of the first primitive identification information, if the first primitive identification information is stored in the tile buffer, the rasterization processing module can also be configured to: read the first primitive identification information from the tile buffer to identify the first primitive and the second primitive.
[0078] In another embodiment, the tile division module may be further configured to: save the first primitive identification information to the primitive information. As an example but not limitation, the reserved field in the primitive information is used to identify the first primitive, and the reserved field whose value is used to identify the first primitive is the first primitive identification information.
[0079] Correspondingly, the rasterization processing module reads the primitive index from the tile buffer, obtains the primitive information based on the primitive index, and obtains the first primitive identification information from the primitive information.
[0080] Based on any of the above graphics processor embodiments, the rasterization processing module can also be configured to: identify the screen visible pixels and corresponding texture coordinates covered by the first primitive according to the pixel test result of the first primitive, and save the mapping relationship between the screen visible pixels and texture coordinates.
[0081] Furthermore, the pixel processing module may specifically configure the pixel processing of the texture space shading object as follows: performing pixel processing (including shading processing) on the texture space shading object to which the first primitive belongs according to the sampling feedback map, and obtaining and outputting a texture map of the texture space shading object.
[0082] By way of example and not limitation, in one embodiment, the rasterization processing module includes a pixel coverage test submodule and a pixel interpolation calculation submodule. The pixel coverage test submodule identifies the screen visible pixels covered by the first primitive according to the pixel test result of the first primitive, and fills the pixel coordinates of the screen visible pixels into the mapping relationship data structure; the pixel interpolation calculation submodule determines the texture coordinates corresponding to the screen visible pixel coordinates through interpolation calculation and fills them into the mapping relationship data structure.
[0083] It should be noted that the above-mentioned functions of pixel coverage test and pixel interpolation calculation can also be implemented by less or more hardware, and the present disclosure does not limit this.
[0084] In the present disclosure, the mapping relationship data structure stores the screen visible pixel coordinates and texture coordinates with mapping relationship. The present disclosure does not limit the specific data structure form of the mapping relationship data structure. As an example, the data structure form of the mapping table can be used.
[0085] Furthermore, the mapping relationship between the visible pixels on the screen and the texture coordinates can be stored in the system memory. In one embodiment, a storage space for storing the mapping relationship is allocated in the system memory, and after the mapping relationship is determined, the mapping relationship is output to the storage space of the mapping relationship.
[0086] As described above, the purpose of texture space shading is to separately shade relatively unchanged objects in multiple frames, so that each frame only performs mapping when displaying the object. Therefore, after texture space shading is performed on the texture space shading object, the pixel color of the texture space shading object can be determined by the drawing display module according to the above implementation method in the subsequent multiple frames.
[0087] The embodiment of the present disclosure further provides a graphics processing system, which includes the graphics processor described in any of the above embodiments.
[0088] In the embodiment of the present disclosure, the product form of the graphics processing system may be a SOC (System on Chip) chip.
[0089] The graphics processor system in the embodiment of the present disclosure may be a single-die (chip) SOC chip or a multi-die interconnected SOC chip.
[0090] The following uses a die as an example to illustrate the architecture and working principle of the graphics processing system provided by the present disclosure.
[0091] exist Figure 1 In one embodiment shown, a single-die graphics processing system includes a GPU core, which is the graphics processor mentioned above.
[0092] The GPU core is used to process drawing instructions, and according to the drawing instructions, execute the image rendering pipeline, and can also be used to execute other operation instructions. The GPU core further includes: a computing unit, which is used to execute instructions compiled by the shader, and is a programmable module composed of a large number of ALUs; a cache, which is used to cache GPU core data to reduce memory access; a rasterization module, a fixed stage of the 3D rendering pipeline; a tile division (Tilling) module, which performs slicing processing on a frame in the TBR and TBDR GPU architectures; a cropping module, a fixed stage of the 3D rendering pipeline, which crops out the primitives outside the observation range or that are not displayed on the back; a post-processing module, which is used to scale, crop, rotate, and other operations on the drawn image; a micro core, which is used for scheduling between various pipeline hardware modules on the GPU core, or for task scheduling of multiple GPU cores.
[0093] The GPU core is connected to the on-chip network, which is used for data exchange between masters and slaves on the graphics processing system. In this embodiment, the on-chip network includes a configuration bus, a data communication network, a communication bus, and the like.
[0094] like Figure 1 As shown, the graphics processing system may also include:
[0095] General DMA (Direct Memory Access) is used to perform data transfer between the host and the graphics processing system memory (such as the graphics card memory). For example, DMA is used to move the vertex data of 3D drawings from the host to the graphics processing system memory.
[0096] PCIe controller, an interface for communicating with the host, implements the PCIe protocol, and enables the graphics processing system to be connected to the host through the PCIe interface. The host runs programs such as the graphics API and graphics card driver;
[0097] The application processor is used to schedule tasks of various modules on the graphics processing system. For example, after the GPU renders a frame of image, it notifies the application processor, and the application processor then starts the display controller to display the image drawn by the GPU on the screen.
[0098] Memory controller, used to connect memory devices and save data on SOC;
[0099] Display controller, which controls the output of the frame buffer in the memory to the display via the display interface (HDMI, DP, etc.);
[0100] Video decoding, which can decode the encoded video on the host hard disk into a displayable picture;
[0101] Video encoding can encode the original video code stream on the host hard disk into a specified format and return it to the host.
[0102] based on Figure 1 The graphics processing system architecture shown in FIG. 1 is a schematic diagram of a graphics processing system. In one embodiment, the graphics rendering process is as follows:
[0103] The graphics API of the host (in actual applications, for the graphics processing system of the mobile terminal, it can also be the software on the application processor) sends a drawing instruction to the SOC chip, requesting the rendering of the image frame, and the texture space shading object is marked in the drawing instruction.
[0104] The image frame includes both texture space colored objects and pixel space colored objects. In this embodiment, if a texture space colored object has been texture space colored in a previous image frame, then it is not necessary to color the texture space colored object in the current image frame, but mapping is performed according to the texture map that has been obtained. Therefore, the texture space colored object will not be marked as a texture space object in the current image frame.
[0105] The general DMA moves the vertex data of each object in the image frame (the vertex data includes the 3D coordinates of the object's vertices) from the host to the graphics processing system memory.
[0106] After obtaining the above drawing instruction, the computing unit of the GPU core decodes the drawing instruction.
[0107] The vertex shader of the GPU core (whose function is implemented by the computing unit) obtains the vertex data of each object in the image frame from the system memory, and transmits the vertex data of the object to the geometry shader (whose function is implemented by the computing unit). The geometry shader converts the 3D coordinates of the object's vertices into unfolded texture coordinates (i.e. (u, v) coordinates).
[0108] Optionally, the computing unit can identify objects based on software tags. For objects identified as pixel-space shaded objects, it searches the system memory to see whether there is a corresponding texture map. If so, it means that the object is actually a texture-space shaded object, and the geometry shader is not scheduled to perform coordinate mapping on it, thereby reducing hardware overhead.
[0109] After the geometric processing is completed, the tile division module in the GPU core performs tile division processing on the objects in the image frame and saves the tile division processing results to the tile buffer. The tile division processing results include the primitive index of the primitive covering the tile. In addition, the tile division module identifies the primitive of the texture space shading object according to the texture space shading object marked by the software. For the primitive identified as covered by the texture space shading object, the flag bit corresponding to its primitive index is set to 1, and for the primitive identified as covered by the pixel space shading object, the flag bit corresponding to its primitive index is set to 0.
[0110] It should be noted that, in this embodiment, if the texture space shading object has been texture space shaded in the previous image frame, then there is no need to perform sampling feedback on it in the current image frame, and therefore the primitive covered by it will not be identified as the first primitive.
[0111] After the tile division is completed, the rasterization module performs rasterization processing. The rasterization module processes each tile one by one, and reads the primitive index and the corresponding flag value of the primitive covering the current tile from the tile buffer each time; if the flag value corresponding to a primitive index is 1, it means that the primitive corresponding to the primitive index is the first primitive. The rasterization module reads the primitive information of the primitive through the primitive index, and uses the primitive information of the primitive to perform pixel coverage test to determine the pixels covered by the primitive, and then determines the texture coordinates corresponding to the pixels covered by the primitive through interpolation calculation, and saves the texture coordinates corresponding to the screen visible pixels covered by the primitive into the sampling feedback map. Then at least one pixel test is performed to determine the visibility of the pixel (as an example and not limitation, the pixel test may include a depth test, a template test, etc.); if the flag bit corresponding to a primitive index has a value of 0, it means that the primitive corresponding to the primitive index is the second primitive, and the rasterization module reads the primitive information of the primitive through the primitive index, and uses the primitive information of the primitive to perform a pixel coverage test to determine the pixels covered by the primitive, and then at least one pixel test is performed to determine the visibility of the pixel (as an example and not limitation, the pixel test may include a depth test, a template test, etc.).
[0112] by Figure 2A As an example, assume that the software indicates that the visible parts of the cube in screen space are the front, top, and right sides. Figure 2B As shown, the texture coordinates in the sampling feedback map corresponding to the cube are the texture coordinates corresponding to the pixels covered by the primitives on the front, top and right sides of the cube.
[0113] In the present disclosure, existing technologies are used to implement pixel coverage testing, pixel interpolation calculation and pixel testing.
[0114] Visibility information of pixels can be determined by pixel testing. Therefore, the rasterization module identifies the screen visible pixels among the pixels covered by the first primitive according to the pixel processing result, and saves the pixel coordinates and corresponding texture coordinates of the screen visible pixels covered by the first primitive into the above mapping relationship table.
[0115] Optionally, after the pixel test, the rasterization module first determines whether the pixel is a screen visible pixel based on the visibility information (i.e., the pixel test result). For the screen visible pixel, it further determines whether the primitive covering the pixel is the first primitive. If it is the first primitive, the pixel coordinates and corresponding texture coordinates of the pixel are saved in the above-mentioned mapping relationship table. If it is not the first primitive, the fragment shader (whose function is implemented by the computing unit) performs pixel processing on the pixel.
[0116] by Figure 2A As an example, assuming that the cube is blocked by a column, the pixel coordinates in the above mapping relationship table corresponding to the cube are the screen visible pixels covered by the primitives on the front, top and right sides of the cube (such as Figure 2C ).
[0117] During the above process, the hardware outputs three buffers:
[0118] The frame buffer stores the final color information of the object. For texture space shaded objects, the pixel visibility information is output to the frame buffer after the pixel test, but no shading is performed.
[0119] The sampling feedback map records the texture coordinates of the visible part of the texture space shading object in the screen space. When shading in texture space, only the texture coordinates recorded in the sampling feedback map are shaded;
[0120] The pixel-to-texture coordinate mapping table is a mapping of pixel coordinates to texture coordinates. For example, the pixel (0,1) position is mapped to (u=0.1, v=0.5), which is used to perform color lookup on the pixel position in the mapping stage. In the pixel-to-texture coordinate mapping table, only the mapping relationship between the visible pixels and texture coordinates of the texture space shaded object on the current image frame screen is recorded.
[0121] After the rasterization process is completed, the fragment shader of the GPU core (implemented by the computing unit) performs shading calculations (such as lighting calculations) for the corresponding pixels according to the texture coordinates recorded in the sampling feedback map. Among them, the shading calculation results of the texture space shading object are recorded in the texture map of the texture space shading object for use in the current frame and subsequent image frame mapping.
[0122] In the mapping stage, for the texture space shading object, the hardware in the GPU core searches for the color value from the texture map of the texture space shading object according to the above mapping relationship as the final display value of the corresponding pixel.
[0123] The disclosed embodiment also provides an electronic device, which includes the graphics processing system described in any of the above embodiments. In some usage scenarios, the product form of the electronic device is a graphics card; in other usage scenarios, the product form of the electronic device is a CPU motherboard.
[0124] The disclosed embodiments also provide an electronic device, which includes the above-mentioned electronic device. In some usage scenarios, the product form of the electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, a game console, a workstation, a server, etc.
[0125] Based on the same inventive concept, an embodiment of the present disclosure also provides a graphics processing method, which adopts a tile-based rendering architecture. The method includes at least the following steps: rasterizing primitives tile by tile, and the primitives include first primitives and second primitives. The first primitives include primitives identified as belonging to texture space shading objects, and the second primitives include primitives identified as belonging to pixel space shading objects.
[0126] like Figure 3 As shown, the rasterization process for the first primitive includes:
[0127] Step 301, reading the primitive information of the first primitive;
[0128] Step 302: Determine the texture coordinates corresponding to the sampled feedback pixels covered by the first primitive;
[0129] Step 303: Output the texture coordinates to the sampling feedback map;
[0130] Step 304: Perform at least one pixel test on the first primitive according to the primitive information of the first primitive.
[0131] It should be noted that steps 302 to 304 are all executed after step 301. The present disclosure does not limit the execution sequence of step 302 and step 304.
[0132] The pixel processing of the second picture element includes: reading picture element information of the second picture element, and performing at least one pixel test on the second picture element according to the picture element information of the second picture element.
[0133] Optionally, the method provided by the embodiment of the present disclosure further includes:
[0134] The first primitive identification information is read from the tile buffer, the primitive indicated by the first primitive identification information is identified as the first primitive, and the non-first primitive is identified as the second primitive.
[0135] Furthermore, the first primitive identification information may include a primitive index pointing to a first storage space, the first storage space is used to store primitive information of the first primitive, and the primitive information of the second primitive is stored in a second storage space.
[0136] Based on any of the above method embodiments, the above method may further include:
[0137] In response to the drawing instruction, geometric processing is performed on objects in the image frame, where the objects in the image frame include texture space shading objects and pixel space shading objects;
[0138] Performing a block division process on the object in the image frame, and saving the block division process result to a block buffer, wherein the block division process result includes a primitive index of a primitive covering the block;
[0139] The first primitive identification information is saved in the tile buffer, where the first primitive identification information is determined according to the first primitive identification information indicated by the drawing instruction.
[0140] Based on any of the above method embodiments, the method provided by the embodiment of the present disclosure may further include:
[0141] The screen visible pixels covered by the first picture element and the corresponding texture coordinates are identified according to the pixel test result of the first picture element, and the mapping relationship between the screen visible pixels and the texture coordinates is saved.
[0142] Furthermore, the above method may also include:
[0143] Pixel processing is performed on the texture space shaded object to which the first primitive belongs according to the sampled feedback map.
[0144] In another embodiment, Figure 4 As shown, the graphics processing method provided by the present disclosure includes the following operations:
[0145] Step 401: The hardware performs geometric processing on objects in an image frame in response to a drawing instruction submitted by the software.
[0146] The image frame includes texture space shading objects and pixel space shading objects.
[0147] Step 402: The hardware performs a block division process on the object in the image frame and saves the block division process result to a block buffer. The block division process result includes a primitive index of a primitive covering the block.
[0148] Step 403: The hardware determines the primitive (first primitive) covered by the object identified as the texture space shading object according to the texture space shading object marked in the drawing instruction, and saves the first primitive identification information to the tile buffer.
[0149] Step 404: The hardware reads first primitive identification information corresponding to a tile from the tile buffer, and identifies a first primitive and a second primitive covering the current tile according to the first primitive identification information.
[0150] For the first primitive covering the current tile, step 405 is executed, and for the second primitive covering the current tile, step 410 is executed.
[0151] Step 405: The hardware reads the primitive information of the first primitive;
[0152] Step 406: The hardware determines the texture coordinates corresponding to the sampled feedback pixels covered by the first primitive;
[0153] Step 407: The hardware outputs the texture coordinates to the sampling feedback map;
[0154] Step 408: The hardware performs at least one pixel test on the first primitive according to the primitive information of the first primitive.
[0155] Step 409: The hardware identifies the screen visible pixels covered by the first primitive and the corresponding texture coordinates according to the pixel test result of the first primitive, and saves the mapping relationship between the screen visible pixels and the texture coordinates.
[0156] Step 410: The hardware reads the primitive information of the second primitive, and performs at least one pixel test on the second primitive according to the primitive information of the second primitive.
[0157] Step 411: The hardware performs pixel processing on the object in the image frame.
[0158] The texture space shading object to which the first primitive belongs is shaded according to the sampling feedback graph.
[0159] Step 412: The hardware performs mapping processing on the objects in the image frame.
[0160] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.
[0161] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A graphics processor, using a tile-based rendering architecture, the graphics processor comprising: A rasterization processing module is configured to: perform rasterization processing on primitives tile by tile, wherein the primitives include first primitives and second primitives, wherein the first primitives include primitives identified as belonging to texture space shading objects, and the second primitives include primitives identified as belonging to pixel space shading objects; Texture space shading objects refer to objects processed using texture space shading techniques, which are relatively unchanged in multiple image frames; Pixel space shaded objects refer to objects other than texture space shaded objects in the image frame; The rasterization processing of the first primitive includes: reading primitive information of the first primitive, determining texture coordinates corresponding to sampling feedback pixels covered by the first primitive, outputting the texture coordinates to a sampling feedback map, and performing at least one pixel test on the first primitive according to the primitive information of the first primitive, wherein the sampling feedback pixel refers to a pixel of a visible portion of a texture space shaded object in a screen space; after reading the primitive information of the first primitive, the processing process of determining the texture coordinates corresponding to the sampling feedback pixels and outputting them to the sampling feedback map and the processing process of performing at least one pixel test on the first primitive according to the primitive information of the first primitive can be performed in parallel; The rasterization processing of the second primitive includes: reading primitive information of the second primitive, and performing at least one pixel test on the second primitive according to the primitive information of the second primitive.
2. The graphics processor according to claim 1, wherein the rasterization processing module is further configured to: First primitive identification information is read from the tile buffer, and a primitive indicated by the first primitive identification information is identified as a first primitive, and a non-first primitive is identified as a second primitive.
3. The graphics processor according to claim 2, wherein the first primitive identification information comprises a primitive index pointing to a first storage space, the first storage space is used to store primitive information of the first primitive, and the primitive information of the second primitive is stored in a second storage space.
4. The graphics processor according to claim 2 or 3, further comprising a geometry processing module and a tile partitioning module; The geometry processing module is configured to: perform geometry processing on objects in an image frame according to a drawing instruction, wherein the objects in the image frame include the texture space shading objects and the pixel space shading objects; The block division module is configured to: perform block division processing on the object in the image frame, and save the block division processing result to the block buffer, wherein the block division processing result includes the primitive index of the primitive covering the block; The image block division module is further configured to: save the first image primitive identification information to the image block buffer, where the first image primitive identification information is determined according to the first image primitive identification information indicated by the drawing instruction.
5. According to the graphics processor according to any one of claims 1 to 3, the rasterization processing module is further configured to: identify the screen visible pixels and corresponding texture coordinates covered by the first primitive according to the pixel test result of the first primitive, and save the mapping relationship between the screen visible pixels and texture coordinates. 6 . The graphics processor according to claim 5 , further comprising a pixel processing module configured to: perform pixel processing on a texture space shading object to which the first primitive belongs according to the sampling feedback map.
7. A graphics processing system, comprising the graphics processor according to any one of claims 1 to 6.
8. An electronic device comprising the system according to claim 7.
9. An electronic device comprising the electronic device according to claim 8.
10. A graphics processing method, using a tile-based rendering architecture, the method comprising: rasterizing primitives tile by tile, the primitives comprising first primitives and second primitives, the first primitives comprising primitives identified as belonging to texture space shaded objects, the second primitives comprising primitives identified as belonging to pixel space shaded objects; Texture space shading objects refer to objects processed using texture space shading techniques, which are relatively unchanged in multiple image frames; Pixel space shaded objects refer to objects other than texture space shaded objects in the image frame; The rasterization processing of the first primitive includes: reading primitive information of the first primitive, determining texture coordinates corresponding to sampling feedback pixels covered by the first primitive, outputting the texture coordinates to a sampling feedback map, and performing at least one pixel test on the first primitive according to the primitive information of the first primitive, wherein the sampling feedback pixel refers to a pixel of a visible portion of a texture space shaded object in a screen space; after reading the primitive information of the first primitive, determining the texture coordinates corresponding to the sampling feedback pixels and outputting them to the sampling feedback map and performing at least one pixel test on the first primitive according to the primitive information of the first primitive can be performed in parallel; The rasterization processing of the second primitive includes: reading primitive information of the second primitive, and performing at least one pixel test on the second primitive according to the primitive information of the second primitive.
11. The method according to claim 10, further comprising: First primitive identification information is read from the tile buffer, and a primitive indicated by the first primitive identification information is identified as a first primitive, and a non-first primitive is identified as a second primitive. 12 . According to the method of claim 11 , the first primitive identification information comprises a primitive index pointing to a first storage space, the first storage space is used to store the primitive information of the first primitive, and the primitive information of the second primitive is stored in a second storage space.
13. The method according to claim 11 or 12, further comprising: In response to the drawing instruction, geometric processing is performed on objects in the image frame, wherein the objects in the image frame include the texture space shading objects and the pixel space shading objects; Performing a block division process on the object in the image frame, and saving the block division process result to the block buffer, wherein the block division process result includes a primitive index of a primitive covering the block; The first primitive identification information is saved in the tile buffer, where the first primitive identification information is determined according to the first primitive identification information indicated by the drawing instruction.
14. The method according to any one of claims 10 to 12, further comprising: The screen visible pixels and corresponding texture coordinates covered by the first primitive are identified according to the pixel test result of the first primitive, and the mapping relationship between the screen visible pixels and the texture coordinates is saved.
15. The method according to claim 14, further comprising: Pixel processing is performed on the texture space shading object to which the first primitive belongs according to the sampling feedback map.
