Skip to content
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

Find a way to aviod copying buffer for gl.bufferData and gl.texImage2D. #14

Closed
zwcloud opened this issue Nov 5, 2018 · 3 comments
Closed

Comments

@zwcloud
Copy link
Owner

zwcloud commented Nov 5, 2018

Investigate emscripten.

@zwcloud
Copy link
Owner Author

zwcloud commented Nov 5, 2018

Possible solution 1
Use emscripten memory as an ArrayBufferView and access it from C# via mono/wasm.

Directly access emscripten memory as an ArrayBufferView is currently not directly impossible because it is blocked by kripken/emscripten#6747.
A possible workaround is to re-get the ArrayBufferView from Module.HEAPF32.buffer:

if (Module.HEAPF32.buffer !== b) { b = Module.HEAPF32.buffer; view = ...; }

See the gitter archive on 2018/11/06 for details.

@zwcloud
Copy link
Owner Author

zwcloud commented Nov 5, 2018

Possible solution 2
Create, write and read an ArrayBufferView from C# via mono/wasm.

See https://github.com/sq/FNA/blob/c3803c30fb3e96137d2a8f56e5128072bdb4281b/src/Platform/JSIL.cs#L60
Also, by kg

iirc they already have implementations of EA in spidermonkey and v8 that just aren't always enabled due to bugs.

@zwcloud
Copy link
Owner Author

zwcloud commented Nov 18, 2018

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

No branches or pull requests

1 participant