gl: Update some more buffer-object functions

This commit is contained in:
kd-11 2022-05-27 22:55:57 +03:00 committed by kd-11
parent 3ee27bd434
commit 532563e861
2 changed files with 13 additions and 3 deletions

View File

@ -742,12 +742,16 @@ namespace gl
{ {
ensure(m_memory_type != memory_type::local); ensure(m_memory_type != memory_type::local);
target target_ = current_target(); DSA_CALL2(NamedBufferData, m_id, size, data_, usage);
save_binding_state save(target_, *this);
glBufferData(static_cast<GLenum>(target_), size, data_, usage);
m_size = size; m_size = size;
} }
void sub_data(GLsizeiptr offset, GLsizeiptr length, GLvoid* data)
{
ensure(m_memory_type != memory_type::local);
DSA_CALL2(NamedBufferSubData, m_id, offset, length, data);
}
GLubyte* map(GLsizeiptr offset, GLsizeiptr length, access access_) GLubyte* map(GLsizeiptr offset, GLsizeiptr length, access access_)
{ {
ensure(m_memory_type == memory_type::host_visible); ensure(m_memory_type == memory_type::host_visible);

View File

@ -198,6 +198,12 @@ OPENGL_PROC(PFNGLCLEARBUFFERFVPROC, ClearBufferfv);
OPENGL_PROC(PFNGLCOPYNAMEDBUFFERSUBDATAPROC, CopyNamedBufferSubData); OPENGL_PROC(PFNGLCOPYNAMEDBUFFERSUBDATAPROC, CopyNamedBufferSubData);
OPENGL_PROC(PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC, NamedCopyBufferSubDataEXT); OPENGL_PROC(PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC, NamedCopyBufferSubDataEXT);
OPENGL_PROC(PFNGLNAMEDBUFFERDATAPROC, NamedBufferData);
OPENGL_PROC(PFNGLNAMEDBUFFERDATAEXTPROC, NamedBufferDataEXT);
OPENGL_PROC(PFNGLNAMEDBUFFERSUBDATAPROC, NamedBufferSubData);
OPENGL_PROC(PFNGLNAMEDBUFFERSUBDATAEXTPROC, NamedBufferSubDataEXT);
// Sampler Objects // Sampler Objects
OPENGL_PROC(PFNGLGENSAMPLERSPROC, GenSamplers); OPENGL_PROC(PFNGLGENSAMPLERSPROC, GenSamplers);
OPENGL_PROC(PFNGLDELETESAMPLERSPROC, DeleteSamplers); OPENGL_PROC(PFNGLDELETESAMPLERSPROC, DeleteSamplers);