Select complete source LOD explicitly and reject renderer allocation failures

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 22:24:46 +03:00
parent 16865574d0
commit 37d6f90456
5 changed files with 59 additions and 8 deletions
+19
View File
@@ -37,3 +37,22 @@ def scene_diagnostics(count, source_bytes):
except Exception as exc:
value["capacity_unavailable"] = type(exc).__name__
return value
class RendererMemoryGuard:
"""A reported allocation failure invalidates the scene, even if Kit keeps running."""
def __init__(self, log):
self.log, self.offset, self.tail = log, 0, b""
def check(self):
with self.log.open("rb") as stream:
stream.seek(self.offset)
while chunk := stream.read(65536):
content = self.tail + chunk
if (b"ERROR_OUT_OF_DEVICE_MEMORY" in content or
b"Out of GPU memory allocating resource" in content):
raise ScenePreparationError(
"Недостаточно видеопамяти для полной сцены выбранной детализации. "
"Прогон остановлен: корректность изображения не подтверждена.")
self.tail = content[-128:]
self.offset = stream.tell()