You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fixes TTP 335869 - UE4: RENDERING: CRITICAL: EDITOR: CRASH: Occurs when launching mobile preview on the StarterMap using the Asus UX31 Sandy Bridge Ultrabook [CL 2119491 by Graeme Thornton in Main branch]
66 lines
1.5 KiB
Plaintext
66 lines
1.5 KiB
Plaintext
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
ResolvePixelShader.usf: Resolve pixel shader source.
|
|
=============================================================================*/
|
|
|
|
#include "Common.usf"
|
|
|
|
|
|
#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
|
|
|
|
Texture2DMS<float4> UnresolvedSurface;
|
|
|
|
void MainDepth(
|
|
float2 InUV : TEXCOORD0,
|
|
out float OutDepth : SV_DEPTH
|
|
)
|
|
{
|
|
float2 SurfaceDimensions;
|
|
int NumSurfaceSamples;
|
|
UnresolvedSurface.GetDimensions(SurfaceDimensions.x,SurfaceDimensions.y,NumSurfaceSamples);
|
|
|
|
int2 IntUV = trunc(InUV);
|
|
|
|
// Compute the minimum depth of all samples.
|
|
// Note that minimum depth actually means farthest depth, since 1/depth is stored.
|
|
float MinDepth = 1000000;
|
|
for(int SampleIndex = 0;SampleIndex < NumSurfaceSamples;++SampleIndex)
|
|
{
|
|
float Sample = UnresolvedSurface.Load(IntUV,SampleIndex).r;
|
|
MinDepth = min(MinDepth,Sample);
|
|
}
|
|
|
|
OutDepth = MinDepth;
|
|
}
|
|
|
|
uint SingleSampleIndex;
|
|
|
|
void MainSingleSample(
|
|
float2 InUV : TEXCOORD0,
|
|
out float4 OutColor : SV_Target0
|
|
)
|
|
{
|
|
float2 SurfaceDimensions;
|
|
int NumSurfaceSamples;
|
|
UnresolvedSurface.GetDimensions(SurfaceDimensions.x,SurfaceDimensions.y,NumSurfaceSamples);
|
|
|
|
int2 IntUV = trunc(InUV);
|
|
|
|
OutColor = UnresolvedSurface.Load(IntUV,SingleSampleIndex);
|
|
}
|
|
|
|
#else
|
|
|
|
Texture2D UnresolvedSurfaceNonMS;
|
|
void MainDepthNonMS(
|
|
float2 InUV : TEXCOORD0,
|
|
out float OutDepth : SV_DEPTH
|
|
)
|
|
{
|
|
int3 IntUV = int3(trunc(InUV),0);
|
|
float Sample = UnresolvedSurfaceNonMS.Load(IntUV).r;
|
|
OutDepth = Sample;
|
|
}
|
|
|
|
#endif |