Use GL_ARRAY_BUFFER

This commit is contained in:
Jupeyy 2021-08-08 16:55:19 +02:00
parent 9bfe4ec76a
commit ac5d731b91

View file

@ -1834,9 +1834,9 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(const CCommandBuf
if(m_HasShaders)
{
glGenBuffers(1, &VertBufferID);
glBindBuffer(GL_COPY_WRITE_BUFFER, VertBufferID);
glBufferData(GL_COPY_WRITE_BUFFER, (GLsizeiptr)(pCommand->m_DataSize), pUploadData, GL_STATIC_DRAW);
glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, VertBufferID);
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)(pCommand->m_DataSize), pUploadData, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
SBufferObject &BufferObject = m_BufferObjectIndices[Index];
@ -1858,9 +1858,9 @@ void CCommandProcessorFragment_OpenGL2::Cmd_RecreateBufferObject(const CCommandB
if(m_HasShaders)
{
glBindBuffer(GL_COPY_WRITE_BUFFER, BufferObject.m_BufferObjectID);
glBufferData(GL_COPY_WRITE_BUFFER, (GLsizeiptr)(pCommand->m_DataSize), pUploadData, GL_STATIC_DRAW);
glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, BufferObject.m_BufferObjectID);
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)(pCommand->m_DataSize), pUploadData, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
BufferObject.m_DataSize = pCommand->m_DataSize;
@ -1882,9 +1882,9 @@ void CCommandProcessorFragment_OpenGL2::Cmd_UpdateBufferObject(const CCommandBuf
if(m_HasShaders)
{
glBindBuffer(GL_COPY_WRITE_BUFFER, BufferObject.m_BufferObjectID);
glBufferSubData(GL_COPY_WRITE_BUFFER, (GLintptr)(pCommand->m_pOffset), (GLsizeiptr)(pCommand->m_DataSize), pUploadData);
glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, BufferObject.m_BufferObjectID);
glBufferSubData(GL_ARRAY_BUFFER, (GLintptr)(pCommand->m_pOffset), (GLsizeiptr)(pCommand->m_DataSize), pUploadData);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
if(pUploadData)
@ -1906,9 +1906,9 @@ void CCommandProcessorFragment_OpenGL2::Cmd_CopyBufferObject(const CCommandBuffe
if(m_HasShaders)
{
glBindBuffer(GL_COPY_WRITE_BUFFER, WriteBufferObject.m_BufferObjectID);
glBufferSubData(GL_COPY_WRITE_BUFFER, (GLintptr)(pCommand->m_pWriteOffset), (GLsizeiptr)(pCommand->m_CopySize), ((uint8_t *)WriteBufferObject.m_pData) + (ptrdiff_t)pCommand->m_pWriteOffset);
glBindBuffer(GL_COPY_WRITE_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, WriteBufferObject.m_BufferObjectID);
glBufferSubData(GL_ARRAY_BUFFER, (GLintptr)(pCommand->m_pWriteOffset), (GLsizeiptr)(pCommand->m_CopySize), ((uint8_t *)WriteBufferObject.m_pData) + (ptrdiff_t)pCommand->m_pWriteOffset);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
}