Open dzil123 opened 2 years ago
ERROR: FATAL: Index p_index = 0 is out of bounds (size() = 0).
at: get (./core/cowdata.h:156)
================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v3.5.beta.custom_build (e2287a201a54a113bb1461cd5997a23cc9c1f50d)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] godots() [0x1851e4a] (/home/runner/work/GodotBuilds/GodotBuilds/godot/platform/x11/crash_handler_x11.cpp:55)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46520) [0x7f77d0b62520] (??:0)
[3] CowData<RasterizerStorageGLES2::RenderTarget::MipMaps::Size>::get(int) const (/home/runner/work/GodotBuilds/GodotBuilds/godot/./core/cowdata.h:156 (discriminator 7))
[4] Vector<RasterizerStorageGLES2::RenderTarget::MipMaps::Size>::operator[](int) const (/home/runner/work/GodotBuilds/GodotBuilds/godot/./core/vector.h:87)
[5] RasterizerSceneGLES2::_post_process(RasterizerSceneGLES2::Environment*, CameraMatrix const&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/drivers/gles2/rasterizer_scene_gles2.cpp:2831)
[6] RasterizerSceneGLES2::render_scene(Transform const&, CameraMatrix const&, int, bool, RasterizerScene::InstanceBase**, int, RID*, int, RID*, int, RID, RID, RID, RID, int) (/home/runner/work/GodotBuilds/GodotBuilds/godot/drivers/gles2/rasterizer_scene_gles2.cpp:3628)
[7] VisualServerScene::_render_scene(Transform, CameraMatrix const&, int, bool, RID, RID, RID, RID, int) (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_scene.cpp:3233)
[8] VisualServerScene::render_camera(RID, RID, Vector2, RID) (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_scene.cpp:2810 (discriminator 2))
[9] VisualServerViewport::_draw_3d(VisualServerViewport::Viewport*, ARVRInterface::Eyes) (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_viewport.cpp:68)
[10] VisualServerViewport::_draw_viewport(VisualServerViewport::Viewport*, ARVRInterface::Eyes) (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_viewport.cpp:109)
[11] VisualServerViewport::draw_viewports() (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_viewport.cpp:351)
[12] VisualServerRaster::draw(bool, double) (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_raster.cpp:117 (discriminator 4))
[13] VisualServerWrapMT::draw(bool, double) (/home/runner/work/GodotBuilds/GodotBuilds/godot/servers/visual/visual_server_wrap_mt.cpp:122)
[14] Main::iteration() (/home/runner/work/GodotBuilds/GodotBuilds/godot/main/main.cpp:2290)
[15] OS_X11::run() (/home/runner/work/GodotBuilds/GodotBuilds/godot/platform/x11/os_x11.cpp:3722)
[16] godots(main+0x329) [0x18480ef] (/home/runner/work/GodotBuilds/GodotBuilds/godot/platform/x11/godot_x11.cpp:57)
[17] /lib/x86_64-linux-gnu/libc.so.6(+0x2dfd0) [0x7f77d0b49fd0] (??:0)
[18] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x7d) [0x7f77d0b4a07d] (??:0)
[19] godots(_start+0x2e) [0x1847d0e] (??:?)
-- END OF BACKTRACE --
================================================================
crash happens because code trying to copy color buffer from destroyed mipmap level to gles2::system_fbo color buffer (gles2::system_fbo sets when Render Direct To Screen mode activated as current_rt->color)
file: rasterizer_scene_gles2.cpp
use_post_process become true value in this place
then makes a copy to system_fbo from non existing mipmap level of current_rt in this place (line 2849)
this happens because in _render_target_allocate code sets the mip_maps_allocated to true, but when mode Render Direct To Screen sets, this flag no reset in _render_target_allocate because function exits early in if condition (on screenshot), but all mipmaps clears and fbo destroyed in _render_target_clear
some update. Crash can be fixed by moving that lines (on screeshot) above if condition. But i'm not shure what that change not breaks anything else. In my case - no viewport image when run currrent scene, just gray screen. When mode Render Direct To Screen disabled, all works fine (via ViewportTexture node)
Godot version
v3.4.2.stable.official.45eaa2daf
System information
Arch Linux (x86_64 latest), GLES2
Issue description
Given a project on GLES2, a Viewport node with Fxaa enabled, a Spatial node and a Camera as a child of the Viewport node: enabling the Viewport node's render_direct_to_screen property will crash the editor.
This occurs on multiple computers with different GPUs, so I don't think the GPU model and driver version are relevant.
Steps to reproduce
Minimal reproduction project
SampleProject.zip