gl-renderer: Assume fixed wireframe tex unit

The wireframe unit can only be used by the wireframe texture so
there's no need to bind it anymore before use.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit is contained in:
Loïc Molinari 2024-07-23 14:01:59 +02:00 committed by Daniel Stone
parent 69d4f66fab
commit b755345a46
2 changed files with 2 additions and 5 deletions

View File

@ -1812,6 +1812,7 @@ update_wireframe_tex(struct gl_renderer *gr,
if (new_size <= gr->wireframe_size)
return;
glActiveTexture(GL_TEXTURE0 + TEX_UNIT_WIREFRAME);
if (gr->wireframe_size == 0) {
glGenTextures(1, &gr->wireframe_tex);
glBindTexture(GL_TEXTURE_2D, gr->wireframe_tex);

View File

@ -765,12 +765,8 @@ gl_shader_load_config(struct gl_shader *shader,
break;
}
if (sconf->req.wireframe) {
assert(sconf->wireframe_tex != 0);
if (sconf->req.wireframe)
glUniform1i(shader->tex_uniform_wireframe, TEX_UNIT_WIREFRAME);
glActiveTexture(GL_TEXTURE0 + TEX_UNIT_WIREFRAME);
glBindTexture(GL_TEXTURE_2D, sconf->wireframe_tex);
}
}
bool