Class Decode
The Decode class provides static methods for decoding/decompressing meshoptimizer compressed vertex and index buffers.
Inherited Members
Namespace: Meshoptimizer
Assembly: Unity.Meshopt.Decompress.dll
Syntax
public static class Decode
Methods
DecodeGltfBuffer(NativeSlice<int>, NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter)
Creates a C# job that decompresses the provided source buffer into destination
Declaration
public static JobHandle DecodeGltfBuffer(NativeSlice<int> returnCode, NativeArray<byte> destination, int count, int size, NativeSlice<byte> source, Mode mode, Filter filter = Filter.None)
Parameters
Type | Name | Description |
---|---|---|
Native |
returnCode | An array with a length of one. The job's return code will end up at index 0 |
Native |
destination | Destination buffer where the source will be decompressed into |
int | count | Number of elements (vertices/indices) to decode |
int | size | Size of elements (vertex/index) in bytes |
Native |
source | Source buffer |
Mode | mode | Compression mode |
Filter | filter | In case of Attributes mode, filter to be applied |
Returns
Type | Description |
---|---|
Job |
JobHandle for the created C# job |
Exceptions
Type | Condition |
---|---|
Argument |
Thrown upon invalid mode/filter |
DecodeGltfBufferSync(NativeArray<byte>, int, int, NativeSlice<byte>, Mode, Filter)
Synchronous variant of Decode
Declaration
public static int DecodeGltfBufferSync(NativeArray<byte> destination, int count, int size, NativeSlice<byte> source, Mode mode, Filter filter = Filter.None)
Parameters
Type | Name | Description |
---|---|---|
Native |
destination | Destination buffer where the source will be decompressed into |
int | count | Number of elements (vertices/indices) to decode |
int | size | Size of elements (vertex/index) in bytes |
Native |
source | Source buffer |
Mode | mode | Compression mode |
Filter | filter | In case of Attributes mode, filter to be applied |
Returns
Type | Description |
---|---|
int | Return code that is 0 in case of success |