You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#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]
30 lines
907 B
Plaintext
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 ) );
|
|
} |