Refactor Streaming with new settings and textures streaming configuration

This commit is contained in:
Wojtek Figat
2021-06-17 15:33:34 +02:00
parent 64501a8645
commit 4744fa05ef
42 changed files with 631 additions and 480 deletions

View File

@@ -9,6 +9,38 @@
#include "Engine/Graphics/RenderTools.h"
#include "Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h"
TextureHeader_Deprecated::TextureHeader_Deprecated()
{
Platform::MemoryClear(this, sizeof(*this));
}
TextureHeader::TextureHeader()
{
Platform::MemoryClear(this, sizeof(*this));
TextureGroup = -1;
}
TextureHeader::TextureHeader(TextureHeader_Deprecated& old)
{
Platform::MemoryClear(this, sizeof(*this));
Width = old.Width;;
Height = old.Height;
MipLevels = old.MipLevels;
Format = old.Format;
Type = old.Type;
if (old.IsCubeMap)
IsCubeMap = 1;
if (old.IsSRGB)
IsSRGB = 1;
if (old.NeverStream)
NeverStream = 1;
TextureGroup = -1;
Platform::MemoryCopy(CustomData, old.CustomData, sizeof(CustomData));
}
static_assert(sizeof(TextureHeader_Deprecated) == 10 * sizeof(int32), "Invalid TextureHeader size.");
static_assert(sizeof(TextureHeader) == 36, "Invalid TextureHeader size.");
StreamingTexture::StreamingTexture(ITextureOwner* parent, const String& name)
: StreamableResource(StreamingGroups::Instance()->Textures())
, _owner(parent)
@@ -112,6 +144,11 @@ String StreamingTexture::ToString() const
return _texture->ToString();
}
int32 StreamingTexture::GetMaxResidency() const
{
return _header.MipLevels;
}
int32 StreamingTexture::GetCurrentResidency() const
{
return _texture->ResidentMipLevels();