Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/StaticBoundShaderState.cpp
christopher waters 1f21b73b25 Ran IWYU on RHI and RenderCore, private only.
#preflight 63d358c85c69f453c1f79c37

[CL 23889591 by christopher waters in ue5-main branch]
2023-01-27 14:54:10 -05:00

56 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
StaticBoundShaderState.cpp: Static bound shader state implementation.
=============================================================================*/
#include "StaticBoundShaderState.h"
#include "RenderingThread.h"
PRAGMA_DISABLE_DEPRECATION_WARNINGS
TLinkedList<FGlobalBoundShaderStateResource*>*& FGlobalBoundShaderStateResource::GetGlobalBoundShaderStateList()
{
static TLinkedList<FGlobalBoundShaderStateResource*>* List = NULL;
return List;
}
FGlobalBoundShaderStateResource::FGlobalBoundShaderStateResource()
: GlobalListLink(this)
#if DO_CHECK
, BoundVertexDeclaration(nullptr)
, BoundVertexShader(nullptr)
, BoundPixelShader(nullptr)
, BoundGeometryShader(nullptr)
#endif
{
// Add this resource to the global list in the rendering thread.
if(IsInRenderingThread())
{
GlobalListLink.LinkHead(GetGlobalBoundShaderStateList());
}
else
{
FGlobalBoundShaderStateResource* Resource = this;
ENQUEUE_RENDER_COMMAND(LinkGlobalBoundShaderStateResource)(
[Resource](FRHICommandList& RHICmdList)
{
Resource->GlobalListLink.LinkHead(GetGlobalBoundShaderStateList());
});
}
}
FGlobalBoundShaderStateResource::~FGlobalBoundShaderStateResource()
{
// Remove this resource from the global list.
GlobalListLink.Unlink();
}
void FGlobalBoundShaderStateResource::ReleaseRHI()
{
// Release the cached bound shader state.
BoundShaderState.SafeRelease();
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS