Permalink
Browse files

GE Debugger: Fix tex preview race condition.

If we redraw the tex preview first, we need this for the VAO.  Oops.
  • Loading branch information...
unknownbrackets committed Sep 21, 2018
1 parent a8588b0 commit e90ffdb8e14fedc4131a30675400275d5c77b5e2
Showing with 9 additions and 3 deletions.
  1. +9 −3 Windows/GEDebugger/VertexPreview.cpp
@@ -392,8 +392,10 @@ void CGEDebugger::UpdatePrimPreview(u32 op, int which) {
glBindVertexArray(previewVao);
glEnableVertexAttribArray(previewProgram->a_position);
glGenBuffers(1, &ibuf);
glGenBuffers(1, &vbuf);
if (ibuf == 0)
glGenBuffers(1, &ibuf);
if (vbuf == 0)
glGenBuffers(1, &vbuf);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibuf);
glBindBuffer(GL_ARRAY_BUFFER, vbuf);
@@ -451,11 +453,15 @@ void CGEDebugger::UpdatePrimPreview(u32 op, int which) {
glScissor((GLint)x, (GLint)-(y + fh - secondWindow->Height()), (GLsizei)fw, (GLsizei)fh);
BindPreviewProgram(texPreviewProgram);
if (texPreviewVao == 0 && gl_extensions.ARB_vertex_array_object) {
if (texPreviewVao == 0 && vbuf != 0 && ibuf != 0 && gl_extensions.ARB_vertex_array_object) {
glGenVertexArrays(1, &texPreviewVao);
glBindVertexArray(texPreviewVao);
glEnableVertexAttribArray(texPreviewProgram->a_position);
if (ibuf == 0)
glGenBuffers(1, &ibuf);
if (vbuf == 0)
glGenBuffers(1, &vbuf);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibuf);
glBindBuffer(GL_ARRAY_BUFFER, vbuf);

0 comments on commit e90ffdb

Please sign in to comment.