From f63e8490929892650d60f407521be05d61bd92e1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 16 Nov 2016 11:10:34 +0800 Subject: [PATCH] Sought completely to eliminate the outgoing concept of 'clearing zones'. --- Outputs/CRT/Internals/CRTOpenGL.cpp | 14 +++----------- Outputs/CRT/Internals/CRTOpenGL.hpp | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Outputs/CRT/Internals/CRTOpenGL.cpp b/Outputs/CRT/Internals/CRTOpenGL.cpp index beadc565c..8781b6fc7 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.cpp +++ b/Outputs/CRT/Internals/CRTOpenGL.cpp @@ -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(); diff --git a/Outputs/CRT/Internals/CRTOpenGL.hpp b/Outputs/CRT/Internals/CRTOpenGL.hpp index 295d74fa7..fca1e6532 100644 --- a/Outputs/CRT/Internals/CRTOpenGL.hpp +++ b/Outputs/CRT/Internals/CRTOpenGL.hpp @@ -62,7 +62,7 @@ class OpenGLOutputBuilder { std::unique_ptr _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 output_shader_program; std::unique_ptr 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()