Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/ScenePrivateBase.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

51 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ScenePrivate.h: Private scene manager definitions.
=============================================================================*/
#pragma once
#include "CoreMinimal.h"
#include "RendererInterface.h"
typedef TBitArray<SceneRenderingBitArrayAllocator> FSceneBitArray;
typedef TConstSetBitIterator<SceneRenderingBitArrayAllocator> FSceneSetBitIterator;
typedef TConstDualSetBitIterator<SceneRenderingBitArrayAllocator,SceneRenderingBitArrayAllocator> FSceneDualSetBitIterator;
// Forward declarations.
class FScene;
class FOcclusionQueryHelpers
{
public:
enum
{
MaxBufferedOcclusionFrames = 3
};
// get the system-wide number of frames of buffered occlusion queries.
static int32 GetNumBufferedFrames(ERHIFeatureLevel::Type FeatureLevel);
// get the index of the oldest query based on the current frame and number of buffered frames.
static uint32 GetQueryLookupIndex(int32 CurrentFrame, int32 NumBufferedFrames)
{
// queries are currently always requested earlier in the frame than they are issued.
// thus we can always overwrite the oldest query with the current one as we never need them
// to coexist. This saves us a buffer entry.
const uint32 QueryIndex = CurrentFrame % NumBufferedFrames;
return QueryIndex;
}
// get the index of the query to overwrite for new queries.
static uint32 GetQueryIssueIndex(int32 CurrentFrame, int32 NumBufferedFrames)
{
// queries are currently always requested earlier in the frame than they are issued.
// thus we can always overwrite the oldest query with the current one as we never need them
// to coexist. This saves us a buffer entry.
const uint32 QueryIndex = CurrentFrame % NumBufferedFrames;
return QueryIndex;
}
};