Data processing method and device, graphics processor and equipment

By adjusting the accuracy of ray tracing data, the problems of large ray tracing calculation and high power consumption in the prior art are solved, and efficient image rendering and equipment performance improvements under limited power consumption are achieved.

CN120107441APending Publication Date: 2025-06-06HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311656477.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In the prior art, ray tracing calculations are large and power consumption is high, especially in real-time rendering scenarios of mobile devices.

Method used

By obtaining the data information corresponding to the ray tracing task, adjusting the accuracy of the data based on the accuracy configuration information, adjusting it from unified accuracy to mixed accuracy, adapting to scenarios with different accuracy requirements, and reducing calculation amount and power consumption.

Benefits of technology

Improve the quality of image rendering under limited power consumption, improve equipment performance and battery life, and achieve more efficient ray tracing calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107441A_ABST
    Figure CN120107441A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, a graphics processor and equipment, and relates to the technical field of data processing. The method comprises the following steps: acquiring first data information corresponding to a ray tracing task, wherein the first data information comprises at least one of the following data: multiple pieces of ray data with the same precision, multiple pieces of bounding box data with the same precision and multiple pieces of surface element data with the same precision; according to the precision configuration information, the precision of at least one piece of data in the first data information is adjusted to obtain second data information, and the second data information comprises at least one of the following data: multiple pieces of light data with different precision, multiple pieces of bounding box data with different precision and multiple pieces of surface element data with different precision; and performing an intersection test based on the second data information to obtain an intersection test result. In this way, the problems that in the prior art, the light tracing calculation amount is large, and power consumption is large can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a data processing method, apparatus, graphics processor and device. Background Art

[0002] As the requirements for computer graphics quality continue to increase, ray tracing is increasingly being applied to real-time computer graphics. When a graphics processing unit (GPU) performs real-time ray tracing calculations, it is necessary to perform a large amount of ray data to traverse the entire scene. For example, it is necessary to perform a large amount of intersection tests between ray data and bounding box data, and ray data and triangle surface data. Therefore, the existing technology has the problem of large ray tracing calculation amount and high power consumption. Summary of the invention

[0003] The present application provides a data processing method, apparatus, graphics processor and device, which solve the problems of large amount of calculation and high power consumption of ray tracing in the prior art.

[0004] In order to achieve the above purpose, this application adopts the following technical solutions:

[0005] In a first aspect, a data processing method is provided, the method comprising: obtaining first data information corresponding to a ray tracing task, the first data information comprising at least one of the following data: multiple ray data of the same precision, multiple bounding box data of the same precision, and multiple face metadata of the same precision. According to the precision configuration information, the precision of at least one data in the first data information is adjusted to obtain second data information, the second data information comprising at least one of the following data: multiple ray data of different precisions, multiple bounding box data of different precisions, and multiple face metadata of different precisions. An intersection test is performed based on the second data information to obtain a result of the intersection test.

[0006] In the above technical scheme, with the continuous expansion of graphics processing application scenarios, in addition to workstations, computers and other fields that can perform offline rendering, mobile devices that need to perform real-time rendering have also introduced ray tracing functions. However, the power consumption limit of mobile devices is large, and ray tracing calculations can only be performed under limited power consumption. After generating multiple data required for intersection tests of uniform precision, the embodiment of the present application adjusts the precision of multiple data required for intersection tests from uniform precision to mixed precision, and can adjust the data precision according to scenes with different precision requirements. Among them, the data required for intersection testing is light data, bounding box data, or face data. For scenes with lower precision requirements, the precision of light data, bounding box data or face data at the scene is reduced to reduce the amount of calculation and power consumption. For scenes with higher precision requirements, the precision of light data, bounding box data and face data is set higher to obtain better lighting effects and higher precision object imaging quality. In this way, the quality of image rendering can be improved under limited power consumption, and the performance and endurance of the device can be improved.

[0007] In a possible implementation of the first aspect, the precision configuration information is used to indicate the at least one data. In the above possible implementation, the precision configuration information is used to indicate the at least one data, so that the multiple data in the first data information can be screened according to the precision configuration information, and the data that needs to adjust the precision can be selected, so that the precision of the light data, or the bounding box data, or the face data can be adjusted as needed, providing a basis for implementing a mixed precision intersection test.

[0008] In a possible implementation of the first aspect, the precision configuration information includes a first preset range, and the parameters indicated by the at least one data are within the first preset range, wherein the parameters indicated by the light data include light brightness and / or saturation, the parameters indicated by the bounding box data include visual depth or LOD level fineness, and the parameters indicated by the surface metadata include visual depth or LOD level fineness. In the above possible implementation, based on the fact that the parameters indicated by the light data are within the first preset range, it is determined that the precision of the light data needs to be adjusted; based on the fact that the parameters indicated by the bounding box data are within the first preset range, it is determined that the precision of the bounding box data needs to be adjusted; based on the fact that the parameters indicated by the surface metadata are within the first preset range, it is determined that the precision of the surface metadata needs to be adjusted. This provides a basis for adjusting the precision of the light data, bounding box data, or surface metadata on demand and for implementing mixed precision intersection testing.

[0009] In a possible implementation of the first aspect, the precision configuration information is further used to indicate the adjusted precision range of each data in the at least one data. In the above possible implementation, the precision configuration information is further used to indicate the adjusted precision range of each data in the at least one data, providing a basis for implementing a mixed precision intersection test.

[0010] In a possible implementation of the first aspect, the at least one data includes first light data and second light data, and the precision of the adjusted first light data is different from the precision of the adjusted second light data. And / or, the at least one data includes first bounding box data and second bounding box data, and the precision of the adjusted first bounding box data is different from the precision of the adjusted second bounding box data. And / or, the at least one data includes first face metadata and second face metadata, and the precision of the adjusted first face metadata is different from the precision of the adjusted second face metadata. In the above possible implementations, the precision of multiple light data (or multiple bounding box data, or multiple face metadata) in the first data information is adjusted to multiple precisions, there are multiple gears for precision adjustment, and the precision configuration method is relatively accurate.

[0011] In a possible implementation of the first aspect, the at least one data includes third light data and third bounding box data. The method also includes: when the third light data and the third bounding box data have an intersection, adjusting the precision of the third light data again according to the precision configuration information. In the above possible implementation, after adjusting the precision of the third light data for the first time, if it is determined that the third light data and the third bounding box data have an intersection, the precision of the third light data can be adjusted again, so that the third light data after the second precision adjustment is subjected to an intersection test with the bounding box data inside the third bounding box data space. In this way, when the bounding box to be intersected may have an intersection with the light data, the precision of the light data is adjusted again to perform an intersection test, so that the precision of the light data during the intersection test can be configured more accurately.

[0012] In a possible implementation of the first aspect, the precision configuration information includes a second preset range, and the parameters indicated by the third bounding box are within the second preset range, wherein the parameters indicated by the third bounding box data include the fineness of the visual depth or LOD level. In the above possible implementation, when the precision of the third light data is adjusted for the first time, since it is unknown whether the third bounding box data intersects with the third light data, the precision of the third light data can only be adjusted by the parameters indicated by the third light data. When it is determined that there is an intersection between the third light data and the third bounding box data, the precision of the third light data can be adjusted again according to the parameters indicated by the third bounding box data, so that the third light data after the second precision adjustment is subjected to an intersection test with the bounding box data within the third bounding box data space. In this way, not only the influence of the parameters of the light data itself is considered, but also the influence of the parameters of the bounding box data intersecting with the light data on the precision of the light data is considered, so that the precision of the light data during the intersection test can be configured more accurately.

