From ac5d731b911322cfbd463b429838c2781a219998 Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Sun, 8 Aug 2021 16:55:19 +0200 Subject: [PATCH] Use GL_ARRAY_BUFFER --- .../client/backend/opengl/backend_opengl.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/engine/client/backend/opengl/backend_opengl.cpp b/src/engine/client/backend/opengl/backend_opengl.cpp index 352e66422..aa96b0b17 100644 --- a/src/engine/client/backend/opengl/backend_opengl.cpp +++ b/src/engine/client/backend/opengl/backend_opengl.cpp @@ -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); } }