2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
PostProcessBusyWait.usf: Post processing busy wait implementation. For Debugging GPU timing.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "Common.usf"
|
|
|
|
|
#include "PostProcessCommon.usf"
|
|
|
|
|
|
|
|
|
|
// >0, from the console variable r.GPUBusyWait, multiplied with some factor
|
|
|
|
|
uint GPUBusyWait;
|
|
|
|
|
|
|
|
|
|
void MainPS(float4 UVAndScreenPos : TEXCOORD0, out float4 OutColor : SV_Target0)
|
|
|
|
|
{
|
|
|
|
|
float2 UV = UVAndScreenPos.xy;
|
|
|
|
|
|
|
|
|
|
float Value = UV.x;
|
|
|
|
|
|
|
|
|
|
for(uint i = 0; i < GPUBusyWait; ++i)
|
|
|
|
|
{
|
|
|
|
|
Value = Value * Value - 2.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OutColor = Value * 0.000000001f;
|
|
|
|
|
}
|