Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New View and Viewer: IndirectBufferView #48

Open
MuGdxy opened this issue Jun 23, 2024 · 0 comments
Open

Add New View and Viewer: IndirectBufferView #48

MuGdxy opened this issue Jun 23, 2024 · 0 comments

Comments

@MuGdxy
Copy link
Owner

MuGdxy commented Jun 23, 2024

template<bool IsConst, typename IndexType, typename ValueType>
class IndirectBufferView
{
using value_type = ValueType;
const IndexType* m_index_buffer;
size_t m_index_buffer_offset;
size_t m_index_buffer_size;
auto_const_t<ValueType>* m_value_buffer;
size_t m_value_buffer_offset;
size_t m_value_buffer_size;
};
IndirectBufferView[i] -> 
{
    auto offset = m_index_buffer[m_index_buffer_offset + i];
    return m_value_buffer[m_value_buffer_offset + offset];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant