Support access bits in gfx::buffer::map
This commit is contained in:
parent
6e366cea16
commit
27a9c9ee7b
1 changed files with 2 additions and 2 deletions
|
|
@ -154,13 +154,13 @@ namespace psemek::gfx
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::shared_ptr<T[]> map()
|
std::shared_ptr<T[]> map(GLbitfield access)
|
||||||
{
|
{
|
||||||
if (auto p = mapped_.lock())
|
if (auto p = mapped_.lock())
|
||||||
return std::static_pointer_cast<T[]>(p);
|
return std::static_pointer_cast<T[]>(p);
|
||||||
|
|
||||||
bind();
|
bind();
|
||||||
std::shared_ptr<T[]> p(reinterpret_cast<T *>(gl::MapBufferRange(Target, 0, size_, gl::MAP_WRITE_BIT)), [this](T *){
|
std::shared_ptr<T[]> p(reinterpret_cast<T *>(gl::MapBufferRange(Target, 0, size_, access)), [this](T *){
|
||||||
bind();
|
bind();
|
||||||
gl::UnmapBuffer(Target);
|
gl::UnmapBuffer(Target);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue