-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Game crashes if it has a 3D camera and windowsize is reduced to 1 pixel wide/tall. #19628
Comments
Hi, I can confirm this bug using master from 5c5aafa I could trace it down to RasterizerSceneGLES3::_post_process in file drivers/gles3/rasterizer_scene_gles3.cpp Here is the result of exporting test project in debug and reducing window's height down to 0 : Only solution I found to limit this problem was to add if (storage->frame.current_rt->effects.mip_maps[0].sizes.size() == 0)
return; just before if (storage->frame.current_rt->buffers.active) {
//transfer to effect buffer if using buffers, also resolve MSAA in function But I think the real solution would be to find why the array storage->frame.current_rt->effects.mip_maps[0].sizes becomes null... am I wrong ? |
I also found what @malbach found using Visual Studio's debugger. I verified that the sizes vector is coming into the _post_process method empty when the height of the viewport is set to 0 by setting a conditional breakpoint in Visual Studio at the top of the method for when sizes._ptr is null. Therefore, it's happening somewhere else in the code base. I tried a few things, but couldn't find a fix. |
Hi, This function returns directly if width or height is <=0, thus not allocating what's necessary for For reference, this bug has already been reported in #19207 |
So, I just set a conditional breakpoint on the following line of draw_viewports() in visual_server_viewport.cpp to trigger whenever the viewport size is less than 2:
It triggers when size.y is 1 as expected when I shrink down the window height. I was able to fix the crashing by changing that line I referenced above to the following:
I think this is an acceptable and simple enough tradeoff (it skips rendering viewports with a width or height less than 2) to prevent the crashes for now, and I will likely put in a PR referencing this issue to see what the devs think about making this tradeoff. I am very curious why a 1 height viewport is causing the mipmap sizes to go away. I tried changing some things in methods like _render_target_allocate() to see if the sizes Vector would stop being empty to no avail. Again, until the true root cause is identified, I think my proposed change is worth the tradeoff. |
I'm at build 1fc7973, which includes #20026 and I'm still experiencing this problem (with 2D project) - it crashes as soon as window height is dragged down to 0 with:
|
Hi, if (rt->width <= 0 || rt->height <= 0)
return; with rt->width = rt->width > 0 ? rt->width : 1;
rt->height = rt->height > 0 ? rt->height : 1; |
@malbach compiled with patch, didn't help. Still crashed with same error. |
@lekoder ok thx for the test |
@malbach I did now, it did not help either. |
Hi, |
I'm sorry my fix didn't solve the issue. It stopped crashing for me after making the change in my PR, but obviously there's more to the issue than I had anticipated. I hope someone can figure this out, as I can no longer reproduce the crashing on my computer. I'm on Windows 10 with Intel graphics right now. |
@taylorjoshuaw you are correct, your PR fixed some of the issues - minimal project no longer crashes. I managed to narrow down my issue down to Switching to GLES2 also helps. Hardware reference: I'm testing with Windows 10 with Intel UHD Graphics 630 and with GTX1070. |
I should correct my own previous statement : it's also crashing in X11 with glow enabled 😢 glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[i + 1].fbo); //next level, since mipmaps[0] starts one level bigger in file rasterizer_scene_gles3.cpp (around line 3931). My first try was simply if (storage->frame.current_rt->effects.mip_maps[0].sizes.size() > i + 1)
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[i + 1].fbo); //next level, since mipmaps[0] starts one level bigger
else
glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); and no more crash no matter how I resized the window, but it's like the first bug from the OP, I just put a patch, not a solution 🤔 |
I get the same crash on iOS, but with a full sized viewport (1024x600 pixels or larger). I've attached a minimal scene file below, which can be dropped into any project with default settings. The mesh and the light are not instrumental in the crash; they can be removed. The scene works fine on my MacBook Pro, but crashes at Leading to the crash, I get half a dozen of the following error message: By the way, this is on an iPhone 6s, and an earlier line in the programs output says |
Cherry-picked for 3.0.7. |
(cherry picked from commit a78b42c)
Godot version:
Godot 3.0.3
OS/device including version:
Ubuntu 18.04 64bit on AMD Cayman (HD 6950) and Mesa 18.0.0-rc5.
Intel® Core™ i5-4570 CPU @ 3.20GHz × 4
Issue description:
In a 3d scene with camera, if scene is played in windowed mode and the user reduces the size of the window to 1 pixel (or less) tall or wide, the game will silently crash.
This bug gives the following terminal output when launched from Godot editor
This bug gives the following terminal output when the project is exported and launched directly.
Steps to reproduce:
Minimal reproduction project:
TinyWindowBug.zip
The text was updated successfully, but these errors were encountered: