gl_engine: ++safety

This commit is contained in:
Hermet Park 2025-06-17 18:52:07 +09:00 committed by Mira Grudzinska
parent 56f6a8672b
commit 212e888725

View file

@ -985,12 +985,13 @@ bool GlRenderer::sync()
RenderRegion GlRenderer::region(RenderData data)
{
if (currentPass()->isEmpty()) return {};
auto pass = currentPass();
if (!data || !pass || pass->isEmpty()) return {};
auto shape = reinterpret_cast<GlShape*>(data);
auto bounds = shape->geometry->getBounds();
auto const& vp = currentPass()->getViewport();
auto const& vp = pass->getViewport();
bounds.intersect(vp);
return bounds;