Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Public/StaticBoundShaderState.h
Bryan sefcik b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00

88 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
StaticBoundShaderState.h: Static bound shader state definitions.
=============================================================================*/
#pragma once
#include "Containers/List.h"
#include "CoreMinimal.h"
#include "Misc/Build.h"
#include "RHI.h"
#include "RHIDefinitions.h"
#include "RenderResource.h"
class FShader;
/**
* FGlobalBoundShaderState
*
* Encapsulates a global bound shader state resource.
*/
class FGlobalBoundShaderStateResource : public FRenderResource
{
public:
/** @return The list of global bound shader states. */
RENDERCORE_API static TLinkedList<FGlobalBoundShaderStateResource*>*& GetGlobalBoundShaderStateList();
/** Initialization constructor. */
RENDERCORE_API FGlobalBoundShaderStateResource();
/** Destructor. */
RENDERCORE_API virtual ~FGlobalBoundShaderStateResource();
private:
/** The cached bound shader state. */
FBoundShaderStateRHIRef BoundShaderState;
/** This resource's link in the list of global bound shader states. */
TLinkedList<FGlobalBoundShaderStateResource*> GlobalListLink;
// FRenderResource interface.
RENDERCORE_API virtual void ReleaseRHI();
#if DO_CHECK
FRHIVertexDeclaration* BoundVertexDeclaration;
FRHIVertexShader* BoundVertexShader;
FRHIPixelShader* BoundPixelShader;
FRHIGeometryShader* BoundGeometryShader;
#endif
};
typedef TGlobalResource<FGlobalBoundShaderStateResource> FGlobalBoundShaderState_Internal;
struct FGlobalBoundShaderStateArgs
{
FRHIVertexDeclaration* VertexDeclarationRHI;
FShader* VertexShader;
FShader* PixelShader;
FShader* GeometryShader;
};
struct FGlobalBoundShaderStateWorkArea
{
FGlobalBoundShaderStateArgs Args;
FGlobalBoundShaderState_Internal* BSS; //ideally this would be part of this memory block and not a separate allocation...that is doable, if a little tedious. The point is we need to delay the construction until we get back to the render thread.
FGlobalBoundShaderStateWorkArea()
: BSS(nullptr)
{
}
};
struct FGlobalBoundShaderState
{
public:
FGlobalBoundShaderStateWorkArea* Get(ERHIFeatureLevel::Type InFeatureLevel) { return WorkAreas[InFeatureLevel]; }
FGlobalBoundShaderStateWorkArea** GetPtr(ERHIFeatureLevel::Type InFeatureLevel) { return &WorkAreas[InFeatureLevel]; }
private:
FGlobalBoundShaderStateWorkArea* WorkAreas[ERHIFeatureLevel::Num];
};