diff options
author | Reiko Asakura | 2020-09-23 13:03:51 -0400 |
---|---|---|
committer | Reiko Asakura | 2020-09-23 13:03:51 -0400 |
commit | efc507147e0beb1ac5b2f046bf8e4d902bca652c (patch) | |
tree | 19d92ed113ce6ee627d5042953691c0baac14851 /include/user/gxm/memory.h | |
parent | Add SceFios2Kernel (diff) | |
download | vds-libraries-efc507147e0beb1ac5b2f046bf8e4d902bca652c.tar.gz |
Refactor SceGxmInternal headers
Diffstat (limited to 'include/user/gxm/memory.h')
-rw-r--r-- | include/user/gxm/memory.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/include/user/gxm/memory.h b/include/user/gxm/memory.h new file mode 100644 index 0000000..fb33636 --- /dev/null +++ b/include/user/gxm/memory.h @@ -0,0 +1,109 @@ +#ifndef _DOLCESDK_PSP2_GXM_MEMORY_INTERNAL_H_ +#define _DOLCESDK_PSP2_GXM_MEMORY_INTERNAL_H_ + +/** @file + + Memory mapping API for the GPU. +*/ + +#include <psp2/gxm/memory.h> + +#ifdef __cplusplus +extern "C" { +#endif // def __cplusplus + +/** Maps memory for vertex USSE code usage. If successful, this mapping + operation returns a USSE offset to address the memory as vertex USSE code. + + @param[in] base A 4K-aligned base address of the region to map. + @param[in] size A 4K-aligned size in bytes of the region to map. This + cannot be greater than 8MB. + @param[in] offset A pointer to a 32-bit value to hold the USSE offset. + + @retval + SCE_OK The operation was completed successfully. + @retval + SCE_GXM_ERROR_UNINITIALIZED The operation failed because the library was not initialized. + @retval + SCE_GXM_ERROR_INVALID_POINTER The operation failed because a pointer was invalid. + @retval + SCE_GXM_ERROR_INVALID_VALUE The operation failed because a parameter was invalid. + @retval + SCE_GXM_ERROR_DRIVER The operation failed due to a driver error. + + @ingroup render +*/ +SceGxmErrorCode sceGxmMapVertexUsseMemoryInternal(void *base, uint32_t size, uint32_t *offset); + +/** Unmaps memory that was previously mapped as vertex USSE code. It is the + responsibility of the caller to ensure that the GPU no longer needs this + memory for rendering. This could be accomplished by calling #sceGxmFinish() + before unmapping. + + @param[in] base The base address of the region to unmap. This must match + the base address that was used when mapping the memory + using #sceGxmMapVertexUsseMemory(). + + @retval + SCE_OK The operation was completed successfully. + @retval + SCE_GXM_ERROR_UNINITIALIZED The operation failed because the library was not initialized. + @retval + SCE_GXM_ERROR_INVALID_POINTER The operation failed because a pointer was invalid. + @retval + SCE_GXM_ERROR_DRIVER The operation failed due to a driver error. + + @ingroup render +*/ +SceGxmErrorCode sceGxmUnmapVertexUsseMemoryInternal(void *base); + +/** Maps memory for fragment USSE code usage. If successful, this mapping + operation returns a USSE offset to address the memory as fragment USSE code. + + @param[in] base A 4K-aligned base address of the region to map. + @param[in] size A 4K-aligned size in bytes of the region to map. This + cannot be greater than 8MB. + @param[in] offset A pointer to a 32-bit value to hold the USSE offset. + + @retval + SCE_OK The operation was completed successfully. + @retval + SCE_GXM_ERROR_UNINITIALIZED The operation failed because the library was not initialized. + @retval + SCE_GXM_ERROR_INVALID_POINTER The operation failed because a pointer was invalid. + @retval + SCE_GXM_ERROR_INVALID_VALUE The operation failed because a parameter was invalid. + @retval + SCE_GXM_ERROR_DRIVER The operation failed due to a driver error. + + @ingroup render +*/ +SceGxmErrorCode sceGxmMapFragmentUsseMemoryInternal(void *base, uint32_t size, uint32_t *offset); + +/** Unmaps memory that was previously mapped as fragment USSE code. It is the + responsibility of the caller to ensure that the GPU no longer needs this + memory for rendering. This could be accomplished by calling #sceGxmFinish() + before unmapping. + + @param[in] base The base address of the region to unmap. This must match + the base address that was used when mapping the memory + using #sceGxmMapFragmentUsseMemory(). + + @retval + SCE_OK The operation was completed successfully. + @retval + SCE_GXM_ERROR_UNINITIALIZED The operation failed because the library was not initialized. + @retval + SCE_GXM_ERROR_INVALID_POINTER The operation failed because a pointer was invalid. + @retval + SCE_GXM_ERROR_DRIVER The operation failed due to a driver error. + + @ingroup render +*/ +SceGxmErrorCode sceGxmUnmapFragmentUsseMemoryInternal(void *base); + +#ifdef __cplusplus +} +#endif // def __cplusplus + +#endif /* _DOLCESDK_PSP2_GXM_MEMORY_INTERNAL_H_ */ |