diff options
| author | Andre Weissflog <floooh@gmail.com> | 2019-07-28 18:21:38 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2019-07-28 18:21:38 +0200 |
| commit | 905f96aa36e0acfbb8dd9def19307730ecc85302 (patch) | |
| tree | 60505c00d7fb764759b5cde2b5b8b7693d267659 /sokol_gfx.h | |
| parent | e734ef4021ef77f1e687e8a5c50f5fe3f5b89b50 (diff) | |
sokol_gfx: fix ETC2 detection on WebGL2
Diffstat (limited to 'sokol_gfx.h')
| -rw-r--r-- | sokol_gfx.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h index a7e3cc5e..7fa488e2 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -4436,6 +4436,11 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { bool has_rgtc = false; /* BC4 and BC5 */ bool has_bptc = false; /* BC6H and BC7 */ bool has_pvrtc = false; + #if defined(__EMSCRIPTEN__) + bool has_etc2 = false; + #else + bool has_etc2 = true; + #endif bool has_bgra = false; bool has_colorbuffer_float = false; bool has_colorbuffer_half_float = false; @@ -4460,6 +4465,9 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { else if (strstr(ext, "_texture_compression_pvrtc")) { has_pvrtc = true; } + else if (strstr(ext, "_compressed_texture_etc")) { + has_etc2 = true; + } else if (strstr(ext, "_color_buffer_float")) { has_colorbuffer_float = true; } @@ -4482,7 +4490,7 @@ _SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { _sg_gl_init_limits(); /* pixel formats */ - const bool has_etc2 = true; + const bool has_texture_half_float_linear = true; _sg_gl_init_pixelformats(has_bgra, _sg.gl.gles2); _sg_gl_init_pixelformats_float(_sg.gl.gles2, has_colorbuffer_float, has_texture_float_linear); |