Add some missing changes
This commit is contained in:
committed by
Wojtek Figat
parent
afed5a30bc
commit
69a1e007a6
@@ -244,6 +244,7 @@ bool GPUBuffer::DownloadData(BytesContainer& result)
|
|||||||
// Ensure not running on main thread
|
// Ensure not running on main thread
|
||||||
if (IsInMainThread())
|
if (IsInMainThread())
|
||||||
{
|
{
|
||||||
|
// TODO: support mesh data download from GPU on a main thread during rendering
|
||||||
LOG(Warning, "Cannot download GPU buffer data on a main thread. Use staging readback buffer or invoke this function from another thread.");
|
LOG(Warning, "Cannot download GPU buffer data on a main thread. Use staging readback buffer or invoke this function from another thread.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,6 +218,13 @@ public:
|
|||||||
/// <param name="value">The clear value.</param>
|
/// <param name="value">The clear value.</param>
|
||||||
virtual void ClearUA(GPUTexture* texture, const uint32 value[4]) = 0;
|
virtual void ClearUA(GPUTexture* texture, const uint32 value[4]) = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears an unordered access texture with a float value.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="texture">The texture to clear.</param>
|
||||||
|
/// <param name="value">The clear value.</param>
|
||||||
|
virtual void ClearUA(GPUTexture* texture, const Vector4& value) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether this mesh is using 16 bit index buffer, otherwise it's 32 bit.
|
/// Determines whether this mesh is using 16 bit index buffer, otherwise it's 32 bit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if this mesh is using 16 bit index buffer, otherwise 32 bit index buffer.</returns>
|
|
||||||
API_PROPERTY() FORCE_INLINE bool Use16BitIndexBuffer() const
|
API_PROPERTY() FORCE_INLINE bool Use16BitIndexBuffer() const
|
||||||
{
|
{
|
||||||
return _use16BitIndexBuffer;
|
return _use16BitIndexBuffer;
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
#include "Engine/Graphics/RenderTargetPool.h"
|
#include "Engine/Graphics/RenderTargetPool.h"
|
||||||
#include "Engine/Engine/Engine.h"
|
#include "Engine/Engine/Engine.h"
|
||||||
|
|
||||||
|
// How many frames keep cached buffers for temporal or optional effects?
|
||||||
|
#define LAZY_FRAMES_COUNT 4
|
||||||
|
|
||||||
RenderBuffers::RenderBuffers(const SpawnParams& params)
|
RenderBuffers::RenderBuffers(const SpawnParams& params)
|
||||||
: ScriptingObject(params)
|
: ScriptingObject(params)
|
||||||
{
|
{
|
||||||
@@ -35,8 +38,7 @@ void RenderBuffers::Prepare()
|
|||||||
if (VolumetricFog)
|
if (VolumetricFog)
|
||||||
{
|
{
|
||||||
ASSERT(VolumetricFogHistory);
|
ASSERT(VolumetricFogHistory);
|
||||||
|
if (frameIndex - LastFrameVolumetricFog >= LAZY_FRAMES_COUNT)
|
||||||
if (frameIndex - LastFrameVolumetricFog >= 4)
|
|
||||||
{
|
{
|
||||||
RenderTargetPool::Release(VolumetricFog);
|
RenderTargetPool::Release(VolumetricFog);
|
||||||
VolumetricFog = nullptr;
|
VolumetricFog = nullptr;
|
||||||
@@ -48,7 +50,7 @@ void RenderBuffers::Prepare()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define UPDATE_LAZY_KEEP_RT(name) \
|
#define UPDATE_LAZY_KEEP_RT(name) \
|
||||||
if (name && frameIndex - LastFrame##name >= 4) \
|
if (name && frameIndex - LastFrame##name >= LAZY_FRAMES_COUNT) \
|
||||||
{ \
|
{ \
|
||||||
RenderTargetPool::Release(name); \
|
RenderTargetPool::Release(name); \
|
||||||
name = nullptr; \
|
name = nullptr; \
|
||||||
|
|||||||
Reference in New Issue
Block a user