diff options
Diffstat (limited to 'tests/gles2_uniform_arrays.cpp')
-rw-r--r-- | tests/gles2_uniform_arrays.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/gles2_uniform_arrays.cpp b/tests/gles2_uniform_arrays.cpp index d1823b0b..0ae79c4a 100644 --- a/tests/gles2_uniform_arrays.cpp +++ b/tests/gles2_uniform_arrays.cpp @@ -4,6 +4,7 @@ #include <stdio.h> #include <string.h> #include <assert.h> +#include <emscripten.h> void RunTest(int testVariant) { @@ -95,13 +96,20 @@ void RunTest(int testVariant) glDrawArrays(GL_TRIANGLES, 0, 6); - unsigned char pixel[4]; - glReadPixels(1,1,1,1,GL_RGBA,GL_UNSIGNED_BYTE, pixel); - //printf("%d,%d,%d,%d\n", pixel[0], pixel[1], pixel[2], pixel[3]); - assert(pixel[0] == 255); - assert(pixel[1] == 178); - assert(pixel[2] == 102); - assert(pixel[3] == 255); + int in_worker = EM_ASM_INT_V({ + return typeof importScripts !== 'undefined' + }); + + if (!in_worker) { + printf("Doing readpixels check\n"); + unsigned char pixel[4]; + glReadPixels(1,1,1,1,GL_RGBA,GL_UNSIGNED_BYTE, pixel); + //printf("%d,%d,%d,%d\n", pixel[0], pixel[1], pixel[2], pixel[3]); + assert(pixel[0] == 255); + assert(pixel[1] == 178); + assert(pixel[2] == 102); + assert(pixel[3] == 255); + } printf("OK: Case %d passed.\n", testVariant); // Lazy, don't clean up afterwards. |