mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-21 12:00:06 +00:00
ScratchImage Initialize zero-fills image data (#308)
This commit is contained in:
parent
278e708f25
commit
371643fce2
@ -367,7 +367,9 @@ HRESULT ScratchImage::Initialize(const TexMetadata& mdata, CP_FLAGS flags) noexc
|
||||
Release();
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
memset(m_memory, 0, pixelSize);
|
||||
m_size = pixelSize;
|
||||
|
||||
if (!SetupImageArray(m_memory, pixelSize, m_metadata, flags, m_image, nimages))
|
||||
{
|
||||
Release();
|
||||
@ -435,7 +437,9 @@ HRESULT ScratchImage::Initialize2D(DXGI_FORMAT fmt, size_t width, size_t height,
|
||||
Release();
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
memset(m_memory, 0, pixelSize);
|
||||
m_size = pixelSize;
|
||||
|
||||
if (!SetupImageArray(m_memory, pixelSize, m_metadata, flags, m_image, nimages))
|
||||
{
|
||||
Release();
|
||||
@ -489,6 +493,7 @@ HRESULT ScratchImage::Initialize3D(DXGI_FORMAT fmt, size_t width, size_t height,
|
||||
Release();
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
memset(m_memory, 0, pixelSize);
|
||||
m_size = pixelSize;
|
||||
|
||||
if (!SetupImageArray(m_memory, pixelSize, m_metadata, flags, m_image, nimages))
|
||||
|
Loading…
Reference in New Issue
Block a user