System and method for reading arrays of data by rebuilding an index buffer while preserving order
摘要:
Disclosed herein are systems and methods for reading input data into a geometry shader by rebuilding an index buffer. In one aspect, an exemplary method comprises constructing T-vectors for one-element ranges of the index buffer by defining each T-vector as a 4-component vector, calculating T-vectors for ranges [0; i] for all vertices of the index buffer by prefix scanning, for each vertex and for each primitive featuring the vertex, determining if the primitive is complete, and for each complete primitive, calculating an offset in an output index buffer using a component of the T-vector used to indicate, for the vertex, a number of complete primitives inside the range and a component that indicates a number of vertices since a last primitive restart, and writing an index value in an output index buffer, and reading input data into the geometry shader in accordance with the written index values.
信息查询
0/0