Merge remote-tracking branch 'origin/master' into 1.9
This commit is contained in:
@@ -670,6 +670,17 @@ void GlobalSurfaceAtlasPass::Dispose()
|
||||
_shader = nullptr;
|
||||
}
|
||||
|
||||
bool GlobalSurfaceAtlasPass::Get(const RenderBuffers* buffers, BindingData& result)
|
||||
{
|
||||
auto* surfaceAtlasData = buffers ? buffers->FindCustomBuffer<GlobalSurfaceAtlasCustomBuffer>(TEXT("GlobalSurfaceAtlas")) : nullptr;
|
||||
if (surfaceAtlasData && surfaceAtlasData->LastFrameUsed + 1 >= Engine::FrameCount) // Allow to use Surface Atlas from the previous frame (not used currently)
|
||||
{
|
||||
result = surfaceAtlasData->Result;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void GlobalSurfaceAtlasPass::OnCollectDrawCalls(RenderContextBatch& renderContextBatch)
|
||||
{
|
||||
// Check if Global Surface Atlas will be used this frame
|
||||
|
||||
@@ -61,6 +61,14 @@ private:
|
||||
void* _currentActorObject;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Gets the Global Surface Atlas (only if enabled in Graphics Settings).
|
||||
/// </summary>
|
||||
/// <param name="buffers">The rendering context buffers.</param>
|
||||
/// <param name="result">The result Global Surface Atlas data for binding to the shaders.</param>
|
||||
/// <returns>True if there is no valid Global Surface Atlas rendered during this frame, otherwise false.</returns>
|
||||
bool Get(const RenderBuffers* buffers, BindingData& result);
|
||||
|
||||
/// <summary>
|
||||
/// Calls drawing scene objects in async early in the frame.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user