Ray tracing debugging methods, devices, equipment and media
By recording and replacing device addresses in the ray tracing application, the debugging flexibility issue caused by differences in hardware platform configurations is resolved, enabling automated device address replacement and improving debugging efficiency and hardware verification speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- RICUN TECH (SHANGHAI) CO LTD
- Filing Date
- 2026-06-10
- Publication Date
- 2026-07-31
AI Technical Summary
When debugging ray tracing applications, different hardware platforms have different device address configuration methods, resulting in poor debugging flexibility and a large consumption of human resources.
By recording the device address and cached data of the ray tracing application running on the first hardware platform and replacing it with a device address that can be used on the second hardware platform, automated device address replacement is achieved, reducing the consumption of human resources.
It enables flexible configuration of device addresses on different hardware platforms, improving debugging efficiency, reducing manpower consumption, and accelerating hardware verification and iteration.
Smart Images

Figure CN122489448A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of ray tracing technology, and in particular relates to a ray tracing debugging method, apparatus, equipment and medium. Background Technology
[0002] With the development of hardware technology, graphics processing units (GPUs) can integrate various functional modules, such as ray tracing modules. Ray tracing modules and various shaders are used to render graphics and obtain rendered images.
[0003] To obtain high-quality rendered images or ensure the proper functioning of the ray tracing module, the ray tracing application needs to be debugged when debugging the GPU. However, during the debugging process, different hardware platforms use different methods for configuring device addresses to improve debugging efficiency, resulting in poor debugging flexibility and requiring manual configuration of device addresses, which consumes a lot of manpower. Summary of the Invention
[0004] This application provides a method, apparatus, device, medium, and product for debugging ray tracing, in order to solve the problems of poor debugging flexibility and high manpower consumption.
[0005] A first aspect of this application provides a method for debugging ray tracing, including: Obtain the sequence of interface calls required for the first hardware platform to run the ray tracing application; Based on the interface call sequence, determine and record the device address of each ray tracing interface in the interface call sequence, the cache data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application; During the debugging of the ray tracing application on the second hardware platform based on the rendering results, the device addresses of each ray tracing interface are adjusted to new addresses, and the cached data is added to the new addresses. The first hardware platform is different from the second hardware platform, and the new addresses are addresses that the second hardware platform can call.
[0006] A second aspect of this application provides a ray tracing debugging apparatus, comprising: The interface call sequence acquisition module is used to acquire the interface call sequence required by the first hardware platform to run the ray tracing application; The data determination module is used to determine and record, based on the interface call sequence, the device address of each ray tracing interface in the interface call sequence, the cached data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application; The execution module is used to adjust the device addresses of each ray tracing interface to a new address and add the cached data to the new address during the debugging of the ray tracing application based on the rendering results on the second hardware platform. The first hardware platform is different from the second hardware platform, and the new address is an address that the second hardware platform can call.
[0007] A third aspect of the present application provides an electronic device, the electronic device comprising: a memory and a program or instructions stored in the memory and executable on a processor, wherein when the program or instructions are executed by the processor, they implement the ray tracing debugging method provided in any of the above-described embodiments of the present application.
[0008] A fourth aspect of this application provides a computer-readable storage medium, which is a non-volatile or non-transient storage medium, having a computer program thereon, wherein the computer program, when run by a processor, executes the steps of the ray tracing debugging method provided in any aspect of this application.
[0009] A fifth aspect of the embodiments of this application provides a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform a ray tracing debugging method as provided in any aspect of the embodiments of this application described above.
[0010] The ray tracing debugging method provided in this application embodiment obtains the interface call sequence required by the first hardware platform to run the ray tracing application. Based on the interface call sequence, the device address of each ray tracing interface in the interface call sequence, the cached data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application are determined and recorded. During the debugging of the ray tracing application on the second hardware platform based on the rendering result, the device address of each ray tracing interface is adjusted to a new address, and the cached data is added to the new address. The first hardware platform and the second hardware platform are different. This application embodiment achieves automated device address replacement and flexible device address configuration by recording the device address and cached data used by the first hardware platform capable of running the ray tracing application when running the ray tracing application, and replacing the device address and cached data with device addresses usable by the second hardware platform. This reduces manpower consumption. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic flowchart illustrating a ray tracing debugging method provided in one embodiment of this application; Figure 2 A flowchart illustrating the ray tracing debugging method provided in Embodiment 1 of this application; Figure 3 This is a flowchart illustrating the ray tracing debugging method provided in Embodiment 2 of this application; Figure 4 A schematic diagram of the structure of a ray tracing debugging device provided in one embodiment of this application; Figure 5 This is a schematic diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0013] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0014] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0015] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations. In the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0016] Ray tracing tasks can occur in various scenarios, including, for example, games and graphics software. To improve the execution efficiency of ray tracing tasks and the computational efficiency of shaders for different types of objects, device addresses related to the hardware platform running the ray tracing application can be used in the ray tracing application, and hardware platform-related device addresses can be used in the shader binding table. This enables the ray tracing application and driver to efficiently call and execute the ray tracing interface.
[0017] However, due to the differences in device address implementation methods across different hardware platforms, and the fact that debugging software does not support the recording and debugging of ray tracing applications, device addresses currently require manual configuration, which is inflexible and consequently affects the debugging progress of ray tracing applications.
[0018] The technical solution of this application addresses the problem that manual configuration of device addresses is inflexible and thus affects the debugging progress of ray tracing applications. It proposes a ray tracing debugging method. The embodiments of this application record the device address and cache data used by the first hardware platform that can run the ray tracing application when running the ray tracing application, and replace the device address and cache data with the device address that can be used by the second hardware platform. This realizes automated device address replacement, flexible configuration of device addresses, and reduces human resource consumption.
[0019] Specifically, embodiments of this application provide a method, apparatus, device, medium, and product for debugging ray tracing. First, the debugging method for ray tracing provided in this application embodiment will be introduced. The executing entity of the ray tracing debugging method in this application embodiment can be any electronic device. This electronic device can be a device capable of data interaction with various hardware platforms, and the hardware platform can be a platform capable of running ray tracing applications. For example, the hardware platform can be a graphics card including a graphics processor.
[0020] Figure 1 A flowchart illustrating a ray tracing debugging method according to an embodiment of this application is shown. Figure 1 As shown, the method includes steps S101 to S105.
[0021] S101, Obtain the sequence of interface calls required for the first hardware platform to run the ray tracing application.
[0022] S102, based on the interface call sequence, determine and record the device address of each ray tracing interface in the interface call sequence, the cache data of each device address, and the rendering results obtained by the first hardware platform running the ray tracing application.
[0023] S103, during the process of debugging the ray tracing application based on the rendering results on the second hardware platform, adjusts the device address of each ray tracing interface to a new address and adds the cached data to the new address.
[0024] In this embodiment, the interface call sequence required for the first hardware platform to run the ray tracing application is obtained. Based on the interface call sequence, the device address of each ray tracing interface in the interface call sequence, the cached data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application are determined and recorded. During the debugging of the ray tracing application on the second hardware platform based on the rendering result, the device address of each ray tracing interface is adjusted to a newly created address, and the cached data is added to the newly created address. The first hardware platform differs from the second hardware platform; the newly created address is an address that the second hardware platform can call. This embodiment records the device address and cached data used by the first hardware platform capable of running the ray tracing application when running the application, and replaces the device address and cached data with device addresses that the second hardware platform can use, thereby achieving automated device address replacement, flexible device address configuration, and reduced manpower consumption.
[0025] For S101, the first hardware platform can be a hardware platform that can directly run the ray tracing application without device address adjustment. The ray tracing application can be any application that performs ray tracing tasks; for example, it can be a rendering program. The interface call sequence can include the types of interfaces called by the hardware platform to run the ray tracing application and the order in which these interfaces are called. Examples include shader binding table interfaces and ray tracing interfaces. The ray tracing interface is a drawing interface used to implement ray emission, collision and intersection calculation, reflection calculation, and shadow calculation. The interface call sequence can be obtained by parsing the interface definitions in a specific interface or platform specification. The interface call sequence may also include interface identifiers to distinguish different interfaces.
[0026] For S102, since the first hardware platform can directly run the ray tracing application, the device address obtained at this time is the device address associated with the first hardware platform. This cached data contains various types of data required for scene rendering when the first hardware platform runs the ray tracing application. For example, the cached data may include the bounding boxes of primitive triangles constituting various scenes, triangle indices, vertex references, sub-level addresses, etc. The more complex the scene, the more primitives, the more complex the acceleration structure, and the more shaders used in the ray tracing pipeline, the better the rendering effect, but the greater the difficulty of verification and debugging.
[0027] It is understandable that this cached data may also include device addresses, although these device addresses may differ from those in the aforementioned ray tracing interface. Subsequent address replacements can also replace the device addresses within the cached data.
[0028] The rendering result can be understood as the execution result of the ray tracing application. The execution result can be the ray-traced scene rendered. For example, the rendering result can be various rendered scene images, etc.
[0029] In this embodiment of the application, by recording the behavior of the first hardware platform when running the ray tracing application, it is convenient to perform address adjustment operations later.
[0030] For S103, the first hardware platform and the second hardware platform are different, therefore, their device addresses differ, necessitating device address adjustment. This newly created address can be a device address related to the second hardware platform, or simply an address that the second hardware platform can call. Therefore, after the device address is adjusted, the second hardware platform can directly call this newly created address. Since the device address has been adjusted, to ensure the second hardware platform can correctly retrieve the corresponding cached data when using this newly created address later, the cached data can also be added to the newly created address.
[0031] In some embodiments, the ray tracing application can be debugged in a simulation platform; therefore, the second hardware platform can be a simulation platform. Of course, the second hardware platform can also be a non-simulation platform that actually performs the ray tracing task, and this application embodiment does not impose any limitations on this.
[0032] In this embodiment, the behavior of large software is recorded on a mature hardware platform, and then replayed and the results are compared in a simulation platform. This enables the design verification and debugging of new hardware, improves the iteration speed, and ensures normal functionality.
[0033] For application and driver developers, recording the problems encountered in the sequence of interface calls can improve the targeting and efficiency of debugging by replaying the calls multiple times.
[0034] Understandably, during the debugging of the ray tracing application on the second hardware platform, each interface can be called according to the interface call sequence. If it is determined that the currently called interface is a ray tracing interface, the device address of that ray tracing interface can be adjusted to a new address, and cached data can be added to this new address. Since this new address is an address that the second hardware platform can directly call, the second hardware platform can call the interface with the adjusted address to execute ray tracing tasks, thereby enabling debugging of the ray tracing application based on the rendering results.
[0035] It's important to note that when designing, developing, and verifying new hardware, functional debugging and verification can be performed on a simulation platform. Verification can include Compatibility Test Suite (CTS), Hardware Lab Kit (HLK), Software Development Kit (SDK) test suites, existing mainstream large-scale benchmarks, AAA games, design software, etc. Because simulation platforms struggle to use existing device addresses, it's difficult to use their recording, playback, and debugging tools for verifying ray tracing applications. CTS is an automated testing framework provided by industry standards organizations or platform vendors to verify whether hardware conforms to the compatibility specifications of a specific interface or platform, ensuring that applications within the ecosystem can run consistently across devices. HLK is a hardware compatibility testing and certification framework used to verify whether hardware platforms and drivers conform to the specifications of a specific operating system. An SDK is a complete set of development tools provided by platform vendors or interface organizations, including library files, header files, compilers, etc., used to simplify application development for a specific platform or interface.
[0036] In this embodiment of the application, the device address adjustment operation enables the simulation platform to use the adjusted device address, thereby allowing the ray tracing application to be debugged.
[0037] In some embodiments, in S102, to facilitate subsequent device address adjustments and enable the second hardware platform to adjust the ray tracing application, the device addresses used in the ray tracing process can be determined first. For example, during the execution of the ray tracing application on the first hardware platform, the device addresses of each ray tracing interface in the interface call sequence called by the ray tracing application and the cached data of each device address can be determined and recorded; each ray tracing interface can then be called to obtain the rendering result.
[0038] Since the device address is used during the running of the ray tracing application, in order to obtain the device address, the device address of each ray tracing interface can be obtained when the ray tracing application is running on the first hardware platform and each interface is called in the order of the interface call sequence.
[0039] Since the device addresses are used, it can be understood as calling the cached data stored at each device address to perform ray tracing tasks. Therefore, the cached data of each device address can also be obtained.
[0040] In some embodiments, to determine whether the first hardware platform has invoked each interface, a recording tool can be used to capture the interface call requests. The recording tool can be any module capable of capturing interface call requests.
[0041] When the recording tool captures the API call request, it can identify and record the device address of each ray tracing interface and the cached data of each device address.
[0042] After that, the first hardware platform can call the various interfaces to obtain the rendering results.
[0043] In this embodiment of the application, during the running of the ray tracing application, requests to call the ray tracing interface are dynamically captured so as to record the device address and save the cached data before executing the ray tracing task through the ray tracing interface, so as to facilitate the subsequent automatic adjustment of the device address.
[0044] In some embodiments, when determining and recording the device address of each ray tracing interface in the interface call sequence and the cached data of each device address, the device address of each interface in the interface call sequence called by the ray tracing application can typically be determined and recorded; the device address of each ray tracing interface can be retrieved and recorded from the device address of each interface based on the interface identifier of each interface; and the cached data of each ray tracing interface can be determined and recorded based on the device address of each ray tracing interface.
[0045] Understandably, the device addresses of each interface in the API call sequence can be obtained first. Then, when the recording tool captures an API call request, it can determine that the current API call request is for a ray tracing interface based on the interface identifier of the requested interface. Then, by using the interface identifier of each interface, the device address of the ray tracing interface can be retrieved from the device addresses of each interface, and the cached data of the device address of the ray tracing interface can be determined and recorded.
[0046] In some embodiments, the interface identifier is an identifier that represents the interface type and can be used to distinguish between the interface type and the interface itself. For example, the interface identifier can be the interface name. For example, the interface name can be Ray Tracing Interface 1, Ray Tracing Interface 2, Shader Binding Table Interface 1, Shader Binding Table Interface 2, etc.
[0047] Since interface identifiers can be used to distinguish interface types, the device addresses of all interface types can be searched based on the interface identifiers of each interface to obtain the device address of the currently invoked interface, indicating that the interface type is a ray tracing interface. Then, the content stored in the device address of this ray tracing interface can be retrieved to obtain the cached data of the ray tracing interface's device address.
[0048] It is understood that in the embodiments of this application, the device address of each interface can be recorded without distinguishing the interface type, and then the device address and cache data of each ray tracing interface can be obtained from the recorded device addresses of each interface according to the interface type.
[0049] In this embodiment, the device address of each interface is recorded first, and then the interface type is determined by the interface identifier, thereby obtaining the device address and cached data of the ray tracing interface, which improves the efficiency of obtaining the device address and cached data of the ray tracing interface.
[0050] In some embodiments, it is not necessary to record the device addresses of each interface in the interface call sequence in advance. When calling a certain interface, if the interface is determined to be a ray tracing interface based on the interface identifier of the called interface, the device address of the ray tracing interface and the cache data of each device address can be obtained and recorded.
[0051] In this embodiment, the interface type is identified by the interface identifier. When the interface type is ray tracing interface, the device address and cached data of the interface are recorded. It is not necessary to record the device addresses of all interfaces, which can reduce the amount of data recorded and save computing resources.
[0052] Before executing S103, in order to improve the efficiency of device address adjustment, a mapping relationship between the device address of each ray tracing interface and the newly created address can be established.
[0053] To facilitate the identification of each device address and its corresponding new address for subsequent replacement operations, a mapping relationship between the device address and the new address of each ray tracing interface can be established before address adjustment. This mapping relationship indicates a one-to-one correspondence between the device address and the new address, which facilitates subsequent address adjustments.
[0054] It should be noted that since the cached data can also include device addresses, a mapping relationship can be established between the newly created address and the device address in the cached data of the ray tracing interface.
[0055] In this embodiment of the application, by pre-establishing a mapping relationship, when performing address replacement operations in the future, the newly created address mapped to each device address can be determined directly through this mapping relationship, thereby improving the efficiency of device address adjustment.
[0056] In some embodiments, when executing S103, the newly created address mapped to the device address of each ray tracing interface can be determined according to the mapping relationship between the newly created address and the device address; and the device address of each ray tracing interface can be replaced with the newly created address.
[0057] During the debugging of ray tracing applications on the second hardware platform, before calling the ray tracing interface, the device address of the ray tracing interface can be replaced with a newly created address mapped to that device address. Since this newly created address is associated with the second hardware platform, it can use this newly created address to call the ray tracing interface subsequently.
[0058] In this embodiment of the application, a new address associated with the device address of the ray tracing interface is found through the mapping relationship, thereby improving the address lookup efficiency and thus improving the address replacement efficiency.
[0059] In some embodiments, when performing S103, an unused new address may be identified among the newly created addresses, and the cached data of the device address that has not been replaced may be stored in the unused new address.
[0060] In this embodiment of the application, there is no need to establish a mapping relationship, so as to improve the convenience of address replacement.
[0061] In some embodiments, during the execution of S103, the second hardware platform, in the process of debugging the ray tracing application based on the rendering results, involves a playback operation of the rendering results. By playing back the rendering results, relevant technicians can easily identify the adjustable parts in the process of executing the ray tracing application and obtaining the rendering results, so as to debug the ray tracing application and obtain higher quality rendering results based on the debugged ray tracing application. Here, playback can be understood as reproducing the process of obtaining the rendering results.
[0062] In order to enable the second hardware platform to correctly replay the rendering result, during the debugging of the ray tracing application on the second hardware platform based on the rendering result, when the ray tracing application calls each interface in the call sequence, the device address of each ray tracing interface is adjusted to a new address, and the cached data is added to the new address.
[0063] For example, during playback, the playback tool can specifically replay the interface call sequence and cached data recorded by the recording tool. Then, during the debugging of the ray tracing application on the second hardware platform, each interface is called according to the call order in the interface call sequence. The playback tool can be an engine in the second hardware platform that implements the playback interface call sequence and playback cached data.
[0064] Specifically, based on the interface definition in the specific interface or platform specification, the recorded device address and cached data can be parsed, and then the device address can be replaced and the cached data can be copied.
[0065] For example, the interface definition may include the parameters required by the interface, parameter types, usage rules, etc.
[0066] When the interface being called is determined to be a ray tracing interface based on the interface identifier, in order for the second hardware platform to call the ray tracing interface normally, all recorded device addresses can be retrieved to obtain the device address of the ray tracing interface. The cached data for this device address is then retrieved from the recorded cached data. The device address of the ray tracing interface is adjusted to a newly created address related to the second hardware platform, and the cached data for this device address is copied to the newly created address.
[0067] In some embodiments, during the debugging process, the ray tracing application can be debugged by replaying the rendering results and then using the data generated during the playback process.
[0068] For example, based on the cached data in the newly created address, the rendering result is replayed on the second hardware platform to obtain the playback result; based on the playback result and the rendering result, the ray tracing application is debugged.
[0069] When the ray tracing interface is called on the second hardware platform, it can be automatically changed to call the cached data in the newly created address, realizing automatic adaptation to various hardware platforms, and finally obtaining the playback result. By comparing the playback result and the rendering result, the ray tracing application can be debugged.
[0070] In some embodiments, the second hardware platform can read various shaders included in the cached data in the newly created address to generate rays emitted from the camera. Based on the bounding boxes of all objects in the scene included in the cached data and the generated rays, the object that the rays collide with is determined; for example, the object could be a chair. Furthermore, based on the triangle index included in the cached data, the object that the rays collide with can be further identified as the chair's seat triangle, obtaining a precise collision point. Finally, by reading the texture and shader cache in the cached data and combining the collision point, the color of the rays is determined, thereby obtaining a rendered image, which is the playback result.
[0071] When debugging a ray tracing application, you can compare the rendered image with the actual rendering result and adjust the ray tracing application accordingly.
[0072] For example, if the difference is a difference in color before and after playback, it indicates a problem with the acceleration structure built by the ray tracing application, and the code segment used to build the acceleration structure in the ray tracing application can be adjusted. It can also indicate a problem with the cached data itself; therefore, the cached data in the newly created address called by the ray tracing application can also be modified.
[0073] In this embodiment of the application, by performing an address replacement operation during playback, a new address that can be called by the second hardware platform is obtained, thereby realizing automated address adaptation of the ray tracing application and enabling debugging of the ray tracing application on various hardware platforms.
[0074] In this embodiment, address substitution enables playback and debugging on different manufacturers and hardware platforms, facilitating application development, driver debugging, and hardware verification, and improving work efficiency. In particular, it enhances the design and verification efficiency of new hardware from graphics processor and chip design manufacturers, ensuring functional verification and accelerating iteration speed.
[0075] In some embodiments, before adjusting the device address of each ray tracing interface to the new address, the new address can be determined first. The new address is obtained by: constructing a new cache region; determining and saving the new address of the new cache region.
[0076] The newly created cache region can be any newly created cache region accessible to the second hardware platform.
[0077] To ensure that ray tracing scenes of the application can be correctly replayed on different hardware platforms, some device addresses required by the ray tracing interface can be saved. These device addresses can be newly created so that the playback tool can be supported to complete the playback work on different hardware platforms.
[0078] In this embodiment of the application, by setting the newly created cache area corresponding to the newly created address as an area accessible to the second hardware platform, the second statement platform can access the cached data cached in the newly created address after subsequent address replacement.
[0079] Figure 2 This diagram illustrates a flowchart of the ray tracing debugging method provided in Embodiment 1 of this application. Embodiment 1 is a further refinement of step S102, based on one or more of the above embodiments. Figure 2 As shown, the method includes steps S201 to S206.
[0080] S201, record the interface and parameters.
[0081] The interface may include various interfaces in the interface call sequence, and the parameters may include parameters such as the size of the cached data of the interface. The embodiments of this application do not limit the number and type of such parameters.
[0082] S202, records all device addresses.
[0083] In this embodiment of the application, the device address includes device addresses for various interfaces.
[0084] To save the cached data corresponding to the device addresses of the ray tracing interfaces, a logging tool can be used to record the device addresses of all interfaces. This allows for quick retrieval and matching of the cached data for the ray tracing interfaces based on the recorded device addresses, and then saving the data.
[0085] S203, determine whether it is a ray tracing interface. If yes, execute S204~S206. If no, execute S206.
[0086] S204, retrieve the cached data corresponding to the device address.
[0087] If the interface being called by the first hardware platform is determined to be the ray tracing interface, in order for the second hardware platform to debug the ray tracing application later, the cached data corresponding to the device address of the currently called interface can be retrieved first.
[0088] S205, save cached data.
[0089] S206, Invoke the interface.
[0090] If the currently invoked interface is not a ray tracing interface or the device address and cached data of the ray tracing interface have already been stored, the first hardware platform can invoke the current interface to execute the ray tracing task.
[0091] Figure 3 A flowchart illustrating the ray tracing debugging method provided in Embodiment 2 of this application is shown. Embodiment 2 is a further refinement of step S103, based on one or more of the above embodiments. Figure 3 As shown, the method includes steps S301 to S307.
[0092] S301, sequentially reads the recorded interfaces and parameters.
[0093] In this embodiment of the application, the interface and parameters recorded by the recording tool are read sequentially. The interface may include interfaces and parameters of various interface types.
[0094] S302, save all newly created device addresses and establish a mapping relationship with the recorded device addresses.
[0095] In this embodiment, the newly created device address can be understood as a newly created address, which is a device address accessible by the second hardware platform. When establishing the mapping relationship, a mapping relationship can be established between the newly created address and the device address of the ray tracing interface, and a mapping relationship can also be established between the newly created address and the device address in the cached data of the ray tracing interface.
[0096] S303: Determine if it is a ray tracing interface. If yes, execute S304~S307. If no, execute S307.
[0097] In this embodiment of the application, it can be determined whether the interface currently called by the second hardware platform is a ray tracing interface.
[0098] S304, retrieve the cached data corresponding to the device address.
[0099] In this embodiment of the application, when the currently invoked interface is a ray tracing interface, the cached data corresponding to the device address of the ray tracing interface in each recorded interface is retrieved.
[0100] S305, replace with the newly created address according to the mapping relationship.
[0101] In this embodiment of the application, in order to correctly replay ray tracing scenes on different hardware platforms, the device address of the ray tracing interface can be replaced during the playback process.
[0102] Specifically, based on the previously established device address mapping relationship, the portion of the cached data containing the device address can be replaced with the newly mapped address, and the device address of the ray tracing interface can be replaced with the newly mapped address.
[0103] S306, copy the recorded cached data to the newly created address.
[0104] In this embodiment of the application, the cached data saved by the recording tool can also be copied to a newly created address.
[0105] S307, call the interface.
[0106] If the currently called interface is not a ray tracing interface or if S304~S306 has already been executed, the second hardware platform can call the current interface to replay the rendering results in order to debug the ray tracing application.
[0107] This application also provides specific embodiments of a ray tracing debugging apparatus.
[0108] like Figure 4 As shown, the ray tracing debugging device 400 provided in this application embodiment includes an interface call sequence acquisition module 402, a data determination module 404, and an execution module 406.
[0109] The interface call sequence acquisition module 402 is used to acquire the interface call sequence required by the first hardware platform to run the ray tracing application. The data determination module 404 is used to determine and record, based on the interface call sequence, the device address of each ray tracing interface in the interface call sequence, the cache data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application; The execution module 406 is used to adjust the device address of each ray tracing interface to a new address and add the cached data to the new address during the debugging of the ray tracing application based on the rendering results on the second hardware platform. The first hardware platform is different from the second hardware platform, and the new address is an address that the second hardware platform can call.
[0110] As an optional embodiment, the data determination module 404 includes: The first data determination module is used to determine and record the device address of each ray tracing interface in the interface call sequence called by the ray tracing application and the cache data of each device address during the process of running the ray tracing application on the first hardware platform. The second data determination module is used to call each of the ray tracing interfaces to obtain the rendering results.
[0111] As an optional embodiment, the first data determination module includes: The device address recording module is used to determine and record the device address of each interface in the interface call sequence called by the ray tracing application; The retrieval module is used to retrieve and record the device address of each ray tracing interface from the device address of each interface according to the interface identifier of each interface; The cache data recording module is used to determine and record the cache data of each ray tracing interface according to the device address of each ray tracing interface.
[0112] As an optional embodiment, the apparatus further includes: The mapping relationship establishment module is used to establish a mapping relationship between the device address and the newly created address of each ray tracing interface before adjusting the device address of each ray tracing interface to the newly created address.
[0113] As an optional embodiment, execution module 406 includes a data adjustment module, which includes: The new address determination module is used to determine the new address mapped to the device address of each of the ray tracing interfaces based on the mapping relationship between the new address and the device address. The replacement module is used to replace the device address of each of the ray tracing interfaces with the newly created address.
[0114] As an optional embodiment, the apparatus further includes: The playback result determination module is used to replay the rendering result in the second hardware platform based on the cached data of the newly created address to obtain the playback result; The debugging module is used to debug the ray tracing application based on the playback results and the rendering results.
[0115] As an optional embodiment, the apparatus further includes: The new cache region construction module is used to build new cache regions; The save module is used to determine and save the new address of the newly created cache area.
[0116] Figure 5 This is a schematic diagram of the structure of an electronic device 10 provided in an embodiment of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0117] like Figure 5 As shown, the electronic device 10 includes at least one graphics processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one graphics processor 11. The memory stores computer programs executable by the at least one graphics processor. The graphics processor 11 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 12 or loaded from the storage unit 18 into the random access memory 13. The random access memory 13 can also store various programs and data required for the operation of the electronic device 10. The graphics processor 11, the read-only memory 12, and the random access memory 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0118] Multiple components in electronic device 10 are connected to input / output interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0119] The graphics processor 11 can be any dedicated graphics processing component with processing and computing capabilities. The graphics processor 11 performs the various methods and processes described above, such as ray tracing debugging methods.
[0120] In some embodiments, the ray tracing debugging method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via read-only memory 12 and / or communication unit 19. When the computer program is loaded into random access memory 13 and executed by graphics processor 11, one or more steps of the ray tracing debugging method described above can be performed. Alternatively, in other embodiments, graphics processor 11 can be configured to perform the ray tracing debugging method by any other suitable means (e.g., by means of firmware).
[0121] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implementation in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable graphics processor, which may be an application-specific programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the graphics processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the graphics processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory, erasable programmable read-only memory (flash memory or erasable programmable read-only memory, EPROM), optical fibers, compact disc read-only memory (CD ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0125] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the Internet.
[0126] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0127] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0128] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for debugging ray tracing, characterized in that, The method includes: Obtain the sequence of interface calls required for the first hardware platform to run the ray tracing application; Based on the interface call sequence, determine and record the device address of each ray tracing interface in the interface call sequence, the cache data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application; During the debugging of the ray tracing application on the second hardware platform based on the rendering results, the device addresses of each ray tracing interface are adjusted to new addresses, and the cached data is added to the new addresses. The first hardware platform is different from the second hardware platform, and the new addresses are addresses that the second hardware platform can call.
2. The ray tracing debugging method as described in claim 1, characterized in that, Based on the interface call sequence, determine and record the device address of each ray tracing interface in the interface call sequence, the cached data of each device address, and the rendering results obtained by the first hardware platform running the ray tracing application, including: During the running of the ray tracing application on the first hardware platform, the device address of each ray tracing interface in the interface call sequence called by the ray tracing application and the cache data of each device address are determined and recorded; Call the respective ray tracing interfaces to obtain the rendering results.
3. The ray tracing debugging method as described in claim 2, characterized in that, Determine and record the device address of each ray tracing interface in the interface call sequence called by the ray tracing application and the cached data of each device address, including: Identify and record the device address of each interface in the interface call sequence called by the ray tracing application; Based on the interface identifier of each interface, retrieve and record the device address of each ray tracing interface from the device address of each interface; Based on the device address of each ray tracing interface, determine and record the cache data of each ray tracing interface.
4. The ray tracing debugging method as described in claim 1, characterized in that, Before adjusting the device address of each of the ray tracing interfaces to the newly created address, the method further includes: Establish a mapping relationship between the device address and the newly created address for each of the aforementioned ray tracing interfaces.
5. The ray tracing debugging method as described in claim 4, characterized in that, Adjust the device addresses of each of the aforementioned ray tracing interfaces to the newly created addresses, including: Based on the mapping relationship between the newly created address and the device address, determine the newly created address that maps to the device address of each of the ray tracing interfaces; Replace the device address of each of the aforementioned ray tracing interfaces with the newly created address.
6. The ray tracing debugging method as described in claim 1, characterized in that, The method further includes: Based on the cached data in the newly created address, the rendering result is replayed in the second hardware platform to obtain the replay result; The ray tracing application is debugged based on the playback and rendering results.
7. The ray tracing debugging method according to any one of claims 1-6, characterized in that, The newly created address was obtained through the following method: Create a new cache region; Determine and save the new address of the newly created cache area.
8. A ray tracing debugging device, characterized in that, The device includes: The interface call sequence acquisition module is used to acquire the interface call sequence required by the first hardware platform to run the ray tracing application; The data determination module is used to determine and record, based on the interface call sequence, the device address of each ray tracing interface in the interface call sequence, the cached data of each device address, and the rendering result obtained by the first hardware platform running the ray tracing application; The execution module is used to adjust the device addresses of each ray tracing interface to a new address and add the cached data to the new address during the debugging of the ray tracing application based on the rendering results on the second hardware platform. The first hardware platform is different from the second hardware platform, and the new address is an address that the second hardware platform can call.
9. An electronic device, characterized in that, The electronic device includes: a memory and a program or instructions stored in the memory and executable on a processor, wherein when the program or instructions are executed by the processor, they implement the ray tracing debugging method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause the graphics processor to execute the ray tracing debugging method according to any one of claims 1-7.