Add HDR env probes support

This commit is contained in:
Wojciech Figat
2022-07-19 10:33:52 +02:00
parent b184650835
commit 0af86d8cb8
5 changed files with 37 additions and 21 deletions

View File

@@ -533,7 +533,7 @@ GPUTexture* GPUTexture::ToStagingUpload() const
return staging;
}
bool GPUTexture::Resize(int32 width, int32 height, int32 depth)
bool GPUTexture::Resize(int32 width, int32 height, int32 depth, PixelFormat format)
{
// Validate texture is created
if (!IsAllocated())
@@ -543,11 +543,14 @@ bool GPUTexture::Resize(int32 width, int32 height, int32 depth)
}
auto desc = GetDescription();
if (format == PixelFormat::Unknown)
format = desc.Format;
// Skip if size won't change
if (desc.Width == width && desc.Height == height && desc.Depth == depth)
if (desc.Width == width && desc.Height == height && desc.Depth == depth && desc.Format == format)
return false;
desc.Format = format;
desc.Width = width;
desc.Height = height;
desc.Depth = depth;

View File

@@ -486,11 +486,12 @@ public:
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="format">The new texture format. Use Unknown to remain texture format unchanged.</param>
/// <returns>True if fails, otherwise false.</returns>
API_FUNCTION() bool Resize(int32 width, int32 height)
API_FUNCTION() bool Resize(int32 width, int32 height, PixelFormat format = PixelFormat::Unknown)
{
const auto depth = IsAllocated() ? Depth() : 1;
return Resize(width, height, depth);
return Resize(width, height, depth, format);
}
/// <summary>
@@ -499,8 +500,9 @@ public:
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="depth">The depth.</param>
/// <param name="format">The new texture format. Use Unknown to remain texture format unchanged.</param>
/// <returns>True if fails, otherwise false.</returns>
API_FUNCTION() bool Resize(int32 width, int32 height, int32 depth);
API_FUNCTION() bool Resize(int32 width, int32 height, int32 depth, PixelFormat format = PixelFormat::Unknown);
public:
/// <summary>