You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Increased max buffered occlusion queries by 1 - Fixed bug where depth read/stencil write had incorrect layouts #rb Mihnea.Balta #robomerge 5.0 [CL 17739089 by carl lloyd in ue5-main branch]
51 lines
1.8 KiB
C++
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 = 4
|
|
};
|
|
|
|
// 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;
|
|
}
|
|
};
|