[0013] In a possible implementation of the first aspect, the method further includes: receiving precision configuration information. In the above possible implementation, the precision configuration information is received so that one or more ray tracing calculations can be performed according to the precision configuration information, providing a basis for improving the quality of image rendering under limited power consumption, and improving device performance and battery life.

[0014] In a possible implementation of the first aspect, the method further includes: outputting a result of an intersection test, wherein the result of the intersection test is used to generate a target image to be drawn by the ray tracing task. In the above possible implementation, the intersection test unit outputs the result of the intersection test, which provides a basis for subsequent high-precision image drawing under limited power consumption.

[0015] In a second aspect, a data processing device is provided, the device comprising: a precision configuration unit, used to obtain first data information corresponding to a ray tracing task, the first data information comprising at least one of the following data: multiple ray data of the same precision, multiple bounding box data of the same precision, and multiple face metadata of the same precision. The precision configuration unit is also used to adjust the precision of at least one data in the first data information according to the precision configuration information to obtain second data information, the second data information comprising at least one of the following data: multiple ray data of different precisions, multiple bounding box data of different precisions, and multiple face metadata of different precisions. An intersection test unit is used to perform an intersection test based on the second data information to obtain a result of the intersection test.

[0016] In a possible implementation manner of the second aspect, the precision configuration information is used to indicate the at least one data.

[0017] In a possible implementation of the second aspect, the precision configuration information includes a first preset range, and the parameters indicated by the at least one data are within the first preset range, wherein the parameters indicated by the light data include light brightness and / or saturation, the parameters indicated by the bounding box data include visual depth or LOD level fineness, and the parameters indicated by the face metadata include visual depth or LOD level fineness.

[0018] In a possible implementation manner of the second aspect, the precision configuration information is further used to indicate an adjusted precision range of each data in the at least one data.

[0019] In a possible implementation of the second aspect, the at least one data includes first light data and second light data, and the precision of the adjusted first light data is different from the precision of the adjusted second light data. And / or, the at least one data includes first bounding box data and second bounding box data, and the precision of the adjusted first bounding box data is different from the precision of the adjusted second bounding box data. And / or, the at least one data includes first face metadata and second face metadata, and the precision of the adjusted first face metadata is different from the precision of the adjusted second face metadata.

[0020] In a possible implementation of the second aspect, the at least one data includes third ray data and third bounding box data. The precision configuration unit is further configured to adjust the precision of the third ray data again according to the precision configuration information when the third ray data and the third bounding box data have an intersection.

[0021] In a possible implementation manner of the second aspect, the precision configuration information includes a second preset range, and the parameters indicated by the third bounding box data are located in the second preset range, wherein the parameters indicated by the third bounding box data include visual depth or LOD level fineness.

[0022] In a possible implementation manner of the second aspect, the precision configuration unit is further configured to receive precision configuration information.

[0023] In a possible implementation manner of the second aspect, the intersection test unit is further used to output a result of the intersection test, and the result of the intersection test is used to generate a target image to be drawn by a ray tracing task.

[0024] According to a third aspect, a graphics processor is provided, comprising: a coupled shader and a ray tracing processor, wherein the ray tracing processor is a data processing device provided by the second aspect or any possible implementation of the second aspect, and the shader is used to generate a target image to be drawn for a ray tracing task based on a result of an intersection test.

[0025] In a fourth aspect, a graphics processing device is provided, comprising: a processor and a memory, wherein instructions are stored in the memory, and when the processor executes the instructions, the graphics processing device implements the method provided by the first aspect or any possible implementation of the first aspect.

[0026] According to a fifth aspect, a computer-readable storage medium is provided, in which a program code is stored. The program code can be called by a processor to execute the method provided by the first aspect or any possible implementation of the first aspect.

[0027] According to another aspect of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is enabled to execute the method provided by the first aspect or any possible implementation manner of the first aspect.

[0028] It can be understood that any of the data processing devices, graphics processors, graphics processing equipment, computer storage media or computer program products provided above are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A schematic diagram of ray tracing provided in an embodiment of the present application;

[0030] Figure 2 A schematic diagram of an acceleration structure provided in an embodiment of the present application;

[0031] Figure 3 A schematic diagram of a graphics processing device provided in an embodiment of the present application;

[0032] Figure 4 A schematic diagram of a first graphics processor provided in an embodiment of the present application;

[0033] Figure 5 A schematic diagram of a second graphics processor provided in an embodiment of the present application;

[0034] Figure 6 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 1 ;

[0035] Figure 7 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 2 ;

[0036] Figure 8 A schematic diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In the present application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b and c can be single or multiple. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, in the embodiments of the present application, the words "first", "second" and the like do not limit the quantity and execution order.

[0038] In this application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the words "exemplary" or "for example" is intended to present the related concepts in a concrete way.

[0039] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0040] First, some technical terms involved in the embodiments of the present application are explained:

[0041] Ray Tracing: It is a rendering algorithm in computer graphics. By tracing the light rays that intersect with the surface of the object, and performing specular reflection, diffuse reflection or refraction according to the material of the surface of the object and physical rules, the path of the light rays can be obtained. This can more accurately simulate the imaging process of objects in the real world on the camera or the human eye, so the rendering result can achieve a "photo-realistic" effect. Among them, ray tracing includes forward ray tracing and reverse ray tracing. Forward ray tracing starts from the light source, obtains the intersection points where multiple light rays emitted by the light source intersect with each object in the scene, and traces the paths of multiple light rays in the scene. Since a large number of light rays in forward ray tracing will not enter the viewpoint (human eye or camera), computing resources will be wasted. Reverse ray tracing emits light from the viewpoint to the pixel points on the imaging surface, then from the imaging surface to the scene, and then traces the path of the light rays in the scene. For example, if Figure 1As shown, light 1 and light 2 are emitted from the camera to the pixel point on the imaging surface. After several reflections or refractions, light 1 reaches the light source, and light 1 is determined to be a valid light; after several reflections or refractions, light 2 will not reach the light source, and light 2 is determined to be an invalid light. Then, the shading calculation is performed according to the intersection of the valid light and the object to be rendered, and the shading component of the pixel corresponding to the intersection is obtained. If the surface of the object at the intersection is a scattering surface, the color generated by the light source directly irradiating the intersection is calculated; if the surface of the object at the intersection is a mirror or a refractive surface, another light ray is continued to be traced in the direction of reflection or refraction, and so on recursively until the light escapes from the scene or reaches the set maximum recursive depth. The ray tracing scene involved in the embodiment of the present application can be a forward ray tracing scene or a reverse ray tracing scene, and the embodiment of the present application does not limit this.

[0042] Intersection test: It is a method of performing intersection operations on rays and multiple facets to determine whether the ray has an intersection with the object to be rendered. For example, in a three-dimensional space scene, rays and facets can be represented by vector data, and the intersection test can be a vector operation. Since there may be a large number of objects to be rendered in the scene, and one object to be rendered includes multiple facets, it requires a lot of calculation to determine whether the ray intersects with each facet of the object to be rendered. Therefore, a bounding box acceleration structure can be used to perform the intersection test.

[0043] The bounding box acceleration structure is: use a bounding box with simple geometric characteristics to approximate the geometric features of a larger object in the scene, and then gradually approximate the geometric model of the object by constructing a bounding box tree hierarchy until the geometric characteristics of the object to be rendered in the scene are almost completely described. For example, Figure 2 As shown, the bounding box 100 includes the bounding box 110 and the bounding box 120. The bounding box 110 includes the face element of the object A to be rendered and the face element of the object B to be rendered. The bounding box 120 includes the face element of the object C to be rendered and the face element of the object D to be rendered. The bounding box 100 is the root node, the bounding box 110 and the bounding box 120 are the internal nodes of the lower layer of the root node, and the face elements of the objects A, B, C and D to be rendered are the leaf nodes of the lower layer of the internal nodes, wherein, Figure 2Only the two-dimensional structure of the bounding box and the object to be rendered is shown. In the actual scene, the bounding box and the object to be rendered can be a three-dimensional structure. Furthermore, the bounding box involved in the embodiment of the present application is a geometric object that can be described by a data equation, such as a cuboid, a cube, a sphere, an ellipsoid, a cone, a cylinder, etc., which is not limited to the embodiment of the present application. In addition, the face element of the object to be rendered can be a triangular face element or a face element of other shapes, which is not limited to the embodiment of the present application. Furthermore, the tree-like acceleration structure involved in the embodiment of the present application can also be in other forms, which is not limited to the embodiment of the present application.

