godot icon indicating copy to clipboard operation
godot copied to clipboard

Duplicated [self drawView] in iphone gl_view

Open sanja-sa opened this issue 9 years ago • 12 comments

iOS IPhone 5 (32 bit), Godot 2.1.2

in file /platform/iphone/gl_view.mm

314	[self drawView];
315	[self drawView];

It's right? With this dublication I have fuzzy crash on change orientation.

sanja-sa avatar Mar 04 '17 13:03 sanja-sa

@sanja-sa I'm not actually iOS guy. So, I can't say it's right or wrong. but did you test your project is fine with removing 315 line?

volzhs avatar Mar 04 '17 14:03 volzhs

In that case i have crash on string 451 in file /platform/iphone/gl_view.mm

- (void)drawView
{
	if (useCADisplayLink) {
		// Pause the CADisplayLink to avoid recursion
		[displayLink setPaused: YES];

		// Process all input events
		while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource);  <<-- Crash here

If I have delete 315 string - seems like ok. But there is a need to test on multiple devices. My property settings: clipboard01

sanja-sa avatar Mar 06 '17 07:03 sanja-sa

@punto- Ping :smiley:

bojidar-bg avatar Mar 06 '17 11:03 bojidar-bg

It was added in this PR: #2461

Note that the duplicated "[self drawView];" line in gl_view.mm is deliberate. This prevents first frame from being drawn black, and causing a brief black screen between launch image and splash screen.

That still sounds pretty bogus to me.

akien-mga avatar Mar 06 '17 11:03 akien-mga

Any update on this? I get the same issues with 2.1.3 build on iOS. There seem to be other issues with orientation changes on iOS as well. I've opened a new issue https://github.com/godotengine/godot/issues/9295

FuzzyRhombus avatar Jun 20 '17 18:06 FuzzyRhombus

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

kubecz3k avatar Apr 10 '18 17:04 kubecz3k

Godot 2.1.5 RC bug still present and with changing orintation too issue: #9295

sanja-sa avatar Jul 23 '18 10:07 sanja-sa

This seems still relevant in the current master branch (09e94aa). CC @godotengine/ios. It doesn't seem to be handled in #22784 either.

akien-mga avatar Apr 15 '19 15:04 akien-mga

I am having the same problem in 3.1.1. stable (reported also here: https://github.com/godotengine/godot/issues/32149) -- is this planned to be fixed in 3.2?

AlexRixhardson avatar Sep 15 '19 21:09 AlexRixhardson

@AlexRixhardson Were you able to apply the proposed change locally? (That is, removing the duplicated [self drawView]; call.) See Compiling on iOS for instructions on compiling iOS export templates.

If so, can you confirm it solves the crash while avoiding a brief black screen as stated in #2461?

Calinou avatar Sep 15 '19 21:09 Calinou

@Calinou I made tests on 3.2 master branch (commit 3e782c78a) and found out the following:

  1. there is a brief black screen between launch image and main scene regardless of the number of [self drawView]; calls
  2. I cannot reproduce the crash if I remove the 2nd [self drawView]; call
  3. moreover, I cannot see any difference if I remove all [self drawView]; calls from layoutSubviews function

Why are we even calling drawView method in layoutSubviews?

I propose that function layoutSubviews gets changed into this:

- (void)layoutSubviews {
	[EAGLContext setCurrentContext:context];
	[self destroyFramebuffer];
	[self createFramebuffer];
}

This way we get rid of unnecessary [self drawView]; calls (and comment //printf("HERE\n"); which has no purpose) with related crashes without loosing any of the functionality. As said, there is a brief black screen regardless of the number of [self drawView]; calls in the layoutSubviews function, and I cannot see any change in behaviour even if I remove all [self drawView]; calls. If anyone knows why that should be there, then I propose we leave only one call, since the 2nd call is obviously causing crashes.

Tested on iPad Mini 2 and iPhone Xr.

AlexRixhardson avatar Sep 17 '19 20:09 AlexRixhardson

Some additional info: after some more testing, I was able to reproduce the crash if I eliminated the second (duplicated) call only. It just takes more time to reproduce than with duplicated calls. I was able to reproduce the crash on iPhone Xr. So, I made a patch where I eliminated both calls, as described in my previous comment.

Pull request is available here: https://github.com/godotengine/godot/pull/32194

I would appreciate if others could test this as well and include it in version 3.2.

AlexRixhardson avatar Sep 18 '19 21:09 AlexRixhardson