From 8ee0e57528d05a9624887b1545b730f39d9659e1 Mon Sep 17 00:00:00 2001 From: GrapheneCt <57592952+GrapheneCt@users.noreply.github.com> Date: Sat, 7 Aug 2021 00:46:05 +0200 Subject: [PATCH] Bugfixes, added vitasdk stubs --- eurasiacon/imgegl/imgegl.vcxproj | 3 + eurasiacon/imgegl/imgegl/khronos_egl.c | 4 +- eurasiacon/opengles1/context.h | 1 + eurasiacon/opengles1/eglglue.c | 4 + eurasiacon/opengles1/makemips.c | 4 +- eurasiacon/opengles1/misc.c | 3 + eurasiacon/opengles1/misc.h | 1 + eurasiacon/opengles1/opengles1.vcxproj | 7 +- eurasiacon/opengles1/psp2/heap.c | 15 ++ eurasiacon/opengles1/psp2/swtexop.c | 49 +++++ eurasiacon/opengles1/psp2/swtexop.h | 4 + eurasiacon/opengles1/tex.c | 8 +- eurasiacon/opengles1/texmgmt.c | 12 +- .../env/playstation/common/pvr_apphint.c | 67 ++++++ gpu_es4_ext/gpu_es4_ext.vcxproj | 9 +- gpu_es4_ext/libSceGpuEs4UserForVsh_stub.a | Bin 0 -> 3920 bytes gpu_es4_ext/libSceGpuEs4User_stub.a | Bin 64230 -> 64230 bytes include/gpu_es4/eurasia/include4/services.h | 2 + include/gpu_es4/psp2_pvr_defs.h | 7 + lib/SceGpuEs4UserForVsh.emd | 8 + lib/vitasdk_out/GLESv1_CM.yml | 207 ++++++++++++++++++ lib/vitasdk_out/IMGEGL.yml | 95 ++++++++ lib/vitasdk_out/gpu_es4_ext.yml | 60 +++++ unittests/gles1test1/gles1test1.c | 62 +----- 24 files changed, 561 insertions(+), 71 deletions(-) create mode 100644 gpu_es4_ext/libSceGpuEs4UserForVsh_stub.a create mode 100644 lib/SceGpuEs4UserForVsh.emd create mode 100644 lib/vitasdk_out/GLESv1_CM.yml create mode 100644 lib/vitasdk_out/IMGEGL.yml create mode 100644 lib/vitasdk_out/gpu_es4_ext.yml diff --git a/eurasiacon/imgegl/imgegl.vcxproj b/eurasiacon/imgegl/imgegl.vcxproj index 1b6be1c..2a47496 100644 --- a/eurasiacon/imgegl/imgegl.vcxproj +++ b/eurasiacon/imgegl/imgegl.vcxproj @@ -95,6 +95,9 @@ --no-required-files None + + "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\vdsuite-libgen.exe" --output-kind VitasdkStub "$(SolutionDir)lib\vitasdk_out\IMGEGL.yml" "$(OutDir)libIMGEGL_stub_vitasdk.a" + diff --git a/eurasiacon/imgegl/imgegl/khronos_egl.c b/eurasiacon/imgegl/imgegl/khronos_egl.c index 927523a..b3a25ae 100644 --- a/eurasiacon/imgegl/imgegl/khronos_egl.c +++ b/eurasiacon/imgegl/imgegl/khronos_egl.c @@ -458,7 +458,7 @@ IMG_INTERNAL IMG_BOOL _TlsInit(TLS psTls) PVRSRVGetAppHint(pvHintState, "ParamBufferSize", IMG_UINT_TYPE, &ui32DefaultParamBufferSize, &psGlobalData->sAppHints.ui32ParamBufferSize); - PVRSRVGetAppHint(pvHintState, "DriverMemorySizeSize", IMG_UINT_TYPE, + PVRSRVGetAppHint(pvHintState, "DriverMemorySize", IMG_UINT_TYPE, &ui32DefaultDriverMemorySize, &psGlobalData->sAppHints.ui32DriverMemorySize); ui32Default = EXTERNAL_ZBUFFER_MODE_DEFAULT; @@ -4921,7 +4921,7 @@ IMG_EXPORT EGLContext IMGeglCreateContext(EGLDisplay eglDpy, KEGL_CONFIG_INDEX configIndex = (KEGL_CONFIG_INDEX)eglCfg; #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) - SGX_CONTEXT_PRIORITY eContextPriority = SGX_CONTEXT_PRIORITY_MEDIUM; + SGX_CONTEXT_PRIORITY eContextPriority = SGX_CONTEXT_PRIORITY_HIGH; #endif #if defined(EGL_EXTENSION_IMG_EGL_HIBERNATION) diff --git a/eurasiacon/opengles1/context.h b/eurasiacon/opengles1/context.h index b799f1d..7916f27 100644 --- a/eurasiacon/opengles1/context.h +++ b/eurasiacon/opengles1/context.h @@ -614,6 +614,7 @@ __inline IMG_VOID *GLES1CallocHeapUNC(GLES1Context *gc, unsigned int size) } #define GLES1ReallocHeapUNC(X,Y,Z) (IMG_VOID*)sceHeapReallocHeapMemory(X->pvUNCHeap, Y, Z) #define GLES1FreeHeapUNC(X,Y) sceHeapFreeHeapMemory(X->pvUNCHeap, Y) +#define GLES1FreeHeapAsyncUNC(X,Y) texOpAsyncAddForCleanup(X, Y) #define GLES1MallocHeapCDRAM(X,Y) (IMG_VOID*)sceHeapAllocHeapMemory(X->pvCDRAMHeap, Y) diff --git a/eurasiacon/opengles1/eglglue.c b/eurasiacon/opengles1/eglglue.c index 286b810..66240af 100644 --- a/eurasiacon/opengles1/eglglue.c +++ b/eurasiacon/opengles1/eglglue.c @@ -19,6 +19,7 @@ #include "context.h" #include "pvrversion.h" +#include "psp2/swtexop.h" #include "psp2/libheap_custom.h" #include #include @@ -613,6 +614,9 @@ static IMG_BOOL InitContext(GLES1Context *gc, GLES1Context *psShareContext, EGLc goto FAILED_sceUltUlthreadRuntimeCreate; } + SceUID swTexCl = sceKernelCreateThread("OGLES1AsyncTexOpCl", texOpAsyncCleanupThread, 190, 256 * 1024, 0, 0, SCE_NULL); + sceKernelStartThread(swTexCl, 4, &gc); + #if defined(GLES1_EXTENSION_VERTEX_ARRAY_OBJECT) /* Initialize the unshareable names arrays */ for (i = 0; i < GLES1_MAX_UNSHAREABLE_NAMETYPE; i++) diff --git a/eurasiacon/opengles1/makemips.c b/eurasiacon/opengles1/makemips.c index 612da0a..34e8d7d 100644 --- a/eurasiacon/opengles1/makemips.c +++ b/eurasiacon/opengles1/makemips.c @@ -966,7 +966,7 @@ IMG_INTERNAL IMG_BOOL HardwareMakeTextureMipmapLevels(GLES1Context *gc, GLESText { bHWTexUploaded = IMG_TRUE; - GLES1FreeHeapUNC(gc, psLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psLevel->pui8Buffer); psLevel->pui8Buffer = GLES1_LOADED_LEVEL; } @@ -1068,7 +1068,7 @@ IMG_INTERNAL IMG_BOOL HardwareMakeTextureMipmapLevels(GLES1Context *gc, GLESText /* The local data copy of the texture level is being freed */ if ((psLevel->pui8Buffer != IMG_NULL) && (psLevel->pui8Buffer != GLES1_LOADED_LEVEL)) { - GLES1FreeHeapUNC(gc, psLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psLevel->pui8Buffer); } if (i == 0) diff --git a/eurasiacon/opengles1/misc.c b/eurasiacon/opengles1/misc.c index b640de5..f2718fb 100644 --- a/eurasiacon/opengles1/misc.c +++ b/eurasiacon/opengles1/misc.c @@ -857,6 +857,9 @@ IMG_INTERNAL IMG_BOOL GetApplicationHints(GLESAppHints *psAppHints, EGLcontextMo ui32Default = 16; PVRSRVGetAppHint(pvHintState, "OGLES1SwTexOpMaxUltNum", IMG_UINT_TYPE, &ui32Default, &psAppHints->ui32OGLES1SwTexOpMaxUltNum); + ui32Default = 10000000; + PVRSRVGetAppHint(pvHintState, "OGLES1SwTexOpCleanupDelay", IMG_UINT_TYPE, &ui32Default, &psAppHints->ui32OGLES1SwTexOpCleanupDelay); + PVRSRVFreeAppHintState(IMG_OPENGLES1, pvHintState); return IMG_TRUE; diff --git a/eurasiacon/opengles1/misc.h b/eurasiacon/opengles1/misc.h index bf18001..4822798 100644 --- a/eurasiacon/opengles1/misc.h +++ b/eurasiacon/opengles1/misc.h @@ -95,6 +95,7 @@ typedef struct GLESAppHintsRec IMG_UINT32 ui32OGLES1SwTexOpThreadPriority; IMG_UINT32 ui32OGLES1SwTexOpThreadAffinity; IMG_UINT32 ui32OGLES1SwTexOpMaxUltNum; + IMG_UINT32 ui32OGLES1SwTexOpCleanupDelay; } GLESAppHints; IMG_BOOL GetApplicationHints(GLESAppHints *psAppHints, EGLcontextMode *psMode); diff --git a/eurasiacon/opengles1/opengles1.vcxproj b/eurasiacon/opengles1/opengles1.vcxproj index b5f889f..f95211e 100644 --- a/eurasiacon/opengles1/opengles1.vcxproj +++ b/eurasiacon/opengles1/opengles1.vcxproj @@ -204,7 +204,7 @@ $(SCE_PSP2_SDK_DIR)\target\include\vdsuite\user;$(SCE_PSP2_SDK_DIR)\target\include\vdsuite\common;$(SolutionDir)include\gpu_es4;$(SolutionDir)include\gpu_es4\eurasia\include4;$(SolutionDir)include\gpu_es4\eurasia\hwdefs;$(SolutionDir)include\gpu_es4\eurasia\services4\include;$(SolutionDir)include\gpu_es4\eurasia\services4\system\psp2;$(SolutionDir)codegen\pds;$(SolutionDir)codegen\pixevent;$(SolutionDir)codegen\usegen;$(SolutionDir)eurasiacon\include;$(SolutionDir)eurasiacon\common;$(SolutionDir)common\tls;$(SolutionDir)common\dmscalc;$(SolutionDir)include\gpu_es4\eurasia\services4\srvclient\devices\sgx;$(SolutionDir)codegen\ffgen;$(SolutionDir)tools\intern\useasm;$(SolutionDir)codegen\pixfmts;$(SolutionDir)intermediates\pds_mte_state_copy;$(SolutionDir)intermediates\pds_aux_vtx;$(SolutionDir)intermediates\pixelevent;$(SolutionDir)intermediates\pixelevent_tilexy;$(SolutionDir)intermediates\sgxsupport;$(SolutionDir)intermediates\errata;$(SolutionDir)tools\intern\usc2;%(AdditionalIncludeDirectories) - $(OutDir)libgpu_es4_ext_stub.a;$(OutDir)libpvrPSP2_WSEGL_stub.a;$(OutDir)libIMGEGL_stub.a;$(SolutionDir)gpu_es4_ext\libSceGpuEs4User_stub.a;-lSceGxm_stub;-lSceGpuEs4ForUser_stub;-lSceDmacmgr_stub;-lSceSysmodule_stub;-lSceUlt_stub_weak;%(AdditionalDependencies) + $(OutDir)libgpu_es4_ext_stub.a;$(OutDir)libpvrPSP2_WSEGL_stub.a;$(OutDir)libIMGEGL_stub.a;$(SolutionDir)gpu_es4_ext\libSceGpuEs4User_stub.a;$(SolutionDir)gpu_es4_ext\libSceGpuEs4UserForVsh_stub.a;-lSceGxm_stub;-lSceGpuEs4ForUser_stub;-lSceDmacmgr_stub;-lSceSysmodule_stub;-lSceUlt_stub_weak;%(AdditionalDependencies) $(SCE_PSP2_SDK_DIR)\target\lib\vdsuite;%(AdditionalLibraryDirectories) @@ -217,10 +217,13 @@ true - $(OutDir)libgpu_es4_ext_stub.a;$(OutDir)libpvrPSP2_WSEGL_stub.a;$(OutDir)libIMGEGL_stub.a;$(SolutionDir)gpu_es4_ext\libSceGpuEs4User_stub.a;-lSceGxm_stub;-lSceGpuEs4ForUser_stub;-lSceDmacmgr_stub;-lSceSysmodule_stub;-lSceUlt_stub_weak;%(AdditionalDependencies) + $(OutDir)libgpu_es4_ext_stub.a;$(OutDir)libpvrPSP2_WSEGL_stub.a;$(OutDir)libIMGEGL_stub.a;$(SolutionDir)gpu_es4_ext\libSceGpuEs4User_stub.a;$(SolutionDir)gpu_es4_ext\libSceGpuEs4UserForVsh_stub.a;-lSceGxm_stub;-lSceGpuEs4ForUser_stub;-lSceDmacmgr_stub;-lSceSysmodule_stub;-lSceUlt_stub_weak;%(AdditionalDependencies) $(SCE_PSP2_SDK_DIR)\target\lib\vdsuite;%(AdditionalLibraryDirectories) StripSymsAndDebug + + "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\vdsuite-libgen.exe" --output-kind VitasdkStub "$(SolutionDir)lib\vitasdk_out\GLESv1_CM.yml" "$(OutDir)libGLESv1_CM_stub_vitasdk.a" + diff --git a/eurasiacon/opengles1/psp2/heap.c b/eurasiacon/opengles1/psp2/heap.c index fc2343c..a802785 100644 --- a/eurasiacon/opengles1/psp2/heap.c +++ b/eurasiacon/opengles1/psp2/heap.c @@ -360,6 +360,21 @@ void *sceHeapAllocHeapMemoryWithOption(void *heap, unsigned int nbytes, const Sc head->info.ordblks++; #endif /* USE_HEAPINFO */ sceKernelUnlockLwMutex(&head->lwmtx, 1); + +#if defined(DEBUG) + res = PVRSRVCheckMappedMemory( + head->psDevData, + head->hDevMemContext, + result, + nbytes, + PVRSRV_MEM_READ | PVRSRV_MEM_WRITE + ); + + sceClibPrintf("sceHeapAllocHeapMemoryWithOption check res: %d\n", res); + sceClibPrintf("base: 0x%X\n", result); + sceClibPrintf("size: 0x%X\n", nbytes); +#endif + return (result); } diff --git a/eurasiacon/opengles1/psp2/swtexop.c b/eurasiacon/opengles1/psp2/swtexop.c index c460afb..382a02e 100644 --- a/eurasiacon/opengles1/psp2/swtexop.c +++ b/eurasiacon/opengles1/psp2/swtexop.c @@ -7,6 +7,9 @@ int32_t sceKernelAtomicAddAndGet32(volatile int32_t* ptr, int32_t value); +static IMG_VOID *pvAsDstPtr[1024]; +static IMG_UINT32 ui32AsDstReqTime[1024]; + static IMG_INT32 _SWTextureUploadEntry(IMG_UINT32 arg) { SWTexUploadArg *psArg = (SWTexUploadArg *)arg; @@ -162,4 +165,50 @@ IMG_INTERNAL IMG_BOOL SWMakeTextureMipmapLevels(GLES1Context *gc, GLESTexture *p SCE_NULL); return IMG_TRUE; +} + +IMG_VOID texOpAsyncAddForCleanup(GLES1Context *gc, IMG_PVOID pvPtr) +{ + IMG_UINT32 i = 0; + + for (i = 0; i < 1024; i++) + { + if (pvAsDstPtr[i] == IMG_NULL) + { + ui32AsDstReqTime[i] = sceKernelGetProcessTimeLow(); + pvAsDstPtr[i] = pvPtr; + return; + } + } + + GLES1FreeHeapUNC(gc, pvPtr); +} + +IMG_INT32 texOpAsyncCleanupThread(IMG_UINT32 argSize, IMG_VOID *pArgBlock) +{ + IMG_UINT32 i = 0; + IMG_UINT32 ui32TriggerTime = 0; + GLES1Context *gc = *(GLES1Context **)pArgBlock; + + sceClibMemset(pvAsDstPtr, 0, 1024 * 4); + sceClibMemset(&ui32AsDstReqTime[0], 0, 1024 * 4); + + while (1) + { + ui32TriggerTime = sceKernelGetProcessTimeLow(); + + for (i = 0; i < 1024; i++) + { + if (pvAsDstPtr[i] != IMG_NULL) + { + if ((ui32TriggerTime - ui32AsDstReqTime[i]) > gc->sAppHints.ui32OGLES1SwTexOpCleanupDelay) + { + GLES1FreeHeapUNC(gc, pvAsDstPtr[i]); + pvAsDstPtr[i] = IMG_NULL; + } + } + } + + sceKernelDelayThread(100000); + } } \ No newline at end of file diff --git a/eurasiacon/opengles1/psp2/swtexop.h b/eurasiacon/opengles1/psp2/swtexop.h index 2e0a7b0..b025600 100644 --- a/eurasiacon/opengles1/psp2/swtexop.h +++ b/eurasiacon/opengles1/psp2/swtexop.h @@ -32,4 +32,8 @@ IMG_INTERNAL IMG_VOID SWTextureUpload( IMG_INTERNAL IMG_BOOL SWMakeTextureMipmapLevels(GLES1Context *gc, GLESTexture *psTex, IMG_UINT32 ui32Face); +IMG_INT32 texOpAsyncCleanupThread(IMG_UINT32 argSize, IMG_VOID *pArgBlock); + +IMG_VOID texOpAsyncAddForCleanup(GLES1Context *gc, IMG_PVOID pvPtr); + #endif /* _PSP2_SWTEXOP_ */ diff --git a/eurasiacon/opengles1/tex.c b/eurasiacon/opengles1/tex.c index 6609131..11a2f21 100644 --- a/eurasiacon/opengles1/tex.c +++ b/eurasiacon/opengles1/tex.c @@ -3578,7 +3578,7 @@ GL_API void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffse ui32SrcRowSize, psMipLevel, IMG_TRUE); TranslateLevel(gc, psTex, 0, 0); - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); psMipLevel->pui8Buffer = GLES1_LOADED_LEVEL; @@ -3819,7 +3819,7 @@ GL_API void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffse } } - GLES1FreeHeapUNC(gc, pui8SubTexBuffer); + GLES1FreeHeapAsyncUNC(gc, pui8SubTexBuffer); } } @@ -5716,7 +5716,7 @@ GL_API void GL_APIENTRY glCopyTexSubImage2D(GLenum target, GLint level, GLint xo TranslateLevel(gc, psTex, 0, 0); - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); psMipLevel->pui8Buffer = GLES1_LOADED_LEVEL; @@ -6161,7 +6161,7 @@ GL_API void GL_APIENTRY glCopyTexSubImage2D(GLenum target, GLint level, GLint xo } } - GLES1FreeHeapUNC(gc, pui8SubTexBuffer); + GLES1FreeHeapAsyncUNC(gc, pui8SubTexBuffer); } /* otherwise, use the software copy subtexture uploading: diff --git a/eurasiacon/opengles1/texmgmt.c b/eurasiacon/opengles1/texmgmt.c index 5e6d1ef..992471f 100644 --- a/eurasiacon/opengles1/texmgmt.c +++ b/eurasiacon/opengles1/texmgmt.c @@ -1094,7 +1094,7 @@ IMG_INTERNAL IMG_BOOL TextureMakeResident(GLES1Context *gc, GLESTexture *psTex) #if (defined(DEBUG) || defined(TIMING)) ui32TextureMemCurrent -= psMipLevel->ui32ImageSize; #endif - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); psMipLevel->pui8Buffer = GLES1_LOADED_LEVEL; } @@ -1532,7 +1532,7 @@ IMG_INTERNAL IMG_BOOL TextureCreatePBufferLevel(GLES1Context *gc, GLESTexture *p if (psMipLevel->pui8Buffer != NULL && psMipLevel->pui8Buffer != GLES1_LOADED_LEVEL) { PVR_UNREFERENCED_PARAMETER(gc); - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); } psMipLevel->pui8Buffer = IMG_NULL; @@ -1650,7 +1650,7 @@ IMG_INTERNAL IMG_BOOL TextureCreateImageLevel(GLES1Context *gc, GLESTexture *psT if (psMipLevel->pui8Buffer != NULL && psMipLevel->pui8Buffer != GLES1_LOADED_LEVEL) { PVR_UNREFERENCED_PARAMETER(gc); - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); } psMipLevel->pui8Buffer = IMG_NULL; @@ -2062,7 +2062,7 @@ IMG_INTERNAL IMG_UINT8* TextureCreateLevel(GLES1Context *gc, GLESTexture *psTex { if (psMipLevel->pui8Buffer != GLES1_LOADED_LEVEL) { - pui8Buffer = (IMG_UINT8 *) GLES1Realloc(gc, psMipLevel->pui8Buffer, ui32BufferSize); + pui8Buffer = (IMG_UINT8 *) GLES1ReallocHeapUNC(gc, psMipLevel->pui8Buffer, ui32BufferSize); if (pui8Buffer == IMG_NULL) { @@ -2123,7 +2123,7 @@ IMG_INTERNAL IMG_UINT8* TextureCreateLevel(GLES1Context *gc, GLESTexture *psTex #if (defined(DEBUG) || defined(TIMING)) ui32TextureMemCurrent -= psMipLevel->ui32ImageSize; #endif - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); } psMipLevel->pui8Buffer = IMG_NULL; @@ -2290,7 +2290,7 @@ static IMG_VOID FreeTexture(GLES1Context *gc, GLESTexture *psTex) #if (defined(DEBUG) || defined(TIMING)) ui32TextureMemCurrent -= psMipLevel->ui32ImageSize; #endif - GLES1FreeHeapUNC(gc, psMipLevel->pui8Buffer); + GLES1FreeHeapAsyncUNC(gc, psMipLevel->pui8Buffer); psMipLevel->pui8Buffer = IMG_NULL; } diff --git a/gpu_es4_ext/eurasia/services4/srvclient/env/playstation/common/pvr_apphint.c b/gpu_es4_ext/eurasia/services4/srvclient/env/playstation/common/pvr_apphint.c index fc24a7a..febf159 100644 --- a/gpu_es4_ext/eurasia/services4/srvclient/env/playstation/common/pvr_apphint.c +++ b/gpu_es4_ext/eurasia/services4/srvclient/env/playstation/common/pvr_apphint.c @@ -352,6 +352,11 @@ IMG_EXPORT IMG_BOOL PVRSRVGetAppHint(IMG_VOID *pvHintState, *(IMG_UINT32 *)pvReturn = s_appHint.ui32OGLES1SwTexOpMaxUltNum; bFound = IMG_TRUE; } + else if (!sceClibStrncasecmp(pszHintName, "OGLES1SwTexOpCleanupDelay", 26)) + { + *(IMG_UINT32 *)pvReturn = s_appHint.ui32OGLES1SwTexOpCleanupDelay; + bFound = IMG_TRUE; + } } if (!bFound) @@ -401,5 +406,67 @@ IMG_EXPORT IMG_BOOL PVRSRVCreateVirtualAppHint(PVRSRV_PSP2_APPHINT *psAppHint) sceClibMemcpy(&s_appHint, psAppHint, sizeof(PVRSRV_PSP2_APPHINT)); s_appHintCreated = IMG_TRUE; + return IMG_TRUE; +} + +/****************************************************************************** + Function Name : PVRSRVInitializeAppHint + Inputs : *psAppHint + Outputs : + Returns : Boolean - True if hint struct created, False if error + Description : Sets default values for apphint struct +******************************************************************************/ +IMG_EXPORT IMG_BOOL PVRSRVInitializeAppHint(PVRSRV_PSP2_APPHINT *psAppHint) +{ + if (!psAppHint) + return IMG_FALSE; + + sceClibMemset(psAppHint, 0, sizeof(PVRSRV_PSP2_APPHINT)); + + sceClibStrncpy(psAppHint->szGLES1, "app0:libGLESv1_CM.suprx", 256); + sceClibStrncpy(psAppHint->szWindowSystem, "app0:libpvrPSP2_WSEGL.suprx", 256); + psAppHint->bDisableMetricsOutput = IMG_TRUE; + psAppHint->bDumpProfileData = IMG_FALSE; + psAppHint->ui32ProfileStartFrame = 0; + psAppHint->ui32ProfileEndFrame = 0; + psAppHint->ui32ExternalZBufferMode = IMG_FALSE; + psAppHint->ui32ExternalZBufferXSize = 0; + psAppHint->ui32ExternalZBufferYSize = 0; + psAppHint->ui32ParamBufferSize = 16 * 1024 * 1024; + psAppHint->ui32PDSFragBufferSize = 50 * 1024; + psAppHint->ui32DriverMemorySize = 4 * 1024 * 1024; + + psAppHint->bDisableHWTextureUpload = IMG_FALSE; + psAppHint->bDisableHWTQBufferBlit = IMG_FALSE; + psAppHint->bDisableHWTQMipGen = IMG_TRUE; + psAppHint->bDisableHWTQNormalBlit = IMG_FALSE; + psAppHint->bDisableHWTQTextureUpload = IMG_FALSE; + psAppHint->bDisableStaticPDSPixelSAProgram = IMG_FALSE; + psAppHint->bDisableUSEASMOPT = IMG_FALSE; + psAppHint->bDumpShaders = IMG_FALSE; + psAppHint->bEnableAppTextureDependency = IMG_FALSE; + psAppHint->bEnableMemorySpeedTest = IMG_TRUE; + psAppHint->bEnableStaticMTECopy = IMG_TRUE; + psAppHint->bEnableStaticPDSVertex = IMG_TRUE; + psAppHint->bFBODepthDiscard = IMG_TRUE; + psAppHint->bOptimisedValidation = IMG_TRUE; + psAppHint->ui32DefaultIndexBufferSize = 200 * 1024; + psAppHint->ui32DefaultPDSVertBufferSize = 50 * 1024; + psAppHint->ui32DefaultPregenMTECopyBufferSize = 50 * 1024; + psAppHint->ui32DefaultPregenPDSVertBufferSize = 80 * 1024; + psAppHint->ui32DefaultVDMBufferSize = 20 * 1024; + psAppHint->ui32DefaultVertexBufferSize = 200 * 1024; + psAppHint->ui32FlushBehaviour = 0; + psAppHint->ui32MaxVertexBufferSize = 800 * 1024; + psAppHint->ui32OGLES1UNCTexHeapSize = 4 * 1024; + psAppHint->ui32OGLES1CDRAMTexHeapSize = 256 * 1024; + psAppHint->bOGLES1EnableUNCAutoExtend = IMG_TRUE; + psAppHint->bOGLES1EnableCDRAMAutoExtend = IMG_TRUE; + psAppHint->ui32OGLES1SwTexOpThreadNum = 1; + psAppHint->ui32OGLES1SwTexOpThreadPriority = 70; + psAppHint->ui32OGLES1SwTexOpThreadAffinity = 0; + psAppHint->ui32OGLES1SwTexOpMaxUltNum = 16; + psAppHint->ui32OGLES1SwTexOpCleanupDelay = 10000000; + return IMG_TRUE; } \ No newline at end of file diff --git a/gpu_es4_ext/gpu_es4_ext.vcxproj b/gpu_es4_ext/gpu_es4_ext.vcxproj index 6a9aa05..e20b2f7 100644 --- a/gpu_es4_ext/gpu_es4_ext.vcxproj +++ b/gpu_es4_ext/gpu_es4_ext.vcxproj @@ -120,7 +120,8 @@ --no-required-files - "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump "$(SolutionDir)lib\SceGpuEs4User.emd" --stub-archive + "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump "$(SolutionDir)lib\SceGpuEs4User.emd" --stub-archive +"$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump "$(SolutionDir)lib\SceGpuEs4UserForVsh.emd" --stub-archive @@ -137,8 +138,12 @@ StripSymsAndDebug - "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump "$(SolutionDir)lib\SceGpuEs4User.emd" --stub-archive + "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump "$(SolutionDir)lib\SceGpuEs4User.emd" --stub-archive +"$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\armlibgen.exe" --dump "$(SolutionDir)lib\SceGpuEs4UserForVsh.emd" --stub-archive + + "$(SCE_PSP2_SDK_DIR)\host_tools\build\bin\vdsuite-libgen.exe" --output-kind VitasdkStub "$(SolutionDir)lib\vitasdk_out\gpu_es4_ext.yml" "$(OutDir)libgpu_es4_ext_stub_vitasdk.a" + diff --git a/gpu_es4_ext/libSceGpuEs4UserForVsh_stub.a b/gpu_es4_ext/libSceGpuEs4UserForVsh_stub.a new file mode 100644 index 0000000000000000000000000000000000000000..1793fba8ac3b85deb0165860331407ea2160d44b GIT binary patch literal 3920 zcmds4&u`pB6rRmC4N1$7R6QV&s8NFy4)NM+v)!!B<94HTvn$(0 z?Ew&XPH?I~h(mkqkt0&C+&FOL0D^x2iF^6Jv0pq%?WBsL9{RM;Gw;1`#?NowyqSIb zQWy_MA1pMiz2vrlPK;^;*De!IF926NqT1xjG}N;m149xNn;hPezXG*h+0;Eq0Idi9U%tCo-__X z;Olz_Bf5?gc$>pc%jtMTHsr;*YgKFQI!?>?Ez5P=c#`@HUtL}6)@n5@c}6w0tO`k~ z6PYmUYxA-?t>)G1=>LBI(vMV`*q0#BEGkvDb}Ed=x3>njq8&TB8(GV)-E?f)B#iST7vB2ihxcVWumtkkj z4#S279GTS~id=(#E5&qb5%R}-oqf1JV7O3%V}6)>`YeQ>pkpSpChhL&qumlPLp42*{l|Ei`TYju z@A|*KPp@>ox7vB8XU$>x?s~0fKFiZ=F?P@LS9Hbao2%&0zu$V&_zNolM(xkWYq0pt z_28M$wV6S&Wxbu@fprY~2qnAQ!(CwaFo$A2x|x`A7uO|I)_C3=?B3ItRJ-b~SALs# zk@m6dDehzQ)R6vp=()UtYojl98{OS89{MJZcL$ln#9hvDasu6e%-j%?F<(Prq?PJJ zE_?46(3_`I3Ym8sxkGV2=HRzr&gXzhyf>89t?!{X>((!je+CPQPYALahBcRZt8 kP#xJI>yc^abljy@vA*8S;arO|_?xQ>ub~U`J{w~G2X?vndjJ3c literal 0 HcmV?d00001 diff --git a/gpu_es4_ext/libSceGpuEs4User_stub.a b/gpu_es4_ext/libSceGpuEs4User_stub.a index 3e13ed43b576f6549380931b7f7ec617b9c1eba3..658017420952bfc99a6afc89ce8a37e96b111df7 100644 GIT binary patch delta 667 zcmaF%mHF9M<_R)vMi!Qa#s(XeI>e#O%^SqGu|V0AH;9XEZj!O#gz*iuB_>~JD%%{S zb_1qnvw?OVD@yl=CS;Tf3Rt7r!PsDbo6Ur~ZL`9>BDh?Gb>C*SB_ELNk=$&$G7v5gbDz|Dg!@2xnzkV8 zk=Q(8rx#4m<_G%_;Q|WJPe)L~6YSrjQwZ}wc7Wpe)_Hgw1H(mfvgyjw&2CrkAh}Iq tv%@Wf+d*c#JwTWZa@Vn^2zPe#O%^SqGu|V0AH;9XEZj!O#gz*iuB_>~JD%%{S zb_1qnvw?OVD@yl=CS;Tf3Rt7r!PsDbo6Ur~ZL`9>BDh?Gb>C*SB_ELNk=$&$G7v5gbDz|Dg!@2xnzkV8 zk=Q(8rx#4m<_G%_;Q|WJPe)L~6YSrjQwZ}wc7Wpe)_Hgw1H(mfvgyjw&2CrkAh}Iq tv%@Wf+d*c#JwTWZa@Vn^2zP -#include -#include -#include -#include -#include - #if defined(__psp2__) #include @@ -37,6 +30,13 @@ SCE_USER_MODULE_LIST("app0:libgpu_es4_ext.suprx", "app0:libIMGEGL.suprx"); #include #endif +#include +#include +#include +#include +#include +#include + #if defined(SUPPORT_ANDROID_PLATFORM) #include "eglhelper.h" #endif @@ -351,52 +351,8 @@ int main(int argc, char *argv[]) #if defined(__psp2__) PVRSRV_PSP2_APPHINT hint; - sceClibMemset(&hint, 0, sizeof(PVRSRV_PSP2_APPHINT)); - - sceClibStrncpy(hint.szGLES1, "app0:libGLESv1_CM.suprx", 256); - sceClibStrncpy(hint.szWindowSystem, "app0:libpvrPSP2_WSEGL.suprx", 256); - hint.bDisableMetricsOutput = IMG_TRUE; - hint.bDumpProfileData = IMG_FALSE; - hint.ui32ProfileStartFrame = 0; - hint.ui32ProfileEndFrame = 0; - hint.ui32ExternalZBufferMode = IMG_FALSE; - hint.ui32ExternalZBufferXSize = 0; - hint.ui32ExternalZBufferYSize = 0; - hint.ui32ParamBufferSize = 16 * 1024 * 1024; - hint.ui32PDSFragBufferSize = 50 * 1024; - hint.ui32DriverMemorySize = 16 * 1024 * 1024; - - hint.bDisableHWTextureUpload = IMG_FALSE; - hint.bDisableHWTQBufferBlit = IMG_FALSE; - hint.bDisableHWTQMipGen = IMG_TRUE; - hint.bDisableHWTQNormalBlit = IMG_FALSE; - hint.bDisableHWTQTextureUpload = IMG_FALSE; - hint.bDisableStaticPDSPixelSAProgram = IMG_FALSE; - hint.bDisableUSEASMOPT = IMG_FALSE; - hint.bDumpShaders = IMG_FALSE; - hint.bEnableAppTextureDependency = IMG_FALSE; - hint.bEnableMemorySpeedTest = IMG_TRUE; - hint.bEnableStaticMTECopy = IMG_TRUE; - hint.bEnableStaticPDSVertex = IMG_TRUE; - hint.bFBODepthDiscard = IMG_TRUE; - hint.bOptimisedValidation = IMG_TRUE; - hint.ui32DefaultIndexBufferSize = 200 * 1024; - hint.ui32DefaultPDSVertBufferSize = 50 * 1024; - hint.ui32DefaultPregenMTECopyBufferSize = 50 * 1024; - hint.ui32DefaultPregenPDSVertBufferSize = 80 * 1024; - hint.ui32DefaultVDMBufferSize = 20 * 1024; - hint.ui32DefaultVertexBufferSize = 200 * 1024; - hint.ui32FlushBehaviour = 0; - hint.ui32MaxVertexBufferSize = 800 * 1024; - hint.ui32OGLES1UNCTexHeapSize = 4 * 1024; - hint.ui32OGLES1CDRAMTexHeapSize = 256 * 1024; - hint.bOGLES1EnableUNCAutoExtend = IMG_TRUE; - hint.bOGLES1EnableCDRAMAutoExtend = IMG_TRUE; - hint.ui32OGLES1SwTexOpThreadNum = 1; - hint.ui32OGLES1SwTexOpThreadPriority = 70; - hint.ui32OGLES1SwTexOpThreadAffinity = 0; - hint.ui32OGLES1SwTexOpMaxUltNum = 16; - + + PVRSRVInitializeAppHint(&hint); PVRSRVCreateVirtualAppHint(&hint); frameStop = 50000;