[0044] For example, next, Figure 1 The specific process of performing intersection tests on the traversal bounding box acceleration structure is introduced. When light 1 enters the scene, an intersection test is first performed with the bounding box 100 corresponding to the root node. When it is determined that light 1 has an intersection with the bounding box 100, the bounding box 110 and the bounding box 120 corresponding to the internal nodes under the root node are continued to be tested for intersection. When it is determined that light 1 has no intersection with the bounding box 110, it can be determined that light 1 has no intersection with the objects A, B, C and D to be rendered inside the bounding box 110, and there is no need to use light 1 to perform intersection tests on the face elements of the objects A, B, C and D to be rendered. Since the geometric characteristics of the bounding box 110 are simple, the intersection test between light 1 and the bounding box 110 is simpler than the intersection test between light 1 and the face elements of the objects A, B, C and D to be rendered, thereby improving the intersection test speed of ray tracing. When it is determined that ray 1 intersects with bounding box 120, the intersection test is continued for the facets of objects C and D to be rendered corresponding to the leaf nodes at the lower level of bounding box 120, thereby determining that ray 1 does not intersect with object C to be rendered, and ray 1 intersects with object D to be rendered. As can be seen from this example, ray tracing requires each ray to perform an intersection test of traversing the bounding box acceleration structure. For offline rendering scenes, thousands of rays can be emitted for ray tracing. However, for real-time rendering scenes, if too many rays are emitted, a large amount of computing resources and power consumption will be consumed, reducing the image frame rate. If the number of emitted rays is small, the imaging quality will be reduced, resulting in poor lighting effects.

[0045] The embodiment of the present application provides a graphics processing device, which has an image processing function. The graphics processing device can be an electronic device, including but not limited to: a mobile phone, a tablet computer, a computer, a laptop computer, a video camera, a camera, a wearable device, a vehicle-mounted device or a terminal device, etc. The graphics processing device can also be a component of an electronic device, such as a chip built into the electronic device, such as a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a display subsystem in a mobile phone or computer, or a graphics processing subsystem in a head-mounted display device, etc. Figure 3 As shown, the graphics processing device 2000 includes a processor 300 and a memory 200, and the processor 300 and the memory 200 can be arranged on a circuit board (not shown in the figure) in the graphics processing device 2000. The processor 300 is used to perform ray tracing tasks, and the memory 200 is used to store data or programs required for ray tracing tasks. Exemplarily, the processor 300 can be a central processing unit (central processing unit), a graphics processing unit (graphics processing unit, GPU) or other processors. The embodiment of the present application is introduced by taking the processor 300 as a graphics processor as an example. The graphics processor may include a shader processor and a ray tracing unit (ray tracing unit, RTU), hereinafter the shader processor is referred to as a shader, and the ray tracing processor is referred to as a ray tracing processor. Exemplarily, the memory 200 can be a memory, such as a double data rate synchronous dynamic random access memory (double data rate synchronous dynamic random access memory, DDR). Exemplarily, the graphics processing device 2000 may also include other hardware modules, such as an interface circuit (for communicating with an external device), a multimedia component (such as a screen for displaying a rendered image), and the like.

[0046] In some possible implementations, in order not to reduce the number of rays too much, reduce the amount of calculation and power consumption, and improve the image frame rate, the data accuracy required for the intersection test can be uniformly reduced. The processor 300 can be a first graphics processor for uniformly reducing the data accuracy required for the intersection test. The data required for the intersection test includes one of ray data, bounding box data, or face data. Figure 4As shown, the first graphics processor 300A may include a first shader 310A, a first creation circuit 320A and a first ray tracing processor 330A. The first ray tracing processor 330A includes a first intersection circuit 331A, a first traversal circuit 332A and a first cache 333A. The first shader 310A is coupled to the first ray tracing processor 330A, the first creation circuit 320A is coupled to the memory 200, the first intersection circuit 331A and the first cache 333A are both coupled to the first traversal circuit 332A, and the first cache 333A is also coupled to the memory 200. In the embodiment of the present application, the intersection circuit may also be referred to as an intersection test unit, the traversal circuit may also be referred to as an acceleration structure traversal unit, and the creation circuit may also be referred to as an acceleration structure creation unit.

[0047] Exemplarily, after the first graphics processor 300A receives the ray tracing task, the first shader 310A is used to generate multiple ray data of the same precision and output the multiple ray data to the first ray tracing processor 330A. The first creation circuit 320A is used to generate an acceleration structure and send the acceleration structure to the memory 200 for storage, wherein the acceleration structure includes bounding box data of the same precision and face metadata of the same precision, and the acceleration structure can be a tree structure. The first ray tracing processor 330A is used to obtain the acceleration structure from the memory 200 and store the read acceleration structure in the first cache 333A. The first traversal circuit 332A is used to input the acceleration structure from the first cache 333A and traverse from the root node of the acceleration structure to the lower nodes (such as internal nodes and leaf nodes). The first traversal circuit 332A is used to output the bounding box data to the first intersection circuit 331A when traversing to the bounding box data, and the first intersection circuit 331A is used to perform a bounding box intersection test based on each ray in the multiple ray data and the bounding box data. The first traversal circuit 332A is used to output the face metadata to the first intersection circuit 331A when traversing to the face metadata. The first intersection circuit 331A is used to perform a face intersection test based on each ray of the multiple ray data and the face metadata. The first traversal circuit 332A is used to obtain the result of the intersection test after traversing all bounding box data and face metadata. The result of the intersection test includes the intersection point information of each ray data and each face metadata. The result of the intersection test is output to the first shader 310A. The first shader 310A is used to generate a target image to be drawn by the ray tracing task according to the result of the intersection test.

[0048] Exemplarily, the first graphics processor 300A may only uniformly reduce the precision of the plurality of light data. The first shader 310A is used to generate a plurality of light data of the same precision, and the precision of the plurality of light data is lower. For example, the light data is usually a 32-bit floating point number, and the plurality of light data generated by the first shader 310A are all 16-bit floating point numbers.

[0049] Exemplarily, the first graphics processor 300A may also only uniformly reduce the precision of the plurality of bounding box data. The first creation circuit 320A is used to generate a plurality of bounding box data of the same precision, and the precision of the plurality of bounding box data is lower. For example, the bounding box data is usually a 32-bit floating point number, and the plurality of bounding box data generated by the first creation circuit 320A are all 16-bit floating point numbers.

[0050] Exemplarily, the first graphics processor 300A may also uniformly reduce the precision of the plurality of face data. The first creation circuit 320A is used to generate a plurality of face data of the same precision, and the precision of the plurality of face data is low. For example, the face data is usually a 32-bit floating point number, and the plurality of face data generated by the first creation circuit 320A are all 16-bit floating point numbers.

[0051] In the embodiment of the present application, the first graphics processor 300A can generate uniform low-precision light data, or uniform low-precision bounding box / surface metadata, so as to reduce the computational complexity and power consumption of the intersection test and improve the image frame rate. However, in this way, for scenes with high precision requirements, if the precision of the bounding box data or light data is uniformly reduced, the lighting effect will be poor; if the precision of the surface metadata is uniformly reduced, the precision of the object imaging will be further reduced. Therefore, the precision requirements of the scene cannot be met.

