Browse Source

Removed obsolete and unused code files from the plugin

pssr
Nico de Poel 1 year ago
parent
commit
16774bc66f
  1. 1
      .gitignore
  2. BIN
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/Plugins/PS5/PSSRPlugin.prx
  3. 4
      Tools/PSSRPlugin/PSSRPlugin.vcxproj
  4. 12
      Tools/PSSRPlugin/PSSRPlugin.vcxproj.filters
  5. 3
      Tools/PSSRPlugin/common.h
  6. 86
      Tools/PSSRPlugin/mfsr.cpp
  7. 36
      Tools/PSSRPlugin/prx.cpp
  8. 7
      Tools/PSSRPlugin/psml.cpp
  9. 2
      Tools/PSSRPlugin/pssrplugin.cpp

1
.gitignore

@ -11,3 +11,4 @@ screenshot-*.png
.vs
Tools/PSSRPlugin/Prospero_Debug/
*.user
Tools/PSSRPlugin/Prospero_Release/

BIN
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/Upscaling/Plugins/PS5/PSSRPlugin.prx

4
Tools/PSSRPlugin/PSSRPlugin.vcxproj

@ -68,13 +68,9 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="mfsr.cpp" />
<ClCompile Include="prx.cpp" />
<ClCompile Include="psml.cpp" />
<ClCompile Include="pssrplugin.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="common.h" />
<ClInclude Include="UnityPluginAPI\IUnityGraphics.h" />
<ClInclude Include="UnityPluginAPI\IUnityGraphicsAgcPS5.h" />
<ClInclude Include="UnityPluginAPI\IUnityGraphicsPS5.h" />

12
Tools/PSSRPlugin/PSSRPlugin.vcxproj.filters

@ -15,23 +15,11 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="prx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mfsr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="psml.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pssrplugin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="UnityPluginAPI\IUnityGraphics.h">
<Filter>Header Files</Filter>
</ClInclude>

3
Tools/PSSRPlugin/common.h

@ -1,3 +0,0 @@
#pragma once
#define PSML_EXPORT __declspec (dllexport)

86
Tools/PSSRPlugin/mfsr.cpp

@ -1,86 +0,0 @@
#include "common.h"
#include <psml_mfsr.h>
#include <agc/core/sync.h>
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
}

36
Tools/PSSRPlugin/prx.cpp

@ -1,36 +0,0 @@
#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;
}

7
Tools/PSSRPlugin/psml.cpp

@ -1,7 +0,0 @@
#include "common.h"
#include <libsysmodule.h>
PSML_EXPORT bool Load()
{
return sceSysmoduleLoadModule(SCE_SYSMODULE_PSML) == SCE_SYSMODULE_LOADED;
}

2
Tools/PSSRPlugin/pssrplugin.cpp

@ -1,5 +1,3 @@
#include "common.h"
#include <libsysmodule.h>
#include <agc.h>
#include <agc/gnmp/gnmp.h>

Loading…
Cancel
Save