File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -993,6 +993,11 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
993
993
994
994
var prevProgram = gl . getParameter ( 0x8B8D /*GL_CURRENT_PROGRAM*/ ) ;
995
995
gl . useProgram ( context . blitProgram ) ;
996
+ // If prevProgram was already marked for deletion, then, since it was
997
+ // still bound, it was not *actually* deleted. Binding a new program
998
+ // just now, thus, deleted the old one. This makes it impossible to
999
+ // restore. Hopefully the application didn't actually need it!
1000
+ if ( ! gl . isProgram ( prevProgram ) ) prevProgram = null ;
996
1001
997
1002
var prevVB = gl . getParameter ( 0x8894 /*GL_ARRAY_BUFFER_BINDING*/ ) ;
998
1003
gl . bindBuffer ( 0x8892 /*GL_ARRAY_BUFFER*/ , context . blitVB ) ;
Original file line number Diff line number Diff line change 5
5
* found in the LICENSE file.
6
6
*/
7
7
8
+ #include <assert.h>
8
9
#include <stdio.h>
9
10
#include <stdlib.h>
10
11
#include <emscripten/emscripten.h>
@@ -104,8 +105,13 @@ int main() {
104
105
glDrawArrays (GL_TRIANGLES , 0 , 3 );
105
106
106
107
#ifdef EXPLICIT_SWAP
108
+ // Mark the program for deletion, first, as a regression test for the state
109
+ // restoration. https://github.com/emscripten-core/emscripten/issues/23654
110
+ glDeleteProgram (program );
111
+
107
112
emscripten_webgl_commit_frame ();
108
113
#endif
109
114
115
+ assert (glGetError () == GL_NO_ERROR );
110
116
return 0 ;
111
117
}
You can’t perform that action at this time.
0 commit comments