[0052] In some possible implementations, different precisions may be configured for the data required for the intersection test for scenarios with different precision requirements. The processor 300 may be a second graphics processor 300B for adjusting the precision of the data required for the intersection test from uniform precision to mixed precision. Figure 5As shown, the second graphics processor 300B may include a second shader 310B, a second creation circuit 320B, and a second ray tracing processor 330B. The second ray tracing processor 330B includes a second intersection circuit 331B, a second traversal circuit 332B, and a second cache 333B. The second intersection circuit 331B includes a precision configuration unit 31B, a bounding box intersection test unit 32B, and a surface element intersection test unit 33B. The second shader 310B is coupled to the second ray tracing processor 330B, the second creation circuit 320B is coupled to the memory 200, the bounding box intersection test unit 32B, the surface element intersection test unit 33B, and the second cache 333B are all coupled to the second traversal circuit 332B, the bounding box intersection test unit 32B and the surface element intersection test unit 33B are also coupled to the precision configuration unit 31B, and the second cache 333B is also coupled to the memory 200. In the embodiment of the present application, the precision configuration unit 31B may also be called an intersection test precision configuration unit, the bounding box intersection test unit 32B may also be called an intersection test unit, or a mixed precision bounding box intersection test unit, and the face element intersection test unit 33B may also be called an intersection test unit. If the face element is a triangular face element, the face element intersection test unit 33B may also be called a mixed precision triangle intersection test unit.

[0053] Exemplarily, the functions of the second traversal circuit 332B and the second cache 333B can refer to the functions of the first traversal circuit 332A and the first cache 333A. Unlike the first graphics processor 300A, after the second shader 310B in the second graphics processor 300B generates multiple ray data of the same precision, and the second creation circuit 320B generates multiple bounding box data of the same precision and the facet metadata of the same precision, the precision configuration unit 31B is used to obtain the first data information corresponding to the ray tracing task, and the first data information includes at least one of the following data: multiple ray data of the same precision, multiple bounding box data of the same precision, and multiple facet metadata of the same precision. The precision configuration unit 31B is also used to adjust the precision of at least one data in the first data information according to the precision configuration information to obtain the second data information. The second data information includes at least one of the following data: multiple ray data of different precisions, multiple bounding box data of different precisions, and multiple facet metadata of different precisions. The bounding box intersection test unit 32B and the facet intersection test unit 33B are used to perform an intersection test based on the second data information to obtain the result of the intersection test.

[0054] Exemplarily, the second graphics processor 300B may only adjust the precision of the plurality of light data from uniform precision to mixed precision. The first data information includes a plurality of light data of the same precision. The second data information includes a plurality of light data of different precisions, such as part of the light data of 32-bit floating point numbers. Optionally, the precision may be represented by a floating point number or a fixed point number. For example, uniform precision may mean that the floating point numbers of all data are 32 bits, and mixed precision may mean that the floating point numbers of a portion of data are 32 bits, and the floating point numbers of another portion of data are 16 bits.

[0055] Exemplarily, the second graphics processor 300B can adjust the precision of the plurality of light data from uniform precision to mixed precision, and adjust the precision of the plurality of bounding box data from uniform precision to mixed precision. The first data information includes a plurality of light data of the same precision and a plurality of bounding box data of the same precision. The second data information includes a plurality of light data of different precisions and a plurality of bounding box data of different precisions.

[0056] Exemplarily, the second graphics processor 300B can adjust the precision of multiple light data from unified precision to mixed precision, adjust the precision of multiple bounding box data from unified precision to mixed precision, and adjust the precision of multiple facet metadata from unified precision to mixed precision. The first data information includes multiple light data of the same precision, multiple bounding box data of the same precision, and multiple facet metadata of the same precision. The second data information includes multiple light data of different precisions, multiple bounding box data of different precisions, and multiple facet metadata of different precisions.

[0057] In the embodiments of the present application, as the application scenarios of graphics processing continue to expand, in addition to workstations and computers that can perform offline rendering, mobile devices that need real-time rendering also introduce ray tracing functions. However, mobile devices have large power consumption limitations and can only perform ray tracing calculations under limited power consumption. Figure 4 The first graphics processor 300A shown uniformly reduces the data precision when generating data required for multiple intersection tests. Although this can reduce power consumption, it cannot adjust the data precision according to scenarios with different precision requirements. Figure 5After generating multiple data required for intersection tests of uniform precision, the second graphics processor 300B shown adjusts the precision of the multiple data required for intersection tests from uniform precision to mixed precision, and can adjust the data precision according to scenes with different precision requirements. For scenes with lower precision requirements, the precision of the light data, bounding box data, or plane data is reduced in the scene to reduce the amount of calculation and power consumption; for scenes with higher precision requirements, the precision of the light data, bounding box data, and plane data is set higher to obtain better lighting effects and higher precision object imaging quality. In this way, the quality of image rendering can be improved under limited power consumption, and the performance and battery life of the device can be improved.

[0058] In some possible implementations, the accuracy of the at least one data before being adjusted may be an initial accuracy, and the accuracy of the at least one data after being adjusted may be different from the initial accuracy, thereby obtaining second data information.

[0059] Exemplarily, the first data information includes: multiple light data of the same precision, multiple bounding box data of the same precision, and multiple facet metadata of the same precision. Among them, the precision of the multiple light data is the initial light precision, the precision of the multiple bounding box data is the initial bounding box precision, and the precision of the multiple facet metadata is the initial facet precision. The above at least one data includes: the fourth light data in the multiple light data, the fourth bounding box data in the multiple bounding box data, and the third facet metadata in the multiple facet metadata. The second data information includes multiple light data of different precisions, multiple bounding box data of different precisions, and multiple facet metadata of different precisions. Multiple light data of different precisions means: the precision of the fourth light data after adjustment is different from the initial light precision; multiple bounding box data of different precisions means: the precision of the fourth bounding box data after adjustment is different from the initial bounding box precision; multiple facet metadata of different precisions means: the precision of the third facet metadata after adjustment is different from the initial facet precision. In the embodiment of the present application, the precision of the above at least one data is adjusted to a precision different from the initial precision, there is only one gear for precision adjustment, and the precision configuration method is simple.

[0060] In some possible implementations, the at least one data is a plurality of light data, and the precision of the plurality of light data can be adjusted to a plurality of precisions, and the adjusted plurality of precisions are all different from the initial precision, thereby obtaining the second data information.

[0061] Exemplarily, the at least one data includes first light data and second light data, and the precision of the adjusted first light data is different from the precision of the adjusted second light data. And / or, the at least one data includes first bounding box data and second bounding box data, and the precision of the adjusted first bounding box data is different from the precision of the adjusted second bounding box data. And / or, the at least one data includes first surface metadata and second surface metadata, and the precision of the adjusted first surface metadata is different from the precision of the adjusted second surface metadata. In an embodiment of the present application, the precision of multiple light data (or multiple bounding box data, or multiple surface metadata) in the first data information is adjusted to multiple precisions different from the initial precision, there are multiple gears for precision adjustment, and the precision configuration method is relatively accurate.

[0062] In some possible implementations, the accuracy configuration information may be received via an application program interface (API). For example, Figure 3 The graphics processing device 2000 shown may also include a CPU, which is coupled to the second graphics processor 300B. The CPU runs an operating system, which includes an application and an API interface. The application can call the driver of the second graphics processor 300B through the API interface to enable the second graphics processor 300B to perform a ray tracing task. The application can set precision configuration information through the API interface and send it to the second graphics processor 300B. The precision configuration information set by the application may include: for each ray data, configuring the precision of the bounding box intersection test and the face element intersection test, or, for each bounding box data, configuring the precision of the bounding box intersection test, or, for each face element data, configuring the precision of the face element intersection test.

