1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-26 09:29:45 +00:00

Ensured logic for whether composite output is in use is consistent.

This commit is contained in:
Thomas Harte 2017-01-25 21:25:03 -05:00
parent 4d6e78e641
commit c2d7e36c8f
2 changed files with 8 additions and 7 deletions

View File

@ -83,6 +83,11 @@ OpenGLOutputBuilder::~OpenGLOutputBuilder()
free(rgb_shader_);
}
bool OpenGLOutputBuilder::get_is_television_output()
{
return output_device_ == Television || !rgb_input_shader_program_;
}
void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int output_height, bool only_if_dirty)
{
// lock down any other draw_frames
@ -171,7 +176,7 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
{nullptr}
};
RenderStage *active_pipeline = (output_device_ == Television || !rgb_input_shader_program_) ? composite_render_stages : rgb_render_stages;
RenderStage *active_pipeline = get_is_television_output() ? composite_render_stages : rgb_render_stages;
if(array_submission.input_size || array_submission.output_size)
{
@ -428,12 +433,7 @@ void OpenGLOutputBuilder::set_output_shader_width()
{
if(output_shader_program_)
{
float width = 1.0f;
switch(output_device_)
{
case Television: width = get_composite_output_width(); break;
case Monitor: width = 1.0f; break;
}
const float width = get_is_television_output() ? get_composite_output_width() : 1.0f;
output_shader_program_->set_input_width_scaler(width);
}
}

View File

@ -96,6 +96,7 @@ class OpenGLOutputBuilder {
GLsync fence_;
float get_composite_output_width() const;
void set_output_shader_width();
bool get_is_television_output();
public:
// These two are protected by output_mutex_.