mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Fixes timing of wrap.
This commit is contained in:
parent
b7c407be10
commit
68f9084d9e
@ -228,11 +228,8 @@ void ScanTarget::end_data(size_t actual_length) {
|
||||
&write_area_texture_[size_t(write_pointers_.write_area) * data_type_size_],
|
||||
data_type_size_);
|
||||
|
||||
// The write area was allocated in the knowledge that there's sufficient
|
||||
// distance left on the current line, but there's a risk of exactly filling
|
||||
// the final line, in which case this should wrap back to 0.
|
||||
// Advance to the end of the current run.
|
||||
write_pointers_.write_area += actual_length + 1;
|
||||
write_pointers_.write_area %= (write_area_texture_.size() / data_type_size_);
|
||||
|
||||
// Also bookend the end.
|
||||
memcpy(
|
||||
@ -240,6 +237,11 @@ void ScanTarget::end_data(size_t actual_length) {
|
||||
&write_area_texture_[size_t(write_pointers_.write_area - 2) * data_type_size_],
|
||||
data_type_size_);
|
||||
|
||||
// The write area was allocated in the knowledge that there's sufficient
|
||||
// distance left on the current line, but there's a risk of exactly filling
|
||||
// the final line, in which case this should wrap back to 0.
|
||||
write_pointers_.write_area %= (write_area_texture_.size() / data_type_size_);
|
||||
|
||||
// Record that no further end_data calls are expected.
|
||||
data_is_allocated_ = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user