Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/ScenePrivateBase.h
carl lloyd 94f69a7fbf Fixes for Vulkan Mobile Desktop renderer
- Increased max buffered occlusion queries by 1
 - Fixed bug where depth read/stencil write had incorrect layouts

#rb Mihnea.Balta

#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-SOURCE: CL 17739089 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17739184 by carl lloyd in ue5-release-engine-test branch]
2021-10-06 14:55:41 -04: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 = 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;
}
};