Skip to content

Commit 4fcd6e2

Browse files
author
kevyuu
committed
Implement ICPUBuffer valid()
1 parent d58554e commit 4fcd6e2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/nbl/asset/ICPUBuffer.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ class ICPUBuffer final : public asset::IBuffer, public IPreHashed
110110
return true;
111111
}
112112

113+
inline virtual bool valid() const override
114+
{
115+
if (!m_data) return false;
116+
if (!m_mem_resource) return false;
117+
// check if alignment is power of two
118+
return (m_alignment > 0 && !(m_alignment & (m_alignment - 1)));
119+
}
120+
113121
protected:
114122
inline void discardContent_impl() override
115123
{

0 commit comments

Comments
 (0)