1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Eliminate deferred uniform sets.

This commit is contained in:
Thomas Harte
2026-02-02 09:08:50 -05:00
parent 3a02b2b6c0
commit 15cced59e5
3 changed files with 49 additions and 114 deletions
+13 -13
View File
@@ -673,23 +673,23 @@ void ScanTarget::update(int, int output_height) {
void ScanTarget::draw(int output_width, int output_height) {
while(is_drawing_to_accumulation_buffer_.test_and_set(std::memory_order_acquire));
// if(accumulation_texture_) {
// // Copy the accumulation texture to the target.
// test_gl([&]{ glBindFramebuffer(GL_FRAMEBUFFER, target_framebuffer_); });
// test_gl([&]{ glViewport(0, 0, (GLsizei)output_width, (GLsizei)output_height); });
//
// test_gl([&]{ glClearColor(0.0f, 0.0f, 0.0f, 0.0f); });
// test_gl([&]{ glClear(GL_COLOR_BUFFER_BIT); });
// accumulation_texture_->bind_texture();
// accumulation_texture_->draw(float(output_width) / float(output_height), 4.0f / 255.0f);
// }
if(!composition_buffer_.empty()) {
if(accumulation_texture_) {
// Copy the accumulation texture to the target.
test_gl([&]{ glBindFramebuffer(GL_FRAMEBUFFER, target_framebuffer_); });
test_gl([&]{ glViewport(0, 0, (GLsizei)output_width, (GLsizei)output_height); });
composition_buffer_.draw(float(output_width) / float(output_height), 4.0f / 255.0f);
test_gl([&]{ glClearColor(0.0f, 0.0f, 0.0f, 0.0f); });
test_gl([&]{ glClear(GL_COLOR_BUFFER_BIT); });
accumulation_texture_->bind_texture();
accumulation_texture_->draw(float(output_width) / float(output_height), 4.0f / 255.0f);
}
// if(!composition_buffer_.empty()) {
// // Copy the accumulation texture to the target.
// test_gl([&]{ glBindFramebuffer(GL_FRAMEBUFFER, target_framebuffer_); });
// test_gl([&]{ glViewport(0, 0, (GLsizei)output_width, (GLsizei)output_height); });
// composition_buffer_.draw(float(output_width) / float(output_height), 4.0f / 255.0f);
// }
is_drawing_to_accumulation_buffer_.clear(std::memory_order_release);
}