Browse Source

Changed minimum visible viewport size

When the viewport's size.y becomes lower than 2, the storage->frame.current_rt->effects.mip_maps[0].sizes Vector during rendering becomes empty, resulting in crashes in at least GLES3. This is a temporary fix to stop rendering a viewport when its size is below 2 rather than below 1.
Josh Taylor 7 năm trước cách đây
mục cha
commit
892a4b175a
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      servers/visual/visual_server_viewport.cpp

+ 1 - 1
servers/visual/visual_server_viewport.cpp

@@ -268,7 +268,7 @@ void VisualServerViewport::draw_viewports() {
 		ERR_CONTINUE(!vp->render_target.is_valid());
 
 		bool visible = vp->viewport_to_screen_rect != Rect2() || vp->update_mode == VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode == VS::VIEWPORT_UPDATE_ONCE || (vp->update_mode == VS::VIEWPORT_UPDATE_WHEN_VISIBLE && VSG::storage->render_target_was_used(vp->render_target));
-		visible = visible && vp->size.x > 0 && vp->size.y > 0;
+		visible = visible && vp->size.x > 1 && vp->size.y > 1;
 
 		if (!visible)
 			continue;