|
|
|
@ -87,25 +87,25 @@ namespace FidelityFX |
|
|
|
// TODO: we could potentially gather *all* resource binding here, by using CommandBuffer.SetGlobalTexture for everything
|
|
|
|
|
|
|
|
// Resource FSR2_SpdAtomicCounter: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_UINT, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavSpdAtomicCount, 1, 1, 0, default(FilterMode), GraphicsFormat.R32_UInt, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavSpdAtomicCount, 1, 1, 0, default, GraphicsFormat.R32_UInt, 1, true); |
|
|
|
|
|
|
|
// FSR2_ReconstructedPrevNearestDepth: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_UINT, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavReconstructedPrevNearestDepth, maxRenderSize.x, maxRenderSize.y, 0, default(FilterMode), GraphicsFormat.R32_UInt, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavReconstructedPrevNearestDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R32_UInt, 1, true); |
|
|
|
|
|
|
|
// FSR2_DilatedDepth: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavDilatedDepth, maxRenderSize.x, maxRenderSize.y, 0, default(FilterMode), GraphicsFormat.R32_SFloat, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavDilatedDepth, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R32_SFloat, 1, true); |
|
|
|
|
|
|
|
// FSR2_LockInputLuma: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavLockInputLuma, maxRenderSize.x, maxRenderSize.y, 0, default(FilterMode), GraphicsFormat.R16_SFloat, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavLockInputLuma, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16_SFloat, 1, true); |
|
|
|
|
|
|
|
// FSR2_DilatedReactiveMasks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8G8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavDilatedReactiveMasks, maxRenderSize.x, maxRenderSize.y, 0, default(FilterMode), GraphicsFormat.R8G8_UNorm, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavDilatedReactiveMasks, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R8G8_UNorm, 1, true); |
|
|
|
|
|
|
|
// FSR2_PreparedInputColor: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavPreparedInputColor, maxRenderSize.x, maxRenderSize.y, 0, default(FilterMode), GraphicsFormat.R16G16B16A16_SFloat, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavPreparedInputColor, maxRenderSize.x, maxRenderSize.y, 0, default, GraphicsFormat.R16G16B16A16_SFloat, 1, true); |
|
|
|
|
|
|
|
// FSR2_NewLocks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
|
|
|
|
commandBuffer.GetTemporaryRT(UavNewLocks, displaySize.x, displaySize.y, 0, default(FilterMode), GraphicsFormat.R8_UNorm, 1, true); |
|
|
|
commandBuffer.GetTemporaryRT(UavNewLocks, displaySize.x, displaySize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true); |
|
|
|
} |
|
|
|
|
|
|
|
public static void UnregisterResources(CommandBuffer commandBuffer) |
|
|
|
@ -132,7 +132,13 @@ namespace FidelityFX |
|
|
|
|
|
|
|
kernelIndex = shaderRef.FindKernel("CS"); |
|
|
|
|
|
|
|
bool useLut = (SystemInfo.computeSubGroupSize == 64); |
|
|
|
bool useLut = false; |
|
|
|
#if UNITY_2020_3_OR_NEWER
|
|
|
|
if (SystemInfo.computeSubGroupSize == 64) |
|
|
|
{ |
|
|
|
useLut = true; |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
// Allow 16-bit floating point as a configuration option, except on passes that explicitly disable it
|
|
|
|
bool supportedFP16 = ((flags & Fsr2.InitializationFlags.EnableFP16Usage) != 0 && AllowFP16); |
|
|
|
@ -300,9 +306,9 @@ namespace FidelityFX |
|
|
|
// Simply loading the accumulate_pass compute shader will give us the same instance as the non-sharpen pipeline
|
|
|
|
// So we have to clone the shader instance and set the extra keyword on the new copy
|
|
|
|
_shaderCopy = UnityEngine.Object.Instantiate(ComputeShader); |
|
|
|
foreach (var keyword in ComputeShader.enabledKeywords) |
|
|
|
foreach (var keyword in ComputeShader.shaderKeywords) |
|
|
|
{ |
|
|
|
_shaderCopy.EnableKeyword(keyword.name); |
|
|
|
_shaderCopy.EnableKeyword(keyword); |
|
|
|
} |
|
|
|
_shaderCopy.EnableKeyword("FFX_FSR2_OPTION_APPLY_SHARPENING"); |
|
|
|
} |
|
|
|
|