diff --git a/.gitignore b/.gitignore index 9f08bd0..70a44be 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ screenshot-*.png .vs Tools/PSSRPlugin/Prospero_Debug/ *.user +Tools/PSSRPlugin/Prospero_Release/ diff --git a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/Plugins/PS5/PSSRPlugin.prx b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/Plugins/PS5/PSSRPlugin.prx index 083e1c6..f9c932e 100644 Binary files a/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/Plugins/PS5/PSSRPlugin.prx and b/Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/Plugins/PS5/PSSRPlugin.prx differ diff --git a/Tools/PSSRPlugin/PSSRPlugin.vcxproj b/Tools/PSSRPlugin/PSSRPlugin.vcxproj index 90c8248..bdb3140 100644 --- a/Tools/PSSRPlugin/PSSRPlugin.vcxproj +++ b/Tools/PSSRPlugin/PSSRPlugin.vcxproj @@ -68,13 +68,9 @@ - - - - diff --git a/Tools/PSSRPlugin/PSSRPlugin.vcxproj.filters b/Tools/PSSRPlugin/PSSRPlugin.vcxproj.filters index c4b069f..2d165c8 100644 --- a/Tools/PSSRPlugin/PSSRPlugin.vcxproj.filters +++ b/Tools/PSSRPlugin/PSSRPlugin.vcxproj.filters @@ -15,23 +15,11 @@ - - Source Files - - - Source Files - - - Source Files - Source Files - - Header Files - Header Files diff --git a/Tools/PSSRPlugin/common.h b/Tools/PSSRPlugin/common.h deleted file mode 100644 index 6e20506..0000000 --- a/Tools/PSSRPlugin/common.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#define PSML_EXPORT __declspec (dllexport) diff --git a/Tools/PSSRPlugin/mfsr.cpp b/Tools/PSSRPlugin/mfsr.cpp deleted file mode 100644 index f01200f..0000000 --- a/Tools/PSSRPlugin/mfsr.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "common.h" -#include -#include - -using namespace sce::Psml; - -struct MfsrCommandInitializationData -{ - MfsrProfile profile; - uint16_t outputColorWidth; - uint16_t outputColorHeight; -}; - -struct MfsrCommandExecutionData -{ - -}; - -struct MfsrTextureTable -{ - sce::Agc::Core::Texture* colorInput; - sce::Agc::Core::Texture* colorOutput; - sce::Agc::Core::Texture* depth; - sce::Agc::Core::Texture* exposureTexture; - sce::Agc::Core::Texture* motionVectors; - sce::Agc::Core::Texture* reactiveMask; -}; - -PSML_EXPORT bool CreateMfsrContext(const MfsrCommandInitializationData* initSettings, MfsrContext* context, MfsrSharedResources* sharedResources) -{ - int res = initMfsr(); - if (res != SCE_OK && res != SCE_PSML_MFSR_ERROR_ALREADY_INITIALIZED) - { - // TODO: log error code - return false; - } - - // TODO: figure out what the exact purpose of the shared resources is exactly. - // Does it map one-to-one with the MfsrContext or do we only ever need a single shared resources instance? - // This affects how we should model the internal data and the interface exposed to C#. - // - // Seems to be shared between all contexts. Just use a fixed MfsrProfile as Quality is the only one that exists right now anyway. - // See also: https://p.siedev.net/resources/documents/SDK/9.000/PSML_MFSR-Overview/0002.html#__document_toc_00000011 - MfsrSharedResourcesInitParameters resParams; - resParams.init(); - resParams.m_profile = initSettings->profile; - - createMfsrSharedResources(sharedResources, &resParams); // TODO: handle error - - MfsrContextInitParameters initParams; - initParams.init(); - initParams.m_profile = initSettings->profile; - initParams.m_outputColorWidth = initSettings->outputColorWidth; - initParams.m_outputColorHeight = initSettings->outputColorHeight; - // TODO: allocate buffers for previous frames - - createMfsrContext(context, &initParams); // TODO: handle error - - return true; -} - -PSML_EXPORT void DestroyMfsrContext(MfsrContext context, MfsrSharedResources sharedResources) -{ - releaseMfsrContext(context); - releaseMfsrSharedResources(sharedResources); -} - -PSML_EXPORT void ExecuteMfsr(sce::Agc::DrawCommandBuffer* cmd, MfsrContext context, const MfsrTextureTable* textures) // TODO: add dispatch params (initData & executeData) -{ - // TODO: flushing cache on input textures equivalent to SyncCacheOp::kFlushWritesToGl2 may be necessary, depending on what Unity does or doesn't do internally. - // This means basically invalidating all write caches, making sure that dispatchMfsr() gets to see all the latest data when it reads from the input textures. - // See technote: https://p.siedev.net/technotes/view/644/1 - - DispatchMfsrParameters dispatchParams; - dispatchParams.init(); // TODO: might want to reuse these params as init() is relatively expensive - dispatchParams.m_color = textures->colorInput; - dispatchParams.m_outputColor = textures->colorOutput; - dispatchParams.m_depth = textures->depth; - dispatchParams.m_exposure = textures->exposureTexture; - dispatchParams.m_motionVectors = textures->motionVectors; - dispatchParams.m_reactiveMask = textures->reactiveMask; - // TODO: add data from initData & executeData - // TODO: where exactly do the shared resources feature in all this? - - dispatchMfsr(context, cmd, &dispatchParams); // TODO: handle error -} diff --git a/Tools/PSSRPlugin/prx.cpp b/Tools/PSSRPlugin/prx.cpp deleted file mode 100644 index a738e53..0000000 --- a/Tools/PSSRPlugin/prx.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include - -// 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; -} diff --git a/Tools/PSSRPlugin/psml.cpp b/Tools/PSSRPlugin/psml.cpp deleted file mode 100644 index c1d78d7..0000000 --- a/Tools/PSSRPlugin/psml.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "common.h" -#include - -PSML_EXPORT bool Load() -{ - return sceSysmoduleLoadModule(SCE_SYSMODULE_PSML) == SCE_SYSMODULE_LOADED; -} diff --git a/Tools/PSSRPlugin/pssrplugin.cpp b/Tools/PSSRPlugin/pssrplugin.cpp index 7c5e2e1..3236daf 100644 --- a/Tools/PSSRPlugin/pssrplugin.cpp +++ b/Tools/PSSRPlugin/pssrplugin.cpp @@ -1,5 +1,3 @@ -#include "common.h" - #include #include #include