[BGM Shader] Add a safety check for tweaking framebuffer sizes

This commit is contained in:
Luke Hubmayer-Werner 2024-07-15 01:02:29 +09:30
parent 313872f115
commit 8b006976b4
1 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,9 @@ func _draw() -> void:
var draw_rows: int = self.render_queue[0][1]
rows_drawn += draw_rows
if rows_drawn > OUTPUT_HEIGHT:
if self.waiting_for_viewport.empty():
print('Could not fit %s into %dx%d output framebuffer, it needs %d rows'%[self.render_queue[0][2], OUTPUT_WIDTH, OUTPUT_HEIGHT, draw_rows])
self.render_queue.pop_front()
break
# Draw the next ImageTexture