mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-27 01:31:42 +00:00
Made an attemp to deal with glUnmapBuffer(GL_ARRAY_BUFFER) == GL_FALSE
.
This commit is contained in:
parent
0b1c9fb291
commit
5b37a651ac
@ -206,7 +206,6 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
size_t first_size = InputVertexBufferDataSize - start;
|
size_t first_size = InputVertexBufferDataSize - start;
|
||||||
memcpy(&target[start], &_output_buffer_data[start], first_size);
|
memcpy(&target[start], &_output_buffer_data[start], first_size);
|
||||||
memcpy(target, _output_buffer_data, length - first_size);
|
memcpy(target, _output_buffer_data, length - first_size);
|
||||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -215,10 +214,16 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
if(target)
|
if(target)
|
||||||
{
|
{
|
||||||
memcpy(target, &_output_buffer_data[start], length);
|
memcpy(target, &_output_buffer_data[start], length);
|
||||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while(glUnmapBuffer(GL_ARRAY_BUFFER) == GL_FALSE)
|
||||||
|
{
|
||||||
|
// "the data store contents are undefined. An application must detect this rare condition and reinitialize the data store."
|
||||||
|
uint8_t *target = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, InputVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
||||||
|
memcpy(target, _output_buffer_data, InputVertexBufferDataSize);
|
||||||
|
}
|
||||||
|
|
||||||
_run_builders[run]->amount_of_uploaded_data = _run_builders[run]->amount_of_data;
|
_run_builders[run]->amount_of_uploaded_data = _run_builders[run]->amount_of_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user