Files
UnrealEngineUWP/Engine/Shaders/Private/CopyDepthTextureCS.usf
Sebastien Hillaire 2b4ae7c654 Made depth copy compute shader shared.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6419a9763f3d31c94af55d4d

[CL 24730842 by Sebastien Hillaire in ue5-main branch]
2023-03-21 09:08:46 -04:00

24 lines
679 B
Plaintext

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
CopyDepthTextureCS.usf
=============================================================================*/
#include "Common.ush"
#ifndef THREADGROUP_SIZE
#error THREADGROUP_SIZE must be defined
#endif
Texture2D SceneDepthTexture;
RWTexture2D<float> RWDepthTexture;
[numthreads(THREADGROUP_SIZE, THREADGROUP_SIZE, 1)]
void CopyDepthCS(
uint2 DispatchThreadId : SV_DispatchThreadID)
{
float DeviceZ = SceneDepthTexture[DispatchThreadId + View.ViewRectMinAndSize.xy].x;
RWDepthTexture[DispatchThreadId + View.ViewRectMinAndSize.xy] = DeviceZ;
}