Skip to content

Avoid GL symbols being added to library as "undefined". NFC#19032

Closed
sbc100 wants to merge 1 commit into
mainfrom
avoid_undefined_gl_sybmols
Closed

Avoid GL symbols being added to library as "undefined". NFC#19032
sbc100 wants to merge 1 commit into
mainfrom
avoid_undefined_gl_sybmols

Conversation

@sbc100

@sbc100 sbc100 commented Mar 22, 2023

Copy link
Copy Markdown
Collaborator

The recordGLProcAddressGet was processing aliases, but it was assuming the aliases existed within the same library file which in was not the case for glGenFramebuffersOES and others in this file that alias symbols in library_webgl.js.

This was resulting the jsifier thinking the symbols was defined (since it existed in the library) but generating undefined symbols in the in the final output such as:

var glGenFramebuffersOES = undefined;

Removing the aliasing resolution from recordGLProcAddressGet lets jsifier.js handle the alias which results in the following output after this change:

var _glGenFramebuffersOES = _glGenFramebuffers;

Also add some assertions so these types of error don't get overlooked in the future.

@sbc100 sbc100 requested review from juj and kripken March 22, 2023 05:30
@sbc100 sbc100 force-pushed the avoid_undefined_gl_sybmols branch 2 times, most recently from 0bbf8c7 to 35cb17f Compare March 22, 2023 05:44
The `recordGLProcAddressGet` was processing aliases, but it was
assuming the aliases existed within the same library file which in
was not the case for `glGenFramebuffersOES` and others in this file
that alias symbols in `library_webgl.js`.

This was resulting the jsifier thinking the symbols was defined (since
it existed in the library) but generating undefined symbols in the
in the final output such as:

```
var glGenFramebuffersOES = undefined;
```

Removing the aliasing resolution from `recordGLProcAddressGet` lets
`jsifier.js` handle the alias which results in the following output
after this change:

```
var _glGenFramebuffersOES = _glGenFramebuffers;
```

Also add some assertions so these types of error don't get overlooked in
the future.
@sbc100 sbc100 force-pushed the avoid_undefined_gl_sybmols branch from 35cb17f to 29582fe Compare March 22, 2023 06:25
@sbc100

sbc100 commented Mar 22, 2023

Copy link
Copy Markdown
Collaborator Author

There is a second part of this change, which is to disallow "undefined" as a valid library element, but I could also revert that part if you don't think its useful?

@sbc100

sbc100 commented Mar 22, 2023

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #19033

@sbc100 sbc100 closed this Mar 22, 2023
@sbc100 sbc100 deleted the avoid_undefined_gl_sybmols branch March 22, 2023 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant