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

Sought completely to eliminate the outgoing concept of 'clearing zones'.

This commit is contained in:
Thomas Harte 2016-11-16 11:10:34 +08:00
parent 311f8c0b47
commit f63e849092
2 changed files with 5 additions and 13 deletions

View File

@ -111,7 +111,6 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(unsigned int buffer_depth) :
_draw_mutex(new std::mutex),
_visible_area(Rect(0, 0, 1, 1)),
_composite_src_output_y(0),
_cleared_composite_output_y(0),
_composite_shader(nullptr),
_rgb_shader(nullptr),
_last_output_width(0),
@ -228,16 +227,8 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
// bind and flush the source array buffer
GLsizei submitted_source_data = submitArrayData(source_array_buffer, _source_buffer.data.data(), &_source_buffer.pointer);
// determine how many lines are newly reclaimed; they'll need to be cleared
Range clearing_zones[2];
// the clearing zones for the composite output Y are calculated with a fixed offset of '1' which has the effect of clearing
// one ahead of the expected drawing area this frame; that's because the current _composite_src_output_y may or may not have been
// written to during the last update, so we want it to have been cleared during the last update.
int number_of_clearing_zones = getCircularRanges(&_cleared_composite_output_y, &_composite_src_output_y, IntermediateBufferHeight, 1, 1, clearing_zones);
uint16_t completed_texture_y = _buffer_builder->get_and_finalise_current_line();
// upload new source pixels
// upload new source pixels, if any
uint16_t completed_texture_y = _buffer_builder->get_and_finalise_current_line();
if(completed_texture_y)
{
glActiveTexture(source_data_texture_unit);
@ -296,6 +287,7 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
active_pipeline++;
}
}
_composite_src_output_y = 0;
// transfer to framebuffer
framebuffer->bind_framebuffer();

View File

@ -62,7 +62,7 @@ class OpenGLOutputBuilder {
std::unique_ptr<std::mutex> _draw_mutex;
// transient buffers indicating composite data not yet decoded
GLsizei _composite_src_output_y, _cleared_composite_output_y;
GLsizei _composite_src_output_y;
std::unique_ptr<OpenGL::OutputShader> output_shader_program;
std::unique_ptr<OpenGL::IntermediateShader> composite_input_shader_program, composite_separation_filter_program, composite_y_filter_shader_program, composite_chrominance_filter_shader_program;
@ -166,7 +166,7 @@ class OpenGLOutputBuilder {
inline bool composite_output_buffer_is_full()
{
return _composite_src_output_y == _cleared_composite_output_y + IntermediateBufferHeight;
return _composite_src_output_y == IntermediateBufferHeight;
}
inline void increment_composite_output_y()