Image rendering replay verification method, device, equipment, medium and product

CN122714632BActive Publication Date: 2026-10-27MOORE THREAD INTELLIGENT TECHNOLOGY (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611215641.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-10-27
Estimated Expiration
2046-08-12

AI Technical Summary

Technical Problem

[0004]然而,帧数量缩减后的Trace文件中仍然包含多个帧对应的Trace文件,数据规模仍然较大,导致对渲染过程中的绘制操作进行重现与分析的效率仍然较低

Benefits of technology

本申请实施例所示的方案,在验证第一绘制操作在图像帧的渲染过程中是否正确执行的场景下,计算机设备可以获取图像帧的跟踪数据文件,即图像帧的渲染过程中的各个绘制操作的操作数据,并从中提取出第一绘制操作的操作数据以及第一绘制操作在图像帧的渲染过程中的执行结果(即绘制结果),之后,根据第一绘制操作的操作数据构建第一绘制操作的可执行文件,执行可执行文件,得到第一绘制操作的重放结果,根据重放结果与绘制结果之间的比对结果,验证第一绘制操作在图像帧的渲染过程中是否正确执行;本申请可以从图像帧多个绘制操作的操作数据中,提取出指定绘制操作的操作数据,得到单个绘制操作对应的最小资源依赖闭包,避免获取到与指定绘制操作无关的其他绘制操作的操作数据,降低重放验证过程中的数据规模,提高对单个绘制操作进行重现与分析时的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122714632B_ABST
    Figure CN122714632B_ABST
Patent Text Reader

Abstract

The application relates to a replay verification method, device and equipment for image rendering, a medium and a product, and relates to the technical field of computer graphics. The method comprises the following steps: acquiring a tracking data file of an image frame; the tracking data file of the image frame is used for indicating operation data of each drawing operation in a rendering process of the image frame; acquiring operation data of a first drawing operation according to the tracking data file of the image frame, the first drawing operation being one of the each drawing operation; constructing an executable file of the first drawing operation according to the operation data of the first drawing operation; executing the executable file to obtain a replay result of the first drawing operation; comparing the replay result of the first drawing operation with a drawing result to obtain a verification result of the first drawing operation; the drawing result comprises an execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used for indicating whether the first drawing operation is correctly executed in the rendering process of the image frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graphics technology, and in particular to a method, apparatus, device, medium and product for replay verification of image rendering. Background Technology

[0002] In the fields of computer graphics and software engineering, the general paradigm of capture (Trace / Capture) → replay can transform the dynamic, real-time image rendering process into a static data stream (such as the original Trace file) so that the drawing operations during the rendering process can be reproduced and analyzed.

[0003] In related technologies, the original trace file can be analyzed frame by frame. By clustering analysis, multiple similar frames can be grouped into one category, and a frame can be selected as the key frame for each category, thus obtaining a trace file with a reduced number of frames.

[0004] However, even with the reduced number of frames, the trace file still contains trace files corresponding to multiple frames, resulting in a still large data size. This makes it difficult to reproduce and analyze the drawing operations during the rendering process. Summary of the Invention

[0005] This application provides a method, apparatus, device, medium, and product for replay verification of image rendering, the technical solution of which is as follows: According to one aspect of this application, a method for replaying and verifying image rendering is provided, the method comprising: Obtain the tracking data file of the image frame; the tracking data file of the image frame is used to indicate the operation data of each drawing operation in the rendering process of the image frame; The operation data for the first drawing operation is obtained from the tracking data file of the image frame; the first drawing operation is one of the various drawing operations. Construct an executable file for the first drawing operation based on the operation data of the first drawing operation; Execute the executable file to obtain the replay result of the first drawing operation; The replay result of the first drawing operation is compared with the drawing result to obtain the verification result of the first drawing operation; the drawing result includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used to indicate whether the first drawing operation was correctly executed in the rendering process of the image frame.

[0006] According to one aspect of this application, a replay verification apparatus for image rendering is provided, the apparatus comprising: The file acquisition module is used to acquire the tracking data file of the image frame; the tracking data file of the image frame is used to indicate the operation data of each drawing operation in the rendering process of the image frame; The data acquisition module is used to acquire operation data for the first drawing operation based on the tracking data file of the image frame; the first drawing operation is one of the various drawing operations. The file building module is used to build an executable file for the first drawing operation based on the operation data of the first drawing operation; The file execution module is used to execute the executable file and obtain the replay result of the first drawing operation; The result comparison module is used to compare the replay result of the first drawing operation with the drawing result to obtain the verification result of the first drawing operation; the drawing result includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used to indicate whether the first drawing operation was correctly executed in the rendering process of the image frame.

[0007] In some embodiments, the operation data of the drawing operation includes the metadata of the drawing operation and the resource data of the drawing operation; The file construction module is used to write the metadata of the first drawing operation into a JSON file; write the resource data of the first drawing operation into a resource file; generate a source code file based on the JSON file; the source code file is used to perform setting operations based on the metadata of the first drawing operation and the resource data in the resource file; and compile the source code file and the entry source file to obtain the executable file.

[0008] In some embodiments, the image rendering replay verification apparatus further includes: The API writing module is used to, when the first drawing operation is a drawing operation that calls the glEnd function, obtain the various application programming interface APIs from the tracking data file of the image frame from the glBegin function corresponding to the glEnd function to the glEnd function; and write the obtained APIs into the entry source file.

[0009] In some embodiments, when the first drawing operation is a drawing operation that calls a kernel function, the resource data of the first drawing operation includes data uploaded from the CPU to the GPU by the kernel function.

[0010] In some embodiments, the metadata of the drawing operation includes at least one of the following: Status parameters, data type of resource data, and data format of resource data; The resource data for the drawing operation includes at least one of the following: Texture resources, buffer resources, framebuffer object resources, shader resources.

[0011] In some embodiments, the file execution module is configured to execute the executable file to obtain a tracking data file of the first drawing operation; the tracking data file of the first drawing operation is used to indicate the operation data in the reconstruction process of the first drawing operation; and based on the tracking data file of the first drawing operation, to obtain the replay result of the first drawing operation.

[0012] In some embodiments, the result comparison module is configured to obtain the drawing result from the tracking data file of the image frame; compare the replay result of the first drawing operation with the drawing result to obtain the similarity between the replay result of the first drawing operation and the drawing result; and obtain the verification result of the first drawing operation based on the similarity between the replay result of the first drawing operation and the drawing result.

[0013] According to another aspect of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer instruction, the at least one computer instruction being loaded and executed by the processor to implement the image rendering replay verification method as described above.

[0014] According to another aspect of this application, a computer-readable storage medium is provided, wherein at least one computer instruction is stored therein, the at least one computer instruction being loaded and executed by a processor to implement the image rendering replay verification method as described above.

[0015] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor reads from the computer-readable storage medium and executes the computer instructions to implement the image rendering replay verification method described above.

[0016] The technical solutions provided in this application embodiment may have the following beneficial effects: The solution described in this application, in a scenario where the first drawing operation is correctly executed during the rendering process of an image frame, allows the computer device to obtain the tracking data file of the image frame, i.e., the operation data of each drawing operation during the rendering process of the image frame. The computer then extracts the operation data of the first drawing operation and its execution result (i.e., the drawing result) during the rendering process of the image frame. Subsequently, an executable file for the first drawing operation is constructed based on its operation data. The executable file is executed to obtain the replay result of the first drawing operation. The comparison between the replay result and the drawing result verifies whether the first drawing operation was correctly executed during the rendering process of the image frame. This application can extract the operation data of a specified drawing operation from the operation data of multiple drawing operations in an image frame, obtaining the minimum resource dependency closure corresponding to a single drawing operation. This avoids obtaining the operation data of other drawing operations unrelated to the specified drawing operation, reducing the data scale during the replay verification process and improving the efficiency of reproducing and analyzing a single drawing operation. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the implementation environment of an image rendering replay verification system provided in an exemplary embodiment of this application; Figure 2 This is a schematic diagram of an image rendering replay verification method provided in an exemplary embodiment of this application; Figure 3 This is a flowchart of an image rendering replay verification method provided in an exemplary embodiment of this application; Figure 4 This is a flowchart of a replay verification method for image drawing provided in another exemplary embodiment of this application; Figure 5 This is a schematic diagram illustrating the construction of an executable file provided in an exemplary embodiment of this application; Figure 6 This is a schematic diagram of a first drawing operation that calls the glEnd function, provided in an exemplary embodiment of this application; Figure 7 This is a flowchart of an exemplary embodiment of the present application providing a method for automatically generating a Trace to a standalone C++ replay project for a single OpenGL draw call; Figure 8This is a block diagram illustrating an image rendering replay verification apparatus according to an exemplary embodiment of this application; Figure 9 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application.

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0021] Please refer to Figure 1 This illustrates a schematic diagram of an implementation environment for an image rendering replay verification system provided in an exemplary embodiment of this application. Figure 1 As shown, the implementation environment may include: terminal 100 and server 200.

