@@ -45,7 +45,8 @@ var LibraryHtml5WebGL = {
45
45
#endif
46
46
} ,
47
47
48
- $emscripten_webgl_power_preferences : "['default', 'low-power', 'high-performance']" ,
48
+ $webglPowerPreferences__internal : true ,
49
+ $webglPowerPreferences : [ 'default ', 'low - power ', 'high - performance '] ,
49
50
50
51
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
51
52
// In offscreen framebuffer mode, we implement a proxied version of the
@@ -74,7 +75,7 @@ var LibraryHtml5WebGL = {
74
75
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
75
76
'emscripten_webgl_create_context_proxied' ,
76
77
#endif
77
- '$JSEvents' , '$emscripten_webgl_power_preferences ' , '$findEventTarget' , '$findCanvasEventTarget' ] ,
78
+ '$JSEvents' , '$webglPowerPreferences ' , '$findEventTarget' , '$findCanvasEventTarget' ] ,
78
79
// This function performs proxying manually, depending on the style of context that is to be created.
79
80
emscripten_webgl_do_create_context : ( target , attributes ) => {
80
81
#if ASSERTIONS
@@ -89,7 +90,7 @@ var LibraryHtml5WebGL = {
89
90
'antialias' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] ,
90
91
'premultipliedAlpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] ,
91
92
'preserveDrawingBuffer' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer } } } >> 2 ) ] ,
92
- 'powerPreference' : emscripten_webgl_power_preferences [ powerPreference ] ,
93
+ 'powerPreference' : webglPowerPreferences [ powerPreference ] ,
93
94
'failIfMajorPerformanceCaveat' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat } } } >> 2 ) ] ,
94
95
// The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
95
96
majorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] ,
@@ -276,7 +277,7 @@ var LibraryHtml5WebGL = {
276
277
} ,
277
278
278
279
emscripten_webgl_get_context_attributes__proxy : 'sync_on_webgl_context_handle_thread' ,
279
- emscripten_webgl_get_context_attributes__deps : [ '$emscripten_webgl_power_preferences ' ] ,
280
+ emscripten_webgl_get_context_attributes__deps : [ '$webglPowerPreferences ' ] ,
280
281
emscripten_webgl_get_context_attributes : ( c , a ) => {
281
282
if ( ! a ) return { { { cDefs . EMSCRIPTEN_RESULT_INVALID_PARAM } } } ;
282
283
c = GL . contexts [ c ] ;
@@ -291,7 +292,7 @@ var LibraryHtml5WebGL = {
291
292
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . antialias , 't.antialias' , 'i32' ) } } } ;
292
293
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha , 't.premultipliedAlpha' , 'i32' ) } } } ;
293
294
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer , 't.preserveDrawingBuffer' , 'i32' ) } } } ;
294
- var power = t [ 'powerPreference' ] && emscripten_webgl_power_preferences . indexOf ( t [ 'powerPreference' ] ) ;
295
+ var power = t [ 'powerPreference' ] && webglPowerPreferences . indexOf ( t [ 'powerPreference' ] ) ;
295
296
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference , 'power' , 'i32' ) } } } ;
296
297
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat , 't.failIfMajorPerformanceCaveat' , 'i32' ) } } } ;
297
298
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion , 'c.version' , 'i32' ) } } } ;
0 commit comments