View data processing method and device, computer equipment, storage medium and computer program product
By executing a multi-view loop processing program in the shader execution unit of the GPU, processing multi-view data to reduce duplicate calculation and storage, the problem of resource waste and inefficiency in traditional GPUs when simulating stereoscopic visual effects is solved, and more efficient GPU resource utilization and drawing efficiency is achieved.
Patent Information
- Application Number
- CN202411537211.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-28
AI Technical Summary
When simulating stereoscopic visual effects, traditional GPUs fail to effectively utilize the multi-view input and output data characteristics, resulting in repeated input of the same data, storing shared data multiple times, repeatedly computing, wasting GPU resources, and inefficient drawing.
By executing a multi-view loop processing program in the shader execution unit, the activated view is determined, and the vertex input data is loaded to obtain intermediate common data when processing the first activated view, the input data of each activated view is loaded to obtain intermediate dedicated data, and these data are output to the vertex intermediate data cache unit for primitive drawing.
It realizes the reduction of GPU resource waste and improves drawing efficiency. By drawing one time, multiple views are completed, and multiple processing and storage of input data are avoided, and storage space for intermediate data is saved.
Smart Images

Figure CN119540421A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of graphics processor technology, and in particular to a view data processing method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the continuous development of virtual reality and augmented reality technology, supporting multiple views has become an indispensable and important function of GPU (Graphics Processing Unit). In order to produce a stereoscopic visual effect, the traditional GPU simulates the left and right eyes to establish two different view transformation matrices according to human visual characteristics, and uses each view transformation matrix to calculate and draw the corresponding images for the left and right eyes. Therefore, it takes two draws to simulate a stereoscopic image.
[0003] Since each view data is drawn and calculated separately, output to the corresponding frame buffer and then displayed, the traditional method does not consider the characteristics of multi-view input and output data, resulting in repeated input of the same data, multiple storage of shared data, repeated calculations, waste of GPU resources, and low drawing efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a view data processing method, device, computer equipment, computer-readable storage medium and computer program product that can reduce GPU resource waste and improve rendering efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a view data processing method, which is applied to a shader execution unit, and the method comprises:
[0006] Get the shader multi-view loop processing program compiled by the compiler;
[0007] Execute the shader multi-view loop processing program to determine the activated view;
[0008] When processing a first activated view, loading vertex input data, and obtaining intermediate common data based on the vertex input data;
[0009] Loading input data of each activated view, and obtaining intermediate dedicated data based on the input data of each activated view;
[0010] The intermediate common data and the intermediate private data are output to a vertex intermediate data cache unit, and the intermediate common data and the intermediate private data stored in the vertex intermediate data cache unit are used for primitive drawing.
[0011] In one embodiment, executing the shader multi-view loop processing program to obtain each activated view includes:
[0012] Executing the shader multi-view loop processing program to obtain view configuration information;
[0013] An activated view is determined based on the view configuration information.
[0014] In one embodiment, the loading of input data corresponding to each activated view and obtaining intermediate dedicated data based on the input data of each activated view includes:
[0015] Loading input data of a first activated view, and obtaining intermediate dedicated data of the first activated view based on the input data of the first activated view;
[0016] Check if there are other activated views;
[0017] In the case that there are other activated views, the input data of the currently activated view is loaded, and the intermediate dedicated data of the currently activated view is obtained based on the input data of the currently activated view, and the step of detecting whether there are other activated views is continued until there are no other activated views.
[0018] The present application also provides a view data processing method, which is applied to a vertex intermediate data cache unit, and the method comprises:
[0019] receiving view information, intermediate common data and intermediate private data sent by a shader execution unit, wherein the intermediate common data and the intermediate private data are obtained by the view data processing method described in any one of the above embodiments;
[0020] Acquire the number of attributes of the intermediate common data and the intermediate private data, and obtain the size of vertex intermediate data of each vertex based on the number of attributes and view information, wherein the vertex intermediate data includes the intermediate common data and the intermediate private data;
[0021] Allocate a corresponding storage space for each vertex based on the vertex intermediate data, the storage space comprising a shared data storage area and a dedicated data storage area;
[0022] storing the intermediate shared data in the shared data storage area;
[0023] The intermediate dedicated data is stored in a dedicated data storage area, wherein the vertex intermediate data stored in the storage space is used for primitive drawing.
[0024] In one embodiment, obtaining the number of attributes of the intermediate common data and the intermediate private data, and obtaining the size of the vertex intermediate data of each vertex based on the number of attributes and the view information, includes:
[0025] Obtaining the size of the common data based on the number of attributes of the intermediate common data and the number of components contained in each attribute;
[0026] Obtaining the size of the dedicated data corresponding to each view based on the number of attributes of the intermediate dedicated data and the number of components contained in each attribute;
[0027] The size of the vertex intermediate data of each vertex is obtained based on the common data size, the private data size corresponding to each view, and the amount of view information.
[0028] In one embodiment, allocating corresponding storage space to each vertex based on the vertex intermediate data includes:
[0029] Determine the storage address of the vertex based on the vertex index and the size of the vertex intermediate data of each vertex;
[0030] Based on the attribute index, the number of components contained in each attribute and the storage address of the vertex, a common attribute storage address is obtained;
[0031] Based on the component index and the common attribute storage address, a common component storage address is obtained, and based on the common storage address of each component of each attribute, a common data storage area is obtained;
[0032] Obtaining a view storage address based on the storage address of the vertex, the common data size, and the view index;
[0033] Based on the view storage address, the attribute index, the number of attributes and the number of components contained in each attribute, obtain a view-specific data attribute storage address;
[0034] Based on the view-specific data attribute storage address and the index of the component, obtaining a view-specific data component storage address;
[0035] A dedicated data storage area is obtained based on the storage address of each of the components of each of the attributes of each of the views.
[0036] In a third aspect, the present application further provides a view data processing method, which is applied to a rasterization pipeline unit, and the method comprises:
[0037] Acquire intermediate common data and intermediate private data from a vertex intermediate data cache unit, wherein the intermediate private data carries a view index, and the intermediate common data and the intermediate private data are obtained by the view data processing method described in any one of the above embodiments;
[0038] Primitive drawing is performed based on the intermediate common data and the intermediate private data.
[0039] In one of the embodiments, the step of obtaining the intermediate common data and the intermediate dedicated data from the vertex intermediate data cache unit includes:
[0040] Obtaining a storage address of a vertex according to an index of the vertex in the vertex intermediate data cache unit;
[0041] Based on the storage address of the vertex, start reading the attribute data of the vertex;
[0042] In the case where the attribute data is intermediate common data, reading the corresponding intermediate common data;
[0043] In the case where the attribute data is intermediate private data, the corresponding intermediate private data is read.
[0044] In one embodiment, the reading the corresponding intermediate shared data includes:
[0045] Based on the attribute index, the number of components contained in each attribute and the storage address of the vertex, a common attribute storage address is obtained;
[0046] Based on the component index and the common attribute storage address, obtain a common component storage address;
[0047] Based on the common component storage address and the common attribute storage address, the corresponding intermediate common data is read.
[0048] In one embodiment, the reading of the corresponding intermediate dedicated data includes:
[0049] Obtaining a view-specific storage address based on the storage address of the vertex, the common data size, and the view index;
[0050] Obtaining a view-specific data attribute storage address based on the view storage address, the attribute index, the number of attributes of the intermediate-specific data, and the number of components contained in each attribute;
[0051] Based on the view-specific data attribute storage address and the component index, obtaining the view-specific data component storage address;
[0052] Based on the view storage address, the view specific data attribute storage address and the view specific data component storage address, the corresponding intermediate specific data is read.
[0053] In a fourth aspect, the present application further provides a view data processing device, applied to a shader execution unit, the device comprising:
[0054] A program acquisition module is used to acquire a shader multi-view loop processing program compiled by a compiler;
[0055] A view acquisition module, used for executing the shader multi-view loop processing program to obtain each activated view;
[0056] An intermediate common data calculation module, used for loading vertex input data when processing the first activated view, and obtaining intermediate common data corresponding to each vertex based on the vertex input data;
[0057] An intermediate dedicated data calculation module, used for loading the input data of each activated view, and obtaining the intermediate dedicated data based on the input data of each activated view;
[0058] The data storage module is used to output the intermediate common data and the intermediate special data to the vertex intermediate data cache unit, and the intermediate common data and the intermediate special data stored in the vertex intermediate data cache unit are used for primitive drawing.
[0059] In a fifth aspect, the present application further provides a view data processing device, applied to a vertex intermediate data cache unit, the device comprising:
[0060] A receiving module, configured to receive view information, intermediate common data and intermediate private data sent by a shader execution unit, wherein the intermediate common data and intermediate private data are obtained by the view data processing device in any one of the above embodiments;
[0061] a vertex intermediate data size determination module, used to obtain the number of attributes of the intermediate common data and the intermediate private data, and obtain the size of the vertex intermediate data of each vertex based on the number of attributes and view information, wherein the vertex intermediate data includes the intermediate common data and the intermediate private data;
[0062] A storage area determination module, used to allocate a corresponding storage space to each vertex based on the vertex intermediate data, wherein the storage space includes a shared data storage area and a dedicated data storage area;
[0063] A shared data storage module, used for storing the intermediate shared data in the shared data storage area;
[0064] The dedicated data storage module is used to store the intermediate dedicated data in a dedicated data storage area, wherein the vertex intermediate data stored in the storage space is used for primitive drawing.
[0065] In a sixth aspect, the present application further provides a view data processing device, applied to a rasterization pipeline unit, the device comprising:
[0066] A data reading module, used for acquiring intermediate common data and intermediate special data from a vertex intermediate data cache unit, wherein the intermediate special data carries a view index, and the intermediate common data and intermediate special data are obtained by the view data processing device in any one of the above-mentioned embodiments;
[0067] The drawing module is used for drawing primitives based on the intermediate common data and the intermediate dedicated data.
[0068] In a seventh aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above-mentioned embodiments when executing the computer program.
[0069] In an eighth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method in any one of the above-mentioned embodiments.
[0070] In a ninth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the method in any one of the above-mentioned embodiments when executed by a processor.
[0071] The above-mentioned view data processing method, device, computer equipment, storage medium and computer program product are compiled by a compiler to obtain a shader multi-view loop processing program, and the shader multi-view loop processing program is executed to obtain each activated view; when processing the first activated view, the vertex input data is loaded, and the intermediate common data is obtained based on the vertex input data; the input data of each activated view is loaded, and the intermediate special data is obtained based on the input data of each activated view; the intermediate common data and the intermediate special data are output to the vertex intermediate data cache unit, so that multi-view processing is completed in one drawing, and the input data is only processed once to obtain the intermediate common data, and there is no need to process the input data multiple times, and the intermediate common data is only stored once during storage, thereby reducing GPU resource waste and improving drawing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0073] FIG1 is a block diagram of a process in which a GPU simulates binocular vision to produce a stereoscopic effect in a conventional technology;
[0074] FIG2 is a diagram of an application environment of a method for processing view data in one embodiment;
[0075] FIG3 is a schematic diagram of a flow chart of a method for processing view data in one embodiment;
[0076] FIG4 is a flowchart of a shader program loop processing multiple views in one embodiment;
[0077] FIG5 is a schematic flow chart of a method for processing view data in yet another embodiment;
[0078] FIG6 is a data storage layout diagram of a vertex intermediate data cache unit in one embodiment;
[0079] FIG. 7 is a schematic diagram of a storage location of each vertex data in one embodiment;
[0080] FIG8 is a schematic flow chart of a method for processing view data in yet another embodiment;
[0081] FIG9 is a flow chart of the processing steps of the rasterization pipeline unit in one embodiment;
[0082] FIG10 is a flow chart of a sub-process for reading vertex attributes in one embodiment;
[0083] FIG11 is a structural block diagram of a view data processing device in one embodiment;
[0084] FIG12 is a structural block diagram of a view data processing device in yet another embodiment;
[0085] FIG13 is a structural block diagram of a view data processing device in yet another embodiment;
[0086] FIG. 14 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0088] As shown in FIG. 1 , FIG. 1 is a flowchart of a process of simulating binocular vision to produce a stereoscopic effect by a GPU in a conventional technology. In this embodiment, in order to produce a stereoscopic visual effect, a conventional GPU simulates the left and right eyes to establish two different view transformation matrices according to the visual characteristics of a person, and uses each view transformation matrix to calculate and draw the images corresponding to the left and right eyes. Therefore, it takes two draws to simulate a stereoscopic image. Since a drawing pipeline processes one view at a time, the conventional method of simulating a stereoscopic image requires two draws, and the data shared by the views is processed multiple times, which is inefficient and slow to draw.
[0089] In order to solve the above problems, the view data processing method provided by the embodiment of the present application can be applied to the application environment shown in Figure 2. The application environment includes a multi-view application, a compiler, a driver, a shader execution unit, a vertex intermediate data cache unit and a rasterization pipeline unit. The multi-view application transmits the multi-view configuration data to the compiler, and the compiler generates each view data processing instruction according to the multi-view configuration data and the view hidden code View Mask loop to form a complete shader multi-view loop processing program View Loop Program, and sends the shader multi-view loop processing program to the driver, and the driver sends the shader multi-view loop processing program to the shader execution unit. The shader execution unit executes the shader multi-view loop processing program to obtain each activated view; when processing the first activated view, the vertex input data is loaded, and the intermediate common data is obtained based on the vertex input data; the input data of each activated view is loaded, and the intermediate special data is obtained based on the input data of each activated view; the intermediate common data and the intermediate special data are output to the vertex intermediate data cache unit, and the intermediate common data and the intermediate special data stored in the vertex intermediate data cache unit are used for primitive drawing. The vertex intermediate data cache unit stores the intermediate shared data and intermediate dedicated data in the corresponding storage space according to the vertex index and view index. The rasterization pipeline unit can read the vertex intermediate data of a specific view from the vertex intermediate data cache unit, assemble the primitives to obtain the complete primitive data, and then perform pre-processing such as pixel interpolation before sending it to the subsequent pipeline.
[0090] Through the above-mentioned view data processing method, the programmable characteristics of the shader are utilized to realize the calculation of multi-view vertex data in a shader program, and the vertex data of each view is processed cyclically according to the multi-view configuration. The vertex data buffer unit saves all view data of a vertex according to the common and unique attributes to the vertex space range. The subsequent rasterization pipeline unit reads these intermediate data and draws the corresponding image according to the information of each view and its metadata. Multi-view processing is completed in one drawing, and the input data is only processed once to obtain the intermediate common data. There is no need to process the input data multiple times, and the intermediate common data is only stored once during storage, thereby reducing the waste of GPU resources and improving drawing efficiency.
[0091] In an exemplary embodiment, as shown in FIG3 , a view data processing method is provided, which is described by taking the method applied to the shader execution unit in FIG1 as an example, and includes the following steps 302 to 310. Among them:
[0092] S302: Obtain a shader multi-view loop processing program compiled by a compiler.
[0093] The shader multi-view loop processing program includes looping and generating each view data processing instruction according to the multi-view configuration data and the view hidden code ViewMask. The present application utilizes the programmable characteristics of the shader to implement the multi-view function in one shader program, and the shader program processes each view vertex data according to the multi-view configuration loop.
[0094] S304: Execute the shader multi-view loop processing program to obtain each activated view.
[0095] In one of the optional embodiments, executing a shader multi-view loop processing program to obtain each activated view includes: executing a shader multi-view loop processing program to obtain view configuration information; and determining an activated view based on the view configuration information.
[0096] The activated view corresponding to the vertex is determined based on the view configuration code. After obtaining the view configuration code, the compiler determines the activated view based on the view configuration code and starts processing and calculation from the first view; if the current view is not activated, the next view is processed, otherwise the current view data is processed until all views are processed.
[0097] S306: When processing the first activated view, load vertex input data, and obtain intermediate common data based on the vertex input data.
[0098] S308: Load the input data of each activated view, and obtain intermediate dedicated data based on the input data of each activated view.
[0099] The shader execution unit executes the shader multi-view loop processing program compiled by the compiler to divide the vertex attribute data output by the primitive into two categories: shared data and dedicated data; shared data Shared Data refers to the data that is the same for each vertex in each view, such as color, etc.; dedicated data Seperated Data refers to the different data corresponding to vertices in different views, such as the input view transformation matrix, the output vertex position, normal vector, etc.; the input shared data only needs to be loaded once, the intermediate shared data is calculated once and stored in one copy; the input data is calculated according to the application configuration of the multiple views, and the intermediate dedicated data unique to each view is stored in different locations.
[0100] The vertex input data includes position and color information, which is common to all views. Each view has its own perspective matrix, which is the input data of the activated view.
[0101] S310: Outputting the intermediate common data and the intermediate private data to the vertex intermediate data cache unit. The intermediate common data and the intermediate private data stored in the vertex intermediate data cache unit are used for primitive drawing.
[0102] In this embodiment, the shader sends the calculation results of the shader multi-view loop processing program, that is, the intermediate common data and the intermediate special data as well as the corresponding view information, to the vertex intermediate data cache unit. The vertex intermediate data cache unit saves these vertex intermediate data cache units according to the common and special attributes within the vertex storage space based on the vertex index, view index and other information; the subsequent rasterization pipeline unit reads these vertex data and draws the corresponding image according to each view information and its graphics metadata.
[0103] In one of the optional embodiments, input data corresponding to each activated view is loaded, and intermediate special data is obtained based on the input data of each activated view, including: loading the input data of the first activated view, and obtaining the intermediate special data of the first activated view based on the input data of the first activated view; detecting whether there are other activated views; if there are other activated views, loading the input data of the currently activated view, and obtaining the intermediate special data of the currently activated view based on the input data of the currently activated view, and continuing to execute the step of detecting whether there are other activated views until there are no other activated views.
[0104] For ease of understanding, an example is given, in which two views are defined and three parameters are input: vertexPosition is the vertex position, vertexColor is the vertex color, and ViewProjection is the view transformation matrix of the view; vertexPosition and vertexColor are involved in the calculation for both views, so they are classified as vertex input data in the view; ViewProjection is different for different views, so it is classified as input data of the view. The two intermediate results are output: v_Color is the vertex color and gl_Position is the vertex position information of the view; v_Color has the same value for both views, so it is classified as shared intermediate data; gl_Position has different values for different views, so it is classified as Seperated intermediate dedicated data.
[0105] Specifically, in conjunction with FIG. 4 , FIG. 4 is a flowchart of a shader program cyclically processing multiple views in an embodiment. In this embodiment, the view index is initialized first, and then the shader program starts processing and calculating from the first view after obtaining the view configuration code; if the current view is not activated, the next view is processed, and the view index is increased by one, otherwise the current view data is continued to be processed until all views are processed; if the current activated view is the first activated view, the vertex input data Input Shared Data is loaded, and the intermediate shared data Shared Data is calculated; if the input data Input Seperated Data of the current activated view is loaded, the view intermediate dedicated data Seperated Data is calculated. If the current activated view is not the first activated view, only the input data Input Seperated Data of the current activated view is loaded, the view intermediate dedicated data Seperated Data is calculated, and after the processing is completed, the next view is processed, for example, the view index is increased by one (that is, the next view is used as the current view), and it is determined whether the view index exceeds the maximum view index range. If so, the processing is terminated, otherwise, the view configuration code is continued to be obtained, and it is determined whether the current view is activated.
[0106] After being processed by the compiler, the shader definition script is compiled into a GPU instruction sequence. Taking the above example as an example, the pseudo code of the compiled shader instruction program is roughly as follows:
[0107]
[0108] Among them, the instruction Output.mv[n].e[m].xyzw, R[x] outputs the values of the four registers x, x+1, x+2 and x+3 as the vertex view n attribute m to the vertex intermediate data cache unit.
[0109] The above-mentioned view data processing method is compiled by a compiler to obtain a shader multi-view loop processing program, and executes the shader multi-view loop processing program to obtain each activated view; when processing the first activated view, load the input data, and obtain the intermediate common data based on the input data; load the input data of each activated view, and obtain the intermediate special data based on each input data; output the intermediate common data and the intermediate special data to the vertex intermediate data cache unit, so that multi-view processing is completed in one drawing, and the vertex input data is only processed once to obtain the intermediate common data, and there is no need to process the vertex input data multiple times, and the intermediate common data is only stored once during storage, thereby reducing GPU resource waste and improving drawing efficiency.
[0110] In an exemplary embodiment, as shown in FIG5 , a view data processing method is provided, which is described by taking the method applied to the vertex intermediate data cache unit in FIG1 as an example, and includes the following steps 502 to 510. Among them:
[0111] S502: receiving view information, intermediate common data and intermediate private data sent by a shader execution unit, where the intermediate common data and the intermediate private data are obtained by the view data processing method in any one of the above embodiments.
[0112] The view information refers to a view index, which includes intermediate common data and intermediate private data corresponding to each view for each vertex, wherein the intermediate private data is represented by a view index to determine the view to which each intermediate private data belongs.
[0113] S504: Acquire the number of attributes of the intermediate common data and the intermediate private data, and obtain the size of the vertex intermediate data of each vertex based on the number of attributes and the view information, where the vertex intermediate data includes the intermediate common data and the intermediate private data.
[0114] S506: Allocate corresponding storage space to each vertex based on the vertex intermediate data, where the storage space includes a shared data storage area and a dedicated data storage area.
[0115] S508: Storing the intermediate shared data in the shared data storage area.
[0116] S510: Storing intermediate dedicated data in a dedicated data storage area, wherein the vertex intermediate data stored in the storage space is used for primitive drawing.
[0117] For the convenience of description, the intermediate shared data and intermediate dedicated data are collectively referred to as vertex intermediate data. Among the multi-view vertex intermediate data, some are shared by all views, and some are exclusive to a certain view. In order to save storage space and improve storage efficiency, only one copy of the intermediate shared data is stored; the intermediate dedicated data of each view occupies a certain amount of storage space separately. The vertex intermediate data cache unit calculates the size of the space occupied by a vertex intermediate data, allocates the corresponding space, and divides it into a shared data storage area and a plurality of views' dedicated data storage areas; when the vertex intermediate data cache unit receives the intermediate shared data and intermediate dedicated data output by the shader program unit, it saves the data to a specific area according to whether it is shared or exclusive. If it is intermediate shared data, it is saved to the shared data storage area; if it is intermediate dedicated data, it is saved to the corresponding dedicated data storage area of the view.
[0118] As shown in Figure 6, assuming that the number of views is n, the storage space of a vertex is divided into n+1 parts: 1 shared data storage area and n dedicated data storage areas; and assuming that shared data is stored first starting from the low address in the vertex storage space, and then the dedicated data of each view is stored in sequence, the vertex intermediate data storage layout is shown in Figure 6.
[0119] In one of the optional embodiments, the number of attributes of the intermediate common data and the intermediate private data is obtained, and the size of the vertex intermediate data of each vertex is obtained based on the number of attributes and the view information, including: obtaining the common data size based on the number of attributes of the intermediate common data and the number of components contained in each attribute; obtaining the private data size corresponding to each view based on the number of attributes of the intermediate private data and the number of components contained in each attribute; obtaining the size of the vertex intermediate data of each vertex based on the common data size, the private data size corresponding to each view, and the view information.
[0120] The space occupied by the intermediate shared data and intermediate private data is determined by the number of its attribute Element. The attribute contains 4 components XYZW (the number of components contained in each attribute). Then the number of intermediate shared data attributes is SharedElementNum, the space occupied by the shared data, that is, the shared data size is SharedSize, the number of intermediate private data attributes of view n is ViewnSeperatedElementNum, and the space occupied by its private data, that is, the size of the private data corresponding to each view is ViewnSeperatedSize; then, the space occupied by the vertex, that is, the size of the intermediate data of each vertex, VertexSize, and the relationship between the vertex data are:
[0121] SharedSize = SharedElementNum * 4 (Formula-1);
[0122] ViewnSeperatedSize = ViewnSeperatedElementNum * 4 (formula-2);
[0123] VertexSize = SharedSize + (Formula-3);
[0124] Among them, 4 is the number of components. In other embodiments, if the number of components included in each attribute is other values, the 4 in the formula can be modified to other values, and no specific limitation is made here.
[0125] For ease of understanding, according to the above formulas 1 to 3, the calculation results of the shared data of the vertex intermediate data and the storage area occupied by each view in the above example are as follows:
[0126] SharedSize = 1 * 4 = 4;
[0127] View0SeperatedSize = 1 * 4 = 4;
[0128] View1SeperatedSize = 1 * 4 = 4;
[0129] VertexSize = 4 + 4 + 4 = 12.
[0130] In one of the optional embodiments, a corresponding storage space is allocated to each vertex based on the vertex intermediate data, including: determining the storage address of the vertex based on the vertex index and the size of the vertex intermediate data of each vertex; obtaining a common attribute storage address based on the attribute index, the number of components contained in each attribute and the storage address of the vertex; obtaining a common component storage address based on the component index and the common attribute storage address, and obtaining a common data storage area based on the common storage address of each component of each attribute; obtaining a view storage address based on the vertex storage address, common data size and view index; obtaining a view-specific data attribute storage address based on the view storage address, attribute index, the number of attributes and the number of components contained in each attribute; obtaining a view-specific data component storage address based on the view-specific data attribute storage address and the component index; obtaining a dedicated data storage area based on the storage address of each component of each attribute of each view.
[0131] Assuming that the storage space starts from the low address, the common data is stored first, and then the view-specific data is stored in sequence. The calculation formula for the storage address of the common data and view-specific data in the middle of the vertex is as follows:
[0132] VertexBaseAddr = VertexIdx * VertexSize (Formula-4);
[0133] SharedBaseAddr = VertexBaseAddr (Formula-5);
[0134] SharedElementmBaseAddr = SharedBaseAddr + m * 4
[0135] m is the attribute index (Formula-6);
[0136] SharedElementmComponentxAddr = SharedElementmBaseAddr + x
[0137] x is the component index (Formula-7);
[0138] ViewnBaseAddr=VertexBaseAddr+SharedSize+, n is the view index (formula -8);
[0139] ViewnElementmBaseAddr = ViewnBaseAddr + (m - SharedElementNum) * 4, n is the view index, m is the attribute index (Formula -9);
[0140] ViewnElementmComponentxAddr = ViewnElementmBaseAddr+x, where n is the view index, m is the attribute index, and x is the component index (Formula -10);
[0141] Among them, VertexBaseAddr is the storage address (starting address) of the vertex, VertexIdx is the index of the vertex, VertexSize is the size of the intermediate data of each vertex, SharedBaseAddr is the intermediate shared data storage address (starting address), which is equal to the storage address (starting address) of the vertex. SharedElementmBaseAddr is the shared attribute storage address, SharedElementmComponentxAddr is the shared component storage address, ViewnBaseAddr is the view storage address (starting address), ViewnElementmBaseAddr is the view-specific data attribute storage address, and ViewnElementmComponentxAddr is the view-specific data component storage address.
[0142] Here is the calculation process of the intermediate data storage address for vertex 0 attribute 0 and vertex 8 attribute 1 as follows:
[0143] Vertex 0 attribute 0 is the shared color data, then,
[0144] Attribute base address calculation:
[0145] VertexBaseAddr = 0 * 12 = 0;
[0146] VertexSharedBaseAddr = 0;
[0147] SharedElement0BaseAddr = 0 + 0 * 4 = 0;
[0148] Component storage address calculation:
[0149] SharedElement0Component0Addr = 0 + 0 = 0;
[0150] SharedElement0Component1Addr = 0 + 1 = 1;
[0151] SharedElement0Component2Addr = 0 + 2 = 2;
[0152] SharedElement0Component3Addr = 0 + 3 = 3;
[0153] Vertex 8 attribute 1 is the position data specific to each view, then,
[0154] View 0 base address calculation:
[0155] VertexBaseAddr = 8 * 12 = 96;
[0156] VertexSharedBaseAddr = 96;
[0157] View0BaseAddr = 96+ 4 + 0 * 4 = 100;
[0158] View 0 attribute 1 base address calculation:
[0159] View0Element1BaseAddr = 100 + (1 – 1) * 4 = 100;
[0160] View 0 attribute 1 component storage address:
[0161] View0Element1Component0Addr = 100 + 0 = 100;
[0162] View0Element1Component1Addr = 100 + 1 = 101;
[0163] View0Element1Component2Addr = 100 + 2 = 102;
[0164] View0Element1Component3Addr = 100 + 3 = 103;
[0165] View 1 base address calculation:
[0166] VertexBaseAddr = 8 * 12 = 96;
[0167] VertexSharedBaseAddr = 96;
[0168] View1BaseAddr = 96 + 4 + 1 * 4 = 104;
[0169] View 1 attribute 1 base address calculation:
[0170] View1Element1BaseAddr = 104 + (1 – 1) * 4 = 104;
[0171] View 1 Attribute 1 Storage address of each component:
[0172] View1Element1Component0Addr = 104 + 0 = 104;
[0173] View1Element1Component1Addr = 104 + 1 = 105;
[0174] View1Element1Component2Addr = 104+ 2 = 106;
[0175] View1Element1Component3Addr = 104 + 3 = 107;
[0176] According to the above calculation results, the storage location of each vertex data is shown in Figure 7. After the front-end shader runs the program instructions to generate the vertex intermediate data, the vertex intermediate data cache unit calculates the storage address based on the vertex index, view information, vertex attributes and component index using the above formula, and stores the data in the specified location of the vertex intermediate data cache unit.
[0177] In an exemplary embodiment, as shown in FIG8 , a method for processing view data is provided, which is described by taking the method applied to the rasterization pipeline unit in FIG1 as an example, and includes the following steps 802 to 804. Among them:
[0178] S802: Acquire intermediate common data and intermediate private data from a vertex intermediate data cache unit, where the intermediate private data carries a view index, and the intermediate common data and the intermediate private data are obtained by the view data processing method in any one of the above embodiments;
[0179] S804: Rendering primitives based on the intermediate common data and the intermediate dedicated data.
[0180] In the rasterization pipeline stage, the rasterization pipeline unit processes multi-view data in two stages: in the first stage, basic primitives with the required number of vertices are constructed according to the vertex storage address of the front-end shader and the view to which it belongs, and the intermediate common data of the vertices and the intermediate special data of each view stored in the vertex intermediate data cache unit are read; in the second stage, valid primitives are constructed based on the read vertex position information and other attributes of each view, and the valid primitive color attributes are sent to the back-end pixel shader after pre-processing such as interpolation. The second stage of constructing valid primitives for each view and the subsequent processing methods are consistent with the traditional single-view method and will not be repeated. This application focuses on the first stage in which the rasterization module constructs basic primitives for views with the required number of vertices and reads data for each view from the vertex intermediate data buffer. The processing flow is shown in Figure 9, where Figure 10 is the sub-process of reading vertex attributes in Figure 9.
[0181] In one of the optional embodiments, intermediate common data and intermediate special data are obtained from a vertex intermediate data cache unit, including: obtaining a storage address of a vertex according to an index of the vertex in the vertex intermediate data cache unit; starting to read attribute data of the vertex based on the storage address of the vertex; in the case where the attribute data is intermediate common data, reading corresponding intermediate common data; in the case where the attribute data is intermediate special data, reading corresponding intermediate special data.
[0182] In one of the optional embodiments, the corresponding intermediate common data is read, including: obtaining a common attribute storage address based on an attribute index, the number of components contained in each attribute, and a storage address of a vertex; obtaining a common component storage address based on a component index and a common attribute storage address; and reading the corresponding intermediate common data based on the common component storage address and the common attribute storage address.
[0183] In one of the optional embodiments, the corresponding intermediate private data is read, including: obtaining a view storage address based on the storage address of the vertex, the common data size and the view index; obtaining a view-specific data attribute storage address based on the view storage address, the attribute index, the number of attributes of the intermediate private data and the number of components contained in each attribute; obtaining a view-specific data component storage address based on the view-specific data attribute storage address and the component index; and reading the corresponding intermediate private data based on the view storage address, the view-specific data attribute storage address and the view-specific data component storage address.
[0184] The flow of rasterization pipeline processing vertex view data is briefly described as follows:
[0185] First, the rasterization pipeline unit constructs basic primitives based on vertex information. If there are not enough vertices, these vertices are discarded, the current processing is terminated, and the subsequent vertex input is waited for; otherwise, the subsequent steps are executed; the vertex data is read starting from the first view of the basic primitive; the data is read starting from the first vertex of the first view until all the vertex data of the basic primitive of the view is read; all the vertex information of the current view of the basic primitive is output to the subsequent pipeline unit; the next view information of the basic primitive is read, and the above steps are repeated until all views are read.
[0186] Among them, the process of rasterization pipeline reading vertex attribute data is also a key point of this application, and its processing flow is as follows: the rasterization pipeline unit first calculates the starting storage address of the vertex according to the vertex index; starts to read the attribute data of the vertex; if the current attribute is common data independent of the specific view, calculates its storage address according to formula-5 and reads the data; if the current attribute is special data related to the specific view, calculates its storage address according to formula-6 with the view index as a parameter and reads the data; sends the read attribute data to the subsequent pipeline unit; repeats the above steps until all attributes of the vertex are read.
[0187] The rasterization pipeline usually reads a complete attribute at a time, that is, the result of a read operation contains all four components, so during the reading process, it only needs to calculate the base address of the attribute and read four storage units continuously. Taking vertex 8 in the above example as an example, the process of reading vertex common data and dedicated data in the rasterization pipeline is as follows.
[0188] Vertex 8 base address calculation: VertexBaseAddr = 8 * 12 = 96;
[0189] Vertex 8 attribute 0 [shared data] base address calculation:
[0190] SharedElement0Addr =VertexSharedBaseAddr = VertexBaseAddr = 96;
[0191] Vertex 8 attributes 1 [dedicated data, 2 views] base address calculation:
[0192] View0BaseAddr = 96+ 4 + 0 * 4 = 100;
[0193] View0Element1BaseAddr = 100 + (1 – 1) * 4 = 100;
[0194] View1BaseAddr = 100 + 4 = 104;
[0195] View1Element1BaseAddr = 104 + (1 – 1) * 4 = 104;
[0196] In the above embodiment, the programmable characteristics of the shader are utilized, and the shader program is utilized to loop through the metadata of each view according to the multi-view configuration. The subsequent pipelines cooperate with each other, and a stereoscopic visual effect can be simulated in one drawing, thereby improving the efficiency of multi-view drawing. Multi-view processing is completed in one drawing, and multi-view problems are processed by combining software and hardware, which is efficient and flexible; it saves intermediate data storage space and GPU hardware resources.
[0197] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0198] Based on the same inventive concept, the embodiment of the present application further provides a view data processing device for implementing the view data processing method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more view data processing device embodiments provided below can refer to the above limitations on the view data processing method, and will not be repeated here.
[0199] In an exemplary embodiment, as shown in FIG11 , a view data processing device is provided, comprising: a program acquisition module 1101, a view acquisition module 1102, an intermediate common data calculation module 1103, an intermediate dedicated data calculation module 1104 and a data storage module 1105, wherein:
[0200] A program acquisition module 1101 is used to acquire a shader multi-view loop processing program compiled by a compiler;
[0201] The view acquisition module 1102 is used to execute the shader multi-view loop processing program to obtain each activated view;
[0202] The intermediate common data calculation module 1103 is used to load the vertex input data and obtain the intermediate common data based on the vertex input data when processing the first activated view;
[0203] The intermediate dedicated data calculation module 1104 is used to load the input data of each activated view and obtain the intermediate dedicated data based on the input data of each activated view;
[0204] The data storage module 1105 is used to output the intermediate common data and the intermediate special data to the vertex intermediate data cache unit. The intermediate common data and the intermediate special data stored in the vertex intermediate data cache unit are used for primitive drawing.
[0205] In one of the optional embodiments, the view acquisition module 1102 is specifically configured to execute a shader multi-view loop processing program to obtain view configuration information; and determine an activated view based on the view configuration information.
[0206] In one of the optional embodiments, the above-mentioned device also includes: a loop module, which is used to load the input data of the first activated view, and obtain the intermediate special data of the first activated view based on the input data of the first activated view; detect whether there are other activated views; if there are other activated views, load the input data of the currently activated view, and obtain the intermediate special data of the currently activated view based on the input data of the currently activated view, and continue to execute the step of detecting whether there are other activated views until there are no other activated views.
[0207] In an exemplary embodiment, as shown in FIG12 , a view data processing device is provided, comprising: a receiving module 1201, a size determination module 1202, a storage area determination module 1203, a common data storage module 1204 and a dedicated data storage module 1205, wherein:
[0208] A receiving module 1201, configured to receive view information, intermediate common data and intermediate private data sent by a shader execution unit, where the intermediate common data and the intermediate private data are obtained by the view data processing apparatus in any one of the above embodiments;
[0209] A size determination module 1202, configured to obtain the number of attributes of the intermediate common data and the intermediate private data, and obtain the size of the vertex intermediate data of each vertex based on the number of attributes and the view information, wherein the vertex intermediate data includes the intermediate common data and the intermediate private data;
[0210] A storage area determination module 1203, configured to allocate a corresponding storage space to each vertex based on the vertex intermediate data, wherein the storage space includes a shared data storage area and a dedicated data storage area;
[0211] A shared data storage module 1204, used to store the intermediate shared data in a shared data storage area;
[0212] The dedicated data storage module 1205 is used to store intermediate dedicated data in the dedicated data storage area, wherein the vertex intermediate data stored in the storage space is used for primitive drawing.
[0213] In one of the optional embodiments, the size determination module 1202 is specifically used to obtain the common data size based on the number of attributes and the number of components contained in each attribute; obtain the private data size corresponding to each view based on the number of attributes and the number of components contained in each attribute; and obtain the size of the vertex intermediate data of each vertex based on the common data size, the private data size corresponding to each view, and the view information.
[0214] In one of the optional embodiments, the storage area determination module 1203 is specifically used to determine the storage address of the vertex based on the vertex index and the size of the vertex intermediate data of each vertex; obtain the common attribute storage address based on the attribute index, the number of components contained in each attribute and the storage address of the vertex; obtain the common component storage address based on the component index and the common attribute storage address, and obtain the common data storage area based on the common storage address of each component of each attribute; obtain the view storage address based on the vertex storage address, the common data size and the view index; obtain the view-specific data attribute storage address based on the view storage address, the attribute index, the number of attributes and the number of components contained in each attribute; obtain the view-specific data component storage address based on the view-specific data attribute storage address and the component index; obtain the dedicated data storage area based on the storage address of each component of each attribute of each view.
[0215] In an exemplary embodiment, as shown in FIG13 , a view data processing device is provided, including: a data reading module 1301 and a drawing module 1302, wherein:
[0216] A data reading module 1301 is used to obtain intermediate common data and intermediate special data from a vertex intermediate data cache unit, where the intermediate special data carries a view index, and the intermediate common data and the intermediate special data are obtained by the view data processing device in any one of the above embodiments;
[0217] The drawing module 1302 is used to draw primitives based on the intermediate common data and the intermediate dedicated data.
[0218] In one of the optional embodiments, the above-mentioned data reading module 1301 is specifically used to obtain intermediate common data and intermediate special data from the vertex intermediate data cache unit, including: obtaining the storage address of the vertex according to the index of the vertex in the vertex intermediate data cache unit; starting to read the attribute data of the vertex based on the storage address of the vertex; when the attribute data is intermediate common data, reading the corresponding intermediate common data; when the attribute data is intermediate special data, reading the corresponding intermediate special data.
[0219] In one of the optional embodiments, the above-mentioned data reading module 1301 is specifically used to obtain the common attribute storage address based on the attribute index, the number of components contained in each attribute and the storage address of the vertex; obtain the common component storage address based on the component index and the common attribute storage address; based on the common component storage address and the common attribute storage address, read the corresponding intermediate common data.
[0220] In one of the optional embodiments, the data reading module 1301 is specifically used to obtain the view storage address based on the vertex storage address, the common data size and the view index; obtain the view-specific data attribute storage address based on the view storage address, the attribute index, the number of attributes of the intermediate special data and the number of components contained in each attribute; obtain the view-specific data component storage address based on the view-specific data attribute storage address and the component index; read the corresponding intermediate special data based on the view storage address, the view-specific data attribute storage address and the view-specific data component storage address.
[0221] Each module in the above-mentioned view data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0222] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG14. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a view data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0223] Those skilled in the art will understand that the structure shown in FIG. 14 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0224] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0225] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0226] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0227] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0228] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0229] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing view data, characterized in that: Applied to a shader execution unit, the method comprises: Get the shader multi-view loop processing program compiled by the compiler; Executing the shader multi-view loop processing program to obtain each activated view; When processing a first activated view, loading vertex input data, and obtaining intermediate common data based on the vertex input data; Loading input data of each activated view, and obtaining intermediate dedicated data based on the input data of each activated view; The intermediate common data and the intermediate private data are output to a vertex intermediate data cache unit, and the intermediate common data and the intermediate private data stored in the vertex intermediate data cache unit are used for primitive drawing.
2. The method according to claim 1, characterized in that The executing the shader multi-view loop processing program to obtain each activated view includes: Executing the shader multi-view loop processing program to obtain view configuration information; An activated view is determined based on the view configuration information.
3. The method according to claim 1, characterized in that The loading of input data corresponding to each activated view and obtaining intermediate dedicated data based on the input data of each activated view includes: Loading input data of a first activated view, and obtaining intermediate dedicated data of the first activated view based on the input data of the first activated view; Check if there are other activated views; In the case that there are other activated views, the input data of the currently activated view is loaded, and the intermediate dedicated data of the currently activated view is obtained based on the input data of the currently activated view, and the step of detecting whether there are other activated views is continued until there are no other activated views.
4. A method for processing view data, characterized in that: Applied to a vertex intermediate data cache unit, the method comprises: receiving view information, intermediate common data and intermediate private data sent by a shader execution unit, wherein the intermediate common data and the intermediate private data are obtained by the view data processing method according to any one of claims 1 to 3; Acquire the number of attributes of the intermediate common data and the intermediate private data, and obtain the size of vertex intermediate data of each vertex based on the number of attributes and the view information, wherein the vertex intermediate data includes the intermediate common data and the intermediate private data; Allocate a corresponding storage space for each vertex based on the vertex intermediate data, the storage space comprising a shared data storage area and a dedicated data storage area; storing the intermediate shared data in the shared data storage area; The intermediate dedicated data is stored in a dedicated data storage area, wherein the vertex intermediate data stored in the storage space is used for primitive drawing.
5. The method according to claim 4, characterized in that The acquiring the number of attributes of the intermediate common data and the intermediate dedicated data, and obtaining the size of the vertex intermediate data of each vertex based on the number of attributes and the view information, includes: Obtaining a common data size based on the number of attributes of the intermediate common data and the number of components contained in each attribute; Obtaining a size of the dedicated data corresponding to each view based on the number of attributes of the intermediate dedicated data and the number of components contained in each attribute; The size of the vertex intermediate data of each vertex is obtained based on the common data size, the private data size corresponding to each view, and the view information.
6. The method according to claim 5, characterized in that The allocating corresponding storage space to each vertex based on the vertex intermediate data includes: Determine the storage address of the vertex based on the vertex index and the size of the vertex intermediate data of each vertex; Based on the attribute index, the number of components contained in each attribute and the storage address of the vertex, a common attribute storage address is obtained; Based on the component index and the common attribute storage address, a common component storage address is obtained, and based on the common storage address of each component of each attribute, a common data storage area is obtained; Obtaining a view storage address based on the storage address of the vertex, the common data size, and the view index; Based on the view storage address, the attribute index, the number of attributes and the number of components contained in each attribute, obtain a view-specific data attribute storage address; Based on the view-specific data attribute storage address and the index of the component, obtaining a view-specific data component storage address; A dedicated data storage area is obtained based on the storage address of each of the components of each of the attributes of each of the views.
7. A method for processing view data, characterized in that: Applied to a rasterization pipeline unit, the method comprises: Acquire intermediate common data and intermediate private data from a vertex intermediate data cache unit, wherein the intermediate private data carries a view index, and the intermediate common data and intermediate private data are obtained by the view data processing method according to any one of claims 1 to 3; Primitive drawing is performed based on the intermediate common data and the intermediate private data.
8. The method according to claim 7, characterized in that The step of obtaining the intermediate shared data and the intermediate dedicated data from the vertex intermediate data cache unit includes: Obtaining a storage address of a vertex according to an index of the vertex in the vertex intermediate data cache unit; Based on the storage address of the vertex, start reading the attribute data of the vertex; In the case where the attribute data is intermediate common data, reading the corresponding intermediate common data; In the case where the attribute data is intermediate private data, the corresponding intermediate private data is read.
9. The method according to claim 8, characterized in that The reading of the corresponding output common data includes: Based on the attribute index, the number of components contained in each attribute and the storage address of the vertex, a common attribute storage address is obtained; Based on the component index and the common attribute storage address, obtain a common component storage address; Based on the common component storage address and the common attribute storage address, the corresponding intermediate common data is read.
10. The method according to claim 9, characterized in that The reading of the corresponding intermediate dedicated data comprises: Obtaining a view storage address based on the storage address of the vertex, the common data size, and the view index; Obtaining a view-specific data attribute storage address based on the view storage address, the attribute index, the number of attributes of the intermediate-specific data, and the number of components contained in each attribute; Based on the view-specific data attribute storage address and the component index, obtaining the view-specific data component storage address; Based on the view storage address, the view specific data attribute storage address and the view specific data component storage address, the corresponding intermediate specific data is read.
11. A view data processing device, characterized in that: Applied to a shader execution unit, the device comprises: A program acquisition module is used to acquire a shader multi-view loop processing program compiled by a compiler; A view acquisition module, used for executing the shader multi-view loop processing program to obtain each activated view; An intermediate common data calculation module, used for loading vertex input data when processing the first activated view, and obtaining intermediate common data corresponding to each vertex based on the vertex input data; An intermediate dedicated data calculation module, used for loading the input data of each activated view, and obtaining the intermediate dedicated data based on the input data of each activated view; The data storage module is used to output the intermediate common data and the intermediate special data to the vertex intermediate data cache unit, and the intermediate common data and the intermediate special data stored in the vertex intermediate data cache unit are used for primitive drawing.
12. A view data processing device, characterized in that: Applied to a vertex intermediate data cache unit, the device comprises: a receiving module, configured to receive view information, intermediate common data and intermediate private data sent by a shader execution unit, wherein the intermediate common data and intermediate private data are obtained by the view data processing device according to claim 11; a vertex intermediate data size determination module, used to obtain the number of attributes of the intermediate common data and the intermediate private data, and obtain the size of the vertex intermediate data of each vertex based on the number of attributes and view information, wherein the vertex intermediate data includes the intermediate common data and the intermediate private data; A storage area determination module, used to allocate a corresponding storage space to each vertex based on the vertex intermediate data, wherein the storage space includes a shared data storage area and a dedicated data storage area; A shared data storage module, used for storing the intermediate shared data in the shared data storage area; The dedicated data storage module is used to store the intermediate dedicated data in a dedicated data storage area, wherein the vertex intermediate data stored in the storage space is used for primitive drawing.
13. A view data processing device, characterized in that: Applied to a rasterization pipeline unit, the device comprises: a data reading module, configured to obtain intermediate common data and intermediate special data from a vertex intermediate data cache unit, wherein the intermediate special data carries a view index, and the intermediate common data and intermediate special data are obtained by the view data processing device according to claim 11; The drawing module is used for drawing primitives based on the intermediate common data and the intermediate dedicated data.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 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 method according to any one of claims 1 to 10 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.