1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-28 09:54:49 +00:00

Corrects QAM texture generation logic.

This commit is contained in:
Thomas Harte 2019-02-09 17:20:13 -05:00
parent 1cd6d58f17
commit b3b4b7cf0c

View File

@ -308,20 +308,20 @@ void ScanTarget::setup_pipeline() {
// Destroy or create a QAM buffer and shader, if appropriate.
const bool needs_qam_buffer = (modals_.display_type == DisplayType::CompositeColour || modals_.display_type == DisplayType::SVideo);
if(needs_qam_buffer && !qam_chroma_texture_) {
qam_chroma_texture_.reset(new TextureTarget(LineBufferWidth, LineBufferHeight, QAMChromaTextureUnit, GL_NEAREST, false));
} else {
qam_chroma_texture_.reset();
qam_separation_shader_.reset();
}
if(needs_qam_buffer) {
if(!qam_chroma_texture_) {
qam_chroma_texture_.reset(new TextureTarget(LineBufferWidth, LineBufferHeight, QAMChromaTextureUnit, GL_NEAREST, false));
}
qam_separation_shader_ = qam_separation_shader();
glBindVertexArray(line_vertex_array_);
glBindBuffer(GL_ARRAY_BUFFER, line_buffer_name_);
enable_vertex_attributes(ShaderType::QAMSeparation, *qam_separation_shader_);
set_uniforms(ShaderType::QAMSeparation, *qam_separation_shader_);
qam_separation_shader_->set_uniform("textureName", GLint(UnprocessedLineBufferTextureUnit - GL_TEXTURE0));
} else {
qam_chroma_texture_.reset();
qam_separation_shader_.reset();
}
// Establish an output shader.