mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-11 04:28:58 +00:00
Resolved output errors.
This commit is contained in:
parent
10bc33464d
commit
2e4af90e2d
@ -24,7 +24,8 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(unsigned int number_of_buffers, va_list
|
|||||||
_composite_src_output_y(0),
|
_composite_src_output_y(0),
|
||||||
_composite_shader(nullptr),
|
_composite_shader(nullptr),
|
||||||
_rgb_shader(nullptr),
|
_rgb_shader(nullptr),
|
||||||
_output_buffer_data(nullptr)
|
_output_buffer_data(nullptr),
|
||||||
|
_output_buffer_sync(nullptr)
|
||||||
{
|
{
|
||||||
_run_builders = new CRTRunBuilder *[NumberOfFields];
|
_run_builders = new CRTRunBuilder *[NumberOfFields];
|
||||||
for(int builder = 0; builder < NumberOfFields; builder++)
|
for(int builder = 0; builder < NumberOfFields; builder++)
|
||||||
@ -194,6 +195,12 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
|
|
||||||
if(start + length > InputVertexBufferDataSize)
|
if(start + length > InputVertexBufferDataSize)
|
||||||
{
|
{
|
||||||
|
if(_output_buffer_sync)
|
||||||
|
{
|
||||||
|
glWaitSync(_output_buffer_sync, 0, GL_TIMEOUT_IGNORED);
|
||||||
|
glDeleteSync(_output_buffer_sync);
|
||||||
|
}
|
||||||
|
_output_buffer_sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
target = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, InputVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
target = (uint8_t *)glMapBufferRange(GL_ARRAY_BUFFER, 0, InputVertexBufferDataSize, GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT);
|
||||||
memcpy(&target[start], &_output_buffer_data[start], InputVertexBufferDataSize - start);
|
memcpy(&target[start], &_output_buffer_data[start], InputVertexBufferDataSize - start);
|
||||||
memcpy(target, _output_buffer_data, length - (InputVertexBufferDataSize - start));
|
memcpy(target, _output_buffer_data, length - (InputVertexBufferDataSize - start));
|
||||||
|
@ -142,8 +142,7 @@ class OpenGLOutputBuilder {
|
|||||||
{
|
{
|
||||||
_output_mutex->lock();
|
_output_mutex->lock();
|
||||||
uint8_t *pointer = &_output_buffer_data[_output_buffer_data_pointer];
|
uint8_t *pointer = &_output_buffer_data[_output_buffer_data_pointer];
|
||||||
_output_buffer_data_pointer += 6 * InputVertexSize;
|
_output_buffer_data_pointer = (_output_buffer_data_pointer + 6 * InputVertexSize) % InputVertexBufferDataSize;
|
||||||
if(_output_buffer_data_pointer > InputVertexBufferDataSize) _output_buffer_data_pointer = 0;
|
|
||||||
return pointer;
|
return pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user