[0063] In the embodiment of the present application, the precision configuration unit 31B receives the precision configuration information, so that one or more ray tracing calculations can be performed according to the precision configuration information, providing a basis for improving the quality of image rendering under limited power consumption, improving device performance and endurance. In addition, by receiving the precision configuration information through the API interface, the application can set the precision configuration information according to the needs, which can be flexibly applied to various rendering scenarios.

[0064] In some possible implementations, the data in the first data information that needs to adjust the precision and the adjusted precision range can be determined according to the precision configuration information. That is, the precision configuration information can be used to indicate the at least one data, and can also be used to indicate the adjusted precision range of each data in the at least one data.

[0065] Exemplarily, the protocol standard and API interface may provide the following configuration options (taking the facet as a triangular facet as an example):

[0066] The ray flags that control the accuracy of ray data are defined in the ray tracing standard to precisely control the intersection test accuracy of each ray data. The ray flags may include:

[0067] *RAY_FLAG_LOW_PRECISION_BOX_TEST;

[0068] *RAY_FLAG_MEDIUM_PRECISION_BOX_TEST;

[0069] *RAY_FLAG_HIGH_PRECISION_BOX_TEST;

[0070] *RAY_FLAG_LOW_PRECISION_TRIANGLE_TEST;

[0071] *RAY_FLAG_MEDIUM_PRECISION_TRIANGLE_TEST;

[0072] *RAY_FLAG_HIGH_PRECISION_TRIANGLE_TEST;

[0073] Control the intersection accuracy at different bounding box or triangle granularity:

[0074] *Set the bounding box intersection test precision (precision level), SetBoxIntersectionTestPrecision(Precision level);

[0075] *Set the triangle intersection test precision (precision level), SetTriangleIntersectionTestPrecision(Precision level);

[0076] Among them, the accuracy level can be selected as high accuracy, medium accuracy, and low accuracy.

[0077] In this example, through the ray flag, the precision configuration information can be used to indicate that the precision of at least one ray data in the first data information needs to be adjusted, through the bounding box configuration rule, the precision configuration information can be used to indicate that the precision of at least one bounding box data in the first data information needs to be adjusted, and through the triangle face configuration rule, the precision configuration information can be used to indicate that the precision of at least one triangle face data needs to be adjusted. By setting the precision level to high precision, medium precision, and low precision, the precision configuration information can be used to indicate the adjusted precision range of each data in the at least one data.

[0078] Exemplarily, the precision range indicated by high precision can be greater than the initial precision, the precision range indicated by medium precision can be equal to the initial precision, and the precision range indicated by low precision can be less than the initial precision. The embodiment of the present application does not limit the size relationship between the precision ranges indicated by high precision, medium precision, and low precision and the initial precision. Exemplarily, the precision configuration information set by the application through the API interface indicates the adjusted precision range, and the adjusted specific precision value can be pre-configured by the ray tracing software and hardware system.

[0079] In the embodiment of the present application, on the one hand, the precision configuration information is used to indicate the at least one data, so that the multiple data in the first data information can be screened according to the precision configuration information, and the data that needs to adjust the precision can be selected. In this way, the precision of the light data, or the bounding box data, or the face data can be adjusted as needed, providing a basis for implementing the intersection test of mixed precision. On the other hand, the precision configuration information is also used to indicate the adjusted precision range of each data in the at least one data, providing a basis for implementing the intersection test of mixed precision.

[0080] In some possible implementations, the precision configuration information may be set with a preset range, and when the parameters indicated by the data in the first data information satisfy the preset range, the data are determined to be data that require precision adjustment.

[0081] Exemplarily, the precision configuration information includes a first preset range, the parameters indicated by the above-mentioned at least one data are located in the first preset range, the parameters indicated by the light data include light brightness and / or saturation, the parameters indicated by the bounding box data include visual depth or the fineness of multiple levels of detail (LOD), and the parameters indicated by the surface metadata include visual depth or the fineness of the LOD level. Among them, the first preset range may include a preset range corresponding to the light data, such as a light brightness range, and / or a light saturation range. The first preset range may also include a preset range corresponding to the bounding box data, such as a visual depth range, or a fineness range of the LOD level. The first preset range may also include a preset range corresponding to the surface metadata, such as a visual depth range, or a fineness range of the LOD level.

[0082] Exemplarily, taking the example that the first data information includes a plurality of identical light data, an example is given to illustrate how the precision configuration information indicates that at least one of the above data needs to be adjusted. The first preset range includes a larger brightness range, a moderate brightness range, and a lower brightness range, and determines within which brightness range the light brightness carried by each light data is. If the light brightness carried by the light data is within a larger brightness range, the precision of the light data is adjusted to high precision. If the light brightness carried by the light data is within a moderate brightness range, the precision of the light data is adjusted to medium precision. If the light brightness carried by the light data is within a smaller brightness range, the precision of the light data is adjusted to low precision.

[0083] Exemplarily, in some global illumination special effects scenes with darker lighting effects, or in ambient light occlusion special effects, or shadow special effects, the human eye has a low perception of lighting. The light brightness and / or saturation are used as the standard for determining whether the accuracy of the light data needs to be adjusted. When the light brightness and / or saturation are low, the accuracy of the light data is reduced, which does not affect the user's experience of the picture. Exemplarily, the precision configuration information can also determine the light that needs to be adjusted in accuracy according to the special effects used for image rendering. For example, in addition to the darker lighting effects, or in ambient light occlusion special effects and shadow special effects, for applications such as using spatial probes (probes) to store intermediate approximate results to further calculate global illumination special effects, it is usually only necessary to perform visibility judgments or some approximations, that is, intermediate results, of whether the light intersects with the object. The accuracy of the light data can be configured to medium or low accuracy through the accuracy configuration information. After the intersection test is completed, the result of whether the light intersects with the object is returned to the second shader 310B to determine whether the light is blocked, so as to further calculate the occlusion coefficient to show the shadow effect.

[0084] Exemplarily, for objects that are farther away from the human eye (with a greater visual depth), the human eye has a lower degree of perception of the lighting effect of the object. Visual depth is used as a criterion for determining whether the accuracy of the bounding box data or the face data needs to be adjusted. When the visual depth of the bounding box data or the face data is large, the accuracy of the bounding box data or the face data is set to low precision, which does not affect the user's experience of the picture. After the intersection test is completed, the key information of the intersection point (such as the distance from the human eye, the center of gravity coordinates) of whether the light intersects with the object is returned to the second shader 310B, so as to further calculate the lighting effect.

[0085] Exemplarily, when performing ray tracing calculations on a large-scale scene, the scene is first LOD modeled, and the LOD level information is stored in the acceleration structure. For objects with low levels of detail, the human eye has a low degree of perception of the lighting effect of the object. The fineness of the LOD level is used as a standard to determine whether the accuracy of the bounding box data or the face data needs to be adjusted. When the LOD level of the bounding box data or the face data is coarse, the accuracy of the bounding box data or the face data is set to low precision. When the LOD level of the bounding box data or the face data is fine, the accuracy of the bounding box data or the face data is set to high precision, which can ensure the user's experience of the picture. After the intersection test is completed, the key information of the intersection point (such as the distance from the human eye, the center of gravity coordinates) of whether the light and the object intersect is returned to the second shader 310B, so as to further calculate the lighting effect.

