Development repository for FSR2 integration into Unity Post-Processing Stack V2.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.2 KiB

#include <libsysmodule.h>
#include <psml/mfsr.h>
// We need to provide an export to force the expected stub library to be generated
__declspec (dllexport) void dummy()
{
if (sceSysmoduleLoadModule(SCE_SYSMODULE_PSML) != SCE_OK)
{
return;
}
sce::Psml::initMfsr(); // TODO: probably returns an error code if PSSR is not supported (0 is okay, SCE_PSML_MFSR_ERROR_ALREADY_INITIALIZED is also okay, everything else is error)
sce::Psml::MfsrSharedResourcesInitParameters resParams;
resParams.init();
sce::Psml::MfsrSharedResources sharedResources;
sce::Psml::createMfsrSharedResources(&sharedResources, &resParams); // TODO: handle error
sce::Psml::MfsrContextInitParameters initParams;
initParams.init();
sce::Psml::MfsrContext context;
sce::Psml::createMfsrContext(&context, &initParams); // TODO: handle error
sce::Psml::DispatchMfsrParameters dispatchParams;
dispatchParams.init(); // TOOD: get this stuff from Unity
sce::Psml::dispatchMfsr(context, nullptr, &dispatchParams); // TODO: get command buffer pointer from Unity
sce::Psml::releaseMfsrContext(context);
context = nullptr;
sce::Psml::releaseMfsrSharedResources(sharedResources);
sharedResources = nullptr;
}