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