-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Version 168 accessing undefined variable in onContextRestore #29434
Comments
I suspect the error happens because your system produces a WebGL context loss in the first place. The engine automatically tries to restore the context ( What console output do you get with the following fiddle? https://jsfiddle.net/jkod6qz2/ |
@Mugen87 why are you suspecting it? I hate to hear that because people in the area I live say that about any thing and are always talking about how they persecute people through the processes of the product's work, then say they are suspecting it. The real truth the majority of the time is that they are eventually unable to explain the difference. You may not be that way, but the truth of this issue is that when the context is lost the three.js module should not continue trying to access variables and properties that are not available. If there is a WebGL context loss, any running loop, event, interval or callback that attempts to access that Why would you not fix that problem, the system is allowed to lose the WebGL context and the three.js module should not fail or lock the cpu when the WebGL context is lost. |
Would you please answer my question and tell us what console output you are getting on your system?
|
Next time it happens and the Safari Web Inspector doesn't close by itself before then, sure. It's a cable connected iPad and the console is on a laptop sitting next to it. There is no console on the iPad itself and the "remote" one closes without reporting why and preserve logs doesn't do anything if the iPad safari refreshes before I look at it.
The checks for That is why you need to use It's really about mapping out each possibility and testing for it, because that can be known but is much work. I think you are only considering the word performance and not the actual amount of time taken by a It would be a different truth if you were using |
Even if you This you learn when you try to get hardware instruction counters and find out that they don't exist in Javascript. Javascript's https://man7.org/linux/man-pages/man2/perf_event_open.2.html |
That fiddle does not remove and re-add The 2 invalid variable access errors I showed you already remain to happen when the three.js code removes and re-adds |
This is really all that's needed. function getMaxPrecision( precision ) {
if (gl === null) {
return null;
}
if ( precision === 'highp' ) {
if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 &&
gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) {
return 'highp';
}
precision = 'mediump';
}
if ( precision === 'mediump' ) {
if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 &&
gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) {
return 'mediump';
}
}
return 'lowp';
}
A return value of |
I made those changes to Once some days of testing pass, I'll update you with the results @Mugen87. It is only happening on the iPad in Safari with the latest iOS 18 per the hardware I have available for testing. |
Into the second day now without refreshing the document, it sure has not happened again with the |
Description
https://github.com/mrdoob/three.js/blob/111670613f1c475ed6e9c2d15056f960f0ad6f1b/build/three.module.js#L29320
In
three.module.min.js
this code is minified and as shown in this screenshot:info.autoReset
ortt.autoReset
is not accessible asinfo
ortt
is undefined.Reproduction steps
Code
This is only a group of meshes displayed and removed repeatedly.
Once the WebGL context is lost, this error happens.
Live example
Screenshots
No response
Version
168
Device
Mobile
Browser
Safari
OS
iOS
The text was updated successfully, but these errors were encountered: