Skip to content

Commit 4a4b51d

Browse files
author
kevyuu
committed
Implement ICPUImage::valid()
1 parent 345dbd8 commit 4a4b51d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/nbl/asset/ICPUImage.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ class NBL_API2 ICPUImage final : public IImage, public IPreHashed
195195
return true;
196196
}
197197

198+
inline virtual bool valid() const override
199+
{
200+
if (!validateCreationParameters(m_creationParams)) return false;
201+
if (info != m_creationParams.format) return false;
202+
if (!buffer->valid()) return false;
203+
for (const auto& region : regions)
204+
if (!region.isValid()) return false;
205+
return true;
206+
}
207+
198208
protected:
199209
inline ICPUImage(const SCreationParams& _params) : IImage(_params) {}
200210
virtual ~ICPUImage() = default;

0 commit comments

Comments
 (0)