mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-11 04:28:58 +00:00
Sought completely to eliminate the outgoing concept of 'clearing zones'.
This commit is contained in:
parent
311f8c0b47
commit
f63e849092
@ -111,7 +111,6 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(unsigned int buffer_depth) :
|
|||||||
_draw_mutex(new std::mutex),
|
_draw_mutex(new std::mutex),
|
||||||
_visible_area(Rect(0, 0, 1, 1)),
|
_visible_area(Rect(0, 0, 1, 1)),
|
||||||
_composite_src_output_y(0),
|
_composite_src_output_y(0),
|
||||||
_cleared_composite_output_y(0),
|
|
||||||
_composite_shader(nullptr),
|
_composite_shader(nullptr),
|
||||||
_rgb_shader(nullptr),
|
_rgb_shader(nullptr),
|
||||||
_last_output_width(0),
|
_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
|
// bind and flush the source array buffer
|
||||||
GLsizei submitted_source_data = submitArrayData(source_array_buffer, _source_buffer.data.data(), &_source_buffer.pointer);
|
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
|
// upload new source pixels, if any
|
||||||
Range clearing_zones[2];
|
uint16_t completed_texture_y = _buffer_builder->get_and_finalise_current_line();
|
||||||
|
|
||||||
// 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
|
|
||||||
if(completed_texture_y)
|
if(completed_texture_y)
|
||||||
{
|
{
|
||||||
glActiveTexture(source_data_texture_unit);
|
glActiveTexture(source_data_texture_unit);
|
||||||
@ -296,6 +287,7 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
active_pipeline++;
|
active_pipeline++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_composite_src_output_y = 0;
|
||||||
|
|
||||||
// transfer to framebuffer
|
// transfer to framebuffer
|
||||||
framebuffer->bind_framebuffer();
|
framebuffer->bind_framebuffer();
|
||||||
|
@ -62,7 +62,7 @@ class OpenGLOutputBuilder {
|
|||||||
std::unique_ptr<std::mutex> _draw_mutex;
|
std::unique_ptr<std::mutex> _draw_mutex;
|
||||||
|
|
||||||
// transient buffers indicating composite data not yet decoded
|
// 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::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;
|
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()
|
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()
|
inline void increment_composite_output_y()
|
||||||
|
Loading…
Reference in New Issue
Block a user