[0022] Terminal 100 includes, but is not limited to, smartphones, tablets, smart voice interaction devices, smart home appliances, in-vehicle terminals, laptops, or desktop computers. Terminal 100 may run a client that provides primitive processing functions. This client can be an interactive instruction processing application, an image rendering replay verification application, etc. This application embodiment does not limit the specific type of client.

[0023] Server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data and artificial intelligence platforms.

[0024] In this configuration, terminal 100 and server 200 communicate via a communication network. Optionally, the communication network can be a wired network or a wireless network, and can be at least one of a local area network (LAN), a metropolitan area network (MAN), and a wide area network (WAN).

[0025] The current field of graphics debugging generally follows the common paradigm of "trace / capture → replay," which involves intercepting OpenGL call sequences on the target platform and replaying them in another environment for problem reproduction, performance analysis, and regression testing. Under this paradigm, typical tools such as Apitrace support call-level and frame-level trimming (gltrim / frametrim) and can be replayed via glretrace, but their output is still a trace file, which cannot be directly converted into a compileable project. RenderDoc and GAPID focus on frame-level capture and interactive debugging, providing scripted replay capabilities, but they also do not generate independent C++ projects, making them difficult to integrate into regular compilation and automated testing workflows.

[0026] In the relevant technical solutions, Solution 1 can export frame-level OpenGL ES calls as C++ replay source code containing resources through the testing mechanism of the graphics abstraction layer. However, exporting on a frame or context-by-frame basis cannot minimize dependencies for a single draw call, resulting in large redundancy in calls and resources, high construction and runtime times, and also affecting native OpenGL. The 4.x (compatible / core) project generation capability is not publicly available, resulting in insufficient cross-platform versatility. Solution 2 can export the entire frame as a compilable and runnable C++ project through the project export function of the graphics debugging and performance analysis tools, which is convenient for driver and performance analysis. However, it does not involve the minimum resource closure of a single draw or call interval. The exported project is large in scale and contains many irrelevant calls, which is not conducive to unit testing and rapid CI verification. While selecting keyframes and constructing a reduced Trace for playback can reduce some I / O volume, its output is still a Trace file rather than an independent C++ project. It is difficult to incorporate into the regular C++ compilation, static analysis and CI process. Moreover, it is still oriented towards keyframes and state recovery sequences, and does not implement the resource dependency closure of a single draw. A large number of calls unrelated to the target draw are still retained, resulting in limited improvement in playback time and I / O.

[0027] In summary, related technologies generally suffer from problems such as "coarse granularity, high redundancy, and low degree of engineering implementation." The solution in the embodiments shown in this application can solve the following technical problem: for a specified single OpenGL drawing call, the minimum resource dependency closure is automatically obtained from the Trace file, significantly reducing calls and data unrelated to the target drawing; based on this closure, a C++ project that can be built and run independently is automatically generated, achieving fast, stable, and portable regression reproduction, thereby making up for the key deficiencies of existing solutions in single-draw granularity closure and engineering implementation.

[0028] Please refer to Figure 2 This illustration shows a schematic diagram of a replay verification method for image rendering provided in an exemplary embodiment of this application. Figure 2As shown, firstly, the computer device obtains the original Trace file 201 of the image frame. The original Trace file 201 of the image frame contains the operation data of each drawing operation in the rendering process of the image frame. Then, the computer device uses a Python script to call Apitrace, and extracts the operation data 202 of the first drawing operation and the drawing result 203 of the first drawing operation from the original Trace file 201 of the image frame according to the identification information of the first drawing operation. Subsequently, the computer device uses a Python script to construct an executable file 204 of the first drawing operation based on the operation data 202 of the first drawing operation. Then, the Python script is used to perform replay verification, including: executing the executable file 204 of the first drawing operation to obtain the replay result 205 of the first drawing operation; comparing the replay result 205 of the first drawing operation with the drawing result 203 of the first drawing operation to obtain the verification result 206 of the first drawing operation; wherein, the drawing result 203 of the first drawing operation includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result 206 of the first drawing operation is used to indicate whether the first drawing operation was correctly executed in the rendering process of the image frame.

[0029] Please refer to Figure 3 The diagram illustrates a flowchart of a replay verification method for image rendering provided in an exemplary embodiment of this application. The method is executed by a computer device, which may optionally be a computer device... Figure 1 Terminal 100 in the system shown; or, the computer device may be Figure 1 The system shown includes server 200; or, the computer device may be... Figure 1 The system shown includes terminal 100 and server 200. Figure 3 As shown, the method may include steps 310 to 350.

[0030] Step 310: Obtain the image frame tracking data file; the image frame tracking data file is used to indicate the operation data of each drawing operation in the rendering process of the image frame.

