Browse Source

Removed auto-T&C mask resources from FSR3.

2019
Nico de Poel 2 years ago
parent
commit
8d34558083
  1. 31
      Runtime/FSR3/Fsr3UpscalerResources.cs

31
Runtime/FSR3/Fsr3UpscalerResources.cs

@ -41,15 +41,11 @@ namespace FidelityFX.FSR3
public RenderTexture DilatedDepth;
public RenderTexture ReconstructedPrevNearestDepth;
public RenderTexture FrameInfo;
public RenderTexture AutoReactive;
public RenderTexture AutoComposition;
public readonly RenderTexture[] Accumulation = new RenderTexture[2];
public readonly RenderTexture[] Luma = new RenderTexture[2];
public readonly RenderTexture[] InternalUpscaled = new RenderTexture[2];
public readonly RenderTexture[] LumaHistory = new RenderTexture[2];
public readonly RenderTexture[] PrevPreAlpha = new RenderTexture[2];
public readonly RenderTexture[] PrevPostAlpha = new RenderTexture[2];
public void Create(Fsr3Upscaler.ContextDescription contextDescription)
{
@ -121,23 +117,6 @@ namespace FidelityFX.FSR3
// Resources FSR3UPSCALER_LumaHistory1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(LumaHistory, "FSR3UPSCALER_LumaHistory", maxRenderSize, GraphicsFormat.R16G16B16A16_SFloat);
}
public void CreateTcrAutogenResources(Fsr3Upscaler.ContextDescription contextDescription)
{
// Resource FSR3UPSCALER_AutoReactive: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
AutoReactive = new RenderTexture(contextDescription.MaxRenderSize.x, contextDescription.MaxRenderSize.y, 0, GraphicsFormat.R8_UNorm) { name = "FSR3UPSCALER_AutoReactive", enableRandomWrite = true };
AutoReactive.Create();
// Resource FSR3UPSCALER_AutoComposition: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_NONE
AutoComposition = new RenderTexture(contextDescription.MaxRenderSize.x, contextDescription.MaxRenderSize.y, 0, GraphicsFormat.R8_UNorm) { name = "FSR3UPSCALER_AutoComposition", enableRandomWrite = true };
AutoComposition.Create();
// Resources FSR3UPSCALER_PrevPreAlpha0/1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R11G11B10_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(PrevPreAlpha, "FSR3UPSCALER_PrevPreAlpha", contextDescription.MaxRenderSize, GraphicsFormat.B10G11R11_UFloatPack32);
// Resources FSR3UPSCALER_PrevPostAlpha0/1: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R11G11B10_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource(PrevPostAlpha, "FSR3UPSCALER_PrevPostAlpha", contextDescription.MaxRenderSize, GraphicsFormat.B10G11R11_UFloatPack32);
}
// Set up shared aliasable resources, i.e. temporary render textures
// These do not need to persist between frames, but they do need to be available between passes
@ -184,8 +163,6 @@ namespace FidelityFX.FSR3
public void Destroy()
{
DestroyTcrAutogenResources();
DestroyResource(LumaHistory);
DestroyResource(InternalUpscaled);
DestroyResource(Luma);
@ -202,14 +179,6 @@ namespace FidelityFX.FSR3
DestroyResource(ref DefaultExposure);
DestroyResource(ref LanczosLut);
}
public void DestroyTcrAutogenResources()
{
DestroyResource(PrevPostAlpha);
DestroyResource(PrevPreAlpha);
DestroyResource(ref AutoComposition);
DestroyResource(ref AutoReactive);
}
private static void DestroyResource(ref Texture2D resource)
{

Loading…
Cancel
Save