@ -98,7 +98,7 @@ namespace ArmASR
SceneLuminance . Create ( ) ;
// Resource FSR2_AutoExposure: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R32G32_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource ( AutoExposure , "ASR_AutoExposure" , Vector2Int . one , rg16Format ) ;
CreateDoubleBufferedResource ( AutoExposure , "ASR_AutoExposure" , Vector2Int . one , rg16Format , enableRandomWrite : true ) ;
// Resources FSR2_InternalDilatedVelocity1/2: FFX_RESOURCE_USAGE_RENDERTARGET | FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16_FLOAT, FFX_RESOURCE_FLAGS_NONE
CreateDoubleBufferedResource ( DilatedMotionVectors , "ASR_InternalDilatedVelocity" , contextDescription . MaxRenderSize , GraphicsFormat . R16G16_SFloat ) ;
@ -135,16 +135,16 @@ namespace ArmASR
commandBuffer . GetTemporaryRT ( AsrShaderIDs . 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 ( AsrShaderIDs . UavDilatedDepth , maxRenderSize . x , maxRenderSize . y , 0 , default , GraphicsFormat . R32_SFloat , 1 , true ) ;
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavDilatedDepth , maxRenderSize . x , maxRenderSize . y , 0 , default , GraphicsFormat . R32_SFloat , 1 ) ;
// FSR2_LockInputLuma: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavLockInputLuma , maxRenderSize . x , maxRenderSize . y , 0 , default , GraphicsFormat . R16_SFloat , 1 , true ) ;
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavLockInputLuma , maxRenderSize . x , maxRenderSize . y , 0 , default , GraphicsFormat . R16_SFloat , 1 ) ;
// FSR2_DilatedReactiveMasks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8G8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavDilatedReactiveMasks , maxRenderSize . x , maxRenderSize . y , 0 , default , GraphicsFormat . R8G8_UNorm , 1 , true ) ;
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavDilatedReactiveMasks , maxRenderSize . x , maxRenderSize . y , 0 , default , GraphicsFormat . R8G8_UNorm , 1 ) ;
// FSR2_PreparedInputColor: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R16G16B16A16_FLOAT, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavPreparedInputColor , maxRenderSize . x , maxRenderSize . y , 0 , default , preparedInputColorNeedsFp16 ? GraphicsFormat . R16G16B16A16_SFloat : GraphicsFormat . R8G8B8A8_UNorm , 1 , true ) ;
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavPreparedInputColor , maxRenderSize . x , maxRenderSize . y , 0 , default , preparedInputColorNeedsFp16 ? GraphicsFormat . R16G16B16A16_SFloat : GraphicsFormat . R8G8B8A8_UNorm , 1 ) ;
// FSR2_NewLocks: FFX_RESOURCE_USAGE_UAV, FFX_SURFACE_FORMAT_R8_UNORM, FFX_RESOURCE_FLAGS_ALIASABLE
commandBuffer . GetTemporaryRT ( AsrShaderIDs . UavNewLocks , displaySize . x , displaySize . y , 0 , default , r8Format , 1 , true ) ;
@ -177,11 +177,11 @@ namespace ArmASR
commandBuffer . ReleaseTemporaryRT ( AsrShaderIDs . UavNewLocks ) ;
}
private static void CreateDoubleBufferedResource ( RenderTexture [ ] resource , string name , Vector2Int size , GraphicsFormat format )
private static void CreateDoubleBufferedResource ( RenderTexture [ ] resource , string name , Vector2Int size , GraphicsFormat format , bool enableRandomWrite = false )
{
for ( int i = 0 ; i < 2 ; + + i )
{
resource [ i ] = new RenderTexture ( size . x , size . y , 0 , format ) { name = name + ( i + 1 ) , enableRandomWrite = tru e } ;
resource [ i ] = new RenderTexture ( size . x , size . y , 0 , format ) { name = name + ( i + 1 ) , enableRandomWrite = enableRandomWrit e } ;
resource [ i ] . Create ( ) ;
}
}