Detailed Description
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
In addition, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
A graphics processing unit (Graphics Processing Unit, GPU) pipeline includes a series of processing stages for converting graphics data into pixels that are ultimately displayed on a screen. These stages in turn process the graphics data, each stage performing a specific task, ultimately producing a final image. A typical GPU pipeline includes the following stages of processing:
1. vertex shading (Vertex loader) phase, the first phase of the GPU pipeline, is used for receiving Vertex data input such as Vertex coordinates, color and texture coordinates, and performing Vertex-level computation and transformation such as model transformation, view transformation and projection transformation. The vertex shading stage may process vertex attributes, such as color interpolation, normal transformation, etc., and output processed vertex data.
2. Primitive assembly (PRIMITIVE ASSEMBLY) stage, at which the GPU assembles the colored vertices into primitives and outputs primitive data. The primitive may be a point, a line segment, or a triangle. The primitive data may include a correspondence of primitives to vertices.
3. Geometry Shader (Geometry Shader) stage the Geometry Shader stage is an optional stage that does not require the GPU to support. At this stage, the GPU performs geometry-dependent operations on the primitives, such as geometric transformations, normal calculations, clipping, etc., and outputs the processed primitive data.
4. A rasterization (Rasterization) stage in which the primitive data is converted into pixels on the screen. This stage determines which pixels are covered by the primitive and generates a Fragment (Fragment) for each pixel.
5. Fragment shading (FRAGMENT SHADER) stage, which is an important stage of the GPU pipeline, takes as input fragments generated by the rasterization stage, calculates the color and other properties of the fragments, such as texture sampling, illumination model, shadow calculation, etc., and outputs pixel colors.
6. Segment-by-segment operation (Per-Fragment Operations) phase in which some operations are performed on each segment, such as depth testing, stencil testing, blending, etc., and the final pixel is output. These operations can affect whether the fragment is ultimately written to the frame buffer and how it is mixed with existing pixels.
7. Frame buffer write (Framebuffer Write) stage-frame buffer write is the last stage of the GPU pipeline to write the final pixels to the frame buffer for display by the display.
Wherein, the rasterization is a key stage in the GPU pipeline, and the rasterization stage mainly comprises the following steps:
1. And assembling the graphics primitives according to the vertex data output by the vertex shader and the graphics primitive data output by the graphics primitive assembling stage (or the geometry shading stage), and establishing the corresponding relation between the graphics primitives and the vertex coordinates.
2. Primitive clipping-prior to starting rasterization, the GPU will typically clip primitives to ensure that only a portion of the triangles within the view cone will be rasterized, thereby improving rendering efficiency.
3. Projective transformation-after clipping, the vertices of the primitives are projectively transformed and mapped to a normalized device space coordinate system (Normalized Device Coordinate, NDC).
4. Viewport transformation-after projective transformation, the vertices of the primitives are mapped to rendering target space, thereby determining the locations of the vertices of the primitives on the screen.
5. The graphic element setting, wherein the GPU determines the pixel to be rasterized according to the projected vertex coordinates and the position of the pixel relative to the graphic element.
6. Scan conversion-in the rasterization phase, the GPU will scan convert each primitive. In this process, the GPU determines the pixel coverage of the primitive on the screen, and the position of each pixel relative to the primitive.
7. Pixel interpolation-during rasterization, the GPU will also interpolate vertex attributes (e.g., color, texture coordinates, etc.) on the primitives to determine the final attribute value for each pixel. This ensures a smooth transition of the rendering results inside the primitives.
8. Fragment generation-after scan conversion, the GPU generates pixel fragments that cover the primitives. Each segment contains the pixel's location, color, depth value, and possibly other attributes.
In the primitive clipping step, when clipping the primitive, it is desirable to keep the primitive wholly located within the rendering target and the part of the primitive located within the rendering target in the primitive intersecting with the rendering target. If the rendering target is directly taken as the basis for clipping the primitives, the primitives intersected with the rendering target are clipped.
Clipping is a time consuming operation in the GPU pipeline and a single primitive may be clipped into multiple primitives, resulting in an increased number of primitives after clipping. To reduce clipping time and reduce the number of primitives after clipping, a clipping guard band (guardband) may be used and placed around the rendering target, where only primitives that intersect the clipping guard band are clipped. In this case, for any one of the primitives intersecting the rendering target but not intersecting the clipping guard band, clipping is required when the clipping guard band is not used, but not when the clipping guard band is used, so that the clipping times and clipping time are reduced, and the rendering efficiency is improved. The primitives within the clipping guard band can be expressed with the precision required by the application programming interface (Application Programming Interface, API) and hardware, so that the primitives within the clipping guard band are not clipped and have no effect on the precision of the rendering results.
The number of cuts is related to the size of the cut guard band. Fig. 1 shows the effect of different sizes of cut guard bands on the number of cuts.
As shown in fig. 1, the size of the clipping guard band 2 is smaller than that of the clipping guard band 1, and when the clipping guard band 2 is used, all of the primitives 1, 2,3, and 4 intersect with the clipping guard band 2, so that all of the primitives 1, 2,3, and 4 need clipping. When the clipping guard band 1 is used, only the primitives 2, 4 intersect the clipping guard band 1, so that only the primitives 2, 4 need be clipped. It follows that a guard band of larger size can further reduce the number of primitives that are clipped compared to a smaller size clipping guard band.
However, clipping the guard band is not unlimited, because the vertex coordinates of the clipped primitive need to be used in the rasterization stage, and the data precision supported in the rasterization stage is preset, if the clipping guard band is oversized, the precision of the vertex coordinates of the clipped primitive may be greater than the preset data precision, and the data precision of the rasterization stage needs to be additionally modified to make rasterization normally performed, thereby increasing the complexity of the GPU.
In the prior art solutions, clipping protection bands are typically manually configured such that a rendering target is located in the clipping protection band, and vertex coordinate accuracy of primitives clipped based on the clipping protection band is less than or equal to a preset data accuracy. However, if the size of the rendering target is changed, it is necessary to manually adjust configuration information of the cut guard band, and the configuration of the cut guard band is not flexible enough.
In view of this, the disclosure provides a primitive clipping method, a device, an electronic device and a storage medium. According to the method, configuration information of the clipping protection band is determined in a self-adaptive mode according to the size of the rendering target and the preset data precision of the rasterization stage, so that the clipping protection band is configured flexibly when the size of the rendering target changes, and the GPU performance is improved under the condition that the early stage of the rasterization function is not affected.
Further, the configuration information determined by the method can enable the size of the clipping protection band to be larger, so that the clipping of the graphic primitive is fewer, the clipping time consumption of the graphic primitive is smaller, and the rendering efficiency is higher.
Fig. 2 illustrates an exemplary application scenario of a primitive clipping method according to an embodiment of the present disclosure.
As shown in fig. 2, the primitive clipping method of the present disclosure may be applied to a primitive clipping device in a GPU and used to complete clipping of primitives. The primitive clipping device can store the information of the preset data precision of the rasterization stage, and after receiving the size of the rendering target, the primitive clipping device can firstly determine the configuration information of clipping the protection belt according to the size of the rendering target and the preset data precision of the rasterization stage. The primitive clipping device can also receive the vertex coordinates of the primitives and primitive information (such as textures of the primitives, etc.), determine whether the primitives need clipping according to the configuration information of clipping protection bands and the vertex coordinates of the primitives, clip the primitives needing clipping by using the clipping protection bands, and remove invalid primitive information. The primitive clipping result can be put into a vertex buffer area for other functional modules of the later stage, such as a triangle parameter setting module, a depth and gradient setting module and the like. The triangle parameter setting module and the depth and gradient setting module are all existing modules in the prior art, and the functions of the triangle parameter setting module and the depth and gradient setting module are not repeated here.
Fig. 3 shows a schematic diagram of a flow of a primitive clipping method according to an embodiment of the present disclosure.
As shown in fig. 3, in one possible implementation, the present disclosure proposes a primitive clipping method, which includes:
Step 31, determining configuration information of the clipping guard band according to the size of the rendering target and the preset data precision of the rasterization stage, so that the rendering target is positioned in the clipping guard band, the size of the rendering target comprises the size of the rendering target in one or more clipping directions of the rendering target space, and the configuration information comprises the configuration information of the clipping guard band in each clipping direction;
Step 32, generating a clipping mask of the primitive according to the vertex coordinates and configuration information of the primitive, wherein the clipping mask of the primitive indicates whether to clip the primitive, and when the clipping mask of the primitive indicates to clip the primitive, the clipping mask of the primitive also indicates the clipping mode of the primitive;
And step 33, when the clipping mask of the primitive indicates to clip the primitive, clipping the primitive according to the clipping mode indicated by the clipping mask of the primitive, wherein the precision of the vertex coordinates of the clipped primitive is smaller than or equal to the preset data precision.
For example, a render target refers to a buffer for drawing textures, typically rectangular in shape. The rendering target space refers to a coordinate space that may express a real size of a rendering target, and may include a first clipping direction X and a second clipping direction Y, which are perpendicular. The dimension W of the rendering object in the first clipping direction X may represent the width of the rendering object. The dimension H of Y in the second clipping direction may represent the height of the rendering target. X and Y may be positive integers. The size of the render target may include the size of the render target in one or more clipping directions of the render target space, i.e., including at least one of X and Y.
The preset data precision of the rasterization stage may be, for example, a fixed point number in 16.8 format, where the maximum coordinate in which the rendering target space can be expressed in each clipping direction is 64k (the maximum expression range of 16-bit integer). It will be appreciated by those skilled in the art that the preset data precision of the rasterization stage may also be a fixed point number in 18.8 format, where the maximum coordinate that the rendering target space can express in each clipping direction is 256k (the maximum expression range of an 18-bit integer). The embodiments of the present disclosure do not limit the preset data precision of the rasterization stage.
After determining the size of the rendering object and the preset data precision of the rasterization stage, step S31 may be executed to determine configuration information of the clipping guard band according to the size of the rendering object and the preset data precision of the rasterization stage. The configuration information of the clipping protection band may include configuration information of the clipping protection band in each clipping direction, and the configuration information of the clipping protection band in different clipping directions may be the same or different. The configuration information of the clipping guard band may indicate a position and a shape of the clipping guard band in a rendering target space, and the rendering target may be located in the clipping guard band. Examples of configuration information of the cut guard band are given later. The present disclosure is not limited to the specific implementation of step S31, and exemplary implementations are given below.
Multiple primitives may be included in the render target space. As described above, not all primitives need to be cropped. Therefore, whether each primitive needs to be cut or not can be judged, and only the primitive needing to be cut is cut. The method can sequentially judge whether the plurality of primitives need to be cut or not, and can judge whether the plurality of primitives need to be cut or not in parallel, and the method is not limited in this disclosure. For clarity of description, the following takes as an example a determination as to whether or not a plurality of primitives need clipping in turn.
For any primitive, step S32 may be executed first, to determine whether the primitive needs clipping according to the vertex coordinates and configuration information of the primitive, and to generate a clipping mask of the primitive. The present disclosure is not limited to the specific implementation of step S32, and exemplary implementations are given below. The clipping mask of the primitive may indicate whether to clip the primitive, and when the clipping mask of the primitive indicates to clip the primitive, the clipping mask of the primitive also indicates the clipping manner of the primitive. Further, judging whether the primitive needs to be cut or not can firstly judge whether the primitive needs to be cut or not, directly determining that the primitive does not need to be cut for the primitive needing to be cut, and further judging whether the primitive needs to be cut or not for the primitive which does not need to be cut. In this way, the number of primitives to be clipped can be reduced to further reduce the number of primitive clipping times.
When the clipping mask of the current primitive indicates that the primitive is not clipped, the clipping step of the current primitive may be skipped, and the determination of whether the next primitive needs clipping is continued, that is, step S32 is re-executed for the next primitive.
When the clipping mask of the current primitive indicates clipping the primitive, the clipping step of the current primitive may be continued, that is, step S33 is performed, clipping the primitive according to the clipping mode indicated by the clipping mask of the primitive. The present disclosure is not limited to the specific implementation of step S33, and exemplary implementations are given below. Because the configuration information of the clipping protection belt is determined based on the preset data precision of the rasterization stage, the configuration information is used for determining the position relation between the graphic primitive and the clipping protection belt, and the position relation is used for determining the clipping mask of the graphic primitive, the precision of the vertex coordinates of the graphic primitive can be smaller than or equal to the preset data precision after clipping according to the clipping mode indicated by the clipping mask of the graphic primitive, so that the rasterization function is not influenced.
According to the primitive clipping method, configuration information of clipping protection bands can be determined in a self-adaptive mode according to the size of a rendering target and preset data precision of a rasterization stage, the rendering target is located in the clipping protection bands, configuration flexibility of the clipping protection bands is improved, a clipping mask of the primitive is generated according to vertex coordinates and the configuration information of the primitive, the clipping mask of the primitive indicates whether the primitive is clipped, the clipping mask of the primitive also indicates the clipping mode of the primitive when the clipping mask of the primitive indicates the clipping primitive, whether the primitive is to be clipped or not and how the primitive is to be clipped can be determined according to the clipping mask of the primitive, and when the clipping mask of the primitive indicates the clipping primitive, the clipping mode of the clipping protection bands is clipped according to the clipping mode of the primitive, because the configuration information of the clipping protection bands is determined based on the preset data precision of the rasterization stage, the precision of the vertex coordinates of the primitive after clipping mode according to the clipping mask of the primitive can be smaller than or equal to the preset data precision, and therefore the rasterization function is not influenced. In summary, the primitive clipping method disclosed by the disclosure can adaptively determine configuration information of clipping protection bands according to the size of a rendering target and the preset data precision of a rasterization stage, so that the clipping protection bands are flexibly configured when the size of the rendering target changes, and the performance of the GPU is improved under the earlier stage of not affecting the rasterization function.
Exemplary contents included in the configuration information of the cut guard band are described below.
In one possible implementation, the configuration information of the clip guard band in any one of the clip directions includes scale information and offset information, wherein,
The ratio information represents a ratio of a first difference value to a size of the rendering target in the clipping direction, the first difference value being equal to a difference value between an actual size of the clipping protection band in the clipping direction and a size of the rendering target in the clipping direction;
The offset information indicates a difference between a minimum coordinate of the rendering target in the clipping direction and a minimum coordinate of the rendering target space in the clipping direction.
Taking the first cutting direction X as an example, the contents included in the configuration information of the cutting protection tape in the first cutting direction X will be described.
Fig. 4 illustrates a positional relationship of clipping guard bands and rendering targets in a first clipping direction X according to an embodiment of the disclosure.
As shown in fig. 4, it is assumed that the minimum coordinate of the rendering target space in the first clipping direction X is 0 and the maximum coordinate is max_resolution_x. In the first clipping direction X, the minimum coordinate X2 of the rendering target is larger than the minimum coordinate X1 of the clipping guard band, the maximum coordinate X3 of the rendering target is smaller than the maximum coordinate X4 of the clipping guard band, and the rendering target is located at the center of the clipping guard band, that is, x2—x1=x4—x3. In the first clipping direction X, the minimum coordinate X1 of the clipping guard band is larger than the minimum coordinate of the rendering target space, i.e., X1>0, and the maximum coordinate X4 of the clipping guard band is smaller than the maximum coordinate of the rendering target space, i.e., x4< max_resolution_x.
The configuration information of the cut guard band in the first cutting direction X includes scale information Kx and offset information Bx. The definition of the scale information Kx and the offset information Bx is given below.
In the example of fig. 4, the dimension w=x3-X2 of the rendering target in the first clipping direction X. The actual dimension W 'of the clipping guard band in the first clipping direction X is equal to the difference between the maximum coordinate X4 and the minimum coordinate X1 of the clipping guard band, i.e., W' =x4-X1. The difference (W ' -W) of the actual size W ' of the clipping protection band in the first clipping direction X and the size W of the rendering target in the first clipping direction X, also referred to as the first difference in the first clipping direction X in this disclosure, is W ' -w= (X4-X1) - (X3-X2) =x4-x3+x2-x1=2 (X4-X3) =2 (X2-X1).
In the present disclosure, in the first clipping direction X, the first difference value (W' -W) may be proportional to the size (W) of the rendering target, and the scale information Kx may indicate a proportional relationship of the two. That is, the ratio information Kx of the clipping protection tape in the first clipping direction X represents a ratio of a first difference value (W '-W) to the size W of the rendering target in the first clipping direction X, the first difference value being equal to a difference value of an actual size W' of the clipping protection tape in the first clipping direction X and the size W of the rendering target in the first clipping direction X. In this case, in the first clipping direction X, the actual size W' =kx×w+w of the clipping protection tape.
In any one of the clipping directions, the position of the rendering target in the rendering target space is not fixed, and may be at the center of the rendering target space, and may be left or right of the center. In the configuration information of the clipping guard band in the first clipping direction X, the offset information Bx may indicate a position of the rendering target with respect to the rendering target space in the first clipping direction X, for example, the offset information Bx may represent a difference between a minimum coordinate X2 of the rendering target in the first clipping direction X and a minimum coordinate 0 of the rendering target space in the first clipping direction X. That is, bx=x2-0=x2.
In this case, if the size W of the rendering target in the first clipping direction X and the offset information Bx are known, it is possible to determine that the minimum coordinate of the rendering target in the rendering target space is Bx and the maximum coordinate is Bx+W in the first clipping direction X, and if the minimum coordinate Bx, the maximum coordinate Bx+W of the rendering target in the rendering target space in the first clipping direction X, and the size W and the scale information Kx of the rendering target in the first clipping direction X are known, it is possible to determine that the minimum coordinate of the clipping guard band in the rendering target space in the first clipping direction X is Bx-Kx X W/2 and the maximum coordinate is Bx+ (W+Kx X W/2).
Similarly, if the size H and the offset information By of the rendering target in the second cropping direction Y are known, the minimum coordinate of the rendering target in the rendering target space is By and the maximum coordinate is by+H, and if the minimum coordinate By and the maximum coordinate by+H of the rendering target in the rendering target space in the second cropping direction Y, the size H and the proportion information Ky of the rendering target in the second cropping direction Y are known, the minimum coordinate of the cropping guard band in the rendering target space is By-Ky×H/2 and the maximum coordinate is by+ (H+Ky×H/2) in the second cropping direction Y can be determined.
That is, in one possible implementation, for any one clipping direction corresponding to the size of the rendering target, the clipping guard band has a minimum coordinate of b-mxr/2 and a maximum coordinate of b+ (r+mxr/2) in that clipping direction, wherein,
R represents the size of the rendering target in the clipping direction, R is a positive integer;
m represents the proportion information of the clipping protection band in the clipping direction, and m is a positive number;
b represents offset information of the clipping guard band in the clipping direction, and b is a positive number.
For the first clipping direction X, R may be equal to W, m may be equal to Kx, and b may be equal to Bx. For the second clipping direction Y, R may be equal to H, m may be equal to Ky, and b may be equal to By.
Before rasterization, the coordinates of the render target first need to be transformed to the normalized device space NDC coordinate system, so fig. 4 also shows the coordinates of the render target in the NDC coordinate system and the coordinates of the clipping guard band. As shown in fig. 4, if the maximum coordinate X3 of the rendering target in the first clipping direction X is transformed to 1 in the NDC coordinate system and the minimum coordinate X2 of the rendering target in the first clipping direction X is transformed to-1 in the NDC coordinate system, the maximum coordinate X4 of the clipping guard band in the first clipping direction X may be 1+m and the minimum coordinate X1 of the clipping guard band in the first clipping direction X may be- (1+m) in the NDC coordinate system.
An exemplary determination of the scale information and the offset information of the cut guard band in the first cutting direction X is described below.
In one possible implementation, determining configuration information of clipping guard bands according to a size of a rendering target and a preset data precision of a rasterization stage (step S31) includes:
For any one of the clipping directions corresponding to the size of the rendering target,
Determining the maximum size and the maximum coordinate of the rendering target space in the clipping direction according to the preset data precision of the rasterization stage;
Determining proportion information of a cutting protection belt in the cutting direction according to the size of a rendering target in the cutting direction and the maximum size and the maximum coordinate of a rendering target space in the cutting direction, and determining offset information of the cutting protection belt in the cutting direction according to the size and the proportion information of the rendering target in the cutting direction and the maximum size and the maximum coordinate of the rendering target space in the cutting direction, so that the actual size of the cutting protection belt in the cutting direction is smaller than the maximum size of the rendering target space in the cutting direction, the minimum coordinate of the cutting protection belt in the cutting direction is larger than 0, and the maximum coordinate of the cutting protection belt in the cutting direction is smaller than the maximum coordinate of the rendering target space in the cutting direction.
For example, when determining the configuration information, only the size of the rendering target in one clipping direction may be used, or the sizes of the rendering targets in a plurality of clipping directions may be used. If the size of the rendering object in a plurality of clipping directions is used, it is necessary to determine the configuration information of the clipping protection tape in the clipping direction for each clipping direction separately, in which case the configuration information of the clipping protection tape in different clipping directions may be different.
For example, for any clipping direction corresponding to the size of the rendering target, the maximum size and the maximum coordinate of the rendering target space in the clipping direction may be determined according to the preset data precision of the rasterization stage.
The minimum coordinates of the rendering target space in different clipping directions may be the same and equal to 0. The maximum coordinates of the rendering target space in different clipping directions may be the same or different as long as the accuracy of the maximum coordinates of the rendering target space in each clipping direction is made smaller than or equal to the preset data accuracy.
Taking the example that the preset data precision of the rasterization stage is a fixed point number in a 16.8 format, the maximum coordinate of the expressible rendering target space in each clipping direction is 64k (the maximum expression range of 16-bit integer). The minimum coordinates of the rendering target space in different clipping directions may be the same and equal to 0, and when the rendering target space is maximum, the maximum size of the rendering target space in different clipping directions and the maximum coordinates are equal to and equal to 64k.
For example, the user may reduce the rendering target space according to the application scene requirement, and the maximum size and the maximum coordinate of the rendering target space in different clipping directions may be different. As long as the accuracy of the maximum coordinates of the rendering target space in each clipping direction is less than or equal to the preset data accuracy. The present disclosure is not limited to a specific determination manner of the maximum size, maximum coordinates of the rendering target space in each clipping direction.
The coordinate of the clipping guard band is set in the rendering target space entirely, that is, in any clipping direction, the actual size of the clipping guard band in the clipping direction is smaller than the maximum size of the rendering target space in the clipping direction, the minimum coordinate of the clipping guard band in the clipping direction is larger than 0, and the maximum coordinate of the clipping guard band in the clipping direction is smaller than the maximum coordinate of the rendering target space in the clipping direction.
From the above conditions, formulas (1) to (6) can be obtained:
Kx×W+W<MAX_RESOLUTION_X (1)
Bx-Kx×W/2>0 (2)
Bx+Kx×W/2+W<MAX_RESOLUTION_X (3)
Ky×H+H<MAX_RESOLUTION_Y (4)
By-Ky×H/2>0 (5)
By+Ky×H/2+H<MAX_RESOLUTION_Y (6)
in the formulas (1) - (3), kx×W+W represents the actual size of the cut-out protection tape in the first cut-out direction X, MAX_RESOLUTION_X represents the maximum size and the maximum coordinate of the rendering target space in the first cut-out direction X, bx-Kx×W/2 represents the minimum coordinate of the cut-out protection tape in the first cut-out direction X, and Bx+Kx×W/2+W represents the maximum coordinate of the cut-out protection tape in the first cut-out direction X.
In the formulas (4) - (6), ky represents the proportion information of the cut-out protection tape in the second cutting direction Y, by represents the offset information of the cut-out protection tape in the second cutting direction Y, H represents the size of the rendering target in the second cutting direction Y, ky×h+h represents the actual size of the cut-out protection tape in the second cutting direction Y, max_resolution_y represents the maximum size of the rendering target space in the second cutting direction Y, by-ky×h/2 represents the minimum coordinate of the cut-out protection tape in the second cutting direction Y, by+ky×h/2+H represents the maximum coordinate of the cut-out protection tape in the second cutting direction Y.
The formulas (1) - (6) can be further simplified, and the value range of Kx, bx, ky, by is obtained as follows:
Kx<MAX_RESOLUTION_X/X-1;
Kx×W/2<Bx<MAX_RESOLUTION_X-(W/2+1)W;
Ky<MAX_RESOLUTION_Y/Y-1;
Ky×H/2<By<MAX_RESOLUTION_Y-(H/2+1)H;
Any numerical combination of Kx and Bx which satisfies the above-mentioned value range can be set as the proportion information and the offset information of the clipping protection band in the first clipping direction X, and any numerical combination of Ky and By which satisfies the above-mentioned value range can be set as the proportion information and the offset information of the clipping protection band in the second clipping direction Y.
Only two clipping directions are shown above, and those skilled in the art will understand that there may be more clipping directions for the rendering target space, and the embodiments of the present disclosure do not limit how many clipping directions the rendering target space has in particular.
When configuration information of the clipping protection band is determined by using the sizes of the rendering targets in a plurality of clipping directions, the size setting of the clipping protection band in different clipping directions is more flexible.
In one possible implementation, when the size of the rendering target corresponds to one clipping direction, the size of the rendering target in that clipping direction is greater than or equal to the size in the other clipping directions;
The configuration information of the cut guard band in the cut direction is also used as the configuration information of the cut guard band in other cut directions.
For example, if the configuration information of the clip protection tape is determined using only the size of the rendering target in one clipping direction, the configuration information of the clip protection tape in that clipping direction may be determined in the same manner as when the configuration information of the clip protection tape is determined using the sizes of the rendering target in a plurality of clipping directions. That is, if the configuration information of the clip protection tape is determined using only the size of the rendering target in the first clipping direction X, the configuration information of the clip protection tape in the first clipping direction X may be determined according to formulas (1) - (3). If the configuration information of the clip protection tape is determined using only the size of the rendering target in the second clipping direction Y, the configuration information of the clip protection tape in the second clipping direction Y may be determined according to formulas (4) - (6). The specific determination manner is already described above and will not be described here again.
The configuration information of the cut guard band in the cut direction is also used as the configuration information of the cut guard band in other cut directions. The configuration information of the cut guard bands in the different cut directions is the same, i.e., kx=ky, bx=by.
In order for the clip protection tape to satisfy the condition that the actual size is smaller than the maximum size of the rendering target space in the clipping direction, the minimum coordinate is larger than 0, and the maximum coordinate is smaller than the maximum coordinate of the rendering target space in the clipping direction in each clipping direction, when configuration information of the clip protection tape is determined using only the size of the rendering target in one clipping direction, a clipping direction in which the size of the rendering target is larger, that is, when the size of the rendering target corresponds to one clipping direction, the size of the rendering target in the clipping direction is larger than or equal to the sizes in other clipping directions may be selected. For example, when the size of the rendering object in the first clipping direction X is larger than the size in the second clipping direction Y, the configuration information of the clipping protection tape may be determined by selecting the size of the rendering object in the first clipping direction X. When the size of the rendering object in the first clipping direction X is smaller than the size in the second clipping direction Y, the configuration information of the clipping protection tape may be determined by selecting the size of the rendering object in the second clipping direction Y. When the size of the rendering object in the first clipping direction X is equal to the size in the second clipping direction Y, the configuration information of the clipping protection tape is determined by selecting the size of the rendering object in the second clipping direction Y or the first clipping direction X.
In this case, the manner of determining the configuration information of the cut guard band is simpler.
One exemplary manner in which the present disclosure determines specific values for the scale information and the offset information is described below.
In one possible implementation, when there are a plurality of numerical combinations of the scale information and the offset information of the clipping protection tape in any one clipping direction, a numerical combination is selected such that the actual size of the clipping protection tape in that clipping direction is closest to the maximum size of the rendering target space in that clipping direction.
As described above, since the scale information and the offset information can be derived from the formulas (1) to (6), the values conforming to the scale information and the offset information can be selected, and thus, in any one cutting direction, the scale information and the offset information can be selected by a plurality of combinations of values. And as described above, the larger the cut guard band, the fewer the number of cuts, in which case, in any one cutting direction, the numerical combination that makes the actual size of the cut guard band closest to the maximum size of the cut guard band may be selected so that the actual size of the cut guard band is larger, further reducing the number of cuts.
In practical applications, in any clipping direction, the size of the rendering object is typically an exponential power of 2 (unit bit), such as 1k, 2k, 4k, 8k, 16k, 32k, etc. (1 k equals 1024 bits). Since the selection of the size of the rendering target is limited, a lookup table of configuration information of the clipping guard band may be predetermined. The lookup table may record a correspondence of the size of the render target to the scale information and the offset information. Different look-up tables may be set for different data accuracies of the rasterization phase. Table 1 shows an example of a lookup table of configuration information of a clip guard band when the rasterized data precision is 16.8.
TABLE 1
| Size of rendering target | m | b | Coordinates of cutting protecting band |
| R | m | b | b-m×R/2,b+(R+m×R/2) |
| 32k | 0.5 | 20k | 14k,60k |
| 16k | 2 | 20k | 4k,52k |
| 8k | 6 | 30k | 6k,62k |
| 4k(4096) | 14 | 30k | 2k,62k |
| 2k(2048) | 30 | 31k | 1k,63k |
| 1k(1024) | 60 | 31k | 1k,62k |
In this case, the lookup table to be searched can be found according to the preset data precision of the rasterization stage, and then the configuration information of the clipping protection belt is directly searched in the lookup table according to the size of the rendering target to be used for determining the configuration information of the clipping protection belt, so that the configuration information of the clipping protection belt is not required to be calculated and determined, and the determination efficiency of the configuration information is improved.
In the embodiment of the present disclosure, determining the configuration information of the clipping guard band may be performed by a module of hardware or may be performed by a software algorithm, which is not limited in this disclosure.
An exemplary method of determining the positional relationship of primitives and clipping guard bands of the present disclosure is described below.
In one possible implementation, step S32 includes:
determining coordinates of a cutting face of the cutting protection belt in each cutting direction according to configuration information of the cutting protection belt;
Determining the position relationship between the primitive and each clipping surface according to the vertex coordinates of the primitive and the coordinates of each clipping surface;
And generating clipping masks of the primitives according to the position relation.
For example, the space in which the primitives are located is a three-dimensional space, and thus fig. 1 and 4 show cross-sections of the cut guard bands. The clipping protection belt can have two clipping surfaces in each clipping direction. Wherein the minimum coordinates of the clipping guard band in the clipping direction correspond to the first clipping plane and the maximum coordinates correspond to the second clipping plane.
From the configuration information of the cut protection tape, coordinates of the cut surface of the cut protection tape in each cut direction can be determined. The position relationship between the primitive and each clipping plane can be determined according to the vertex coordinates of the primitive and the coordinates of each clipping plane.
Fig. 5 illustrates an example of a positional relationship of primitives and clipping guard bands according to an embodiment of the present disclosure.
As shown in fig. 5, the clipping protection tape may correspond to the clipping surface 1 and the clipping surface 2 in the first clipping direction X, and the coordinates of all points on the clipping surface 1 in the first clipping direction X are equal to the minimum coordinates of the clipping protection tape in the first clipping direction X, and the coordinates of all points on the clipping surface 3 in the first clipping direction X are equal to the maximum coordinates of the clipping protection tape in the first clipping direction X. The clipping protection band may correspond to the clipping plane 3 and the clipping plane 4 in the second clipping direction Y. The coordinates of all points on the clipping plane 3 in the second clipping direction Y are equal to the minimum coordinates of the clipping protection tape in the second clipping direction Y, and the coordinates of all points on the clipping plane 4 in the second clipping direction Y are equal to the maximum coordinates of the clipping protection tape in the second clipping direction Y.
In this case the positional relationship of the primitive 1 and the clipping guard band may be such that the primitive 1 does not intersect with the clipping surfaces 1,2, 3, 4, i.e. the primitive 1 does not intersect with the clipping guard band, the positional relationship of the primitive 2 and the clipping guard band may be such that the primitive 2 does not intersect with the clipping surfaces 1,2, 3, i.e. the primitive 2 intersects with the clipping guard band, the positional relationship of the primitive 3 and the clipping guard band may be such that the primitive 3 does not intersect with the clipping surfaces 1,2, 3, 4, i.e. the primitive 3 does not intersect with the clipping guard band, and the positional relationship of the primitive 4 and the clipping guard band may be such that the primitive 4 does not intersect with the clipping surfaces 1,2, 4, i.e. the primitive 4 intersects with the clipping guard band.
An exemplary manner in which the present disclosure determines whether primitives require clipping is described below.
In one possible implementation, when the primitive intersects at least one clipping plane and intersects the render target, the clipping mask of the primitive indicates clipping the primitive, the clipping mode of the primitive includes clipping the primitive using the clipping plane that intersects the primitive;
when the primitive does not intersect each clipping plane or does not intersect a rendering target, the clipping mask of the primitive indicates that the primitive is not clipped.
For example, in practical applications, there may be a culling step before rendering to remove primitives that are not visible off-screen to improve rendering performance. If the primitive intersects the clipping guard band, but does not intersect the render target, then the primitive is effectively a cullable primitive, nor does the clipping primitive have an effect on the result of the rasterization. That is, only primitives that intersect at least one clipping plane and also intersect the render target need actually be clipped.
Thus, when a primitive intersects at least one clipping plane and intersects a render target, the clipping mask of the primitive may indicate clipping the primitive in a manner that includes clipping the primitive using the clipping plane that intersects the primitive. For example, in the example of FIG. 5, only primitive 4 intersects at least one clipping plane and intersects the render target, so that only the clipping mask for primitive 4 may indicate clipping primitive 4, and the clipping mask for primitive 4 may also indicate that primitive 4 is clipped using clipping plane 3.
When the primitive and each clipping plane do not intersect, or the primitive and rendering target do not intersect, the primitive does not need clipping, and the clipping mask of the primitive may indicate that the primitive is not clipped. For example, in the example of FIG. 5, primitive 1 and each clipping plane do not intersect, nor do rendering targets, so the clipping mask for primitive 1 may indicate that primitive 1 is not clipped. Primitive 2 and the render target do not intersect, so the clipping mask for primitive 2 may indicate that primitive 2 is not clipped. Primitive 3 and each clipping plane do not intersect, so the clipping mask for primitive 3 may indicate that primitive 3 is not clipped.
By enabling the clipping guard band to play a role in the process of eliminating, the method is beneficial to reducing the cost of unnecessary processing on invisible primitives, so that the number of the clipped primitives is smaller, and the rendering efficiency is improved.
Another exemplary manner in which the present disclosure determines whether primitives require clipping is described below.
In one possible implementation, when the primitive intersects at least one clipping plane, the clipping mask of the primitive indicates clipping the primitive, the clipping mode of the primitive includes clipping the primitive using the clipping plane that intersects the primitive;
when the primitive and each clipping plane do not intersect, the clipping mask of the primitive indicates that the primitive is not clipped.
In one example, when determining whether the primitive needs clipping, whether the primitive needs clipping may also be determined without considering whether the primitive needs clipping, that is, only according to the intersection condition of the primitive and the clipping plane.
In this case, when the primitive intersects at least one clipping plane and intersects the rendering target, it may be determined that the primitive needs to be clipped, and the clipping mask of the primitive may indicate clipping the primitive in a manner that includes clipping the primitive using the clipping plane that intersects the primitive. For example, in the example of FIG. 5, primitive 2 intersects clipping plane 4, primitive 4 intersects clipping plane 3, so that the clipping mask of primitive 4 may indicate clipping primitive 4 and may further indicate that primitive 4 is clipping primitive 4 using clipping plane 3, and the clipping mask of primitive 2 may indicate clipping primitive 2 and may further indicate that primitive 4 is clipping primitive 2 using clipping plane 4.
When the primitive and each clipping plane do not intersect, the clipping mask of the primitive indicates that the primitive is not clipped. For example, in the example of FIG. 5, primitive 1 and primitive 3 do not intersect any clipping plane, so the clipping mask for primitive 1 may indicate that primitive 1 is not clipped and the clipping mask for primitive 3 may indicate that primitive 3 is not clipped.
In this way, it is simpler to determine whether the primitive needs clipping.
One example of a clipping primitive of the present disclosure is described below.
In one possible implementation, step S33 includes:
when the clipping mask of the primitive indicates clipping the primitive, the primitive is clipped in turn according to clipping planes intersecting the primitive, one clipping plane at a time.
For example, since the clipping plane intersecting the primitive has already been determined when the clipping mask of the primitive is generated, the clipping manner of the primitive may indicate all clipping planes intersecting the primitive. It is assumed that only one clipping plane can be used at a time to clip a primitive, in which case, when the clipping mask of the primitive indicates clipping the primitive, the primitive may be clipped sequentially according to clipping planes intersecting the primitive, one clipping plane at a time. After the last clipping surface is used, the primitive clipping is finished.
In this way, the clipping flow of the primitive is simpler.
Another example of clipping primitives of the present disclosure is described below.
In one possible implementation, step S33 includes:
When the clipping mask of the primitive indicates to clip the primitive, selecting any clipping surface from clipping surfaces intersected with the primitive, and clipping the primitive by using the selected clipping surface;
The method further includes updating a clipping mask of the primitive according to the vertex coordinates of the clipped new vertex.
For example, assuming that only one clipping plane can be used at a time to clip a primitive, the shape of the primitive changes after each clipping, and thus an unused clipping plane may be invalid. For example, a certain primitive may intersect 3 clipping planes before clipping, and if clipping is performed in a clipping manner indicated by a clipping mask determined before clipping, clipping is required 3 times. After the 1 st clipping, it may intersect only 1 clipping plane, so in practice 2 clipping is enough to clip the primitive, 1 clipping plane is invalid.
In this case, when the clipping mask of the primitive indicates clipping the primitive, any clipping plane may be selected from clipping planes intersecting the primitive as the clipping plane used in the present clipping. When only one clipping surface is intersected with the graphic primitive, the clipping surface is directly selected. Where there are multiple clipping planes intersecting the primitive, one clipping plane may be randomly selected. The primitives may be cropped using the selected crop plane.
At least one new vertex can be obtained after clipping the primitive. The clipping mask of the primitive may be updated based on the vertex coordinates of the clipped new vertex. For example, the updating manner may be to redetermine the positional relationship between the primitive and each clipping plane according to the vertex coordinates of the new vertex and the vertex coordinates of the valid old vertex and the coordinates of each clipping plane, and generate a clipping mask of the primitive according to the determined positional relationship, that is, the clipping mask of the updated primitive. Determining the positional relationship between the primitive and the clipping plane, and generating the clipping mask of the primitive according to the determined positional relationship has been described above, and will not be described herein.
Step S33 may be re-executed according to the clipping mask of the updated primitive until the clipping mask of the primitive no longer indicates clipping the primitive.
In this way, the number of clipping times of the primitive can be further reduced.
The following describes an exemplary structure of a primitive clipping device implemented using hardware modules and functions of each hardware module according to embodiments of the present disclosure.
Fig. 6 shows a schematic diagram of the structure of a primitive clipping device according to an embodiment of the present disclosure.
As shown in fig. 6, the primitive clipping device may include a configuration information generation unit and a clipping module. The clipping module may include a clipping mask generating unit, a clipping resolution unit, and a clipping execution unit.
The configuration information generation unit may store information of a preset data precision of the rasterization stage. The configuration information generating unit may receive the size of the rendering target and perform step S31 of determining configuration information of the clipping guard band according to the size of the rendering target and the preset data precision of the rasterization stage so that the rendering target is located in the clipping guard band. The configuration information generating unit may obtain the configuration information of the clip tape in each clip direction and output to the clip mask generating unit.
Fig. 7 illustrates a schematic diagram in which a configuration information generating unit outputs configuration information to a clipping mask generating unit according to an embodiment of the present disclosure.
As shown in fig. 7, it is assumed that the rendering target space has a first clipping direction X and a second clipping direction Y. The configuration information generation unit may transmit the configuration information of the clip guard band in the first clip direction X and the configuration information in the second clip direction Y to the clip mask generation unit, respectively.
The clipping mask generating unit also receives the vertex coordinates and performs steps S32 and S33 to generate a clipping mask for the primitive based on the vertex coordinates of the primitive and the configuration information. For example, the clipping mask generating unit may generate a clipping mask of the vertex for the vertex, where the clipping mask of the vertex indicates a positional relationship between the vertex and the clipping surface, and generate a clipping mask of the primitive according to the clipping mask of the vertex, so that the clipping mask of the primitive indicates the positional relationship between the primitive and the clipping surface, and further indicates a clipping manner of the primitive. The clipping mask generating unit may output the clipping mask of the primitive to the clipping resolution unit.
The clipping resolution unit also receives the primitive information, and according to the clipping mask of the primitive and the primitive information, the clipping resolution unit can determine whether to clip the primitive, and further determine which clipping plane is used in the clipping when determining to clip the primitive. The clipping resolution unit may output information of clipping planes used when clipping the graphic element to the clipping execution unit.
The clipping execution unit also receives vertex coordinates and primitive information, clips the primitive according to the clipping plane information used when clipping the primitive, removes invalid vertex coordinates and primitive information when clipping, and generates new vertex coordinates. The clipping execution unit may output the new vertex coordinates to the clipping mask generation unit, and the clipping mask generation unit may generate a new vertex clipping mask for the new vertex coordinates and update the clipping mask of the primitive according to the new vertex clipping mask after receiving the new vertex coordinates.
The clipping resolution unit continues to determine whether to clip the primitive according to the updated primitive clipping mask, and when determining to clip the primitive, the clipping execution unit repeats the above-mentioned procedure until the clipping resolution unit determines that the clipping unit is not required according to the clipping mask, and may drive the clipping execution unit to output the clipping result of the primitive to a vertex buffer (not shown) at a later stage.
The disclosure also provides a primitive clipping device, and fig. 8 is a schematic diagram illustrating a structure of the primitive clipping device according to an embodiment of the disclosure.
As shown in fig. 8, in one possible implementation, the apparatus includes:
A first determining module 81, configured to determine configuration information of a clipping protection band according to a size of a rendering target and a preset data precision of a rasterization stage, so that the rendering target is located in the clipping protection band, where the size of the rendering target includes a size of the rendering target in one or more clipping directions of a rendering target space, and the configuration information includes configuration information of the clipping protection band in each clipping direction;
A first generating module 82, configured to generate a clipping mask of a primitive according to vertex coordinates of the primitive and the configuration information, where the clipping mask of the primitive indicates whether to clip the primitive, and when the clipping mask of the primitive indicates to clip the primitive, the clipping mask of the primitive also indicates a clipping manner of the primitive;
and the first clipping module 83 is configured to clip the primitive according to the clipping mode indicated by the clipping mask of the primitive when the clipping mask of the primitive indicates clipping the primitive, where the accuracy of the vertex coordinates of the clipped primitive is less than or equal to the preset data accuracy.
The first determining module, the first generating module and the first clipping module can be hardware modules or software modules. When the first determining module is used as a hardware module, the first determining module corresponds to the configuration information generating unit, the first generating module corresponds to the clipping mask generating unit, and the first clipping module corresponds to the clipping resolution unit and the clipping execution unit.
In one possible implementation manner, the configuration information of the clipping protection band in any clipping direction includes proportion information and offset information, wherein the proportion information represents a ratio of a first difference value to a size of the rendering target in the clipping direction, the first difference value is equal to a difference value between an actual size of the clipping protection band in the clipping direction and a size of the rendering target in the clipping direction, and the offset information represents a difference value between a minimum coordinate of the rendering target in the clipping direction and a minimum coordinate of a rendering target space in the clipping direction.
In one possible implementation manner, the configuration information of the clipping protection belt is determined according to the size of the rendering target and the preset data precision of the rasterization stage, and the configuration information comprises determining the maximum size and the maximum coordinate of the rendering target space in the clipping direction according to the preset data precision of the rasterization stage for any clipping direction corresponding to the size of the rendering target, determining the proportion information of the clipping protection belt in the clipping direction according to the size of the rendering target in the clipping direction and the maximum size and the maximum coordinate of the rendering target space in the clipping direction, and determining the offset information of the clipping protection belt in the clipping direction according to the size of the rendering target in the clipping direction, the proportion information and the maximum size and the maximum coordinate of the rendering target space in the clipping direction, so that the actual size of the clipping protection belt in the clipping direction is smaller than the maximum size of the rendering target space in the clipping direction, the minimum coordinate of the clipping protection belt in the clipping direction is larger than 0, and the maximum coordinate of the clipping protection belt in the clipping direction is smaller than the maximum coordinate of the target space in the clipping direction.
In one possible implementation manner, when the size of the rendering target corresponds to one clipping direction, the size of the rendering target in the clipping direction is larger than or equal to the size of the rendering target in other clipping directions, and the configuration information of the clipping protection belt in the clipping direction is also used as the configuration information of the clipping protection belt in other clipping directions.
In one possible implementation manner, for any clipping direction corresponding to the size of the rendering target, the minimum coordinate of the clipping protection band in the clipping direction is b-m×r/2, the maximum coordinate is b+ (rm×r/2), wherein R represents the size of the rendering target in the clipping direction, R is a positive integer, m represents the proportion information of the clipping protection band in the clipping direction, m is a positive number, b represents the offset information of the clipping protection band in the clipping direction, and b is a positive number.
In one possible implementation, when there are a plurality of numerical combinations of the scale information and the offset information of the clipping protection band in any one clipping direction, a numerical combination is selected such that the actual size of the clipping protection band in the clipping direction is closest to the maximum size of the rendering target space in the clipping direction.
In one possible implementation manner, the generating the clipping mask of the primitive according to the vertex coordinates of the primitive and the configuration information comprises determining coordinates of clipping surfaces of the clipping protection belt in each clipping direction according to the configuration information of the clipping protection belt, determining a position relation between the primitive and each clipping surface according to the vertex coordinates of the primitive and the coordinates of each clipping surface, and generating the clipping mask of the primitive according to the position relation.
In one possible implementation, when the primitive intersects at least one clipping plane and intersects the rendering target, the clipping mask of the primitive indicates clipping the primitive, the clipping mode of the primitive includes clipping the primitive using the clipping plane intersecting the primitive, and when the primitive does not intersect each clipping plane or does not intersect the rendering target, the clipping mask of the primitive indicates not clipping the primitive.
In one possible implementation, the clipping mask of the primitive indicates clipping the primitive when the primitive intersects at least one clipping plane, and the clipping mode of the primitive includes clipping the primitive using the clipping plane that intersects the primitive, and the clipping mask of the primitive indicates not clipping the primitive when the primitive does not intersect each clipping plane.
In one possible implementation manner, when the clipping mask of the primitive indicates clipping the primitive, clipping the primitive according to the clipping mode indicated by the clipping mask of the primitive comprises selecting any clipping surface from clipping surfaces intersected with the primitive when the clipping mask of the primitive indicates clipping the primitive, clipping the primitive by using the selected clipping surface, and updating the clipping mask of the primitive according to the vertex coordinates of a new vertex obtained by clipping.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementations thereof may refer to descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The disclosed embodiments also provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium.
The embodiment of the disclosure also provides electronic equipment, which comprises a processor and a memory for storing instructions executable by the processor, wherein the processor is configured to realize the method when the instructions stored by the memory are executed.
Embodiments of the present disclosure also provide a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, performs the above method.
Fig. 9 shows a block diagram of an electronic device 1900 according to an embodiment of the disclosure. For example, electronic device 1900 may be provided as a server or terminal device. Referring to FIG. 9, electronic device 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output interface 1958 (I/O interface). The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1932, including computer program instructions executable by processing component 1922 of electronic device 1900 to perform the methods described above.
The present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, punch cards or intra-groove protrusion structures such as those having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as SMALLTALK, C ++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvements in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.