[0086] In an embodiment of the present application, whether the accuracy of the ray data needs to be adjusted is determined according to the parameters indicated by the ray data, whether the accuracy of the bounding box data needs to be adjusted is determined according to the parameters indicated by the bounding box data, and whether the accuracy of the surface metadata needs to be adjusted is determined according to the parameters indicated by the surface metadata, thereby providing a basis for adjusting the accuracy of the ray data, bounding box data, or surface metadata as needed and realizing mixed precision intersection testing.

[0087] In some possible implementations, the precision of the light data can be adjusted multiple times. Exemplarily, the at least one data includes third light data and third bounding box data. The precision configuration unit 31B is further configured to adjust the precision of the third light data again according to the precision configuration information when there is an intersection between the third light data and the third bounding box data.

[0088] Exemplarily, the space of the third bounding box data also includes the fifth bounding box data. After the second shader 310B generates multiple light data of the same precision, the precision configuration unit 31B is used to adjust the precision of the third light data among the multiple light data for the first time according to the precision configuration information. The second traversal circuit 332B sends the traversed third bounding box data to the bounding box intersection test unit 32B, and the bounding box intersection test unit 32B obtains the third light data after the first adjustment of the precision from the precision configuration unit 31B, and performs an intersection test on the third bounding box data and the third light data to determine whether the third light data and the third bounding box data have an intersection. The precision configuration unit 31B is used to adjust the precision of the third light data for the second time, so that the second traversal circuit 332B performs an intersection test based on the third light data after the second adjustment of the precision and based on the fifth bounding box data to determine whether the third light data and the fifth bounding box data have an intersection.

[0089] In the embodiment of the present application, after the accuracy of the third ray data is adjusted for the first time, if it is determined that the third ray data and the third bounding box data have an intersection, the accuracy of the third ray data can be adjusted again, so that the third ray data after the second accuracy adjustment is subjected to an intersection test with the bounding box data within the third bounding box data space. In this way, when the bounding box to be subjected to the intersection test may have an intersection with the ray data, the accuracy of the ray data is adjusted again to perform the intersection test, so that the accuracy of the ray data during the intersection test can be configured more accurately.

[0090] In some possible implementations, when adjusting the accuracy of the light data for the second time, the adjustment can be made according to the parameters indicated by the bounding box data that intersects the light data. Exemplarily, the accuracy configuration information includes a second preset range, the parameters indicated by the third bounding box data are within the second preset range, and the parameters indicated by the third bounding box data include the visual depth or the fineness of the LOD level. Among them, the second preset range may include a preset range corresponding to the bounding box data, such as a preset visual depth range, or a preset LOD level fineness range. The preset range corresponding to the bounding box data in the first preset range may be the same as or different from the preset range corresponding to the bounding box data in the second preset range, and the embodiments of the present application are not limited to this.

[0091] Exemplarily, when the precision of the third light data is adjusted for the first time, the precision of the third light data is adjusted to high precision because the light brightness indicated by the third light data is high. When the third light data and the third bounding box data have an intersection, since the visual depth of the third bounding box data is large, it means that the visual depth of the fifth bounding box data inside the third bounding box data space is also large, and the human eye has a low degree of perception of the lighting effect of the object at the fifth bounding box data, and there is no need to set the precision of the third light data to high precision. Therefore, when the precision of the third light data is adjusted for the second time, the precision of the third light data is adjusted to low precision.

[0092] In an embodiment of the present application, when adjusting the accuracy of the third light data for the first time, since it is unknown whether the third bounding box data and the third light data intersect, the accuracy of the third light data can only be adjusted by the parameters indicated by the third light data. When it is determined that there is an intersection between the third light data and the third bounding box data, the accuracy of the third light data can be adjusted again according to the parameters indicated by the third bounding box data, so that the third light data after the second accuracy adjustment is subjected to an intersection test with the bounding box data inside the third bounding box data space. In this way, not only the influence of the parameters of the light data itself is considered, but also the influence of the parameters of the bounding box data intersecting with the light data on the accuracy of the light data is considered, so that the accuracy of the light data during the intersection test can be configured more accurately.

[0093] In some possible implementations, after receiving the precision configuration information from the API interface, the second graphics processor 300B may perform one or more ray tracing calculations based on the precision configuration information. After the ray tracing calculation is completed, the second graphics processor 300B also sends the target image after the ray tracing calculation is completed to the API interface. Exemplarily, the intersection test unit is also used to output the result of the intersection test, and the result of the intersection test is used to generate the target image to be drawn for the ray tracing task. Exemplarily, the second shader 310B is used to generate the target image based on the result of the intersection test. In an embodiment of the present application, the intersection test unit outputs the result of the intersection test, which provides a basis for subsequent high-precision image drawing under limited power consumption.

[0094] Based on the above Figure 5 The second graphics processor 300B shown in FIG. 1 may execute the following steps: Figure 6 The data processing method shown includes the following steps:

[0095] S110: Obtain first data information corresponding to the ray tracing task, where the first data information includes at least one of the following data: a plurality of ray data with the same precision, a plurality of bounding box data with the same precision, and a plurality of surface metadata with the same precision.

[0096] S120: According to the precision configuration information, adjust the precision of at least one data in the first data information to obtain second data information, where the second data information includes at least one of the following data: multiple light data with different precisions, multiple bounding box data with different precisions, and multiple face metadata with different precisions.

[0097] S130: Perform an intersection test based on the second data information to obtain a result of the intersection test.

[0098] In some possible implementations, the at least one data includes first light data and second light data, and the precision of the adjusted first light data is different from the precision of the adjusted second light data. And / or, the at least one data includes first bounding box data and second bounding box data, and the precision of the adjusted first bounding box data is different from the precision of the adjusted second bounding box data. And / or, the at least one data includes first face metadata and second face metadata, and the precision of the adjusted first face metadata is different from the precision of the adjusted second face metadata.

[0099] In some possible implementations, the at least one data includes third ray data and third bounding box data, and the data processing method may further include: when the third ray data and the third bounding box data have an intersection, adjusting the accuracy of the third ray data again according to the accuracy configuration information.

[0100] In some possible implementations, before S110, the data processing method may further include: receiving the precision configuration information.

[0101] In some possible implementations, after S130, the data processing method may further include: outputting a result of the intersection test, where the result of the intersection test is used to generate a target image to be drawn by the ray tracing task.

[0102] The relevant contents of the precision configuration information can refer to the contents in the embodiment of the above-mentioned graphics processing device 2000, which will not be described in detail here. The memory 200 in the graphics processing device 2000 provided in the embodiment of the present application stores instructions, and when the processor 300 runs the instructions, the graphics processing device 2000 implements the various steps of the above-mentioned data processing method. Since the functions of the various hardware modules of the graphics processing device 2000 have been described in detail in the embodiment of the above-mentioned graphics processing device 2000, they will not be described in detail here.

[0103] Next, combine Figure 3 The graphics processing device 2000 and Figure 5 The various hardware modules of the second graphics processor 300B shown in FIG. 1 are used to illustrate possible implementation methods of the data processing method. Please refer to FIG. Figure 7 .

[0104] S210: Application sets precision configuration information. Exemplarily, the second graphics processor 300B is coupled to the CPU, and the application running on the CPU sets precision configuration information through an API interface, and sends the precision configuration information to a driver running on the second graphics processor 300B, and the precision configuration unit 31B in the second graphics processor 300B stores the precision configuration information in a register of the precision configuration unit 31B under the call of the driver.

[0105] S220: The second graphics processor 300B receives a ray tracing task.

[0106] S230: The second graphics processor 300B generates an acceleration structure.

[0107] Exemplarily, the second construction circuit in the second graphics processor 300B generates an acceleration structure, which may be a tree structure, and includes a plurality of bounding box data of the same precision and a plurality of face metadata of the same precision. Each of the plurality of bounding box data carries the LOD level of detail of the bounding box data and the position of the bounding box data in the scene, and each of the plurality of face metadata carries the LOD level of detail of the face metadata and the position of the face metadata in the scene. The second creation circuit 320B stores the acceleration structure in the memory 200.

