gsdx-ogl: early bind vertex array object

Creation of buffer will generate a bind in BufferStorage mode. It is just to be safe.
This commit is contained in:
Gregory Hainaut 2015-04-25 12:48:47 +02:00
parent 15ae9996bb
commit f2f59544d2
1 changed files with 3 additions and 1 deletions

View File

@ -283,6 +283,7 @@ public:
GSVertexBufferStateOGL(size_t stride, GSInputLayoutOGL* layout, uint32 layout_nbr) GSVertexBufferStateOGL(size_t stride, GSInputLayoutOGL* layout, uint32 layout_nbr)
{ {
gl_GenVertexArrays(1, &m_va); gl_GenVertexArrays(1, &m_va);
bind();
m_vb = new GSBufferOGL(GL_ARRAY_BUFFER, stride); m_vb = new GSBufferOGL(GL_ARRAY_BUFFER, stride);
m_ib = new GSBufferOGL(GL_ELEMENT_ARRAY_BUFFER, sizeof(uint32)); m_ib = new GSBufferOGL(GL_ELEMENT_ARRAY_BUFFER, sizeof(uint32));
@ -299,7 +300,8 @@ public:
void bind() void bind()
{ {
gl_BindVertexArray(m_va); gl_BindVertexArray(m_va);
m_vb->bind(); if (m_vb)
m_vb->bind();
} }
void set_internal_format(GSInputLayoutOGL* layout, uint32 layout_nbr) void set_internal_format(GSInputLayoutOGL* layout, uint32 layout_nbr)