[0031] In some embodiments, a computer device can obtain the trace data file of an image frame using a specified tool. For example, the specified tool could be Apitrace, and the trace data file could be a Trace file. For instance, during the rendering of an image frame, the Apitrace Trace command can be invoked (e.g., executing `apitrace trace --api gl your_app` to trace OpenGL applications). This tool establishes an interception layer between the application and the underlying graphics driver, fully recording all specified graphics API calls issued during the rendering process (including OpenGL, Direct3D, and other interface functions and their parameters, pointer data, etc.), and ultimately persisting these call sequences and corresponding state information as the original Trace file of the image frame.

[0032] It's important to note that during the rendering of an image frame, a single draw operation refers to a drawing command (e.g., a draw call) issued by the CPU to the Graphics Processing Unit (GPU) through the Application Programming Interface (API). This command instructs the GPU to draw a batch of primitives (such as points, lines, and triangles) based on the current context's vertex data, shader programs, texture and buffer binding states. A draw operation is the smallest execution unit that constitutes an image frame. A single frame typically requires multiple draw operations to be completed sequentially, and the image frame's tracking data file can indicate the operation data corresponding to each of these draw operations.

[0033] In some embodiments, the operation data for drawing operations includes, but is not limited to: state parameters, shaders, and bound objects (Texture, Buffer, FBO, etc.). In the OpenGL rendering pipeline, the final effect of a drawing operation is determined by various state parameters in the current state machine, the compiled, linked, and bound shader programs, and various bound objects. The state parameters include viewport size (determining the mapping from NDC coordinates to window pixels), OpenGL / OpenGL ES version number (determining available features and pipeline type, such as whether programmable shaders are supported), and texture state (such as wrapping mode GL_REPEAT / GL_CLAMP_TO_EDGE, filtering mode GL_NEAREST / GL_LINEAR, and mipmap strategy, controlling texture coordinate out-of-bounds behavior and sampling quality). For shaders, OpenGL / OpenGL ES uses a programmable pipeline consisting of GLSL programs such as vertex shaders and fragment shaders. Shader objects are generated through glCreateShader and glCompileShader, then formed into executable program objects through glCreateProgram, glAttachShader, and glLinkProgram. These are then bound by glUseProgram and applied to the current draw. Internally, vertex attributes are mapped through layout(location) or glBindAttribLocation, and constant data such as matrices and light sources are passed through uniforms. The bound objects follow a "bound-to-use" design: texture objects are bound through glGenTextures / ... `glBindTexture` creates and binds to a texture unit, serving as the data source for the sampler. Buffer objects, managed by `glGenBuffers` / `glBindBuffer`, can be bound to targets such as `GL_ARRAY_BUFFER` (vertex attributes), `GL_ELEMENT_ARRAY_BUFFER` (indexes), `GL_UNIFORM_BUFFER` (uniform blocks), and `GL_SHADER_STORAGE_BUFFER` (shader storage), providing vertex, index, and constant data for drawing. Framebuffer objects (FBOs) use `glBindFramebuffer` to switch the rendering target from the default window buffer to an off-screen buffer, used for rendering to textures or multiple rendering targets. These state parameters, shaders, and bound objects together constitute the current context upon which a drawing operation depends, and are the core elements that must be fully captured and replayed when implementing the smallest resource closure at the single-draw granularity.

[0034] Step 320: Obtain the operation data for the first drawing operation based on the tracking data file of the image frame; the first drawing operation is one of the various drawing operations.

[0035] In the embodiments of this application, the first drawing operation is the drawing operation waiting for replay verification among various drawing operations. Replay verification can determine whether the first drawing operation was correctly executed during the rendering process of the image frame. It should be noted that the computer device can use the schemes in the various embodiments of this application to perform parallel or sequential replay verification of some or all drawing operations during the rendering process of the image frame, so as to determine whether some or all drawing operations in each drawing operation were correctly executed during the rendering process of the image frame. The replay verification process of other drawing operations is the same as the replay verification process of the first drawing operation, and will not be described again in this application.

[0036] In some embodiments, developers may pre-write a script file (such as a Python script) to dump the operation data of the first drawing operation and save it to a file. Accordingly, a computer device can load and run the script file to obtain the operation data of the first drawing operation from the trace data file.

[0037] In one possible implementation, step 320 above can be implemented as follows: based on the identification information of the first drawing operation, obtain the operation data of the first drawing operation from the tracking data file of the image frame.

[0038] In this embodiment, during the rendering of an image frame, each drawing operation corresponds to an identification information. This identification information distinguishes different drawing operations; for example, it can be a unique number (such as a sequential number) or an index identifier for the drawing operation. Specifically, the identification information for the first drawing operation is the callNo of the first draw. Accordingly, based on the identification information of the first drawing operation, the computer device can quickly extract the operation data of the first drawing operation from its tracking data file, avoiding the acquisition of operation data that is not from the first drawing operation and ensuring the accuracy of the acquired operation data.

[0039] Step 330: Construct the executable file for the first drawing operation based on the operation data of the first drawing operation.

[0040] In some embodiments, developers can pre-write a script file (such as a Python script) to parse the operation data of the first drawing operation and generate a C++ file. Correspondingly, the computer device can load and run this script file, generating the corresponding C++ file based on a preset C++ source code template (such as a .tmpl template file). Then, it generates supporting files (such as the entry source file) and moves the C++ file and supporting files to a well-organized project folder, maintaining a clean project directory structure for easy subsequent management and version control. Based on this, by calling CMake to read the CMakeLists.txt configuration in the project, it automatically generates a build file (such as a Makefile) adapted to the current platform. Then, it executes the compilation and linking process, integrating the generated C++ file and supporting files into an independent executable file. The entire process relies on CMake's cross-platform capabilities, eliminating the need to maintain separate build scripts for different systems. Finally, this process can be further integrated into a CI / Continuous Deployment (CD) system to achieve full automation of code generation, building, and testing, supporting continuous integration and regression verification of the smallest closure project at the granularity of a single drawing operation.

[0041] Step 340: Execute the executable file to obtain the replay result of the first drawing operation.

[0042] In the embodiments of this application, the replay result of the first drawing operation is the execution result of the reconstructed first drawing operation in the rendering process of the image frame.

[0043] Step 350: Compare the replay result of the first drawing operation with the drawing result to obtain the verification result of the first drawing operation; the drawing result includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used to indicate whether the first drawing operation was executed correctly in the rendering process of the image frame.

[0044] In some embodiments, the computer device can compare the replay result of the first drawing operation with the drawing result for similarity. If the similarity is high, it can be determined that the first drawing operation was correctly executed during the rendering of the image frame; otherwise, if the similarity is low, it can be determined that the first drawing operation was not correctly executed during the rendering of the image frame.

