Thank you for reply.
I have try to use the startup sequence both in opengl and dx9 systems.
Code: Select all
1. [Main thread] Call preExtraThreadsStarted()
2. [Main thread] Start other thread, wait
3. [Other thread] Call registerThread(), notify main thread & continue
4. [Main thread] Wake up & call postExtraThreadsStarted()
When using dx9 system, it works nice!
But in opengl system it still crashes.
Code: Select all
void* pBufferData = 0;
if(mCurrentCapabilities->hasCapability(RSC_VBO))
{
mStateCacheManager->bindGLBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB,
static_cast<GLHardwareIndexBuffer*>(
op.indexData->indexBuffer.get())->getGLBufferId());
pBufferData = VBO_BUFFER_OFFSET(
op.indexData->indexStart * op.indexData->indexBuffer->getIndexSize());
}
...
...
GLenum indexType = (op.indexData->indexBuffer->getType() == HardwareIndexBuffer::IT_16BIT) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
do
{
// Update derived depth bias
if (mDerivedDepthBias && mCurrentPassIterationNum > 0)
{
_setDepthBias(mDerivedDepthBiasBase +
mDerivedDepthBiasMultiplier * mCurrentPassIterationNum,
mDerivedDepthBiasSlopeScale);
}
if(hasInstanceData)
{
glDrawElementsInstancedARB(primType, op.indexData->indexCount, indexType, pBufferData, numberOfInstances);
}
else
{
glDrawElements(primType, op.indexData->indexCount, indexType, pBufferData);
}
} while (updatePassIterationRenderState());
Here crashed on glDrawElements(primType, op.indexData->indexCount, indexType, pBufferData).
Code: Select all
Access Conflict Occurs at 0xC0000005: Read Location 0x00000
I'm not sure what happened here.