[0108] S240: The second graphics processor 300B generates light data.

[0109] Exemplarily, the second shader 310B in the second graphics processor 300B generates a plurality of ray data with the same precision. Each ray data in the plurality of ray data carries the ray brightness and / or saturation of the ray data, and carries viewpoint information.

[0110] S250: The second graphics processor 300B obtains first data information.

[0111] Exemplarily, the second ray tracing processor 330B in the second graphics processor 300B obtains the acceleration structure from the memory 200 and stores the acceleration structure in the second cache 333B. The precision configuration unit 31B in the second graphics processor 300B obtains multiple rays of the same precision from the second shader 310B, and obtains multiple bounding box data of the same precision and multiple face metadata of the same precision from the second cache 333B. The precision configuration unit 31B determines the visual depth of the bounding box data based on the viewpoint information indicated by the ray data and the position of each bounding box data in the multiple bounding box data in the scene. The precision configuration unit 31B determines the visual depth of the face metadata based on the viewpoint information indicated by the ray data and the position of each face metadata in the multiple face metadata in the scene.

[0112] S260: The second graphics processor 300B adjusts the precision of at least one data in the first data information according to the precision configuration information to obtain second data information.

[0113] Exemplarily, the precision configuration unit 31B can determine the light data, bounding box data, or face data that need to be precision adjusted according to the precision configuration information, and can determine the adjusted precision range according to the precision configuration information. The precision configuration unit 31B can adjust the precision of only at least one of the multiple light data, or only at least one of the multiple bounding box data, or only at least one of the multiple face data. The embodiment of the present application takes the case where the precision of all three types of data needs to be adjusted as an example to illustrate the precision adjustment method indicated by the precision configuration information.

[0114] For example, if the brightness of the light data A is within a larger brightness range, the precision of the light data A is adjusted to high precision. If the brightness of the light data A is within a moderate brightness range, the precision of the light data A is adjusted to medium precision. If the brightness of the light data A is within a smaller brightness range, the precision of the light data A is adjusted to low precision. For another example, the first preset range includes fine and coarse LOD level fineness ranges, if the LOD level of the bounding box data B is fine, the precision of the bounding box data B is adjusted to high precision. If the LOD level of the bounding box data B is coarse, the precision of the bounding box data B is adjusted to low precision. For another example, the first preset range includes a larger visual depth range, a moderate visual depth range, and a lower visual depth range, if the visual depth of the bounding box data C is within a larger visual depth range, the precision of the bounding box data C is adjusted to high precision. If the visual depth of the bounding box data C is within a moderate visual depth range, the precision of the bounding box data C is adjusted to medium precision. If the visual depth of the bounding box data C is within a smaller visual depth range, the precision of the bounding box data C is adjusted to a low precision. Exemplarily, when adjusting the precision of the bounding box data and the face data, one of the LOD level fineness or the visual depth can be selected as the adjustment standard.

[0115] Exemplarily, after adjusting the data precision for the first time, the precision configuration unit 31B obtains second data information, where the second data information includes: a plurality of ray data with different precisions, a plurality of bounding box data with different precisions, and a plurality of face data with different precisions.

[0116] S270: The second graphics processor 300B performs an intersection test based on the second data information to obtain a result of the intersection test.

[0117] Exemplarily, the second traversal circuit 332B in the second graphics processor 300B obtains the acceleration structure from the second cache 333B and traverses the acceleration structure. When the second traversal circuit 332B traverses to the upper node bounding box data D, the bounding box data D is output to the bounding box intersection test unit 32B. The bounding box intersection test unit 32B obtains a plurality of light data after the first precision adjustment from the precision configuration unit 31B, performs a bounding box intersection test based on the plurality of light data after the first precision adjustment and the bounding box data D, and determines that there is an intersection between the bounding box data D and the light data E. The bounding box intersection test unit 32B outputs the intersection information of the bounding box data D and the light data E to the second traversal circuit 332B, and the second traversal circuit 332B traverses the internal nodes of the bounding box data D. The bounding box intersection test unit 32B notifies the precision configuration unit 31B that the bounding box data D and the light data E have an intersection, and the precision configuration unit 31B adjusts the precision of the light data E for the second time, and the second adjustment precision is adjusted according to the visual depth of the bounding box data D or the fineness of the LOD level. When the second traversal circuit 332B traverses to the bounding box data F of the internal node of the bounding box data D, the bounding box data F is output to the bounding box intersection test unit 32B. The bounding box intersection test unit 32B obtains the light data E after the second adjustment of precision from the precision configuration unit 31B, performs a bounding box intersection test based on the bounding box data F and the light data E after the second adjustment of precision, and determines that there is an intersection between the bounding box data F and the light data E. The bounding box intersection test unit 32B outputs the intersection information of the bounding box data F and the light data E to the second traversal circuit 332B, and the second traversal circuit 332B traverses the internal nodes of the bounding box data E. When the second traversal circuit 332B traverses to the internal node facet data G of the bounding box data E, the facet data G is output to the facet intersection test unit 33B. The facet intersection test unit 33B obtains the light data E after the second precision adjustment from the precision configuration unit 31B, performs facet intersection test based on the facet data G and the light data E after the second precision adjustment, and determines that there is an intersection between the facet data G and the light data E. The facet intersection test unit 33B outputs the intersection information of the facet data G and the light data E to the second traversal circuit 332B. In the above manner, all nodes of the light data E are traversed, and the intersection information of all facet data intersecting with the light data E is output to the second traversal circuit 332B, so that the second traversal circuit 332B determines the facet data with the smallest visual depth among all facet data intersecting with the light data E. In the above manner, the intersection test is performed on all the light data to obtain the result of the intersection test, wherein the result of the intersection test includes the intersection information of each light data and each facet data.

[0118] S280: The second graphics processor 300B outputs the result of the intersection test, and the result of the intersection test is used to generate the target image to be drawn by the ray tracing task. Exemplarily, the second traversal circuit 332B outputs the intersection information of each ray data and each face data to the second shader 310B, so that the second shader 310B performs subsequent processing. After the second shader 310B generates the target image according to the result of the intersection test, it sends the target image to the API interface through the driver.

[0119] The above main Figure 3 The graphics processing device 2000 shown in FIG. Figure 5 The hardware modules of the second graphics processor 300B shown in the figure, as well as the data processing method and functions thereof are introduced. In order to realize the above functions, the graphics processing device 2000 also includes software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the methods, structures and functions of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use software modules to implement the functions described by the above hardware modules for each specific application, but such implementation should not be considered to be beyond the scope of this application. Based on the following Figure 5 The second graphics processor 300B shown in the embodiment of the present application provides a software module that can be applied to the second graphics processor 300B. By way of example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The division of modules in the embodiment of the present application is schematic, which is only a logical function division. There may be other division methods in actual implementation. The software module is introduced below.

[0120] The present application also provides a data processing device, such as Figure 8 As shown, the data processing device 400 includes: a precision configuration unit 410 and an intersection test unit 420. The precision configuration unit 410 is used to obtain the first data information corresponding to the ray tracing task, and the first data information includes at least one of the following data: multiple ray data with the same precision, multiple bounding box data with the same precision, and multiple face metadata with the same precision. The precision configuration unit 410 is also used to adjust the precision of at least one data in the first data information according to the precision configuration information to obtain second data information, and the second data information includes at least one of the following data: multiple ray data with different precisions, multiple bounding box data with different precisions, and multiple face metadata with different precisions. The intersection test unit 420 is used to perform an intersection test based on the second data information to obtain a result of the intersection test.

[0121] In some possible implementations, the precision configuration information is used to indicate the at least one data.

[0122] In some possible embodiments, the precision configuration information includes a first preset range, and the parameters indicated by the at least one data are within the first preset range, wherein the parameters indicated by the light data include light brightness and / or saturation, the parameters indicated by the bounding box data include visual depth or LOD level fineness, and the parameters indicated by the face metadata include visual depth or LOD level fineness.

[0123] In some possible implementations, the precision configuration information is further used to indicate the adjusted precision range of each data in the at least one data.

[0124] In some possible implementations, the at least one data includes first light data and second light data, and the precision of the adjusted first light data is different from the precision of the adjusted second light data. And / or, the at least one data includes first bounding box data and second bounding box data, and the precision of the adjusted first bounding box data is different from the precision of the adjusted second bounding box data. And / or, the at least one data includes first face metadata and second face metadata, and the precision of the adjusted first face metadata is different from the precision of the adjusted second face metadata.

[0125] In some possible implementations, the at least one data includes third ray data and third bounding box data. The precision configuration unit 410 is further configured to adjust the precision of the third ray data according to the precision configuration information when there is an intersection between the third ray data and the third bounding box data.

[0126] In some possible implementations, the precision configuration information includes a second preset range, and the parameters indicated by the third bounding box data are within the second preset range, wherein the parameters indicated by the third bounding box data include visual depth or LOD level of refinement.

[0127] In some possible implementations, the precision configuration unit 410 is further configured to receive precision configuration information.

[0128] In some possible implementations, the intersection test unit 420 is further configured to output a result of the intersection test, and the result of the intersection test is used to generate a target image to be drawn by a ray tracing task.

[0129] It is understandable that the various functional modules of the above-mentioned data processing device 400 can be operated on Figure 5The above method embodiment is executed on each hardware module of the second ray tracing processor 330B of the second graphics processor 300B shown. Since the functions of each hardware module of the second graphics processor 300B have been described in detail in the aforementioned embodiment of the second graphics processor 300B, they will not be repeated here.

[0130] An embodiment of the present application also provides a computer-readable storage medium, which stores program code. When the computer-readable storage medium is run on a device (for example, the device may be a single-chip microcomputer, a chip, a computer or a processor, etc.), the program code therein may be called by the processor to execute one or more steps in the above method embodiment.

[0131] Based on this understanding, the embodiments of the present application also provide a computer program product comprising instructions. The essence of the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor therein to execute all or part of the steps of the methods described in the embodiments of the present application.

[0132] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method, It is characterized in that The method comprises: Acquire first data information corresponding to the ray tracing task, where the first data information includes at least one of the following data: a plurality of ray data with the same precision, a plurality of bounding box data with the same precision, and a plurality of face data with the same precision; According to the precision configuration information, adjust the precision of at least one data in the first data information to obtain second data information, where the second data information includes at least one of the following data: a plurality of light data with different precisions, a plurality of bounding box data with different precisions, and a plurality of face data with different precisions; An intersection test is performed based on the second data information to obtain a result of the intersection test.

2. The method according to claim 1, It is characterized in that The precision configuration information is used to indicate the at least one data.

3. The method according to claim 2, It is characterized in that The precision configuration information includes a first preset range, and the parameters indicated by the at least one data are within the first preset range, wherein the parameters indicated by the light data include light brightness and / or saturation, the parameters indicated by the bounding box data include visual depth or LOD level fineness, and the parameters indicated by the face metadata include visual depth or LOD level fineness.

4. The method according to any one of claims 1 to 3, It is characterized in that The precision configuration information is also used to indicate the adjusted precision range of each data in the at least one data.

5. The method according to any one of claims 1 to 4, It is characterized in that The at least one data includes first light data and second light data, and the adjusted precision of the first light data is different from the adjusted precision of the second light data; and / or, The at least one data includes first bounding box data and second bounding box data, and the adjusted precision of the first bounding box data is different from the adjusted precision of the second bounding box data; and / or, The at least one data includes first facet data and second facet data, and the adjusted precision of the first facet data is different from the adjusted precision of the second facet data.

6. The method according to any one of claims 1 to 5, It is characterized in that The at least one data includes third ray data and third bounding box data; the method further includes: When the third ray data and the third bounding box data have an intersection, the precision of the third ray data is adjusted again according to the precision configuration information.

7. The method according to claim 6, It is characterized in that The precision configuration information includes a second preset range, and the parameters indicated by the third bounding box data are located in the second preset range, wherein the parameters indicated by the third bounding box data include visual depth or LOD level of detail.

8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: The precision configuration information is received.

9. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: The result of the intersection test is output, and the result of the intersection test is used to generate a target image to be drawn by the ray tracing task.

10. A data processing device, It is characterized in that The device comprises: A precision configuration unit, configured to obtain first data information corresponding to a ray tracing task, wherein the first data information includes at least one of the following data: a plurality of ray data of the same precision, a plurality of bounding box data of the same precision, and a plurality of face data of the same precision; The precision configuration unit is further used to adjust the precision of at least one data in the first data information according to the precision configuration information to obtain second data information, wherein the second data information includes at least one of the following data: a plurality of light data with different precisions, a plurality of bounding box data with different precisions, and a plurality of face data with different precisions; An intersection test unit is used to perform an intersection test based on the second data information to obtain a result of the intersection test.

11. The device according to claim 10, It is characterized in that The precision configuration information is used to indicate the at least one data.

12. The device according to claim 11, It is characterized in that The precision configuration information includes a first preset range, and the parameters indicated by the at least one data are within the first preset range, wherein the parameters indicated by the light data include light brightness and / or saturation, the parameters indicated by the bounding box data include visual depth or LOD level fineness, and the parameters indicated by the face metadata include visual depth or LOD level fineness.

13. The device according to any one of claims 10 to 12, It is characterized in that The precision configuration information is also used to indicate the adjusted precision range of each data in the at least one data.

14. The device according to any one of claims 10 to 13, It is characterized in that The at least one data includes first light data and second light data, and the adjusted precision of the first light data is different from the adjusted precision of the second light data; and / or, The at least one data includes first bounding box data and second bounding box data, and the adjusted precision of the first bounding box data is different from the adjusted precision of the second bounding box data; and / or, The at least one data includes first facet data and second facet data, and the adjusted precision of the first facet data is different from the adjusted precision of the second facet data.

15. The device according to any one of claims 10 to 14, It is characterized in that The at least one data includes third ray data and third bounding box data; The precision configuration unit is further configured to adjust the precision of the third ray data again according to the precision configuration information when there is an intersection between the third ray data and the third bounding box data.

16. The device according to claim 15, It is characterized in that The precision configuration information includes a second preset range, and the parameters indicated by the third bounding box data are located in the second preset range, wherein the parameters indicated by the third bounding box data include visual depth or LOD level of refinement.

17. The device according to any one of claims 10 to 16, It is characterized in that The precision configuration unit is further used to receive the precision configuration information.

18. The device according to any one of claims 10 to 16, It is characterized in that The intersection test unit is further used to output the result of the intersection test, and the result of the intersection test is used to generate the target image to be drawn by the ray tracing task.

19. A graphics processor, It is characterized in that The graphics processor includes: a coupled shader and a ray tracing processor, the ray tracing processor is a data processing device as described in any one of claims 10-18, and the shader is used to generate a target image to be drawn by the ray tracing task according to the result of the intersection test.

20. A graphics processing device, It is characterized in that The device comprises: a processor and a memory, wherein instructions are stored in the memory, and when the processor executes the instructions, the graphics processing device implements the method according to any one of claims 1 to 9.

21. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method as claimed in any one of claims 1 to 9.