mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-28 14:54:11 +00:00
gl: Memoize the bound range for a buffer
This commit is contained in:
parent
3ef1eb8529
commit
4cf7b7022e
@ -146,11 +146,13 @@ namespace gl
|
||||
|
||||
void buffer::bind_range(u32 index, u32 offset, u32 size) const
|
||||
{
|
||||
m_bound_range = { offset, size };
|
||||
glBindBufferRange(static_cast<GLenum>(current_target()), index, id(), offset, size);
|
||||
}
|
||||
|
||||
void buffer::bind_range(target target_, u32 index, u32 offset, u32 size) const
|
||||
{
|
||||
m_bound_range = { offset, size };
|
||||
glBindBufferRange(static_cast<GLenum>(target_), index, id(), offset, size);
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,9 @@ namespace gl
|
||||
target m_target = target::array;
|
||||
memory_type m_memory_type = memory_type::undefined;
|
||||
|
||||
// Metadata
|
||||
mutable std::pair<u32, u32> m_bound_range{};
|
||||
|
||||
void allocate(GLsizeiptr size, const void* data_, memory_type type, GLenum usage);
|
||||
|
||||
public:
|
||||
@ -109,6 +112,7 @@ namespace gl
|
||||
uint id() const { return m_id; }
|
||||
void set_id(uint id) { m_id = id; }
|
||||
bool created() const { return m_id != GL_NONE; }
|
||||
std::pair<u32, u32> bound_range() const { return m_bound_range; }
|
||||
|
||||
explicit operator bool() const { return created(); }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user