Skip to content

Commit 4c3a66e

Browse files
committed
opengl support for memory64
1 parent 7301dcd commit 4c3a66e

File tree

7 files changed

+253
-163
lines changed

7 files changed

+253
-163
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,3 +592,4 @@ a license to everyone to use it as detailed in LICENSE.)
592592
* Alexandra Cherdantseva <[email protected]>
593593
* Michael Schmuki <[email protected]>
594594
* Skye Gibney <[email protected]>
595+
* Philipp Muigg <[email protected]> (copyright owned by Siemens)

emcc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,10 +2854,11 @@ def get_full_import_name(name):
28542854

28552855
# check if we can address the 2GB mark and higher: either if we start at
28562856
# 2GB, or if we allow growth to either any amount or to 2GB or more.
2857-
if settings.INITIAL_MEMORY > 2 * 1024 * 1024 * 1024 or \
2858-
(settings.ALLOW_MEMORY_GROWTH and
2859-
(settings.MAXIMUM_MEMORY < 0 or
2860-
settings.MAXIMUM_MEMORY > 2 * 1024 * 1024 * 1024)):
2857+
if settings.MEMORY64 == 0 and \
2858+
(settings.INITIAL_MEMORY > 2 * 1024 * 1024 * 1024 or
2859+
(settings.ALLOW_MEMORY_GROWTH and
2860+
(settings.MAXIMUM_MEMORY < 0 or
2861+
settings.MAXIMUM_MEMORY > 2 * 1024 * 1024 * 1024))):
28612862
settings.CAN_ADDRESS_2GB = 1
28622863

28632864
settings.EMSCRIPTEN_VERSION = shared.EMSCRIPTEN_VERSION

src/embind/embind.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,11 @@ var LibraryEmbind = {
445445
} else {
446446
throw new TypeError("Unknown boolean type size: " + name);
447447
}
448+
#if MEMORY64
449+
return this['fromWireType'](heap[pointer / (1 << shift)]);
450+
#else
448451
return this['fromWireType'](heap[pointer >> shift]);
452+
#endif
449453
},
450454
destructorFunction: null, // This type does not need a destructor
451455
});

src/library_html5.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,10 @@ var LibraryHTML5 = {
524524
if (targetThread) {
525525
var mouseEventData = _malloc( {{{ C_STRUCTS.EmscriptenMouseEvent.__size__ }}} ); // This allocated block is passed as satellite data to the proxied function call, so the call frees up the data block when done.
526526
fillMouseEventData(mouseEventData, e, target);
527-
JSEvents.queueEventHandlerOnThread_iiii(targetThread, callbackfunc, eventTypeId, mouseEventData, userData);
527+
JSEvents.queueEventHandlerOnThread_iipp(targetThread, callbackfunc, eventTypeId, mouseEventData, userData);
528528
} else
529529
#endif
530-
if ({{{ makeDynCall('iiii', 'callbackfunc') }}}(eventTypeId, JSEvents.mouseEvent, userData)) e.preventDefault();
530+
if ({{{ makeDynCall('iipp', 'callbackfunc') }}}(eventTypeId, JSEvents.mouseEvent, userData)) e.preventDefault();
531531
};
532532

533533
var eventHandler = {
@@ -635,7 +635,7 @@ var LibraryHTML5 = {
635635
if (targetThread) JSEvents.queueEventHandlerOnThread_iiii(targetThread, callbackfunc, eventTypeId, wheelEvent, userData);
636636
else
637637
#endif
638-
if ({{{ makeDynCall('iiii', 'callbackfunc') }}}(eventTypeId, wheelEvent, userData)) e.preventDefault();
638+
if ({{{ makeDynCall('iipp', 'callbackfunc') }}}(eventTypeId, wheelEvent, userData)) e.preventDefault();
639639
};
640640
#if MIN_IE_VERSION <= 8 || MIN_SAFARI_VERSION < 60100 // Browsers that do not support https://caniuse.com/#feat=mdn-api_wheelevent
641641
// The 'mousewheel' event as implemented in Safari 6.0.5
@@ -647,7 +647,7 @@ var LibraryHTML5 = {
647647
{{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaY, 'wheelDeltaY', 'double') }}};
648648
{{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaZ, '0 /* Not available */', 'double') }}};
649649
{{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaMode, '0 /* DOM_DELTA_PIXEL */', 'i32') }}};
650-
var shouldCancel = {{{ makeDynCall('iiii', 'callbackfunc') }}}( eventTypeId, JSEvents.wheelEvent, userData);
650+
var shouldCancel = {{{ makeDynCall('iipp', 'callbackfunc') }}}( eventTypeId, JSEvents.wheelEvent, userData);
651651
if (shouldCancel) {
652652
e.preventDefault();
653653
}

0 commit comments

Comments
 (0)