You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my js13k game I am doing Very Bad Things to save precious bytes. One such thing is creating a hash of all available methods like so:
vartmp=[]for(iingl){// First, filter the methods into an arraygl[i].bind&&tmp.push(i)}for(iintmp.sort()){// Then map the sorted methods into the arraygl[i]=gl[tmp[i]].bind(gl)}
This code injects its own new properties (numeric indices) in a deterministic manner, which satisfies a need for additional minification. E.g.:
When the inspector is enabled, the context returned to the application is given a lot of new enumerable properties, which breaks the determinism of the above code. (The code itself is not deterministic, as it relies on a vanilla WebGL context.)
Some examples of the new enumerable properties are:
gl.captureCallbackgl.errorMapgl.rawgl// oh hey, it's the original context that I wanted originallygl.enabledExtensions// ...
IMHO, this isn't so much a bug that is bad because it breaks silly things like what I'm doing. It's more of an issue that it exposes the WebGL Inspector to the application, and violates the following claim in the readme: https://github.com/benvanik/WebGL-Inspector/blame/master/readme.md#L15
Non-destructive to host page - everything happens in a separate GL context
The text was updated successfully, but these errors were encountered:
In my js13k game I am doing Very Bad Things to save precious bytes. One such thing is creating a hash of all available methods like so:
This code injects its own new properties (numeric indices) in a deterministic manner, which satisfies a need for additional minification. E.g.:
When the inspector is enabled, the context returned to the application is given a lot of new enumerable properties, which breaks the determinism of the above code. (The code itself is not deterministic, as it relies on a vanilla WebGL context.)
Some examples of the new enumerable properties are:
See:
WebGL-Inspector/core/host/CaptureContext.js
Lines 167 to 199 in abb6290
IMHO, this isn't so much a bug that is bad because it breaks silly things like what I'm doing. It's more of an issue that it exposes the WebGL Inspector to the application, and violates the following claim in the readme: https://github.com/benvanik/WebGL-Inspector/blame/master/readme.md#L15
The text was updated successfully, but these errors were encountered: