Image rendering method and device, electronic equipment and storage medium

By forcibly modifying the shear parameters in GPU software modeling and reducing the image rendering area, the high cost problem caused by failing test cases in GPU verification is solved, and the verification efficiency is improved.

CN119784913AActive Publication Date: 2025-04-08MOORE THREADS TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Application Number
CN202411836946.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-08
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

During GPU software modeling, unpassed test cases often require redrawing the entire image for debugging, resulting in high time and labor costs and reducing GPU verification efficiency.

Method used

An image rendering method is proposed. When the test case fails, a smaller image is rendered by forcibly modifying the actual cut parameters, thereby reducing time and labor costs and improving GPU verification efficiency.

Benefits of technology

By forcibly modifying the shear parameters, the rendering area is reduced, which significantly reduces the image rendering time and labor cost and improves the efficiency of GPU verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784913A_ABST
    Figure CN119784913A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer vision, and provides an image rendering method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring primitive information of each primitive in a current test case; obtaining a shearing mode and determining actual shearing parameters of the current test case according to the shearing mode; cutting the primitives in the current test case according to the actual cutting parameters, and updating primitive information according to a cutting result; and rendering the pixels in the actual rendering area according to the updated primitive information to obtain an image. When the current test case is an unpassed test case, the image rendering method can be used for forcibly modifying the actual cutting parameter before the image is rendered, so that a smaller image is rendered, the time cost and the labor cost are reduced, and the GPU verification efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer vision, and in particular to an image rendering method, device, electronic device and storage medium. Background Art

[0002] In the early stages of GPU design, software modeling is often used to verify the functions and performance of GPUs. When modeling software, the GPU needs to be adapted to the mainstream graphics application programming interface (API). In order to meet the specifications, a 100% pass rate is required on the mainstream graphics API test set. In the process of gradually improving the pass rate of the graphics API test set, it is necessary to debug the failed test cases to locate the problems in the software modeling and solve the problems.

[0003] In the past, GPU software modeling usually simulated the partitioning of hardware modules to build software modules. In this case, it is difficult for software developers to conduct joint debugging with architecture designers. Therefore, when a test case fails, usually only the parameters carried by the test case itself can be used to complete the drawing, that is, the entire image needs to be redrawn and the image needs to be checked by both parties to gradually find the wrong pixels before debugging. In practice, it is found that most of the failed test cases are only errors in individual pixels or pixels in individual areas, and it takes several hours or even dozens of hours to draw the entire image. If the entire image is drawn every time debugging is performed, a lot of time and labor costs will be wasted, reducing the efficiency of GPU verification. Summary of the invention

[0004] In view of this, the present disclosure proposes an image rendering method, device, electronic device and storage medium. When the current test case is a failed test case, the image rendering method of the present disclosure can be used to forcibly modify the actual shearing parameters before rendering the image, thereby rendering a smaller image, reducing time and labor costs, and improving GPU verification efficiency.

[0005] According to one aspect of the present disclosure, an image rendering method is provided, the method comprising: obtaining primitive information of each primitive in a current test case; obtaining a shearing mode and determining actual shearing parameters of the current test case according to the shearing mode, when the shearing mode is a forced mode, the size of an actual rendering area corresponding to the actual shearing parameters is less than or equal to the size of a maximum rendering area in the forced mode, and the size of the maximum rendering area is less than the size of a preset rendering area of ​​the current test case; shearing primitives in the current test case according to the actual shearing parameters, and updating the primitive information according to the shearing result; rendering pixels in the actual rendering area according to the updated primitive information to obtain an image.

[0006] In one possible implementation, the obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes: when the shearing mode is a forced mode, using the preset shearing parameters in the forced mode as the actual shearing parameters of the current test case, and the preset shearing parameters in the forced mode correspond to the maximum rendering area in the forced mode.

[0007] In a possible implementation, the obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode include: when the shearing mode is a forced mode, determining the bounding box of each primitive according to the primitive information; determining the maximum rendering area under the forced mode according to preset shearing parameters under the forced mode; calculating the overlapping area between each bounding box and the maximum rendering area under the forced mode; taking the rectangular area with the smallest size including all overlapping areas as the actual rendering area, and determining the actual shearing parameters according to the actual rendering area.

[0008] In a possible implementation, the method of obtaining the cutting mode and determining the actual cutting parameters of the current test case according to the cutting mode further includes: when the cutting mode is a default mode, using the cutting parameters recorded in the current test case as the actual cutting parameters of the current test case, and the cutting parameters recorded in the current test case correspond to a preset rendering area of ​​the current test case.

[0009] In a possible implementation, the obtaining of the cutting mode and determining the actual cutting parameters of the current test case according to the cutting mode further includes: reading a cutting identifier in a configuration file, wherein the cutting identifier indicates the cutting mode; and when the cutting identifier corresponds to a forced mode, reading the cutting parameters in the configuration file as preset cutting parameters in the forced mode.

[0010] In a possible implementation, the clipping parameters include a minimum value of the horizontal coordinate, a maximum value of the horizontal coordinate, a minimum value of the vertical coordinate, and a maximum value of the vertical coordinate; the rendering area corresponding to the clipping parameters is: the area where pixels whose horizontal coordinates are between the minimum value of the horizontal coordinate and the maximum value of the horizontal coordinate and whose vertical coordinates are between the minimum value of the vertical coordinate and the maximum value of the vertical coordinate are located.

[0011] In a possible implementation, before obtaining the graphic element information of each graphic element in the current test case, the method further includes: when the current test case has not been tested, setting the cutting flag in the configuration file to correspond to a default mode.

[0012] In a possible implementation, before obtaining the graphic element information of each graphic element in the current test case, the method also includes: when the current test case has been tested and the test result indicates the existence of erroneous pixels, setting the cropping flag in the configuration file to correspond to the forced mode, and setting the cropping parameters in the configuration file according to the position of the erroneous pixels.

[0013] According to another aspect of the present disclosure, an image rendering device is provided, the device comprising: a pipeline front-end module, used to obtain the primitive information of each primitive in a current test case; a middleware, used to obtain a shearing mode and determine the actual shearing parameters of the current test case according to the shearing mode, when the shearing mode is a forced mode, the size of the actual rendering area corresponding to the actual shearing parameters is less than or equal to the size of the maximum rendering area in the forced mode, and the size of the maximum rendering area is less than the size of the preset rendering area of ​​the current test case; a shearing module, used to shear the primitives in the current test case according to the actual shearing parameters, and update the primitive information according to the shearing result; a rendering module, used to render the pixels in the actual rendering area according to the updated primitive information to obtain an image.

[0014] In one possible implementation, the obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes: when the shearing mode is a forced mode, using the preset shearing parameters in the forced mode as the actual shearing parameters of the current test case, and the preset shearing parameters in the forced mode correspond to the maximum rendering area in the forced mode.

[0015] In a possible implementation, the obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode include: when the shearing mode is a forced mode, determining the bounding box of each primitive according to the primitive information; determining the maximum rendering area under the forced mode according to preset shearing parameters under the forced mode; calculating the overlapping area between each bounding box and the maximum rendering area under the forced mode; taking the rectangular area with the smallest size including all overlapping areas as the actual rendering area, and determining the actual shearing parameters according to the actual rendering area.

[0016] In a possible implementation, the method of obtaining the cutting mode and determining the actual cutting parameters of the current test case according to the cutting mode further includes: when the cutting mode is a default mode, using the cutting parameters recorded in the current test case as the actual cutting parameters of the current test case, and the cutting parameters recorded in the current test case correspond to a preset rendering area of ​​the current test case.

[0017] In a possible implementation, the obtaining of the cutting mode and determining the actual cutting parameters of the current test case according to the cutting mode further includes: reading a cutting identifier in a configuration file, wherein the cutting identifier indicates the cutting mode; and when the cutting identifier corresponds to a forced mode, reading the cutting parameters in the configuration file as preset cutting parameters in the forced mode.

[0018] In a possible implementation, the clipping parameters include a minimum value of the horizontal coordinate, a maximum value of the horizontal coordinate, a minimum value of the vertical coordinate, and a maximum value of the vertical coordinate; the rendering area corresponding to the clipping parameters is: the area where pixels whose horizontal coordinates are between the minimum value of the horizontal coordinate and the maximum value of the horizontal coordinate and whose vertical coordinates are between the minimum value of the vertical coordinate and the maximum value of the vertical coordinate are located.

[0019] In a possible implementation, the device further includes: a first setting module, configured to set the cutting flag in the configuration file to correspond to a default mode before obtaining the graphic element information of each graphic element in the current test case when the current test case has not been tested.

[0020] In one possible implementation, the device also includes: a second setting module, which is used to set the cutting flag in the configuration file to correspond to the forced mode before obtaining the graphic element information of each graphic element in the current test case when the current test case has been tested and the test result indicates the existence of erroneous pixels, and set the cutting parameters in the configuration file according to the position of the erroneous pixels.

[0021] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0022] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0023] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0024] According to the image rendering method of the embodiment of the present disclosure, by obtaining the primitive information of each primitive in the current test case, obtaining the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode, when the shearing mode is the forced mode, the size of the actual rendering area corresponding to the actual shearing parameter is less than or equal to the size of the maximum rendering area in the forced mode, and the size of the maximum rendering area is less than the size of the preset rendering area of ​​the current test case, so that the size of the actual rendering area in the forced mode is adjustable and less than the size of the preset rendering area of ​​the current test case; the primitives in the current test case are sheared according to the actual shearing parameters, and the primitive information is updated according to the shearing result; the pixels in the actual rendering area are rendered according to the updated primitive information to obtain an image, so that the size of the image finally rendered in the forced mode is also less than the size of the image obtained by rendering the pixels in the preset rendering area of ​​the current test case. When the current test case is a failed test case, the image rendering method of the present disclosure can be used to force the modification of the actual shearing parameters before rendering the image, so as to render a smaller image, reduce time cost and labor cost, and improve GPU verification efficiency.

[0025] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0027] Figure 1 An exemplary application scenario of the image rendering method according to an embodiment of the present disclosure is shown.

[0028] Figure 2A schematic diagram showing the process of an image rendering method according to an embodiment of the present disclosure.

[0029] Figure 3 An example of cutting primitives according to an embodiment of the present disclosure is shown.

[0030] Figure 4 An example of further reducing the actual rendering area of ​​the current test case in the forced mode according to an embodiment of the present disclosure is shown.

[0031] Figure 5 A schematic diagram showing the structure of an architecture software model according to an embodiment of the present disclosure.

[0032] Figure 6 A schematic diagram showing the initialization process of the middleware implemented according to the present disclosure.

[0033] Figure 7 A schematic diagram showing the workflow of the middleware in the mandatory mode and the default mode according to the embodiment of the present invention.

[0034] Figure 8 A schematic diagram showing the structure of an image rendering device according to an embodiment of the present disclosure.

[0035] Fig. 9 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0036] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0037] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0038] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0039] In the early stages of GPU design, software modeling is often used to verify the functions and performance of GPUs. Software modeling not only allows for a preliminary evaluation of the potential performance of GPUs, but also provides an early development platform for software developers through a simulation environment. This verification method promotes parallel development of multiple departments and accelerates the GPU design process.

[0040] When software modeling, software developers develop drivers, compilers, firmware programs, etc., and need to adapt the GPU to the mainstream graphics application programming interface (Application Programming Interface, API). Common mainstream graphics APIs include Direct3D, Opengl, Vulkan, etc. In order to meet the specifications, it is necessary to achieve a 100% pass rate on the mainstream graphics API test set. In the process of gradually improving the pass rate of the graphics API test set, it is necessary to debug the failed test cases to locate the problems in the software modeling and solve the problems.

