Skip to content

Commit bb6f9e5

Browse files
author
devsh
committed
add conversion operator from SBufferRange to SBufferBinding
1 parent aae0623 commit bb6f9e5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/nbl/asset/IBuffer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ struct SBufferRange
100100
inline operator SBufferRange<const BufferType>&() {return *reinterpret_cast<SBufferRange<const BufferType>*>(this);}
101101
inline operator const SBufferRange<const BufferType>&() const {return *reinterpret_cast<const SBufferRange<const BufferType>*>(this);}
102102

103+
template<typename BT> requires std::is_same_v<std::remove_const_t<BT>,BufferType>
104+
inline operator SBufferBinding<BT>() const { return {.offset=offset,.buffer=buffer}; }
105+
103106
explicit inline operator bool() const {return isValid();}
104107

105108
inline bool isValid() const

0 commit comments

Comments
 (0)