Skip to content

tentative changes for supporting memory64 in webgl wrapper #17743

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

Closed
wants to merge 1 commit into from
Closed

tentative changes for supporting memory64 in webgl wrapper #17743

wants to merge 1 commit into from

Conversation

PhM81
Copy link

@PhM81 PhM81 commented Aug 26, 2022

These changes are in no way production ready (most if this is hacked together in order to get a prototype build working). They have allowed me to generate a wasm64 compile of an opengl based rendering engine. These changes also provide the capability to use more than 4GB of heap memory when using the OpenGL api.

@juj
Copy link
Collaborator

juj commented Aug 27, 2022

I have a work in progress PR #15433 that should address these JS library concerns. I should try to bring that up to latest.

@@ -69,7 +69,7 @@ var LibraryEGL = {
} else if (param == 0x3038 /*EGL_NONE*/) {
break;
}
attribList += 8;
attribList += 8n;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general the way we avoid actually having to deal with BigInts in the JS libraries is to use __sig specifiers on the functions that receive the pointers. We use the p specifier within the signature to signify that a paramater or return type is a pointer or size_t value. For example a __sig of vpip would mean a void function that take a pointer, and integer, and another pointer. Then the library code will automatically convert pointers to JS numbers (int53 numbers to be precise) at the boundary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, i think i did change the __sig of some other method in order to get this to work. I think there are a few places in the opengl code which use "i" instead of "p".

@PhM81 PhM81 closed this by deleting the head repository Feb 14, 2023
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.

3 participants