[0041] In the past, GPU software modeling usually used Electronic System-Level Languages ​​(ESL) modeling in C++ frameworks such as SystemC. The software modules were constructed by simulating the segmentation of hardware modules, and the main focus was on the hardware characteristics of the model, such as clock, bandwidth, cache hit rate, etc. In this case, it is difficult for software developers to jointly debug with architecture designers. Therefore, when a test case fails, it is usually only possible to use the clipping parameters carried by the test case itself to complete the drawing, that is, the entire image needs to be redrawn and the image needs to be checked by both parties. After gradually finding the wrong pixels, debugging can be performed. In practice, it is found that most of the failed test cases are only errors in individual pixels or pixels in individual areas, and it takes several hours or even dozens of hours to draw the entire image. If the entire image is drawn every time debugging is performed, a lot of time and labor costs will be wasted, reducing the efficiency of GPU verification.

[0042] In view of this, the present disclosure proposes an image rendering method, device, electronic device and storage medium. When the current test case is a failed test case, the image rendering method of the present disclosure can be used to forcibly modify the actual shearing parameters before rendering the image, thereby rendering a smaller image, reducing time and labor costs, and improving GPU verification efficiency.

[0043] Figure 1 An exemplary application scenario of the image rendering method according to an embodiment of the present disclosure is shown.

[0044] like Figure 1 As shown, during the GPU development process, a complete simulation environment including an architecture software model will be provided to software developers. The simulation environment is usually packaged in a container (docker) or other environment packaging tools. The simulation environment includes an architecture simulator. Software developers need to start the architecture simulator first, inject the driver (including test cases) into the architecture simulator, and the architecture simulator will perform simulation. The architecture simulator mainly consists of two parts, one is the client system (GuestOS), which is an operating system provided to software developers for simulation, and the other is the device side (Device), which is a GPU device simulated by the architecture software model.

[0045] The image rendering method of the disclosed embodiment can be executed by an architecture software model. The architecture software model can determine the shearing mode and shearing parameters by reading the configuration file, and can complete operations such as vertex shading, primitive assembly, primitive shearing, rasterization (pixel rendering) according to the instructions in the issued driver, and finally obtain an image. The shearing mode and shearing parameters determine the specific shearing method of the primitive.

[0046] Figure 2 A schematic diagram showing the process of an image rendering method according to an embodiment of the present disclosure.

[0047] like Figure 2 As shown, in a possible implementation, the present disclosure proposes an image rendering method, the method comprising:

[0048] Step S21, obtaining the graphic element information of each graphic element in the current test case;

[0049] Step S22, obtaining a shearing mode and determining actual shearing parameters of the current test case according to the shearing mode, when the shearing mode is a forced mode, the size of the actual rendering area corresponding to the actual shearing parameters is less than or equal to the size of the maximum rendering area in the forced mode, and the size of the maximum rendering area is less than the size of the preset rendering area of ​​the current test case;

[0050] Step S23, cutting the graphic element in the current test case according to the actual cutting parameters, and updating the graphic element information according to the cutting result;

[0051] Step S24, rendering the pixels in the actual rendering area according to the updated primitive information to obtain an image.

[0052] For example, after starting to execute the current test case, step S21 may be executed to obtain the primitive information of each primitive in the current test case. The primitive information may include the vertex coordinates corresponding to the primitive, so the position of any primitive in space can be determined according to the primitive information of the primitive.

[0053] Next, step S22 can be executed to first obtain the shearing mode, and determine the actual shearing parameters of the current test case according to the shearing mode. The shearing modes supported by the image rendering method of the present disclosure include forced mode. In the forced mode, software developers are allowed to set preset shearing parameters in the forced mode, and the preset shearing parameters correspond to the maximum rendering area in the forced mode. The size and position of the maximum rendering area can be adjusted by adjusting the value of the preset shearing parameter, so that the size of the maximum rendering area in the forced mode is smaller than the size of the preset rendering area of ​​the current test case. The size of the actual rendering area corresponding to the actual shearing parameters actually used in the forced mode may be less than or equal to the size of the maximum rendering area in the forced mode. In this case, the size of the actual rendering area of ​​the current test case is necessarily smaller than the size of the preset rendering area of ​​the current test case.

[0054] After determining the actual clipping parameters of the current test case, step S23 can be executed to clip the primitives in the current test case according to the actual clipping parameters, and update the primitive information according to the clipping results. The actual clipping parameters correspond to the actual rendering area. When clipping primitives, only the primitives that partially overlap with the actual rendering area need to be clipped, and the parts that overlap with the actual rendering area are retained. New vertices will be generated after the primitives are clipped, so the primitive information of the clipped primitives needs to be updated.

[0055] Figure 3 An example of cutting primitives according to an embodiment of the present disclosure is shown.

[0056] like Figure 3 As shown, primitive 1 includes vertex A, vertex B, and vertex C. Vertex A is within the actual rendering area, and vertices B and C are outside the actual rendering area. Therefore, primitive 1 and the actual rendering area partially overlap. When clipping, the overlapped part of primitive 1 and the actual rendering area is retained, vertices B and vertices C are invalid, and new vertices E and F are generated. Then the updated primitive information of primitive 1 may include the vertex coordinates of vertex A, vertex E, and vertex F.

[0057] In addition to the clipped primitives, there are also primitives that are entirely within the actual rendering area and primitives that are entirely outside the actual rendering area. The primitives that are entirely within the actual rendering area are still valid and their primitive information does not need to be updated. The primitives that are entirely outside the actual rendering area are invalid and their primitive information can be removed.

[0058] After completing the update of the primitive information, step S24 can be executed to render the pixels in the actual rendering area according to the updated primitive information to obtain an image. The rendering process may include steps such as rasterization and pixel shading, which can be implemented based on the existing technology and will not be repeated here. The size of the image finally rendered is equal to the size of the actual rendering area. Since the size of the actual rendering area is smaller than the size of the preset rendering area of ​​the current test case, the size of the image rendered by the current test case in the forced mode is also smaller than the size of the image rendered by the pixels in the preset rendering area of ​​the current test case.

[0059] According to the image rendering method of the embodiment of the present disclosure, by obtaining the primitive information of each primitive in the current test case, obtaining the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode, when the shearing mode is the forced mode, the size of the actual rendering area corresponding to the actual shearing parameter is less than or equal to the size of the maximum rendering area in the forced mode, and the size of the maximum rendering area is less than the size of the preset rendering area of ​​the current test case, so that the size of the actual rendering area in the forced mode is adjustable and less than the size of the preset rendering area of ​​the current test case; the primitives in the current test case are sheared according to the actual shearing parameters, and the primitive information is updated according to the shearing result; the pixels in the actual rendering area are rendered according to the updated primitive information to obtain an image, so that the size of the image finally rendered in the forced mode is also less than the size of the image obtained by rendering the pixels in the preset rendering area of ​​the current test case. When the current test case is a failed test case, the image rendering method of the present disclosure can be used to force the modification of the actual shearing parameters before rendering the image, so as to render a smaller image, reduce time cost and labor cost, and improve GPU verification efficiency.

[0060] In a possible implementation, obtaining the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes:

[0061] When the clipping mode is the forced mode, the preset clipping parameters in the forced mode are used as the actual clipping parameters of the current test case, and the preset clipping parameters in the forced mode correspond to the maximum rendering area in the forced mode.

[0062] For example, the preset clipping parameters in the forced mode can be set by the software developer and correspond to the maximum rendering area in the forced mode. Since the size of the maximum rendering area in the forced mode is already smaller than the size of the preset rendering area of ​​the current test case, the preset clipping parameters in the forced mode can be directly used as the actual clipping parameters of the current test case.

[0063] In this case, the actual rendering area and the maximum rendering area in the forced mode are the same area, and the size of the rendered image is equal to the size of the maximum rendering area in the forced mode, which is smaller than the size of the image rendered by rendering the pixels in the preset rendering area of ​​the current test case.

[0064] In a possible implementation, obtaining the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes:

[0065] When the clipping mode is the forced mode, the bounding box of each primitive is determined according to the primitive information;

[0066] Determine the maximum rendering area in forced mode according to the preset clipping parameters in forced mode;

[0067] Calculate the overlap area between each bounding box and the maximum rendering area in forced mode;

[0068] A rectangular area including all overlapping areas and having the smallest size is taken as the actual rendering area, and the actual shearing parameters are determined according to the actual rendering area.

[0069] For example, the primitives in the current test case may not cover the entire maximum rendering area in the forced mode, but may only cover a portion of the maximum rendering area in the forced mode. In other words, it may not be necessary to render all pixels in the maximum rendering area in the forced mode, and the size of the actual rendering area may be smaller than the size of the maximum rendering area in the forced mode.

[0070] Therefore, when determining the actual shearing parameters of the current test case in the forced mode, the bounding box of each primitive can be determined according to the primitive information, wherein the bounding box of the primitive refers to the minimum bounding box that can accommodate all the vertices of the primitive. The bounding box of the primitive can be an axis-aligned bounding box. And the maximum rendering area in the forced mode is determined according to the preset shearing parameters in the forced mode. Next, the overlapping area of ​​each bounding box and the maximum rendering area in the forced mode is calculated (equal to the logical AND operation result of each bounding box and the maximum rendering area), and the rectangular area with the smallest size including all overlapping areas is used as the actual rendering area, and the actual shearing parameters are determined according to the actual rendering area. The relationship between the shearing parameters and the rendering area is given later.

[0071] Figure 4 An example of further reducing the actual rendering area of ​​the current test case in the forced mode according to an embodiment of the present disclosure is shown.

[0072] like Figure 4As shown, assuming that the current test case includes primitive 1 and primitive 2, the maximum rendering area in the forced mode is rectangle abcd. The bounding box of primitive 1 is rectangle efgh, and the overlapping area with rectangle abcd is rectangle ahgi. The bounding box of primitive 2 is rectangle jkmn, and the overlapping area with rectangle abcd is rectangle obpn. Assuming that the horizontal coordinates of points i, g, n, and p are the same, in this case, the rectangular area that includes all overlapping areas and has the smallest size can be rectangle abpi. Rectangle abpi can be used as the actual rendering area of ​​the current test case. At this time, the actual rendering area of ​​the current test case is smaller than the maximum rendering area in the forced mode, so that the size of the final rendered image is also smaller.

[0073] In a possible implementation, obtaining the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode further includes:

[0074] When the clipping mode is the default mode, the clipping parameters recorded in the current test case are used as the actual clipping parameters of the current test case, and the clipping parameters recorded in the current test case correspond to the preset rendering area of ​​the current test case.

[0075] For example, in actual application scenarios, software developers may also wish not to force modification of the cropping parameters when testing the current test case, but to directly use the cropping parameters recorded in the current test case. In this regard, the present disclosure also provides another cropping mode, namely the default mode. When the cropping mode is the default mode, the cropping parameters recorded in the current test case can be directly used as the actual cropping parameters of the current test case. The cropping parameters recorded in the current test case correspond to the preset rendering area of ​​the current test case, so the size of the image rendered in the default mode can be equal to the size of the preset rendering area of ​​the current test case, making the size of the rendered image larger.

[0076] In this way, the image rendering method disclosed in the present invention supports both a rendering method of forcibly modifying the shearing parameters before rendering the image and a conventional rendering method of not modifying the shearing parameters, thereby expanding the application scenarios of the image rendering method.

[0077] In a possible implementation, obtaining the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes:

[0078] Read the cutting mark in the configuration file, where the cutting mark indicates the cutting mode;

[0079] When the cutting identifier corresponds to the forced mode, the cutting parameters in the configuration file are read as the preset cutting parameters in the forced mode.

[0080] For example, a shearing flag may be set in a configuration file to indicate a shearing mode. Since the actual shearing parameters in the forced mode are determined according to the preset shearing parameters in the forced mode, when the shearing flag corresponds to the forced mode, the preset shearing parameters in the forced mode may be further set in the configuration file, and the preset shearing parameters correspond to the maximum rendering area in the forced mode. An example of the preset shearing parameters is given in Table 1.

[0081] In this case, the architecture software model can obtain the cropping mode by reading the cropping identifier in the configuration file. When the cropping identifier corresponds to the forced mode, the preset cropping parameters in the configuration file can be read and the preset cropping parameters in the forced mode can be determined according to the preset cropping parameters. For an example of the maximum rendering area corresponding to the preset cropping parameters in the forced mode, see Figure 4 Related description.

[0082] When the cutting identifier corresponds to the default mode, the cutting parameters recorded in the current test case can be used directly without further reading the configuration file.

[0083] In this way, the amount of information read from the configuration file can be reduced, reducing data transmission costs.

[0084] An example of clipping parameters and rendering areas corresponding to the clipping parameters is given below.

[0085] In a possible implementation, the shearing parameters include a minimum abscissa value, a maximum abscissa value, a minimum ordinate value, and a maximum ordinate value;

[0086] The rendering area corresponding to the clipping parameter is: the area where the pixels whose horizontal coordinates are between the minimum value and the maximum value of the horizontal coordinate and whose vertical coordinates are between the minimum value and the maximum value of the vertical coordinate are located.

[0087] For example, the clipping parameters may include a minimum abscissa value X_min, a maximum abscissa value X_max, a minimum ordinate value Y_min, and a maximum ordinate value Y_max. The rendering area corresponding to the clipping parameters may be a rectangular area. X_min may be used as the abscissa value of the lower left corner and the upper left corner of the rendering area, and X_max may be used as the abscissa value of the lower right corner and the upper right corner of the rendering area; Y_min may be used as the ordinate value of the lower left corner and the lower right corner of the rendering area, and Y_max may be used as the ordinate value of the upper left corner and the upper right corner of the rendering area. Therefore, the rendering area corresponding to the clipping parameters is the area where the pixels whose abscissas are between the minimum abscissa value and the maximum abscissa value and whose ordinates are between the minimum ordinate value and the maximum ordinate value are located.

[0088] The configuration file may be in the form of a YAML file. Table 1 shows an example of a configuration file in the mandatory mode.

[0089] Table 1

[0090] Cutting mark / preset cutting parameters Numeric Force_scissor_on 1 X_min -30 X_max 30 Y_min -20 Y_max 20

[0091] As shown in Table 1, Force_scissor_on may be a shear flag. When the value of the shear flag is "0", it corresponds to the default mode, and when the value of the shear flag is "1", it corresponds to the forced mode.

[0092] When the value of the clipping flag is "1", the clipping parameters in the configuration file (minimum value of the horizontal coordinate X_min, maximum value of the horizontal coordinate X_max, minimum value of the vertical coordinate Y_min, maximum value of the vertical coordinate Y_max) are valid. In the example of Table 1, X_min = -30, X_max = 30, Y_min = -20, Y_max = 20, so the coordinates of the four corner points of the rectangular rendering area corresponding to the clipping parameters are (-30, -20), (-30, 20), (30, -20), (30, 20) respectively.

[0093] When the value of the shear flag is "0", the shear parameter in the configuration file is invalid. At this time, the value of the shear parameter in the configuration file can be cleared, or the value of the shear parameter can be left unchanged, as long as the shear parameter in the configuration file is not read any further. The present disclosure does not limit the specific value of the shear parameter in the configuration file in the default mode.

[0094] Those skilled in the art should understand that the numerical value of the cut flag should be more than the above examples, as long as the numerical value of the cut flag in the default mode and the forced mode is different, and the present disclosure does not limit the specific numerical value of the cut flag.

[0095] In a possible implementation, before obtaining the graphic element information of each graphic element in the current test case, the method further includes:

[0096] When the current test case is not tested, the cut flag in the configuration file is set to correspond to the default mode.

[0097] For example, when the current test case has not been tested, the software developer may want to draw the entire image before testing the test case to check whether there are any erroneous pixels. In this case, it can be determined that the current test case needs to be tested in the default mode.

[0098] The software developer can set the clipping flag in the configuration file to correspond to the default mode, and then control the architecture simulation model to start executing the driver including the current test case, use the clipping parameters recorded in the current test to draw an image with a size equal to the size of the preset rendering area of ​​the current test case, and obtain the test result of the current test case in the default mode based on the image. The test result records information such as whether there are erroneous pixels in the image and the position of the erroneous pixels in the image.

[0099] If the test result indicates that there are no erroneous pixels in the image, then the current test case does not need to be tested again, and the next test case can be tested. If the test result indicates that there are erroneous pixels in the image, it can be determined that the current test case needs to be tested in the forced mode at least once more.

[0100] In a possible implementation, before obtaining the graphic element information of each graphic element in the current test case, the method further includes:

[0101] When the current test case has been tested and the test result indicates that there are erroneous pixels, the clipping flag in the configuration file is set to correspond to the forced mode, and the clipping parameters in the configuration file are set according to the location of the erroneous pixels.

