diff --git a/Source/Engine/Graphics/GPUBuffer.cpp b/Source/Engine/Graphics/GPUBuffer.cpp index 72a1c07bc..bf52943db 100644 --- a/Source/Engine/Graphics/GPUBuffer.cpp +++ b/Source/Engine/Graphics/GPUBuffer.cpp @@ -244,6 +244,7 @@ bool GPUBuffer::DownloadData(BytesContainer& result) // Ensure not running on main thread 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."); return true; } diff --git a/Source/Engine/Graphics/GPUContext.h b/Source/Engine/Graphics/GPUContext.h index 941dac961..59699417e 100644 --- a/Source/Engine/Graphics/GPUContext.h +++ b/Source/Engine/Graphics/GPUContext.h @@ -218,6 +218,13 @@ public: /// The clear value. virtual void ClearUA(GPUTexture* texture, const uint32 value[4]) = 0; + /// + /// Clears an unordered access texture with a float value. + /// + /// The texture to clear. + /// The clear value. + virtual void ClearUA(GPUTexture* texture, const Vector4& value) = 0; + public: /// diff --git a/Source/Engine/Graphics/Models/MeshBase.h b/Source/Engine/Graphics/Models/MeshBase.h index 4bb000917..5a76e4f46 100644 --- a/Source/Engine/Graphics/Models/MeshBase.h +++ b/Source/Engine/Graphics/Models/MeshBase.h @@ -95,7 +95,6 @@ public: /// /// Determines whether this mesh is using 16 bit index buffer, otherwise it's 32 bit. /// - /// True if this mesh is using 16 bit index buffer, otherwise 32 bit index buffer. API_PROPERTY() FORCE_INLINE bool Use16BitIndexBuffer() const { return _use16BitIndexBuffer; diff --git a/Source/Engine/Graphics/RenderBuffers.cpp b/Source/Engine/Graphics/RenderBuffers.cpp index 681910307..df2962e52 100644 --- a/Source/Engine/Graphics/RenderBuffers.cpp +++ b/Source/Engine/Graphics/RenderBuffers.cpp @@ -7,6 +7,9 @@ #include "Engine/Graphics/RenderTargetPool.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) : ScriptingObject(params) { @@ -35,8 +38,7 @@ void RenderBuffers::Prepare() if (VolumetricFog) { ASSERT(VolumetricFogHistory); - - if (frameIndex - LastFrameVolumetricFog >= 4) + if (frameIndex - LastFrameVolumetricFog >= LAZY_FRAMES_COUNT) { RenderTargetPool::Release(VolumetricFog); VolumetricFog = nullptr; @@ -48,7 +50,7 @@ void RenderBuffers::Prepare() } } #define UPDATE_LAZY_KEEP_RT(name) \ - if (name && frameIndex - LastFrame##name >= 4) \ + if (name && frameIndex - LastFrame##name >= LAZY_FRAMES_COUNT) \ { \ RenderTargetPool::Release(name); \ name = nullptr; \