diff options
| author | Andre Weissflog <floooh@gmail.com> | 2019-05-15 20:24:37 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2019-05-15 20:24:37 +0200 |
| commit | b0ad2e9426bcfeb24bca912757f509dfcc0a5c6e (patch) | |
| tree | 626a25893f2228c40161f17f6c1685a339da71f3 | |
| parent | e6283fea8214d06d4143df99a5446d218bb5a2f2 (diff) | |
fix a texture binding bug for GLES2/WebGL in the new clear-bind-slot code
| -rw-r--r-- | sokol_gfx.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h index 4f3376b7..48fa3f3d 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -2,6 +2,8 @@ /* sokol_gfx.h -- simple 3D API wrapper + Project URL: https://github.com/floooh/sokol + Do this: #define SOKOL_IMPL before you include this file in *one* C or C++ file to create the @@ -81,6 +83,10 @@ https://github.com/floooh/sokol-samples + For an optional shader-cross-compile solution, see: + + https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md + STEP BY STEP ============ @@ -3886,8 +3892,10 @@ _SOKOL_PRIVATE void _sg_gl_clear_texture_bindings(bool force) { glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_CUBE_MAP, 0); #if !defined(SOKOL_GLES2) - glBindTexture(GL_TEXTURE_3D, 0); - glBindTexture(GL_TEXTURE_2D_ARRAY, 0); + if (!_sg.gl.gles2) { + glBindTexture(GL_TEXTURE_3D, 0); + glBindTexture(GL_TEXTURE_2D_ARRAY, 0); + } #endif _sg.gl.cache.textures[i].target = 0; _sg.gl.cache.textures[i].texture = 0; |