Codebase list wlroots / 6d3f3b9
render/gles2: unbind textures after use Keeping textures bound results in hard-to-debug situations where some GL operations incorrectly affect the texture. Simon Ser authored 4 years ago Drew DeVault committed 4 years ago
2 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
161161 glUniform1f(shader->alpha, alpha);
162162
163163 draw_quad();
164
165 glBindTexture(texture->target, 0);
164166
165167 POP_GLES2_DEBUG;
166168 return true;
7878 glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
7979 glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
8080
81 glBindTexture(GL_TEXTURE_2D, 0);
82
8183 POP_GLES2_DEBUG;
8284 return true;
8385 }
175177 glTexImage2D(GL_TEXTURE_2D, 0, fmt->gl_format, width, height, 0,
176178 fmt->gl_format, fmt->gl_type, data);
177179 glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0);
180
181 glBindTexture(GL_TEXTURE_2D, 0);
178182
179183 POP_GLES2_DEBUG;
180184 return &texture->wlr_texture;
230234 glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture->tex);
231235 gles2_procs.glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES,
232236 texture->image);
237 glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
233238
234239 POP_GLES2_DEBUG;
235240 return &texture->wlr_texture;
291296 glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture->tex);
292297 gles2_procs.glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES,
293298 texture->image);
299 glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
294300
295301 POP_GLES2_DEBUG;
296302 return &texture->wlr_texture;