[0045] In summary, the solution presented in this application, in the scenario of verifying whether the first drawing operation is correctly executed during the rendering process of an image frame, allows the computer device to obtain the tracking data file of the image frame, i.e., the operation data of each drawing operation during the rendering process of the image frame, and extract the operation data of the first drawing operation and the execution result (i.e., the drawing result) of the first drawing operation during the rendering process of the image frame. Then, an executable file of the first drawing operation is constructed based on the operation data of the first drawing operation, and the executable file is executed to obtain the replay result of the first drawing operation. Based on the comparison between the replay result and the drawing result, the correct execution of the first drawing operation during the rendering process of the image frame is verified. This application can extract the operation data of a specified drawing operation from the operation data of multiple drawing operations of an image frame to obtain the minimum resource dependency closure corresponding to a single drawing operation, avoiding the acquisition of operation data of other drawing operations unrelated to the specified drawing operation, reducing the data scale in the replay verification process, and improving the efficiency of reproducing and analyzing a single drawing operation.

[0046] Furthermore, the executable file built on the operational data of a single drawing operation transforms the operational data into a compilable and independently runnable C++ project, which can be seamlessly integrated into automated testing and continuous integration systems to achieve fast, stable, and portable regression reproduction. This enables regression verification and problem reproduction at the level of a single drawing operation, improving the efficiency of reproducing and analyzing a single drawing operation.

[0047] Based on the above Figure 3 In one possible implementation of the scheme shown in the embodiments, the operation data for the drawing operation includes metadata for the drawing operation and resource data for the drawing operation. Please refer to... Figure 4 This illustrates a flowchart of a replay verification method for image drawing provided in another exemplary embodiment of this application. Figure 4 As shown, step 330 can be implemented as steps 330a, 330b, 330c, and 330d.

[0048] Step 330a: Write the metadata of the first drawing operation to a JSON file.

[0049] In this embodiment of the application, the JavaScript Object Notation (JSON) file is used to store the metadata of the first drawing operation and is responsible for recording descriptive information. For example, the metadata written into the JSON file is used to annotate the attributes and semantics of the actual resource data stored in the resource file, so that the resource characteristics and dependencies can be quickly identified during subsequent parsing and reconstructing drawing operations.

[0050] Step 330b: Write the resource data of the first drawing operation to the resource file.

[0051] In this embodiment of the application, the operation data of the drawing operation includes metadata and resource data. The computer device can write the metadata of the first drawing operation into a JSON file and the resource data of the first drawing operation into a resource file from the operation data of the first drawing operation, thereby realizing the separation of metadata and resource data.

[0052] In some embodiments, the computer device may save status parameters, etc., as JSON files, and data types and formats, etc., as data such as Texture, Buffer, and FBO as resource files. For example, the resource files mentioned above may be binary (BIN) files, used to store the raw byte stream of resource data.

[0053] Step 330c: Generate source code file based on JSON file; source code file is used to perform setting operation based on metadata of first drawing operation and resource data in resource file.

[0054] In this embodiment of the application, the source code file of the first drawing operation is used to instruct the logic for setting the metadata of the first drawing operation and the resource data of the first drawing operation during the execution of the executable file.

[0055] In some embodiments, parsing the JSON file described above can extract the metadata of the first drawing operation, and then generate the corresponding source code file based on the metadata. For example, developers can pre-write a script file (such as a Python script) to parse the JSON file, generate the source code file based on the metadata of the first drawing operation, and set resource data such as state parameters, Texture, Buffer, Framebuffer, and Uniform. Correspondingly, a computer device can load and run the script file to parse the JSON file and generate the source code file based on the metadata of the first drawing operation.

[0056] Step 330d: Compile the source code file and the entry source file to obtain the executable file.

[0057] In some embodiments, the source code file includes source files and header files, and the entry point source file is the source file containing the program's entry point. For example, the source code file can be a C++ file, the entry point source file can be a main.cpp file, and the executable file can be a .exe file.

[0058] In some embodiments, the computer device can move the source code files and entry source files to a designated project folder according to a standard project directory structure, and call a generation tool (such as CMake) to compile them in order to generate the aforementioned executable file. The settings in the source code files and the drawing logic of the first drawing operation are compiled into machine instructions in the executable file.

[0059] In some embodiments, the generated source code files and entry source files can be directly treated as regular C++ projects, and can be compiled into independent executable files by configuring build rules through CMake (such as setting C++ standards, linking dependent libraries such as OpenGL / GLAD / GLFW), thereby reducing engineering maintenance costs.

[0060] The above Figure 4 In the embodiment shown, the computer device can write the metadata of the first drawing operation into a JSON file and the resource data of the first drawing operation into a resource file from the operation data of the first drawing operation, thereby separating the metadata and resource data. Then, the JSON file is parsed to generate a source code file, and the source code file and the entry source file are compiled into an executable file. This can avoid omitting the operation data of the first drawing operation when building the executable file, thus ensuring the reliability of the executable file.

[0061] Based on the above Figure 2 Please refer to Figure 5 This illustrates a schematic diagram of constructing an executable file according to an exemplary embodiment of this application. Figure 5 As shown, the operation data 202 of the first drawing operation includes a JSON file 202a and a BIN file 202b of the first drawing operation. The computer device loads and runs the specified script file, parses the JSON file 202a of the first drawing operation, generates the source code file 202c of the first drawing operation based on the metadata of the first drawing operation, and compiles the source code file 202c of the first drawing operation and the entry source file 220d of the first drawing operation to obtain the executable file 204 of the first drawing operation.

[0062] based on Figure 4 In one possible implementation of the scheme shown in the embodiments, the above-described image rendering replay verification method further includes: If the first drawing operation is a drawing operation that calls the glEnd function, retrieve the various APIs from the glBegin function corresponding to the glEnd function to the glEnd function from the tracking data file of the image frame; Write the obtained API into the entry source file.

[0063] In this embodiment, the glBegin and glEnd functions are a pair of functions in the OpenGL graphics interface used to define the vertex data of geometric primitives. The pairing of the glBegin and glEnd functions can define the scope of the vertex data. For example, glBegin specifies the primitive type formed by subsequent vertices through the mode parameter, while glEnd marks the end of the vertex definition. The API between the two functions together describes the complete vertex attribute information of a set of geometric primitives.

[0064] In some embodiments, the API between the glBegin function corresponding to the glEnd function and the glEnd function includes, but is not limited to, the glVertex function for setting vertex coordinates. ( ) The function glColor sets the color ( ) The function glTexCoord for setting texture coordinates ( ) The function glNormal sets the normal coordinates. ( ) The function glMaterial sets material properties ( ) The function glIndex sets the color index. ( ), the function glEvalCoord for generating coordinates ( ), the function glEvalPoint generates the evaluation point ( ), the function glEdgeFlag controls the drawing of boundaries. ()wait.

[0065] In some embodiments, a computer device may write the API from the glBegin function corresponding to the glEnd function to the glEnd function as code (e.g., C++ code) and add it to a specified write location in the entry source file. The specified write location is the position in the entry source file used to write the API from the glBegin function corresponding to the glEnd function to the glEnd function.

[0066] Since the glBegin and glEnd functions are function pairs in immediate mode and compatibility mode, the CPU needs to call the function once for each vertex drawn. In the solution of this application embodiment, when the first drawing operation is a drawing operation that calls the glEnd function, each API between the glBegin and glEnd functions is written into the entry source file. This can avoid data omission in immediate mode and compatibility mode, realize the adaptation to immediate mode and compatibility mode OpenGL projects, and effectively expand the applicability of this solution in different OpenGL versions.

[0067] Please refer to Figure 6This illustrates a schematic diagram of a first drawing operation involving a call to the glEnd function, provided in an exemplary embodiment of this application. Figure 6 As shown, taking the first drawing operation as calling the glEnd function to draw a triangle as an example, the API from the glBegin function corresponding to the glEnd function to the glEnd function includes glColor3f (), glVertex3f (),glColor3f () is used to set the color of the vertex, glVertex3f The parentheses () are used to set the coordinates of the three vertices of the triangle. Accordingly, the computer device will use glColor3f (), glVertex3f Write the parentheses in C++ and add them to the specified write location in the entry source file.

[0068] Based on the solutions shown in the above embodiments of this application, in one possible implementation, when the first drawing operation is a drawing operation that calls a core function, the resource data of the first drawing operation includes data uploaded from the CPU to the GPU by the core function.

[0069] In some embodiments, core functions include glBufferData, glTexImage2D, etc.

[0070] In this embodiment, the first drawing operation that calls the kernel function refers to a drawing operation belonging to the modern kernel mode, which is different from the first drawing operation that calls the glEnd function. Instead, it uploads a large amount of data (such as all vertex data, index data, unified buffer data, etc. of a complete model) from the CPU system memory to the GPU video memory at once, which can avoid the transmission overhead of per-vertex calls and improve transmission efficiency. Accordingly, during the process of obtaining the operation data of the first drawing operation based on the tracking data file of the image frame, the computer device can add the data uploaded from the CPU to the GPU by the kernel function corresponding to the first drawing operation to the resource file of the first drawing operation, so as to avoid missing the data uploaded from the CPU to the GPU by the kernel function.

[0071] Based on the solutions shown in the above embodiments of this application, in one possible implementation, the metadata of the drawing operation includes at least one of the following: Status parameters, data type of resource data, and data format of resource data; The resource data for drawing operations includes at least one of the following: Texture resources, buffer resources, framebuffer object resources, shader resources.

[0072] In some embodiments, the above-mentioned state parameters are configuration items used to define the current running state of the rendering environment, and can be in various forms such as numerical values, boolean values, and enumeration values. For example, state parameters include, but are not limited to: viewport size, OpenGL / OpenGL ES version number, and texture parameters (such as wrapping mode GL_REPEAT / GL_CLAMP_TO_EDGE, and filtering mode GL_NEAREST / GL_LINEAR).

[0073] In some embodiments, the data type and data format of resource data are used to accurately describe the attribute characteristics of GPU resources upon which drawing operations depend. The data type of resource data refers to the top-level logical category of the resource data itself, used to identify the core attributes of the resource. For example, resource data data types include major categories such as Texture, Buffer, Frame Buffer Object (FBO), and Shader. The data format of resource data refers to the specific underlying encoding method and purpose identifier of the resource data. For example, the pixel format of a texture (such as GL_RGBA8, GL_RGB565, etc., defining the channel composition and bit width of a single pixel), and the purpose of a buffer (such as GL_STATIC_DRAW indicating that data is uploaded once and read frequently, and GL_DYNAMIC_DRAW indicating that data is frequently updated).

[0074] In some embodiments, a texture is image data used to map onto the surface of an object, and texture resources are the raw pixel data of the texture (such as a pixel array uploaded via glTexImage2D). A buffer is a collection of data stored in GPU memory, used for efficient storage of geometric data (vertex, index, etc.) or uniform variables. Buffer resources may include vertex data (vertex coordinates, normals, texture coordinates, etc.), index data (primitive indices stored in the EBO for reusing vertices), etc. A frame buffer object (FBO) is a container object used to manage rendering targets. Frame buffer object resources include bound color attachment data (such as color output from textures or render buffers), depth attachment data (for depth testing), stencil attachment data (for stencil testing), etc., and are the core carrier for rendering to textures, multiple rendering targets, and other scenarios. A shader is a programmable program running on the GPU. Shader resources refer to source code strings (such as GLSL code text) or compiled binary code (such as program binary data obtained via glGetProgramBinary), containing execution logic for different stages such as vertex shaders and fragment shaders.

[0075] This application embodiment illustrates the content of metadata in a JSON file and the content of resource data in a resource file, so that during the process of obtaining the operation data of the first drawing operation, different operation data can be saved to the corresponding JSON file or resource file, thereby achieving the separation of data and description.

[0076] Based on the solutions shown in the above embodiments of this application, in one possible implementation, step 340 can be implemented as follows: Execute the executable file to obtain the trace data file of the first drawing operation; the trace data file of the first drawing operation is used to indicate the operation data in the reconstruction process of the first drawing operation; Based on the tracking data file of the first drawing operation, obtain the replay result of the first drawing operation.

[0077] In some embodiments, during the execution of an executable file, the computer device sets up resources according to the resource data in the resource file and runs the machine instructions in the executable file to perform a first drawing operation.

[0078] In some embodiments, during the execution of an executable file, the computer device invokes a capture command in a specified tool (such as the Trace command in Apitrace) to trace the execution process of the executable file, intercepts and records all specified graphics API calls issued during the execution process, and generates a new Trace file, i.e., the trace data file of the first drawing operation. Then, the computer device invokes the aforementioned specified tool (such as Apitrace) to dump the last generated framebuffer in the trace data file of the first drawing operation, obtaining the replay result of the first drawing operation.

[0079] Based on the solutions shown in the above embodiments of this application, in one possible implementation, step 350 can be implemented as step 350a, step 350b and step 350c.

[0080] Step 350a: Obtain the rendering results from the tracking data file of the image frame.

[0081] In some embodiments, step 350a above can be implemented as: obtaining the drawing result of the first drawing operation from the tracking data file of the image frame based on the identification information of the first drawing operation.

[0082] In some embodiments, a computer device can invoke a specified tool (such as Apitrace) to dump the framebuffer generated by the first drawing operation in the tracking data file of the image frame, based on the identification information of the first drawing operation, to obtain the drawing result of the first drawing operation. For example, this can be done using `apitrace replay -D`.<call_number> The `application.trace` command (where `call_number` is the identifier for the first drawing operation) pauses and dumps the pixel data in the current framebuffer immediately after the first drawing operation is completed during the playback of the trace file. It saves the data as an image file (such as a Portable Network Graphics (PNG) or Portable Pixmap (PPM) format) or a structured data file, thus obtaining the drawing result of the first drawing operation.

[0083] Step 350b: Compare the replay result of the first drawing operation with the drawing result to obtain the similarity between the replay result of the first drawing operation and the drawing result.

[0084] In this embodiment, the replay result of the first drawing operation is the rendered image of the reconstructed first drawing operation during the rendering process of the image frame; the drawing result of the first drawing operation is the rendered image of the first drawing operation during the rendering process of the image frame; that is, the replay result and the drawing result correspond to the image data in the two states of reconstructed output and original output, respectively. Accordingly, the computer device can compare the replay result and the drawing result of the first drawing operation to obtain the similarity between the replay result and the drawing result.

[0085] Step 350c: Obtain the verification result of the first drawing operation based on the similarity between the replay result and the drawing result of the first drawing operation.

[0086] In some embodiments, the computer device may compare the similarity between the replay result of the first drawing operation and the drawing result with a preset similarity threshold. If the similarity between the replay result of the first drawing operation and the drawing result is not less than the similarity threshold, the verification result is determined to be that the first drawing operation was correctly executed during the rendering of the image frame. Conversely, if the similarity between the replay result of the first drawing operation and the drawing result is less than the similarity threshold, the verification result is determined to be that the first drawing operation was not correctly executed during the rendering of the image frame.

[0087] This application embodiment obtains the similarity between the replay result and the drawing result, which can transform the rendered images corresponding to the first drawing operation before and after reconstruction into quantifiable similarity indicators. Without the need for manual frame-by-frame viewing of the rendered screen, the verification conclusion of the first drawing operation can be obtained quickly, automatically and accurately. It is especially suitable for minimum closure replay verification and large-scale automated testing scenarios with single draw granularity.

[0088] In some embodiments, step 350b above can be implemented as follows: The replay result of the first drawing operation is compared with the drawing result to obtain the proportion of similar pixels between the replay result and the drawing result of the first drawing operation. The above step 350c can be implemented as follows: In response to the similar pixel ratio reaching a specified threshold, the verification result is determined to indicate that the first drawing operation was correctly executed during the rendering process of the image frame; In response to the fact that the proportion of similar pixels did not reach the specified threshold, the verification result is determined to be that the first drawing operation was not executed correctly during the rendering of the image frame.

[0089] The similarity pixel ratio between the replay and rendering results directly reflects the consistency between the two rendering outputs. In some embodiments, the computer device can use pixel-level comparison to obtain the similarity pixel ratio between the replay and rendering results. For example, the computer device compares the color values ​​(or pixel data) at the same coordinate positions of the two images corresponding to the replay and rendering results pixel by pixel, counts the number of pixels with the same color using a counter, and calculates the percentage of pixels with the same color out of the total number of pixels in the image, thereby obtaining the similarity pixel ratio between the replay and rendering results.

[0090] In some embodiments, the specified threshold is a value pre-set by the developers according to the accuracy requirements of the project, such as 90%, 95%, or other values. If the calculated similarity percentage is not less than the specified threshold, the computer device can determine that the first drawing operation was correctly executed during the rendering of the image frame, meaning the replay result is highly consistent with the original result. Conversely, if the similarity percentage is less than the specified threshold, the computer device can determine that the first drawing operation was not correctly executed during the rendering of the image frame, meaning there may be problems such as state loss, resource errors, or missed calls.

[0091] This application embodiment obtains the similar pixel ratio between the replay result and the drawing result, which can transform the rendered images corresponding to the first drawing operation before and after reconstruction into a quantifiable similarity index; then, by comparing the similar pixel ratio with a specified threshold, the similar pixel ratio is transformed into a binary classification result of whether the first drawing operation was correctly executed during the rendering process of the image frame; the scheme based on similar pixel calculation and numerical threshold analysis shown in this application embodiment can quickly, automatically and accurately obtain the verification conclusion of the first drawing operation without manually checking the rendered screen frame by frame, which is especially suitable for minimum closure replay verification and large-scale automated testing scenarios at the single draw granularity.

[0092] The solutions described in the above embodiments of this application can be applied as a method and system for automatically generating independent C++ replay projects from traces of a single OpenGL draw call. This method, targeting a specific single OpenGL draw call, automatically obtains the minimum resource dependency closure from the trace, significantly reducing calls and data unrelated to the target draw. Based on this closure, an independently buildable and runnable C++ project is automatically generated, achieving fast, stable, and portable regression reproduction. Please refer to... Figure 7 This illustrates a flowchart of an exemplary embodiment of the present application providing a method for automatically generating a Trace to a standalone C++ replay project for a single OpenGL draw call. (See attached diagram.) Figure 7 As shown, the above method includes the following steps: Step 1: Obtain the original trace file of the image frame and specify the draw.

[0093] The original trace file of the image frame can be input into a specified software tool. By specifying the number (callNo) of the drawing operation, the specified draw (i.e., the first drawing operation mentioned above) can be determined from each drawing operation in the rendering process of the image frame.

[0094] Step 2: Dump the operation data of the specified draw operation and save it as a binary file and a JSON file.

[0095] For example, step 2 can be implemented as follows: Use a Python script to call Apitrace to dump the specified draw status parameters, shaders, and bound objects (Texture, Buffer, FBO, etc.) and save them to a file. The status parameters are saved as a JSON file, while the data for Texture, Buffer, FBO, and shaders are saved as binary files, with data type and format information stored in the JSON file.

[0096] Step 3: Parse the JSON file and generate a C++ file.

[0097] For example, step 3 can be implemented as follows: The Python script parses the JSON file and generates the corresponding C++ files in sequence: apply_state / apply_tex / apply_buffer / apply_framebuffer / apply_uniform, which are used to set state parameters, texture, buffer, framebuffer, uniform and other resources; In the process of using a Python script to parse the original Trace file and specifying draw, if draw is specified as a drawing operation that calls the glEnd function, then all APIs between glBegin and glEnd must be written into main.cpp; if draw is specified to upload data from the CPU, then the uploaded data must be dumped and configured in the generated main.cpp.

[0098] In addition, main.cpp needs to call the C++ file in step 3 to set specified resources such as status parameters, texture, buffer, framebuffer, and uniform.

[0099] Step 4: Move the C++ file, main.cpp, and data file to the project folder, and call cmake to compile and generate the executable file.

[0100] For example, step 4 can be implemented as follows: Move the generated C++ source files, main.cpp, and data files (binary files) to the project directory to generate a CMake / VS project; Use CMake to compile and generate an executable file (.exe).

[0101] You can use a Python script to start the scripts mentioned in steps 2 and 3, and perform operations such as dumping resources, parsing resources, generating C++ files, and moving the generated C++ source files and data files (binary files) to the specified project folder.

[0102] Step 5: For the executable file, call Apitrace to capture a new Trace file and save the final framebuffer. Compare it with the framebuffer specified for drawing in the original Trace file. A high similarity indicates successful reconstruction.

[0103] For example, a Python script can be used to automatically test the generated C++ project. First, it needs to call aptrace to capture the trace file of the reconstructed cpp project; second, it calls aptrace to dump the final framebuffer generated in the trace file; finally, it compares the similarity between the framebuffer images of the initial trace file (draw) and the reconstructed trace file (draw). If the similarity is high, the reconstruction process of the specified draw is considered successful.

[0104] Afterwards, the computer equipment can obtain the results record, including verification results, verification logs, and difference graphs before and after reconstruction. In the above process, only the input of step 1 is manually specified; the remaining steps are all completed automatically by Python scripts.

[0105] In summary, the beneficial effects of the above methods include: 1) The minimum resource dependency closure is automatically saved for the specified draw in the Trace file, and calls and data unrelated to the target drawing are removed; replacing the whole frame / segment playback with the minimum draw closure can significantly reduce the scale of function calls and data reading and writing, and greatly improve the running speed.

[0106] 2) The output is a standard C++ project. The minimum closure is automatically generated into a C++ project that can be built and run independently, so as to be free from the replayer. This facilitates cross-platform and CI batch regression and can be directly connected to compilation, static analysis, unit testing and continuous integration (CI).

[0107] 3) The analysis of specific problems is more precise, and the reports can be made with minimal context and discrepancies, helping to focus on the problem's resources and status.

[0108] 4) Using templates (Python scripts) for driving, it can be compatible with different systems.

[0109] 5) Accurately restore the original drawing state, setting parameters, shaders, textures, buffers, and framebuffers to be completely consistent with the original drawing.

[0110] Please refer to Figure 8 This illustration shows a block diagram of an image rendering replay verification apparatus according to an exemplary embodiment of this application, which can be used to perform, for example... Figure 3 In the method shown, such as Figure 8 As shown, the device includes: The file acquisition module 801 is used to acquire the tracking data file of the image frame; the tracking data file of the image frame is used to indicate the operation data of each drawing operation in the rendering process of the image frame. The data acquisition module 802 is used to acquire the operation data of the first drawing operation based on the tracking data file of the image frame; the first drawing operation is one of the various drawing operations. The file building module 803 is used to build an executable file for the first drawing operation based on the operation data of the first drawing operation; The file execution module 804 is used to execute the executable file and obtain the replay result of the first drawing operation; The result comparison module 805 is used to compare the replay result of the first drawing operation with the drawing result to obtain the verification result of the first drawing operation; the drawing result includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used to indicate whether the first drawing operation was correctly executed in the rendering process of the image frame.

[0111] In some embodiments, the operation data of a drawing operation includes the metadata of the drawing operation and the resource data of the drawing operation; The file building module 801 is used to write the metadata of the first drawing operation into a JSON file; write the resource data of the first drawing operation into a resource file; generate a source code file based on the JSON file; the source code file is used to perform setting operations based on the metadata of the first drawing operation and the resource data in the resource file; and compile the source code file and the entry source file to obtain an executable file.

[0112] In some embodiments, the image rendering replay verification device further includes: an API writing module, configured to, when the first rendering operation is a rendering operation that calls the glEnd function, obtain from the tracking data file of the image frame each application programming interface API between the glBegin function corresponding to the glEnd function and the glEnd function; and write the obtained APIs into the entry source file.

[0113] In some embodiments, when the first drawing operation is a drawing operation that calls a kernel function, the resource data of the first drawing operation includes data uploaded from the CPU to the GPU by the kernel function.

[0114] In some embodiments, the metadata of a drawing operation includes at least one of the following: Status parameters, data type of resource data, and data format of resource data; The resource data for drawing operations includes at least one of the following: Texture resources, buffer resources, framebuffer object resources, shader resources.

[0115] In some embodiments, the file execution module 804 is configured to execute an executable file to obtain a tracking data file of a first drawing operation; the tracking data file of the first drawing operation is used to indicate the operation data in the reconstruction process of the first drawing operation; and based on the tracking data file of the first drawing operation, to obtain the replay result of the first drawing operation.

[0116] In some embodiments, the result comparison module 805 is used to obtain the drawing result from the tracking data file of the image frame; compare the replay result of the first drawing operation with the drawing result to obtain the similarity between the replay result of the first drawing operation and the drawing result; and obtain the verification result of the first drawing operation based on the similarity between the replay result of the first drawing operation and the drawing result.

[0117] With the apparatus provided in the above embodiments, in a scenario where the first drawing operation is correctly executed during the rendering process of an image frame, the computer device can obtain the tracking data file of the image frame, i.e., the operation data of each drawing operation during the rendering process of the image frame, and extract the operation data of the first drawing operation and the execution result (i.e., the drawing result) of the first drawing operation during the rendering process of the image frame. Then, an executable file of the first drawing operation is constructed based on the operation data of the first drawing operation, and the executable file is executed to obtain the replay result of the first drawing operation. Based on the comparison result between the replay result and the drawing result, the correct execution of the first drawing operation during the rendering process of the image frame is verified. This application can extract the operation data of a specified drawing operation from the operation data of multiple drawing operations of an image frame to obtain the minimum resource dependency closure corresponding to a single drawing operation, avoiding the acquisition of operation data of other drawing operations unrelated to the specified drawing operation, reducing the data scale in the replay verification process, and improving the efficiency of reproducing and analyzing a single drawing operation.

[0118] Furthermore, the executable file built on the operational data of a single drawing operation transforms the operational data into a compilable and independently runnable C++ project, which can be seamlessly integrated into automated testing and continuous integration systems to achieve fast, stable, and portable regression reproduction. This enables regression verification and problem reproduction at the level of a single drawing operation, improving the efficiency of reproducing and analyzing a single drawing operation.

[0119] It should be noted that the device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0120] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments of the relevant method; the technical effects achieved by each module performing its operation are the same as the technical effects in the embodiments of the relevant method, and will not be elaborated here.

[0121] Please refer to Figure 9 This illustration shows a schematic diagram of a computer device provided in an exemplary embodiment of this application. The computer device 900 includes a Central Processing Unit (CPU) 901, a system memory 904 including Random Access Memory (RAM) 902 and Read-Only Memory (ROM) 903, and a system bus 905 connecting the system memory 904 and the CPU 901. The computer device 900 also includes a Basic Input / Output System (I / O System) 906 that facilitates information transfer between various devices within the computer, and a mass storage device 907 for storing an operating system 913, application programs 914, and other program modules 915.

[0122] The basic input / output system 906 includes a display 908 for displaying information and an input device 909 for user input, such as a mouse or keyboard. Both the display 908 and the input device 909 are connected to the central processing unit 901 via an input / output controller 910 connected to the system bus 905. The basic input / output system 906 may also include the input / output controller 910 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 910 also provides output to a display device, printer, or other types of output devices.

[0123] The mass storage device 907 is connected to the central processing unit 901 via a mass storage controller (not shown) connected to the system bus 905. The mass storage device 907 and its associated computer-readable media provide non-volatile storage for the computer device 900. That is, the mass storage device 907 may include computer-readable media (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.

[0124] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc), or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 904 and mass storage device 907 described above can be collectively referred to as memory.

[0125] Computer device 900 can be connected to the Internet or other network devices via network interface unit 911 connected to the system bus 905.

[0126] The memory also includes one or more programs / instructions, which are stored in the memory. The central processing unit 901 executes the one or more programs / instructions to implement all or part of the steps in the methods shown in the above embodiments of this application.

[0127] In an exemplary embodiment, a computer program product is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads and executes the computer instructions from the computer-readable storage medium to implement all or part of the steps of the methods shown in the above embodiments of this application.

[0128] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores instructions that are loaded and executed by a processor to implement all or part of the steps of the methods shown in the above embodiments of this application.

[0129] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0130] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for replaying and verifying image rendering, characterized in that, The method includes: Obtain the tracking data file of the image frame; the tracking data file of the image frame is used to indicate the operation data of each drawing operation in the rendering process of the image frame; The operation data for the first drawing operation is obtained from the tracking data file of the image frame; the first drawing operation is one of the various drawing operations. Construct an executable file for the first drawing operation based on the operation data of the first drawing operation; Execute the executable file to obtain the replay result of the first drawing operation; The replay result of the first drawing operation is compared with the drawing result to obtain the verification result of the first drawing operation; the drawing result includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used to indicate whether the first drawing operation was correctly executed in the rendering process of the image frame.

2. The method according to claim 1, characterized in that, The operation data of the drawing operation includes the metadata of the drawing operation and the resource data of the drawing operation; The step of constructing the executable file of the first drawing operation based on the operation data of the first drawing operation includes: Write the metadata of the first drawing operation to a JSON file; Write the resource data of the first drawing operation to the resource file; A source code file is generated based on the JSON file; the source code file is used to perform setting operations based on the metadata of the first drawing operation and the resource data in the resource file; The source code file and the entry source file are compiled to obtain the executable file.

3. The method according to claim 2, characterized in that, The method further includes: When the first drawing operation is a drawing operation that calls the glEnd function, the various application programming interfaces (APIs) between the glBegin function corresponding to the glEnd function and the glEnd function are obtained from the tracking data file of the image frame. The obtained API is written into the entry source file.

4. The method according to claim 2, characterized in that, When the first drawing operation is a drawing operation that calls a core function, the resource data of the first drawing operation includes data uploaded from the CPU to the GPU by the core function.

5. The method according to claim 2, characterized in that, The metadata of the drawing operation includes at least one of the following: Status parameters, data type of resource data, and data format of resource data; The resource data for the drawing operation includes at least one of the following: Texture resources, buffer resources, framebuffer object resources, shader resources.

6. The method according to any one of claims 1 to 5, characterized in that, The execution of the executable file to obtain the replay result of the first drawing operation includes: Execute the executable file to obtain the tracking data file of the first drawing operation; the tracking data file of the first drawing operation is used to indicate the operation data in the reconstruction process of the first drawing operation; Based on the tracking data file of the first drawing operation, obtain the replay result of the first drawing operation.

7. The method according to any one of claims 1 to 5, characterized in that, The step of comparing the replay result of the first drawing operation with the drawing result to obtain the verification result of the first drawing operation includes: The rendering result is obtained from the tracking data file of the image frame; The replay result of the first drawing operation is compared with the drawing result to obtain the similarity between the replay result of the first drawing operation and the drawing result. The verification result of the first drawing operation is obtained based on the similarity between the replay result of the first drawing operation and the drawing result.

8. A replay verification device for image rendering, characterized in that, The device includes: The file acquisition module is used to acquire the tracking data file of the image frame; the tracking data file of the image frame is used to indicate the operation data of each drawing operation in the rendering process of the image frame; The data acquisition module is used to acquire operation data for the first drawing operation based on the tracking data file of the image frame; the first drawing operation is one of the various drawing operations. The file building module is used to build an executable file for the first drawing operation based on the operation data of the first drawing operation; The file execution module is used to execute the executable file and obtain the replay result of the first drawing operation; The result comparison module is used to compare the replay result of the first drawing operation with the drawing result to obtain the verification result of the first drawing operation; the drawing result includes the execution result of the first drawing operation in the rendering process of the image frame, and the verification result is used to indicate whether the first drawing operation was correctly executed in the rendering process of the image frame.

9. The apparatus according to claim 8, characterized in that, The operation data of the drawing operation includes the metadata of the drawing operation and the resource data of the drawing operation; The file construction module is used to write the metadata of the first drawing operation into a JSON file; Write the resource data of the first drawing operation to the resource file; A source code file is generated based on the JSON file; the source code file is used to perform setting operations based on the metadata of the first drawing operation and the resource data in the resource file; The source code file and the entry source file are compiled to obtain the executable file.

10. The apparatus according to claim 9, characterized in that, The device further includes: The API writing module is used to, when the first drawing operation is a drawing operation that calls the glEnd function, obtain the various application programming interface APIs from the tracking data file of the image frame from the glBegin function corresponding to the glEnd function to the glEnd function; and write the obtained APIs into the entry source file.

11. The apparatus according to claim 9, characterized in that, When the first drawing operation is a drawing operation that calls a core function, the resource data of the first drawing operation includes data uploaded from the CPU to the GPU by the core function.

12. The apparatus according to claim 9, characterized in that, The metadata of the drawing operation includes at least one of the following: Status parameters, data type of resource data, and data format of resource data; The resource data for the drawing operation includes at least one of the following: Texture resources, buffer resources, framebuffer object resources, shader resources.

13. The apparatus according to any one of claims 8 to 12, characterized in that, The file execution module is used to execute the executable file and obtain the tracking data file of the first drawing operation; the tracking data file of the first drawing operation is used to indicate the operation data in the reconstruction process of the first drawing operation; Based on the tracking data file of the first drawing operation, obtain the replay result of the first drawing operation.

14. The apparatus according to any one of claims 8 to 12, characterized in that, The result comparison module is used to obtain the drawing result from the tracking data file of the image frame; compare the replay result of the first drawing operation with the drawing result to obtain the similarity between the replay result of the first drawing operation and the drawing result; The verification result of the first drawing operation is obtained based on the similarity between the replay result of the first drawing operation and the drawing result.

15. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer instruction, which is loaded and executed by the processor to implement the image rendering replay verification method as described in any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer instruction, which is loaded and executed by a processor to implement the image rendering replay verification method as described in any one of claims 1 to 7.

17. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device to implement the image rendering replay verification method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Hybrid ray tracing drawing method and system

    CN112017254A

  • Command stream repeated playback method and device of image frame

    CN119206013A