From 2f90f35478c41a0e3742e09167ecbf8b50f2cf1b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Jul 2017 23:37:44 -0400 Subject: [PATCH] =?UTF-8?q?Ensured=20the=20same=20write=20area=20can=20be?= =?UTF-8?q?=20submitted=20multiple=20times=20=E2=80=94=20this=20is=20activ?= =?UTF-8?q?ely=20used=20if=20a=20run=20of=20data=20overlaps=20a=20flywheel?= =?UTF-8?q?-suggested=20sync.=20Which=20nullifies=20the=20idea=20of=20not?= =?UTF-8?q?=20having=20a=20write=20area=20in=20the=20barrel,=20at=20least?= =?UTF-8?q?=20as=20soon=20as=20any=20one=20has=20been=20allocated.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Outputs/CRT/Internals/TextureBuilder.cpp | 8 ++------ Outputs/CRT/Internals/TextureBuilder.hpp | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Outputs/CRT/Internals/TextureBuilder.cpp b/Outputs/CRT/Internals/TextureBuilder.cpp index 6df0a7ab8..98371bd4d 100644 --- a/Outputs/CRT/Internals/TextureBuilder.cpp +++ b/Outputs/CRT/Internals/TextureBuilder.cpp @@ -39,7 +39,6 @@ TextureBuilder::TextureBuilder(size_t bytes_per_pixel, GLenum texture_unit) : write_areas_start_y_(0), is_full_(false), did_submit_(false), - has_write_area_(false), number_of_write_areas_(0) { image_.resize(bytes_per_pixel * InputBufferBuilderWidth * InputBufferBuilderHeight); glGenTextures(1, &texture_name_); @@ -87,7 +86,6 @@ uint8_t *TextureBuilder::allocate_write_area(size_t required_length) { write_area_.x = starting_x + 1; write_area_.y = starting_y; write_area_.length = (uint16_t)required_length; - has_write_area_ = true; return pointer_to_location(write_area_.x, write_area_.y); } @@ -97,17 +95,16 @@ bool TextureBuilder::is_full() { } void TextureBuilder::retain_latest() { - if(is_full_ || !has_write_area_) return; + if(is_full_) return; if(number_of_write_areas_ < write_areas_.size()) write_areas_[number_of_write_areas_] = write_area_; else write_areas_.push_back(write_area_); number_of_write_areas_++; - has_write_area_ = false; } void TextureBuilder::reduce_previous_allocation_to(size_t actual_length) { - if(is_full_ || !has_write_area_) return; + if(is_full_) return; write_area_.length = (uint16_t)actual_length; @@ -174,6 +171,5 @@ void TextureBuilder::flush(const std::function } did_submit_ = false; - has_write_area_ = false; number_of_write_areas_ = 0; } diff --git a/Outputs/CRT/Internals/TextureBuilder.hpp b/Outputs/CRT/Internals/TextureBuilder.hpp index aa51a19fe..88b95ee19 100644 --- a/Outputs/CRT/Internals/TextureBuilder.hpp +++ b/Outputs/CRT/Internals/TextureBuilder.hpp @@ -101,7 +101,6 @@ class TextureBuilder { size_t number_of_write_areas_; bool is_full_; bool did_submit_; - bool has_write_area_; inline uint8_t *pointer_to_location(uint16_t x, uint16_t y); // Usually: the start position for the current batch of write areas.