gl-renderer: Avoid GL_ as a prefix for constants

Avoid prefixing constants with GL_ as it could be confused with OpenGL
constants.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit is contained in:
Loïc Molinari 2024-07-23 12:37:31 +02:00 committed by Daniel Stone
parent 8a9fba9827
commit 16390dbae1
3 changed files with 9 additions and 9 deletions

View File

@ -115,8 +115,8 @@ struct gl_shader;
struct weston_color_transform;
struct dmabuf_allocator;
#define GL_SHADER_INPUT_TEX_MAX 3
#define GL_SHADER_WIREFRAME_TEX_UNIT GL_SHADER_INPUT_TEX_MAX
#define SHADER_INPUT_TEX_MAX 3
#define SHADER_WIREFRAME_TEX_UNIT SHADER_INPUT_TEX_MAX
struct gl_shader_config {
struct gl_shader_requirements req;
@ -127,7 +127,7 @@ struct gl_shader_config {
GLfloat unicolor[4];
GLfloat tint[4];
GLint input_tex_filter; /* GL_NEAREST or GL_LINEAR */
GLuint input_tex[GL_SHADER_INPUT_TEX_MAX];
GLuint input_tex[SHADER_INPUT_TEX_MAX];
GLuint wireframe_tex;
union {

View File

@ -1198,10 +1198,10 @@ gl_shader_config_set_input_textures(struct gl_shader_config *sconf,
copy_uniform4f(sconf->unicolor, gb->color);
assert(gb->num_textures <= GL_SHADER_INPUT_TEX_MAX);
assert(gb->num_textures <= SHADER_INPUT_TEX_MAX);
for (i = 0; i < gb->num_textures; i++)
sconf->input_tex[i] = gb->textures[i];
for (; i < GL_SHADER_INPUT_TEX_MAX; i++)
for (; i < SHADER_INPUT_TEX_MAX; i++)
sconf->input_tex[i] = 0;
}

View File

@ -681,7 +681,7 @@ gl_shader_load_config(struct gl_shader *shader,
glUniform1f(shader->view_alpha_uniform, sconf->view_alpha);
in_tgt = gl_shader_texture_variant_get_target(sconf->req.variant);
for (i = 0; i < GL_SHADER_INPUT_TEX_MAX; i++) {
for (i = 0; i < SHADER_INPUT_TEX_MAX; i++) {
if (sconf->input_tex[i] == 0)
continue;
@ -695,7 +695,7 @@ gl_shader_load_config(struct gl_shader *shader,
}
/* Fixed texture unit for color_pre_curve LUT if it is available */
i = GL_SHADER_INPUT_TEX_MAX;
i = SHADER_INPUT_TEX_MAX;
switch (sconf->req.color_pre_curve) {
case SHADER_COLOR_CURVE_IDENTITY:
break;
@ -768,8 +768,8 @@ gl_shader_load_config(struct gl_shader *shader,
if (sconf->req.wireframe) {
assert(sconf->wireframe_tex != 0);
glUniform1i(shader->tex_uniform_wireframe, GL_SHADER_WIREFRAME_TEX_UNIT);
glActiveTexture(GL_TEXTURE0 + GL_SHADER_WIREFRAME_TEX_UNIT);
glUniform1i(shader->tex_uniform_wireframe, SHADER_WIREFRAME_TEX_UNIT);
glActiveTexture(GL_TEXTURE0 + SHADER_WIREFRAME_TEX_UNIT);
glBindTexture(GL_TEXTURE_2D, sconf->wireframe_tex);
}
}