MapBuffer
Function Usage
Maps data in a buffer to the memory.
- If data in the buffer can be mapped to contiguous memory in user space, fill in data and dataLen in the buffer field for this API.
- If data in the buffer cannot be mapped to contiguous memory, leave data in the buffer field empty and fill in the dataLen field.
Prototype
int32_t MapBuffer(GpuEncoderBufferT &buffer, uint32_t flag) = 0
Parameter Description
Field Name |
Input/Output |
Field Type |
Description |
|---|---|---|---|
buffer |
Output |
GpuEncoderBufferT & |
Pointer to the buffer whose data needs to be mapped. |
flag |
Input |
uint32_t |
Configures the access type of the mapping data, including read or write. |
The value of flag is FLAG_READ | FLAG_WRITE when both read and write are enabled.
1 2 3 4 | enum MapFlag : uint32_t { FLAG_READ = 1, FLAG_WRITE = 1 << 1, }; |
Return Value Description
Data type: GpuEncoderErrorCode
The value can be any of the following:
- OK: Data in the buffer is successfully mapped.
- Other: Failed to map data in the buffer.
Parent topic: GPU Acceleration APIs (C and C++)