Browse Source

Fixed a subtle bug where pointers to two structs that were out of scope were being passed to the MFSR initialization. This only went wrong when the native plugin was compiled with optimizations enabled.

pssr
Nico de Poel 1 year ago
parent
commit
a4a422b8dc
  1. 3
      Tools/PSSRPlugin/pssrplugin.cpp

3
Tools/PSSRPlugin/pssrplugin.cpp

@ -274,17 +274,16 @@ extern "C" int32_t UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API CreatePssrContext(
initParams.m_outputColorHeight = params->displayHeight;
initParams.m_sharedResources = s_mfsrSharedResources;
MfsrKeepCopyTextureSpec depthCopySpec = {}, mvCopySpec = {};
if (params->autoKeepCopies)
{
// Keep a copy of the previous depth internally
MfsrKeepCopyTextureSpec depthCopySpec = {};
depthCopySpec.m_width = params->maxRenderWidth;
depthCopySpec.m_height = params->maxRenderHeight;
depthCopySpec.m_bytesPerPixel = 4; // R32_SFloat
initParams.m_maxSizeDepthForKeepCopy = &depthCopySpec;
// Keep a copy of the previous motion vectors internally
MfsrKeepCopyTextureSpec mvCopySpec = {};
mvCopySpec.m_width = params->maxRenderWidth;
mvCopySpec.m_height = params->maxRenderHeight;
mvCopySpec.m_bytesPerPixel = 4; // R16G16_SFloat

Loading…
Cancel
Save