1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00

Fixed: issue was (i) always thinking the entire source run buffer needed to be issued; and (ii) having fixed that, always thinking that the block that needs redrawing doesn't overflow the buffer. Fixed both. 'Television' mode is now working without explicit synchronisation (and with a lot less work).

This commit is contained in:
Thomas Harte 2016-04-19 22:38:11 -04:00
parent 3d7a3ce995
commit ef83595af3
2 changed files with 3 additions and 3 deletions

View File

@ -209,7 +209,7 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
glDisable(GL_BLEND);
size_t new_data_size = _drawn_source_buffer_data_pointer - _source_buffer_data_pointer;
size_t new_data_size = _source_buffer_data_pointer - _drawn_source_buffer_data_pointer;
size_t new_data_start = _drawn_source_buffer_data_pointer;
_source_buffer_data_pointer %= SourceVertexBufferDataSize;
_drawn_source_buffer_data_pointer = _source_buffer_data_pointer;
@ -220,7 +220,7 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
new_data_start = 0;
}
size_t first_data_length = std::max(SourceVertexBufferDataSize - new_data_start, new_data_size);
size_t first_data_length = std::min(SourceVertexBufferDataSize - new_data_start, new_data_size);
glDrawArrays(GL_LINES, (GLint)(new_data_start / SourceVertexSize), (GLsizei)(first_data_length / SourceVertexSize));
if(new_data_size > first_data_length)
{

View File

@ -116,7 +116,7 @@ class OpenGLOutputBuilder {
inline void complete_source_run()
{
_source_buffer_data_pointer += 2 * SourceVertexSize;;
_source_buffer_data_pointer += 2 * SourceVertexSize;
_output_mutex->unlock();
}