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

Hybrid bindings #19

Closed
maierfelix opened this issue Apr 5, 2019 · 0 comments · Fixed by #22
Closed

Hybrid bindings #19

maierfelix opened this issue Apr 5, 2019 · 0 comments · Fixed by #22
Labels
enhancement New feature or request

Comments

@maierfelix
Copy link
Owner

maierfelix commented Apr 5, 2019

The hybrid-bindings branch contains ongoing efforts into moving Vulkan structures and handles from C++ over to JS. Vulkan function calls and enums remain in C++. Vulkan related C++ memory is filled within JavaScript using TypedArrays, ArrayBuffers and inlined memory offsets (done using pseudo bootstrapping in the code generation process).

Benchmarks with the new hybrid bindings already show some improvements in both memory usage and performance, because the JS->C++ overhead is reduced.

This also results in a reduced package size, less compile times, more flexibility for the interfaces (e.g. error handling) and greatly reduces code complexity in both the code generator and the generated binding code.

Some further notes:

  • Add asm.js for faster memory operations? Further investigate into asm.js context switching performance
  • Strings and Numbers live inside a Structure's memoryBuffer only
  • Structures are now flushed within JavaScript
  • C++ Vulkan Structure reflection gets possibly moved to JavaScript as well

State of 4/13/19:

  • Hybrid bindings tend to be a lot faster than the native bindings
  • Memory usage is now reduced
  • Better error handling
  • Shared memory for nested structures
@maierfelix maierfelix added the enhancement New feature or request label Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant