mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Eliminated a further potential cause of texture/geometry mismatch: the texture retain succeeded but then there wasn't room for geometry.
This commit is contained in:
parent
646622b99e
commit
8ccec37a4b
@ -143,6 +143,9 @@ void CRT::advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bo
|
||||
bool did_retain_source_data = openGL_output_builder_.texture_builder.retain_latest();
|
||||
if(did_retain_source_data) {
|
||||
next_run = openGL_output_builder_.array_builder.get_input_storage(SourceVertexSize);
|
||||
if(!next_run) {
|
||||
openGL_output_builder_.texture_builder.discard_latest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,11 @@ bool TextureBuilder::retain_latest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void TextureBuilder::discard_latest() {
|
||||
if(was_full_) return;
|
||||
number_of_write_areas_--;
|
||||
}
|
||||
|
||||
bool TextureBuilder::is_full() {
|
||||
return is_full_;
|
||||
}
|
||||
|
@ -79,6 +79,9 @@ class TextureBuilder {
|
||||
/// @returns @c true if a retain succeeded; @c false otherwise.
|
||||
bool retain_latest();
|
||||
|
||||
// Undoes the most recent retain_latest. Undefined behaviour if a submission has occurred in the interim.
|
||||
void discard_latest();
|
||||
|
||||
/// @returns @c true if all future calls to @c allocate_write_area will fail on account of the input texture
|
||||
/// being full; @c false if calls may succeed.
|
||||
bool is_full();
|
||||
|
Loading…
Reference in New Issue
Block a user