You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
44 lines
930 B
Plaintext
44 lines
930 B
Plaintext
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
ClearReplacement.usf: Collection of Shaders for alternative ways to clear a texture/buffer.
|
|
=============================================================================*/
|
|
|
|
#include "Common.usf"
|
|
|
|
float4 ClearColor;
|
|
|
|
float4 ClearVS(uint Id : SV_VertexID) : SV_POSITION
|
|
{
|
|
int x = Id & 1;
|
|
int y = Id >> 1;
|
|
|
|
return float4(x * 2 - 1, y * 2 - 1, 0, 1);
|
|
}
|
|
|
|
|
|
float4 ClearPS() : SV_Target0
|
|
{
|
|
return ClearColor;
|
|
}
|
|
|
|
#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
|
|
RWTexture2D<float4> ClearTextureRW;
|
|
|
|
[numthreads(8,8,1)]
|
|
void ClearTexture2DCS(uint2 Position : SV_DispatchThreadID)
|
|
{
|
|
ClearTextureRW[Position] = ClearColor;
|
|
}
|
|
|
|
|
|
uint ClearDword;
|
|
RWBuffer<uint> ClearBufferRW;
|
|
|
|
[numthreads(64,1,1)]
|
|
void ClearBufferCS(uint Position : SV_DispatchThreadID)
|
|
{
|
|
ClearBufferRW[Position] = ClearDword;
|
|
}
|
|
#endif
|