Files
UnrealEngineUWP/Engine/Shaders/UpdateTextureShaders.usf
Lee Clark 114fb0f752 #summary - PS4 - Texure updating / resolving now uses compute shaders
#change - RHICopyToResolveTarget now uses a compute shader. Now have the ability to copy from a tiled to a non-tiled texture.  (Also slightly faster).
#change - RHIUpdateTexture2D now uses a compute shader so it can work with tiled textures. (Also slightly faster).
#change - Surfaces created with CPUReadback are forced to be linear so that the CPU can read them directly.
#change - HZB occlusion culling now works on PS4.

[CL 2038599 by Lee Clark in Main branch]
2014-04-23 16:40:35 -04:00

30 lines
907 B
Plaintext

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
UpdateTextureShaders.usf: Compute shaders for copying and updating textures.
=============================================================================*/
#include "Common.usf"
Buffer<int4> SrcBuffer;
RWTexture2D<int4> DestTexture;
int SrcPitch;
uint4 DestPosSize; // xy = pos, zw = Size of the destination sub rect
[numthreads(8,8,1)]
void UpdateTexture2DSubresourceCS( uint2 ThreadId : SV_DispatchThreadID )
{
if( all( ThreadId.xy < DestPosSize.zw ) )
{
DestTexture[ ThreadId.xy + DestPosSize.xy ] = SrcBuffer[ ThreadId.x + ThreadId.y * SrcPitch ];
}
}
Texture2D<int4> SrcTexture;
[numthreads(8,8,1)]
void CopyTexture2DCS( uint3 ThreadId : SV_DispatchThreadID )
{
DestTexture[ ThreadId.xy ] = SrcTexture.Load( int3( ThreadId.x, ThreadId.y, 0 ) );
}