diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-20 16:05:42 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-20 16:05:42 -0700 |
commit | 6db9f86c1e92d2fc8aaa2e1e05c02778811f2c25 (patch) | |
tree | a0ec920054379e88591a9a7e2625cd1592720147 /tests/gles2_uniform_arrays.cpp | |
parent | 6ee65ab31f3671c0dc44a44291b8a8084971ae9d (diff) |
enable proxied version of test_gles2_uniform_arrays
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. |