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 DilatedDepth;
public RenderTexture ReconstructedPrevNearestDepth; public RenderTexture ReconstructedPrevNearestDepth;
public RenderTexture FrameInfo; public RenderTexture FrameInfo;
public RenderTexture AutoReactive;
public RenderTexture AutoComposition;
public readonly RenderTexture[] Accumulation = new RenderTexture[2]; public readonly RenderTexture[] Accumulation = new RenderTexture[2];
public readonly RenderTexture[] Luma = new RenderTexture[2]; public readonly RenderTexture[] Luma = new RenderTexture[2];
public readonly RenderTexture[] InternalUpscaled = new RenderTexture[2]; public readonly RenderTexture[] InternalUpscaled = new RenderTexture[2];
public readonly RenderTexture[] LumaHistory = 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) public void Create(Fsr3Upscaler.ContextDescription contextDescription)
{ {
@ -122,23 +118,6 @@ namespace FidelityFX.FSR3
CreateDoubleBufferedResource(LumaHistory, "FSR3UPSCALER_LumaHistory", maxRenderSize, GraphicsFormat.R16G16B16A16_SFloat); 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 // 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 // These do not need to persist between frames, but they do need to be available between passes
public static void CreateAliasableResources(CommandBuffer commandBuffer, Fsr3Upscaler.ContextDescription contextDescription, Fsr3Upscaler.DispatchDescription dispatchParams) public static void CreateAliasableResources(CommandBuffer commandBuffer, Fsr3Upscaler.ContextDescription contextDescription, Fsr3Upscaler.DispatchDescription dispatchParams)
@ -184,8 +163,6 @@ namespace FidelityFX.FSR3
public void Destroy() public void Destroy()
{ {
DestroyTcrAutogenResources();
DestroyResource(LumaHistory); DestroyResource(LumaHistory);
DestroyResource(InternalUpscaled); DestroyResource(InternalUpscaled);
DestroyResource(Luma); DestroyResource(Luma);
@ -203,14 +180,6 @@ namespace FidelityFX.FSR3
DestroyResource(ref LanczosLut); DestroyResource(ref LanczosLut);
} }
public void DestroyTcrAutogenResources()
{
DestroyResource(PrevPostAlpha);
DestroyResource(PrevPreAlpha);
DestroyResource(ref AutoComposition);
DestroyResource(ref AutoReactive);
}
private static void DestroyResource(ref Texture2D resource) private static void DestroyResource(ref Texture2D resource)
{ {
if (resource == null) if (resource == null)

Loading…
Cancel
Save