@@ -30,12 +30,12 @@ var LibraryHtml5WebGL = {
3030 HEAP32 [ a + i ] = 0 ;
3131 }
3232
33- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } >> 2 ) ] =
34- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } >> 2 ) ] =
35- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] =
36- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] =
37- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] =
38- HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } >> 2 ) ] = 1 ;
33+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } ) ] =
34+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } ) ] =
35+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } ) ] =
36+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } ) ] =
37+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } ) ] =
38+ HEAP8 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } ) ] = 1 ;
3939
4040#if PTHREADS
4141 // Default context initialization state (user can override):
@@ -80,25 +80,25 @@ var LibraryHtml5WebGL = {
8080#if ASSERTIONS
8181 assert ( attributes ) ;
8282#endif
83- var a = attributes >> 2 ;
84- var powerPreference = HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference } } } >> 2 ) ] ;
83+ var powerPreference = { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . powerPreference , 'i32' ) } } } ;
8584 var contextAttributes = {
86- 'alpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . alpha } } } >> 2 ) ] ,
87- 'depth' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . depth } } } >> 2 ) ] ,
88- 'stencil' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . stencil } } } >> 2 ) ] ,
89- 'antialias' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . antialias } } } >> 2 ) ] ,
90- 'premultipliedAlpha' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha } } } >> 2 ) ] ,
91- 'preserveDrawingBuffer' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer } } } >> 2 ) ] ,
85+ 'alpha ': ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . alpha , 'i32' ) } } } ,
86+ 'depth' : ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . depth , ' i32 ' ) } } } ,
87+ 'stencil' : ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . stencil , ' i32 ' ) } } } ,
88+ 'antialias ': ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . antialias , ' i32 ' ) } } } ,
89+ 'premultipliedAlpha ': ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . premultipliedAlpha , ' i32 ' ) } } } ,
90+ 'preserveDrawingBuffer ': ! ! { { { makeGetValue ( ' attributes ' , C_STRUCTS . EmscriptenWebGLContextAttributes . preserveDrawingBuffer , ' i32 ' ) } } } ,
9291 'powerPreference ': emscripten_webgl_power_preferences [ powerPreference ] ,
93- 'failIfMajorPerformanceCaveat' : ! ! HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat } } } >> 2 ) ] ,
92+ 'failIfMajorPerformanceCaveat' : ! ! { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . failIfMajorPerformanceCaveat , 'i32' ) } } } ,
9493 // The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
95- majorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion } } } >> 2 ) ] ,
96- minorVersion : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . minorVersion } } } >> 2 ) ] ,
97- enableExtensionsByDefault : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault } } } >> 2 ) ] ,
98- explicitSwapControl : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . explicitSwapControl } } } >> 2 ) ] ,
99- proxyContextToMainThread : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . proxyContextToMainThread } } } >> 2 ) ] ,
100- renderViaOffscreenBackBuffer : HEAP32 [ a + ( { { { C_STRUCTS . EmscriptenWebGLContextAttributes . renderViaOffscreenBackBuffer } } } >> 2 ) ]
94+ majorVersion : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . majorVersion , 'i32' ) } } } ,
95+ minorVersion : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . minorVersion , 'i32' ) } } } ,
96+ enableExtensionsByDefault : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . enableExtensionsByDefault , 'i32' ) } } } ,
97+ explicitSwapControl : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . explicitSwapControl , 'i32' ) } } } ,
98+ proxyContextToMainThread : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . proxyContextToMainThread , 'i32' ) } } } ,
99+ renderViaOffscreenBackBuffer : { { { makeGetValue ( 'attributes' , C_STRUCTS . EmscriptenWebGLContextAttributes . renderViaOffscreenBackBuffer , 'i32' ) } } }
101100 } ;
101+ err ( contextAttributes ) ;
102102
103103 var canvas = findCanvasEventTarget ( target ) ;
104104
0 commit comments