[0102] For example, when the current test case has been tested and the test result indicates that there are erroneous pixels, the clipping flag in the configuration file can be set to correspond to the forced mode. Then, the clipping parameters in the configuration file (i.e., the preset clipping parameters in the forced mode) are set according to the position of the erroneous pixels, so that the rendering area corresponding to the clipping parameters (i.e., the maximum rendering area in the forced mode) includes at least one erroneous pixel.

[0103] When setting the clipping parameters in the configuration file, the size of the maximum rendering area in the forced mode, W×H, can be determined first, where W represents the width of the maximum rendering area and H represents the height of the maximum rendering area. Then, according to the position of the erroneous pixels, it can be determined whether all the erroneous pixels are displayed in the same screen of size W×H.

[0104] In one example, if the difference between the maximum value of the horizontal coordinate and the minimum value of the horizontal coordinate of all erroneous pixels is less than or equal to W, and the difference between the maximum value of the vertical coordinate and the minimum value of the vertical coordinate is less than or equal to H, it means that all erroneous pixels can be displayed in the same screen with a size of W×H. If the difference between the maximum value of the horizontal coordinate and the minimum value of the horizontal coordinate of all erroneous pixels is greater than W, or the difference between the maximum value of the vertical coordinate and the minimum value of the vertical coordinate is greater than H, it means that all erroneous pixels cannot be displayed in the same screen with a size of W×H.

[0105] When all erroneous pixels can be displayed in the same screen of size W×H, the current test case can be tested in forced mode. The maximum value of the horizontal coordinate of all erroneous pixels can be set to the maximum value of the horizontal coordinate in the shearing parameters of the configuration file, and the maximum value of the vertical coordinate of all erroneous pixels can be set to the maximum value of the vertical coordinate in the shearing parameters of the configuration file. The minimum value of the horizontal coordinate in the shearing parameters can be equal to the difference between the maximum value of the horizontal coordinate in the shearing parameters and W, and the minimum value of the vertical coordinate in the shearing parameters can be equal to the difference between the maximum value of the vertical coordinate in the shearing parameters and H. After that, the architecture software model executes steps S21-S24 to complete the image rendering, analyzes the cause of the pixel error based on the rendered image, and obtains the test result of this test.

[0106] For example, assuming that the size of the maximum rendering area in forced mode is 60×40, the coordinates of the erroneous pixels are (20, 10), (30, 30), (50, 40), W=60, H=40. Then the maximum value of the horizontal coordinates of all erroneous pixels is 50, and the minimum value is 10; the maximum value of the vertical coordinates of all erroneous pixels is 40, and the minimum value is 10. Since 50-20=30<60, 40-10=30<40, all erroneous pixels can be displayed in the same screen with a size of 60×40. The shearing parameters in the configuration file can be set as: X_min=-10, X_max=50, Y_min=0, Y_max=40.

[0107] Those skilled in the art should understand that when all erroneous pixels can be displayed in the same screen of size W×H, it is sufficient to use the maximum value of the horizontal coordinate (or the minimum value of the horizontal coordinate) of all erroneous pixels as the maximum value of the horizontal coordinate (or the minimum value of the horizontal coordinate) in the shearing parameters, and the maximum value of the vertical coordinate (or the minimum value of the vertical coordinate) of all erroneous pixels as the maximum value of the vertical coordinate (or the minimum value of the vertical coordinate) in the shearing parameters, and make the minimum value of the horizontal coordinate in the shearing parameters equal to the difference between the maximum value of the horizontal coordinate in the shearing parameters and W, and the minimum value of the vertical coordinate in the shearing parameters equal to the difference between the maximum value of the vertical coordinate in the shearing parameters and H. The embodiments of the present disclosure do not limit the specific values ​​of each shearing parameter.

[0108] When all the incorrect pixels cannot be displayed in the same screen with a size of W×H, it is possible to continue to determine the minimum number K of screens that can display all the incorrect pixels and have a size less than or equal to W×H, and perform K tests on the current test case in the forced mode. Before the w-th test in the forced mode, set the clipping parameters in the configuration file according to the w-th screen. During the w-th test in the forced mode, render the w-th screen, where 0 < w ≤ K and w is an integer. The clipping parameters used to render the w-th screen can correspond to a rendering area with the same size as that of the screen. The clipping parameters used to render each screen can be determined according to the prior art, and the determination method of the clipping parameters used to render each screen will not be elaborated here.

[0109] Among the clipping parameters used to render the w-th screen, the minimum abscissa value can be equal to the difference between the maximum abscissa value and the width of the w-th screen, and the minimum ordinate value can be equal to the difference between the maximum ordinate value and the height of the w-th screen. The pixels included in each screen can partially overlap or not overlap at all, and the present disclosure does not limit this.

[0110] Those skilled in the art should understand that the test results of the current test case in the default mode can also be submitted to the software developers, and the software developers can manually set the clipping flag in the configuration file to correspond to the forced mode and manually set the clipping parameters in the configuration file according to the positions of the incorrect pixels. In this way, the test of the current test case in the forced mode can be started according to the needs of the software developers, and the setting of the clipping parameters is more flexible.

[0111] After the test of any test case is completed, the architecture emulator runs to an end. It is possible to wait until the configuration file is reconfigured and then start the architecture emulator again, send the driver program to the architecture software model, and the architecture software model reads the configuration file and tests the test cases in the driver program.

[0112] The structures of the traditional architecture software model and the architecture software model of the embodiments of the present disclosure will be introduced below. Figure 5 A schematic diagram showing the structure of the architecture software model according to an embodiment of the present disclosure.

[0113] As Figure 5As shown, the architecture software model of the embodiment of the present disclosure may include a pipeline front-end module, a cutting module and a rendering module. The pipeline front-end module is responsible for vertex shading and primitive assembly to obtain primitive information; the cutting module is responsible for cutting primitives according to cutting parameters and updating primitive information; the rendering module is used to render pixels in the rendering area corresponding to the cutting parameters according to the updated primitive information. The architecture software model of the embodiment of the present disclosure also adds a middleware between the pipeline front-end module and the cutting module, which is used to read the configuration file and force the modification of the cutting parameters in a specific cutting mode. The middleware can be integrated in the GPU pipeline architecture modeling, but it is not used as a reference for hardware design. As a backdoor, it can break through the design limitations to modify the primitive cutting method of the software architecture model.

[0114] The middleware can be used as the front interface of the cutting module. When the cutting mode is the forced mode, it can read the cutting parameters in the configuration file and send them to the cutting module to achieve the effect of forcibly changing the pipeline data of the architecture software model.

[0115] Figure 6 A schematic diagram showing the initialization process of the middleware implemented according to the present disclosure.

[0116] like Figure 6 As shown, when the architecture software model starts to initialize, the middleware also starts to initialize. During the middleware initialization process, the cut identifier in the configuration file is first read, and the cut mode is determined according to the cut identifier. If the cut identifier corresponds to the mandatory mode, the cut parameters in the configuration file are read again. After reading the cut parameters, the cut mode is set to the mandatory mode, and the initialization of the middleware is completed. If the cut identifier corresponds to the default mode, the cut mode can be directly set to the default mode.

[0117] Figure 7 A schematic diagram showing the workflow of the middleware in the mandatory mode and the default mode according to the embodiment of the present invention.

[0118] like Figure 7 As shown, in the forced mode, the middleware can determine the actual shearing parameters according to the shearing parameters in the configuration file that has been read. For example, the bounding box of each primitive is first determined according to the primitive information, and the maximum rendering area in the forced mode is determined according to the shearing parameters in the configuration file. Then, the overlapping area of ​​each bounding box and the maximum rendering area is calculated through logical AND operation, and the rectangular area with the smallest size including all overlapping areas is taken as the actual rendering area, and the actual shearing parameters are determined according to the actual rendering area. Then, the actual shearing parameters and primitive information are sent to the shearing module.

[0119] In the default mode, the middleware directly sends the acquired primitive information and the preset cutting parameters recorded in the current test case to the cutting module. At this time, the preset cutting parameters are the actual cutting parameters.

[0120] The clipping module can complete the clipping of primitives according to the primitive information and clipping parameters received from the middleware, and update the primitive information according to the clipping results. Among them, in the mandatory mode, the clipping parameters received by the clipping module are the actual clipping parameters determined by the middleware. The clipping module will "mistakenly believe" that the valid information of each primitive in the current test case only exists within the actual rendering area corresponding to the actual clipping parameters, and thus clip the primitives outside the actual rendering area corresponding to the actual clipping parameters. The updated primitive information can continue to be sent to the rendering module.

[0121] The rendering module can complete the rendering of pixels according to the primitive information received from the clipping module and output the rendered image. Among them, since the updated primitive information only retains the primitive information of the primitive within the actual rendering area corresponding to the actual clipping parameters, only the pixels within the actual rendering area need to be rendered during rendering, that is, during rasterization, only the pixels within the actual rendering area will be subjected to triangle traversal and other operations, thus reducing the number of rendered pixels, reducing the size of the rendered image, greatly improving the calculation speed, and saving calculation time. In addition, the wrong pixels are more obvious in smaller images, which makes it easier to highlight the wrong pixels.

[0122] Those skilled in the art should understand that in the architecture software model, the upstream module also sends information and instructions to the downstream module to be used when the downstream module works, so that the downstream module can work normally. The specific information sent by the upstream module to the downstream module will not be repeated here.

[0123] Those skilled in the art should understand that the architecture software model may also include more modules. For example, a test result generation module may be included after the rendering module, which is used to generate test results based on the rendered images, etc. The embodiments of the present disclosure do not limit what specific modules the architecture software module includes.

[0124] By setting up middleware as a backdoor of the architecture software model, the transparency and controllability of the architecture software model for software developers are improved.

[0125] The present disclosure also provides an image rendering device, Figure 8 A schematic diagram showing the structure of an image rendering device according to an embodiment of the present disclosure.

[0126] like Figure 8 As shown, in a possible implementation, the device includes:

[0127] The pipeline front module 81 is used to obtain the primitive information of each primitive in the current test case;

[0128] The middleware 82 is used to obtain a shearing mode and determine actual shearing parameters of a current test case according to the shearing mode, and when the shearing mode is a forced mode, the size of an actual rendering area corresponding to the actual shearing parameters is less than or equal to the size of a maximum rendering area in the forced mode, and the size of the maximum rendering area is less than the size of a preset rendering area of ​​the current test case;

[0129] A cutting module 83, used for cutting the graphic element in the current test case according to the actual cutting parameters, and updating the graphic element information according to the cutting result;

[0130] The rendering module 84 is used to render the pixels in the actual rendering area according to the updated primitive information to obtain an image.

[0131] The image rendering device can be equivalent to Figure 5 The architectural software model shown.

[0132] In one possible implementation, the obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes: when the shearing mode is a forced mode, using the preset shearing parameters in the forced mode as the actual shearing parameters of the current test case, and the preset shearing parameters in the forced mode correspond to the maximum rendering area in the forced mode.

[0133] In a possible implementation, the obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode include: when the shearing mode is a forced mode, determining the bounding box of each primitive according to the primitive information; determining the maximum rendering area under the forced mode according to preset shearing parameters under the forced mode; calculating the overlapping area between each bounding box and the maximum rendering area under the forced mode; taking the rectangular area with the smallest size including all overlapping areas as the actual rendering area, and determining the actual shearing parameters according to the actual rendering area.

[0134] In a possible implementation, the method of obtaining the cutting mode and determining the actual cutting parameters of the current test case according to the cutting mode further includes: when the cutting mode is a default mode, using the cutting parameters recorded in the current test case as the actual cutting parameters of the current test case, and the cutting parameters recorded in the current test case correspond to a preset rendering area of ​​the current test case.

[0135] In a possible implementation, the obtaining of the cutting mode and determining the actual cutting parameters of the current test case according to the cutting mode further includes: reading a cutting identifier in a configuration file, wherein the cutting identifier indicates the cutting mode; and when the cutting identifier corresponds to a forced mode, reading the cutting parameters in the configuration file as preset cutting parameters in the forced mode.

[0136] In a possible implementation, the clipping parameters include a minimum value of the horizontal coordinate, a maximum value of the horizontal coordinate, a minimum value of the vertical coordinate, and a maximum value of the vertical coordinate; the rendering area corresponding to the clipping parameters is: the area where pixels whose horizontal coordinates are between the minimum value of the horizontal coordinate and the maximum value of the horizontal coordinate and whose vertical coordinates are between the minimum value of the vertical coordinate and the maximum value of the vertical coordinate are located.

[0137] In a possible implementation, the device further includes: a first setting module, configured to set the cutting flag in the configuration file to correspond to a default mode before obtaining the graphic element information of each graphic element in the current test case when the current test case has not been tested.

[0138] In one possible implementation, the device also includes: a second setting module, which is used to set the cutting flag in the configuration file to correspond to the forced mode before obtaining the graphic element information of each graphic element in the current test case when the current test case has been tested and the test result indicates the existence of erroneous pixels, and set the cutting parameters in the configuration file according to the position of the erroneous pixels.

[0139] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0140] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0141] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0142] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0143] Fig. 9 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Fig. 9 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions that can be executed by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0144] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM or similar.

[0145] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0146] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0147] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0148] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0149] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0150] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0151] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0152] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0153] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0154] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. An image rendering method, characterized in that: The method comprises: Get the graphic element information of each graphic element in the current test case; Acquire a shearing mode and determine actual shearing parameters of a current test case according to the shearing mode, where, when the shearing mode is a forced mode, a size of an actual rendering area corresponding to the actual shearing parameters is less than or equal to a size of a maximum rendering area under the forced mode, and the size of the maximum rendering area is less than a size of a preset rendering area of ​​the current test case; Cutting the graphic element in the current test case according to the actual cutting parameters, and updating the graphic element information according to the cutting result; The pixels in the actual rendering area are rendered according to the updated primitive information to obtain an image.

2. The method according to claim 1, characterized in that The obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes: When the shearing mode is the forced mode, the preset shearing parameters in the forced mode are used as the actual shearing parameters of the current test case, and the preset shearing parameters in the forced mode correspond to the maximum rendering area in the forced mode.

3. The method according to claim 1, characterized in that The obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode includes: When the clipping mode is a forced mode, determining a bounding box of each primitive according to the primitive information; Determine the maximum rendering area in forced mode according to the preset clipping parameters in forced mode; Calculate the overlap area between each bounding box and the maximum rendering area in the forced mode; A rectangular area including all overlapping areas and having the smallest size is used as the actual rendering area, and the actual shearing parameters are determined according to the actual rendering area.

4. The method according to claim 1, characterized in that: The obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode also includes: When the cutting mode is the default mode, the cutting parameters recorded in the current test case are used as the actual cutting parameters of the current test case, and the cutting parameters recorded in the current test case correspond to the preset rendering area of ​​the current test case.

5. The method according to any one of claims 2 to 4, characterized in that: The obtaining of the shearing mode and determining the actual shearing parameters of the current test case according to the shearing mode also includes: Reading a cutting mark in a configuration file, wherein the cutting mark indicates the cutting mode; When the cutting identifier corresponds to the forced mode, the cutting parameters in the configuration file are read as the preset cutting parameters in the forced mode.

6. The method according to claim 5, characterized in that The shearing parameters include a minimum abscissa value, a maximum abscissa value, a minimum ordinate value, and a maximum ordinate value; The rendering area corresponding to the clipping parameter is: an area where pixels whose horizontal coordinates are between the minimum horizontal coordinate value and the maximum horizontal coordinate value and whose vertical coordinates are between the minimum vertical coordinate value and the maximum vertical coordinate value are located.

7. The method according to claim 5, characterized in that Before obtaining the graphic element information of each graphic element in the current test case, the method further includes: When the current test case has not been tested, the cut flag in the configuration file is set to correspond to the default mode.

8. The method according to claim 5, characterized in that Before obtaining the graphic element information of each graphic element in the current test case, the method further includes: When the current test case has been tested and the test result indicates that there are erroneous pixels, the shearing flag in the configuration file is set to correspond to the forced mode, and the shearing parameters in the configuration file are set according to the position of the erroneous pixels.

9. An image rendering device, characterized in that: The device comprises: The pipeline front module is used to obtain the primitive information of each primitive in the current test case; The middleware is used to obtain a shearing mode and determine actual shearing parameters of a current test case according to the shearing mode, wherein when the shearing mode is a forced mode, the size of an actual rendering area corresponding to the actual shearing parameters is less than or equal to the size of a maximum rendering area under the forced mode, and the size of the maximum rendering area is less than the size of a preset rendering area of ​​the current test case; A cutting module, used for cutting the graphic element in the current test case according to the actual cutting parameters, and updating the graphic element information according to the cutting result; The rendering module is used to render the pixels in the actual rendering area according to the updated primitive information to obtain an image.

10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 8 when executing the instructions stored in the memory.

11. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Clipping of graphics primitives

    CN104933749A

  • Method and device for improving graphic rendering efficiency and computer storage medium

    CN111179151A

  • Debugging method and device for rendering problem, equipment and storage medium

    CN115357516A

  • Graph rendering method and device

    CN117501312A

  • Interface display method and display equipment

    CN117827337A

Cited By

  • Coordinate processing system and method, chip and electronic equipment

    CN122368192A