this fixes "GPU Wait On Buffer" issue found in Xcode Instruments - OpenGL ES Analyzer.

This commit is contained in:
rachytski 2012-11-01 19:01:39 +03:00 committed by Alex Zolotarev
parent e1bf439c7b
commit 8916569f7c

View file

@ -46,7 +46,14 @@ namespace yg
m_size = size;
makeCurrent();
if (g_isBufferObjectsSupported)
{
OGLCHECK(glBufferDataFn(m_target, m_size, 0, GL_DYNAMIC_DRAW));
/// In multithreaded resource usage scenarios the suggested way to see
/// resource update made in one thread to the another thread is
/// to call the glFlush in thread, which modifies resource and then rebind
/// resource in another threads that is using this resource, if any.
OGLCHECK(glFlush());
}
}
}