summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/user/gxm/context.h19
-rw-r--r--include/user/gxm/init.h12
-rw-r--r--include/user/gxm/memory.h59
-rw-r--r--nids/360/SceGpuEs4User.yml3
-rw-r--r--nids/360/SceGxm.yml5
5 files changed, 98 insertions, 0 deletions
diff --git a/include/user/gxm/context.h b/include/user/gxm/context.h
index 06a35fe..3897677 100644
--- a/include/user/gxm/context.h
+++ b/include/user/gxm/context.h
@@ -75,6 +75,25 @@ SceGxmErrorCode sceGxmSetFragmentJobVisibilityBuffer(
void *bufferBase,
uint32_t stridePerCore);
+/** Allocates a VDM buffer for Razor GPU Capture.
+
+ @param[in] context A pointer to the rendering context.
+ @param[in] size The size to allocate.
+ @param[out] mem Receives the buffer address.
+
+ @retval
+ SCE_OK The operation was successful.
+ @retval
+ SCE_GXM_ERROR_RESERVE_FAILED The operation failed due to the VDM buffer callback
+ function failing to provide sufficient memory.
+
+ @ingroup render
+*/
+SceGxmErrorCode sceGxmRazorReplayReserveVdm(
+ SceGxmContext *context,
+ uint32_t size,
+ void **mem);
+
#ifdef __cplusplus
}
#endif // def __cplusplus
diff --git a/include/user/gxm/init.h b/include/user/gxm/init.h
index 6739e2a..8f27a79 100644
--- a/include/user/gxm/init.h
+++ b/include/user/gxm/init.h
@@ -10,6 +10,18 @@
extern "C" {
#endif // def __cplusplus
+/** Flags for libgxm initialization.
+
+ @ingroup render
+*/
+typedef enum SceGxmInitializeFlagsInternal
+{
+ SCE_GXM_INITIALIZE_FLAG_PB_USE_USER_MEMORY = 0x00000001U, ///< Use uncached main memory for the parameter buffer.
+ SCE_GXM_INITIALIZE_FLAG_PBDESCFLAGS_ZLS_OVERRIDE = 0x00000002U,
+ SCE_GXM_INITIALIZE_FLAG_PBDESCFLAGS_SHARED = 0x00000004U, ///< The parameter buffer can be shared between rendering contexts.
+ SCE_GXM_INITIALIZE_FLAG_DRIVER_MEM_SHARE = 0x00000008U ///< Use shared driver memory for the parameter buffer.
+} SceGxmInitializeFlagsInternal;
+
/** Initializes the libgxm library for shared sync objects.
Internally this function will prepare this process for rendering, creating
diff --git a/include/user/gxm/memory.h b/include/user/gxm/memory.h
index de0cb34..cc4125a 100644
--- a/include/user/gxm/memory.h
+++ b/include/user/gxm/memory.h
@@ -12,6 +12,29 @@
extern "C" {
#endif // def __cplusplus
+/** The device heap ID when allocating memory using #sceGxmAllocDeviceMemLinux().
+
+ @ingroup render
+*/
+typedef enum SceGxmDeviceHeapId {
+ SCE_GXM_DEVICE_HEAP_ID_USER_NC,
+ SCE_GXM_DEVICE_HEAP_ID_CDRAM,
+ SCE_GXM_DEVICE_HEAP_ID_VERTEX_USSE,
+ SCE_GXM_DEVICE_HEAP_ID_FRAGMENT_USSE
+} SceGxmDeviceHeapId;
+
+/** Memory info for memory allocated and mapped using #sceGxmAllocDeviceMemLinux().
+
+ @ingroup render
+*/
+typedef struct SceGxmDeviceMemInfo {
+ SceUID memBlockId; ///< The UID of the allocated memory block.
+ void *mappedBase; ///< Base address of the allocated memory block.
+ uint32_t offset; ///< USSE offset for vertex and fragment USSE memory.
+ uint32_t size; ///< The size passed to #sceGxmAllocDeviceMemLinux().
+ uint32_t heapId; ///< The device heap ID from #SceGxmDeviceHeapId.
+} SceGxmDeviceMemInfo;
+
/** Checks if memory is mapped for GPU usage. If mapped, pointers within the region of
memory described by <c><i>base</i></c> and <c><i>size</i></c> may be used with libgxm
functions directly.
@@ -123,6 +146,42 @@ SceGxmErrorCode sceGxmMapFragmentUsseMemoryInternal(void *base, uint32_t size, u
*/
SceGxmErrorCode sceGxmUnmapFragmentUsseMemoryInternal(void *base);
+/** Allocates and maps memory for GPU usage. The storage for the memory info is
+ allocated by libgxm.
+
+ @param[in] heapId Device memory heap ID from #SceGxmDeviceHeapId.
+ @param[in] flags Bitwise combined attributes from #SceGxmMemoryAttribFlags.
+ @param[in] size Size in bytes of the memory to allocate.
+ @param[in] alignment This parameter is unused. Specify 0 or a power of 2.
+ @param[out] memInfo Memory info of the allocated memory.
+
+ @retval
+ SCE_OK The operation was completed successfully.
+ @retval
+ SCE_GXM_ERROR_OUT_OF_MEMORY There was no memory to perform the operation.
+ @retval
+ SCE_GXM_ERROR_INVALID_VALUE The operation failed because a parameter was invalid.
+ @retval
+ SCE_GXM_ERROR_INVALID_POINTER The operation failed because a pointer was invalid.
+ @retval
+ SCE_GXM_ERROR_INVALID_ALIGNMENT The operation failed due to invalid alignment.
+
+ @ingroup render
+*/
+SceGxmErrorCode sceGxmAllocDeviceMemLinux(uint32_t heapId, uint32_t flags, uint32_t size, uint32_t alignment, SceGxmDeviceMemInfo **memInfo);
+
+/** Unmaps and frees memory allocated with #sceGxmAllocDeviceMemLinux(). The
+ storage for the memory info is freed by libgxm.
+
+ @param[in] memInfo Memory info of the allocated memory.
+
+ @retval
+ SCE_OK The operation was completed successfully.
+
+ @ingroup render
+*/
+SceGxmErrorCode sceGxmFreeDeviceMemLinux(SceGxmDeviceMemInfo* memInfo);
+
#ifdef __cplusplus
}
#endif // def __cplusplus
diff --git a/nids/360/SceGpuEs4User.yml b/nids/360/SceGpuEs4User.yml
index 3750385..2afcefa 100644
--- a/nids/360/SceGpuEs4User.yml
+++ b/nids/360/SceGpuEs4User.yml
@@ -8,6 +8,7 @@ modules:
PVRSRVAcquireDeviceData: 0x70800B46
PVRSRVAllocDeviceMem: 0x071E62F0
PVRSRVAllocSyncInfo: 0x94286660
+ PVRSRVAllocUserModeMem: 0x7AF40138
PVRSRVConnect: 0x228252A2
PVRSRVCreateDeviceMemContext: 0x1E0A9C4A
PVRSRVCreateSyncInfoModObj: 0x416C8813
@@ -16,11 +17,13 @@ modules:
PVRSRVEnumerateDevices: 0x4447D217
PVRSRVFreeDeviceMem: 0xB6CFD213
PVRSRVFreeSyncInfo: 0xB26DF3D2
+ PVRSRVFreeUserModeMem: 0x1BE5985A
PVRSRVGetMiscInfo: 0x73E945A1
PVRSRVMapMemoryToGpu: 0x56893E98
PVRSRVModifyPendingSyncOps: 0x0D27286F
PVRSRVReleaseMiscInfo: 0xF4735A47
PVRSRVUnmapMemoryFromGpu: 0xAD20D1A0
+ SGXAddRenderTarget: 0x0162A405
SGXCreateRenderContext: 0x8A997DBB
SGXCreateTransferContext: 0xBDE2B9E1
SGXDestroyRenderContext: 0x0BFE1685
diff --git a/nids/360/SceGxm.yml b/nids/360/SceGxm.yml
index cedfcf9..ffd1921 100644
--- a/nids/360/SceGxm.yml
+++ b/nids/360/SceGxm.yml
@@ -287,10 +287,15 @@ modules:
nid: 0xB5973AAA
functions:
sceGxmShaderPatcherCreateFragmentProgramInternal: 0x83149CAD
+ SceGxmInternalForReplay:
+ nid: 0xA64BEF47
+ functions:
+ sceGxmRazorReplayReserveVdm: 0xEFA222AF
SceGxmInternalForTest:
nid: 0x171129AF
functions:
sceGxmAllocDeviceMemLinux: 0xD412F27B
+ sceGxmFreeDeviceMemLinux: 0x2B0A5A39
sceGxmSetFragmentJobDepthBiasAdjust: 0x46D6C306
sceGxmSetFragmentJobSplitThreshold: 0xD352F90A
sceGxmSetFragmentJobVisibilityBuffer: 0x1D68FB73