@@ -20,7 +20,8 @@ var LibraryHtml5WebGL = {
20
20
return len ;
21
21
} ,
22
22
23
- $emscripten_webgl_power_preferences : "['default', 'low-power', 'high-performance']" ,
23
+ $webglPowerPreferences__internal : true ,
24
+ $webglPowerPreferences : [ 'default' , 'low-power' , 'high-performance' ] ,
24
25
25
26
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
26
27
// In offscreen framebuffer mode, we implement a proxied version of the
@@ -50,7 +51,7 @@ var LibraryHtml5WebGL = {
50
51
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
51
52
'emscripten_webgl_create_context_proxied' ,
52
53
#endif
53
- '$JSEvents' , '$emscripten_webgl_power_preferences ' , '$findEventTarget' , '$findCanvasEventTarget' ] ,
54
+ '$JSEvents' , '$webglPowerPreferences ' , '$findEventTarget' , '$findCanvasEventTarget' ] ,
54
55
// This function performs proxying manually, depending on the style of context that is to be created.
55
56
emscripten_webgl_do_create_context : ( target , attributes ) => {
56
57
#if ASSERTIONS
@@ -65,7 +66,7 @@ var LibraryHtml5WebGL = {
65
66
'antialias' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] ,
66
67
'premultipliedAlpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] ,
67
68
'preserveDrawingBuffer' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer } } } >> 2 ) ] ,
68
- 'powerPreference' : emscripten_webgl_power_preferences [ powerPreference ] ,
69
+ 'powerPreference' : webglPowerPreferences [ powerPreference ] ,
69
70
'failIfMajorPerformanceCaveat' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat } } } >> 2 ) ] ,
70
71
// The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
71
72
majorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] ,
@@ -252,7 +253,7 @@ var LibraryHtml5WebGL = {
252
253
} ,
253
254
254
255
emscripten_webgl_get_context_attributes__proxy : 'sync_on_webgl_context_handle_thread' ,
255
- emscripten_webgl_get_context_attributes__deps : [ '$emscripten_webgl_power_preferences ' ] ,
256
+ emscripten_webgl_get_context_attributes__deps : [ '$webglPowerPreferences ' ] ,
256
257
emscripten_webgl_get_context_attributes : ( c , a ) => {
257
258
if ( ! a ) return { { { cDefs . EMSCRIPTEN_RESULT_INVALID_PARAM } } } ;
258
259
c = GL . contexts [ c ] ;
@@ -267,7 +268,7 @@ var LibraryHtml5WebGL = {
267
268
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . antialias , 't.antialias' , 'i32' ) } } } ;
268
269
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha , 't.premultipliedAlpha' , 'i32' ) } } } ;
269
270
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer , 't.preserveDrawingBuffer' , 'i32' ) } } } ;
270
- var power = t [ 'powerPreference' ] && emscripten_webgl_power_preferences . indexOf ( t [ 'powerPreference' ] ) ;
271
+ var power = t [ 'powerPreference' ] && webglPowerPreferences . indexOf ( t [ 'powerPreference' ] ) ;
271
272
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference , 'power' , 'i32' ) } } } ;
272
273
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat , 't.failIfMajorPerformanceCaveat' , 'i32' ) } } } ;
273
274
{ { { makeSetValue ( 'a' , C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion , 'c.version' , 'i32' ) } } } ;
0 commit comments