Simulation method, simulation system and equipment for primitive processing and storage medium
By using transaction-level modeling and element-elimination modules to process structured data in GPU pipeline modeling, the problem of high module coupling in the existing technology is solved, the module reusability and scalability are improved, and the program operation efficiency is improved.
Patent Information
- Application Number
- CN202411943879.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-22
AI Technical Summary
The existing GPU pipeline modeling is based on hardware details, resulting in high coupling between modules, limiting the reusability and scalability of modules, and increasing the workload of development and maintenance.
Transaction-level modeling is adopted, and structured data is received and processed at different element processing stages through the element culling module, simplifying data transmission and communication between modules and improving the level of abstraction.
It improves the reusability and scalability of the primitive culling module, simplifies data transmission and processing processes, reduces development and maintenance costs, and improves program operation efficiency.
Smart Images

Figure CN119861926A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to, but is not limited to, the field of graphics processing technology, and in particular to a simulation method, simulation system, device and storage medium for primitive processing. Background Art
[0002] In the early stages of GPU (Graphics Processing Unit) development, software modeling is required to abstract the GPU hardware rendering process, simulate the hardware execution process, and verify the GPU's functions and performance. This process can not only quickly evaluate the GPU design, but also provide a development and verification platform for software developers, improve the efficiency of multi-department parallel development, and thus shorten the R&D and iteration cycle of the entire project.
[0003] In the GPU modeling process, a set of standard GPU rendering command interfaces must be provided to software developers, and hardware parsing and execution of rendering commands must be simulated in the GPU pipeline. The modeling process of the GPU pipeline is usually called "electronic device level (ESL) modeling", which is the core process of GPU modeling. The primitive culling module (Culling) is an indispensable part of the GPU pipeline, and its processing speed and accuracy will directly affect the operating efficiency of subsequent rendering modules. Summary of the invention
[0004] In view of this, the embodiments of the present disclosure provide a simulation method, simulation system, device and storage medium for primitive processing, which improve the reusability and scalability of modules, simplify data transmission between modules, and improve program operation efficiency while accurately eliminating illegal primitives.
[0005] An embodiment of the present disclosure provides a simulation system, comprising: a primitive culling module; wherein the primitive culling module is configured to receive corresponding structured data in different primitive processing stages, and perform culling operations on multiple structured data received in different primitive processing stages, and output culling results; wherein the primitive culling module and multiple structured data are all generated based on transaction-level modeling; and the data formats of multiple structured data are consistent.
[0006] In the above scheme, each parameter of the structured data includes: a primitive and a culling status word; the culling status word is used to indicate the operation type of the culling operation of the primitive; the primitive culling module is also configured to perform a culling operation on the primitive in the structured data based on the culling status word, and generate and output a culling result.
[0007] In the above scheme, the primitive culling module includes: a culling pipeline, a culling scheme pool and a vector operation submodule; wherein the culling scheme pool is configured to store culling methods; the culling pipeline is configured to traverse the culling status word and call the culling method corresponding to the culling status word; the vector operation submodule is configured to store a vector operation set and perform corresponding vector operations on the primitives based on the culling method.
[0008] In the above scheme, the parameters of the structured data also include: primitive coordinates, geometric control words and screen size; the primitive culling module includes: multiple first interfaces; the primitive culling module receives the structured data through multiple first interfaces; wherein the same parameter is transmitted through a corresponding one of the first interfaces.
[0009] In the above scheme, there is a primitive clipping module and a preprocessing simulation module; wherein the preprocessing simulation module is configured to receive the data to be processed, and perform a first preprocessing on the data to be processed, and generate a first structured data for the logic before clipping; the primitive culling module is configured to perform a first culling operation on the primitives in the first structured data, and generate a first culling result; the primitive clipping module is configured to perform a clipping operation on the primitives in the first culling result; the preprocessing simulation module is also configured to perform a second preprocessing on the first culling result after completing the clipping operation, and generate a second structured data for the logic after clipping; wherein the generation process of the second structured data masks the state of the clipping operation; the data formats of the first structured data and the second structured data are consistent, and both are generated based on transaction-level modeling; the primitive culling module is also configured to perform a second culling operation on the primitives in the second structured data, and generate and output a second culling result.
[0010] In the above scheme, the pre-processing simulation module is also configured to analyze the culling type of the primitives in the data to be processed based on the primitive information of the data to be processed and the status of the cropping operation, and convert the culling type into a first culling status word; and, based on the primitive information of the first culling result, analyze the culling type of the primitives in the first culling result, and convert the culling type into the second culling status word; wherein the primitive information includes: the type of primitive and the direction of the primitive.
[0011] In the above scheme, the pre-processing simulation module is also configured to perform precision conversion on the coordinates of the primitive; and to encapsulate the coordinates of the primitive that has completed the precision conversion into a vector, and store the vector in the primitive.
[0012] In the above scheme, the simulation system also includes: a viewport conversion module; wherein the viewport conversion module is configured to receive the data to be processed and convert the coordinates of the graphic elements in the data to be processed from a three-dimensional coordinate system to a two-dimensional plane coordinate system.
[0013] In the above scheme, the simulation system is encapsulated in a carrier of a virtual platform; the virtual platform includes: a virtual host and a virtual device; wherein the virtual device includes: firmware and a memory management module; the virtual host includes: driver software; the virtual host is configured to access the virtual device through the driver software, issue rendering instructions to the firmware, and store related graphics elements in the memory management module.
[0014] The disclosed embodiment also provides a simulation method for primitive processing, comprising: receiving corresponding structured data in different primitive processing stages; wherein the multiple structured data received in the different primitive processing stages are all generated based on transaction-level modeling; the data formats of the multiple structured data are consistent; and performing a culling operation on the multiple structured data received in the different primitive processing stages, and outputting the culling result.
[0015] In the above scheme, the parameters of the structured data include: graphics elements and culling status words; performing culling operations on multiple structured data received at different graphics element processing stages and outputting culling results, including: traversing the culling status words and calling the culling method corresponding to the culling status words; performing vector operations on the graphics elements based on the culling methods to generate the culling results; and outputting and displaying the culling results.
[0016] In the above scheme, the simulation method also includes: based on the primitive information of the primitive and the status of the cropping operation, analyzing the culling type of the primitive, and converting the culling type into the culling status word; wherein the primitive information includes: the type of primitive and the direction of the primitive.
[0017] An embodiment of the present disclosure provides 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 an electronic device, a processor in the electronic device executes the steps in the simulation method described in any of the above schemes.
[0018] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the simulation method described in any of the above schemes are implemented.
[0019] An embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the simulation method described in any of the above solutions are implemented.
[0020] In the disclosed embodiment, the simulation system includes a primitive culling module. The primitive culling module is configured to receive corresponding structured data in different primitive processing stages, and perform culling operations on multiple structured data received in different primitive processing stages, and output culling results; wherein the primitive culling module and multiple structured data are both generated based on transaction-level modeling; and the data formats of the multiple structured data are consistent.
[0021] Thus, in the first aspect, both the primitive culling module and the structured data are modeled at the transaction level. Thus, compared with the register transfer level model in the related art, the embodiment of the present disclosure improves the abstraction level of the primitive culling module, simplifies the communication between the primitive culling module and other modules, reduces the workload of development and maintenance, and improves the program running efficiency.
[0022] Secondly, the data formats of multiple structured data are consistent. Therefore, the primitive removal module can exchange data with other modules more smoothly, reduce errors and exceptions caused by data format mismatch, and ensure that the primitive removal module can perform removal operations on structured data at different primitive processing stages. In addition, the disclosed embodiment can simplify the data transmission and processing process, reduce the overhead of data conversion and format verification, and improve the operating efficiency of the overall system.
[0023] Thirdly, the present disclosure can reuse the primitive culling module to perform culling operations on structured data at different primitive processing stages. Thus, the reusability of the primitive culling module can be improved. Moreover, the embodiments of the present disclosure do not require repeated writing of the primitive culling module, which can reduce code redundancy. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the structure of the primitive culling module provided in the embodiment of the present disclosure Figure 1 ;
[0025] Figure 2 A schematic diagram of the structure of the primitive culling module provided in the embodiment of the present disclosure Figure 2 ;
[0026] Figure 3 A schematic diagram of a swimming lane of a primitive culling module provided in an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram of the structure of the simulation system provided in the embodiment of the present disclosure Figure 1 ;
[0028] Figure 5A schematic diagram of the structure of the simulation system provided in the embodiment of the present disclosure Figure 2 ;
[0029] Figure 6 A schematic diagram of the structure of a virtual platform provided in an embodiment of the present disclosure;
[0030] Figure 7 Schematic diagram of the simulation method provided in the embodiment of the present disclosure Figure 1 ;
[0031] Figure 8 Schematic diagram of the simulation method provided in the embodiment of the present disclosure Figure 2 ;
[0032] Fig. 9 Schematic diagram of the simulation method provided in the embodiment of the present disclosure Figure 3 ;
[0033] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present disclosure. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0035] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0036] If similar descriptions of "first / second" appear in the application documents, the following description is added. In the following description, the terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing the embodiments of the present disclosure and are not intended to limit the present disclosure.
[0038] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0039] In the related art, the modeling of GPU pipeline is usually based on the underlying hardware. For example, the GPU pipeline is a register transfer level model. In addition, the model in the related art simulates the data transmission of the hardware through the data and event interaction between modules. Due to the limitation of hardware details, there is a high degree of coupling between the construction of modules, so it is difficult to separate the module from the system for use; thus, the module reusability and scalability in ESL modeling are limited, and the workload of system development and maintenance is increased. At the same time, hardware-based modeling requires code abstraction and optimization to be zero-loss or loss-controllable, which restricts the improvement of program efficiency. There are a large number of redundant modules in the current hardware-level modeling. For example, the primitive culling modules such as the two primitive culling before and after primitive clipping need to be written repeatedly, resulting in multiple modules with highly similar functions in the model, causing code redundancy. This is not only not conducive to the readability of the software, but also affects the scalability of the system. In addition, hardware-based modeling pays more attention to program details, and the front end cannot provide software developers with truly valuable information in real time, thereby increasing the difficulty of the software debugging process.
[0040] Figure 1 4 is a schematic diagram of the structure of an optional primitive culling module 40 provided in an embodiment of the present disclosure. It should be noted that the primitive culling module 40 and the structured data received by the primitive culling module 40 are generated based on transaction level modeling (TLM). For example, the communication function and the calculation function of the primitive culling module 40 can be separated. The primitive culling module 40 can communicate with other modules in the system through structured data, and the primitive culling module 40 can independently complete the calculation of structured data within it.
[0041] In the embodiments of the present disclosure, reference Figure 1The primitive culling module 40 is configured to receive corresponding structured data in different primitive processing stages. For example, two primitive cullings before and after primitive clipping generate first structured data and second structured data respectively. For another example, frustum culling, back-face culling, and occlusion culling are performed in different processing stages, respectively, and corresponding structured data can be generated.
[0042] The data formats of the multiple structured data in different primitive processing stages are consistent. The data formats of the multiple structured data can be shown in the following Table 1:
[0043] name type Points Vector <point> < / point> Geometry_state GeometryState& Culling state word (Culling_state) Uint32_t Screen size (Screen_size) Point
[0044] Table 1
[0045] It should be noted that in Table 1, “Primitive” includes the two-dimensional plane coordinates of each vertex of the primitive; “Vector <point>" indicates that the coordinates of the primitive are packaged coordinates. In Table 1, "Geometry Control Word" is used to store parameters such as primitive type and triangle retention direction; "GeometryState&" is a custom structure for detailed reference of subsequent culling operations. The culling state word is used to indicate the type of culling operation. The culling state word can be a multi-bit encoding, and each bit corresponds to a type of culling operation; "Uint32_t" represents unsigned 32-bit integer data. "Screen size" is used to determine the range of the screen interface (ie: the length and width of the screen); "Point" consists of two unsigned 32-bit integer data.
[0046] In the embodiments of the present disclosure, reference Figure 1 The primitive culling module 40 can perform culling operations on multiple structured data received at different primitive processing stages, and output culling results. For example, the primitive culling module 40 can perform vector operations on primitives encapsulated as vectors by traversing the culling status word of the first structured data (or the second structured data) bit by bit, calling the vector operation method (such as addition, subtraction, inner product and cross multiplication) corresponding to the culling status word, and outputting the vector operation result, that is, outputting the culling result.
[0047] It is understandable that the primitive culling module 40 and the structured data are both transaction-level modeling. Thus, compared with the register transfer level model in the related art, the embodiment of the present disclosure improves the abstraction level of the primitive culling module, simplifies the communication between the primitive culling module and other modules, reduces the workload of development and maintenance, and improves the program running efficiency.
[0048] At the same time, the data formats of multiple structured data are consistent. In this way, the primitive removal module can exchange data with other modules more smoothly, reduce errors and exceptions caused by data format mismatch, and ensure that the primitive removal module can perform removal operations on structured data at different primitive processing stages. In addition, the disclosed embodiment can simplify the data transmission and processing process, reduce the overhead of data conversion and format verification, and thus improve the operating efficiency of the overall system.
[0049] In addition, the disclosed embodiment can reuse the primitive culling module to perform culling operations on structured data at different primitive processing stages. Thus, the disclosed embodiment can improve the reusability of the primitive culling module. Moreover, the disclosed embodiment does not need to repeatedly write the primitive culling module, which can reduce code redundancy.
[0050] Figure 2 and Figure 3 is an optional schematic diagram of the primitive culling module 40 provided in the embodiment of the present disclosure; wherein, Figure 2 The internal architecture of the primitive culling module 40 is shown; Figure 3 The diagram shows the mutual calling relationship among the submodules in the internal architecture of the primitive culling module 40 .
[0051] In some embodiments of the present disclosure, reference Figure 2 The primitive culling module 40 is also configured to perform a culling operation on the primitives in the structured data based on the culling status word, and generate and output a culling result.
[0052] In the embodiment of the present disclosure, combined with Table 1 and Figure 2 , each parameter of structured data includes a primitive and a culling status word. The culling status word is used to indicate the operation type of the primitive culling operation. For example, Figure 2 The culling pipeline 410 of the primitive culling module 40 can call multiple designated culling methods corresponding to the culling status word by traversing the culling status word bit by bit. Then, the culling scheme pool 420 calls the operation set in the vector operation submodule 430 based on the culling method to perform vector operations on the primitives in the structured data and generate vector operation results (i.e., culling results).
[0053] In some embodiments of the present disclosure, reference Figure 2 The primitive culling module 40 includes a culling pipeline (CullingPipeline) 410, a culling method pool (Culling Method Pool) 420, a vector operation submodule (VectorOperations) 430 and a log (Log) generation submodule 440.
[0054] In the present disclosure, in combination Figure 2 and Figure 3 The culling scheme pool 420 is configured to store culling methods. The culling scheme pool 420 can store all available culling methods, such as edge culling, degenerate primitive culling, backface primitive culling, screen periphery culling, clipping culling, small primitive culling, and super small primitive culling.
[0055] In the present disclosure, in combination Figure 2 and Figure 3 The vector operation submodule 430 is configured to store a vector operation set and perform corresponding vector operations on the primitives based on the culling method. Vector operations are commonly used to represent and process the position, direction and transformation of graphic objects. Common vector operations include vector addition, vector subtraction, vector dot multiplication and vector cross multiplication.
[0056] In the present disclosure, in combination Figure 2 and Figure 3 , the culling pipeline 410 is configured to traverse the culling status word and call the culling method corresponding to the culling status word. The culling pipeline 410 is configured to parse the primitives, culling status words, screen size and other parameter information of the data to be processed. The culling pipeline 410 calls multiple specified culling methods corresponding to the culling status word by traversing the culling status word bit by bit. Then, the culling scheme pool 420 calls the operation set in the vector operation submodule 430 based on the culling method to perform vector operations. Finally, the culling pipeline 410 organizes the results and intermediate values of the culling method, and sends the results and intermediate values of the culling method to the pipeline simulation module 10 to execute the subsequent rendering process.
[0057] In the present disclosure, in combination Figure 2 and Figure 3 The log generation submodule 440 is configured to receive the result of the vector operation and convert the result of the vector operation into a log, that is, the log generation submodule 440 prints the log. The log generation submodule 440 can convert the culling results and intermediate values of the culling pipeline into a log and display the log.
[0058] It is understandable that each submodule in the primitive culling module 40 communicates through function calls, and the computing function and the communication function are separated. In other words, the primitive culling module 40 is a transaction level modeling (TLM). In this way, compared with the register transfer level model in the related art, the embodiment of the present disclosure improves the abstraction level of the primitive culling module, simplifies the communication between modules, reduces the workload of development and maintenance, and improves the program running efficiency.
[0059] At the same time, the culling scheme pool 420 and the vector operation submodule 430 store culling methods and vector operation sets respectively. The culling methods and vector operation sets are codes used frequently in the primitive culling process. In other words, the embodiment of the present disclosure encapsulates high-frequency codes. Thus, the redundancy of the code can be reduced, the readability of the code can be improved, and the code can be made easier to maintain.
[0060] In addition, the log generation submodule 440 can print key information (culling results and intermediate values of the culling pipeline) to the screen in real time. In this way, the disclosed embodiment facilitates software developers to track primitive culling operations and debug software. At the same time, the disclosed embodiment is transaction-level modeling, shielding hardware details, and thus, there is no complex hardware detail information such as hardware interrupts and registers in the log, making the log information clearer and easier to understand. Therefore, it is easier to discover and understand the execution process and detection problems of primitive culling.
[0061] Figure 4 and Figure 5 is a schematic diagram of an optional simulation system 100 provided in an embodiment of the present disclosure. Figure 4 and Figure 5 The middle primitive culling module 40 is used to model the workflow of primitive culling of the GPU pipeline. Figure 4 and Figure 5 The middle primitive clipping module 50 is used to model the workflow of primitive clipping of the GPU pipeline. Figure 4 and Figure 5 The pipeline simulation module 10 is used to model the remaining work processes of the GPU pipeline except primitive culling and primitive clipping. For example, the pipeline simulation module 10 can perform vertex processing and geometry shader processing before the first culling operation, and the pipeline simulation module 10 can perform rasterization processing after the second culling operation.
[0062] Figure 4 and Figure 5 The primitive culling module 40 , the viewport conversion module 20 , the preprocessing simulation module 30 , the primitive clipping module 50 and the pipeline simulation module 10 may all be programs. Figure 4 The preprocessing simulation module 30 may include a plurality of preprocessing simulation submodules. For example, Figure 4 The pre-processing simulation module 30 may include Figure 5 The first preprocessing simulation module 310 and the second preprocessing simulation module 320 in the embodiment of the present invention can respectively complete two preprocessings before and after the primitive clipping.
[0063] It should also be noted that Figure 4 The preprocessing simulation module 30 may also include only one preprocessing simulation submodule. The preprocessing simulation submodule can complete two preprocessings before and after the primitive is cut. In this way, during the two elimination operations before and after the cutting operation, the embodiment of the present disclosure can reuse one preprocessing simulation submodule to complete the preprocessing operation. Thus, the reusability and scalability of the module can be further improved. Correspondingly, the reusability and portability of the code can be further improved. In addition, the embodiment of the present disclosure does not need to repeatedly write the preprocessing simulation module, which can reduce the redundancy of the code.
[0064] In the embodiments of the present disclosure, refer to Table 1 and Figure 4 , the parameters of the structured data also include geometric control words and screen size. During the primitive culling operation performed by the primitive culling module 40, the primitive culling module 40 determines the size of the object or vertex on the screen by the received screen size, thereby culling the primitives that are too small. The primitive culling module 40 can determine the type of primitive, the direction of the triangle to be retained (front culling and back culling) and other information by the geometric control word, so as to perform culling calculations according to the requirements of the front end (the geometric control word comes from the front end). The primitive culling module 40 can determine which vertices in the primitive are inside the viewing cone and which are outside the viewing cone by the coordinates of the received primitive.
[0065] In some embodiments of the present disclosure, reference Figure 4 The primitive removal module 40 includes a plurality of first interfaces. The same parameter is transmitted through a corresponding first interface. For example, Figure 5 The first pre-processing simulation module 310 and the second pre-processing simulation module 320 transmit data to the primitive culling module 40 through multiple first interfaces. The primitive, the geometric control word, the culling state word, and the screen size can be transmitted to the primitive culling module 40 through a corresponding interface. In other words, the same type of elements in the first structured data and the second structured data are transmitted to the primitive culling module 40 through a corresponding first interface.
[0066] It should be noted that the first pre-processing simulation module 310 and the second pre-processing simulation module 320 have the same interface type to the primitive culling module 40, namely primitive coordinates, geometric control words, culling status words and screen size. The difference lies in the different post-processing interface values for different cropping states.
[0067] It is understandable that the data transmission between the preprocessing simulation module and the primitive culling module of the embodiment of the present disclosure is completed through the interface, and each interface transmits parameters of the corresponding type. In this way, the embodiment of the present disclosure can increase the cohesion of the module by means of interface isolation. Thereby, the module's dependence on external interaction is reduced, and further, the coupling between modules is reduced.
[0068] In the embodiments of the present disclosure, reference Figure 4 , the simulation system 100 may include a viewport transformation module (View Port Transformation) 20. The pipeline simulation module 10 may pass the data to be processed to the viewport transformation module 20. The viewport transformation module 20 is configured to transform the primitives in the data to be processed from a three-dimensional coordinate system to a two-dimensional plane coordinate system. In this way, in the subsequent primitive culling process, the simulation system 100 can determine whether the primitives in the data to be processed are visible on the screen interface according to the screen size and the two-dimensional plane coordinates of the primitives.
[0069] In the embodiments of the present disclosure, reference Figure 4 , the primitive removal module 40 is used to remove illegal primitives in the data to be processed during the rendering process. For example, illegal primitives include degenerate triangles, primitives that exceed the screen range, and primitives that are too small. Take the removal of primitives that exceed the screen range as an example: the primitive removal module 40 can determine whether the primitive is within the screen interface by the two-dimensional plane coordinates of the primitive. If the primitive is completely outside the screen interface, it can be directly removed without subsequent processing and rendering. The disclosed embodiment performs primitive removal and reduces the amount of data. Therefore, in subsequent processing and rendering, the disclosed embodiment helps to reduce the bandwidth occupancy rate of data transmission and ensure the quality of image rendering.
[0070] In the embodiments of the present disclosure, reference Figure 4 , the simulation system 100 also includes a preprocessing simulation module (CullingPreprocessor) 30 and a primitive clipping module (Clipper) 50. The primitive clipping module 50 is used to remove the part that exceeds the screen interface from the primitive during the rendering process to ensure that only the visible part of the primitive is rendered. For example, in the process of the primitive clipping module clipping the primitives in the first culling result, if a primitive is only partially located in the screen interface, it is necessary to clip the primitive, retain the part of the primitive in the screen interface, and remove the part of the primitive outside the screen interface. In other words, in order to improve the rendering efficiency and the accuracy of the culling results, the primitive culling module 40 needs to perform a culling operation before and after the clipping operation.
[0071] In the embodiments of the present disclosure, reference Figure 4 Before the data to be processed is clipped, the preprocessing simulation module 30 can receive the data to be processed and perform a first preprocessing on the data to be processed to generate a first structured data. After the data to be processed is clipped, the preprocessing simulation module 30 is further configured to perform a second preprocessing on the first elimination result after the clipping operation to generate a second structured data. The first structured data and the second structured data can be as shown in Table 1 above. For example, Figure 5 The first preprocessing simulation module 310 shown is configured to perform a first preprocessing. The second preprocessing simulation module 320 is configured to perform a second preprocessing. That is, the first preprocessing simulation module 310 and the second preprocessing simulation module 320 preprocess the data transmitted to the primitive culling module 40 before and after the clipping operation is completed.
[0072] In the embodiments of the present disclosure, reference Figure 4 , the parameters of the first structured data may include a first rejection status word. The parameters of the second structured data may include a second rejection status word. For example, referring to Table 1, the first rejection status word and the second rejection status word are both the rejection status words in Table 1. The first rejection status word and the second rejection status word may both have encodings of multiple bits with different values. The encodings of different values correspond to different types of rejection operations. Thus, in the subsequent rejection operation process, the primitive rejection module 40 can confirm the type of rejection operation required for the primitive by identifying the first rejection status word (or the second rejection status word).
[0073] In the embodiments of the present disclosure, reference Figure 4 , the state of the clipping operation is used to record and control the clipping operation of the primitive. The state of the clipping operation may include a clipping window, a current polygon, and a current clipping result, etc. The preprocessing simulation module 30 may shield the state of the clipping operation during the generation process of the second structured data. For example, the preprocessing simulation module 30 may fix the numerical value of the encoding of part of the clipping operation corresponding to the second culling state word to 0. Thus, the embodiment of the present disclosure can simplify the calculation process of the primitive culling module.
[0074] In the present disclosure, in combination Figure 4 As shown in Table 1, before the processing data is clipped, the primitive removal module 40 may perform a first removal operation on the primitives in the first structured data based on the first removal status word to generate a first removal result. After the processing data is clipped, the primitive clipping module 40 may perform a second removal operation on the primitives in the second structured data based on the second removal status word to generate and output a second removal result. For example, the primitive removal module 40 may identify the multi-bit encoded value of the first removal status word (or the second removal status word) and perform a corresponding type of removal operation on the primitives in the first structured data (or the second structured data).
[0075] It can be understood that the preprocessing simulation module 30, the primitive culling module 40 and the primitive clipping module 50 of the simulation system 100 in the embodiment of the present disclosure respectively perform preprocessing operations, primitive culling operations and primitive clipping operations. In other words, the functions of each module in the simulation system 100 are independent of each other. Correspondingly, the codes corresponding to each module in the simulation system 100 are also independent of each other. In this way, the embodiment of the present disclosure is more convenient for code expansion and maintenance; thereby, the workload of system development and maintenance is reduced.
[0076] In addition, the preprocessing simulation unit preprocesses the received data to generate structured data; and the structured data simplifies the type of the elimination operation into the form of a status word for storage. In this way, the embodiment of the present disclosure simplifies the data transmission between modules. Thus, the program running efficiency is improved.
[0077] In some embodiments of the present disclosure, reference Figure 4 The pre-processing simulation module 30 is further configured to analyze the rejection type of the primitives in the data to be processed based on the primitive information of the data to be processed and the state of the cropping operation, and convert the rejection type into a first rejection state word. For example, before the cropping operation is completed, Figure 5 The first pre-processing simulation module 310 shown can analyze the elimination process of the primitive based on the primitive information and the state of the clipping operation of the primitive, and convert the elimination process into a first elimination state word. The primitive information may include the type of the primitive and the direction of the primitive. Then, Figure 5 The first pre-processing simulation module 310 shown packs the screen size, primitives, geometric control words and the first culling state word into first structured data, and sends the first structured data to the primitive culling module 40 for primitive culling operation. Figure 5 The first pre-processing simulation module 310 shown receives the first culling result generated by the primitive culling module 40 , and sends the first culling result to the primitive clipping module 50 .
[0078] In the embodiments of the present disclosure, reference Figure 4 The pre-processing simulation module 30 is further configured to analyze the culling type of the primitive in the first culling result based on the primitive information of the first culling result, and convert the culling type into a second culling status word. For example, after the cropping operation is completed, Figure 5 The second pre-processing simulation module 320 shown can analyze the culling type of the primitive based on the primitive information of the primitive, and convert the culling process corresponding to the culling type into a second culling state word. Then, Figure 5 The second pre-processing simulation module 320 shown packs the screen size, primitives, geometric control words and the second culling state words into second structured data, and sends the second structured data to the primitive culling module 40 for primitive culling operation. Figure 5 The second preprocessing simulation module 320 receives the second culling result generated by the primitive culling module 40 and sends the second culling result to the pipeline simulation module 10. In this way, the generation process of the second structured data shields the state of the clipping operation, which can simplify the calculation process of the primitive culling module 40.
[0079] In some embodiments of the present disclosure, reference Figure 4 The pre-processing simulation module 30 is also configured to perform precision conversion on the coordinates of the primitives. For example, the pre-processing simulation module 30 can perform precision conversion on the coordinates of the primitives in the received data (the data to be processed or the first culling result after the culling operation is completed) before and after the clipping operation is completed. In this way, the present disclosure can ensure that the precision of the coordinates of the primitives is consistent with the precision of the screen size. Thus, the accuracy of the culling operation is improved.
[0080] In the embodiments of the present disclosure, reference Figure 4 The preprocessing simulation module 30 is further configured to encapsulate the coordinates of the primitives that have completed the precision conversion into vectors, and store the vectors in the primitives. For example, the preprocessing simulation module 30 can encapsulate the coordinates of the primitives that have completed the precision conversion into vectors in the received data (the data to be processed or the first elimination result after the clipping operation is completed) before and after the clipping operation is completed, and store the vectors in the primitives. Thus, the data can be further simplified.
[0081] Figure 6 It is a schematic diagram of the structure of another optional virtual platform 500 provided in an embodiment of the present disclosure.
[0082] In some embodiments of the present disclosure, reference Figure 6 , the simulation system 100 can be encapsulated in the carrier of the virtual platform 500. For example, the virtual platform 500 can use QEMU as a carrier. The firmware 301, the simulation system 100 and the memory management module 302 can be packaged into a library, and the library is further encapsulated in the carrier of the virtual platform 500.
[0083] In the embodiments of the present disclosure, reference Figure 6 , the virtual device 300 includes firmware 301, a memory management module (MMU) 302 and a simulation system 100. The simulation system 100 and the firmware 301 may be formed based on transaction level modeling.
[0084] In the embodiments of the present disclosure, reference Figure 6 , the virtual host 200 includes a driver software 201. The virtual host 200 accesses the virtual device 300 through the operating device driver software 201. The virtual host 200 is configured to access the virtual device 300 through the driver software 201, issue rendering instructions to the firmware 301, and store related graphics primitives in the memory management module 302. The simulation system 100 parses the rendering instructions and executes the rendering process corresponding to the rendering instructions. The virtual host 200 can be an environment developed by software developers, and it is also a development space provided by the present disclosure for software developers. In this way, the simulation system 100 is formed by adopting a combination of the GPU software model and the ESL model. The strategy of encapsulating the entire simulation system 100 into a virtual machine provides software developers with a simulation platform that is closer to the actual hardware environment. Therefore, the embodiments of the present disclosure can reduce the cycle of software development and updating, and provide developers with a more flexible and practical development environment.
[0085] Figure 7 A flowchart of an optional simulation method provided for an embodiment of the present disclosure will be described in conjunction with each step.
[0086] S101. In different primitive processing stages, corresponding structured data are received; wherein the multiple structured data received in different primitive processing stages are all generated based on transaction-level modeling; and the data formats of the multiple structured data are consistent.
[0087] In the embodiments of the present disclosure, reference Figure 1 The different primitive processing stages may be two primitive culling stages before and after primitive clipping. The primitive culling module 40 may receive the first structured data before generating primitive clipping and receive the second structured data after primitive clipping.
[0088] S102, performing a culling operation on a plurality of structured data received at different primitive processing stages, and outputting a culling result.
[0089] In the embodiments of the present disclosure, reference Figure 1 The primitive culling module 40 can perform culling operations on multiple structured data received at different primitive processing stages, and output culling results. For example, the primitive culling module 40 can perform vector operations on primitives encapsulated as vectors by traversing the culling status word of the first structured data (or the second structured data) bit by bit, calling the vector operation method (such as addition, subtraction, inner product and cross multiplication) corresponding to the culling status word, and outputting the vector operation result, that is, outputting the culling result.
[0090] Thus, compared with the register transfer level model in the related art, the embodiment of the present disclosure improves the abstraction level of the primitive culling module, simplifies the communication between the primitive culling module and other modules, reduces the workload of development and maintenance, and improves the program running efficiency. At the same time, the embodiment of the present disclosure can simplify the data transmission and processing process, reduce the overhead of data conversion and format verification, and thus improve the running efficiency of the overall system. In addition, the embodiment of the present disclosure can improve the reusability of the primitive culling module. Moreover, the embodiment of the present disclosure does not need to repeatedly write the primitive culling module, which can reduce the redundancy of the code.
[0091] In some embodiments of the present disclosure, steps S201 to S203 may be used to implement Figure 1 S102 shown will be described in conjunction with each step.
[0092] S201, traverse the elimination status word, and call the elimination method corresponding to the elimination status word.
[0093] In the embodiments of the present disclosure, reference Figure 2 The culling pipeline 410 traverses the first culling status word (or the second culling status word) bit by bit, calls the culling method specified by the first culling status word (or the second culling status word), and performs culling operations corresponding to the primitives in the first structured data (or the second structured data).
[0094] S202: Based on the culling method, perform vector operations on the primitives to generate culling results.
[0095] In the embodiments of the present disclosure, reference Figure 2 The culling scheme pool 420 can call the culling method corresponding to the vector operation in the vector operation submodule 430, perform a culling operation on the primitives in the first structured data (or the second structured data), and generate a first culling result (or a second culling result).
[0096] S203: Output and display the elimination result.
[0097] In the embodiments of the present disclosure, reference Figure 2 and Figure 4 , the elimination scheme pool 420 can organize the elimination results and intermediate values corresponding to the elimination methods. In addition, the elimination scheme pool 420 can send the first elimination result and the second elimination result to the preprocessing simulation module 30, and then the preprocessing simulation module 30 sends the second elimination result to the pipeline simulation module 10 to execute the subsequent rendering process. The elimination scheme pool 420 can also send the first elimination result and the second elimination result to the log generation submodule 440, and the log generation submodule 440 prints the first elimination result and the second elimination result as a log and displays the log on the screen.
[0098] In some embodiments of the present disclosure, the simulation method may also be implemented through S501, which will be described in conjunction with each step.
[0099] S501. Analyze the culling type of the primitive based on the primitive information and the state of the clipping operation, and convert the culling type into a culling state word; wherein the primitive information includes: the type of the primitive and the direction of the primitive.
[0100] In the embodiments of the present disclosure, reference Figure 4 , the primitive information includes the type of primitive (such as a line segment, a triangle or a rectangle, etc.) and the direction of the primitive (such as the direction of the line segment, the direction of the polygon). The clipping operation refers to determining which primitives or parts of primitives should be in the display area and which should be excluded during the graphic display process. Its status reflects the specific situation of clipping, such as whether the clipping is completed, the boundary of the clipping, etc. The pre-processing simulation module 30 can determine whether the primitive needs to be removed and in what way it is removed based on the primitive information and the clipping operation status. For example, before the clipping operation is performed, if the primitive is completely outside the clipping area, it may be a "completely removed" type; if the primitive is partially inside the clipping area and partially outside, it may be a "partially removed" type; then, all the removal types of the primitive are converted into the corresponding first removal status word. After the clipping operation is performed, since the clipping has been completed, the pre-processing simulation module 30 can fix the value of the part of the code corresponding to the clipping operation in the second removal status word to 0.
[0101] In the embodiments of the present disclosure, reference Figure 4 The preprocessing simulation module 30 preprocesses the information such as the primitives, screen size and the state of the cropping operation of the to-be-processed data, and passes the preprocessing result (first structured data) to the primitive culling module 40. The primitive culling module 40 directly calculates the culling result (first culling result) and returns it to the preprocessing simulation module 30. Subsequently, the preprocessing simulation module 30 passes the first culling result to the primitive cropping module 50.
[0102] Specifically, it can be done by Figure 8 S301 to S306 are shown to implement S501, which will be described in conjunction with each step.
[0103] S301, receiving parameters such as primitives, screen size, state of cropping operation and geometry control word.
[0104] S302: Coordinate precision conversion.
[0105] S303. The coordinates are uniformly packaged into vectors and stored in the primitives.
[0106] In the embodiments of the present disclosure, reference Figure 5 The first preprocessing simulation module 310 can perform a first preprocessing on the data to be processed. In the first preprocessing process, the first preprocessing simulation module 310 can perform precision conversion on the coordinates of the primitives in the data to be processed, and encapsulate the coordinates of the primitives that have completed the precision conversion into vectors, and store the vectors in the primitives.
[0107] S304: Analyze the required culling type according to the primitive information and the state of the clipping operation, and store it in a culling state word.
[0108] In the embodiments of the present disclosure, reference Figure 5 The first pre-processing simulation module 310 can analyze the elimination process of the primitive based on the primitive information and the state of the clipping operation of the primitive, and convert the elimination process into a first elimination state word. The primitive information includes: the type of the primitive and the direction of the primitive.
[0109] S305: Send the primitive, the culling status word and the screen size to the primitive culling module.
[0110] S306: Send the elimination result to the primitive clipping module.
[0111] In the embodiments of the present disclosure, reference Figure 5 , the first preprocessing simulation module 310 can pack the first culling state word, the primitive, the geometric control word and the screen size into the first structured data. Then, the first preprocessing simulation module 310 sends the first structured data to the primitive culling module 40. The primitive culling module 40 performs a primitive culling operation on the first structured data to generate a first culling result. Finally, the first preprocessing simulation module 310 receives the first culling result generated by the primitive culling module 40, and transmits the first culling result to the primitive clipping module 50.
[0112] In the embodiments of the present disclosure, reference Figure 4 , the primitive clipping module 50 clips the primitives in the first culling result, and passes the clipped primitives to the preprocessing simulation module 30. The preprocessing simulation module 30 also performs a second preprocessing on the primitives and other information. The state of the clipping operation is shielded during the second preprocessing. The preprocessing simulation module 30 passes the packaged data (second structured data) to the primitive culling module 40. The primitive culling module 40 further processes the primitive culling result, and finally sends it to the pipeline simulation block 10 for subsequent rendering operations.
[0113] Specifically, you can also Fig. 9 S401 to S406 are shown to implement S501, which will be described in conjunction with each step.
[0114] S401, receiving parameters such as primitives, screen size, and geometric control words.
[0115] S402: Coordinate precision conversion.
[0116] S403. The coordinates are uniformly packaged into vectors and stored in the primitives.
[0117] In the embodiments of the present disclosure, reference Figure 5 The second preprocessing simulation module 320 can perform a second preprocessing on the first culling result after the clipping operation is completed. In the second preprocessing process, the second preprocessing simulation module 320 can perform precision conversion on the coordinates of the primitives in the first culling result after the clipping operation is completed, and encapsulate the coordinates of the primitives that have completed the precision conversion into vectors, and save the vectors in the primitives.
[0118] S404: Analyze the required culling type according to the primitive information and store it in a culling status word.
[0119] In the embodiments of the present disclosure, reference Figure 5 In the second preprocessing process, the second preprocessing simulation module 320 can also analyze the elimination process of the primitive based on the primitive information of the primitive, and convert the elimination process into a second elimination status word. That is, the second preprocessing simulation module 320 shields the state of the clipping operation in the process of generating the second elimination status word.
[0120] S405: Send the primitive, the culling status word and the screen size to the primitive culling module.
[0121] S406, sending the elimination result to the pipeline simulation module.
[0122] In the embodiments of the present disclosure, reference Figure 5 , the second pre-processing simulation module 320 can pack the second culling state word, the primitive, the geometric control word and the screen size into the second structured data. Then, the second pre-processing simulation module 320 sends the second structured data to the primitive culling module 40. The primitive culling module 40 performs a primitive culling operation on the second structured data to generate a second culling result. Finally, the second pre-processing simulation module 320 receives the second culling result generated by the primitive culling module 40 and transmits the second culling result to the pipeline simulation module 10.
[0123] It should be noted that, in the embodiments of the present disclosure, if the above-mentioned simulation method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present disclosure is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0124] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0125] The embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.
[0126] An embodiment of the present disclosure provides a computer program, including a computer-readable code. When the computer-readable code is executed in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0127] The present disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0128] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.
[0129] Fig.10 A hardware entity diagram of a computer device 400 provided in an embodiment of the present disclosure is shown in FIG. Fig.10 As shown, the hardware entity of the computer device 400 includes: a processor 401 and a memory 402, wherein the memory 402 stores a computer program that can be run on the processor 401, and the processor 401 implements the steps in the method of any of the above embodiments when executing the program.
[0130] The memory 402 stores computer programs that can be run on the processor. The memory 402 is configured to store instructions and applications executable by the processor 401. It can also cache data to be processed or processed by the processor 401 and various modules in the computer device 400 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0131] When the processor 401 executes the program, the steps of any of the above simulation methods are implemented. The processor 401 generally controls the overall operation of the computer device 400.
[0132] An embodiment of the present disclosure provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the simulation method of any of the above embodiments.
[0133] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0134] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, which is not specifically limited in the embodiments of the present disclosure.
[0135] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0136] The serial numbers of the embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments. The methods disclosed in the several method embodiments provided by the present disclosure can be arbitrarily combined without conflict to obtain new method embodiments. The features disclosed in the several product embodiments provided by the present disclosure can be arbitrarily combined without conflict to obtain new product embodiments. The features disclosed in the several method or device embodiments provided by the present disclosure can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0137] The above description is only a specific implementation mode of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure.< / point>
Claims
1. A simulation system, characterized in that: The simulation system includes: a primitive culling module; wherein, The primitive culling module is configured to receive corresponding structured data in different primitive processing stages, and perform culling operations on a plurality of structured data received in different primitive processing stages, and output culling results; wherein, The primitive culling module and the plurality of structured data are all generated based on transaction-level modeling; and the data formats of the plurality of structured data are consistent.
2. The simulation system according to claim 1, characterized in that Each parameter of the structured data includes: a primitive and a culling status word; the culling status word is used to indicate the operation type of the culling operation of the primitive; The primitive culling module is further configured to perform a culling operation on the primitives in the structured data based on the culling status word, and generate and output a culling result.
3. The simulation system according to claim 1 or 2, characterized in that: The primitive culling module includes: a culling pipeline, a culling scheme pool and a vector operator module; wherein, The culling scheme pool is configured to store culling methods; The reject pipeline is configured to traverse the reject status word and call the reject method corresponding to the reject status word; The vector operation submodule is configured to store a vector operation set and perform corresponding vector operations on the primitives based on the culling method.
4. The simulation system according to claim 2, characterized in that: The parameters of the structured data also include: primitive coordinates, geometric control words and screen size; the primitive culling module includes: a plurality of first interfaces; The primitive culling module receives the structured data through a plurality of the first interfaces; wherein the same parameter is transmitted through a corresponding one of the first interfaces.
5. The simulation system according to claim 1, characterized in that: The simulation system further includes: a primitive clipping module and a preprocessing simulation module; wherein, The preprocessing simulation module is configured to receive the data to be processed, perform first preprocessing on the data to be processed, and generate first structured data according to the logic before clipping; The primitive culling module is configured to perform a first culling operation on the primitives in the first structured data to generate a first culling result; The primitive clipping module is configured to perform a clipping operation on the primitives in the first culling result; The preprocessing simulation module is further configured to perform a second preprocessing on the first elimination result after the trimming operation, and generate second structured data for the trimmed logic; wherein the generation process of the second structured data shields the state of the trimming operation; the data formats of the first structured data and the second structured data are consistent, and both are generated based on transaction-level modeling; The primitive culling module is further configured to perform a second culling operation on the primitives in the second structured data, and generate and output a second culling result.
6. The simulation system according to claim 5, characterized in that: The pre-processing simulation module is further configured to analyze the culling type of the primitives in the data to be processed based on the primitive information of the data to be processed and the state of the clipping operation, and convert the culling type into a first culling state word; as well as, Analyze the culling type of the primitive in the first culling result based on the primitive information of the first culling result, and convert the culling type into a second culling status word; wherein, The primitive information includes: primitive type and primitive direction.
7. The simulation system according to claim 6, characterized in that: The preprocessing simulation module is further configured to perform precision conversion on the coordinates of the primitive; and to encapsulate the coordinates of the primitive that has completed the precision conversion into a vector, and store the vector in the primitive.
8. The simulation system according to claim 5, characterized in that: The simulation system further includes: a viewport conversion module; wherein, The viewport conversion module is configured to receive the data to be processed and convert the coordinates of the primitives in the data to be processed from a three-dimensional coordinate system to a two-dimensional plane coordinate system.
9. The simulation system according to claim 5, characterized in that: The simulation system is encapsulated in a carrier of a virtual platform; The virtual platform includes: a virtual host and a virtual device; wherein, The virtual device includes: firmware and memory management module; the virtual host includes: driver software; The virtual host is configured to access the virtual device through the driver software, issue rendering instructions to the firmware, and store related graphics primitives in the memory management module.
10. A simulation method for primitive processing, characterized in that: include: In different primitive processing stages, corresponding structured data are received; wherein the plurality of structured data received in different primitive processing stages are all generated based on transaction-level modeling; The data formats of the plurality of structured data are consistent; A culling operation is performed on the plurality of structured data received at different primitive processing stages, and a culling result is output.
11. The simulation method according to claim 10, characterized in that: The parameters of the structured data include: primitives and rejection status words; Performing a culling operation on the plurality of structured data received at different primitive processing stages and outputting a culling result, including: Traverse the removal status word and call the removal method corresponding to the removal status word; Based on the culling method, performing vector operations on the primitives to generate the culling results; The elimination result is output and displayed.
12. The simulation method according to claim 11, characterized in that: The simulation method further comprises: Based on the primitive information and the state of the clipping operation of the primitive, the culling type of the primitive is analyzed, and the culling type is converted into the culling state word; wherein the primitive information includes: the type of the primitive and the direction of the primitive.
13. A computer program product, characterized in that It includes a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code is executed in an electronic device, a processor in the electronic device executes the steps in the simulation method according to any one of claims 10 to 12.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps of the simulation method according to any one of claims 10 to 12 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the simulation method according to any one of claims 10 to 12 are implemented.