Skip to content

Commit

Permalink
Merge pull request KhronosGroup#26 from prestomation/master
Browse files Browse the repository at this point in the history
Modularize emscripten build.
  • Loading branch information
richgel999 committed Jun 26, 2019
2 parents bbbce07 + 39b5c5b commit 087198f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions webgl/gltf/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<body>
<script>
Module.onRuntimeInitialized = () => {
BASIS().then(Module => {

const { BasisFile, initializeBasis } = Module;

Expand Down Expand Up @@ -97,7 +97,7 @@

}, false );

}
});

function log(s) {

Expand Down
4 changes: 2 additions & 2 deletions webgl/texture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<div id='logger'></div>
</body>
<script>
Module.onRuntimeInitialized = () => {
BASIS({onRuntimeInitialized : () => {
var gl = elem('canvas').getContext('webgl');
// Load the DXT extension, and verify it exists.
if (!gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc') && !gl.getExtension('WEBGL_compressed_texture_s3tc')) {
Expand All @@ -275,6 +275,6 @@
}, false);

runLoadFile();
}
}}).then(module => window.Module = module);
</script>
</html>
2 changes: 1 addition & 1 deletion webgl/transcoder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ if (EMSCRIPTEN)
set_target_properties(basis_transcoder.js PROPERTIES
OUTPUT_NAME "basis_transcoder"
SUFFIX ".js"
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -s MALLOC=emmalloc")
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -s MALLOC=emmalloc -s MODULARIZE=1 -s EXPORT_NAME=BASIS ")
endif()
22 changes: 21 additions & 1 deletion webgl/transcoder/build/basis_transcoder.js

Large diffs are not rendered by default.

Binary file modified webgl/transcoder/build/basis_transcoder.wasm
Binary file not shown.

0 comments on commit 087198f

Please sign in to comment.