mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +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:
parent
3d7a3ce995
commit
ef83595af3
@ -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)
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user