mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
- nvAddressSpaceMapBuffer now accepts a flags parameter instead of hardcoding NvMapBufferFlags_IsCacheable. - NvBufferFlags was incorrect and was thus removed. - nvBufferCreate/nvBufferCreateRw replaced with nvBufferCreate, with an extra 'is_cacheable' bool parameter. There's no such thing as a "read-only/read-write" buffer. - nvBufferMakeCpuUncached/nvBufferMakeCpuCached were removed.
31 lines
762 B
C
31 lines
762 B
C
#pragma once
|
|
#include "types.h"
|
|
#include "address_space.h"
|
|
|
|
typedef struct NvAddressSpace NvAddressSpace;
|
|
|
|
typedef struct NvBuffer {
|
|
u32 fd;
|
|
u32 size;
|
|
void* cpu_addr;
|
|
iova_t gpu_addr;
|
|
iova_t gpu_addr_texture;
|
|
NvAddressSpace* addr_space;
|
|
NvKind kind;
|
|
bool has_init;
|
|
bool is_cacheable;
|
|
} NvBuffer;
|
|
|
|
Result nvBufferInit(void);
|
|
u32 nvBufferGetNvmapFd(void);
|
|
void nvBufferExit(void);
|
|
|
|
Result nvBufferCreate(NvBuffer* m, size_t size, u32 align, bool is_cacheable, NvKind kind, NvAddressSpace* as);
|
|
void nvBufferFree(NvBuffer* m);
|
|
|
|
void* nvBufferGetCpuAddr(NvBuffer* m);
|
|
iova_t nvBufferGetGpuAddr(NvBuffer* m);
|
|
|
|
Result nvBufferMapAsTexture(NvBuffer* m, NvKind kind);
|
|
iova_t nvBufferGetGpuAddrTexture(NvBuffer* m);
|